*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 400 1rem/1.4 var(--font); }
button { font: inherit; color: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 8px; }
.top h1 { margin: 0; font: 700 1.45rem/1.1 var(--font-cond); letter-spacing: 0.005em; }
.lang { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); cursor: pointer; }

.banner { margin: 0 16px 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; background: var(--sev-3); color: var(--sev-3-on); font-weight: 600; }
.banner.warn { background: var(--sev-1); color: var(--sev-1-on); }
.banner[hidden], .warnings[hidden] { display: none; }
.banner .sevi { flex: none; width: 24px; height: 24px; }
.banner .sevi .shape { fill: currentColor; }
.banner .sevi .mark { stroke: var(--sev-3); } .banner .sevi .mark-fill { fill: var(--sev-3); }
.banner.warn .sevi .mark { stroke: var(--sev-1); } .banner.warn .sevi .mark-fill { fill: var(--sev-1); }

.warnings { display: flex; flex-direction: column; gap: 8px; margin: 0 16px 10px; }
.wchip { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; font-weight: 600; }
.wchip .sevi { flex: none; width: 24px; height: 24px; margin-top: 1px; }
.wchip .sevi .shape { fill: currentColor; }
.wchip.yellow { background: var(--sev-1); color: var(--sev-1-on); }
.wchip.orange { background: var(--sev-2); color: var(--sev-2-on); }
.wchip.red { background: var(--sev-3); color: var(--sev-3-on); }
.wchip.yellow .sevi .mark { stroke: var(--sev-1); } .wchip.yellow .sevi .mark-fill { fill: var(--sev-1); }
.wchip.orange .sevi .mark { stroke: var(--sev-2); } .wchip.orange .sevi .mark-fill { fill: var(--sev-2); }
.wchip.red .sevi .mark { stroke: var(--sev-3); } .wchip.red .sevi .mark-fill { fill: var(--sev-3); }
.wchip small { display: block; font-weight: 500; opacity: 0.9; }
body[data-tab='map'] .warnings { flex-direction: row; overflow-x: auto; margin-bottom: 6px; }
body[data-tab='map'] .wchip { flex: none; padding: 6px 10px; }
body[data-tab='map'] .wchip small { display: none; }

.views { flex: 1; min-height: 0; position: relative; }
.view { display: none; position: absolute; inset: 0; overflow-y: auto; padding: 0 16px 24px; -webkit-overflow-scrolling: touch; }
body[data-tab='routes'] #view-routes, body[data-tab='about'] #view-about { display: block; }
body[data-tab='map'] #view-map { display: block; padding: 0; overflow: hidden; }

.fresh { margin: 0 0 10px; color: var(--ink-2); font-size: 0.9rem; }
.grp { margin: 18px 0 8px; font-size: 0.95rem; font-weight: 600; color: var(--ink-2); }

