/* Map's Models view, /map?view=models (decision 19 slice 3e-1, D111).

   One forecast picture at a time, beside the choices that change it. The picture is the pipeline's, drawn on its own
   scientific plate with its own key (`app/render/nwp.py`): its pixels are never recoloured by the theme, filtered or
   dimmed, and it sits on white in both themes so its edges read as the picture's. Everything around it takes the shared
   token roles.

   Targets (the site's rules): 44 px under a finger, 32 px under a mouse (above WCAG 2.2's 24 px), and every focused
   control clear of the sticky masthead (`scroll-margin-top`). The picture never forces sideways scroll: it is as wide as
   its column and keeps its 4:3 by its width and height attributes, so a missing hour's box holds the same place. */

.mv { padding-block: var(--sp-4) var(--sp-7); }
.mv-view { display: grid; gap: var(--sp-4); min-width: 0; }
/* On the hub's measure, as the bar, the switch and the page head above it. */
.mv .mv-view.shell-inner { max-width: var(--hub-width); width: calc(100% - 2 * var(--hub-gutter)); padding-inline: 0; }
.mv :is(a, button, input, select, summary)[id], .mv :is(a, button, input, select) {
  scroll-margin-top: calc(var(--masthead-h) + var(--sp-4));
  scroll-margin-bottom: var(--sp-4);
}

.mv-layout { display: grid; gap: var(--sp-5); min-width: 0; }
@media (min-width: 1100px) {
  .mv-layout { grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem); align-items: start; }
}
.mv-stage { display: grid; gap: var(--sp-2); min-width: 0; }
.mv-title { margin: 0; font-size: var(--fs-subhead); line-height: var(--lh-lead); }
.mv-when, .mv-runstate, .mv-tags, .mv-help, .mv-keys { margin: 0; }
.mv-when { display: flex; flex-wrap: wrap; gap: 0 var(--sp-3); font-size: var(--fs-remarks); }
.mv-when-age { color: var(--ink-2); }
.mv-runstate { color: var(--ink-2); font-size: var(--fs-small); }
.mv-help { color: var(--ink-2); font-size: var(--fs-small); max-width: var(--wrap-prose); }

/* The kind tags (DESIGN.md, Severe model guidance): Forecast dotted, read before the picture is. */
.mv-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mv-tag {
  display: inline-block; padding: 0 var(--sp-2); font-size: var(--fs-micro); font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: var(--ink); border: 2px dotted var(--edge); border-radius: var(--radius-control);
}

/* The picture, and in its place, at its size, the box that says why there is none. */
.mv-frame { position: relative; min-width: 0; }
.mv-picture, .mv-picture img { display: block; width: 100%; max-width: 100%; height: auto; }
.mv-picture img {
  aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius-surface); background: #ffffff;
  filter: none; mix-blend-mode: normal;
}
.mv-picture[hidden], .mv-empty[hidden] { display: none; }
.mv-empty {
  display: grid; place-items: center; aspect-ratio: 4 / 3; padding: var(--sp-5); text-align: center;
  background: var(--surface); border: 2px dashed var(--line-strong); border-radius: var(--radius-surface); color: var(--ink);
}
.mv-empty p { margin: 0; max-width: 46ch; }
.mv-empty--page { aspect-ratio: auto; text-align: left; place-items: start; gap: var(--sp-2); }
.mv-empty--page h2 { margin: 0; font-size: var(--fs-subhead); }
.mv-empty code, .mv-runstate code { font-family: var(--font-mono); font-size: 0.9em; }

/* States said in words: the product's (outage, late, ours) and the run's. Never colour alone: each leads with its words. */
.mv-notes { display: grid; gap: var(--sp-2); }
.mv-note, .mv-alert { margin: 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-control); max-width: 80ch; }
.mv-note { background: var(--wash); border: 1px solid var(--line); }
.mv-alert { background: var(--surface); border: 1px solid var(--line-strong); border-inline-start: 4px solid var(--ink); }
.mv-note a { color: var(--link); }

