/* ============================================================================
   usri.css — USRI Research Showcase page ("Is this fix real?")

   Layers on top of 98.css. Everything here is prefixed .u- so it cannot collide
   with styles.css / project_contents.css / desktop.css.

   Design notes
   ------------
   * 98.css supplies the chrome (windows, title bars, buttons, sliders, tabs).
   * Prose gets a slightly larger, non-pixel font — this page is long-form
     reading for a general audience, and Pixelated MS Sans Serif at 11px is
     punishing past a paragraph. The chrome stays period-correct.
   * No colour-only signalling anywhere: every PASS/FAIL carries a word, a
     glyph, and a fill pattern.

   Jacob Lee | jacoblee.codes
   ========================================================================= */

:root {
    --u-ink:        #1a1a1a;
    --u-ink-soft:   #4a4a4a;
    --u-face:       #c0c0c0;
    --u-face-lit:   #dfdfdf;
    --u-shadow:     #808080;
    --u-navy:       #000080;
    --u-pass:       #006b1f;
    --u-pass-bg:    #d8f0d8;
    --u-fail:       #a80000;
    --u-fail-bg:    #ffdcdc;
    --u-warn:       #7a5f00;
    --u-warn-bg:    #fff8cc;
    --u-paper:      #ffffff;
    --u-paper-alt:  #f6f6f0;
    --u-prose: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Verdana, sans-serif;
    --u-mono: "Courier New", Courier, monospace;
}

/* ---------------------------------------------------------------- shell -- */

/* The classic Win98 desktop teal, matching .content in desktop.css. styles.css
   puts an animated tiled-blue gif on <html> for the rest of the site; this page
   is meant to read as the desktop itself, so it overrides that. */
html.u-html {
    background-color: #008080 !important;
    background-image: none !important;
    animation: none !important;
}

body.u-body {
    margin: 0;
    padding: 0;
}

.u-page {
    max-width: 860px;
    margin: 18px auto 40px;
    padding: 0 14px;
    box-sizing: border-box;
}

/* Each beat of the story is its own window.

   98.css already gives .window a silver face with a 3px pad, and .window-body
   an 8px margin — so a silver gutter shows around the body by default. We turn
   that body into a *sunken white document field*, which is what Notepad and
   Word actually looked like: silver chrome, white paper inset into it. Keeps
   long-form reading comfortable while staying period-correct and consistent
   with the windows on the rest of the site. */
.u-win {
    margin-bottom: 20px;
}

.u-win > .window-body {
    padding: 14px 16px 16px;
    background: var(--u-paper);
    border: 2px solid;
    border-top-color: var(--u-shadow);
    border-left-color: var(--u-shadow);
    border-right-color: var(--u-face-lit);
    border-bottom-color: var(--u-face-lit);
}

.u-win .title-bar-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.u-win .title-bar-text img {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}

/* Prose ------------------------------------------------------------------ */

.u-win p,
.u-win li {
    font-family: var(--u-prose);
    font-size: 14px;
    line-height: 1.62;
    color: var(--u-ink);
}

.u-win p { margin: 0 0 12px; }
.u-win p:last-child { margin-bottom: 0; }

.u-win h2 {
    font-family: var(--u-prose);
    font-size: 19px;
    line-height: 1.3;
    margin: 0 0 10px;
    color: var(--u-ink);
}

.u-win h3 {
    font-family: var(--u-prose);
    font-size: 15px;
    margin: 18px 0 8px;
    color: var(--u-ink);
}

.u-win ul, .u-win ol { margin: 0 0 12px; padding-left: 22px; }
.u-win li { margin-bottom: 6px; }

.u-lead {
    font-size: 15.5px !important;
    line-height: 1.6 !important;
}

/* A pulled-out line that carries a beat. */
.u-turn {
    margin: 16px 0;
    padding: 12px 14px;
    background: var(--u-paper-alt);
    border-left: 4px solid var(--u-navy);
    border-top: 1px solid var(--u-shadow);
    border-right: 1px solid var(--u-face-lit);
    border-bottom: 1px solid var(--u-face-lit);
}

.u-turn p { margin: 0; font-size: 14.5px; }