.card { background: var(--surface); border-radius: 12px; border-left: 6px solid var(--sev-n); margin-bottom: 10px; overflow: hidden; }
.card.sev-0 { border-left-color: var(--sev-0); } .card.sev-1 { border-left-color: var(--sev-1); }
.card.sev-2 { border-left-color: var(--sev-2); } .card.sev-3 { border-left-color: var(--sev-3); }
.card .head { display: grid; grid-template-columns: 32px 1fr auto 44px; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 8px 4px 8px 10px; border: 0; background: none; text-align: left; cursor: pointer; }
.card .head .sevi { width: 30px; height: 30px; }
.card .nm b { display: block; font: 600 1.25rem/1.15 var(--font-cond); }
.card .nm span { display: block; color: var(--ink-2); font-size: 0.9rem; }
.card .gust { display: flex; align-items: center; gap: 6px; font: 700 1.6rem/1 var(--font-cond); }
.card .gust svg { width: 28px; height: 28px; }
.card .gust small { font: 500 0.7rem var(--font); color: var(--ink-3); }
.card .chev { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); transition: transform 0.2s; }
.card[data-open='true'] .chev { transform: rotate(180deg); }
.m-wind .w-bg { fill: var(--surface); stroke: #7b868d; stroke-width: 2; } .m-wind .w-arrow { fill: #8a959c; }
.m-wind.lv-1 .w-bg { stroke: var(--sev-1); } .m-wind.lv-1 .w-arrow { fill: var(--sev-1); }
.m-wind.lv-2 .w-bg { stroke: var(--sev-2); } .m-wind.lv-2 .w-arrow { fill: var(--sev-2); }
.m-wind.lv-3 .w-bg { fill: var(--sev-3); stroke: #ffd9d9; } .m-wind.lv-3 .w-arrow { fill: #fff; }
.m-wind.lv-n .w-bg { stroke-dasharray: 3 3; }

.detail { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.detail[hidden] { display: none; }
.detail h3 { margin: 14px 0 6px; font-size: 0.95rem; font-weight: 600; color: var(--ink-2); }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.issues li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.issues .sevi { width: 22px; height: 22px; margin-top: 1px; }
.issues small { display: block; color: var(--ink-2); }
.strip { display: grid; grid-template-columns: repeat(25, 1fr); gap: 2px; align-items: end; height: 56px; }
.strip i { display: block; border-radius: 2px 2px 0 0; background: #3a464e; }
.strip i.lv-0 { height: 28%; } .strip i.lv-1 { height: 52%; background: var(--sev-1); }
.strip i.lv-2 { height: 76%; background: var(--sev-2); } .strip i.lv-3 { height: 100%; background: var(--sev-3); }
.strip i.lv-n { height: 14%; background: transparent; border: 1px dashed var(--ink-3); }
.stripaxis { position: relative; height: 1.2rem; font-size: 0.78rem; color: var(--ink-3); }
.stripaxis span { position: absolute; transform: translateX(-50%); }
.stripaxis span:first-child { transform: none; } .stripaxis span:last-child { transform: translateX(-100%); }
.peak { margin: 6px 0 0; font-weight: 500; }
.obs { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--ink-2); font-size: 0.92rem; }
.obs b { color: var(--ink); font-weight: 600; }
.tblwrap { overflow-x: auto; }
.tbl { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--ink-3); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.btn[aria-pressed='true'] { border-color: var(--accent); }

/* Map tab */
.mapview svg.rw-map { position: absolute; inset: 0; }
.hours { position: absolute; left: 12px; right: 64px; top: 8px; display: flex; gap: 6px; overflow-x: auto; }
.hours button { flex: none; min-height: 44px; min-width: 52px; padding: 0 12px; border-radius: 22px; border: 1px solid #2d373e; background: rgb(12 16 19 / 0.88); color: #f3f5f6; cursor: pointer; font-weight: 600; }
.hours button[aria-pressed='true'] { background: #f3f5f6; color: #0c1013; }
.zoom { position: absolute; right: 12px; top: 8px; display: grid; gap: 6px; }
.zoom button { width: 44px; height: 44px; border-radius: 22px; border: 1px solid #2d373e; background: rgb(12 16 19 / 0.88); color: #f3f5f6; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px 18px; background: var(--surface); border-radius: 16px 16px 0 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgb(0 0 0 / 0.35); }
.sheet .row1 { display: flex; align-items: center; gap: 12px; }
.sheet .row1 .sevi { width: 30px; height: 30px; flex: none; }
.sheet b { font: 600 1.25rem/1.15 var(--font-cond); display: block; }
.sheet span.sub { color: var(--ink-2); font-size: 0.92rem; }
.sheet .more { margin-top: 10px; }
.sheet p { margin: 0; color: var(--ink-2); }

/* About */
.about h2 { margin: 18px 0 8px; font: 700 1.3rem var(--font-cond); }
.about p { margin: 0 0 10px; color: var(--ink-2); max-width: 60ch; }
.fresh-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fresh-list li { display: flex; align-items: center; gap: 10px; }
.fresh-list .sevi { width: 22px; height: 22px; }
.credit { font-size: 0.85rem; color: var(--ink-3); }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { min-height: 56px; border: 0; background: none; color: var(--ink-3); font-weight: 600; cursor: pointer; }
.tabs button[aria-selected='true'] { color: var(--ink); box-shadow: inset 0 3px 0 var(--accent); }

button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .card .chev { transition: none; } }
@media (min-width: 720px) { .view { padding-left: max(16px, calc(50% - 360px)); padding-right: max(16px, calc(50% - 360px)); } }

#view-routes .warnings { margin-left: 0; margin-right: 0; }

.tbl th { font-size: 0.74rem; line-height: 1.15; vertical-align: bottom; overflow-wrap: anywhere; }
.tbl th:nth-child(1) { width: 17%; } .tbl th:nth-child(2), .tbl th:nth-child(3), .tbl th:nth-child(4) { width: 13%; } .tbl th:nth-child(5) { width: 18%; } .tbl th:nth-child(6) { width: 26%; }
.tbl td:last-child { overflow-wrap: anywhere; }
.tbl th, .tbl td { vertical-align: middle; }