/* Playback: shown by the script. One slider over the run's hours, what has loaded shown on its track. */
.mv-player { display: grid; gap: var(--sp-2); padding: var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-surface); }
.mv-player[hidden] { display: none; }
.mv-buttons { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.mv-btn { min-width: 44px; min-height: 36px; }
.mv-play { min-width: 5.5rem; }
.mv-slider { display: grid; gap: var(--sp-1); min-width: 0; }
.mv-slider-label { font-size: var(--fs-small); font-weight: 700; }
.mv-range { width: 100%; margin: 0; min-height: 32px; accent-color: var(--enamel); }
.mv-track { display: flex; gap: 1px; height: 10px; min-width: 0; }
.mv-track span { flex: 1 1 0; min-width: 0; background: var(--wash-strong); border-radius: 1px; }
.mv-track span[data-state="loaded"] { background: var(--enamel); }
.mv-track span[data-state="loading"] { background: color-mix(in srgb, var(--enamel) 40%, transparent); }
.mv-track span[data-state="missing"], .mv-track span[data-state="failed"] {
  background: repeating-linear-gradient(135deg, var(--ink-2) 0 2px, transparent 2px 4px);
}
.mv-track span[data-state="not-yet"] { background: transparent; outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.mv-track span[data-current] { box-shadow: 0 -3px 0 var(--ink); }
.mv-track-words, .mv-keys { margin: 0; font-size: var(--fs-small); color: var(--ink-2); }

.mv-steps { display: flex; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.mv-step { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--sp-2); }
a.mv-step { color: var(--link); }
span.mv-step { color: var(--ink-2); }
.mv-hourform { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-small); }
.mv-hourform label { font-weight: 700; }
.mv-hourform select { min-height: 32px; max-width: 100%; font: inherit; }

/* The choices: presets in their groups, the models that draw the preset, the runs kept, the regions drawn. */
.mv-side { display: grid; gap: var(--sp-4); min-width: 0; align-content: start; }
.mv-choice { display: grid; gap: var(--sp-2); min-width: 0; }
.mv-choice-h { margin: 0; font-size: var(--fs-small); font-weight: 700; text-transform: uppercase; letter-spacing: var(--track-micro); color: var(--ink-2); }
.mv-choice-note { margin: 0; font-size: var(--fs-small); color: var(--ink-2); }
.mv-groups { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.mv-group { display: grid; gap: var(--sp-1); }
.mv-group-name { font-size: var(--fs-small); color: var(--ink-2); }
.mv-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mv .mv-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 32px; padding: 2px var(--sp-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--paper); color: var(--ink);
  font-size: var(--fs-small); text-decoration: none; overflow-wrap: anywhere;
}
/* A chip is a control with a border of its own, not a link in a sentence: no underline (shell.css's rule). */
.mv li a.mv-chip, .mv li a.mv-chip:hover { text-decoration: none; }
.mv-chip:hover { border-color: var(--ink); background: var(--wash-strong); }
.mv-chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 700; }
.mv-run-state { font-size: var(--fs-micro); }
.mv-chip:not([aria-current]) .mv-run-state { color: var(--ink-2); }

/* Regions on request (3e-2, D112). A region not drawn at this hour is a button in one POST form, marked "+" and named
   "Draw …" to a screen reader; one being drawn is its name and state in words, on a dashed edge (never colour alone). */
.mv .mv-chip--draw { font: inherit; font-size: var(--fs-small); cursor: pointer; }
.mv .mv-chip--draw[aria-busy="true"] { cursor: progress; }
.mv-draw-mark { font-weight: 700; color: var(--ink-2); }
.mv .mv-chip--state { border-style: dashed; background: var(--surface); }
.mv-draw { margin: 0; }
.mv-asked { display: grid; gap: var(--sp-2); }
.mv-asked p { margin: 0; }
.mv-asked a { color: var(--link); }
.mv-askform { margin: 0; }
.mv-askform .btn { min-height: 36px; }
.mv-refusal { margin: 0; }

@media (pointer: coarse) {
  .mv .mv-chip, .mv-step, .mv-askform .btn, .mv-asked a, .mv-hourform select, .mv-hourform .btn, .mv-btn, .mv-note a { min-height: 44px; }
  .mv-asked a { display: inline-flex; align-items: center; }
  .mv-note a { display: inline-flex; align-items: center; }
  .mv-range { min-height: 44px; }
}

