/* /accuracy/models/<slug>/ -- one model's verified accuracy record.
 *
 * Why this file exists
 * --------------------
 * The page carried a ~130-line `<style nonce>` block in its own <head>, which
 * defined a private `.mdl-*` vocabulary for a head card, a facts grid,
 * sections, tables, a calls list and a disclosure -- six components the
 * shared layer already owns. The block also sat in the cascade at the
 * position of the page body, could not be reviewed as CSS, and could only be
 * overridden by another inline block.
 *
 * What is left here is only what is *this page's* and nothing else: the
 * measure, the two-up calibration grid, the honest "no percentage" state, the
 * verdict ink on a scored call, and four defensive rules against site-wide
 * blankets. Everything else -- panels, metrics, section heads, tables, the
 * chart frame, chips, buttons, the report column, the disclosure -- is
 * `am-system.css` and `canvas-2026.css`.
 *
 * Three constraints every rule below obeys.
 *
 * 1. It never names a class `canvas-2026.css` owns.
 *    `markets/tests/test_canvas_design.py::
 *    test_canvas_classes_do_not_collide_with_any_other_stylesheet` fails the
 *    build on that, and it is the right thing to fail on: one class, one
 *    owner. Where this page needs to say something about a shared component
 *    it puts its own companion class on the same element and writes a rule
 *    for *that* -- `class="am-section-head mdl-sechead"`, `.mdl-sechead { … }`.
 *
 * 2. Tokens only, logical properties only, no `!important`. There is no hex,
 *    no rgb() and no named colour here, so both themes follow from the token
 *    sheet; there is no physical left/right, so Arabic needs no second file.
 *
 * 3. Specificity is explicit, because *this sheet loads before
 *    `bundle-shell.css`* (base.html:221 vs :235). A one-class rule here loses
 *    every tie against `canvas-2026.css`, `am-system.css` and the bridge. So
 *    the page scope `.mdl-page` is carried into the selector wherever a rule
 *    has to answer a shared one, and the few rules that have to outrank
 *    `canvas-bridge.css` -- the last stylesheet in the document -- say so.
 */

/* ------------------------------------------------------------------- page */

.mdl-page {
  inline-size: 100%;
  max-inline-size: var(--sh-max);
  margin-inline: auto;
  padding-inline: 0;
  padding-block: var(--sh-page-start) clamp(2.5rem, 5vw, 4rem);
}

/* The way back, quiet. The glyph is `.am-chevron`, which mirrors under
   [dir="rtl"] on its own -- the arrow used to be typed into the string
   ("← Back to the leaderboard") and the Arabic translation had to carry a
   second, opposite one. */
.mdl-page .mdl-back {
  display: inline-flex;
  align-items: center;
  gap: var(--c-space-2);
  margin-block-end: var(--c-space-4);
  color: var(--c-text-muted);
  font-size: var(--c-t-meta);
  text-decoration: none;
}
.mdl-page .mdl-back:hover { color: var(--c-text); }
.mdl-page .mdl-back:focus-visible {
  outline: 2px solid var(--c-evidence);
  outline-offset: 3px;
  border-radius: var(--c-r-chip);
}

/* -------------------------------------------------------------- page head */

.mdl-page .mdl-head { margin-block: var(--c-space-3) var(--c-space-6); }

/* The identity chips are a row of their own rather than items on the fact
   line: `.am-page-head__meta` draws a dot between consecutive items, and a
   dot between two pills reads as a third pill. */
.mdl-page .mdl-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--c-space-2);
  margin-block-start: var(--c-space-4);
}

