/* ACAS — design tokens and components.
   Two-hue system drawn from the WSH world: steel-navy ink (uniforms,
   structure) and high-vis amber (the signal colour of a worksite), with
   verified-green reserved for human-approved outcomes. */

@layer reset, tokens, base, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  img, svg { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; }
}

@layer tokens {
  :root {
    /* Palette matched to the official WSH Awards page (tal.sg/wshc):
       leaf-green brand, charcoal ink, green-tinted paper, amber reserved
       for warnings. Colours only — no government masthead or WSHC marks. */
    --ink:      #383838;
    --ink-soft: #4c4d50;
    --muted:    #6d6d6d;
    --paper:    #f5f8f5;
    --surface:  #ffffff;
    --brand:      #9cc840;
    --brand-deep: #61802d;
    --warn:      #f4aa00;
    --green:    #61802d;
    --red:      #be1635;
    --blue:     #076f87;
    /* darker variants for small text on tinted chips — ≥4.5:1 (WCAG AA) */
    --blue-text:  #076f87;
    --green-text: #4f6625;
    --brand-text: #4f6625;
    --warn-text:  #6f4700;
    --red-text:   #be1635;
    --border:   color-mix(in oklch, var(--ink) 14%, transparent);
    --border-soft: color-mix(in oklch, var(--ink) 8%, transparent);

    --fs-0: clamp(.82rem, .8rem + .1vw, .88rem);
    --fs-1: 1rem;
    --fs-2: clamp(1.12rem, 1.08rem + .25vw, 1.25rem);
    --fs-3: clamp(1.35rem, 1.25rem + .5vw, 1.6rem);
    --fs-4: clamp(1.7rem, 1.5rem + 1.1vw, 2.3rem);
    --fs-5: clamp(2.1rem, 1.8rem + 1.8vw, 3.1rem);

    --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
    --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem;

    --r-s: 8px; --r-m: 12px; --r-l: 18px;
    --shadow-s: 0 1px 2px oklch(25% 0.03 255 / .07);
    --shadow-m: 0 1px 3px oklch(25% 0.03 255 / .07),
                0 10px 28px oklch(25% 0.03 255 / .09);
    --focus: 2px solid var(--brand-deep);
  }
}

