/* LITTLE WEATHER — 本館 */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1b1f24;
  --muted: #5d6673;
  --line: #d9dee5;
  --accent: #1f6fd1;
  --stale-bg: #b3261e;
  --stale-ink: #ffffff;
  --map-sea: #e9f0f7;
  --map-land: #d7dce2;
  --map-edge: #ffffff;
  --wx-sun: #f0a500;
  --wx-cloud: #9aa4b1;
  --wx-cloud-dark: #7b8591;
  --wx-rain: #2f74d0;
  --wx-snow: #ffffff;
  --wx-snow-edge: #6f9bd1;
  --fill-sun: #ffd98a;
  --fill-cloud: #c7ccd3;
  --fill-rain: #8fb4ea;
  --fill-snow: #e3eefc;
  --sev1: #f2c94c;
  --sev2: #e5484d;
  --sev3: #8e4ec6;
  --sev4: #2b1640;
  --sev-ink4: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317;
    --panel: #1a1d22;
    --ink: #e7eaee;
    --muted: #9aa3ae;
    --line: #2d333b;
    --accent: #6aa6ff;
    --map-sea: #0f1a26;
    --map-land: #3a414b;
    --map-edge: #1a1d22;
    --wx-cloud: #aab3bf;
    --wx-cloud-dark: #8a94a0;
    --wx-rain: #6aa6ff;
    --fill-sun: #8a6a1c;
    --fill-cloud: #535b66;
    --fill-rain: #2f5890;
    --fill-snow: #6d7f99;
    --sev4: #c9a7ff;
    --sev-ink4: #111317;
  }
}
:root[data-theme="dark"] {
  --bg: #111317;
  --panel: #1a1d22;
  --ink: #e7eaee;
  --muted: #9aa3ae;
  --line: #2d333b;
  --accent: #6aa6ff;
  --map-sea: #0f1a26;
  --map-land: #3a414b;
  --map-edge: #1a1d22;
  --fill-sun: #8a6a1c;
  --fill-cloud: #535b66;
  --fill-rain: #2f5890;
  --fill-snow: #6d7f99;
  --sev4: #c9a7ff;
  --sev-ink4: #111317;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent); }
.shell { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-header .shell { display: flex; align-items: center; gap: 12px; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: 0.06em; color: var(--ink); text-decoration: none; }
.site-header nav { margin-left: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.site-header nav a { text-decoration: none; }
#fullscreen-btn { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 6px; cursor: pointer; }

.stale-bar { background: var(--stale-bg); color: var(--stale-ink); padding: 10px 16px; font-weight: 700; text-align: center; }
.stale-bar a { color: var(--stale-ink); }
.alert-bar { background: var(--sev4); color: var(--sev-ink4); padding: 10px 16px; }
.alert-bar a { color: inherit; }

main { padding: 16px 0 40px; }
h1 { font-size: 22px; margin: 8px 0 4px; }
h2 { font-size: 18px; margin: 28px 0 8px; border-left: 4px solid var(--accent); padding-left: 8px; }
h3 { font-size: 16px; margin: 16px 0 6px; }
.lede { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.src { color: var(--muted); font-size: 12px; text-align: right; margin: 4px 0 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 16px; text-align: center; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tabs button {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 14px;
}
.tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.map-wrap { position: relative; }
#map { width: 100%; display: block; background: var(--map-sea); border-radius: 10px; touch-action: manipulation; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.popup {
  position: absolute; z-index: 5; max-width: min(320px, calc(100% - 16px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); font-size: 14px;
}
.popup .close { position: absolute; right: 6px; top: 2px; border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }

.region { margin-top: 18px; }
.office { border-top: 1px solid var(--line); padding: 10px 0; }
.office-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.office-head a { font-weight: 700; text-decoration: none; }
.area-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; }
.area-row .name { font-weight: 600; }
.area-row .text { color: var(--muted); font-size: 13px; }
.area-row .pop { font-size: 13px; color: var(--muted); white-space: nowrap; }
.temps { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.lo { color: #2f74d0; }
.hi { color: #d0452f; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.card .when { font-weight: 700; }
.card .wx { display: flex; gap: 8px; align-items: center; }
.card dl { margin: 6px 0 0; font-size: 13px; }
.card dt { color: var(--muted); float: left; clear: left; width: 2.5em; }
.card dd { margin: 0 0 2px 2.8em; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; background: var(--panel); }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; white-space: nowrap; }
table.grid th { background: var(--bg); font-weight: 600; }
table.grid td.left, table.grid th.left { text-align: left; }

.warn-list { list-style: none; padding: 0; margin: 0; }
.warn-list li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.sev { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 700; color: #111; }
.sev1 { background: var(--sev1); }
.sev2 { background: var(--sev2); color: #fff; }
.sev3 { background: var(--sev3); color: #fff; }
.sev4 { background: var(--sev4); color: var(--sev-ink4); }

.gaikyo { white-space: pre-wrap; font-size: 14px; }
.chart svg { width: 100%; height: auto; display: block; }

.site-footer { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12px; padding: 16px 0 28px; }
.site-footer p { margin: 4px 0; }

@media (max-width: 560px) {
  h1 { font-size: 19px; }
  .area-row { grid-template-columns: 34px 1fr; }
  .area-row .pop { grid-column: 2; }
}

/* 防災情報などの一覧と電文の表示 */
.tab-link { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); text-decoration: none; font-size: 14px; }
.tab-link[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; } #detail { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow: auto; } }
.bul-list { list-style: none; padding: 0; margin: 0; }
.bul-list li { border-bottom: 1px solid var(--line); }
.bul-list a { display: block; padding: 8px 4px; color: var(--ink); text-decoration: none; }
.bul-list a:hover { background: var(--panel); }
.snippet { font-size: 13px; color: var(--muted); }
.headline { font-weight: 600; margin: 6px 0 10px; white-space: pre-wrap; }
.structure { margin-top: 12px; }
.structure > summary, .node > summary { cursor: pointer; color: var(--muted); }
.node { margin-left: 12px; border-left: 1px dashed var(--line); padding-left: 8px; }
.kv { display: flex; gap: 8px; font-size: 13px; padding: 1px 0; flex-wrap: wrap; }
.kv .k { color: var(--muted); min-width: 7em; }
pre.json { font-size: 12px; overflow: auto; max-height: 50vh; background: var(--bg); padding: 8px; border-radius: 6px; }
.int { display: inline-block; min-width: 2.2em; border-radius: 4px; font-weight: 700; color: #111; }

/* 雨雲 */
.rain-controls { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.rain-controls input[type="range"] { flex: 1 1 200px; }
.rain-controls #play { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 4px 10px; cursor: pointer; }

/* ニュース */
.news-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.news-item p { margin: 4px 0; }
.news-head { font-size: 12px; }
.news-body { white-space: pre-wrap; }
.news-detail { font-size: 12px; }
.more { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 6px 14px; cursor: pointer; }