/* "Choose map" (owner, 2026-11-25): below the desktop breakpoint, where the choices fall under the picture and the
   player, one compact control above the picture says what is shown and leads to them. Without script it is a link to
   the choices (`#mv-choices`); with script a disclosure button that opens the same choices in place under it, pushing
   the picture down rather than covering it or its credit. At the desktop width it is not drawn: the side panel is. */
.mv-chooser { display: none; }
.mv-side[hidden] { display: none; }
@media (max-width: 1099.98px) {
  /* Two short lines in one 44 px row: what the control does, then what is shown (cut with an ellipsis only at 320 px). */
  .mv .mv-chooser {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sp-3); align-items: center;
    justify-self: start; max-width: 100%; min-width: 0; min-height: 44px; margin: 0; box-sizing: border-box;
    padding: 3px var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--radius-control);
    background: var(--paper); color: var(--ink); font: inherit; text-align: start; text-decoration: none; cursor: pointer;
  }
  .mv .mv-chooser:hover { border-color: var(--ink); background: var(--wash-strong); }
  .mv-chooser-label {
    grid-column: 1; font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: 700; text-transform: uppercase;
    letter-spacing: var(--track-micro); color: var(--ink-2);
  }
  .mv-chooser-what {
    grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: var(--fs-small); line-height: var(--lh-lead); font-weight: 700;
  }
  /* A link goes down to the choices; the button opens them here, its mark turned while they are open. */
  .mv-chooser-mark {
    grid-column: 2; grid-row: 1 / span 2; width: 0.55em; height: 0.55em;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-0.15em) rotate(45deg);
  }
  .mv-chooser[aria-expanded="true"] .mv-chooser-mark { transform: translateY(0.15em) rotate(225deg); }
  .mv-side--sheet { padding: var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-surface); }
  /* Reached by the link without script: the choices are where focus lands, ringed as every focused thing is. */
  .mv-side { scroll-margin-top: calc(var(--masthead-h) + var(--sp-4)); }
  .mv-side:target { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
}
@media (forced-colors: active) {
  .mv .mv-chooser { border-color: ButtonText; }
}

/* A phone's first screen (owner, 2026-11-25, D113): the picture starts higher. Below the desktop breakpoint the page head
   says only that these are forecasts, not observations or warnings; the clock and "Your places" share one compact row;
   the stage's name is not drawn twice (the "Choose map" control right under it says it, the heading stays for a screen
   reader); and each state note keeps its line in view and folds its detail behind "Details" (`folds()`, with script).
   At 1100 px and wider nothing here applies: the desktop page is as it was. */