/* A named technical term, on first introduction. Bold + a dotted rule so the
   eye registers "this is the word for it" rather than mere emphasis. */
.u-named {
    font-weight: 700;
    border-bottom: 2px solid var(--u-navy);
}

/* Inline maths symbol, so r / f₀ / W / B are familiar before the readout. */
.u-sym {
    font-family: var(--u-mono);
    font-size: 0.94em;
    background: var(--u-face);
    padding: 0 4px;
    border: 1px solid;
    border-top-color: var(--u-face-lit);
    border-left-color: var(--u-face-lit);
    border-right-color: var(--u-shadow);
    border-bottom-color: var(--u-shadow);
    white-space: nowrap;
}

/* ------------------------------------------------------------- glossary -- */

/* 98.css styles every <table> for its file-listing widget: `white-space: nowrap`
   on the table plus a sticky silver `table > thead > tr > *`. On a prose
   glossary that means the cells refuse to wrap, the table grows wider than the
   panel, and the silver header band slides out past the border. Both are
   undone here — this table is a definition list, not a file listing. */
.u-glossary {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 0;
    font-size: 12.5px;
    white-space: normal;
}

.u-glossary th {
    text-align: left;
    font-family: var(--u-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--u-ink-soft);
    border-bottom: 1px solid var(--u-shadow);
    padding: 0 8px 5px 0;
    font-weight: 700;
    background: transparent;
    box-shadow: none;
    position: static;
    height: auto;
}

.u-glossary td {
    font-family: var(--u-prose);
    vertical-align: top;
    padding: 6px 8px 6px 0;
    border-bottom: 1px solid #e4e4e4;
    line-height: 1.45;
    height: auto;
    overflow-wrap: break-word;
}

.u-glossary tr:last-child td { border-bottom: 0; }

.u-glossary td:first-child { width: 34%; }

.u-glossary .u-gl-tech {
    font-weight: 700;
    color: var(--u-ink);
}

.u-glossary .u-gl-sym {
    font-family: var(--u-mono);
    font-size: 11.5px;
    color: var(--u-navy);
    display: block;
}

@media (max-width: 560px) {
    .u-glossary, .u-glossary tbody, .u-glossary tr, .u-glossary td { display: block; width: auto; }
    .u-glossary thead { display: none; }
    .u-glossary tr { border-bottom: 1px solid var(--u-shadow); padding: 6px 0; }
    .u-glossary td { border: 0; padding: 2px 0; }
    .u-glossary td:first-child { width: auto; }
}

/* ------------------------------------------------------------------ hero -- */

.u-hero-title {
    font-family: var(--u-prose);
    font-size: 27px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 10px;
    color: var(--u-ink);
}

/* Scoped inside .u-win so it outranks `.u-win p { font-size: 14px }`. */
.u-win .u-hero-sub {
    font-family: var(--u-prose);
    font-size: 15.5px;
    color: var(--u-ink-soft);
    margin: 0 0 14px;
    line-height: 1.55;
}

.u-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--u-shadow);
    box-shadow: 0 1px 0 var(--u-face-lit);
}

/* ---------------------------------------------------------------- panels -- */

.u-panel {
    border: 1px solid;
    border-top-color: var(--u-shadow);
    border-left-color: var(--u-shadow);
    border-right-color: var(--u-face-lit);
    border-bottom-color: var(--u-face-lit);
    background: var(--u-face);
    padding: 10px 12px;
    margin: 12px 0;
}

.u-panel-title {
    display: block;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 8px;
}

/* Step 2 uses a <label for> as its panel title, so the numbered step heading
   and the accessible name of the <select> are one and the same string. That
   makes the type rules load-bearing: a <p> here inherits `.u-win p`
   (prose/14px/ink) but a <label> does not, so the two steps drift apart unless
   the font is pinned at a specificity that beats `.u-win p`. */
.u-win .u-panel-title {
    font-family: var(--u-prose);
    font-size: 14px;
    line-height: 1.4;
    color: var(--u-ink);
}

label.u-panel-title {
    cursor: url("../assets/win98/cursors/pointer.cur"), pointer;
}

