/* KU eval — grading desk.
   Light only, by request. The page is a marking desk: the filing is paper, the
   model's answer is laid against the reference as an answer sheet, and the one
   loud colour (marker yellow) is reserved for what the grader has chosen.
   Fonts are self-hosted: the CSP allows nothing from outside this origin. */

@font-face { font-family: "Bricolage"; src: url("/static/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/static/fonts/plex-sans.woff2") format("woff2"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/static/fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/static/fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;

  --desk: #f3f6fa;        /* page */
  --paper: #ffffff;       /* cards, the filing */
  --tint: #f7f9fc;        /* quiet fills */
  --ink: #0f1b2d;
  --ink-2: #44526a;
  --ink-3: #7a879c;
  --rule: #e2e8f0;
  --rule-2: #cbd5e1;
  --blue: #2447d8;        /* actions, links */
  --blue-soft: #e9eeff;
  --marker: #ffe45c;      /* the grader's own marks, nothing else */
  --marker-ink: #4a3d00;
  --good: #0b7a4b;  --good-soft: #e3f5ec;
  --miss: #b45309;  --miss-soft: #fdf0dc;
  --bad: #c0283a;   --bad-soft: #fdeaec;

  --display: "Bricolage", "Plex Sans", system-ui, sans-serif;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --r: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 8px 24px -12px rgba(15, 27, 45, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; background: var(--desk); color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -.015em; line-height: 1.15; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 2px; }
.num, td.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); } .soft { color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.eyebrow { font: 500 .7rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- controls ---------- */
.btn { appearance: none; border: 1px solid var(--rule-2); background: var(--paper); color: var(--ink); font: 500 .9rem/1 var(--sans); padding: .6rem .95rem; border-radius: 8px; cursor: pointer; transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #1c2c46; border-color: #1c2c46; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--tint); border-color: var(--rule); }
.btn-block { width: 100%; }
.btn kbd { margin-left: .5rem; }

kbd { font: 500 .68rem/1 var(--mono); padding: .18rem .34rem; border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 5px; background: var(--paper); color: var(--ink-2); }
.btn-primary kbd { background: transparent; border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.8); }

.field, select.field, textarea.field { width: 100%; font: 400 .93rem/1.4 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2); border-radius: 8px; padding: .55rem .7rem; }
.field:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
textarea.field { resize: vertical; min-height: 4.5rem; }
.field-label { display: block; margin-bottom: .3rem; font: 500 .78rem/1.2 var(--sans); color: var(--ink-2); }
.hint { font-size: .78rem; color: var(--ink-3); margin-top: .3rem; }
.form-error { color: var(--bad); font-size: .85rem; }
.form-error:empty { display: none; }

.seg { display: inline-flex; padding: 3px; background: #e8edf4; border-radius: 9px; gap: 2px; }
.seg button { appearance: none; border: 0; background: transparent; font: 500 .84rem/1 var(--sans); color: var(--ink-2); padding: .45rem .75rem; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(15,27,45,.12); }

.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 1rem; height: 1rem; accent-color: var(--ink); }

.pill { display: inline-flex; align-items: center; gap: .35rem; font: 500 .74rem/1 var(--sans); padding: .3rem .55rem; border-radius: 99px; background: var(--tint); color: var(--ink-2); border: 1px solid var(--rule); white-space: nowrap; }
.pill-task { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.pill-good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.pill-miss { background: var(--miss-soft); border-color: transparent; color: var(--miss); }
.pill-bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.25rem; height: 56px; padding: 0 1.5rem; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: baseline; gap: .4rem; font: 700 1.05rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: inline-block; padding: .16rem .34rem; background: var(--marker); color: var(--marker-ink); border-radius: 5px; font-size: .8rem; transform: rotate(-3deg); }
.run-label { font-size: .84rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32vw; }
.tabs { display: flex; gap: .15rem; align-self: stretch; margin-left: auto; }
.tab { display: inline-flex; align-items: center; padding: 0 .85rem; font: 500 .9rem/1 var(--sans); color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.tabs[hidden] + .topbar-right { margin-left: auto; }
.who { font-size: .82rem; color: var(--ink-3); }

.banner { margin: 1rem auto 0; max-width: 1360px; padding: .7rem 1rem; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: .9rem; border: 1px solid #f5c2c8; }
.view { max-width: 1360px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-3); }
.empty strong { display: block; font: 650 1.1rem var(--display); color: var(--ink); margin-bottom: .35rem; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.head-sub { color: var(--ink-2); margin-top: .35rem; max-width: 62ch; }
.toolbar { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.toolbar .field { width: auto; }
.toolbar label.stack { display: grid; gap: .3rem; font: 500 .74rem var(--sans); color: var(--ink-3); }
.field-sm { width: 5.5rem !important; }

.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 1.15rem 1.25rem; }
.section { margin-top: 2.25rem; }
.section > h2 { margin-bottom: .3rem; }
.section > .head-sub { margin-bottom: .9rem; }

/* ---------- runs ---------- */
.run-list { display: grid; gap: .7rem; }
.run-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 150px auto; align-items: center; gap: 1.25rem; padding: 1rem 1.25rem; text-decoration: none; color: inherit; transition: border-color .12s, transform .12s; }
.run-row:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.run-name { font: 600 1.02rem/1.25 var(--display); overflow-wrap: anywhere; }
.run-meta { font-size: .82rem; color: var(--ink-3); margin-top: .2rem; }
.meter { height: 6px; border-radius: 99px; background: #e8edf4; overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; }
.meter .m-done { background: var(--ink); }
.meter .m-skip { background: repeating-linear-gradient(135deg, var(--rule-2) 0 3px, transparent 3px 6px); }
.meter-label { font: 400 .76rem var(--mono); color: var(--ink-3); margin-top: .35rem; }
.go { color: var(--ink-3); font-size: 1.1rem; }

/* ---------- grading layout ---------- */
.progress { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.progress .meter { flex: 1; height: 8px; }
.progress-count { font: 500 .85rem var(--mono); color: var(--ink-2); white-space: nowrap; }

.grade-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; align-items: start; }
.grade-side { position: sticky; top: 72px; }
.stack { display: grid; gap: 1rem; }

.item-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .1rem; }
.item-id { font: 400 .8rem var(--mono); color: var(--ink-3); }
.reasons { display: flex; gap: .4rem; flex-wrap: wrap; }

details.fold { border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); }
details.fold > summary { list-style: none; cursor: pointer; padding: .7rem 1rem; display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--ink-2); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "+"; font: 500 1rem/1 var(--mono); color: var(--ink-3); width: .8rem; }
details.fold[open] > summary::before { content: "–"; }
details.fold > summary .eyebrow { color: var(--ink-2); }
.fold-peek { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: .85rem; min-width: 0; flex: 1; }
details.fold[open] .fold-peek { visibility: hidden; }
.fold-body { padding: 0 1rem 1rem; display: grid; gap: .8rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; color: var(--ink-2); }
pre.raw { margin: 0; padding: .8rem .9rem; background: var(--tint); border: 1px solid var(--rule); border-radius: 8px; font: 400 .8rem/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 340px; overflow: auto; }

