/* Weather Map Practice: a forecaster's desk. Newsprint page, slate ink, a deep teal accent; the map keeps the NWS
   colors (blue cold front, red warm front, purple occlusion) on screen and prints in black. */
:root {
  --bg: #f3f0e8;
  --panel: #fffdf8;
  --ink: #16202a;
  --muted: #4b5661;
  --line: #cfc9bb;
  --accent: #0d6466;
  --accent-ink: #ffffff;
  --ok: #1d6a37;
  --ok-soft: #e1f0e5;
  --close: #8a5a00;
  --close-soft: #f6ecd6;
  --bad: #a32020;
  --bad-soft: #f8e3e1;
  --focus: #1a5fb4;
  --map-land: #fbfaf5;
  --map-sea: #dcebf3;
  --map-ink: #121212;
  --cold: #1f5fbf;
  --warm: #cc2b24;
  --occl: #7b3fa0;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cond: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --r: 2px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121820;
    --panel: #1a222c;
    --ink: #e5eaef;
    --muted: #a4b0bb;
    --line: #33404d;
    --accent: #5fc4c2;
    --accent-ink: #0b1a1a;
    --ok: #7fd394;
    --ok-soft: #1b3324;
    --close: #f0c066;
    --close-soft: #3a2f17;
    --bad: #f39a90;
    --bad-soft: #3d2120;
    --focus: #8ab8ff;
    --map-land: #eeece4;
    --map-sea: #cfdfe8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.hero { padding: 18px 0 8px; margin-bottom: 12px; display: grid; gap: 2px; border-left: 6px solid var(--accent); padding-left: 14px; }
h1 { font-family: var(--cond); font-stretch: condensed; font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.05; margin: 0 0 4px; letter-spacing: -0.01em; font-weight: 800; }
.lede { margin: 0; color: var(--muted); max-width: 66ch; }
h2 { font-family: var(--cond); font-stretch: condensed; font-size: 1.35rem; line-height: 1.2; margin: 0 0 10px; }

/* setup */
.setup { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; margin: 0 0 12px; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.seg button { font: inherit; font-size: 1rem; min-height: 44px; min-width: 52px; padding: 6px 14px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); font-weight: 700; }
.qdrop { position: relative; }
.qdrop summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 0.3em; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--panel); font-size: 0.95rem; }
.qdrop summary::-webkit-details-marker { display: none; }
.qdrop summary::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -3px 0 0 10px; }
.qdrop[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.qdrop fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.qpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 12px; padding: 10px 12px; margin-top: 6px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--panel); }
@media (min-width: 700px) { .qdrop[open] .qpick { position: absolute; z-index: 5; width: 520px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.15); } }
.qc { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.qc input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

.btn { font: inherit; font-size: 0.95rem; min-height: 44px; padding: 6px 16px; border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--panel); color: var(--ink); cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 4px 12px; font-size: 0.9rem; }
.link { font: inherit; font-size: 0.95rem; background: none; border: 0; padding: 8px 4px; min-height: 44px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
select, input { font: inherit; font-size: 16px; color: var(--ink); background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r); min-height: 44px; padding: 6px 10px; max-width: 100%; }

.note { margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid var(--accent); background: var(--panel); }
.note.warn { border-left-color: var(--bad); }

/* map and questions */
.work { display: grid; gap: 16px; outline: none; }
.mapbox { margin: 0 -8px; background: var(--panel); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); padding: 6px 8px 8px; min-width: 0; }
@media (min-width: 600px) { .mapbox { margin: 0; padding: 8px 10px 10px; border: 1px solid var(--line); border-top: 3px solid var(--ink); } }
.maphead { display: flex; align-items: center; gap: 8px 12px; margin-bottom: 6px; flex-wrap: wrap; }
.maphead h2 { margin: 0; font-size: 1.15rem; }
.maphead h2 { margin-right: auto; }
.code { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.mapview { overflow: hidden; }
.mapview svg { display: block; width: 100%; height: auto; }
.mapbox.zoomed .mapview { overflow-x: auto; }
.mapbox.zoomed .mapview svg { width: 280%; max-width: none; }
@media (min-width: 900px) { #zoom { display: none; } .mapbox.zoomed .mapview svg { width: 100%; } }
@media (min-width: 1060px) {
  .work { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); align-items: start; }
  .mapbox { position: sticky; top: 10px; }
}
.mapjump { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 15; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: var(--r); background: var(--ink); color: var(--panel); font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.25); }
@media (min-width: 1060px) { .mapjump { display: none; } }

