:root {
  --bg: #f5f6f8; --panel: #ffffff; --panel-2: #f0f2f5; --panel-3: #e7eaef; --text: #141b26; --muted: #5b6676;
  --border: #dfe3e9; --border-strong: #c9d0da; --accent: #1d4ed8; --accent-2: #1e40af; --accent-soft: #e8efff;
  --brand: #1e3a8a; --magenta: #a21caf; --ok: #166534; --warn: #92400e; --err: #b91c1c; --on-accent: #ffffff;
  --warn-bg: #fff7e6; --warn-border: #f5d48a;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 20px rgba(16,24,40,.07);
  --shadow-lg: 0 10px 40px rgba(16,24,40,.16);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  --topbar-h: 57px;
  --fs-base: 14px; --fs-small: 12.5px; --fs-title: 22px; --fs-h3: 15px; --fs-lead: 14.5px;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --panel: #151b23; --panel-2: #1c232d; --panel-3: #252d39; --text: #e6e9ee; --muted: #93a0b0;
    --border: #29313c; --border-strong: #3a4452; --accent: #6ea8fe; --accent-2: #9ec5fe; --accent-soft: #1a2a46;
    --magenta: #e879f9; --warn-bg: #2a2110; --warn-border: #5c4512; --ok: #4ade80; --warn: #fbbf24; --err: #f87171; --on-accent: #0b1220;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --panel: #151b23; --panel-2: #1c232d; --panel-3: #252d39; --text: #e6e9ee; --muted: #93a0b0;
  --border: #29313c; --border-strong: #3a4452; --accent: #6ea8fe; --accent-2: #9ec5fe; --accent-soft: #1a2a46;
  --magenta: #e879f9; --warn-bg: #2a2110; --warn-border: #5c4512; --ok: #4ade80; --warn: #fbbf24; --err: #f87171; --on-accent: #0b1220;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { height: 100vh; height: 100dvh; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); font-feature-settings: "cv11", "ss01"; display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono, code, kbd { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3 { letter-spacing: -.01em; }

/* ---------------------------------------------------------------- top bar */
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--border); position: relative; z-index: 1100; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { display: block; border-radius: 7px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-text small { font-size: 11px; color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 2px; }
.tabs a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 550; white-space: nowrap; }
.tabs a:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--accent-soft); color: var(--accent); }
.search { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: 8px 34px 8px 34px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-2); color: var(--text); font: inherit; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--panel); }
.search .kbd { position: absolute; right: 9px; padding: 0 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); font-size: 11px; line-height: 17px; pointer-events: none; }
.search input:focus ~ .kbd, .search input:not(:placeholder-shown) ~ .kbd { display: none; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; }
.results a { display: block; padding: 8px 12px; color: var(--text); border-bottom: 1px solid var(--border); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a.sel { background: var(--accent-soft); text-decoration: none; }
.results .k { display: inline-block; min-width: 62px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.results .sub { display: block; color: var(--muted); font-size: 12px; margin-left: 66px; }
.results .none { padding: 14px 14px; color: var(--muted); cursor: default; }
.results .none b { color: var(--text); display: block; margin-bottom: 2px; }
.cycle { font: 500 12px var(--sans); color: var(--muted); white-space: nowrap; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; background: var(--panel); display: inline-flex; align-items: center; }
.cycle:hover { border-color: var(--border-strong); color: var(--text); }
.cycle .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 7px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.cycle .dot.warn { background: var(--warn); } .cycle .dot.err { background: var(--err); }
.cycle .short { display: none; }
.icon-btn { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 9px; width: 36px; height: 36px; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--panel-2); border-color: var(--border-strong); }
#theme .sun { display: none; }
:root[data-theme="dark"] #theme .sun { display: block; } :root[data-theme="dark"] #theme .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #theme .sun { display: block; } :root:not([data-theme="light"]) #theme .moon { display: none; } }

/* ---------------------------------------------------------------- notice + footer */
.notice { display: flex; align-items: center; gap: 12px; padding: 9px 18px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-border); color: var(--text); font-size: 13px; flex: none; position: relative; z-index: 1050; }
.notice[hidden] { display: none; }
.notice svg { color: var(--warn); flex: none; }
.notice p { margin: 0; flex: 1; }
.footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 18px; background: var(--panel); border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; flex: none; z-index: 1050; }
.footer .sp { flex: 1; }
.footer .sep { opacity: .5; }
.footer .nfn { color: var(--warn); font-weight: 600; }
.footer a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.footer a:hover { color: var(--text); }

main { flex: 1; min-height: 0; position: relative; }

