/* ヤマチョウシ ─ 週間ページ（トップ・/weather/・/weather/{地方}/）（2026-10-07）
   ==========================================================================
   list.css（weather.css・matrix.css を @import）の上に重ねる。
   ★ 表とカードは同じ1つの表。700px 以下は CSS で1山＝1カード（右上に日程の合計、下に7日の帯）に組み替える。
   ★ 列見出し・山名・日程の合計は sticky（横スクロールでも「どの日のどのモデルか」が読める）。
   ★ 色は日の合計・日程の合計の段階（w0〜w5。list_site.WEEK_STEPS）。値は必ずセルに書く（可視ラベル併記）。
   ========================================================================== */

/* ---------- 色（日の合計・日程の合計）---------- */
.w0{background:var(--mm0)}.w1{background:var(--p1)}.w2{background:var(--p2)}
.w3{background:var(--p3)}.w4{background:var(--p4)}.w5{background:var(--p6)}
.w4,.w5{color:var(--on-light)}
:root[data-theme="dark"] .w5{color:var(--on-dark)}

.lnl{font-size:12px;color:var(--text-muted);align-self:center;margin-right:2px}

/* ---------- 日程と絞り込み ---------- */
.wkp{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.wkp[hidden]{display:none}
.wkl{font-size:12.5px;font-weight:800;color:var(--text-secondary)}
.wkl .hint{font-weight:600;color:var(--warn);margin-left:6px}
.wkdates{display:flex;gap:5px;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:3px}
.wkdates button{flex:0 0 auto;min-width:54px;min-height:48px;display:flex;flex-direction:column;align-items:center;
 justify-content:center;gap:1px;border:1px solid var(--line-strong);background:var(--surface-1);color:var(--text-primary);
 border-radius:8px;padding:3px 7px;font:inherit;cursor:pointer;font-variant-numeric:tabular-nums}
.wkdates button b{font-size:13px;line-height:1.2}
.wkdates button i{font-style:normal;font-size:10.5px;color:var(--text-secondary);line-height:1.2;white-space:nowrap}
.wkdates button.sat i{color:var(--rock)}
.wkdates button.sun i,.wkdates button.hol i{color:#c0392b}
.wkdates button.in{background:var(--surface-3)}
.wkdates button.on{background:var(--text-primary);border-color:var(--text-primary);color:var(--surface-1)}
.wkdates button.on i{color:var(--surface-1)}
.wkdates button:disabled{opacity:.45;border-style:dashed;cursor:not-allowed}
.wkrng{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:baseline;font-size:13.5px}
.wkk{background:var(--surface-3);border-radius:4px;padding:0 7px;font-size:11.5px;font-weight:800}
.wkm{font-size:11.5px;color:var(--text-muted)}
.wkdb,.wklb,.wkdet button{appearance:none;font:inherit;font-size:12px;font-weight:700;border:1px solid var(--line-strong);
 background:var(--surface-2);color:var(--text-secondary);border-radius:6px;padding:4px 10px;cursor:pointer;min-height:32px}
.wkdb[aria-expanded="true"]{background:var(--rock);border-color:var(--rock);color:#fff}
.wkdet{border:1px dashed var(--line-strong);border-radius:8px;padding:10px 12px;display:flex;flex-direction:column;gap:8px;font-size:12.5px}
.wkdet[hidden]{display:none}
.wkdet .r{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center}
.wkdet select{font:inherit;font-size:13px;padding:3px 4px;min-height:32px}
.wkdet .t{font-size:11px;font-weight:800;background:var(--surface-3);border-radius:3px;padding:0 5px}
.wkdet .s{font-size:11.5px;color:var(--text-muted)}
.wkreason{background:var(--warn-bg);border:1px solid var(--warn);color:var(--warn);border-radius:6px;padding:6px 10px;font-size:12.5px}
.wkreason[hidden]{display:none}
.wkf{display:flex;flex-direction:column;gap:7px}
.wkfg{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.wkfn{font-size:11.5px;font-weight:800;color:var(--text-muted);min-width:2.6em}
.wkfg .ck{display:inline-flex;align-items:center;gap:5px;min-height:34px;padding:0 9px;border:1px solid var(--line-strong);
 border-radius:6px;font-size:12.5px;font-weight:700;background:var(--surface-1)}
.wkfg .ck input{width:16px;height:16px;margin:0}
.wkfg .n{font-weight:400;opacity:.75;font-size:11px}
.wkfg button.sm{appearance:none;font:inherit;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--text-secondary);
 border-radius:6px;padding:4px 10px;font-size:12px;font-weight:700;cursor:pointer;min-height:32px}
.wkfg button.sm[aria-pressed="true"]{background:var(--rock);border-color:var(--rock);color:#fff}
.wks{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:12px;font-weight:800;color:var(--text-muted)}
.wks input{flex:1 1 220px;max-width:360px;min-height:36px;border:1px solid var(--line-strong);border-radius:6px;padding:0 10px;
 font:inherit;font-size:14px;background:var(--surface-1);color:var(--text-primary)}
.wkoth{font-size:12.5px;background:var(--surface-2);border-radius:6px;padding:7px 10px;display:flex;flex-direction:column;gap:3px}
.wkoth[hidden]{display:none}
.wkoth a{color:var(--rock);font-weight:700}
p.wkdef{font-size:13px;margin:10px 0 0;font-variant-numeric:tabular-nums}

/* ---------- 表 ---------- */
.wkbar{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:10px 0 4px}
.wkbar[hidden]{display:none}
.wkwrap{max-height:80vh;overflow:auto;margin-top:6px;border:1px solid var(--line);border-radius:8px}
table.wkt{border-collapse:separate;border-spacing:0;font-size:12.5px;background:var(--surface-1);font-variant-numeric:tabular-nums;width:100%}
table.wkt th,table.wkt td{padding:5px 7px;border-bottom:1px solid var(--line);white-space:nowrap}
table.wkt thead th{position:sticky;top:0;z-index:2;background:var(--surface-2);border-bottom:1px solid var(--line-strong);
 font-size:11.5px;font-weight:800;color:var(--text-secondary);vertical-align:bottom;text-align:center}
table.wkt thead th .hs{font-size:10px;font-weight:600;color:var(--text-muted);margin-top:2px}
table.wkt thead th.cd a,table.wkt thead th.cd summary{color:inherit;text-decoration:none;cursor:pointer}
table.wkt thead th.cd a:hover,table.wkt thead th.cd summary:hover{color:var(--rock);text-decoration:underline}
table.wkt thead th.sat a,table.wkt thead th.sat summary{color:var(--rock)}
table.wkt thead th.sun a,table.wkt thead th.sun summary,table.wkt thead th.hol a,table.wkt thead th.hol summary{color:#c0392b}
table.wkt thead th.cd{min-width:62px}
table.wkt thead th.cd.ss,table.wkt thead th.cd.sm,table.wkt thead th.cd.se{box-shadow:inset 0 -3px 0 var(--warn)}
.mc{display:inline-block;margin-top:3px;font-size:9.5px;font-weight:800;color:#fff;border-radius:3px;padding:0 5px}
.mc.m-msm{background:var(--msm)}.mc.m-gsm{background:var(--gsm)}.mc.m-lfm{background:var(--lfm)}
table.wkt th.cn{position:sticky;left:0;z-index:1;background:var(--surface-1);text-align:left;width:180px;min-width:180px;max-width:180px;
 white-space:normal;font-weight:700}
table.wkt thead th.cn{z-index:4;background:var(--surface-2)}
table.wkt th.cn a{color:inherit;text-decoration:none;font-size:13.5px}
table.wkt th.cn a:hover{color:var(--rock);text-decoration:underline}
table.wkt th.cn .sb{font-size:11px;font-weight:600;color:var(--text-secondary);margin-left:5px}
table.wkt th.cn .rg{display:block;font-size:10.5px;font-weight:600;color:var(--text-muted)}
.rk{font-style:normal;font-size:9.5px;font-weight:800;border:1px solid var(--line-strong);border-radius:3px;padding:0 3px;margin-right:4px;color:var(--text-secondary)}
.rk.r100{border-color:var(--text-primary);color:var(--text-primary)}
table.wkt .sh{display:inline-block;font-size:9.5px;font-weight:700;color:var(--gsm);border:1px solid var(--gsm);border-radius:3px;padding:0 4px;margin-right:4px}
table.wkt th.cn .bdg{margin-left:0}
table.wkt td{text-align:right;min-width:48px}
table.wkt td.ct{position:sticky;left:180px;z-index:1;font-weight:800;font-size:14px;border-right:2px solid var(--line-strong)}
table.wkt thead th.ct{left:180px;z-index:4;border-right:2px solid var(--line-strong)}
table.wkt .qn{border-bottom:1px dotted var(--warn);cursor:help}
table.wkt .qz{border-bottom:1px dotted var(--text-muted);cursor:help}
details.dd{display:inline-block;position:relative}
details.dd>summary{list-style:none}
details.dd>summary::-webkit-details-marker{display:none}
details.dd .pop{position:absolute;left:50%;transform:translateX(-50%);top:calc(100% + 4px);z-index:6;width:150px;white-space:normal;
 background:var(--surface-1);border:1px solid var(--line-strong);border-radius:8px;padding:8px 9px;box-shadow:0 8px 26px rgba(0,0,0,.18);text-align:left}
details.dd .pop b{display:block;font-size:11px;color:var(--text-secondary);margin-bottom:4px}
details.dd .pop a{display:inline-block;font-size:12px;margin:0 6px 4px 0;color:var(--rock)}
.wkempty{font-size:13px;color:var(--text-secondary);padding:12px;text-align:center}
.wkempty[hidden]{display:none}

/* JS が動くとき：既定で隠す行・8日目以降の列（week.js が切り替える）*/
.js table.wkt tbody tr.nd{display:none}
table.wkt tbody tr[hidden]{display:none}
.js table.wkt:not(.later) .lt{display:none}
.js table.wkt.later th.cd:not(.lt),.js table.wkt.later td.d:not(.lt){display:none}

/* ---------- 凡例 ---------- */
.legend{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;font-size:11.5px;color:var(--text-secondary);margin:10px 0 0}
.legend .lg{display:inline-flex;align-items:center;gap:4px}
.legend .sw{display:inline-block;width:16px;height:12px;border-radius:3px;border:1px solid var(--line)}

/* ---------- カード（700px 以下・1山＝1カード）---------- */
@media (max-width:700px){
  .wkwrap{max-height:none;overflow:visible;border:0}
  table.wkt,table.wkt tbody,table.wkt thead{display:block}
  table.wkt{background:none}
  table.wkt thead{position:sticky;top:0;z-index:5}
  table.wkt thead tr{display:grid;grid-template-columns:repeat(7,1fr);background:var(--surface-2);border-radius:8px}
  table.wkt thead th{position:static;padding:4px 1px;border:0;min-width:0}
  table.wkt thead th.cn,table.wkt thead th.ct{display:none}
  table.wkt thead th.cd{min-width:0;font-size:10.5px}
  table.wkt thead th.cd .hs{display:none}
  table.wkt thead th.cd .wd{display:block;font-size:9.5px}
  table.wkt thead th.cd details.dd,table.wkt thead th.cd>a{display:block}
  table.wkt thead th.cd .mc{display:block;width:max-content;margin:2px auto 0;font-size:9px;padding:0 3px}
  .wkfg{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:3px}
  .wkfg .ck,.wkfg button.sm{flex:0 0 auto;white-space:nowrap}
  table.wkt tbody tr{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;background:var(--surface-1);
   border:1px solid var(--line);border-radius:10px;padding:8px 8px 7px;margin:7px 0}
  table.wkt tbody th.cn{grid-column:1 / 6;position:static;min-width:0;max-width:none;border:0;padding:0 4px 4px 0;background:none}
  table.wkt tbody td.ct{grid-column:6 / 8;position:static;border:0;border-radius:7px;font-size:18px;text-align:center;align-self:start}
  table.wkt tbody td.d{min-width:0;border:0;border-radius:4px;padding:4px 1px;text-align:center;font-size:12.5px}
  .js table.wkt.later tbody td.d:not(.lt){display:none}
}