@font-face {
  font-family: "Inter var";
  src: url("/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@layer base {
  html { color-scheme: light; }
  body {
    font-family: "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
    font-size: var(--fs-1);
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
  h1 { font-size: var(--fs-5); font-weight: 750; }
  h2 { font-size: var(--fs-3); }
  h3 { font-size: var(--fs-2); }
  a { color: var(--blue); text-underline-offset: 3px; }
  :focus-visible { outline: var(--focus); outline-offset: 2px; border-radius: 4px; }
  ::selection { background: color-mix(in oklch, var(--brand) 45%, transparent); }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }
}

@layer components {
  /* ---- shell ---- */
  .skip-link {
    position: absolute; left: -999px; top: 0; z-index: 100;
    background: var(--ink); color: var(--paper);
    padding: .6rem 1rem; border-radius: 0 0 var(--r-s) 0;
    text-decoration: none; font-weight: 600;
  }
  .skip-link:focus { left: 0; }
  #root:focus { outline: none; }
  header.site {
    display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
    padding: var(--sp-4) var(--sp-5);
    background: var(--surface); border-bottom: 1px solid var(--border-soft);
  }
  .brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
  .brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: repeating-linear-gradient(135deg, var(--brand) 0 7px, var(--ink) 7px 14px);
    box-shadow: var(--shadow-s);
  }
  .brand b { font-size: 1.05rem; letter-spacing: -0.01em; }
  .brand small { display: block; color: var(--muted); font-size: var(--fs-0); line-height: 1.2; }
  nav.site { margin-left: auto; display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

  main { max-width: 74rem; margin: 0 auto; padding: var(--sp-5); }

  /* ---- buttons ---- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 2.5rem; padding: .45rem 1.05rem;
    border: 1px solid var(--border); border-radius: var(--r-s);
    background: var(--surface); color: var(--ink);
    cursor: pointer; text-decoration: none; font-weight: 550;
    transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
  }
  .btn:hover { border-color: var(--brand-deep); box-shadow: var(--shadow-s); }
  .btn:active { transform: scale(.98); }
  .btn.primary {
    background: var(--brand); border-color: var(--brand-deep); color: #1d2610;
  }
  .btn.primary:hover { background: color-mix(in oklch, var(--brand) 86%, black); }
  .btn.quiet { border-color: transparent; background: transparent; }
  .btn.quiet:hover { background: color-mix(in oklch, var(--ink) 6%, transparent); }
  .btn.danger { color: var(--red); }
  .btn[disabled] { opacity: .5; cursor: not-allowed; }
  .btn.small { min-height: 2rem; padding: .25rem .7rem; font-size: var(--fs-0); }
  .btn.facet[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  input[type=search]#queue-filter {
    padding: .45rem .7rem; border: 1px solid var(--border); border-radius: var(--r-s);
    background: var(--surface); min-height: 2.5rem;
  }

  /* ---- cards ---- */
  .card {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--r-m); padding: var(--sp-5);
    box-shadow: var(--shadow-s);
  }
  .card + .card { margin-top: var(--sp-4); }
  .card h2 { margin-bottom: var(--sp-3); }
  .card.flat { box-shadow: none; }
  .card.flash { animation: flash-ring 1.6s ease-out 1; }
  @keyframes flash-ring {
    from { box-shadow: 0 0 0 5px color-mix(in oklch, var(--brand) 65%, transparent); }
  }

  /* ---- hero ---- */
  .hero {
    display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--sp-7);
    align-items: center; padding: var(--sp-7) 0 var(--sp-6);
  }
  .hero .kicker {
    color: var(--brand-text); font-weight: 650; font-size: var(--fs-0);
    text-transform: uppercase; letter-spacing: .12em; margin-bottom: var(--sp-3);
  }
  .hero p.lede { color: var(--ink-soft); font-size: var(--fs-2); margin: var(--sp-4) 0 var(--sp-5); max-width: 34rem; }
  .hero .cta-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
  .principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin: var(--sp-6) 0; }
  .principles .card h3 { font-size: 1.02rem; margin-bottom: .35rem; }
  .principles .card p { color: var(--muted); font-size: var(--fs-0); }

  /* ---- funnel spine (signature) ---- */
  .spine { list-style: none; padding: 0; position: relative; }
  .spine li {
    position: relative; padding: 0 0 var(--sp-4) 2.1rem; font-size: var(--fs-0);
    color: var(--muted);
  }
  .spine li::before {
    content: ""; position: absolute; left: .55rem; top: .35rem; bottom: -.35rem;
    width: 2px; background: var(--border);
  }
  .spine li:last-child::before { display: none; }
  .spine li::after {
    content: ""; position: absolute; left: .25rem; top: .18rem;
    width: 0.9rem; height: 0.9rem; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--border);
  }
  .spine li strong { display: block; color: var(--ink-soft); font-weight: 600; font-size: var(--fs-1); }
  .spine li.done::after { background: var(--green); border-color: var(--green); }
  .spine li.now::after {
    background: var(--brand); border-color: var(--brand-deep);
    box-shadow: 0 0 0 5px color-mix(in oklch, var(--brand) 30%, transparent);
  }
  .spine li.now strong { color: var(--ink); }
  .spine li.now { color: var(--ink-soft); }

  /* ---- chips / tags ---- */
  .chip {
    display: inline-block; font-size: .72rem; font-weight: 600;
    padding: .14rem .55rem; border-radius: 999px;
    background: color-mix(in oklch, var(--ink) 8%, transparent); color: var(--ink-soft);
    letter-spacing: .02em;
  }
  .chip.state { background: color-mix(in oklch, var(--blue) 15%, transparent); color: var(--blue-text); }
  .chip.good  { background: color-mix(in oklch, var(--green) 15%, transparent); color: var(--green-text); }
  .chip.warn  { background: color-mix(in oklch, var(--warn) 26%, transparent); color: var(--warn-text); }
  .chip.bad   { background: color-mix(in oklch, var(--red) 14%, transparent); color: var(--red-text); }

  /* ---- forms ---- */
  .field { margin-bottom: var(--sp-4); }
  .field > label { display: block; font-weight: 600; margin-bottom: .3rem; }
  .field .hint { color: var(--muted); font-size: var(--fs-0); margin-bottom: .35rem; }
  .field input[type=text], .field input[type=number], .field input[type=password],
  .field textarea, .field select {
    width: 100%; padding: .55rem .7rem;
    border: 1px solid var(--border); border-radius: var(--r-s);
    background: var(--surface); min-height: 2.5rem;
    transition: border-color .15s, box-shadow .15s;
  }
  .field textarea { resize: vertical; }
  .field :is(input, textarea, select):focus-visible {
    outline: var(--focus); outline-offset: 1px; border-color: var(--brand-deep);
  }
  .field.error :is(input, textarea, select) { border-color: var(--red); }
  .field .error-text { color: var(--red); font-size: var(--fs-0); font-weight: 600; margin-top: .25rem; }

  .error-summary {
    border: 2px solid var(--red); border-radius: var(--r-s);
    background: color-mix(in oklch, var(--red) 6%, var(--surface));
    padding: var(--sp-4); margin-bottom: var(--sp-5);
  }
  .error-summary h3 { color: var(--red); margin-bottom: .4rem; }
  .error-summary a { color: var(--red-text); font-weight: 600; }
  .error-summary:focus { outline: var(--focus); outline-offset: 2px; }

  .stepper { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); flex-wrap: wrap; }
  .stepper span {
    font-size: var(--fs-0); font-weight: 600; color: var(--muted);
    padding: .3rem .7rem; border-radius: 999px; background: color-mix(in oklch, var(--ink) 6%, transparent);
  }
  .stepper span.now { background: var(--ink); color: var(--paper); }
  .stepper span.done { color: var(--green-text); }

  .confirm-panel {
    background: var(--green); color: oklch(98% 0.01 155);
    border-radius: var(--r-m); padding: var(--sp-6); text-align: center;
    margin-bottom: var(--sp-5);
  }
  .confirm-panel h2 { font-size: var(--fs-4); margin-bottom: var(--sp-2); }
  .confirm-panel .ref { font-size: var(--fs-3); font-weight: 750; font-variant-numeric: tabular-nums; }

  /* ---- staff: queue + split pane ---- */
  /* ---- applicant landing ---- */
  .block { margin: var(--sp-7) 0; }
  .block > h2 { margin-bottom: var(--sp-3); }
  .dates { list-style: none; padding: 0; margin: 0 0 var(--sp-3); }
  .dates li { display: flex; justify-content: space-between; gap: var(--sp-3);
    padding: .45rem 0; border-bottom: 1px solid var(--border); }
  .dates li span { color: var(--muted); }
  .awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: var(--sp-4); }
  .award-card { display: flex; flex-direction: column; gap: .45rem; }
  .award-card p { margin: 0; }
  .award-card .btn { margin-top: auto; align-self: flex-start; }
  .howto { list-style: none; counter-reset: step; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: var(--sp-4); }
  .howto li::before { content: counter(step); display: inline-grid;
    place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
    background: var(--ink); color: var(--paper); font-weight: 700;
    margin-bottom: .4rem; }
  .howto li { counter-increment: step; }
  .howto h3 { margin: 0 0 .25rem; }
  .howto p { margin: 0; color: var(--muted); font-size: var(--fs-1); }
  .prep { padding-left: 1.1rem; margin: .25rem 0 var(--sp-3); }
  .prep li { margin: .3rem 0; }

  /* ---- guideline embedding: precheck + declarations ---- */
  .pc-area { margin-top: var(--sp-3); }
  .pc-item { display: flex; gap: var(--sp-2); align-items: baseline; padding: .25rem 0; }
  .pc-item .chip { flex: none; }
  .rolechk.decl { align-items: flex-start; margin: .45rem 0; }
  .rolechk.decl input { margin-top: .2rem; flex: none; }
  .reqbox details { margin: var(--sp-2) 0; }
  .reqbox summary { cursor: pointer; }

  /* ---- staff sign-in & account management ---- */
  .login-wrap { display: grid; place-items: start center; padding-top: var(--sp-7); }
  .login-card { width: min(26rem, 100%); }
  .login-card form { margin-top: var(--sp-4); }
  .login-card .mt { margin-top: var(--sp-4); }
  table.acct { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
  table.acct th { text-align: left; color: var(--muted); font-size: var(--fs-0);
    font-weight: 600; padding: .35rem .6rem .35rem 0; border-bottom: 1px solid var(--border); }
  table.acct td { padding: .5rem .6rem .5rem 0; border-bottom: 1px solid var(--border);
    vertical-align: top; }
  .acct-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
  tr.acct-reset td { background: color-mix(in oklch, var(--brand) 7%, transparent); }
  .rolebox { border: 1px solid var(--border); border-radius: var(--r-s);
    padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
    display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .35rem var(--sp-3); }
  .rolebox legend { font-weight: 600; padding: 0 .3rem; }
  .rolechk { display: flex; align-items: center; gap: .45rem; }
  .rolechk input { accent-color: var(--brand-deep); }

  .queue-item {
    display: flex; align-items: center; gap: var(--sp-3); width: 100%;
    text-align: left; padding: var(--sp-3) var(--sp-4);
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--r-s); cursor: pointer; margin-bottom: var(--sp-2);
    transition: border-color .15s, transform .15s, box-shadow .15s;
  }
  .queue-item:hover { border-color: var(--brand-deep); box-shadow: var(--shadow-s); }
  .queue-item .who { font-weight: 650; }
  .queue-item .meta { margin-left: auto; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

  .progressbar { height: 8px; border-radius: 999px; background: color-mix(in oklch, var(--ink) 8%, transparent); overflow: hidden; }
  .progressbar div { height: 100%; background: var(--green); border-radius: inherit; transition: width .3s; }

  .split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(20rem, .85fr); gap: var(--sp-5); align-items: start; }
  /* Grid items default to min-width auto — a wide table would otherwise
     push the column past the viewport instead of scrolling inside it. */
  .split > * { min-width: 0; }
  .split .scorepane { position: sticky; top: var(--sp-4); max-height: calc(100vh - 2rem); overflow: auto; }

  .unit {
    white-space: pre-wrap; background: color-mix(in oklch, var(--brand) 7%, var(--surface));
    border: 1px solid var(--border-soft); border-left: 3px solid var(--brand);
    border-radius: var(--r-s); padding: var(--sp-4); font-size: .93rem; margin: var(--sp-3) 0;
  }

  .scorerow { padding: var(--sp-3) 0; border-bottom: 1px solid var(--border-soft); }
  .scorerow:last-of-type { border-bottom: none; }
  .scorerow .head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
  .scorerow .head b { font-weight: 650; }
  .scorerow .val {
    font-variant-numeric: tabular-nums; font-weight: 750; font-size: var(--fs-2);
    min-width: 2.4rem; text-align: right;
  }
  .scorerow .desc { color: var(--muted); font-size: var(--fs-0); margin: .15rem 0 .45rem; }
  .scorerow .pair { display: flex; gap: var(--sp-3); align-items: center; }
  .scorerow input[type=range] { flex: 1; accent-color: var(--brand-deep); min-height: 24px; }
  .scorerow input[type=number] { width: 4.6rem; padding: .3rem .4rem; border: 1px solid var(--border); border-radius: 6px; text-align: center; }

  .savestate { color: var(--muted); font-size: var(--fs-0); min-height: 1.2em; }
  .reqbox {
    background: color-mix(in oklch, var(--blue) 6%, var(--surface));
    border: 1px solid var(--border-soft); border-left: 3px solid var(--blue);
    border-radius: var(--r-s); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
  }
  .reqbox ul { margin: .35rem 0 .35rem 1.1rem; }
  .reqbox li { margin: .25rem 0; }
  .card.clarify { border-left: 4px solid var(--brand); }
  .card.clarify ol { margin: .35rem 0 .6rem 1.2rem; }
  .card.clarify .quote {
    background: color-mix(in oklch, var(--brand) 10%, transparent);
    border-radius: 6px; padding: .35rem .6rem; margin: .3rem 0; font-style: italic;
  }
  .claim { display: flex; gap: .5rem; align-items: baseline; padding: .25rem 0; }
  .claim input { accent-color: var(--green); }
  .claim:has(input:checked) span { color: var(--muted); text-decoration: line-through; }
  .simrow { padding: .35rem 0; border-bottom: 1px solid var(--border-soft); }
  .simrow:last-child { border-bottom: none; }
  .scorenote {
    width: 100%; margin-top: .45rem; padding: .35rem .55rem;
    border: 1px solid var(--border-soft); border-radius: 6px;
    font-size: var(--fs-0); resize: vertical; background: var(--surface);
  }
  .scorenote:focus-visible { outline: var(--focus); outline-offset: 1px; }

  .sugg {
    border: 1px solid var(--border-soft); border-left: 3px solid var(--blue);
    border-radius: var(--r-s); padding: var(--sp-3) var(--sp-4); margin: var(--sp-3) 0;
    font-size: .92rem; background: var(--surface);
  }
  .sugg .quote {
    background: color-mix(in oklch, var(--blue) 8%, transparent);
    border-radius: 6px; padding: .35rem .6rem; margin: .3rem 0; font-style: italic;
  }
  .filelist { list-style: none; margin: var(--sp-2) 0; }
  .filelist li {
    display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
    padding: .35rem 0; border-bottom: 1px solid var(--border-soft);
    font-size: var(--fs-0);
  }
  .filelist li:last-child { border-bottom: none; }
  .filelist li.bad .grow { color: var(--red-text); }
  .filelist .grow { flex: 1; min-width: 12rem; word-break: break-word; }
  input[type=file] {
    width: 100%; padding: .5rem; font: inherit; font-size: var(--fs-0);
    border: 1px dashed var(--border); border-radius: var(--r-s);
    background: var(--surface); color: var(--ink);
  }
  input[type=file]:focus-visible { outline: var(--focus); outline-offset: 2px; }
  .cl-round + .cl-round {
    border-top: 1px dashed var(--border-soft);
    margin-top: var(--sp-3); padding-top: var(--sp-3);
  }

  .winner-card {
    border: 1px solid var(--border-soft); border-top: 4px solid var(--brand);
    border-radius: var(--r-m); padding: var(--sp-4); background: var(--surface);
    box-shadow: var(--shadow-s);
  }
  .winner-card h3 { margin-bottom: .5rem; }
  .winner-card li { margin: .25rem 0 .25rem 1rem; font-weight: 550; }
  .winners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--sp-4); }

  table.audit { border-collapse: collapse; width: 100%; font-size: var(--fs-0); }
  table.audit th { text-align: left; color: var(--muted); font-weight: 600; }
  table.audit td, table.audit th { padding: .4rem .5rem; border-bottom: 1px solid var(--border-soft); }
  table.audit td.hash { font-family: ui-monospace, monospace; color: var(--muted); }

  table.compare th small { display: block; font-weight: 400; }
  table.compare th[scope=row] { color: var(--ink); }
  table.compare td.tnum { text-align: right; }
  table.compare tr.diverges td, table.compare tr.diverges th {
    background: color-mix(in oklch, var(--warn) 18%, transparent);
  }
  table.compare tr.diverges td:last-child { color: var(--warn-text); font-weight: 700; }

  .empty { text-align: center; color: var(--muted); padding: var(--sp-7) var(--sp-4); }
  .empty .glyph { font-size: 2rem; margin-bottom: var(--sp-2); }

  .skeleton { border-radius: var(--r-s); background: color-mix(in oklch, var(--ink) 7%, transparent); position: relative; overflow: hidden; min-height: 3rem; margin-bottom: var(--sp-2); }
  .skeleton::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, oklch(100% 0 0 / .55), transparent);
    animation: shimmer 1.3s infinite;
  }
  @keyframes shimmer { from { translate: -100% 0; } to { translate: 100% 0; } }

  #toasts { position: fixed; left: var(--sp-4); bottom: var(--sp-4); display: grid; gap: var(--sp-2); z-index: 50; max-width: 24rem; }

  .stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
  .stat-tiles .card { padding: var(--sp-4); }
  .stat-tiles .num { font-size: var(--fs-4); font-weight: 750; font-variant-numeric: tabular-nums; }
  .stat-tiles .lbl { color: var(--muted); font-size: var(--fs-0); }
  .stat-tiles .sub {
    color: var(--muted); font-size: calc(var(--fs-0) * .92);
    margin-top: .15rem; font-variant-numeric: tabular-nums;
  }
  /* A tile that is also a filter: same face as its neighbours, but it
     reads and behaves as the button it is. */
  .stat-tiles .tile-link {
    font: inherit; text-align: left; cursor: pointer; width: 100%;
    transition: border-color .15s, box-shadow .15s;
  }
  .stat-tiles .tile-link:hover { border-color: var(--brand-deep); box-shadow: var(--shadow-s); }
  .stat-tiles .tile-link:focus-visible { outline: var(--focus); outline-offset: 2px; }
  .funnel-row { display: grid; grid-template-columns: 11rem 1fr 3rem; gap: var(--sp-3); align-items: center; margin: var(--sp-2) 0; }
  .funnel-row .bar { height: 1.4rem; border-radius: 6px; background: color-mix(in oklch, var(--ink) 7%, transparent); overflow: hidden; }
  .funnel-row .bar div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-deep)); border-radius: inherit; min-width: 2px; transition: width .4s; }
  .funnel-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
  .toast {
    background: var(--ink); color: var(--paper); border-radius: var(--r-s);
    padding: .7rem 1rem; box-shadow: var(--shadow-m); font-size: var(--fs-0);
    animation: toast-in .25s ease-out;
  }
  .toast.bad { background: var(--red); }
  .toast.good { background: var(--green); }
  @keyframes toast-in { from { opacity: 0; translate: 0 8px; } }

  footer.site { color: var(--muted); font-size: var(--fs-0); text-align: center; padding: var(--sp-6) var(--sp-4); }
}

