:root {
  --bg: #edf2f6;
  --card: #ffffff;
  --ink: #101b26;
  --sub: #5b6b7a;
  --line: #d8e2ea;
  --brand: #007e95;
  --brand-soft: #d7eef3;
  --ok: #0a8f62;
  --ok-soft: #ddf2e9;
  --warn: #b56a00;
  --warn-soft: #fbeed3;
  --bad: #c22f2f;
  --bad-soft: #fbe3e0;
  --calm: #4a5a74;
  --calm-soft: #e4e9f2;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b131d;
    --card: #141f2c;
    --ink: #e9f1f8;
    --sub: #8fa1b3;
    --line: #21313f;
    --brand: #2fc6dd;
    --brand-soft: #0d2b33;
    --ok: #37cf95;
    --ok-soft: #0c2b21;
    --warn: #f5a63c;
    --warn-soft: #33240c;
    --bad: #ff6f61;
    --bad-soft: #38150f;
    --calm: #93a7c4;
    --calm-soft: #1a2432;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
a, button { touch-action: manipulation; }
button, .tabbar, .chip { -webkit-user-select: none; user-select: none; }

.sk {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 96px;
  animation: skpulse 1.2s ease-in-out infinite;
}
.sk.wide { grid-column: 1 / -1; min-height: 118px; }
@keyframes skpulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.9; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.5;
  padding: max(10px, env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin-inline: auto;
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
}
.tabbar-inner { max-width: 560px; margin-inline: auto; display: flex; }
.tabbar button {
  flex: 1; background: none; border: 0; cursor: pointer;
  color: var(--sub); font-size: 10.5px; font-weight: 800;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.on { color: var(--brand); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.brand-mark { width: 34px; height: 34px; display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; }
.wordmark { font-size: 19px; font-weight: 800; letter-spacing: 0.06em; }
.tagline { font-size: 10.5px; color: var(--sub); letter-spacing: 0.02em; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 4px; margin-bottom: 10px;
}
.seg button {
  border: 0; background: transparent; color: var(--sub);
  border-radius: 10px; padding: 9px 0; font-size: 13.5px; font-weight: 800; cursor: pointer;
}
.seg button.on { background: var(--brand); color: #fff; }

.region-line { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.region-line:first-child { border-top: 0; }
.region-line .rn { font-size: 12.5px; color: var(--sub); font-weight: 700; flex: none; width: 84px; }
.region-line .rv { font-size: 13.5px; font-weight: 800; }
.region-line .rv.ok { color: var(--ok); }
.region-line .rv.warn { color: var(--warn); }
.region-line .rv.bad { color: var(--bad); }

.stale {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.phase {
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.phase .p-icon { width: 34px; height: 34px; flex: none; }
.phase .p-title { font-size: 16.5px; font-weight: 800; margin: 0; }
.phase .p-sub { font-size: 12.5px; margin: 1px 0 0; opacity: 0.92; }
.phase.normal { background: var(--ok-soft); color: var(--ok); }
.phase.approach { background: var(--warn-soft); color: var(--warn); }
.phase.storm { background: var(--bad-soft); color: var(--bad); }
.phase.aftermath { background: var(--calm-soft); color: var(--calm); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  grid-column: span 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  text-decoration: none;
  color: inherit;
  display: block;
  min-height: 92px;
  position: relative;
}
.card.wide { grid-column: 1 / -1; min-height: 0; }
.card:active { transform: scale(0.985); }
.c-head { display: flex; align-items: center; gap: 7px; color: var(--sub); font-size: 12px; font-weight: 700; }
.c-head svg { width: 17px; height: 17px; flex: none; }
.c-line { font-size: 15.5px; font-weight: 800; margin: 6px 0 0; line-height: 1.35; }
.c-sub { font-size: 12px; color: var(--sub); margin: 3px 0 0; }
.card .go {
  position: absolute; right: 12px; top: 13px;
  width: 15px; height: 15px; color: var(--sub); opacity: 0.7;
}
.card.tone-ok .c-line { color: var(--ok); }
.card.tone-warn .c-line { color: var(--warn); }
.card.tone-bad .c-line { color: var(--bad); }
.big { font-size: 29px; letter-spacing: 0.01em; }

.linkrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.linkrow a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  background: transparent;
}
.linkrow a:active, .tabbar button:active, .seg button:active { transform: scale(0.95); }

.foot { margin-top: 14px; color: var(--sub); font-size: 10px; line-height: 1.6; opacity: 0.85; }
.foot p { margin: 0; }
.foot a { color: var(--sub); }
.updated { opacity: 0.8; }

.sheet {
  position: fixed; inset: 0;
  background: var(--bg);
  overflow-y: auto;
  z-index: 10;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
}
.sheet-body { max-width: 560px; margin-inline: auto; }
.sheet-title { font-size: 17px; font-weight: 800; margin: 0 0 4px; }
.sheet-sub { font-size: 12.5px; color: var(--sub); margin: 0 0 14px; }
.region-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.region-tabs button {
  border: 1px solid var(--line); background: var(--card); color: var(--sub);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.region-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.muni-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.muni-grid button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 12px; padding: 11px 4px; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.muni-grid button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.airport-row { display: flex; gap: 8px; flex-wrap: wrap; }
.airport-row button {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 9px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.airport-row button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-no { font-size: 11.5px; font-weight: 800; color: var(--brand); letter-spacing: 0.08em; margin: 0 0 6px; }
.airport-row button { padding: 14px 18px; font-size: 15px; }
.sheet-foot {
  position: sticky; bottom: 0;
  margin-top: 24px;
  padding: 12px 0 max(4px, env(safe-area-inset-bottom));
  background: var(--bg);
}
.primary {
  width: 100%;
  background: var(--brand); color: #fff; border: 0;
  border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 800; cursor: pointer;
}
.primary:disabled { opacity: 0.4; }
.ghost {
  width: 100%; margin-top: 8px;
  background: transparent; color: var(--sub); border: 0;
  padding: 10px; font-size: 13px; font-weight: 700; cursor: pointer;
}

@media (min-width: 470px) {
  .muni-grid { grid-template-columns: repeat(4, 1fr); }
}