.mv-more { display: none; }
@media (max-width: 1099.98px) {
  body[data-page="models"] .pagehead .shell-inner { padding-block: var(--sp-2); gap: var(--sp-1) var(--sp-2); align-items: center; }
  body[data-page="models"] .pagehead-titles { flex-basis: 100%; }
  body[data-page="models"] .pagehead-title { font-size: 1.5rem; line-height: 1.75rem; }
  body[data-page="models"] .pagehead-sub { margin-top: 0; }
  body[data-page="models"] .mv-sub-more { display: none; }
  /* The clock and "Your places" (added by the site's script after this slot) share one row; the slot keeps its 44 px
     before the script fills it, so nothing below moves when it does. */
  body[data-page="models"] .pagehead-aux { width: auto; margin-left: 0; min-height: 44px; }
  /* The clock as Forecast draws it (severe.css): two words in one ruled row, the chosen one underlined, never colour alone. */
  body[data-page="models"] .svb-tz { border: 0; gap: 0; }
  body[data-page="models"] .svb-tz .seg-opt { appearance: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
  body[data-page="models"] .svb-tz .seg-opt > span {
    min-height: 44px; display: flex; align-items: center; padding-inline: var(--sp-2); background: transparent; color: var(--ink-2);
    border-right: 1px solid var(--line); font-size: var(--fs-bulletin);
  }
  body[data-page="models"] .svb-tz .seg-opt:last-child > span { border-right: 0; }
  body[data-page="models"] .svb-tz .seg-opt[aria-pressed="true"] > span { color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
  body[data-page="models"] .svb-tz .seg-opt:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
  body[data-page="models"] .svb-tz-zone { white-space: pre; }
  body[data-page="models"] .pagehead [data-wx-places] { min-height: 44px; }
  .mv { padding-top: var(--sp-1); }
  .mv-view { gap: var(--sp-2); }
  .mv-stage { gap: var(--sp-1); }
  .mv-when { font-size: var(--fs-bulletin); line-height: 1.4; }
  [data-mv-status] { font-size: var(--fs-bulletin); line-height: 1.4; }
  .mv-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .mv-note, .mv-alert { padding-block: var(--sp-1); }
  [data-mv-folded="closed"] [data-mv-detail] { display: none; }
  .mv-more {
    display: inline-flex; align-items: center; min-height: 32px; margin: 0; padding: 0 var(--sp-1); border: 0; background: none;
    font: inherit; font-weight: 700; color: var(--link); text-decoration: underline; cursor: pointer;
  }
  .mv-more:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
}
@media (max-width: 1099.98px) and (pointer: coarse) {
  .mv-more { min-height: 44px; }
}

/* The credits each licence prescribes: never smaller than the page's small print. */
.mv-credit { display: grid; gap: var(--sp-1); padding-top: var(--sp-3); border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--ink); max-width: 100ch; }
.mv-credit p { margin: 0; }
.mv-credit-h { margin: 0; font-size: var(--fs-small); font-weight: 700; }
.mv-statement { color: var(--ink-2); overflow-wrap: anywhere; }
.mv-statement a { color: var(--link); }

/* The reader's time first, UTC after (`clockText()`'s rule); UTC alone when the reader chose UTC. */
html[data-sv-time="utc"] .mv .sv-local { display: none; }

@media (forced-colors: active) {
  .mv-track span[data-state="loaded"] { background: Highlight; }
  .mv-chip[aria-current="page"] { outline: 2px solid Highlight; }
}

/* Two models side by side (3f-1, D114). Each pane has its own heading (model, run, its hour and the valid time both
   follow), its own tags, state and credit line, and its picture with the key in it. At 1100 px and wider the panes sit
   side by side, their headings, pictures and credit lines on shared rows (subgrid) so the two pictures line up, and the
   choices go under them across the width so each picture is half the hub rather than half of what the side panel leaves;
   below that the second pane follows the first, ruled off, and the first picture starts where it does alone. */
.mv-panes { display: grid; gap: var(--sp-4); min-width: 0; }
.mv-pane, .mv-pane-head { display: grid; gap: var(--sp-2); min-width: 0; align-content: start; }
.mv-ctitle { margin: 0; font-size: var(--fs-subhead); line-height: var(--lh-lead); }
.mv-pane-credit, .mv-pane-actions { margin: 0; font-size: var(--fs-small); overflow-wrap: anywhere; }
.mv-pane-credit { color: var(--ink-2); }
.mv-pane-credit a, .mv-pane-actions a { color: var(--link); }
.mv-pane-actions a { display: inline-flex; align-items: center; min-height: 32px; }
.mv-pane-status { display: grid; gap: var(--sp-2); }
.mv-pane-status:empty { display: none; }
.mv-credits { display: grid; gap: var(--sp-4); }
@media (min-width: 1100px) {
  .mv-layout--compare { grid-template-columns: minmax(0, 1fr); }
  .mv-layout--compare .mv-side { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); column-gap: var(--sp-5); align-items: start; }
  .mv-layout--compare .mv-choice { align-content: start; }
  .mv-panes { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-5); row-gap: var(--sp-2); }
  .mv-pane { grid-row: span 3; grid-template-rows: subgrid; }
  .mv-credits { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-5); }
}
@media (max-width: 1099.98px) {
  .mv-pane, .mv-pane-head { gap: var(--sp-1); }
  .mv-panes { gap: var(--sp-3); }
  .mv-pane--compare { padding-top: var(--sp-3); border-top: 1px solid var(--line); }
}
@media (pointer: coarse) {
  .mv-pane-actions a { min-height: 44px; }
}
