/* Light tokens; dark tokens apply for the system setting (auto) or a manual choice. */
:root {
  color-scheme: light;
  --bg: #f6f7f9; --surface: #ffffff; --text: #1d2329; --muted: #5f6973; --line: #d9dee3; --accent: #1c64b4; --hl: #fff0c2;
  --t: #cf2a1e; --td: #1f8a3a; --tw: #0d84a8; --parcel: #8a5a00; --parcel-e: #b0177a; --fog: #7a3fc8;
  --g-p: #c9ced4; --g-iso: #d9c8b4; --g-dry: #e3cdb8; --g-moist: #c7e3cc; --g-mix: #a9b7e0; --g-0: #1f49d6; --g-20: #0b8a8f; --g-trop: #8a2fa8;
  --w-up: #d6452f; --w-dn: #2670c4;
  --cape: rgba(232, 120, 30, 0.28); --cin: rgba(40, 90, 200, 0.22);
  --h1: #d6336c; --h3: #d03a2c; --h6: #e8890c; --h9: #b59a00; --h12: #4f8fc0;
  --hgz: #bf1a7c; --dgz: #a86400; --inflow: #0284a8; --sl-veer: #c2410c; --sl-back: #0369a1;
  --bg-warm: #d9480f; --bg-cold: #1971c2; --mix: #9c36b5; --gh: #2b8a3e; --risk1: #f2c94c; --risk2: #f08c00; --risk3: #e03131; --risk-on: #1d1d1d; --ok: #2f9e44; --no: #c92a2a;
  --wbfl: #1e3a8a; --cold1: #d0ebff; --cold1-on: #0b2740; --cold2: #74c0fc; --cold2-on: #0b2740; --cold3: #1864ab; --cold3-on: #fff;
  --pt-rain: #2f7fd0; --pt-rain-on: #fff; --pt-mix: #a35fd0; --pt-mix-on: #fff; --pt-snow: #4fc6e8; --pt-snow-on: #0b2730;
  --cs1: #dcf3fa; --cs2: #a8e2f2; --cs3: #4fc6e8; --cs4: #1689ad; --cs-on: #0b2730; --cs4-on: #fff;
  --lw1: #0f766e; --lw2: #d9480f; --lw3: #7048e8; --soft: #eef1f4; --on: #1d2329; --on-text: #ffffff;
  --pin0: #0b7fa8; --pin1: #c2185b; --pin2: #6a3fc8; --pin3: #8a6a2f; --pin4: #0f8f7f; --pin5: #5f6973;
  --map-sea: #a9cbe1; --map-coast: #39424a; --map-pt: #1d2329; --map-halo: rgba(255, 255, 255, 0.85); --map-sel: #d6336c; --map-stn: #1456a8; --relief-l: inline; --relief-d: none; --fld-line: #2b3138; --fld-bold: #b3261e; --band-op: 0.07;
  --h-ok: #2f9e44; --h-late: #e08a00; --h-stale: #d6336c; --av-ice: #1c7ed6; --av-turb: #e8590c; --av-con: #5f3dc4; --con-on: #fff; --cap: #4c6ef5; --cap-on: #fff; --pinprev: #66707a; --pinorig: #7b8794;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 13px; color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14181c; --surface: #1c2126; --text: #e7eaed; --muted: #9aa4ae; --line: #333b42; --accent: #6aa9ec; --hl: #4a3f15;
    --t: #ff6b5e; --td: #4fd070; --tw: #4cc4e6; --parcel: #e6b050; --parcel-e: #ff7ac8; --fog: #b98cff;
    --g-p: #39424a; --g-iso: #4d4438; --g-dry: #4a3e33; --g-moist: #2e4a35; --g-mix: #3a4670; --g-0: #86a4ff; --g-20: #3fd6d0; --g-trop: #d48cf0;
    --w-up: #ff7a63; --w-dn: #5fa6f0;
    --cape: rgba(240, 150, 60, 0.28); --cin: rgba(90, 140, 240, 0.25);
    --h1: #f06595; --h3: #ff6b5e; --h6: #f5a53a; --h9: #e0c63f; --h12: #7ab7e6;
    --hgz: #ff7ac6; --dgz: #f5c542; --inflow: #4fd8f5; --sl-veer: #fb923c; --sl-back: #60a5fa;
  --bg-warm: #ff8a4c; --bg-cold: #5aa9f0; --mix: #e599f7; --gh: #69db7c; --risk1: #ffe066; --risk2: #ffa94d; --risk3: #ff6b6b; --risk-on: #14181c; --ok: #69db7c; --no: #ff8787;
  --wbfl: #7b9bff; --cold1: #1d3a57; --cold1-on: #e3f1ff; --cold2: #3d7fc4; --cold2-on: #fff; --cold3: #a5d8ff; --cold3-on: #0b2740;
  --pt-rain: #4ea3f0; --pt-rain-on: #0b1620; --pt-mix: #c08cf0; --pt-mix-on: #1a0f24; --pt-snow: #eef6ff; --pt-snow-on: #0b2730;
  --cs1: #1d3a44; --cs2: #2c6476; --cs3: #5fb4cc; --cs4: #d6f3fb; --cs-on: #eaf7fb; --cs4-on: #0b2730;
    --lw1: #3fd0bc; --lw2: #ff8a50; --lw3: #b197fc; --soft: #232a30; --on: #e7eaed; --on-text: #14181c;
    --pin0: #3fc0e8; --pin1: #f06595; --pin2: #b98cff; --pin3: #cfae6a; --pin4: #3fd0bc; --pin5: #aab4be;
    --map-sea: #16232e; --map-coast: #aab4be; --map-pt: #e7eaed; --map-halo: rgba(10, 14, 18, 0.8); --map-sel: #ff6b9b; --map-stn: #6aa9ec; --relief-l: none; --relief-d: inline; --fld-line: #dfe5ea; --fld-bold: #ff7a8a; --band-op: 0.14;
    --h-ok: #51cf66; --h-late: #ffb02e; --h-stale: #ff6b9b; --av-ice: #74c0fc; --av-turb: #ff922b; --av-con: #b197fc; --con-on: #1a1030; --cap: #91a7ff; --cap-on: #10142a; --pinprev: #a3adb7; --pinorig: #9aa5b1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14181c; --surface: #1c2126; --text: #e7eaed; --muted: #9aa4ae; --line: #333b42; --accent: #6aa9ec; --hl: #4a3f15;
  --t: #ff6b5e; --td: #4fd070; --tw: #4cc4e6; --parcel: #e6b050; --parcel-e: #ff7ac8; --fog: #b98cff;
  --g-p: #39424a; --g-iso: #4d4438; --g-dry: #4a3e33; --g-moist: #2e4a35; --g-mix: #3a4670; --g-0: #86a4ff; --g-20: #3fd6d0; --g-trop: #d48cf0;
  --w-up: #ff7a63; --w-dn: #5fa6f0;
  --cape: rgba(240, 150, 60, 0.28); --cin: rgba(90, 140, 240, 0.25);
  --h1: #f06595; --h3: #ff6b5e; --h6: #f5a53a; --h9: #e0c63f; --h12: #7ab7e6;
  --hgz: #ff7ac6; --dgz: #f5c542; --inflow: #4fd8f5; --sl-veer: #fb923c; --sl-back: #60a5fa;
  --bg-warm: #ff8a4c; --bg-cold: #5aa9f0; --mix: #e599f7; --gh: #69db7c; --risk1: #ffe066; --risk2: #ffa94d; --risk3: #ff6b6b; --risk-on: #14181c; --ok: #69db7c; --no: #ff8787;
  --wbfl: #7b9bff; --cold1: #1d3a57; --cold1-on: #e3f1ff; --cold2: #3d7fc4; --cold2-on: #fff; --cold3: #a5d8ff; --cold3-on: #0b2740;
  --pt-rain: #4ea3f0; --pt-rain-on: #0b1620; --pt-mix: #c08cf0; --pt-mix-on: #1a0f24; --pt-snow: #eef6ff; --pt-snow-on: #0b2730;
  --cs1: #1d3a44; --cs2: #2c6476; --cs3: #5fb4cc; --cs4: #d6f3fb; --cs-on: #eaf7fb; --cs4-on: #0b2730;
  --lw1: #3fd0bc; --lw2: #ff8a50; --lw3: #b197fc; --soft: #232a30; --on: #e7eaed; --on-text: #14181c;
  --pin0: #3fc0e8; --pin1: #f06595; --pin2: #b98cff; --pin3: #cfae6a; --pin4: #3fd0bc; --pin5: #aab4be;
  --map-sea: #16232e; --map-coast: #aab4be; --map-pt: #e7eaed; --map-halo: rgba(10, 14, 18, 0.8); --map-sel: #ff6b9b; --map-stn: #6aa9ec; --relief-l: none; --relief-d: inline; --fld-line: #dfe5ea; --fld-bold: #ff7a8a; --band-op: 0.14;
    --h-ok: #51cf66; --h-late: #ffb02e; --h-stale: #ff6b9b; --av-ice: #74c0fc; --av-turb: #ff922b; --av-con: #b197fc; --con-on: #1a1030; --cap: #91a7ff; --cap-on: #10142a; --pinprev: #a3adb7; --pinorig: #9aa5b1;
}
/* One colour per profile mode, with white text, in both themes. */
:root { --m-convection: #c2410c; --m-waves: #0f766e; --m-temp: #2563eb; --m-fog: #9333ea; --m-aviation: #4d7c0f; --m-temps: #be123c; --mode: var(--m-convection); }
:root[data-mode="temps"] { --mode: var(--m-temps); }
:root[data-mode="waves"] { --mode: var(--m-waves); }
:root[data-mode="temp"] { --mode: var(--m-temp); }
:root[data-mode="fog"] { --mode: var(--m-fog); }
:root[data-mode="aviation"] { --mode: var(--m-aviation); }
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
button, select, input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
button { padding: 3px 11px; cursor: pointer; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; }
select { padding: 2px 6px; font-size: 12.5px; }
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { color: var(--muted); cursor: default; opacity: 0.7; }
button[aria-pressed="true"] { background: var(--on); border-color: var(--on); color: var(--on-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.top { display: flex; align-items: center; gap: 14px; padding: 7px 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -0.015em; }
.mode-bar { background: var(--mode); color: #fff; padding: 2px 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; line-height: 16px; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.modes button { padding: 3px 6px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.modes button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.modes button:hover:not([aria-pressed="true"]) { border-color: var(--c); }
.modes .mode-key { font-variant-numeric: tabular-nums; opacity: .75; }
:root[data-theme="dark"] .modes button:not([aria-pressed="true"]) { color: color-mix(in srgb, var(--c) 55%, #fff); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .modes button:not([aria-pressed="true"]) { color: color-mix(in srgb, var(--c) 55%, #fff); } }
/* Sidebar groups, titled by what they do */
.group { padding: 0 0 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.group:last-child { border-bottom: 0; }
.group-h { display: flex; align-items: center; gap: 6px; margin: 0 0 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.group-h::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--mode); }
.key-dot, .key-sq { display: inline-block; width: 6px; height: 6px; vertical-align: 1px; background: var(--map-pt); border-radius: 50%; }
.key-sq { border-radius: 1px; background: var(--map-stn); width: 7px; height: 7px; }
.modes [data-mode="convection"] { --c: var(--m-convection); }
.modes [data-mode="waves"] { --c: var(--m-waves); }
.modes [data-mode="temp"] { --c: var(--m-temp); }
.modes [data-mode="fog"] { --c: var(--m-fog); }
.modes [data-mode="temps"] { --c: var(--m-temps); }
.modes [data-mode="aviation"] { --c: var(--m-aviation); }
.heading { flex: 1; min-width: 220px; }
.heading span { color: var(--muted); margin-left: 6px; display: inline-block; } /* wraps whole, below the place */
.status { color: var(--w-up); }
.theme { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.health { position: relative; font-size: 12px; }
.health summary { cursor: pointer; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.health summary::-webkit-details-marker { display: none; }
.h-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--h-ok); flex: none; }
.health[data-level="late"] .h-dot { background: var(--h-late); }
.health[data-level="stale"] .h-dot { background: var(--h-stale); }
.health[data-level="stale"] summary { color: var(--h-stale); font-weight: 600; }
.health-pop { position: absolute; left: 0; z-index: 6; margin-top: 6px; padding: 8px 12px; width: min(330px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.health-pop ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; }
.health-pop .hint { margin: 8px 0 0; }
.keys summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.keys { position: relative; }
.keys dl { position: absolute; right: 0; z-index: 5; margin: 6px 0 0; padding: 8px 12px; width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.keys dd { margin: 0; color: var(--muted); }
.keys dt { font-weight: 600; }

.layout { display: grid; grid-template-columns: 330px minmax(0, 2fr) minmax(320px, 1fr); gap: 10px; padding: 10px 14px; align-items: start; }
.side, .centre, .panel { min-width: 0; }
.find { position: relative; display: flex; gap: 5px; margin-bottom: 6px; }
.find input { flex: 1; min-width: 0; padding: 4px 8px; font-size: 12.5px; }
.find button { width: 28px; padding: 0; display: grid; place-items: center; flex: none; }
.find-list { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin: 3px 0 0; padding: 3px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.find-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 7px; border-radius: 4px; font-size: 12.5px; cursor: pointer; }
.find-list li span { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.find-list li[aria-selected="true"], .find-list li:hover { background: var(--on); color: var(--on-text); }
.find-list li[aria-selected="true"] span, .find-list li:hover span { color: inherit; }
.find-list li.none { cursor: default; color: var(--muted); background: none; }
.map-wrap { position: relative; }
#map { width: 100%; display: block; border: 1px solid var(--line); border-radius: 6px; cursor: crosshair; touch-action: none; user-select: none; background: var(--map-sea); }
#map.panning { cursor: grabbing; }
#map * { vector-effect: non-scaling-stroke; }
.map-tools { position: absolute; top: 7px; right: 7px; display: flex; flex-direction: column; gap: 3px; }
.map-tools button { width: 26px; height: 26px; padding: 0; font-size: 15px; line-height: 1; }
.fld-img { pointer-events: none; }
.fld-line { fill: none; stroke: var(--fld-line); stroke-width: 0.9; stroke-opacity: 0.7; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
/* Precipitation outlines over the MUCAPE shading: blue against the yellows and reds, heavier for heavier rain. */
.fld-bold { fill: none; stroke: var(--fld-bold); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
.fld-lab { fill: var(--fld-line); font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--map-halo); stroke-width: 2.4px; stroke-linejoin: round; pointer-events: none; }
.fld-lab.b { fill: var(--fld-bold); }
.field-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 7px; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.field-key .switch { font-size: 11.5px; }
.fk-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.fk-when { width: 100%; font-size: 11px; }
.fk-bar { display: inline-flex; border-radius: 3px; overflow: visible; margin-bottom: 11px; }
.fk-bar span { position: relative; width: 26px; height: 8px; }
.fk-bar span:first-child { border-radius: 3px 0 0 3px; } .fk-bar span:last-child { border-radius: 0 3px 3px 0; }
.fk-bar i { position: absolute; left: 0; top: 9px; transform: translateX(-50%); font-style: normal; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.fk-u { margin-bottom: 0; }
.fk-cats { display: inline-flex; flex-wrap: wrap; gap: 2px 8px; }
.fk-cats b { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 3px; vertical-align: -1px; }
.relief-l { display: var(--relief-l); }
.relief-d { display: var(--relief-d); }
.map-c { fill: none; stroke: var(--map-coast); stroke-width: 0.7; }
.map-b { fill: none; stroke: var(--map-coast); stroke-width: 1; stroke-dasharray: 3 2; }
.pt { fill: var(--map-pt); stroke: var(--map-halo); stroke-width: 0.6; opacity: 0.75; pointer-events: none; }
.pt.far { stroke-width: 0.35; opacity: 0.6; }
.city { fill: var(--text); pointer-events: none; }
.city-d { fill: var(--map-halo); stroke: var(--text); stroke-width: 0.9; pointer-events: none; }
.city-h { fill: none; stroke: var(--map-halo); stroke-width: 2.6; stroke-linejoin: round; pointer-events: none; }
.stn { fill: var(--map-stn); stroke: var(--map-halo); stroke-width: 1; }
.sel { fill: none; stroke: var(--map-sel); stroke-width: 2.4; pointer-events: none; }
.pin-mark { fill: none; stroke-width: 1.8; pointer-events: none; }
.hint { color: var(--muted); font-size: 12px; margin: 5px 0; line-height: 1.35; }
.field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.field select { flex: 1; padding: 3px; }
.time { padding: 5px 12px 4px; border-top: 1px solid var(--line); }
.time-head { display: flex; justify-content: center; align-items: center; color: var(--muted); gap: 10px; }
.time-head b { min-width: 13em; text-align: center; }
.time-steps { display: inline-flex; gap: 3px; }
.time-steps button { min-width: 30px; height: 24px; padding: 0 6px; font-size: 15px; line-height: 1; }
.time-head b { color: var(--text); font-weight: 600; }
.time input { width: 100%; margin: 6px 0 0; border: 0; background: none; accent-color: var(--accent); }
.time-days { position: relative; height: 16px; font-size: 10px; color: var(--muted); }
.time-days span { position: absolute; white-space: nowrap; }
.pinbar { display: flex; gap: 6px; margin-top: 6px; }
.pinbar button { flex: 1; padding: 3px 6px; }
.upbar { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.upbar button.small { padding: 2px 8px; font-size: 12px; }
.up-unit select { font-size: 12px; padding: 1px 2px; }
.map-note { position: absolute; left: 8px; right: 44px; bottom: 8px; margin: 0; padding: 5px 8px; font-size: 12px; line-height: 1.35;
  background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--text); border: 1px solid var(--line); border-radius: 6px; z-index: 2; }
.pins { list-style: none; margin: 8px 0 0; padding: 0; }
.pins li { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12px; }
.pins .pin-go { flex: 1; min-width: 0; border: 0; background: none; padding: 1px 3px; text-align: left; font-size: 12px; font-weight: 400; color: var(--text); border-radius: 4px; }
.pins .pin-go:hover { text-decoration: underline; }
.pins li.on .pin-go { font-weight: 700; }
.pins li:not(.on) .chip { opacity: 0.6; }
.pins .pin-ed { border: 0; background: none; padding: 2px 3px; color: var(--muted); line-height: 0; }
.pins .pin-ed svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
.pins .pin-ed:hover, .pins .pin-x:hover { color: var(--text); }
.pins .pin-name { flex: 1; min-width: 0; font: inherit; font-size: 12px; padding: 2px 6px; border: 1px solid var(--mode); border-radius: 6px; background: var(--bg); color: var(--text); }
.link-btn { margin-left: auto; border: 0; background: none; padding: 0 2px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--mode); border-radius: 4px; }
.link-btn:hover { text-decoration: underline; }
.pins .pin-x { border: 0; background: none; padding: 0 6px; font-size: 15px; font-weight: 400; color: var(--muted); }
.chip { width: 11px; height: 11px; flex: none; display: inline-block; border-radius: 2px; margin-right: 4px; }

.bar { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 7px; align-items: center; }
.tgroup { display: flex; align-items: center; gap: 4px; }
.tgroup-h { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; }
.seg button { border: 0; background: transparent; padding: 2px 10px; }
.seg button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--surface); }
.seg button[aria-pressed="true"] { background: var(--on); color: var(--on-text); }
#reset-view.quiet { color: var(--muted); font-weight: 500; }
.icon-btn { width: 36px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 24px; height: 18px; overflow: visible; }
.icon-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--accent); color: var(--text); }
.ic-p { stroke: var(--muted); stroke-width: 1; }
.ic-con { fill: none; stroke: var(--parcel); stroke-width: 1.3; stroke-dasharray: 2.4 1.6; }
.ic-moist { fill: none; stroke: var(--parcel); stroke-width: 1.5; }
.ic-dot { fill: var(--parcel); }
.ic-t { fill: var(--t); }
.ic-td { fill: var(--td); }
.ic-fog { fill: none; stroke: var(--fog); stroke-width: 1.3; stroke-dasharray: 2.4 1.6; }
.ic-fogc { fill: none; stroke: var(--fog); stroke-width: 1.8; }
.ic-fogd { fill: var(--fog); }
.ic-ruler { fill: color-mix(in srgb, var(--dgz) 22%, var(--surface)); stroke: currentColor; stroke-width: 1.1; }
.ic-tick { stroke: currentColor; stroke-width: 1; }
/* A two-way switch: the label on the side that is on is bold */
.switch { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 2px 8px; border: 1px solid var(--line); background: var(--surface); font-size: 11.5px; font-weight: 500; line-height: 16px; }
.switch .sw-a, .switch .sw-b { color: var(--muted); }
.switch[aria-checked="false"] .sw-a, .switch[aria-checked="true"] .sw-b { color: var(--text); font-weight: 700; }
.sw-track { position: relative; width: 26px; height: 14px; border-radius: 7px; background: var(--line); flex: none; transition: background 0.15s; }
.sw-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: left 0.15s; }
.switch[aria-checked="true"] .sw-track { background: var(--accent); }
.switch[aria-checked="true"] .sw-track::after { left: 14px; }
.skewt-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.strip-switch { position: absolute; top: 3px; padding: 1px 7px; font-size: 11px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
#skewt { width: 100%; display: block; user-select: none; touch-action: none; cursor: default; }
#skewt.panning { cursor: grabbing; }
#skewt.armed { cursor: crosshair; }
.ta-bl { opacity: 0.35; }
.layer-band { fill: var(--accent); opacity: var(--band-op); pointer-events: none; }
.t tr.user-row th, .t tr.user-row td { background: color-mix(in srgb, var(--parcel) 9%, transparent); }
.t tr.user-row th { color: var(--parcel); }
.layer-edge { stroke: var(--accent); stroke-width: 1.3; pointer-events: none; }
.layer-hit { stroke: transparent; stroke-width: 12; cursor: ns-resize; }
.layer-tag { fill: var(--accent); pointer-events: none; }
.layer-tag-t { fill: var(--surface); font-size: 10.5px; font-weight: 700; pointer-events: none; }
.layer-l { fill: var(--accent); font-size: 11px; font-weight: 600; pointer-events: none; }
.area-l { font-size: 11.5px; pointer-events: none; }
.zone { pointer-events: none; font-size: 11px; font-weight: 600; }
.zone line { stroke-width: 1.8; }
.zone-hgz line { stroke: var(--hgz); } .zone-hgz text { fill: var(--hgz); }
.zone-dgz line { stroke: var(--dgz); } .zone-dgz text { fill: var(--dgz); }
.zone-inflow line { stroke: var(--inflow); } .zone-inflow text { fill: var(--inflow); }
/* Veering relative to the storm (positive SRH) warm, backing cold, as for thermal advection. */
.sl-pos { fill: var(--sl-veer); fill-opacity: 0.2; stroke: none; } .sl-neg { fill: var(--sl-back); fill-opacity: 0.22; stroke: none; }
.sl-edge { stroke: var(--muted); stroke-width: 0.9; stroke-dasharray: 3 2; opacity: 0.8; fill: none; }
.inflow-band { fill: var(--inflow); fill-opacity: 0.1; }
.cape-l { fill: var(--parcel); }
.cin-l { fill: var(--accent); }
.steer { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.mk-l { fill: var(--accent); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.steer-v { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 4 3; }
.steer-t { fill: var(--accent); font-size: 12px; font-weight: 600; }
.steer-k { color: var(--accent); }
.export { position: relative; }
.export { margin-left: auto; }
.export summary { cursor: pointer; list-style: none; padding: 3px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; font-size: 12px; font-weight: 600; line-height: 18px; }
.export summary::-webkit-details-marker { display: none; }
.export summary:hover { border-color: var(--muted); }
.export-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; width: 220px; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.export-pop label { display: flex; align-items: center; gap: 6px; }
.export-pop select { flex: 1; padding: 3px; }
.export-host .plot-all { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.export-host .plot-all .plot-main { margin: 0; }
.lvl-lead { stroke: var(--parcel); stroke-width: 0.7; stroke-dasharray: 1 3; }
.hv { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.hv-t { fill: var(--t); }
.hv-td { fill: var(--td); }
.halo.hv { fill: none; }

.plot-bg { fill: var(--surface); }
.plot-frame { fill: none; stroke: var(--muted); stroke-width: 0.8; }
.g-p { stroke: var(--g-p); stroke-width: 0.7; fill: none; }
.g-iso { stroke: var(--g-iso); stroke-width: 0.8; }
.g-hi0 { stroke: var(--g-0); stroke-width: 1.7; }
.g-hi20 { stroke: var(--g-20); stroke-width: 1.7; }
.iso-l { font-size: 10px; font-weight: 600; }
.g-hi0-t { fill: var(--g-0); }
.g-hi20-t { fill: var(--g-20); }
.tick-hi { font-weight: 700; fill: var(--text); }
.ground { fill: var(--bg); opacity: 0.8; }
.g-trop { stroke: var(--g-trop); stroke-width: 1.4; stroke-dasharray: 8 4; }
.ctr-line { fill: none; stroke: var(--av-con); stroke-width: 1.4; stroke-dasharray: 2 3; }
.ctr-line.ctr-wet { stroke-dasharray: 7 3; }
.ctr-l { fill: var(--av-con); }
.cb-top { stroke: var(--parcel); stroke-width: 1.4; stroke-dasharray: 3 3; }
.cb-l { fill: var(--parcel); font-size: 11px; font-weight: 600; }
.av-strip { fill: var(--surface); opacity: 0.5; }
.av-h { fill: var(--muted); font-size: 10px; font-weight: 700; }
.av-ice { fill: var(--av-ice); } .av-turb { fill: var(--av-turb); } .av-con { fill: var(--av-con); }
.av-c1 { opacity: 0.35; } .av-c2 { opacity: 0.65; } .av-c3 { opacity: 1; }
.av-lee { fill: none; stroke: var(--lw1); stroke-width: 1.6; }
.av-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 3px; }
span.av-key.av-ice, i.av-key.av-ice { background: var(--av-ice); } span.av-key.av-turb, i.av-key.av-turb { background: var(--av-turb); }
span.av-key.av-con, i.av-key.av-con { background: var(--av-con); }
i.av-key + i.av-key { margin-left: -1px; }
.av-key.av-lee-k { width: 12px; border: 1.6px solid var(--lw1); background: none; }
.av-legend { display: none; margin: 0; padding: 4px 10px 7px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
:root[data-mode="aviation"] .av-legend, :root[data-mode="waves"] .av-legend { display: block; }
:root[data-mode="waves"] .av-legend .av-only { display: none; }
.av-legend > span { white-space: nowrap; margin-right: 12px; display: inline-block; }
.av-legend > span b { color: var(--ink); margin-right: 3px; }
.av-legend > b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.trop-l { fill: var(--g-trop); font-size: 11px; font-weight: 600; }
.axh { font-weight: 600; }
.g-dry { stroke: var(--g-dry); stroke-width: 0.8; fill: none; }
.g-moist { stroke: var(--g-moist); stroke-width: 0.9; fill: none; stroke-dasharray: 5 3; }
.g-mix { stroke: var(--g-mix); stroke-width: 0.7; fill: none; stroke-dasharray: 2 3; }
.g-mixl { fill: var(--g-mix); font-size: 9px; }
.tick { fill: var(--muted); font-size: 10px; }
.mark { fill: var(--text); font-size: 11px; font-weight: 600; }
.halo { stroke: var(--surface); stroke-width: 3; paint-order: stroke; }
.t { }
.spread-t { fill: var(--t); opacity: 0.16; stroke: none; } .spread-td { fill: var(--td); opacity: 0.16; stroke: none; }
.hodo-spread { fill: var(--muted); opacity: 0.2; stroke: none; }
path.t { fill: none; stroke: var(--t); stroke-width: 2; stroke-linejoin: round; }
path.td { fill: none; stroke: var(--td); stroke-width: 2; stroke-linejoin: round; }
.pin-t { fill: none; stroke-width: 1.4; stroke-linejoin: round; opacity: 0.55; }
.pin-td { fill: none; stroke-width: 1.4; stroke-dasharray: 5 3; stroke-linejoin: round; opacity: 0.55; }
.pin-t.pin-prev, .pin-td.pin-prev { stroke-width: 2; }
.pinline { fill: none; stroke-width: 1.2; opacity: 0.55; }
.tw { fill: none; stroke: var(--tw); stroke-width: 1.4; }
.w-bg { fill: var(--bg); }
.w-axis { stroke: var(--muted); stroke-width: 0.7; }
.w-up { fill: var(--w-up); }
.w-dn { fill: var(--w-dn); }
.w-oup { fill: none; stroke: var(--w-up); stroke-width: 0.8; }
.w-odn { fill: none; stroke: var(--w-dn); stroke-width: 0.8; }
.barb { fill: none; stroke: var(--barb, var(--text)); stroke-width: 1.05; }
.barbf { fill: var(--barb, var(--text)); stroke: none; }
.barb-key { fill: var(--barb, var(--text)); }
.parcel { fill: none; stroke: var(--parcel); stroke-width: 1.6; }
.parcel-q { stroke-width: 1.2; opacity: 0.8; }
.parcel-e { fill: none; stroke: var(--parcel-e); stroke-width: 1.8; }
.cape-head { margin: 10px 0 6px 0; }
.con { fill: none; stroke: var(--parcel); stroke-width: 1.2; stroke-dasharray: 5 3; }
.con-iso { stroke: var(--parcel); stroke-width: 0.7; stroke-dasharray: 2 3; }
.cape { fill: var(--cape); }
.cin { fill: var(--cin); }
.dot { fill: var(--parcel); }
.dot-tw { fill: var(--tw); }
.fog { fill: none; stroke: var(--fog); stroke-width: 1.5; stroke-dasharray: 6 3; }
.fogc { stroke-width: 2; }
.dot-fog { fill: var(--fog); stroke: var(--surface); stroke-width: 1.2; }
.handle { stroke: var(--surface); stroke-width: 1.5; pointer-events: none; }
.handle-hit { fill: transparent; cursor: grab; touch-action: none; }
.handle-hit:active { cursor: grabbing; }
.h-t { fill: var(--t); }
.h-td { fill: var(--td); }
.h-f { stroke: var(--fog); stroke-width: 1.5; }

.panel { max-height: var(--avail, calc(100vh - 95px)); overflow-y: auto; }
.plot-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.plot-main { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin-bottom: 12px; }
.plot-head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px 4px; }
.plot-head-note { color: var(--muted); font-size: 11.5px; }
.lg-i { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.plot-main svg.lg-ic, .lg-ic { width: 12px; height: 12px; max-height: none; flex: none; display: inline-block; overflow: visible; }
.sm-k { color: var(--accent); }
.plot-main svg { width: 100%; height: auto; max-height: 470px; display: block; }
#panel .plot-main svg.hodo { width: 80%; margin: 0 auto; } /* a fifth smaller, to keep more of the summary in view */
.mini-t { fill: var(--text); font-size: 13px; font-weight: 600; }
.mini-u { fill: var(--muted); font-weight: 400; font-size: 11px; }
.mini-l { fill: none; stroke-linejoin: round; }
.plot-main .tick { font-size: 11px; }
.through { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.through > summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.through-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 8px 0 4px; }
.through-bar .hint { margin: 0; }
.through-bar [hidden] { display: none; }
.through-plot { min-height: 40px; }
.through-plot svg { display: block; max-width: 100%; height: auto; }
.through-plot .note { color: var(--muted); font-size: 12px; margin: 8px 0; }
.tp-day { stroke: var(--muted); stroke-width: 0.8; stroke-dasharray: 2 3; }
.tp-dayname { font-weight: 600; }
.tp-iso { fill: none; stroke: var(--g-0); stroke-width: 1; stroke-dasharray: 5 3; }
.tp-iso0 { fill: none; stroke: var(--g-0); stroke-width: 2; }
.tp-isol { fill: var(--g-0); font-size: 10px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.tp-isol.b { font-weight: 700; }
.tp-ground { fill: var(--muted); opacity: 0.35; }
.tp-now { stroke: var(--accent); stroke-width: 2; opacity: 0.8; }
.tp-ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.tp-refl { font-size: 9.5px; }
.tp-flag { fill: var(--lw1); opacity: 0.16; }
.tp-val { fill: var(--accent); font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.tp-hit { fill: transparent; cursor: pointer; }
.tp-hit:hover { fill: var(--accent); fill-opacity: 0.08; }
.ring { fill: none; stroke: var(--muted); stroke-width: 0.7; }
.ring2 { fill: none; stroke: var(--g-p); stroke-width: 0.6; stroke-dasharray: 2 2; }
.hodo-l { fill: none; stroke-width: 2.6; stroke-linejoin: round; }
.hodo-pin { fill: none; stroke-width: 1.4; opacity: 0.55; }
path.h1 { stroke: var(--h1); } path.h3 { stroke: var(--h3); } path.h6 { stroke: var(--h6); } path.h9 { stroke: var(--h9); } path.h12 { stroke: var(--h12); }
.sm { fill: none; stroke: var(--muted); stroke-width: 1.2; }
.smv { stroke: var(--muted); stroke-width: 1.6; }
.legend-h { display: flex; flex-wrap: wrap; gap: 1px 10px; font-size: 11.5px; line-height: 1.35; margin: 3px 4px 2px; font-weight: 600; }
span.h1 { color: var(--h1); } span.h3 { color: var(--h3); } span.h6 { color: var(--h6); } span.h9 { color: var(--h9); } span.h12 { color: var(--h12); }
.sm-text { color: var(--muted); font-weight: 400; }
table.t { border-collapse: separate; border-spacing: 0; background: var(--surface); font-size: 12.5px; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 8px; }
table.t.wide { width: 100%; margin-bottom: 14px; }
table.t caption { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 0 2px 5px; }
table.t caption i { text-transform: none; letter-spacing: 0; font-size: 11.5px; }
table.t i { font-style: normal; color: var(--muted); font-size: 11.5px; font-weight: 400; }
table.t thead i { display: block; font-size: 10.5px; }
table.t th { font-weight: 500; text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
table.t thead th { text-align: right; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--soft); }
table.t thead th:first-child { border-top-left-radius: 7px; }
table.t thead th:last-child { border-top-right-radius: 7px; }
table.t td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t tr:last-child > th, table.t tr:last-child > td { border-bottom: 0; }
table.t td[colspan] { white-space: normal; text-align: left; color: var(--muted); }
table.t .hl, table.t td.hl, table.t tr.hl td, table.t tr.hl th { background: var(--hl); }
table.t td.val { font-weight: 700; }
table.t td.val i { margin-left: 4px; font-weight: 400; }
table.compare th { font-size: 13px; }
.more { margin: 4px 0 12px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
table.dense { font-size: 11.5px; }
table.dense th, table.dense td { padding: 3px 3px; }
.more summary { cursor: pointer; font-weight: 600; font-size: 12.5px; padding: 7px 0; color: var(--text); }
.more summary::marker { color: var(--muted); }
.more[open] { padding-bottom: 10px; }
.more[open] summary { margin-bottom: 6px; }
.more table.t { background: var(--surface); }
.note-row { font-size: 12.5px; margin: 0 0 12px; }
.note-row b { color: var(--g-trop); font-weight: 600; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.t-grid table { width: 100%; }
/* Tables of different heights packed in columns, without the gaps a grid row leaves. */
.t-cols { columns: 2 260px; column-gap: 12px; }
.t-cols > table { width: 100%; break-inside: avoid; margin: 0 0 12px; display: table; }
.t.winter-sum th { width: 40%; }
.t.winter-sum td { text-align: left; white-space: normal; }
.t.winter-sum td i { color: var(--muted); font-style: normal; }
.t.hz-sum th { width: 24%; }
.t.hz-sum td { text-align: left; white-space: normal; }
.t.hz-sum td:nth-child(2) { width: 1%; white-space: nowrap; }
.t.hz-sum td b { font-weight: 700; }
/* Contrails: short-lived outlined, persistent filled, in the strip's purple. */
.con-1 { border-color: var(--av-con); color: var(--av-con); }
.t.conv-sum { margin-bottom: 14px; }
.t.conv-sum th { width: 30%; }
.conv-sum td:nth-child(2) .risk + .risk { margin-left: 4px; }
/* CIN in cap colours: blue-grey deepening as the lid strengthens, so it does not read as a hazard. */
.cin-1 { color: var(--muted); }
.cin-2 { border-color: var(--cap); color: var(--cap); }
.cin-3 { background: var(--cap); border-color: var(--cap); color: var(--cap-on); }
/* On a phone each row is the name and badge on one line, the detail full width beneath. */
@media (max-width: 560px) {
  .t.conv-sum, .t.conv-sum tbody, .t.conv-sum caption { display: block; }
  .t.conv-sum tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .t.conv-sum tr th { width: auto; border-bottom: 0; }
  .t.conv-sum tr td:nth-child(2) { width: auto; border-bottom: 0; }
  .t.conv-sum tr td:nth-child(3) { grid-column: 1 / -1; padding-top: 0; }
}
.pe-t { white-space: nowrap; color: var(--muted); margin-right: 6px; }
.pe-t.pe-ok { color: var(--text); font-weight: 600; }
.pe-t.pe-ok::first-letter { color: var(--ok); }

.con-2 { background: var(--av-con); border-color: var(--av-con); color: var(--con-on); }
.boyden { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 14px; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.boyden input { width: 72px; padding: 2px 4px; text-align: right; }
.readout { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 11px; padding: 7px 10px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--parcel); border-radius: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.readout-f { border-color: var(--fog); }
.readout-m { border-color: var(--accent); }
.fog-t { font-weight: 600; color: var(--fog); }
.readout-note { flex-basis: 100%; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.cape-t { font-weight: 600; color: var(--parcel); }
.cin-t { font-weight: 600; color: var(--accent); }
.verdict { font-weight: 600; font-size: 13px; margin: 12px 0 8px; }
.notes { margin: 6px 0; padding-left: 18px; font-size: 13px; }
.panel .hint { font-size: 12px; margin: -6px 2px 14px; }
.foot { padding: 8px 14px 12px; color: var(--muted); font-size: 11px; }
@media (min-width: 761px) {
  .side { max-height: var(--avail, none); overflow-y: auto; }
}
@media (max-width: 1250px) {
  .layout { grid-template-columns: 320px 1fr; } /* wide enough for "1. Convection" in bold */
  .panel { grid-column: 1 / -1; max-height: none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 8px 16px; }
  .map-wrap { width: min(100%, 39vh); margin: 0 auto; } /* 60vh tall at the map's shape */
  table.t.wide.dense th, table.t.wide.dense td { padding: 3px 2px; }
}

/* ? tips and their box */
.tip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 10.5px; font-weight: 700; line-height: 1; cursor: help; vertical-align: 1px; user-select: none; flex: none; font-style: normal; }
.tip:hover, .tip:focus-visible { border-color: var(--accent); color: var(--accent); }
#tipbox { position: fixed; z-index: 50; max-width: min(320px, calc(100vw - 16px)); padding: 7px 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22); font-size: 12.5px; line-height: 1.4; pointer-events: none; }
.help-link { color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; }
.help-link:hover { text-decoration: underline; }

.field-row { display: flex; align-items: center; gap: 6px; }
.field-row .field { flex: 1; }

table.t caption .tip { margin-left: 4px; }
.more summary + .tip { margin-left: 4px; }
.plot-tabs .tip { margin-left: auto; }
.boyden .tip { order: -1; }
/* Readouts in the plot's top right corner */
.inset { font-size: 11px; font-variant-numeric: tabular-nums; }
.inset-bg { fill: var(--surface); fill-opacity: 0.93; stroke-width: 1.2; }
.inset-n .inset-bg { stroke: var(--parcel); }
.inset-m .inset-bg { stroke: var(--accent); }
.inset-h { fill: var(--text); font-weight: 700; }
.inset-t { fill: var(--text); }
.inset-cape { fill: var(--parcel); font-weight: 600; }
.inset-steer { fill: var(--accent); font-weight: 600; }
.inset-btn { fill: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }
.inset-tip { cursor: help; }
.inset-tip circle { fill: var(--surface); stroke: var(--muted); }
.inset-tip text { fill: var(--muted); font-size: 10px; font-weight: 700; }
.sr-l { fill: var(--accent); }
/* Storm motion */
.sm-box { padding: 5px 7px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12.5px; }
.card-h { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.sm-row .seg button { padding: 2px 6px; }
/* Title and buttons on one row, so the box is two lines high. */
.sm-box .card-h { text-transform: none; letter-spacing: 0; font-size: 12px; gap: 4px; }
.sm-in { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.sm-in input { width: 58px; padding: 2px 4px; text-align: right; }
.sm-line { margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-line i { color: var(--muted); font-style: normal; font-size: 11px; }
.sm-on { stroke: var(--accent); stroke-width: 2; fill: var(--accent); fill-opacity: 0.25; }
.sm-c { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.sm-ct { fill: var(--accent); font-weight: 600; }
.ground-x { stroke: var(--text); stroke-width: 1.6; }

/* Winter: Bourgouin's areas, the ground set, the risk badges and the ground-height box */
.bg-warm { fill: var(--bg-warm); fill-opacity: 0.22; stroke: var(--bg-warm); stroke-opacity: 0.5; stroke-width: 0.8; }
.bg-cold { fill: var(--bg-cold); fill-opacity: 0.2; stroke: var(--bg-cold); stroke-opacity: 0.5; stroke-width: 0.8; }
.bg-l { font-size: 10.5px; font-weight: 600; } .bg-warm-t { fill: var(--bg-warm); } .bg-cold-t { fill: var(--bg-cold); }
.gh-line { stroke: var(--gh); stroke-width: 1.6; stroke-dasharray: 7 4; }
.gh-l { font-size: 11px; font-weight: 700; fill: var(--gh); }
.wbfl-line { stroke: var(--wbfl); stroke-width: 1.4; stroke-dasharray: 6 4; }
.wbfl-dot { fill: var(--wbfl); }
.wbfl-l { font-size: 11px; font-weight: 700; fill: var(--wbfl); }
.mixdown { fill: none; stroke: var(--mix); stroke-width: 1.5; stroke-dasharray: 5 3; } .mixdown-2 { stroke-dasharray: 2 3; }
.mix-l { font-size: 10.5px; font-weight: 600; fill: var(--mix); }
.ground-box { margin: 10px 0 14px; padding: 9px 12px; border: 1px solid var(--line); border-left: 4px solid var(--mode); border-radius: 8px; background: var(--surface); font-size: 12.5px; }
.ground-box .gb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13.5px; }
.ground-box input { width: 84px; padding: 3px 6px; text-align: right; font-size: 14px; font-weight: 700; border-color: var(--mode); }
.ground-box .gb-note { margin: 6px 0 0; color: var(--muted); line-height: 1.4; }
.ground-box .gb-note b { color: var(--text); }
.risk { display: inline-block; padding: 0 9px; border-radius: 999px; font-weight: 700; font-size: 12px; line-height: 19px; border: 1px solid var(--line); }
.risk-0 { color: var(--muted); }
.risk-1 { background: var(--risk1); border-color: var(--risk1); color: var(--risk-on); }
.risk-2 { background: var(--risk2); border-color: var(--risk2); color: var(--risk-on); }
.risk-3 { background: var(--risk3); border-color: var(--risk3); color: #fff; }
/* Precipitation type, in the map's colours; the freezing types in the risk colours. */
.pt-snow { background: var(--pt-snow); border-color: var(--pt-snow); color: var(--pt-snow-on); }
.pt-mix { background: var(--pt-mix); border-color: var(--pt-mix); color: var(--pt-mix-on); }
.pt-rain { background: var(--pt-rain); border-color: var(--pt-rain); color: var(--pt-rain-on); }
/* RAF / NATO colour states for visibility: BLU, WHT, GRN, YLO1, YLO2, AMB, RED. */
.cst { font-family: inherit; letter-spacing: .02em; }
.cst-big { font-size: 15px; line-height: 26px; padding: 0 14px; letter-spacing: .06em; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
tr.cst-overall th { font-weight: 700; font-size: 13.5px; }
tr.cst-overall th, tr.cst-overall td { padding-top: 9px; padding-bottom: 9px; border-top: 2px solid var(--line); }
.cst-blu { background: #1c7ed6; border-color: #1c7ed6; color: #fff; }
.cst-wht { background: #fff; border-color: #adb5bd; color: #1d1d1d; }
.cst-grn { background: #2f9e44; border-color: #2f9e44; color: #fff; }
.cst-ylo1 { background: #ffe066; border-color: #ffe066; color: #1d1d1d; }
.cst-ylo2 { background: #fcc419; border-color: #fcc419; color: #1d1d1d; }
.cst-amb { background: #f08c00; border-color: #f08c00; color: #1d1d1d; }
.cst-red { background: #e03131; border-color: #e03131; color: #fff; }
:root[data-theme="dark"] .cst-wht { border-color: #f1f3f5; background: #f1f3f5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cst-wht { border-color: #f1f3f5; background: #f1f3f5; } }
/* Cold hazards (frost, wind chill): blues, deeper for colder. */
.cold-1 { background: var(--cold1); border-color: var(--cold1); color: var(--cold1-on); }
.cold-2 { background: var(--cold2); border-color: var(--cold2); color: var(--cold2-on); }
.cold-3 { background: var(--cold3); border-color: var(--cold3); color: var(--cold3-on); }
/* Chance of snow, in the Lowndes bands: paler for less likely. */
.cs-0 { color: var(--muted); }
.cs-1 { background: var(--cs1); border-color: var(--cs1); color: var(--cs-on); }
.cs-2 { background: var(--cs2); border-color: var(--cs2); color: var(--cs-on); }
.cs-3 { background: var(--cs3); border-color: var(--cs3); color: #0b2730; }
.cs-4 { background: var(--cs4); border-color: var(--cs4); color: var(--cs4-on); }
table.ptype td, table.slr td, table.fzdz td { white-space: normal; }
table.slr tr.pick th { font-weight: 700; } table.slr tr.pick td { font-weight: 700; }
table.t .muted { color: var(--muted); font-size: 11.5px; }
ul.ings { list-style: none; margin: 2px 0; padding: 0; color: var(--text); }
ul.ings li { margin: 3px 0; line-height: 1.35; padding-left: 18px; text-indent: -18px; }
ul.ings li span { display: inline-block; width: 18px; text-indent: 0; font-weight: 700; }
.ing-ok span { color: var(--ok); } .ing-no span { color: var(--no); } .ing-mid span { color: var(--risk2); }

/* Badge legends: a tap on a summary badge lists every badge that could fill its space (legend.js) */
.risk[data-lg] { cursor: pointer; }
.risk[data-lg]:hover { filter: brightness(1.06); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.risk[data-lg]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.risk[data-lg][aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent); }
.risk.cst-big[data-lg]:hover, .risk.cst-big[data-lg][aria-expanded="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--accent); }
.lg-pop { position: fixed; z-index: 30; width: max-content; max-width: min(340px, calc(100vw - 16px)); padding: 8px 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); font-size: 12px; line-height: 1.35; }
.lg-pop .lg-h { font-weight: 700; margin-bottom: 6px; }
.lg-pop ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; }
.lg-pop li { display: contents; }
.lg-pop li > span:first-child { justify-self: start; white-space: nowrap; }
.lg-pop li.lg-now > span:last-child { font-weight: 700; }
.lg-pop li.lg-now > span:first-child { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.lg-pop p { margin: 7px 0 0; color: var(--muted); }

/* Signals (signals.js): counts on the mode buttons, rings on the map, the list over the map, the note
   above a tab's summary and the badges behind it */
.modes { padding-right: 6px; } /* room for the flag numbers of the right-hand column, which sit 5px outside their buttons */
.modes button { position: relative; overflow: visible; }
.modes .mode-l { display: block; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.modes button .sig-n { position: absolute; top: -7px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--c); color: #fff; border: 1.5px solid var(--surface); font-size: 10px; font-weight: 700; line-height: 13px; text-align: center; box-sizing: border-box; }
.modes button .sig-n.later { min-width: 10px; width: 10px; height: 10px; top: -4px; right: -3px; padding: 0; background: var(--surface); border: 2px solid var(--c); }
.modes button[aria-pressed="true"] .sig-n { background: var(--surface); color: var(--c); border-color: var(--c); }
/* Flag rings: the mode's colour over a white halo, which keeps them clear on every field and theme, with a
   dark edge round the group (set in app.js, scaled with the zoom). */
.sig-halo { fill: none; stroke: #fff; stroke-width: 3.6; opacity: 0.95; pointer-events: none; }
.sig-ring { fill: none; stroke: var(--mode, var(--accent)); stroke-width: 2; pointer-events: none; }
.sig-halo.muted { stroke-width: 2.4; opacity: 0.5; }
.sig-ring.muted { stroke: #6b7280; stroke-width: 1; }
.modes button .sig-n.muted { background: var(--muted); }
.modes button .sig-n.muted.later { background: var(--surface); border-color: var(--muted); }
.modes button[aria-pressed="true"] .sig-n.muted { background: var(--surface); color: var(--muted); border-color: var(--muted); }
.sig-btn { position: absolute; top: 7px; left: 7px; z-index: 2; padding: 2px 8px; font-size: 11.5px; font-weight: 600; line-height: 18px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.sig-btn b { color: var(--mode, var(--accent)); }
.sig-btn[aria-expanded="true"] { border-color: var(--accent); }
.sig-pop { position: absolute; top: 36px; left: 7px; right: 7px; z-index: 7; max-height: min(360px, 70vh); overflow-y: auto; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); font-size: 12px; }
.sig-h { font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.sig-tab { margin: 8px 0 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c); }
.sig-row { margin: 0 0 4px; }
.sig-line { display: flex; align-items: stretch; gap: 4px; margin: 0 0 4px; }
.sig-row > .sig-line { margin: 0; }
.sig-line > .sig-trig, .sig-line > .sig-item { flex: 1; min-width: 0; margin: 0; }
.sig-mute { flex: none; align-self: center; padding: 1px 6px; font-size: 10.5px; line-height: 16px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.sig-mute:hover { color: var(--text); border-color: var(--muted); }
.sig-mute[aria-pressed="true"] { background: var(--surface); border-color: var(--muted); color: var(--text); border-style: dashed; }
.sig-row.muted .sig-trig, .sig-line.muted .sig-item { --c: var(--muted); opacity: 0.6; filter: grayscale(1); }
.sig-row.muted .sig-trig:hover, .sig-line.muted .sig-item:hover { opacity: 0.85; }
.sig-btn.all-muted b { color: var(--muted); }
.sig-h .sig-all { margin-left: auto; }
.sig-x { display: inline-block; margin-right: 3px; padding: 0 5px; border-radius: 3px; font-style: normal; font-size: 10px; font-weight: 700; line-height: 15px; letter-spacing: .02em; color: var(--text); background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.sig-x-veryisol { background: transparent; border-style: dashed; }
.sig-x-wdspr { color: #fff; background: var(--c); border-color: var(--c); }
.sig-x-ctx { color: var(--muted); background: transparent; border-color: var(--line); font-weight: 600; }
.sig-up { display: inline-block; margin-right: 5px; padding: 0 5px; border-radius: 3px; font-style: normal; font-size: 10px; font-weight: 700; line-height: 15px; color: #fff; background: #c62828; }
.sig-trig { display: grid; gap: 1px; width: 100%; text-align: left; padding: 5px 24px 5px 8px; position: relative; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 5px; line-height: 1.3; font-size: 12px; }
.sig-trig::after { content: "▸"; position: absolute; right: 8px; top: 6px; color: var(--muted); }
.sig-trig[aria-expanded="true"]::after { content: "▾"; }
.sig-trig:hover { background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.sig-trig span { color: var(--text); }
.sig-trig i { font-style: normal; color: var(--muted); font-size: 11px; }
.sig-gs { margin: 3px 0 6px 10px; padding-left: 6px; border-left: 1px dashed color-mix(in srgb, var(--c) 45%, transparent); }
.sig-more { display: block; width: 100%; padding: 4px 8px; font-size: 11.5px; color: var(--muted); border: 1px dashed var(--line); border-radius: 5px; text-align: left; }
.sig-more:hover { color: var(--text); border-color: var(--c); }
.sig-item { display: grid; gap: 1px; width: 100%; text-align: left; padding: 5px 8px; margin: 0 0 4px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 5px; line-height: 1.3; font-size: 12px; }
.sig-item:hover { background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.sig-item span { color: var(--text); }
.sig-item i { font-style: normal; color: var(--muted); font-size: 11px; }
.sig-note { margin: 0 0 10px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--mode, var(--accent)) 55%, transparent); border-left: 4px solid var(--mode, var(--accent)); border-radius: 6px; background: color-mix(in srgb, var(--mode, var(--accent)) 8%, var(--surface)); font-size: 12.5px; line-height: 1.4; }
.sig-note-h { font-weight: 700; color: var(--mode, var(--accent)); display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.sig-note ul { margin: 0; padding-left: 16px; display: grid; gap: 2px; }
.sig-note li .tip { width: 14px; height: 14px; font-size: 9.5px; margin-left: 2px; }
.sig-note p { margin: 6px 0 0; color: var(--muted); font-size: 11.5px; }
.risk.sig-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--mode, var(--accent)); }

/* Surface ob: a popover in the bar like Export, and a note above the tables while an ob is applied. */
.export.ob { margin-left: auto; }
.export.ob + .export { margin-left: 0; }
.ob.on summary { border-color: var(--accent); color: var(--accent); }
.ob.on summary::before { content: "● "; font-size: 9px; vertical-align: 1px; }
.ob-pop { width: 280px; }
.ob-pop .ob-paste { font-weight: 600; font-size: 12px; }
.ob-pop textarea { width: 100%; box-sizing: border-box; resize: vertical; font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 5px 6px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.ob-grid label { display: flex; flex-direction: column; align-items: stretch; gap: 2px; font-size: 12px; }
.ob-grid label i { font-style: normal; color: var(--muted); }
.ob-grid input { width: 100%; box-sizing: border-box; padding: 3px 5px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font-variant-numeric: tabular-nums; }
.ob-grid input::placeholder { color: var(--muted); opacity: 0.7; }
.ob-pop .hint { margin: 0; }
.ob-btns { display: flex; gap: 8px; justify-content: space-between; }
.ob-btns #ob-apply { font-weight: 600; }
.pin-t.pin-orig, .pin-td.pin-orig { stroke-dasharray: 5 3; }
.ob-note { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--accent); border-left-width: 4px; border-radius: 6px; background: var(--surface); font-size: 12.5px; line-height: 1.45; }
.ob-note p { margin: 0 0 4px; }
.ob-note i { font-style: normal; color: var(--muted); }
.ob-chg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-variant-numeric: tabular-nums; }
.ob-note .link-btn { padding: 0; }

/* Flags: the view switch, the briefing, and the counts under the time slider. */
.sig-view button { font-size: 11px; padding: 2px 9px; }
.sig-copy { margin-left: auto; }
.sig-none { margin: 8px 2px; }
.sig-day h4 { margin: 10px 2px 4px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sig-areas h4 { margin-top: 4px; }
.sig-a.muted { --c: var(--muted); opacity: 0.6; filter: grayscale(1); }
.sig-kinds h4 { margin-bottom: 4px; }
.sig-day:first-of-type h4 { margin-top: 4px; }
.sig-b .sig-pk { color: var(--muted); }
.time-flags { position: relative; height: 15px; margin: 4px 0 -4px; }
.time-flags .tf { position: absolute; bottom: 0; width: 6px; margin-left: -3px; padding: 0; border: 0; border-radius: 2px 2px 0 0; background: var(--mode); opacity: 0.8; cursor: pointer; }
.time-flags .tf.muted { background: var(--muted); opacity: 0.45; }
.time-flags .tf.now { opacity: 1; box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 2.5px var(--mode); }
.time-flags .tf:hover { opacity: 1; }

/* Cross-section */
.xs-form { display: flex; align-items: center; gap: 6px; flex: 1 1 300px; min-width: 0; }
.xs-form input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); }
#xs-pick[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.xs-cap { margin: 6px 0 2px; font-size: 12.5px; font-weight: 600; }
.xs-cap span { font-weight: 400; color: var(--muted); margin-left: 6px; }
.through-plot .note.warn { color: var(--text); border-left: 3px solid var(--lw1); padding-left: 8px; }
.xs-th { fill: none; stroke: var(--muted); stroke-width: 0.8; opacity: 0.75; }
.xs-turb { fill: var(--av-turb); stroke: none; }
.xs-turb.c1 { opacity: 0.28; }
.xs-turb.c2 { opacity: 0.55; }
.xs-cb { fill: var(--accent); stroke: var(--surface); stroke-width: 1; }
.xs-route { fill: none; stroke: var(--accent); stroke-linejoin: round; stroke-linecap: round; opacity: 0.9; pointer-events: none; }
.xs-wp { fill: var(--surface); stroke: var(--accent); pointer-events: none; }
#map.picking { cursor: crosshair; }
.xs-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.xs-bar span { flex: 1 1 auto; }
.xs-bar[hidden] { display: none; }
.xs-key { margin: 0 0 2px; font-size: 11.5px; color: var(--muted); }
.xs-key .av-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; opacity: 0.55; vertical-align: -1px; }
.xs-cbk { color: var(--accent); }
.xs-g { transition: opacity .25s; }
.xs-g.faded { opacity: .3; }
.xs-route-h { fill: none; stroke: var(--surface); stroke-linejoin: round; stroke-linecap: round; opacity: 0.85; pointer-events: none; }
/* Cross-section layers: lines over the shading, each in a theme colour, and their labels */
.xs-te { fill: none; stroke: var(--parcel); stroke-width: 1.1; }
.xs-rh { fill: none; stroke: var(--td); stroke-width: 1.3; stroke-dasharray: 5 3; }
.xs-spd { fill: none; stroke: var(--av-con); stroke-width: 1.3; }
.xs-wup { fill: none; stroke: var(--w-up); stroke-width: 1.2; }
.xs-wdn { fill: none; stroke: var(--w-dn); stroke-width: 1.2; stroke-dasharray: 4 3; }
.xs-ice { fill: none; stroke: var(--av-ice); stroke-width: 2; }
.tp-isol.xs-th-l { fill: var(--muted); font-size: 9px; }
.tp-isol.xs-te-l { fill: var(--parcel); font-size: 9.5px; }
.tp-isol.xs-rh-l { fill: var(--td); font-size: 9.5px; }
.tp-isol.xs-spd-l { fill: var(--av-con); font-size: 9.5px; font-weight: 600; }
.tp-isol.tp-iso0-l { font-weight: 700; }
.xs-key { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.xs-key > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.xs-sw { width: 22px; height: 10px; flex: none; }
.xs-sw.w2 { width: 42px; }
.xs-swb { fill: none; stroke: var(--text); stroke-width: 1.2; }
.xs-opts { margin-left: 0; }
.xs-pop { width: 260px; }
.xs-pop fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0; padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; }
.xs-pop legend { font-size: 11.5px; color: var(--muted); padding: 0 4px; }
.xs-pop fieldset label { font-size: 12.5px; }
.xs-pop .link-btn { align-self: flex-start; }
.xs-pop [hidden] { display: none; }
/* The Layers popover hangs from the right of the whole bar, wherever its button wraps to. */
#xsec .through-bar { position: relative; }
.export.xs-opts { position: static; }
.xs-pop { right: 0; max-width: calc(100% - 4px); }
label.check { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.through-bar .check[hidden] { display: none; }
.tp-cap { margin: 4px 0 0; }
.tp-cap span { margin-left: 0; }