.mdl-page .mdl-stamp {
  color: var(--c-text-secondary);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------- the one figure */

.mdl-page .mdl-figure { margin-block-end: var(--c-space-5); }

/* The page's subject, so it is larger than a tile's metric value.
   Four classes deep because `canvas-bridge.css` -- the last sheet in the
   document -- writes `:root[data-theme="light"] [class*="__value"]` at
   (0,3,0), and a figure that is the whole point of the page should not
   depend on winning a tie with a substring match. */
:root .mdl-page .mdl-figure .mdl-headline__value {
  margin-block: var(--c-space-3) 0;
  color: var(--c-text);
  font-size: clamp(2.1rem, 5.6vw, 3.1rem);
  font-weight: var(--c-w-bold);
  letter-spacing: -0.035em;
  line-height: 1.05;
}
[dir="rtl"] .mdl-page .mdl-headline__value { letter-spacing: 0; }

/* Below the sample floor no percentage is published, and the sentence that
   replaces it is a sentence and not a 3rem number -- it is not the figure,
   it is the reason there is no figure.
   It carries this class alone, and that is deliberate:
   `test_a_small_sample_gets_no_percentage_headline` asserts on the literal
   `class="mdl-headline__none"`, which is the marker that the honest state
   rendered. Wrapping it in `.am-metric__value` would give it the figure's
   type, which is the one thing it must not have. */
.mdl-page .mdl-headline__none {
  display: block;
  margin-block-start: var(--c-space-3);
  color: var(--c-attention);
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: var(--c-w-semi);
  line-height: 1.3;
}

.mdl-page .mdl-figure__ci {
  color: var(--c-text-muted);
  font-size: var(--c-t-meta);
  font-variant-numeric: tabular-nums;
}

/* `.am-metric__note` is 12px, which is the label floor and right for a tile.
   This one is a sentence a reader is meant to read, so it takes the meta
   size and a measure. (0,3,0) answers
   `body[class^="page-"] .main-content p { color: inherit }` in
   page-unification.css at (0,2,2). */
:root .mdl-page .mdl-figure__note {
  margin-block: var(--c-space-3) 0;
  max-inline-size: 68ch;
  color: var(--c-text-secondary);
  font-size: var(--c-t-meta);
  line-height: 1.6;
}

/* Four facts here and three under Coverage: `.am-metrics` is a fixed four-up,
   and neither row is four everywhere. Auto-fit reflows both without a
   breakpoint per row. 13rem is measured rather than chosen: the grid is
   890.8px wide inside the feature panel at a 1024px window, and four tracks
   plus three 16px gaps is 880 -- 13.5rem missed it by 32px and printed the
   four tiles as a ragged 3 + 1. At 768 the same floor gives a 2 x 2, which
   is what four tiles should be there. */
.mdl-page .mdl-facts {
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--c-space-4);
  margin-block: 0;
}

/* ---------------------------------------------------------------- sections */

.mdl-page .mdl-section { margin-block-end: var(--c-space-5); }

/* The two closing sections are prose, not data, so they are not surfaces
   either: a hairline between bands is how a document separates an argument
   from the argument before it. A card per paragraph made a 200-word caveat
   read as two unrelated notices. */
.mdl-page .mdl-section--open {
  margin-block-start: var(--c-space-6);
  padding-block-start: var(--c-space-6);
  border-block-start: 1px solid var(--c-line);
}

/* `.am-section-head` reserves 24px for a control that is not there on this
   page; the explanatory note sits directly under the heading instead. */
.mdl-page .mdl-sechead { margin-block-end: var(--c-space-3); }

:root .mdl-page .mdl-note {
  margin-block: 0 var(--c-space-4);
  max-inline-size: 72ch;
  color: var(--c-text-secondary);
  font-size: var(--c-t-meta);
  line-height: 1.65;
}

.mdl-page .mdl-report { margin-block-start: var(--c-space-4); }
.mdl-page .mdl-actions { margin-block-start: var(--c-space-5); }

/* ------------------------------------------------------------------ tables */

.mdl-page .mdl-wrap { margin-block-start: var(--c-space-2); }
.mdl-page .mdl-wrap--gap { margin-block-start: var(--c-space-5); }
/* The wrapper is the tab stop (tabindex="0", role="group", a name), so it has
   to show where the focus went. */
.mdl-page .mdl-wrap:focus-visible {
  outline: 2px solid var(--c-evidence);
  outline-offset: 2px;
  border-radius: var(--c-r-control);
}
/* `dashboard.css` turns every `<table>` into a block scroll container below
   768px. That made the table itself a second scrollable region, nested inside
   this one and reachable by no keyboard (axe: scrollable-region-focusable).
   The wrapper is the one scroller; the table stays a table. */
.mdl-wrap > table { display: table; overflow: visible; }
/* Column headings wrap, figures never do. `.am-table thead th` is nowrap for
   a leaderboard's short labels; "Stated confidence" on one line pushed the
   sample column out of the scroller on a 390px screen for no reason -- a
   heading has somewhere to go vertically and a number does not. */
.mdl-page .mdl-table thead th { white-space: normal; }

.mdl-page .mdl-empty { color: var(--c-text-faint); }