/* Sunken well for plots and readouts. */
.u-well {
    background: var(--u-paper);
    border: 2px solid;
    border-top-color: var(--u-shadow);
    border-left-color: var(--u-shadow);
    border-right-color: var(--u-face-lit);
    border-bottom-color: var(--u-face-lit);
    padding: 8px;
}

/* --------------------------------------------------------------- controls -- */

.u-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.u-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.u-control-label {
    font-family: var(--u-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--u-ink-soft);
}

.u-btnrow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Content buttons only. The :not() is load-bearing — without it this rule
   overrides 98.css's 16x14px title-bar controls and the close/minimize glyphs
   render at the wrong size, which is exactly what went wrong the first time. */
.u-page button:not(.title-bar-controls button) {
    font-family: var(--u-prose);
    font-size: 12.5px;
    min-height: 26px;
    padding: 3px 14px !important;
    cursor: url("../assets/win98/cursors/pointer.cur"), pointer;
}

.u-page .title-bar-controls button {
    cursor: url("../assets/win98/cursors/pointer.cur"), pointer;
}

.u-page button:disabled { cursor: url("../assets/win98/cursors/arrow.cur"), default; }

/* Minimised windows collapse to just their title bar (styles.css hides the
   body); keep the gap tidy so a collapsed stack still reads as a desktop. */
.u-win.minimized { margin-bottom: 8px; }

.u-page input[type="range"] { width: 190px; max-width: 100%; }
.u-page select { font-family: var(--u-prose); font-size: 12.5px; padding: 2px; }

/* Two-state fix chooser, styled as a pair of toggle buttons. */
.u-fixpick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.u-fixbtn {
    flex: 1 1 210px;
    text-align: left;
    padding: 8px 10px !important;
    min-height: 0 !important;
    font-family: var(--u-prose) !important;
    line-height: 1.35;
}

.u-fixbtn[aria-pressed="true"] {
    box-shadow: inset -1px -1px #ffffff, inset 1px 1px #0a0a0a,
                inset -2px -2px #dfdfdf, inset 2px 2px #808080 !important;
    background: #b8b8b8 !important;
}

.u-fixbtn-name { display: block; font-weight: 700; font-size: 12.5px; }
.u-fixbtn-desc { display: block; font-size: 11.5px; color: #333; margin-top: 2px; }

.u-fixbtn[aria-pressed="true"] .u-fixbtn-name::before { content: "\25CF  "; }
.u-fixbtn[aria-pressed="false"] .u-fixbtn-name::before { content: "\25CB  "; }

/* -------------------------------------------------------------- lab grid -- */

/* Stacked, not side by side: the plot needs the full column width to be
   readable — a year of daily temperatures squeezed into 55% of the page is
   too dense to see. Order is controls → plot → gauges → verdict, so the
   controls still sit adjacent to what they change. */
.u-lab {
    display: block;
    margin: 12px 0;
}

.u-lab-plot, .u-lab-read { min-width: 0; }

.u-lab-read { margin-top: 12px; }

/* With the full width available, the two gauges can sit beside each other. */
.u-lab-read .u-gauges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    align-items: start;
}

/* Step 2's row: the city chooser and the button that acts on it, side by side.
   They were previously pushed to opposite ends of a wide bar, which read as two
   unrelated controls — the dropdown has to sit next to the button it feeds. */
.u-runrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.u-runrow select {
    flex: 0 1 auto;
    min-width: 190px;
    min-height: 26px;
}

.u-runrow button { flex: 0 0 auto; }

@media (max-width: 420px) {
    .u-runrow select,
    .u-runrow button { flex: 1 1 100%; }
}

/* The day slider belongs to the equation, so it lives with it. */
.u-dayrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    background: var(--u-face);
    border: 1px solid;
    border-top-color: var(--u-face-lit);
    border-left-color: var(--u-face-lit);
    border-right-color: var(--u-shadow);
    border-bottom-color: var(--u-shadow);
    border-bottom: 0;
}

.u-dayrow label {
    font-family: var(--u-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--u-ink-soft);
    white-space: nowrap;
}

.u-dayrow input[type="range"] { flex: 1 1 160px; width: auto; }