/* the map's symbols (screen); print overrides below */
svg text { font-family: var(--sans); }
svg .land { fill: var(--map-land); }
svg .sea { fill: var(--map-sea); }
svg .coast { fill: none; stroke: #7fa6bd; stroke-width: 0.4; }
svg .iso { fill: none; stroke: #4d4d4d; stroke-width: 0.35; stroke-linejoin: round; }
svg .isol { font-size: 5.2px; fill: #303030; paint-order: stroke; stroke: var(--map-land); stroke-width: 1.4px; stroke-linejoin: round; }
svg .fl { fill: none; stroke-width: 1.05; stroke-linejoin: round; }
svg .fl-cold { stroke: var(--cold); } svg .fl-warm { stroke: var(--warm); } svg .fl-occluded { stroke: var(--occl); }
svg .fs-cold, svg .ftri.fs-stationary { fill: var(--cold); }
svg .fs-warm, svg .fsemi.fs-stationary { fill: var(--warm); }
svg .fs-occluded { fill: var(--occl); }
svg .ctr { font-size: 11px; font-weight: 800; paint-order: stroke; stroke: var(--map-land); stroke-width: 1.6px; }
svg .lo { fill: #c0261f; } svg .hi { fill: #1d55b3; }
svg .am { font-size: 9px; font-weight: 700; font-style: italic; fill: #555; paint-order: stroke; stroke: var(--map-land); stroke-width: 1.2px; }
svg .cn { font-size: 5.2px; font-weight: 700; fill: var(--map-ink); paint-order: stroke; stroke: var(--map-land); stroke-width: 1.2px; }
svg .cdot { fill: var(--map-ink); }
svg .sky { fill: #fff; stroke: var(--map-ink); stroke-width: 0.45; }
svg .skyf { fill: var(--map-ink); }
svg .shaft, svg .barb { stroke: var(--map-ink); stroke-width: 0.5; stroke-linecap: round; }
svg .sv { font-size: 6px; fill: var(--map-ink); stroke: none; }
svg .svh { font-size: 6px; fill: var(--map-land); stroke: var(--map-land); stroke-width: 2.2px; stroke-linejoin: round; }
svg .lth { font-size: 7px; font-weight: 800; fill: var(--map-land); stroke: var(--map-land); stroke-width: 1.3px; stroke-linejoin: round; }
svg .stn .lt { stroke: none; }
svg .trs.halo { stroke: var(--map-land); stroke-width: 2.4; stroke-linecap: round; }
svg .wxhalo { fill: var(--map-land); }
svg .trs { stroke: var(--map-ink); stroke-width: 0.5; }
svg .wxl { fill: none; stroke: var(--map-ink); stroke-width: 0.45; }
svg .wxf { fill: var(--map-ink); }
svg .lt { font-size: 7px; font-weight: 800; fill: #8a2c00; paint-order: stroke; stroke: var(--map-land); stroke-width: 1.3px; stroke-linejoin: round; }
svg .pdot { fill: #8a2c00; }
svg .frame { fill: none; stroke: var(--map-ink); stroke-width: 0.5; }
svg .cap { font-size: 4.6px; fill: var(--ink); }
svg .sb-b { fill: var(--ink); } svg .sb-w { fill: var(--panel); stroke: var(--ink); stroke-width: 0.3; }
svg .na { stroke: var(--ink); stroke-width: 0.4; } svg .nh { fill: var(--ink); }
svg.stnbig { display: block; width: 230px; height: auto; background: var(--map-land); border: 1px solid var(--line); }
svg.stnbig .svh { stroke: var(--map-land); fill: var(--map-land); }

.qs { min-width: 0; }
.qs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.score { margin: 0; color: var(--muted); font-size: 0.95rem; }
.qlist { list-style: none; margin: 0; padding: 0; }
.q { padding: 12px 0 14px; border-top: 1px solid var(--line); }
.qt { margin: 0 0 8px; display: flex; gap: 10px; }
.qt .qmap { margin-left: auto; min-height: 32px; padding: 0 2px; align-self: flex-start; font-size: 0.9rem; }
@media (min-width: 1060px) { .qt .qmap { display: none; } }
.num { flex: none; width: 1.75em; height: 1.75em; display: inline-grid; place-items: center; font-weight: 800; font-size: 0.9rem; background: var(--ink); color: var(--panel); border-radius: var(--r); margin-top: 1px; }
.is-right .num { background: var(--ok); }
.is-wrong .num { background: var(--bad); }
.is-close .num { background: var(--close); }
.qbody { padding-left: calc(1.75em + 10px); }
.arow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ain { display: inline-flex; align-items: center; gap: 6px; }
.ain input { width: 7.5em; }
.unit { color: var(--muted); font-size: 0.95rem; }
.parts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 10px; align-items: center; margin: 8px 0; }
.parts > .plab { font-size: 0.95rem; }
.parts .pin { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.parts .pin input { width: 6.5em; }
.pmark { font-size: 0.85rem; font-weight: 700; }
.pmark.right { color: var(--ok); } .pmark.wrong, .pmark.unread { color: var(--bad); } .pmark.close { color: var(--close); }
.radios { display: grid; gap: 4px; margin: 4px 0 8px; }
.radios label { display: flex; gap: 8px; align-items: flex-start; min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; font-size: 0.95rem; }
.radios input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.stnwrap { margin: 2px 0 8px; }
.fb { margin: 8px 0 0; padding: 6px 10px; border-radius: var(--r); font-size: 0.95rem; }
.fb.right { background: var(--ok-soft); color: var(--ok); }
.fb.close { background: var(--close-soft); color: var(--close); }
.fb.wrong, .fb.unread { background: var(--bad-soft); color: var(--bad); }
.q details { margin-top: 6px; }
.q summary { cursor: pointer; color: var(--accent); font-size: 0.95rem; min-height: 32px; padding: 4px 0; }
.ans { margin: 6px 0 4px; }
.steps { margin: 0; padding-left: 1.2em; font-size: 0.95rem; color: var(--muted); }
.steps li { margin: 2px 0; }
.qs-foot { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }

/* share and print */
.share { margin: 22px 0 8px; padding: 14px 0; border-top: 3px solid var(--ink); }
.print-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.print-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.hint { color: var(--muted); font-size: 0.95rem; margin: 8px 0 0; }
.share-out label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.share-out input { width: 100%; }
.recent { margin-top: 12px; }
.recent summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.recent ul { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 4px 0; }
.recent small { display: block; color: var(--muted); }

/* content */
.content { max-width: 760px; margin: 18px 0 30px; }
.content h2 { margin-top: 26px; }
.content p { margin: 0 0 12px; }
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.faq p { margin: 4px 0 10px; }
.sources { font-size: 0.95rem; color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 16px 0 28px; font-size: 0.95rem; color: var(--muted); }
.indep { margin: 0 0 10px; }
.sb-footer p { margin: 0 0 8px; }
.sb-more a { color: var(--muted); }
.sb-credit a { color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 140%); max-width: min(92vw, 520px); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: var(--r); font-size: 0.95rem; transition: transform 0.2s; z-index: 20; }
.toast.on { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.print-root { display: none; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }

@media print {
  @page { margin: 11mm; }
  body { background: #fff; color: #000; font: 10pt/1.35 var(--sans); }
  main, footer, .toast, .skip, .mapjump { display: none !important; }
  .print-root { display: block; }
  .print-root .pt { width: 100%; border-collapse: collapse; }
  .print-root .pt > thead td { font-size: 8.5pt; color: #444; padding: 0 0 1.5mm; text-align: right; }
  .psheet, .pkey { break-after: page; }
  .print-root > section:last-child { break-after: auto; }
  /* answers-only keys run on, several maps to a page */
  .pkey.compact { break-after: auto; break-inside: avoid; margin-bottom: 7mm; }
  .ph { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.5pt solid #000; margin-bottom: 2mm; }
  .ph h2 { font-size: 15pt; margin: 0; font-family: var(--cond); }
  .ph p { margin: 0; font-size: 10pt; }
  .pmeta { display: flex; justify-content: space-between; margin: 0 0 2mm; font-size: 10pt; }
  .pmap { margin: 0 auto 2.5mm; }
  .pmap svg { display: block; width: 100%; height: auto; }
  .pq { margin: 0; padding-left: 5.5mm; column-count: 2; column-gap: 7mm; }
  .pq > li { break-inside: avoid; margin: 0 0 2mm; font-size: 9.3pt; line-height: 1.24; }
  .pq p { margin: 0; }
  .pans { margin-top: 1.3mm !important; }
  .popts { margin: 0.8mm 0 0; padding-left: 0; list-style: none; }
  .popts li { margin: 0 0 0.3mm; padding-left: 5mm; text-indent: -5mm; }
  .pdec { display: flex; gap: 3mm; align-items: flex-start; margin-top: 1mm; }
  .pdec svg.stnbig { width: 40mm; border: 0.5pt solid #000; background: #fff; flex: none; }
  .pdec table { border-collapse: collapse; font-size: 9pt; }
  .pdec td { border: 0.5pt solid #000; padding: 0.4mm 1.4mm; height: 5mm; }
  .pdec td:first-child { white-space: nowrap; }
  .pdec td.blankcell { width: 20mm; white-space: nowrap; }
  .blank { display: inline-block; vertical-align: baseline; height: 1em; border-bottom: 0.6pt solid #000; }
  .blank.w-s { width: 12mm; } .blank.w-m { width: 26mm; } .blank.w-fill { width: calc(100% - 20mm); }
  .blank.w-name { width: 50mm; } .blank.w-date { width: 25mm; } .blank.w-score { width: 10mm; }
  .pk { margin: 0; padding-left: 6mm; }
  .pk > li { break-inside: avoid; margin-bottom: 1.8mm; font-size: 9.6pt; line-height: 1.28; }
  .pkq { margin: 0; color: #333; }
  .pka { margin: 0.5mm 0; font-weight: 700; }
  .pks { margin: 0; padding-left: 5mm; font-size: 9pt; line-height: 1.25; }
  .pkc { margin: 0 0 4mm; padding-left: 6mm; }
  .pkc > li { break-inside: avoid; margin: 0 0 1.6mm; }
  .pkl { color: #333; }
  /* black and white: the map prints in ink only, fronts in their standard symbols */
  svg .land, svg .sea { fill: #fff; }
  svg .coast { stroke: #777; stroke-width: 0.35; stroke-dasharray: 1.2 0.8; }
  svg .iso { stroke: #000; stroke-width: 0.3; }
  svg .isol, svg .cn, svg .lt, svg .am, svg .ctr { fill: #000; stroke: #fff; }
  svg .sv { fill: #000; }
  svg .svh, svg .lth, svg.stnbig .svh { fill: #fff; stroke: #fff; }
  svg .stn .lt { stroke: none; }
  svg .trs.halo { stroke: #fff; }
  svg .wxhalo { fill: #fff; }
  svg .fl, svg .fl-cold, svg .fl-warm, svg .fl-occluded { stroke: #000; }
  svg .fs-cold, svg .fs-warm, svg .fs-occluded, svg .ftri.fs-stationary, svg .fsemi.fs-stationary { fill: #000; }
  svg .lo, svg .hi { fill: #000; }
  svg .pdot, svg .cdot, svg .skyf, svg .wxf, svg .nh, svg .sb-b { fill: #000; }
  svg .sky, svg .sb-w { fill: #fff; stroke: #000; }
  svg .shaft, svg .barb, svg .trs:not(.halo), svg .wxl, svg .frame, svg .na { stroke: #000; }
  svg .cap { fill: #000; }
}
