/* BeaconFTO — black base, lightbar-blue trim. Barlow (highway signage lineage) for text, Barlow Condensed for display. */
@font-face { font-family: Barlow; src: url(/static/fonts/barlow/barlow-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url(/static/fonts/barlow/barlow-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Barlow; src: url(/static/fonts/barlow/barlow-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Barlow; src: url(/static/fonts/barlow/barlow-latin-400-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(/static/fonts/barlow-condensed/barlow-condensed-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(/static/fonts/barlow-condensed/barlow-condensed-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(/static/fonts/barlow-condensed/barlow-condensed-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --black: #000;
  --surface: #070b12;
  --surface-2: #0c1320;
  --surface-3: #121b2c;
  --line: #172238;
  --line-strong: #24324f;
  --text: #e8eef8;
  --muted: #8a9ab5;
  --faint: #6b7a95;
  --blue: #0a95fc;
  --blue-fill: #0070d6;
  --blue-bright: #4db5ff;
  --blue-deep: #04294f;
  --blue-glow: rgba(10, 149, 252, .35);
  --amber: #f2a93b;
  --amber-deep: #3a2608;
  --red: #f0524f;
  --red-deep: #3b0f10;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: Barlow, 'Segoe UI', system-ui, sans-serif;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --side: 248px;
}

* { box-sizing: border-box; }
html { background: var(--black); color-scheme: dark; }
body { margin: 0; font: 400 15px/1.55 var(--body); color: var(--text); background: var(--black); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .005em; margin: 0; line-height: 1.1; }
h1 { font-size: 40px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--blue-fill); color: #fff; padding: 8px 12px; border-radius: var(--r-sm); z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--black); padding: 22px 14px 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 20px; color: var(--text); }
.logo { display: block; height: auto; max-width: 100%; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand-word { font: 600 25px/1 var(--display); letter-spacing: .01em; }
.agency-name { font-size: 13px; color: var(--muted); padding: 0 10px 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 12px; color: var(--muted); border-radius: var(--r-sm); border-left: 2px solid transparent; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a[aria-current='page'] { color: var(--text); border-left-color: var(--blue); background: linear-gradient(90deg, rgba(10,149,252,.14), transparent 70%); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 0; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.me { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-deep); color: var(--blue-bright); font: 600 14px/1 var(--display); border: 1px solid var(--line-strong); flex: none; }
.me-name { font-weight: 600; line-height: 1.2; }
.me-role { font-size: 13px; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; padding: 0; cursor: pointer; }
.linkbtn:hover { color: var(--text); text-decoration: underline; }

.main { min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 18px; padding: 14px 36px; border-bottom: 1px solid var(--line); min-height: 57px; }
.session-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.session-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(10,149,252,.18); }
.session-chip.warn .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(242,169,59,.2); }
.content { padding: 34px 36px 64px; max-width: 1240px; width: 100%; }
.topbar .menu-toggle { display: none; }

/* ---------- Page heads ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 64ch; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: inline-block; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: 600 15px/1 var(--body); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--blue); text-decoration: none; }
.btn-primary { background: var(--blue-fill); border-color: var(--blue-fill); color: #fff; box-shadow: 0 0 0 1px rgba(77,181,255,.25) inset, 0 6px 24px -8px var(--blue-glow); }
.btn-primary:hover { background: #0a80ea; border-color: #0a80ea; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }
.inline-form { display: inline; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 20px 22px; }
.panel + .panel, .stack > * + * { margin-top: 20px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2 > .stack > * + * { margin-top: 20px; }
.grid-half { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.empty { padding: 36px 22px; text-align: left; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- Stat strip (one band, not separate cards) ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: 28px; overflow: hidden; }
.stat { padding: 18px 22px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-num { font: 600 38px/1 var(--display); }
.stat-label { color: var(--muted); font-size: 14px; margin-top: 6px; }
.stat-num.alert { color: var(--amber); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(10,149,252,.035); }
.person { display: flex; align-items: center; gap: 12px; }
.person a { font-weight: 600; color: var(--text); }
.person .sub { font-size: 13px; color: var(--muted); }
td.num, th.num { text-align: right; }

/* ---------- Badges + alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge.blue { color: var(--blue-bright); border-color: rgba(10,149,252,.45); background: rgba(10,149,252,.08); }
.badge.amber { color: var(--amber); border-color: rgba(242,169,59,.45); background: rgba(242,169,59,.07); }
.badge.red { color: var(--red); border-color: rgba(240,82,79,.45); background: rgba(240,82,79,.07); }
.badge.solid { background: var(--blue-fill); color: #fff; border-color: var(--blue-fill); }
.alerts { display: flex; gap: 6px; flex-wrap: wrap; }
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid rgba(10,149,252,.45); background: rgba(10,149,252,.08); margin-bottom: 24px; }
.flash.error { border-color: rgba(240,82,79,.5); background: rgba(240,82,79,.07); }
.flash.error strong { color: var(--red); }
.flash ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Phase rail: the signature element ---------- */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.rail-seg { position: relative; height: 6px; border-radius: 3px; background: var(--line-strong); overflow: hidden; }
.rail-seg.done { background: var(--blue); }
.rail-seg.current { background: var(--blue-deep); box-shadow: 0 0 0 1px var(--blue) inset; }
.rail-seg.current::after { content: ''; position: absolute; inset: 0; width: var(--fill, 40%); background: linear-gradient(90deg, var(--blue), var(--blue-bright)); box-shadow: 0 0 14px var(--blue-glow); border-radius: 3px; }
.rail-lg .rail-seg { height: 10px; border-radius: 5px; }
.rail-labels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 10px; }
.rail-label { font-size: 13px; color: var(--faint); line-height: 1.3; }
.rail-label b { display: block; font: 600 15px/1.2 var(--display); color: var(--muted); }
.rail-label.current b { color: var(--text); }
.rail-label.current { color: var(--muted); }
.rail-label.done b { color: var(--blue-bright); }
.rail-mini { width: 140px; }
/* One orchestrated moment: the current phase sweeps like a lightbar when the page loads. */
@media (prefers-reduced-motion: no-preference) {
  .rail-seg.current::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: sweep 1.6s .25s ease-out 1; z-index: 1; }
  @keyframes sweep { to { transform: translateX(100%); } }
}
.rail-fill-0 { --fill: 6%; } .rail-fill-1 { --fill: 15%; } .rail-fill-2 { --fill: 25%; } .rail-fill-3 { --fill: 35%; } .rail-fill-4 { --fill: 45%; }
.rail-fill-5 { --fill: 55%; } .rail-fill-6 { --fill: 65%; } .rail-fill-7 { --fill: 75%; } .rail-fill-8 { --fill: 85%; } .rail-fill-9 { --fill: 95%; } .rail-fill-10 { --fill: 100%; }

/* ---------- Trainee hero ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: radial-gradient(120% 140% at 100% 0%, rgba(10,149,252,.12), transparent 55%), var(--surface); margin-bottom: 20px; }
.hero-name { font: 600 44px/1 var(--display); }
.hero-meta { color: var(--muted); margin-top: 8px; display: flex; gap: 18px; flex-wrap: wrap; }
.hero-figs { display: flex; gap: 32px; }
.fig-num { font: 600 34px/1 var(--display); }
.fig-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hero .rail-wrap { grid-column: 1 / -1; }

/* ---------- Forms ---------- */
label, .label { display: block; font-weight: 500; margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.field { margin-bottom: 18px; }
.field-error { color: var(--red); font-size: 13px; margin-top: 6px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--black); color: var(--text); font: 400 15px/1.4 var(--body);
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; field-sizing: content; }
input:hover, select:hover, textarea:hover { border-color: #2b4a6e; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,149,252,.22); }
.has-error input, .has-error textarea { border-color: var(--red); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; accent-color: var(--blue); width: 16px; height: 16px; flex: none; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters input, .filters select { width: auto; height: 36px; }
.seg-links { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg-links a { padding: 7px 14px; color: var(--muted); font-size: 14px; border-left: 1px solid var(--line-strong); }
.seg-links a:first-child { border-left: 0; }
.seg-links a[aria-current='true'] { background: var(--blue-deep); color: var(--text); }
.seg-links a:hover { text-decoration: none; color: var(--text); }

/* ---------- DOR form ---------- */
.dor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.dor-side { position: sticky; top: 20px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px 20px; }
.time-item { display: grid; grid-template-columns: 1fr 86px; gap: 10px; align-items: center; }
.time-item label { margin: 0; font-weight: 400; color: var(--muted); }
.time-item input { text-align: right; height: 38px; }
.total-hours { font: 600 44px/1 var(--display); }
.rating-group-name { font: 600 15px/1 var(--display); color: var(--blue-bright); padding: 18px 0 8px; border-bottom: 1px solid var(--line); }
.rating-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 8px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.rating-row .rname { font-weight: 500; }
.rating-row .rcomment { grid-column: 1 / -1; }
.rating-row .rcomment textarea { min-height: 42px; margin-top: 8px; }
.rcomment > summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--faint); display: inline-block; }
.rcomment > summary::-webkit-details-marker { display: none; }
.rcomment > summary:hover { color: var(--text); }
.rcomment[open] > summary { color: var(--muted); }
.rating-row.needs-comment .rcomment > summary { color: var(--amber); }
.scale { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label { margin: 0; min-width: 36px; height: 34px; padding: 0 8px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--black); color: var(--muted); font: 600 15px/1 var(--display); cursor: pointer; }
.scale label:hover { border-color: var(--blue); color: var(--text); }
.scale input:focus-visible + label { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.scale input:checked + label { background: var(--blue-fill); border-color: var(--blue-fill); color: #fff; }
.scale input.low:checked + label { background: var(--amber); border-color: var(--amber); color: #000; }
.scale input.nrt:checked + label { background: var(--red); border-color: var(--red); color: #000; }
.scale input.no:checked + label { background: var(--surface-3); border-color: var(--line-strong); color: var(--text); }
.scale .gap { width: 8px; }
.task-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.levels { display: inline-flex; gap: 4px; }
.levels input { position: absolute; opacity: 0; pointer-events: none; }
.levels label { margin: 0; height: 32px; padding: 0 12px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line-strong); color: var(--muted); font-size: 14px; cursor: pointer; }
.levels input:checked + label { border-color: var(--blue); color: var(--text); background: var(--blue-deep); }
.levels input:focus-visible + label { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.sign-box { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }

/* ---------- Task level marks ---------- */
.lvl { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: inline-block; vertical-align: -2px; flex: none; }
.lvl-1 { border-color: var(--blue); }
.lvl-2 { border-color: var(--blue); background: linear-gradient(90deg, var(--blue) 50%, transparent 50%); }
.lvl-3 { border-color: var(--blue); background: var(--blue); box-shadow: 0 0 8px var(--blue-glow); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-list .lvl-text { margin-left: auto; font-size: 13px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Ratings display ---------- */
.score { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 6px; border-radius: var(--r-sm); font: 600 15px/1 var(--display); border: 1px solid var(--line-strong); color: var(--muted); }
.score.ok { color: var(--text); border-color: var(--line-strong); background: var(--surface-3); }
.score.high { color: #fff; background: var(--blue-fill); border-color: var(--blue-fill); }
.score.low { color: #000; background: var(--amber); border-color: var(--amber); }
.score.nrt { color: #000; background: var(--red); border-color: var(--red); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.prose { white-space: pre-wrap; line-height: 1.6; max-width: 75ch; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 54px; gap: 12px; align-items: center; font-size: 14px; }
.bar-row .num { text-align: right; color: var(--muted); }
.bar-row svg { width: 100%; height: 8px; display: block; }
.trend svg { width: 100%; height: 150px; display: block; }
.integrity { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }

/* ---------- Program builder ---------- */
.phase-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.phase-card + .phase-card { margin-top: 14px; }
.phase-top { display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.phase-num { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--blue); display: grid; place-items: center; font: 600 22px/1 var(--display); color: var(--blue-bright); box-shadow: 0 0 18px -6px var(--blue-glow) inset; }
.phase-body { padding: 8px 20px 16px; }
details.edit > summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit > summary:hover { color: var(--text); }
details.edit[open] > summary { color: var(--blue-bright); }
details.edit .edit-body { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--black); }
.task-edit { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-edit:last-child { border-bottom: 0; }
.cat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--black); font-size: 14px; }
.cat form { display: inline; }
.cat button { background: none; border: 0; color: var(--faint); cursor: pointer; width: 24px; height: 24px; border-radius: 50%; font-size: 16px; line-height: 1; }
.cat button:hover { color: var(--red); background: var(--surface-3); }
.template-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.template-pick input { position: absolute; opacity: 0; }
.template-pick label { margin: 0; height: 100%; padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; font-weight: 400; }
.template-pick label strong { display: block; font: 600 21px/1.15 var(--display); margin-bottom: 8px; }
.template-pick input:checked + label { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset, 0 10px 30px -14px var(--blue-glow); }
.template-pick input:focus-visible + label { outline: 2px solid var(--blue-bright); outline-offset: 2px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); }
.auth-art { position: relative; overflow: hidden; border-right: 1px solid var(--line); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: var(--black); }
.auth-art .beam { position: absolute; inset: -20% -40% auto auto; width: 900px; height: 900px; background: radial-gradient(closest-side, rgba(10,149,252,.28), rgba(10,149,252,.06) 55%, transparent 70%); pointer-events: none; }
.auth-art .lines { position: absolute; inset: 0; opacity: .5; pointer-events: none; }
.auth-headline { position: relative; font: 600 clamp(48px, 6vw, 84px)/.95 var(--display); letter-spacing: -.005em; max-width: 11ch; }
.auth-sub { position: relative; color: var(--muted); max-width: 44ch; margin-top: 18px; font-size: 17px; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 72px); background: var(--surface); }
.auth-panel form { max-width: 400px; width: 100%; }
.auth-panel h1 { font-size: 34px; margin-bottom: 6px; }
.notice-box { max-width: 400px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-left: 2px solid var(--blue); border-radius: var(--r-sm); padding: 12px 14px; margin: 22px 0 18px; background: var(--black); line-height: 1.5; }
.qr { background: #fff; padding: 10px; border-radius: var(--r-md); display: inline-block; }
.qr img { display: block; width: 200px; height: 200px; }
.secret { font: 600 18px/1.4 var(--display); letter-spacing: .08em; color: var(--blue-bright); word-break: break-all; }
.code-input { font: 600 28px/1 var(--display) !important; letter-spacing: .35em; text-align: center; height: 56px !important; }
.temp-pass { font: 600 30px/1.2 var(--display); letter-spacing: .06em; color: var(--blue-bright); padding: 18px 20px; border: 1px dashed var(--blue); border-radius: var(--r-md); background: var(--black); user-select: all; }

/* ---------- Session dialog ---------- */
dialog { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 26px; max-width: 420px; box-shadow: 0 30px 80px -20px #000; }
dialog::backdrop { background: rgba(0,0,0,.72); }
.countdown { font: 600 52px/1 var(--display); color: var(--amber); margin: 10px 0 14px; }

/* ---------- Audit ---------- */
.mono-hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--faint); }
.outcome-failure td:first-child { box-shadow: 2px 0 0 var(--red) inset; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-2, .dor-layout { grid-template-columns: minmax(0, 1fr); }
  .dor-side { position: static; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .template-pick { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { border-left: 0; }
  .side { position: fixed; z-index: 30; width: 270px; left: -280px; transition: left .2s ease; }
  .side.open { left: 0; box-shadow: 20px 0 60px #000; }
  .topbar .menu-toggle { display: inline-flex; margin-right: auto; }
  .topbar { padding: 12px 18px; }
  .content { padding: 24px 18px 56px; }
  h1 { font-size: 32px; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero-name { font-size: 36px; }
  .hero-figs { gap: 22px; flex-wrap: wrap; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 0 !important; border-top: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(2n) { border-left: 1px solid var(--line) !important; }
  .grid-half { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 220px; padding: 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-headline { font-size: 46px; }
  .rating-row { grid-template-columns: minmax(0, 1fr); }
  .scale label { min-width: 30px; padding: 0 5px; height: 36px; }
  .scale .gap { width: 2px; }
  .panel-body, .panel-head { padding-left: 16px; padding-right: 16px; }
  .task-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .levels { flex-wrap: wrap; }
  .page-head { margin-bottom: 20px; }
  .rail-labels .rail-label span { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .phase-top { grid-template-columns: 44px 1fr; }
  .phase-top > :last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Print (DOR packets) ---------- */
@media print {
  :root { --text: #000; --muted: #333; --faint: #555; --line: #bbb; --line-strong: #999; --surface: #fff; --surface-3: #eee; }
  html, body { background: #fff; color: #000; font-size: 11pt; }
  .side, .topbar, .no-print, dialog { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel { border-color: #bbb; break-inside: avoid; }
  .score { color: #000 !important; background: #fff !important; border-color: #000 !important; }
  a { color: #000; }
}
#new-dor { width: 100%; margin-bottom: 2px; }
.stat-num.alert, .total-hours.alert { color: var(--amber); }
.rating-row.needs-comment textarea { border-color: rgba(242,169,59,.55); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.template-pick > div { position: relative; }
.template-pick label > span { display: block; }
.field-narrow { max-width: 520px; }
.mt-sm { margin-top: 12px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 32px; }
.page-head.tight { margin-bottom: 16px; }
.form-row .field .btn { width: 100%; }
.push { margin-left: auto; }
.field-title { font-size: 16px; color: var(--muted); margin-bottom: 6px; }

td .alerts .badge { white-space: normal; height: auto; min-height: 24px; padding: 3px 10px; line-height: 1.3; }
td.rating-group-name { padding: 18px 16px 8px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-row label { margin-bottom: 6px; }
.auth-form { max-width: 400px; }

/* ---------- DOR signature steps ---------- */
.sig-steps { list-style: none; margin: 0 0 12px; padding: 0; }
.sig-steps li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 0 0 16px; position: relative; }
.sig-steps li:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 18px; bottom: 2px; width: 2px; background: var(--line-strong); }
.sig-steps li.done:not(:last-child)::before { background: var(--blue); }
.sig-dot { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--black); }
.sig-steps li.done .sig-dot { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 8px var(--blue-glow); }
.sig-steps li.current .sig-dot { border-color: var(--amber); }
.sig-comment { margin: 6px 0 0; padding: 8px 10px; border-left: 2px solid var(--line-strong); background: var(--black); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.flash .prose { margin: 6px 0; }
.week-figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 14px; }
.week-figs .fig-num.alert { color: var(--amber); }
.recommendation { font: 600 24px/1.2 var(--display); margin: 0; color: var(--blue-bright); }
@media (max-width: 820px) { .week-figs { grid-template-columns: 1fr 1fr; } }
.stats.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stats.stats-4 { grid-template-columns: repeat(4, 1fr); }
.field-wide { max-width: 760px; }
.mail-error { max-width: 36ch; overflow-wrap: anywhere; }
.panel-body.filters { margin: 0; padding-bottom: 0; }
.panel-body > dl.kv.field { margin-bottom: 22px; }

/* ---------- Logo placements ---------- */
.auth-brand { padding: 0; position: relative; }
.topbar-logo { display: none; }
.print-brand { display: none; }
@media (max-width: 820px) { .topbar-logo { display: block; margin-right: auto; } .topbar .menu-toggle { margin-right: 0; } }
@media print {
  .print-brand { display: flex !important; justify-content: space-between; align-items: center; border-bottom: 1px solid #999; padding-bottom: 8px; margin-bottom: 16px; font-size: 10pt; color: #333; }
}

/* ---------- Free-trial reminder for agency administrators ---------- */
.trial-banner { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 16px; margin-bottom: 20px; border-radius: var(--r-md); border: 1px solid rgba(242,169,59,.4); background: rgba(242,169,59,.06); font-size: 14px; }
.trial-banner strong { color: var(--amber); font-weight: 600; }
.trial-banner span { color: var(--muted); }
.plan-extend { display: flex; gap: 8px; align-items: center; }
.plan-extend select { width: auto; height: 40px; }