@layer utilities {
  .narrow { max-width: 44rem; margin-inline: auto; }
  .page-title { font-size: var(--fs-4); }
  .scroll-x { overflow-x: auto; }
  .muted { color: var(--muted); }
  .small { font-size: var(--fs-0); }
  .row { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
  .grow { flex: 1; min-width: 12rem; }
  .spread { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
  .mt { margin-top: var(--sp-4); } .mb { margin-bottom: var(--sp-4); }
  .tnum { font-variant-numeric: tabular-nums; }
  .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: var(--sp-5); }
  .principles { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split .scorepane { position: static; max-height: none; }
}

/* Panel record printing: a case or audit page prints as a clean document —
   navigation, controls and toasts drop out; content flows in one column. */
@media print {
  nav.site, footer.site, #toasts, .skip-link,
  button, .btn, input, select, textarea, .field, .savestate, .stepper {
    display: none !important;
  }
  body { background: #fff; }
  header.site { border-bottom: 2px solid #000; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  .split { display: block; }
  .split .scorepane { position: static; max-height: none; overflow: visible; }
  .scroll-x { overflow: visible; }
  a { color: inherit; text-decoration: none; }
  .spine li.now::after { box-shadow: none; }
  .claim, .claim input { display: flex !important; }
  .claim input { display: inline-block !important; }
}