/* the filing: paper on the desk */
.filing { position: relative; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px var(--r) var(--r) 4px; box-shadow: var(--shadow); padding: 1.4rem 1.6rem 1.5rem 2.1rem; }
.filing::before { content: ""; position: absolute; left: .9rem; top: 0; bottom: 0; width: 1px; background: #f3c6cb; }
.filing-name { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.filing-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.7; max-width: 78ch; max-height: 460px; overflow: auto; }

/* the answer sheet */
.sheet { overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .95rem 1.25rem; border-bottom: 1px solid var(--rule); }
.sheet-tally { display: flex; gap: .4rem; flex-wrap: wrap; }
.sheet-body { padding: .35rem 1.25rem 1.1rem; }
.sheet-key { margin: 1rem 0 .45rem; }
.sheet-note { font-size: .78rem; color: var(--ink-3); padding: 0 1.25rem .9rem; }
.sheet-scroll { overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.cmp th { text-align: left; font: 500 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .5rem .7rem .5rem 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.cmp td { vertical-align: top; padding: .6rem .7rem .6rem 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
table.cmp tr:last-child td { border-bottom: 0; }
table.cmp td.state { width: 1%; white-space: nowrap; padding-right: .9rem; }
.v-ok { color: var(--ink); }
.v-ok::before { content: "✓ "; color: var(--good); font-weight: 600; }
.v-bad { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(192,40,58,.45); }
.v-extra { color: var(--bad); }
.v-none { color: var(--ink-3); }
.expect { display: block; margin-top: .2rem; font-size: .8rem; color: var(--ink-2); }
.expect b { font: 500 .66rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--miss); margin-right: .35rem; }
tr.row-missing td { background: linear-gradient(var(--miss-soft), var(--miss-soft)); }
tr.row-extra td { background: linear-gradient(var(--bad-soft), var(--bad-soft)); }
tr.row-missing td:first-child, tr.row-extra td:first-child { padding-left: .6rem; border-radius: 6px 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.split h4 { margin-bottom: .4rem; }

/* the grade panel */
.grade-panel { padding: 1.2rem 1.25rem 1.25rem; display: grid; gap: 1.05rem; }
.grade-title { display: flex; align-items: baseline; justify-content: space-between; }
.blind-note { font-size: .8rem; color: var(--ink-3); }
.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.quick button { appearance: none; cursor: pointer; border: 1px solid var(--rule-2); background: var(--paper); border-radius: 9px; padding: .55rem .2rem .5rem; display: grid; gap: .25rem; justify-items: center; color: var(--ink); transition: background .1s, border-color .1s, transform .08s; }
.quick button:hover { border-color: var(--ink-3); }
.quick button .q-score { font: 500 1.05rem/1 var(--mono); }
.quick button .q-word { font-size: .68rem; color: var(--ink-3); }
.quick button .q-key { font: 500 .62rem var(--mono); color: var(--ink-3); }
.quick button[aria-pressed="true"] { background: var(--marker); border-color: #e6c82e; transform: rotate(-1.2deg); }
.quick button[aria-pressed="true"] .q-word, .quick button[aria-pressed="true"] .q-key { color: var(--marker-ink); }
.score-row { display: grid; grid-template-columns: 1fr 5.2rem; gap: .75rem; align-items: center; }
.score-row input[type="range"] { width: 100%; accent-color: var(--ink); }
.score-num { font: 500 1.15rem var(--mono) !important; text-align: center; padding: .4rem !important; }
.score-num.is-set { background: var(--marker); border-color: #e6c82e; }
.tagset { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { appearance: none; cursor: pointer; border: 1px dashed var(--rule-2); background: transparent; color: var(--ink-2); font: 500 .8rem/1 var(--sans); padding: .42rem .6rem; border-radius: 99px; display: inline-flex; gap: .4rem; align-items: center; }
.tag:hover { border-color: var(--ink-3); }
.tag[aria-pressed="true"] { border-style: solid; border-color: #e6c82e; background: var(--marker); color: var(--marker-ink); }
.actions { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.keys { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .76rem; color: var(--ink-3); padding-top: .85rem; border-top: 1px dashed var(--rule-2); }
.keys span { display: inline-flex; align-items: center; gap: .3rem; }

.reveal { padding: 1.2rem 1.25rem; display: grid; gap: .9rem; animation: flip .28s ease-out; }
@keyframes flip { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.reveal-model { font: 650 1.35rem/1.15 var(--display); overflow-wrap: anywhere; }
.reveal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.stat { background: var(--tint); border: 1px solid var(--rule); border-radius: 8px; padding: .55rem .65rem; }
.stat b { display: block; font: 500 1.1rem/1.2 var(--mono); }
.stat.mine { background: var(--marker); border-color: #e6c82e; }
.stat span { font-size: .7rem; color: var(--ink-2); }
.reveal-foot { font: 400 .78rem var(--mono); color: var(--ink-3); }

/* side by side */
.sbs-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.sbs-col { display: grid; gap: .75rem; }
.sbs-letter { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--ink); color: #fff; font: 700 1rem var(--display); }
.sbs-head { display: flex; align-items: center; gap: .6rem; }
.sbs-foot { position: sticky; bottom: 0; margin-top: 1.25rem; padding: .85rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); }

/* results: the boundary ladder */
.ladders { display: grid; grid-template-columns: repeat(auto-fit, minmax(540px, 1fr)); gap: 1rem; }
.ladder { padding: 1.15rem 1.25rem 1.2rem; }
.ladder-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .2rem; }
.ladder-answer { font: 650 1.3rem/1.15 var(--display); margin-top: .35rem; overflow-wrap: anywhere; }
.ladder-answer.none { color: var(--ink-3); }
.ladder-note { font-size: .8rem; color: var(--miss); margin-top: .35rem; }
.rungs { margin-top: 1rem; display: grid; gap: .15rem; }
.rung { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 5.5rem; gap: .8rem; align-items: center; padding: .4rem .5rem; border-radius: 8px; }
.rung.is-answer { background: var(--marker); }
.rung-name { font-weight: 500; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rung-cost { font: 400 .74rem var(--mono); color: var(--ink-2); text-align: right; }
.rail { position: relative; height: 22px; }
.rail::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--rule-2); border-radius: 2px; }
.rung.is-answer .rail::before { background: rgba(74,61,0,.25); }
.rail-ci { position: absolute; top: 7px; height: 8px; border-radius: 4px; background: rgba(15,27,45,.16); }
.rail-dot { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--paper); background: var(--bad); box-shadow: 0 0 0 1px rgba(15,27,45,.2); }
.rail-dot.pass { background: var(--good); }
.rail-dot.sure { box-shadow: 0 0 0 1px var(--good), 0 0 0 4px rgba(11,122,75,.18); }
.rail-bar { position: absolute; top: -2px; bottom: -2px; width: 0; border-left: 2px dashed var(--ink); }
.rail-scale { display: grid; grid-template-columns: 9.5rem minmax(0,1fr) 5.5rem; gap: .8rem; padding: 0 .5rem; margin-top: .2rem; }
.rail-scale div { display: flex; justify-content: space-between; font: 400 .68rem var(--mono); color: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .78rem; color: var(--ink-2); margin-top: .9rem; }
.legend i { display: inline-block; vertical-align: -2px; margin-right: .35rem; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; }
.lg-ci { width: 22px; height: 8px; border-radius: 4px; background: rgba(15,27,45,.16); }
.lg-bar { width: 0; height: 12px; border-left: 2px dashed var(--ink); }

/* data tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { text-align: left; font: 500 .66rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: .75rem .7rem; border-bottom: 1px solid var(--rule); background: var(--tint); white-space: nowrap; }
table.data td { padding: .65rem .7rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data th.r, table.data td.r { text-align: right; }
table.data tbody tr.link { cursor: pointer; }
table.data tbody tr.link:hover td { background: var(--tint); }
table.data td.group { font-weight: 600; font-family: var(--display); }
table.data td.wrap { white-space: normal; max-width: 46ch; color: var(--ink-2); font-size: .82rem; }
.scorebar { display: inline-grid; grid-template-columns: 2.6rem 56px; gap: .5rem; align-items: center; }
.scorebar i { display: block; height: 6px; border-radius: 3px; background: #e8edf4; overflow: hidden; }
.scorebar i b { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.exports { display: flex; flex-wrap: wrap; gap: .5rem; }
.exports a { text-decoration: none; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(1200px 500px at 50% -10%, #fff 0, transparent 70%), var(--desk); }
.login-card { width: min(400px, 100%); background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); padding: 2rem 2rem 1.75rem; }
.login-title { font-size: 1.7rem; margin: .9rem 0 .4rem; }
.login-lede { color: var(--ink-2); font-size: .92rem; margin-bottom: 1.4rem; }
.field-row { margin-bottom: .9rem; }

.help { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 30; width: 300px; padding: 1rem 1.1rem; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem .8rem; margin: .7rem 0 0; font-size: .85rem; }
.help dt { display: flex; gap: .2rem; } .help dd { margin: 0; color: var(--ink-2); }

@media (max-width: 1080px) {
  .grade-layout { grid-template-columns: 1fr; }
  .grade-side { position: static; }
  .run-row { grid-template-columns: 1fr; gap: .6rem; }
  .split { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .run-label { display: none; }
}
@media (max-width: 560px) {
  .view { padding: 1.1rem .9rem 3rem; }
  .topbar { padding: 0 .9rem; gap: .6rem; }
  .ladders { grid-template-columns: 1fr; }
  .rung, .rail-scale { grid-template-columns: 6.5rem minmax(0,1fr) 4.4rem; }
  .filing { padding: 1.1rem 1.1rem 1.2rem 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* grid children must be allowed to shrink, or long filings push the page wide */
.stack > *, .grade-layout > *, .sbs-cols > *, .sbs-col > *, .ladders > * { min-width: 0; }
.tab { white-space: nowrap; }
@media (max-width: 560px) {
  .who { display: none; }
  .tab { padding: 0 .6rem; font-size: .84rem; }
  .topbar-right .btn { padding: .5rem .4rem; white-space: nowrap; }
  .sheet-head, .sheet-body { padding-left: 1rem; padding-right: 1rem; }
}

/* studio */
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
label.stack { display: grid; gap: .3rem; font: 500 .8rem var(--sans); color: var(--ink-2); }
label.stack .hint { margin-top: 0; font-weight: 400; }
.model-list { display: grid; gap: .35rem; }
.model-row { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto auto; gap: .8rem; align-items: center; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; }
.model-row:hover { border-color: var(--rule-2); }
.model-row:has(input:checked) { background: var(--marker); border-color: #e6c82e; }
.model-row input { width: 1rem; height: 1rem; accent-color: var(--ink); }
.model-name { font-weight: 500; } .model-id { font: 400 .76rem var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.model-price { font: 400 .76rem var(--mono); color: var(--ink-2); text-align: right; }
.estimate { display: grid; gap: .6rem; }
.estimate .stat b { font-size: 1rem; }
.case { padding: 1rem; border: 1px dashed var(--rule-2); border-radius: 8px; background: var(--tint); }
.doc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
textarea.mono { font: 400 .82rem/1.5 var(--mono); }
@media (max-width: 560px) { .model-row { grid-template-columns: 1.1rem minmax(0,1fr); } .model-price { text-align: left; grid-column: 2; } }
