/* Design tokens and shared components. Brand colours come from configuration via the layout. */
:root {
  --brand-primary: #1f3a5f;
  --brand-accent: #f2a900;
  --ink: #16202b;
  --ink-soft: #4a5868;
  --paper: #f6f7f9;
  --card: #ffffff;
  --line: #dfe3e8;
  --ok: #1d7a4d;
  --danger: #b42318;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 6px 18px rgb(16 24 40 / 0.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--paper); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 0.75em; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button { cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 0.6em 1em; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
button.primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; font-weight: 600; }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, white); }
button.link { border: 0; background: none; padding: 0; color: var(--brand-primary); text-decoration: underline; }

.stack { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.95rem; }
.field input, .field select { font-weight: 400; padding: 0.7em 0.8em; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 44px; }
.field-inline { display: flex; align-items: center; gap: 0.6rem; font-weight: 500; }
.hint { color: var(--ink-soft); font-size: 0.92rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--brand-primary); }
.message { margin: 1rem auto; max-width: 44rem; padding: 0.8rem 1rem; border-radius: 10px; background: #fff4e5; border: 1px solid #f5c26b; }
.withheld { color: var(--ink-soft); font-style: italic; }
.pill { display: inline-block; padding: 0.15em 0.65em; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--line); }
.pill-live { background: #e3f4ea; color: var(--ok); }
.pill-scheduled { background: #fff4e5; color: #8a5a00; }
.pill-ended { background: #eceff3; color: var(--ink-soft); }

/* Bars (distributions) and scores (lens profiles) animate via --fill. */
.bars, .scores { display: grid; gap: 0.45rem; }
.bar, .score { display: grid; grid-template-columns: minmax(7rem, 14rem) 1fr 2.6rem; align-items: center; gap: 0.6rem; font-size: 0.92rem; }
.bar-track, .score-track { height: 0.9rem; background: #e9edf2; border-radius: 999px; overflow: hidden; }
.bar-fill, .score-fill { display: block; height: 100%; width: var(--fill, 0%); background: var(--brand-primary); border-radius: inherit; transition: width 700ms cubic-bezier(.2,.7,.2,1); }
.score-fill { background: var(--brand-accent); }
.bar-count, .score-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.score-value { text-align: left; white-space: nowrap; }

/* Staircase: five treads rising left to right. */
.staircase { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 4px; }
.staircase .step { position: relative; min-height: calc(3.2rem + var(--i) * 1.4rem); background: #e9edf2; border-radius: 8px 8px 0 0; padding: 0.4rem; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.25rem; font-size: 0.78rem; }
.staircase .step.is-self { background: color-mix(in srgb, var(--brand-accent) 35%, white); }
.staircase .step.is-position { box-shadow: inset 0 0 0 3px var(--brand-primary); }
.step-name { font-weight: 700; }
.step-count { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; width: fit-content; padding: 0.05rem 0.4rem; border-radius: 6px; font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--brand-primary); }
.tag-self { background: #8a5a00; }
.above-line { margin-top: 0.6rem; font-weight: 600; }
.result { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mini { margin-top: 0.75rem; }
.mini h4 { font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