.u-dayrow output {
    font-family: var(--u-mono);
    font-size: 13px;
    font-weight: 700;
    min-width: 66px;
    text-align: right;
}

@media (max-width: 820px) {
    .u-dayrow { gap: 8px; }
}

/* ---------------------------------------------------------------- gauges -- */

.u-gauges {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0;
}

.u-gauge {
    border: 1px solid;
    border-top-color: var(--u-face-lit);
    border-left-color: var(--u-face-lit);
    border-right-color: var(--u-shadow);
    border-bottom-color: var(--u-shadow);
    background: var(--u-face);
    padding: 9px 11px;
}

.u-gauge-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.u-gauge-name {
    font-family: var(--u-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* The metric's real name, sitting beside the friendly one. */
.u-gauge-tech {
    font-family: var(--u-mono);
    font-size: 10.5px;
    color: var(--u-navy);
    background: var(--u-paper);
    border: 1px solid var(--u-shadow);
    padding: 0 5px;
    white-space: nowrap;
    margin-right: auto;
}

/* Two classes so this beats `.u-win p { font-size: 14px }`. */
.u-gauge .u-gauge-q {
    font-family: var(--u-prose);
    font-size: 12px;
    line-height: 1.45;
    color: var(--u-ink-soft);
    margin: 0 0 7px;
}

.u-gauge-verdict {
    font-family: var(--u-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 1px 7px;
    border: 1px solid;
    white-space: nowrap;
}

.u-gauge-verdict.is-pass { background: var(--u-pass-bg); color: var(--u-pass); border-color: var(--u-pass); }
.u-gauge-verdict.is-fail { background: var(--u-fail-bg); color: var(--u-fail); border-color: var(--u-fail); }
.u-gauge-verdict.is-idle { background: #e8e8e8; color: #555; border-color: #999; }

/* Meter runs -1 .. +1 with a zero tick. */
.u-meter {
    position: relative;
    height: 24px;
    background: var(--u-paper);
    border: 2px solid;
    border-top-color: var(--u-shadow);
    border-left-color: var(--u-shadow);
    border-right-color: var(--u-face-lit);
    border-bottom-color: var(--u-face-lit);
    overflow: hidden;
}

.u-meter-zero {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 1px;
    background: #555;
    z-index: 3;
}

.u-meter-fill {
    position: absolute;
    top: 0; bottom: 0;
    z-index: 2;
    transition: left 260ms ease, width 260ms ease;
}

/* Solid = pass. Hatched = fail. Distinguishable without colour. */
.u-meter-fill.is-pass { background: var(--u-pass); }

.u-meter-fill.is-fail {
    background: var(--u-fail);
    background-image: repeating-linear-gradient(
        45deg, rgba(255,255,255,0.55) 0 4px, rgba(255,255,255,0) 4px 8px);
}

.u-meter-scale {
    display: flex;
    justify-content: space-between;
    font-family: var(--u-mono);
    font-size: 10px;
    color: var(--u-ink-soft);
    margin-top: 2px;
}

.u-gauge-value {
    font-family: var(--u-mono);
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

/* --------------------------------------------------------------- verdict -- */

.u-verdict {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid;
    border-top-color: var(--u-face-lit);
    border-left-color: var(--u-face-lit);
    border-right-color: var(--u-shadow);
    border-bottom-color: var(--u-shadow);
    background: var(--u-face);
}

.u-stamp {
    font-family: var(--u-mono);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.11em;
    padding: 7px 15px;
    border: 3px solid;
    transform: rotate(-3.5deg);
    white-space: nowrap;
    flex-shrink: 0;
}

.u-stamp.is-pass { color: var(--u-pass); border-color: var(--u-pass); background: var(--u-pass-bg); }
.u-stamp.is-fail { color: var(--u-fail); border-color: var(--u-fail); background: var(--u-fail-bg); }
.u-stamp.is-idle { color: #666; border-color: #999; background: #ececec; transform: none; }

.u-stamp-why {
    font-family: var(--u-prose);
    font-size: 13px;
    line-height: 1.55;
    flex: 1 1 240px;
    min-width: 0;
    margin: 0;
}

/* Animation only when the visitor asked for motion. */
@media (prefers-reduced-motion: no-preference) {
    .u-stamp.u-stamp-drop { animation: u-stamp-in 340ms cubic-bezier(.2,1.5,.4,1); }
}

@keyframes u-stamp-in {
    0%   { transform: rotate(-3.5deg) scale(2.4); opacity: 0; }
    70%  { transform: rotate(-3.5deg) scale(0.94); opacity: 1; }
    100% { transform: rotate(-3.5deg) scale(1); }
}

/* ------------------------------------------------------------------ plot -- */

.u-plot { width: 100%; height: auto; display: block; }

.u-plot text {
    font-family: var(--u-mono);
    font-size: 10px;
    fill: var(--u-ink-soft);
}

.u-plot-caption {
    font-family: var(--u-prose);
    font-size: 12px;
    color: var(--u-ink-soft);
    line-height: 1.5;
    margin: 8px 0 0;
}

.u-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.u-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--u-prose);
    font-size: 11.5px;
    color: var(--u-ink);
}

.u-legend-swatch {
    width: 18px;
    height: 3px;
    flex-shrink: 0;
    display: inline-block;
}

.u-legend-swatch.is-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #333;
}

/* Shaded region rather than a line: the noise floor is a band, not a series. */
.u-legend-swatch.is-band {
    width: 18px; height: 11px;
    background: var(--u-warn-bg);
    border: 1px solid #d8c77a;
}

/* ------------------------------------------------------- equation strip -- */

/* y = f0(x) + h(x) + e, with the real numbers for one real day underneath.
   Four value columns separated by three operators = seven grid columns. */
.u-equation {
    margin: 14px 0;
    padding: 12px 10px;
    background: var(--u-paper);
    border: 2px solid;
    border-top-color: var(--u-shadow);
    border-left-color: var(--u-shadow);
    border-right-color: var(--u-face-lit);
    border-bottom-color: var(--u-face-lit);
    overflow-x: auto;
}

.u-eq-row {
    display: grid;
    grid-template-columns: 2.1fr 0.4fr 1.6fr 0.4fr 1.3fr 0.4fr 1.9fr;
    align-items: center;
    gap: 4px;
    text-align: center;
    min-width: 460px;
}

.u-eq-head span {
    font-family: var(--u-prose);
    font-size: 11px;
    line-height: 1.3;
    color: var(--u-ink-soft);
}

.u-eq-sym span {
    font-family: var(--u-mono);
    font-size: 15px;
    color: var(--u-navy);
    padding: 3px 0;
}

.u-eq-num span {
    font-family: var(--u-mono);
    font-size: 17px;
    font-weight: 700;
    color: var(--u-ink);
    padding-top: 2px;
}

/* colour-code only as reinforcement — position already carries the meaning */
.u-eq-num span:nth-child(1) { color: #000000; }
.u-eq-num span:nth-child(3) { color: #4a4a4a; }
.u-eq-num span:nth-child(5) { color: #a80000; }
.u-eq-num span:nth-child(7) { color: var(--u-navy); }

.u-eq-note {
    font-family: var(--u-prose) !important;
    font-size: 12px !important;
    color: var(--u-ink-soft) !important;
    line-height: 1.55 !important;
    margin: 10px 0 0 !important;
    text-align: left;
    min-width: 0;
}

.u-formula {
    font-family: var(--u-mono);
    font-size: 12.5px;
    line-height: 1.6;
    background: var(--u-face);
    border: 1px solid;
    border-top-color: var(--u-shadow);
    border-left-color: var(--u-shadow);
    border-right-color: var(--u-face-lit);
    border-bottom-color: var(--u-face-lit);
    padding: 8px 10px;
    margin: 10px 0 0;
    overflow-x: auto;
    white-space: nowrap;
}

.u-unusual {
    font-family: var(--u-prose);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--u-ink);
    background: var(--u-paper-alt);
    border-left: 4px solid var(--u-navy);
    padding: 8px 11px;
    margin: 12px 0 0;
}

.u-unusual:empty { display: none; }

/* --------------------------------------------------------- maths readout -- */

.u-maths {
    font-family: var(--u-mono);
    font-size: 12px;
    line-height: 1.75;
    background: var(--u-paper);
    border: 2px solid;
    border-top-color: var(--u-shadow);
    border-left-color: var(--u-shadow);
    border-right-color: var(--u-face-lit);
    border-bottom-color: var(--u-face-lit);
    padding: 10px 12px;
    overflow-x: auto;
}

.u-maths .u-mk { color: var(--u-navy); font-weight: 700; }
.u-maths .u-mv { font-weight: 700; }

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

.u-details {
    border: 1px solid;
    border-top-color: var(--u-face-lit);
    border-left-color: var(--u-face-lit);
    border-right-color: var(--u-shadow);
    border-bottom-color: var(--u-shadow);
    margin: 14px 0;
    background: var(--u-face);
}

.u-details > summary {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    background: var(--u-face);
    font-family: var(--u-mono);
    font-size: 12px;
    font-weight: 700;
    cursor: url("../assets/win98/cursors/pointer.cur"), pointer;
    list-style: none;
    user-select: none;
}

.u-details > summary::-webkit-details-marker { display: none; }
.u-details > summary::marker { content: ""; }

.u-details:not([open]) > summary .u-caret::after { content: "\25B6"; }
.u-details[open]       > summary .u-caret::after { content: "\25BC"; }
.u-caret { font-size: 9px; }

.u-details-body {
    padding: 12px;
    background: var(--u-paper);
    border-top: 1px solid var(--u-shadow);
}

.u-details-body p { font-size: 13px !important; }

/* ------------------------------------------------------- boundary flip -- */

.u-modepick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.u-modebtn {
    flex: 1 1 190px;
    padding: 9px 12px !important;
    min-height: 0 !important;
    font-family: var(--u-mono) !important;
    font-size: 12.5px !important;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: center;
}

.u-modebtn[aria-pressed="true"] {
    box-shadow: inset -1px -1px #ffffff, inset 1px 1px #0a0a0a,
                inset -2px -2px #dfdfdf, inset 2px 2px #808080 !important;
    background: #b8b8b8 !important;
}

.u-modebtn[aria-pressed="true"]::before  { content: "\25C9  "; }
.u-modebtn[aria-pressed="false"]::before { content: "\25CB  "; }

.u-bnd-readout {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    font-family: var(--u-mono);
    font-size: 12.5px;
    margin-top: 10px;
}

/* Per-regime strip — every held-out group at a glance. */
.u-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 6px;
    margin: 10px 0 8px;
}

.u-strip-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    font-family: var(--u-mono);
    font-size: 11px;
    background: var(--u-paper);
    border: 1px solid;
    border-top-color: var(--u-shadow);
    border-left-color: var(--u-shadow);
    border-right-color: var(--u-face-lit);
    border-bottom-color: var(--u-face-lit);
    min-width: 0;
}

.u-strip-cell.is-pass { background: var(--u-pass-bg); }
.u-strip-cell.is-fail { background: var(--u-fail-bg); }
.u-strip-cell.is-current { outline: 2px solid var(--u-navy); outline-offset: -2px; }

.u-strip-mark { font-weight: 700; flex-shrink: 0; }
.u-strip-cell.is-pass .u-strip-mark { color: var(--u-pass); }
.u-strip-cell.is-fail .u-strip-mark { color: var(--u-fail); }

.u-strip-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.u-strip-score { flex-shrink: 0; color: var(--u-ink-soft); }

.u-strip-label {
    font-family: var(--u-prose);
    font-size: 12px;
    color: var(--u-ink-soft);
    line-height: 1.55;
    margin: 0;
}

/* ------------------------------------------------------------- verdicts -- */

/* Four verdicts, so 2x2 at page width rather than 3 + a lone orphan on row 2.
   The 300px floor is what forces two columns inside the 860px page. */
.u-outcomes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.u-outcome {
    border: 1px solid;
    border-top-color: var(--u-face-lit);
    border-left-color: var(--u-face-lit);
    border-right-color: var(--u-shadow);
    border-bottom-color: var(--u-shadow);
    background: var(--u-face);
    padding: 10px;
}

.u-outcome-stamp {
    display: inline-block;
    font-family: var(--u-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 2px 8px;
    border: 2px solid;
    margin-bottom: 7px;
}

.u-outcome-stamp.o-accept { color: var(--u-pass); border-color: var(--u-pass); background: var(--u-pass-bg); }
.u-outcome-stamp.o-reject { color: var(--u-fail); border-color: var(--u-fail); background: var(--u-fail-bg); }
.u-outcome-stamp.o-stop   { color: var(--u-warn); border-color: #c8a800;      background: var(--u-warn-bg); }
.u-outcome-stamp.o-unsure { color: #333;          border-color: #888;         background: #ececec; }

.u-outcome p { font-size: 12.5px !important; margin: 0 !important; line-height: 1.55 !important; }
.u-outcome-when {
    display: block;
    font-family: var(--u-mono);
    font-size: 10.5px;
    color: var(--u-ink-soft);
    margin-top: 6px;
    line-height: 1.45;
}

/* Noise-floor mini illustration. */
.u-noisefloor { margin-top: 10px; }

/* ------------------------------------------------------------ case files -- */

.u-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.u-case {
    text-align: center;
    padding: 10px 6px;
    background: var(--u-paper-alt);
    border: 1px solid;
    border-top-color: var(--u-face-lit);
    border-left-color: var(--u-face-lit);
    border-right-color: var(--u-shadow);
    border-bottom-color: var(--u-shadow);
}

.u-case img {
    width: 32px; height: 32px;
    image-rendering: pixelated;
    display: block;
    margin: 0 auto 6px;
}

.u-case-name {
    display: block;
    font-family: var(--u-prose);
    font-size: 12.5px;
    font-weight: 700;
}

.u-case-what {
    display: block;
    font-family: var(--u-prose);
    font-size: 11.5px;
    color: var(--u-ink-soft);
    line-height: 1.4;
    margin-top: 3px;
}

/* ------------------------------------------------------------ role grid -- */

.u-roles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.u-role {
    background: var(--u-paper-alt);
    border: 1px solid;
    border-top-color: var(--u-face-lit);
    border-left-color: var(--u-face-lit);
    border-right-color: var(--u-shadow);
    border-bottom-color: var(--u-shadow);
    padding: 10px;
}

.u-role-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
}

.u-role-head img { width: 16px; height: 16px; image-rendering: pixelated; }

.u-role-name {
    font-family: var(--u-prose);
    font-size: 13px;
    font-weight: 700;
}

.u-role p { font-size: 12.5px !important; line-height: 1.55 !important; margin: 0 !important; }

.u-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

/* ---------------------------------------------------------------- footer -- */

.u-foot {
    text-align: center;
    font-family: var(--u-prose);
    font-size: 12px;
    color: #f0f0f0;
    text-shadow: 1px 1px 0 rgba(0,0,0,.55);
    padding: 6px 0 24px;
    line-height: 1.7;
}

.u-foot a { color: #ffffff; }

/* --------------------------------------------------------------- helpers -- */

.u-note {
    font-family: var(--u-prose);
    font-size: 12px;
    color: var(--u-ink-soft);
    line-height: 1.55;
    margin: 10px 0 0;
}

.u-kbd {
    font-family: var(--u-mono);
    font-size: 11px;
    background: var(--u-face);
    padding: 1px 5px;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #ffffff,
                inset -2px -2px #808080, inset 2px 2px #dfdfdf;
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 620px) {
    .u-page { padding: 0 8px; margin-top: 10px; }
    .u-win > .window-body { padding: 11px 12px 13px; }
    .u-hero-title { font-size: 22px; }
    .u-win .u-hero-sub { font-size: 14.5px; }
    .u-win p, .u-win li { font-size: 13.5px; }
    .u-controls { flex-direction: column; align-items: stretch; gap: 11px; }
    .u-page input[type="range"] { width: 100%; }
    .u-stamp { font-size: 16px; }
    .u-btnrow button { flex: 1 1 auto; }
}

@media print {
    html { background: #fff !important; animation: none !important; }
    .u-win { break-inside: avoid; }
}