/* ------------------------------------------------------- calibration figure */

/* The plot and the table it is drawn from, side by side where there is room.
   The plot is decoration -- it is aria-hidden and every point in it is a row
   in the table -- so the table gets the larger track. */
.mdl-page .mdl-calib {
  display: grid;
  gap: var(--c-space-5);
  align-items: start;
}
@media (min-width: 62rem) {
  .mdl-page .mdl-calib--split {
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  }
}

/* A well for the figure. `currentcolor` is what the dashed perfect-calibration
   line is stroked with, so the ink is set here once and both themes follow;
   the observed line is `--c-evidence`, which is the site's one verification
   colour and already theme-aware. No chart library is loaded on this page and
   none is wanted for eleven points. */
.mdl-page .mdl-plot {
  padding: var(--c-space-3);
  border: 1px solid var(--c-line);
  border-radius: var(--c-r-control);
  background-color: var(--c-inset);
  color: var(--c-text-secondary);
}

/* The key is the legend, and it is one sentence rather than two named series,
   so it is written as the caption of the row and not as `__legend-item` --
   a legend dot in front of "Dashed: … Solid: …" would be a third series. */
:root .mdl-page .mdl-key {
  margin: 0;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ------------------------------------------------------------ scored calls */

.mdl-page .mdl-calls {
  gap: var(--c-space-3);
  margin-block: 0;
  padding-inline-start: 0;
  list-style: none;
}

/* `.am-evidence--up` / `--down` would be the component's own answer here, and
   it cannot be used: `canvas-bridge.css` is the last sheet in the document
   and repaints `[class*="--up"]` and `[class*="--down"]` with the movement
   token, so the modifier would tint every word in the block -- the symbol,
   the stated confidence and the lifecycle -- the colour of the verdict.
   These names carry the same intent past that blanket. */
.mdl-page .mdl-call--hit {
  border-inline-start-color: var(--c-up);
  background-color: color-mix(in srgb, var(--c-up) 5%, var(--c-inset));
}
.mdl-page .mdl-call--miss {
  border-inline-start-color: var(--c-down);
  background-color: color-mix(in srgb, var(--c-down) 5%, var(--c-inset));
}

.mdl-page .mdl-call__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--c-space-2) var(--c-space-3);
  min-inline-size: 0;
}

:root .mdl-page .mdl-call__meta {
  color: var(--c-text-muted);
  font-size: var(--c-t-meta);
  font-variant-numeric: tabular-nums;
}

/* House rule since the colour audit: a verdict is never colour alone. The
   glyph is drawn rather than typed so it is not part of a translated string
   and cannot be lost in a locale. */
.mdl-page .mdl-call__verdict {
  display: inline-flex;
  align-items: center;
  gap: var(--c-space-1);
  margin-inline-start: auto;
  font-size: var(--c-t-meta);
  font-weight: var(--c-w-semi);
  white-space: nowrap;
}
.mdl-page .mdl-call__verdict--hit { color: var(--c-up-ink); }
.mdl-page .mdl-call__verdict--hit::before { content: "\2713"; }
.mdl-page .mdl-call__verdict--miss { color: var(--c-down-ink); }
.mdl-page .mdl-call__verdict--miss::before { content: "\2717"; }

/* --------------------------------------------------------- technical details */

.mdl-page .mdl-tech { margin-block-start: var(--c-space-5); }
.mdl-page .mdl-defs {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--c-space-1) var(--c-space-5);
  margin: 0;
  font-size: var(--c-t-meta);
}
:root .mdl-page .mdl-defs dt { color: var(--c-text-faint); }
:root .mdl-page .mdl-defs dd {
  margin: 0;
  color: var(--c-text-secondary);
  font-family: var(--c-mono);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------- phone */

@media (max-width: 767px) {
  /* Both are the only things on this page a finger has to hit that the
     component layer does not already floor at 44px. */
  .mdl-page .mdl-back,
  .mdl-page .mdl-call__symbol {
    display: inline-flex;
    align-items: center;
    min-block-size: 44px;
  }
  .mdl-page .mdl-call__verdict { margin-inline-start: 0; }
  /* 284px of content inside the feature panel at 390: two 8rem tracks and a
     16px gap is 272 and fits, 8.5rem is 288 and does not -- which is why the
     four tiles stacked one per row and the panel was a screen tall. */
  .mdl-page .mdl-facts { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
}