/* ---------------------------------------------------------------- map */
#map { position: absolute; inset: 0; }
.layers { position: absolute; top: 12px; right: 12px; z-index: 1000; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); width: 256px; max-height: calc(100% - 52px); overflow: auto; font-size: 13px; }
.layers h4 { margin: 0; padding: 12px 14px 4px; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.layers label { display: flex; align-items: center; gap: 8px; padding: 4px 14px; cursor: pointer; }
.layers label:hover { background: var(--panel-2); }
.layers input[type=checkbox] { accent-color: var(--accent); margin: 0; }
.layers .sw { width: 14px; height: 14px; flex: none; display: grid; place-items: center; }
.layers .sw svg { display: block; }
.layers .hint { margin-left: auto; color: var(--muted); font-size: 10.5px; font-family: var(--mono); }
.layers select { margin: 4px 14px 8px; width: calc(100% - 28px); padding: 6px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; }
.layers .toggle { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; cursor: pointer; user-select: none; background: none; border: 0; width: 100%; color: var(--text); text-align: left; }
.layers.open .toggle { border-bottom: 1px solid var(--border); }
.layers .toggle .chev { transition: transform .15s; color: var(--muted); }
.layers.collapsed .toggle .chev { transform: rotate(180deg); }
.layers.collapsed { width: auto; }
.layers.collapsed .body { display: none; }
.layers .legend { padding: 4px 14px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 11.5px; color: var(--muted); }
.layers .legend span { display: flex; align-items: center; gap: 6px; }
.maphint { position: absolute; left: 12px; bottom: 22px; z-index: 1000; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); max-width: calc(100% - 24px); }
.leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: var(--shadow-lg); background: var(--panel); color: var(--text); }
.leaflet-popup-tip { background: var(--panel); }
.leaflet-popup-content { font: 13px/1.45 var(--sans); margin: 10px 14px; }
.leaflet-popup-content b { font-size: 14px; }
.leaflet-container { background: var(--panel-2); font: inherit; }
.leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--border); }
.leaflet-bar a:hover { background: var(--panel-2); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--panel) 80%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }
.lbl { background: transparent; border: 0; box-shadow: none; font: 600 10.5px var(--sans); color: #0f172a; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; padding: 0; }
:root[data-theme="dark"] .lbl { color: #e5e7eb; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lbl { color: #e5e7eb; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000; } }
.lbl::before { display: none; }
.dark-base .lbl { color: #f8fafc !important; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000 !important; }

/* ---------------------------------------------------------------- data browser */
.data { display: grid; grid-template-columns: 272px 1fr; height: 100%; }
.side { border-right: 1px solid var(--border); background: var(--panel); overflow: auto; padding: 10px 0 24px; }
.side input { margin: 4px 12px 8px; width: calc(100% - 24px); padding: 7px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; }
.side .ds { padding: 10px 14px 3px; font-weight: 650; font-size: 12.5px; display: flex; justify-content: space-between; }
.side .ds small { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 10.5px; }
.side a { display: flex; justify-content: space-between; padding: 4px 14px 4px 24px; color: var(--text); font-size: 13px; }
.side a small { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.side a:hover { background: var(--panel-2); text-decoration: none; }
.side a.active { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.tablewrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.tbar h2 { margin: 0 8px 0 0; font-size: 17px; }
.tbar h2 small { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 11.5px; margin-left: 8px; }
.tbar input { padding: 7px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); min-width: 220px; font: inherit; }
.btn { border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--panel-2); border-color: var(--border-strong); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.tbar .count { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.grid { flex: 1; overflow: auto; min-height: 0; background: var(--panel); }
table.t { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12.5px; }
table.t th, table.t td { padding: 5px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; background: var(--panel); }
table.t td.wrap { white-space: normal; min-width: 260px; }
table.t thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 2; font-weight: 600; font-size: 11.5px; cursor: pointer; user-select: none; vertical-align: bottom; }
table.t thead th .raw { display: block; font: 400 10px var(--mono); color: var(--muted); }
table.t thead tr.filters th { top: var(--head-h, 44px); padding: 4px; cursor: default; }
table.t thead tr.filters input { width: 100%; min-width: 60px; padding: 3px 6px; font-size: 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); color: var(--text); font-family: var(--sans); }
/* frozen first column */
table.t.freeze th:first-child, table.t.freeze td:first-child { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--border); box-shadow: 2px 0 4px rgba(0,0,0,.04); }
table.t.freeze thead th:first-child { z-index: 3; }
table.t tbody tr:hover td { background: var(--accent-soft); cursor: pointer; }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
table.t .null { color: var(--border-strong); }
th .arrow { color: var(--accent); margin-left: 4px; }
.pager { display: flex; gap: 8px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--border); background: var(--panel); }
.pager select { padding: 4px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.dsgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dscard { padding: 14px 16px; }
.dscard .h { display: flex; justify-content: space-between; align-items: baseline; }
.dscard .h span { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.dscard p { color: var(--muted); margin: 6px 0 10px; font-size: 13px; }
.dscard a { display: flex; justify-content: space-between; font-size: 13px; padding: 1px 0; }
.dscard a span:last-child { font-family: var(--mono); color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- drawer */
.drawer { position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: min(540px, 100%); background: var(--panel); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 1200; overflow: auto; padding: 16px 20px 30px; }
.drawer .close { float: right; }
.drawer h2 { margin-top: 0; }
.kv { display: grid; grid-template-columns: minmax(150px, 38%) 1fr; gap: 0; font-size: 13px; }
.kv > div { padding: 5px 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.kv:not(.wide) > div:nth-child(odd) { color: var(--muted); font-size: 12.5px; }
.kv:not(.wide) > div:nth-child(odd) small { font-size: 10.5px; opacity: .8; }
.kv.wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.kv.wide > div { display: flex; flex-direction: column; border: 0; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.kv.wide > div span:first-child { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.kv.wide > div span:last-child { font-weight: 500; }
.kv .raw { color: var(--muted); font-size: 11px; font-weight: 400; }

/* ---------------------------------------------------------------- detail */
.detail { height: 100%; overflow: auto; }
.dhead { display: grid; grid-template-columns: 1fr minmax(320px, 42%); gap: 0; background: var(--panel); border-bottom: 1px solid var(--border); }
.dhead .info { padding: 22px 26px 18px; min-width: 0; }
.dhead .kind { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); font-weight: 700; }
.dhead h1 { margin: 4px 0 4px; font-size: var(--fs-title); line-height: 1.25; font-weight: 700; }
.dhead .subtitle { color: var(--muted); }
.dhead .mini { min-height: 430px; border-left: 1px solid var(--border); }
/* Expand button: the same map over the whole screen (above the top bar and drawers) */
.dhead .mini.expanded { position: fixed !important; inset: 0; z-index: 1300; min-height: 0; border: 0; }  /* !important: Leaflet sets position inline */
.miniexp a { display: flex; align-items: center; justify-content: center; }
.miniexp a:hover, .miniexp a:focus { background: var(--panel-2); color: var(--text); }
/* Cards and action links go full width under the header row, so the map stays next to the title
   instead of stretching down the whole page. */
.dhead .dbody { grid-column: 1 / -1; padding: 0 26px 18px; min-width: 0; border-top: 1px solid var(--border); }
.dhead .dbody.nosum { padding-top: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 16px; }
.facts div { display: flex; flex-direction: column; }
.facts span:first-child { font-size: 11px; color: var(--muted); font-weight: 500; }
.facts span:last-child { font-weight: 600; font-size: 14px; }
.sumcard { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--panel); min-width: 0; }
.sumcard h4 { margin: 0 0 6px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; }
.sumcard h4 a { text-transform: none; letter-spacing: 0; font-weight: 500; }
.freqs { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 13px; }
.freqs .f { font-family: var(--mono); font-weight: 600; }
.freqs .n { color: var(--muted); font-size: 11.5px; }
.rwys { display: grid; gap: 2px; font-size: 13px; margin-top: 8px; }
.rwys div { display: flex; justify-content: space-between; gap: 10px; }
.rwys .id { font-family: var(--mono); font-weight: 600; }
.rwys .m { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.diag { display: flex; flex-direction: column; }
.diag svg { width: 100%; height: auto; display: block; max-width: 220px; margin: auto; }
.dtabs { display: flex; gap: 4px; padding: 0 26px; background: var(--panel); border-bottom: 1px solid var(--border); overflow-x: auto; position: sticky; top: 0; z-index: 5; }
.dtabs button { border: 0; background: none; padding: 11px 12px 10px; color: var(--muted); font-weight: 550; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.dtabs button small { font-family: var(--mono); font-size: 10.5px; margin-left: 5px; padding: 1px 6px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.dtabs button:hover { color: var(--text); }
.dtabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.dtabs button.active small { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chips a { padding: 4px 11px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 12.5px; }
.chips a small { color: var(--muted); margin-left: 4px; }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.chips.actions a { background: var(--panel); }
.sections { padding: 18px 26px 40px; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.card > h3 { margin: 0; padding: 11px 16px; font-size: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.card > h3 small { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 11px; }
.card > h3 .sp { flex: 1; }
.card > h3 a { font-size: 12px; font-weight: 500; }
.card .grid { max-height: 460px; }
.card .kv { padding: 4px 6px; }
.empty { padding: 60px 24px; text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto; }
.empty h2 { color: var(--text); }

/* ---------------------------------------------------------------- API + about pages */
.page { height: 100%; overflow: auto; }
/* API, About, Changes and Data overview share one layout and type scale */
.api, .prose { max-width: 960px; margin: 0 auto; padding: 24px 26px 48px; font-size: var(--fs-base); line-height: 1.55; }
.api h2, .prose h2 { font-size: var(--fs-title); line-height: 1.25; font-weight: 700; margin: 0 0 6px; }
.api h3, .prose h3 { font-size: var(--fs-h3); font-weight: 650; margin: 26px 0 8px; }
.api .lead, .prose .lead { color: var(--muted); font-size: var(--fs-lead); margin: 0 0 18px; }
.api pre { background: var(--panel-2); border: 1px solid var(--border); padding: 10px 12px; border-radius: 8px; overflow: auto; font-size: 12.5px; margin: 6px 0 0; position: relative; }
.api pre .copy { position: absolute; top: 6px; right: 6px; }
.ep { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; }
.ep .sig { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 13px; font-weight: 600; }
.ep .m { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: #dcfce7; color: #166534; }
.ep .m.post { background: #fef3c7; color: #92400e; }
.ep p { margin: 6px 0 4px; color: var(--muted); }
.ep details { margin-top: 6px; }
.ep summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
.callout { border: 1px solid var(--border); background: var(--panel-2); border-radius: 10px; padding: 12px 14px; margin: 16px 0; font-size: var(--fs-base); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.callout h4 { margin: 0 0 4px; }
.callout p { margin: 4px 0; }
.prose p { margin: 0 0 10px; }
.prose ul { padding-left: 20px; margin: 0 0 10px; }
.prose li { margin: 4px 0; }

.toast { position: fixed; bottom: 48px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 9px; z-index: 2000; font-size: 13px; box-shadow: var(--shadow-lg); }


/* ---------------------------------------------------------------- airport extras */
.muted { color: var(--muted); }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "a b c"; gap: 14px; margin-top: 18px; align-items: start; }
.summary .col { display: grid; gap: 14px; min-width: 0; }
.summary .ca { grid-area: a; } .summary .cb { grid-area: b; } .summary .cc { grid-area: c; }
.wx .wxtop { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; font-size: 12.5px; }
.fcat { font: 700 12px var(--sans); letter-spacing: .04em; padding: 3px 9px; border-radius: 6px; color: #fff; }
.fcat-vfr { background: #15803d; } .fcat-mvfr { background: #1d4ed8; } .fcat-ifr { background: #dc2626; } .fcat-lifr { background: #a21caf; }
.wxgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 14px; font-size: 13px; }
.wxgrid div { display: flex; flex-direction: column; }
.wxgrid span { font-size: 11px; color: var(--muted); }
.wxgrid b { font-weight: 600; }
.wx pre.raw { font-size: 11.5px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; margin: 10px 0 0; white-space: pre-wrap; word-break: break-word; }
.wx details { margin-top: 8px; font-size: 12.5px; }
.wx summary { cursor: pointer; color: var(--accent); }
.wxnote { font-size: 12.5px; background: var(--panel-2); border-radius: 7px; padding: 5px 9px; margin-bottom: 8px; }
.wxnote.wxstale { border-left: 3px solid #d98e04; }
.wxfoot { font-size: 10.5px; color: var(--muted); margin-top: 8px; }
.qlinks { display: grid; gap: 2px; font-size: 13px; }
.qlinks a { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px; padding: 3px 0; }
.qlinks a small { color: var(--muted); font-size: 11px; text-align: right; }
.qlinks a small::after { content: " ↗"; }
.near { display: grid; gap: 2px; font-size: 13px; }
.near a { display: flex; justify-content: space-between; gap: 8px; color: var(--text); padding: 3px 0; border-bottom: 1px solid var(--border); }
.near a:last-child { border-bottom: 0; }
.near a:hover { color: var(--accent); text-decoration: none; }
.near a > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near .m { color: var(--muted); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }


/* ---------------------------------------------------------------- official FAA charts */
.apdview { display: block; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.apdview canvas { display: none; width: 100%; height: auto; }
.apdview canvas.ready { display: block; }
.apdview .sk.block { display: block; height: 380px; border-radius: 0; }
.apdview:hover { border-color: var(--accent); }
.apdnote { font-size: 11px; color: var(--muted); margin-top: 6px; }
.chartcard h3 small { font-family: var(--sans); }
.chartnote { padding: 10px 16px; font-size: 12.5px; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--border); }
.cgroup { padding: 10px 16px 12px; border-bottom: 1px solid var(--border); }
.cgroup:last-child { border-bottom: 0; }
.cgroup h4 { margin: 0 0 6px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cgroup h4 small { font-family: var(--mono); margin-left: 4px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 18px; }
.cgrid a { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: var(--fs-base); }
.cgrid a::before { content: ""; width: 14px; height: 16px; flex: none; border-radius: 2px; background: linear-gradient(135deg, transparent 70%, var(--border-strong) 70%), var(--panel-2); border: 1px solid var(--border-strong); }
.cgrid i { font-style: normal; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; padding: 1px 5px; border-radius: 4px; }
.cgrid i.new { background: #dcfce7; color: #166534; } .cgrid i.chg2 { background: #fef3c7; color: #92400e; }

/* ---------------------------------------------------------------- map tools */
.map-tools a { display: grid !important; place-items: center; }
.map-tools a.on { background: #f59e0b !important; color: #1f2937 !important; }
.measuring, .measuring .leaflet-interactive { cursor: crosshair !important; }
.measure-tip { font: 600 11.5px var(--sans); }

/* ---------------------------------------------------------------- changes page */
.ctiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 12px; }
.ctile { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); }
.ctile:hover, .ctile.on { border-color: var(--accent); text-decoration: none; }
.ctile.on { background: var(--accent-soft); }
.ctile span { display: flex; gap: 8px; font-family: var(--mono); font-size: 12px; }
.ctile i { font-style: normal; }
.add { color: var(--ok); } .rem { color: var(--err); } .mod { color: var(--warn); }
.cfilter { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.changes .card { margin-bottom: 14px; }
.clist { max-height: 520px; overflow: auto; }
.crow { padding: 6px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.crow:last-child { border-bottom: 0; }
.crow .tag { display: inline-block; min-width: 64px; font: 600 10px var(--sans); text-transform: uppercase; letter-spacing: .05em; }
.crow.added .tag { color: var(--ok); } .crow.removed .tag { color: var(--err); } .crow.changed .tag { color: var(--warn); }
.cdet { margin: 3px 0 0 68px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cdet s { color: var(--err); } .cdet b { color: var(--text); font-weight: 600; }
.lbl2 { color: var(--muted); }

/* ---------------------------------------------------------------- feedback form */
.fb { display: grid; gap: 12px; max-width: 560px; }
.fb label { display: grid; gap: 4px; font-size: var(--fs-base); font-weight: 500; }
.fb textarea, .fb input { font: inherit; font-size: var(--fs-base); padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text); }
.fb .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.changelog li { margin: 6px 0; }


/* ---------------------------------------------------------------- favourites, route, states */
.star { margin-left: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 1px 9px; font: 600 11px var(--sans); letter-spacing: 0; text-transform: none; cursor: pointer; vertical-align: 1px; }
.star:hover { border-color: var(--accent); color: var(--accent); }
.star.on { color: #b45309; border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, var(--panel)); }
.routeform { display: flex; gap: 8px; margin: 0 0 16px; }
.routeform input, .sfilter { flex: 1; font: 500 15px var(--mono); padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--panel); color: var(--text); }
.sfilter { font-family: var(--sans); font-size: var(--fs-base); width: 100%; margin: 0 0 12px; }
.routesum { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.routesum .sp { flex: 1; }
.routemap { height: 380px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.stategrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.stategrid a { display: flex; justify-content: space-between; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--text); }
.stategrid a:hover { border-color: var(--accent); text-decoration: none; }
.stategrid span { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* ---------------------------------------------------------------- kneeboard printing */
@media print {
  @page { margin: 12mm; }
  body { height: auto; overflow: visible; display: block; background: #fff; color: #000; }
  .topbar, .notice, .footer, .dtabs, .sections, .mini, .chips, .star, #nearcard, .toast, .drawer, .qlinks, .sumcard:has(.qlinks) { display: none !important; }
  main, .detail, .page { height: auto !important; overflow: visible !important; }
  .dhead { display: block; border: 0; }
  .dhead .info, .dhead .dbody { padding: 0; border: 0; }
  .summary { grid-template-columns: 1fr 1fr !important; grid-template-areas: "a c" "b c" !important; grid-template-rows: auto 1fr !important; }
  .sumcard { break-inside: avoid; border-color: #999; }
  .apdview { border-color: #999; }
  .detail::after { content: "Printed from shijo.com. FAA data, not for navigation. Check charts are current."; display: block; margin-top: 8mm; font-size: 9pt; color: #444; }
}

/* ---------------------------------------------------------------- loading skeletons */
.skel { padding: 22px 26px; display: grid; gap: 12px; }
.sk { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 6px; height: 14px; }
.sk.h1 { height: 26px; width: 55%; } .sk.w30 { width: 30%; } .sk.w70 { width: 70%; } .sk.w90 { width: 90%; }
.sk.block { height: 140px; border-radius: 12px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .cycle .long { display: none; } .cycle .short { display: inline; }
  .brand-text small { display: none; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .brand-text b { font-size: 14px; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .search .kbd { display: none; }
  .cycle { margin-left: auto; }
  .tabs a { padding: 6px 9px; }
  .notice { padding: 8px 12px; font-size: 12.5px; flex-wrap: wrap; }
  .footer { padding: 5px 12px; font-size: 11px; gap: 6px; }
  .footer .hide-sm { display: none; }
  .data { grid-template-columns: 1fr; grid-template-rows: 170px 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--border); }
  .dhead h1, .api h2, .prose h2 { font-size: 20px; }
  .dtabs { padding: 0 10px; }
  .sections { padding: 12px; }
  .api, .prose { padding: 18px 16px 40px; }
}
/* phones: detail pages go to one column. iPads in portrait (768-834px) stay above this,
   so they keep the map beside the title and two card columns. */
@media (max-width: 700px) {
  .dhead { grid-template-columns: 1fr; }
  .dhead .info { padding: 18px 16px 14px; }
  .dhead .mini { border-left: 0; border-top: 1px solid var(--border); min-height: 280px; order: 3; }
  .dhead .dbody { padding: 0 16px 14px; border-top: 0; }
}
.nt-short { display: none; }
@media (max-width: 767px) {
  .nt-long { display: none; } .nt-short { display: inline; }
  .notice { flex-wrap: nowrap; align-items: flex-start; }
  .notice svg { margin-top: 2px; }
  .topbar { gap: 8px 6px; }
  .tabs { order: 0; }
  .tabs a { padding: 6px 7px; }
  .cycle { padding: 4px 9px; }
  .icon-btn { width: 34px; height: 34px; }
  .footer .src, .footer .fc { display: none; }
  .tabs .t-about, .tabs .t-api { display: none; }
  .tabs .t-long { display: none; }
  .routeform { flex-direction: column; }
  .routemap { height: 280px; }
  .cdet { margin-left: 0; }
  /* layers panel becomes a bottom sheet */
  .layers { top: auto; right: 10px; left: auto; bottom: 10px; width: auto; max-height: 62%; }
  .layers.open { left: 10px; right: 10px; border-radius: 14px; box-shadow: var(--shadow-lg); }
  .layers.open .toggle { position: sticky; top: 0; background: var(--panel); z-index: 1; }
  .maphint { bottom: auto; top: 10px; left: 56px; font-size: 11.5px; }
  .brand-text { display: none; }
}

/* ---------------------------------------------------------------- Oct 2026 additions: winds, NOTAMs, chart viewer, nav log, glossary, offline */
.skip { position: absolute; left: 8px; top: -60px; z-index: 3000; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 8px; text-decoration: none; }
main:focus { outline: none; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
.rwind { margin-top: 10px; font-size: 12.5px; display: grid; gap: 2px; }
.rwind .rwhead { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.rwind .rwhead .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.rwind > div:not(.rwhead) { display: flex; gap: 10px; padding: 2px 6px; border-radius: 5px; }
.rwind .id { font: 600 12px var(--mono); min-width: 34px; }
.rwind .best { background: var(--accent-soft); }
.rwind .tail { color: var(--bad, #b91c1c); }
table.winds { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.winds th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 2px 4px; }
table.winds td { padding: 2px 4px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 12px; }
table.winds .num { text-align: right; }
.sumcard details summary { cursor: pointer; font-size: 12.5px; color: var(--accent); margin-top: 6px; }
.segs { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg { border: 0; background: transparent; color: var(--muted); font: 600 10.5px var(--sans, inherit); padding: 1px 7px; cursor: pointer; letter-spacing: 0; text-transform: none; }
.seg.on { background: var(--accent); color: var(--on-accent); }
.notam { border-top: 1px solid var(--border); padding: 6px 0; font-size: 12.5px; }
.notam:first-of-type { border-top: 0; }
.notam .nhead { font-size: 11.5px; }
.notam .ntext { font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.notam.hot .ntext { color: var(--bad, #b91c1c); }
.apdview canvas.night, .cvpages.night canvas { filter: invert(1) hue-rotate(180deg); }
.apdview:has(canvas.night) { background: #000; }
.noscroll { overflow: hidden; }
.chartviewer { position: fixed; inset: 0; z-index: 2500; background: var(--bg); display: flex; flex-direction: column; }
.chartviewer[hidden] { display: none; }
.cvbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.cvbar .sp { flex: 1; }
.cvbar .cvtitle { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.cvbar [aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cvpages { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cvpages canvas { background: #fff; box-shadow: var(--shadow-lg, 0 2px 12px rgba(0,0,0,.2)); max-width: none; }
.cvpages.night { background: #000; }
.cvmsg { margin: 40px auto; color: var(--muted); }
.cvfoot { font-size: 11px; color: var(--muted); padding: 4px 12px 8px; text-align: center; }
.minisw { display: flex; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.minisw button { border: 0; background: transparent; color: var(--text); font: 600 11px var(--sans, inherit); padding: 4px 8px; cursor: pointer; }
.minisw button + button { border-left: 1px solid var(--border); }
.minisw button.on { background: var(--accent); color: var(--on-accent); }
.navopts { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 12px; font-size: 13px; }
.navopts label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-weight: 500; }
.navopts label span { display: flex; align-items: center; gap: 6px; color: var(--text); }
.navopts input, .navopts select { width: 110px; font: 500 14px var(--mono); padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text); }
.navopts select { width: auto; font-family: inherit; }
table.navlog td { white-space: nowrap; }
dl.gloss { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 4px 16px; margin: 0 0 18px; font-size: var(--fs-base); }
dl.gloss dt { font: 600 13px var(--mono); }
dl.gloss dd { margin: 0; }
.prose .sfilter { width: 100%; max-width: 420px; margin: 4px 0 14px; }
.offl { margin: 12px 0; }
body.is-offline .cycle .dot { background: var(--muted) !important; }
body.is-offline .topbar::after { content: "Offline"; font-size: 11px; font-weight: 700; color: #fff; background: #6b7280; border-radius: 5px; padding: 2px 7px; }
@media print {
  body.printroute .routeform, body.printroute .navopts, body.printroute #nhelp, body.printroute .routesum .btn, body.printroute .lead { display: none !important; }
  body.printroute .routemap { height: 300px; break-inside: avoid; }
  body.printroute .page::after { content: "Printed from shijo.com. Estimates only from FAA data and NWS forecast winds; not for navigation."; display: block; margin-top: 6mm; font-size: 9pt; color: #444; }
  #notamcard, #windcard { break-inside: avoid; }
  .chartviewer, .minisw { display: none !important; }
}
@media (max-width: 767px) {
  .navopts input { width: 96px; }
  dl.gloss { grid-template-columns: 1fr; gap: 0 0; } dl.gloss dd { margin-bottom: 8px; }
  .cvbar .cvtitle { max-width: 100%; flex-basis: 100%; }
}
:root { --bad: #b91c1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bad: #f87171; } }
:root[data-theme="dark"] { --bad: #f87171; }
.routesum { flex-wrap: wrap; }
.routesum .rsum { min-width: 0; }
.dahot b { color: var(--warn-text, #b45309); }
.dawarn { margin: 2px 0 0; }
:root { --warn-text: #b45309; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warn-text: #fbbf24; } }
:root[data-theme="dark"] { --warn-text: #fbbf24; }

.chgnote { margin: 10px 0 12px; }
.chgnote h4 { margin: 0 0 4px; font-size: 13px; }
.chgnote ul { margin: 0; padding-left: 18px; font-size: 13px; }
.chgnote li { margin: 2px 0; }
.cbadge { font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: var(--panel-3); }
.cbadge.added { background: #dcfce7; color: #166534; } .cbadge.removed { background: #fee2e2; color: #991b1b; } .cbadge.changed { background: #fef3c7; color: #92400e; }
.chgflag { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-transform: none; padding: 1px 7px; border-radius: 999px; background: #fef3c7; color: #92400e; margin-left: 6px; }

.rwx { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 0 0 14px; }
.rwx:empty { display: none; }
#kbpack { display: none; }
@media print {
  body.printpack > *:not(#kbpack) { display: none !important; }
  body.printpack #kbpack { display: block; font-size: 10.5pt; color: #000; }
  #kbpack h2 { font-size: 14pt; margin: 0 0 4px; }
  #kbpack .kbroute { break-after: page; }
  #kbpack .kbroute .card { border: 0; }
  #kbpack table.t { font-size: 9pt; }
  #kbpack .kbapt { display: grid; grid-template-columns: 38% 62%; gap: 6mm; break-after: page; }
  #kbpack .kbdiag img { width: 100%; height: auto; border: 1px solid #999; }
  #kbpack .kbsketch svg { width: 100%; height: auto; color: #000; } #kbpack .kbsketch small { display: block; }
  #kbpack .kbt { border-collapse: collapse; width: 100%; margin: 3mm 0; } #kbpack .kbt th { text-align: left; padding: 1px 6px 1px 0; white-space: nowrap; } #kbpack .kbt td { font-family: monospace; }
  #kbpack .kbwx { font-family: monospace; font-size: 9pt; } #kbpack .kbsrc, #kbpack .kbfoot { font-size: 8.5pt; color: #444; }
}
@media print { #kbpack .kbapt:last-of-type { break-after: auto; } }

.hazards h4 { margin: 0 0 6px; font-size: 13px; }
.hazards ul { margin: 4px 0; padding-left: 18px; }
.hazards li { margin: 4px 0; font-size: 13px; }
.hazards li.s3 > b { color: var(--bad); }
.hazards li.s2 > b { color: var(--warn-text); }
.atalt { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; margin-left: 4px; }
.atalt.yes { background: #fee2e2; color: #991b1b; } .atalt.no { background: var(--panel-3); color: var(--muted); }
.ralt { margin: 0 0 14px; }
@media print { #rhaz details { display: block; } .ralt { break-inside: avoid; } }

.wxplain { font-size: 12.5px; margin: 10px 0 0; line-height: 1.45; }
.tafhead { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 4px; }
.tafline { position: relative; padding-bottom: 16px; }
.trow { position: relative; height: 22px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.trow.tsub { height: 8px; margin-top: 3px; background: transparent; }
.tseg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font: 700 10px var(--sans); color: #fff; border-right: 1px solid var(--panel); cursor: pointer; }
.tseg.c-vfr { background: #16a34a; } .tseg.c-mvfr { background: #2563eb; } .tseg.c-ifr { background: #dc2626; } .tseg.c-lifr { background: #c026d3; } .tseg.c-na { background: #9ca3af; }
.ttemp { border-radius: 3px; opacity: .9; }
.tnow { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); }
.tticks { position: relative; height: 14px; }
.ttick { position: absolute; top: 2px; transform: translateX(-50%); font: 500 9.5px var(--mono); color: var(--muted); white-space: nowrap; }
.tlegend { font-size: 10.5px; }

.nchips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.nchips button { border: 1px solid var(--border); background: var(--panel); color: var(--text); font: 600 11px var(--sans); padding: 2px 8px; border-radius: 999px; cursor: pointer; }
.nchips button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ncat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.nlist .nmore { margin-top: 6px; }
.nprev { font-size: 11.5px; font-weight: 600; background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 6px; padding: 3px 8px; margin-bottom: 6px; }

.help .toc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin: 0 0 8px; }
.help h3 { scroll-margin-top: calc(var(--topbar-h, 60px) + 10px); }
.help kbd { font: 600 11px var(--mono); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 4px; }
/* phones: one column everywhere (the airport-diagram layout used to win over the phone rule) */
@media (max-width: 700px) {
  .summary, .summary:has(.apdview) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "b" "c"; grid-template-rows: none; }
}
@media (max-width: 860px) {
  .ralt .near a, #nearcard .near a { flex-wrap: wrap; }
  .ralt .near a > span:first-child { white-space: normal; }
}
.atalt { white-space: nowrap; display: inline-block; }

/* NOTAM jump button by the airport name, NOTAMs in the route planner and nearby airports */
.notamflag { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-transform: none; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--accent); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.notamflag:hover { text-decoration: none; border-color: var(--accent); }
.notamflag.hot { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.sumcard h4 .nlinks { display: flex; gap: 10px; }
.sumcard h4 .nlinks a { text-transform: none; letter-spacing: 0; font-weight: 500; }
.rnotam .rn { padding: 6px 0; border-top: 1px solid var(--border); }
.rnotam .rn:first-of-type { border-top: 0; }
.rnotam .rnh { font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.rnotam .rnh a { margin-left: auto; font-size: 12px; }
.nnear .nnapt { margin-top: 12px; padding: 0 16px 8px; }
.nnear .nnapt h3 { padding: 12px 0 6px; margin: 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.nnear .nchips { margin: 10px 0 4px; }
.favchg { margin: 14px 0; }
.favchg h3 small { font-weight: 500; color: var(--muted); }
.favchg .cdet { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notamflag.hot { background: #3b1414; border-color: #5b1d1d; color: #fca5a5; } }
:root[data-theme="dark"] .notamflag.hot { background: #3b1414; border-color: #5b1d1d; color: #fca5a5; }

/* Route planner: more options, saved aircraft, recent routes, extra cards */
.navmore { margin: -2px 0 6px; font-size: 13px; }
.navmore > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.navopts input[type="datetime-local"] { width: 210px; font-family: var(--sans); }
.acsave { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acsave input { flex: 1 1 240px; max-width: 360px; font: 500 13px var(--sans); padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text); }
.rrecent { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 12.5px; margin: 2px 0 12px; }
.rrecent:empty { display: none; }
.rrecent a:not(.muted) { font-family: var(--mono); }
.rcards, .rcards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 0 0 14px; align-items: start; }
.rcards:empty { display: none; }
.rcards2 { margin-top: 14px; }
.rnotam { margin: 0 0 14px; }
.sumcard .good { color: var(--ok); font-size: 13px; margin: 4px 0; }
.sumcard .bad { color: var(--err); font-size: 13px; margin: 4px 0; }
.sumcard .warn2 { color: var(--warn); font-size: 13px; margin: 4px 0; }
.altcmp { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0; }
.altcmp th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; padding: 3px 4px; }
.altcmp td { padding: 3px 4px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.altcmp td:last-child, .altcmp th:last-child { text-align: right; }
.altcmp tr.best td { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.altcmp tr.cur td:first-child { font-weight: 700; }
.kv2 { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; margin: 4px 0 6px; }
.kv2 > span:nth-child(odd) { color: var(--muted); }
.rsug { margin: 0 0 12px; }
.rsug > summary { cursor: pointer; }
.rsuglist { margin-top: 8px; }
.rsugi { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.rsugi code { display: block; margin-top: 3px; white-space: normal; word-break: break-word; font-size: 12px; }
.rleg { margin: 6px 0 2px; }
.rleg + .rleg { border-top: 1px solid var(--border); padding-top: 6px; }
.rlegh { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 2px; }
.rwxlist { max-height: 360px; overflow: auto; margin-top: 6px; }
.rwxlist > div { padding: 5px 0; border-top: 1px solid var(--border); font-size: 12.5px; }
.rwxlist > div.urgent { background: color-mix(in srgb, var(--err) 7%, transparent); }
.rwxlist pre.raw { margin: 3px 0 0; white-space: pre-wrap; word-break: break-word; }
.sumcard details > summary { cursor: pointer; font-size: 12.5px; color: var(--accent); margin: 4px 0; }
.icaofpl { white-space: pre-wrap; font-size: 13px; }
.rpt { border-radius: 50%; border: 2px solid #fff; background: var(--brand, #1e3a8a); box-shadow: 0 0 0 1px rgba(0,0,0,.35); cursor: grab; }
.rpt-navaid { background: #fff; border-color: #0e7490; border-radius: 3px; }
.rpt-fix { background: #fff; border-color: #374151; border-radius: 2px; transform: rotate(45deg); }
.routemap { cursor: crosshair; }
.kbextra { margin: 3mm 0; font-size: 9.5pt; }
.kbextra h4 { margin: 0 0 2px; font-size: 10pt; }
@media print { .rcards2, #rsug, .rrecent, .navmore { display: none !important; } }
.rcards .near a, .rcards2 .near a { flex-wrap: wrap; row-gap: 0; }
.rcards .near a > span:first-child, .rcards2 .near a > span:first-child { white-space: normal; flex: 1 1 160px; }
.rcards .near a .m, .rcards2 .near a .m { font-size: 11.5px; }

/* Tools hub, explore, quiz, weight and balance, alerts, airspace popup, plain English */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; }
.tool { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); }
.tool:hover { border-color: var(--accent); text-decoration: none; }
.tool b { color: var(--accent); }
.tool span { color: var(--muted); font-size: 13px; }
.navopts label.chk { justify-content: flex-end; }
.navopts label.chk input { width: auto; }
.quiz .qcard { margin-top: 10px; }
.quiz .qbody { padding: 16px; }
.quiz .qq { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.quiz .qopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.quiz .qo { justify-content: flex-start; text-align: left; white-space: normal; padding: 10px 12px; }
.quiz .qo.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--panel)); color: var(--text); opacity: 1; }
.quiz .qo.wrong { border-color: var(--err); background: color-mix(in srgb, var(--err) 12%, var(--panel)); color: var(--text); opacity: 1; }
.quiz .qres { margin-top: 12px; }
.quiz .good, .wb .good, .alerts .good { color: var(--ok); } .quiz .bad, .wb .bad { color: var(--err); }
.wb .wbst input { width: 100%; min-width: 60px; font: 500 13px var(--sans); padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel); color: var(--text); }
.wb .wbenv { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); max-width: 420px; }
.wb .wbenv textarea { font: 500 13px var(--mono); padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text); }
.wb .altcmp tr.badrow td { background: color-mix(in srgb, var(--err) 12%, transparent); }
.wbchart { width: 100%; max-width: 620px; height: auto; margin-top: 10px; font: 11px var(--sans); }
.wbchart .grid { stroke: var(--border); stroke-width: 1; }
.wbchart text { fill: var(--muted); }
.wbchart .ax { fill: var(--muted); font-weight: 600; }
.wbchart .env { fill: color-mix(in srgb, var(--ok) 14%, transparent); stroke: var(--ok); stroke-width: 2; }
.wbchart .maxg { stroke: var(--err); stroke-dasharray: 5 4; }
.wbchart .to { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.wbchart .ld { fill: var(--panel); stroke: var(--accent); stroke-width: 2.5; }
.wbchart .burn { stroke: var(--accent); stroke-dasharray: 3 3; }
.wbchart .lbl2 { fill: var(--text); font-weight: 600; }
.alertbtn { position: relative; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.alertbtn:hover { text-decoration: none; }
.alertbtn .badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #b91c1c; color: #fff; font: 700 10px/16px var(--sans); text-align: center; }
.newtag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: #fee2e2; color: #991b1b; }
.notam.isnew { background: color-mix(in srgb, var(--err) 6%, transparent); }
.airpop .leaflet-popup-content { margin: 10px 12px; font-size: 12.5px; }
.airq .airhead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 6px; }
.airq .airhere { font-size: 15px; color: var(--accent); margin-right: 2px; }
.airq input { width: 78px; font: 500 12.5px var(--mono); padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel); color: var(--text); }
.airlist { list-style: none; margin: 4px 0; padding: 0; }
.airlist li { padding: 4px 0; border-top: 1px solid var(--border); }
.airlist li.in b { color: var(--accent); }
.airlist li.out { opacity: .8; }
.rwind .over { background: color-mix(in srgb, var(--err) 10%, transparent); }
/* Favoured runway (by wind) on top; the per-runway list folds under it */
.rwind > div.rfav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 9px; border-radius: 7px; background: var(--accent-soft); font-size: 13px; }
.rwind > div.rfav.over { background: color-mix(in srgb, var(--err) 12%, transparent); }
.rwind > div.rfav.none { background: var(--panel-2); color: var(--muted); }
.rfav .rflab { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rfav b { font: 700 14px var(--mono); }
.rwall > summary { cursor: pointer; font-size: 12px; color: var(--accent); margin: 6px 0 2px; }
.rwall > div:not(.rwhead) { display: flex; gap: 10px; padding: 2px 6px; border-radius: 5px; }
.rwall > .rwhead { display: none; }  /* the summary line already says the wind */

/* Procedures card: approaches by runway, SIDs and STARs, each a link to the FAA PDF */
.proccard .psub { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 4px; }
.proccard h4 + .psub { margin-top: 2px; }
.proccard .psub small { font-family: var(--mono); margin-left: 3px; }
.proccard .pfavnote { text-transform: none; letter-spacing: 0; color: var(--accent); }
.prows { display: grid; gap: 1px; }
.prow { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: baseline; padding: 3px 6px; border-radius: 5px; }
.prow.fav { background: var(--accent-soft); }
.prow .id { font: 600 12px var(--mono); }
.plinks { display: flex; flex-wrap: wrap; gap: 4px; }
.plinks a { font-size: 12px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel-2); color: var(--text); white-space: nowrap; }
.plinks a:hover { border-color: var(--accent); text-decoration: none; }
.plinks.wrap a { white-space: normal; }

/* Header strip under the quick facts: current weather and the first frequencies to dial */
.hstrip { display: grid; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.hswx, .hsfreq { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 13px; font-weight: 600; }
.hswx small, .hsfreq small { display: block; font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hswx .muted { font-weight: 500; font-size: 12px; }
.hsfreq span { font-family: var(--mono); }
.hsfreq small { font-family: var(--sans); }
.xover { color: var(--err); font-weight: 700; font-size: 11px; }
.xwl { font-size: 11.5px; margin-top: 4px; }
.nchips .nplain { margin-left: auto; }
.plainlist { margin: 0; padding: 8px 16px 8px 32px; font-size: 13px; }
.plainlist li { padding: 3px 0; }
.rmkplain { margin-left: 8px; }
#briefstamp { display: none; }
@media print {
  body.printbrief .routeform, body.printbrief .navopts, body.printbrief .navmore, body.printbrief #nhelp, body.printbrief .rrecent, body.printbrief .routesum .btn,
  body.printbrief .api > h2, body.printbrief .api > .lead, body.printbrief .leaflet-control-container, body.printbrief #rsug { display: none !important; }
  body.printbrief #briefstamp { display: block; margin-bottom: 4mm; }
  body.printbrief #briefstamp h2 { font-size: 15pt; margin: 0; }
  body.printbrief #briefstamp p { font-size: 9pt; margin: 1mm 0 0; }
  body.printbrief .rcards2, body.printbrief .rcards, body.printbrief .rwx { display: block !important; }
  body.printbrief .sumcard, body.printbrief .card, body.printbrief .callout { break-inside: avoid; margin-bottom: 3mm; }
  body.printbrief .routemap { height: 260px; break-inside: avoid; }
  body.printbrief .rwxlist { max-height: none; overflow: visible; }
}
@media (max-width: 767px) { .tabs .t-changes { display: none; } }
@media (max-width: 1200px) and (min-width: 768px) { .tabs .t-api, .tabs .t-about { display: none; } }

/* At a glance, weather history, share */
.glance { margin: 6px 0 2px; font-size: 13.5px; line-height: 1.5; color: var(--text); max-width: 70ch; }
.wxhist { margin-top: 8px; }
.wxhist > summary { cursor: pointer; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.wxh { position: relative; margin-top: 6px; }
.wxh svg { width: 100%; height: auto; display: block; font: 10px var(--sans); }
.wxh text { fill: var(--muted); }
.wxh .pt { fill: var(--text); font-weight: 600; font-size: 10.5px; }
.wxh .g { stroke: var(--border); stroke-width: 1; }
.wxh .g.v { stroke-dasharray: 2 3; }
.wxh .ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wxh .gu { fill: var(--panel); stroke: var(--accent); stroke-width: 1.5; }
.wxh .nc { fill: var(--muted); opacity: .5; }
.wxh .xh { stroke: var(--text); stroke-width: 1; opacity: .5; }
.wxh rect.c-vfr { fill: #16a34a; } .wxh rect.c-mvfr { fill: #2563eb; } .wxh rect.c-ifr { fill: #dc2626; } .wxh rect.c-lifr { fill: #c026d3; } .wxh rect.c-na { fill: #9ca3af; }
.wxtip { position: absolute; top: -6px; transform: translateY(-100%); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 8px; font-size: 11.5px; line-height: 1.45; box-shadow: 0 4px 14px rgba(0,0,0,.12); pointer-events: none; white-space: nowrap; z-index: 5; }
.wxhraw { margin-top: 6px; }
.wxhraw > summary { cursor: pointer; font-size: 12px; color: var(--accent); }
.sharebox { display: flex; gap: 6px; margin: 10px 0; }
.sharebox input { flex: 1; min-width: 0; font: 500 13px var(--mono); padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text); }
.sharerow { display: flex; gap: 8px; flex-wrap: wrap; }
.near a > span:first-child { flex: 1 1 auto; }
.near a > .m { flex: 0 0 auto; }

/* Accessibility: links in running text are underlined; screen-reader-only text; focus rings */
.prose p a, .prose li a, .api p a, .api li a, .callout p a, .lead a { text-decoration: underline; text-underline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.grid:focus-visible, .rwxlist:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* personal minimums on the airport weather card */
.wxmins { margin: 8px 0; }
.mins { font-size: 13px; border-radius: 7px; padding: 6px 10px; margin-bottom: 6px; background: var(--panel-2); border-left: 3px solid #2e8b57; }
.mins.minsbad { border-left-color: #c0392b; }
.mins ul { list-style: none; margin: 4px 0 0; padding: 0; }
.mins li { margin: 1px 0; }
.mins li.no { font-weight: 600; }
.minsform summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.minsform .navopts { margin-top: 6px; }

/* FBO & services card on airport pages */
.fbo .freqs a { font-family: var(--mono); }
.fbonotes { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.4; }
.fbonotes li { padding: 3px 0; border-top: 1px solid var(--border); }
.fbonotes li b { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 4px; }
.fbonote { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
/* mid-width screens: the cards flow into two balanced columns (fixed a | b | c columns would leave a gap under the shorter side) */
@media (max-width: 1180px) and (min-width: 701px) {
  .summary { display: block; columns: 2; column-gap: 14px; }
  .summary .col { display: contents; }
  .summary .sumcard { break-inside: avoid; margin-bottom: 14px; }
}

/* Night & lighting, runway details, contacts and owner FBO listings (airport pages) */
.lightcard .pcl { margin-bottom: 4px; }
.lightcard .pcl .key { display: inline-block; margin-right: 6px; }
.lightcard .pcl .f, .fbol .f { font-family: var(--mono); font-weight: 600; }
.lrwys { margin-top: 8px; font-size: 12.5px; display: grid; gap: 6px; }
.lrwy > div, .rend { display: grid; grid-template-columns: 2.6em 1fr; gap: 6px; padding-left: 2px; }
.lrwy .id, .rend .id { font: 600 12px var(--mono); }
.rdet { border-top: 1px solid var(--border); padding: 5px 0; font-size: 12.5px; }
.rdet:first-of-type { border-top: 0; }
.rdet > summary { cursor: pointer; list-style-position: inside; }
.rdet .rend { margin: 5px 0; line-height: 1.4; }
.rdet .rt { color: var(--warn); }
.rdet .obst { color: var(--text, inherit); }
.rwt { margin: 4px 0 2px; line-height: 1.4; }
.ctc { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; font-size: 13px; padding: 3px 0; }
.ctc a { font-family: var(--mono); }
.fbolist { display: grid; gap: 8px; margin-bottom: 10px; }
.fbol { border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 13px; line-height: 1.45; }
.fbon { font-size: 14px; }
.fbon a { font-weight: 650; }
.fbol .n { color: var(--muted); font-size: 11.5px; }
.fbol a[href^="tel:"] { font-family: var(--mono); }
.lightcard .pcl { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; border-top: 1px solid var(--border); padding-top: 6px; }
.lightcard .pclh { font-size: 12.5px; margin-bottom: 2px; color: var(--muted); }
.lightcard .pclh .f { color: var(--text, inherit); font-size: 13.5px; }
