/* Counselor Command Center · demo styles
   Layout follows RFP wireframes 01–04: left workspace sidebar, top bar, main column + right rail.
   Restrained styling: flat surfaces, thin dividers, plain-text status, line icons only on controls. */

:root {
  --paper: #f5efe3;
  --paper-deep: #ece4d4;
  --surface: #fbf8f2;
  --ink: #15233a;
  --ink-2: #3b475a;
  --ink-3: #5b6474;
  --rule: #ddd2bf;
  --rule-strong: #8f8270;
  --rust: #a3401d;
  --rust-deep: #85310f;
  --ochre: #7a5200;
  --green: #2c5f45;
  --plum: #6a3a68;
  --slate: #4a5263;
  --hilite: #f6ecdb;
  --plum-tint: #efe0ec;
  --ins: #dcebe0;
  --del: #f6e1d5;
  --focus: #1f4fd1;

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r: 3px;
  --side-w: 232px;
  --top-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
table, .tnum { font-variant-numeric: tabular-nums; }
.sid { font-variant-numeric: normal; }
.mono { font-family: var(--mono); font-size: .86em; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; }
ol, ul { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
strong { font-weight: 600; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus, h2:focus, h3:focus, #main:focus { outline: none; }
h1:focus-visible, h2:focus-visible, h3:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--surface); padding: 10px 14px; }
.skip-link:focus { top: 12px; }
.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* ---------- shell: sidebar + workspace ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  border-right: 1px solid var(--rule); background: var(--paper-deep);
  padding: 20px 18px; display: flex; flex-direction: column; gap: 22px;
}
.brand { text-decoration: none; font: 22px/1.1 var(--serif); }
.brand-sub { display: block; margin-top: 6px; font: 12px/1.4 var(--sans); color: var(--ink-3); }
.nav-group { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.nav-group-next { margin-top: 18px; }
.nav-list a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; margin: 0 -10px; text-decoration: none; font-size: 14px; font-weight: 500; border-left: 2px solid transparent; min-height: 36px; }
.nav-list a:hover { background: var(--paper); }
.nav-list a[aria-current] { border-left-color: var(--ink); background: var(--surface); font-weight: 600; }
.nav-count { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.sidebar-foot { margin-top: auto; font-size: 12.5px; color: var(--ink-3); display: grid; gap: 4px; border-top: 1px solid var(--rule); padding-top: 14px; }
.sidebar-foot strong { color: var(--ink-2); }
.sidebar-foot .textlink { justify-self: start; margin-top: 6px; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--paper);
  border-bottom: 1px solid var(--rule); min-height: 56px;
  display: flex; align-items: center; gap: 18px; padding: 8px 28px;
}
.topbar-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; }
.user { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.user strong { color: var(--ink); }
.title-block h1 { font: 28px/1.05 var(--serif); white-space: nowrap; }
.title-block .sub { margin-top: 1px; font-size: 12px; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; gap: 10px; }
.search { position: relative; flex: 0 1 260px; max-width: 280px; margin-left: auto; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search input { width: 100%; min-height: 38px; padding: 7px 12px 7px 34px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: #fffefb; }
.search input::placeholder { color: var(--ink-3); }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; }
.crumbs li + li::before { content: "›"; color: var(--ink-3); margin-right: 6px; }
.crumbs a { display: inline-flex; align-items: center; gap: 2px; min-height: 24px; font-weight: 500; }
.crumbs [aria-current] { color: var(--ink-3); }

#main { display: block; flex: 1; }
.page { padding: 16px 28px 48px; max-width: 1400px; }
.narrow-page { max-width: 900px; }
.footer { border-top: 1px solid var(--rule); padding: 16px 32px 24px; }
.footer p { font-size: 12.5px; color: var(--ink-3); max-width: 1100px; }

/* ---------- type + common ---------- */
h1 { font: 400 clamp(32px, 3.4vw, 42px)/1.05 var(--serif); }
.page-title { margin-bottom: 14px; }
.page-title.split { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-title .sub { margin-top: 6px; font-size: 14px; }
.lede { font-size: 15px; color: var(--ink-2); margin-bottom: 16px; }
.block-h { font: 400 22px/1.15 var(--serif); }
.block-h.small { font-size: 20px; }
.block-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.mini-h { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 4px; }
.sub { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.sub.ok { color: var(--green); }
.muted { color: var(--ink-3); }
.urgent { color: var(--rust-deep); font-weight: 600; }
.fine { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }

.block { margin-bottom: 22px; }
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--ink-2); margin-bottom: 0; }
.block.boxed { border: 1px solid var(--rule); background: var(--surface); padding: 14px 16px; margin: 0; }
.block.boxed .block-head { border-bottom-color: var(--rule); }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }

.layout-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.layout-rail.wide-rail { grid-template-columns: minmax(0, 1fr) 380px; }
.col-rail { position: sticky; top: calc(var(--top-h) + 16px); display: grid; gap: 14px; max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; padding-bottom: 8px; }
.two-col { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(0, 2fr); gap: 28px; align-items: start; margin-bottom: 32px; }
.two-col .block { margin-bottom: 0; }
.two-col.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 18px; border-radius: var(--r); border: 1px solid transparent; font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; background: none; white-space: nowrap; }
.btn.small { min-height: 32px; padding: 5px 12px; font-size: 13px; font-weight: 500; }
.btn.block { width: 100%; }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.primary:hover { background: #24344f; }
.btn.secondary { border-color: var(--ink-2); color: var(--ink); background: transparent; }
.btn.secondary:hover { background: var(--surface); }
.btn[aria-disabled="true"] { background: transparent; color: var(--ink-3); border: 1px dashed var(--rule-strong); cursor: not-allowed; }
.textlink { background: none; border: 0; padding: 2px 0; min-height: 24px; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.textlink.small { font-size: 13px; }
.textlink:hover { text-decoration-thickness: 2px; }
.rowlink { background: none; border: 0; padding: 2px 0; min-height: 24px; font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.rowlink.on { text-decoration: none; color: var(--ink-3); }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-weight: 600; min-height: 24px; }
textarea, input[type="text"], select { width: 100%; border: 1px solid var(--rule-strong); border-radius: var(--r); background: #fffefb; padding: 9px 12px; line-height: 1.55; }
textarea:focus-visible, input:focus-visible, select:focus-visible { outline-offset: 0; }
textarea[readonly], input[readonly] { background: var(--paper); color: var(--ink-2); }
details > summary { cursor: pointer; }
.disclose > summary { font-size: 13.5px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; list-style: none; min-height: 24px; }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose[open] { flex-basis: 100%; }
.disclose.inline { margin-top: 8px; }
.disclose.inline p { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }

/* ---------- plain-text status vocabulary ---------- */
.status { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.st-missing { color: var(--rust-deep); }
.st-conflicting { color: var(--plum); }
.st-unverified { color: var(--slate); }
.st-in_progress { color: var(--ink-2); font-weight: 500; }
.st-complete { color: var(--green); font-weight: 500; }
.fresh { color: var(--ink-3); }
.fr-aging { color: var(--ink-2); }
.fr-stale { color: var(--ochre); font-weight: 600; }
.group { font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.gr-act { color: var(--rust-deep); font-weight: 600; }
.gr-verify { color: var(--plum); font-weight: 600; }
.gr-done { color: var(--green); }

/* ---------- 01 caseload ---------- */
/* caseload pulse (top bar) */
.pulse { display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 500; min-height: 40px; }
.pulse:hover { border-color: var(--ink-2); }
.pulse[aria-expanded="true"] { border-color: var(--ink); }
.pulse-grid { display: grid; grid-template-columns: repeat(5, 7px); gap: 2px; }
.pm { width: 7px; height: 7px; border: 1px solid var(--rule-strong); background: var(--surface); }
.pm-act { background: var(--rust-deep); border-color: var(--rust-deep); }
.pm-verify { background: var(--plum-tint); border-color: var(--plum); }
.pm-open { background: var(--paper-deep); }
.pm-done { border-style: dashed; }

/* caseload map */
.cmap { margin-bottom: 16px; }
.cmap-head { align-items: baseline; justify-content: flex-start; gap: 6px 14px; padding-bottom: 6px; }
.cmap-head .block-sub { margin: 0; }
.cmap-head .textlink { margin-left: auto; }
.cmap-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding-top: 8px; }
.map-cell { display: grid; gap: 1px; align-content: start; height: 100%; padding: 5px 7px 6px; text-decoration: none; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.map-cell:hover .mc-name { text-decoration: underline; }
.map-cell.is-last { box-shadow: inset 0 -3px 0 var(--ink-2); }
.mc-top { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; }
.mc-rank { font-variant-numeric: tabular-nums; }
.mc-group { font-weight: 600; }
.mc-name { font-weight: 600; font-size: 13px; line-height: 1.2; margin-top: 1px; }
.mc-meta { font-size: 11px; line-height: 1.25; }
.mc-marks { font-size: 10.5px; font-weight: 600; margin-top: 1px; line-height: 1.2; }
.mc-act { background: var(--rust-deep); border-color: var(--rust-deep); color: #fff; }
.mc-act.is-last { box-shadow: inset 0 -3px 0 #fff; }
.mc-verify { background: var(--plum-tint); border: 1px solid var(--plum); box-shadow: inset 4px 0 0 var(--plum); color: var(--ink); }
.mc-verify.is-last { box-shadow: inset 4px 0 0 var(--plum), inset 0 -3px 0 var(--ink-2); }
.mc-verify .mc-group { color: var(--plum); }
.mc-open { background: var(--paper-deep); color: var(--ink); }
.mc-open .mc-group { color: var(--ink-2); }
.mc-done { background: transparent; border-style: dashed; color: var(--ink-2); }
.mc-done .mc-group { color: var(--green); }
.mc-verify .mc-meta, .mc-open .mc-meta, .mc-done .mc-meta, .mc-verify .mc-marks, .mc-open .mc-marks, .mc-done .mc-marks { color: var(--ink-2); }
.cmap-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.legend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.legend-k { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-defs { font-size: 12px; }
.swatch { display: block; width: 14px; height: 11px; border: 1px solid var(--rule-strong); border-radius: 2px; box-shadow: none !important; }
.swatch.mc-verify { box-shadow: inset 3px 0 0 var(--plum) !important; }

.segments { display: flex; gap: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.segment { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 0; margin-bottom: -1px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; min-height: 36px; }
.segment .n { color: var(--ink-3); margin-left: 2px; }
.segment:hover { color: var(--ink); }
.segment[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

.rules-list { margin-top: 8px; font-size: 13px; }
.rules-list div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }

.pq-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.pq-group { padding-top: 2px; }
.pq-name { font-weight: 600; font-size: 15px; text-decoration: none; }
.pq-name:hover { text-decoration: underline; }
.pq-reason { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.pq-action { display: grid; justify-items: end; gap: 4px; }
.why > summary { font-size: 12.5px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; list-style: none; min-height: 24px; }
.why > summary::-webkit-details-marker { display: none; }
.why p { font-size: 12.5px; color: var(--ink-2); max-width: 260px; text-align: right; }

.sort-narrow { display: none; align-items: center; gap: 8px; font-size: 13.5px; }
.sort-narrow select { width: auto; min-height: 34px; padding: 3px 8px; }
table { width: 100%; border-collapse: collapse; }
.caseload thead th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; vertical-align: bottom; }
.caseload thead th.sortable { padding: 2px 2px; }
.caseload thead th button { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 2px; cursor: pointer; padding: 6px 8px; min-height: 30px; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.caseload thead th button:hover { color: var(--ink); }
.caseload thead th button:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.caseload thead th[aria-sort] { color: var(--ink); }
.sort-off { opacity: .5; }
.caseload tbody tr { border-bottom: 1px solid var(--rule); }
.caseload tbody tr:hover { background: var(--surface); }
.caseload tbody tr.is-last { background: var(--hilite); }
.caseload td, .caseload tbody th { padding: 10px; vertical-align: top; text-align: left; font-weight: 400; font-size: 14px; }
.student-link { font-weight: 600; text-decoration: none; }
.student-link:hover { text-decoration: underline; }
.c-pri { white-space: nowrap; }
.rank { display: inline-block; min-width: 26px; color: var(--ink-3); }
.c-stu, .c-dl, .c-done { white-space: nowrap; }
.c-st .sub { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.empty { text-align: center; padding: 24px; color: var(--ink-2); }
.table-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }

.import-block { margin-top: 8px; }
.imp-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.imp-controls { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.imp-file-label { font-size: 13.5px; font-weight: 500; }
.imp-controls input[type="file"] { font-size: 13px; max-width: 100%; }
.imp-preview { padding-top: 12px; display: grid; gap: 10px; }
.imp-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--rule); background: var(--surface); font-size: 13.5px; }
.imp-summary-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.notice.warn { border-color: var(--rust-deep); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface); }

.suggest li { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 4px; }
.sg-title { font-weight: 600; font-size: 14px; }
.sg-body { font-size: 13.5px; color: var(--ink-2); }
.sg-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ---------- 02 student detail ---------- */
.top-actions .btn { min-height: 38px; }
.profile { border: 1px solid var(--rule); background: var(--surface); margin-bottom: 28px; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 14px; }
.profile-line { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.profile-group { padding-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.facts div { padding: 10px 20px; border-left: 1px solid var(--rule); }
.facts div:first-child { border-left: 0; }
.facts dt { font-size: 12px; color: var(--ink-3); }
.facts dd { font-size: 14.5px; font-weight: 500; }

.snapshot .snap-text { font-size: 15px; line-height: 1.65; padding-top: 12px; max-width: 78ch; }
.ref { font-size: 11px; font-weight: 600; vertical-align: super; line-height: 1; background: none; border: 0; padding: 2px 3px; margin-left: 1px; min-width: 24px; min-height: 24px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.plain thead th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 8px 8px; border-bottom: 1px solid var(--rule); }
.plain td, .plain tbody th { padding: 9px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; font-weight: 400; font-size: 14px; }
.plain tbody th { font-weight: 500; }
.ms-table .group-row th { font: 400 17px/1.2 var(--serif); padding: 14px 8px 6px; border-bottom: 1px solid var(--rule); background: transparent; }
.ms-table tr.is-selected td, .ms-table tr.is-selected th { background: var(--hilite); }
.plain .num { text-align: right; white-space: nowrap; }
.ev-cell { text-align: right !important; width: 1%; white-space: nowrap; }

.evidence { border: 1px solid var(--rule); background: var(--surface); padding: 14px 16px 16px; }
.ev-title { font: 400 22px/1.15 var(--serif); margin-top: 10px; }
.ev-college { display: block; font: 500 13.5px/1.4 var(--sans); color: var(--ink-3); margin-top: 2px; }
.ev-facts { display: grid; gap: 2px; margin-top: 10px; font-size: 13.5px; }
.ev-facts div, .obs-dl div, .kv div, .summary div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.ev-facts dt, .obs-dl dt, .kv dt, .summary dt { color: var(--ink-3); }
.ev-explain { margin: 12px 0; padding-left: 12px; border-left: 2px solid var(--ink-2); font-size: 13.5px; }
.conflict-label { font-size: 13px; font-weight: 600; color: var(--plum); margin-bottom: 4px; }
.obs-none { font-size: 13.5px; color: var(--slate); padding: 10px 0; border-top: 1px solid var(--rule); }
.obs-list { border-top: 1px solid var(--rule); }
.obs { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 4px; }
.obs-src { font-weight: 600; font-size: 13.5px; }
.obs-said { font-size: 15px; font-weight: 600; }
.obs-dl { font-size: 13px; display: grid; gap: 1px; }
.excerpt { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--ink-2); background: var(--paper); padding: 7px 9px; }
.obs-note { font-size: 12px; color: var(--ink-3); }
.verify-form { margin-top: 14px; display: grid; gap: 8px; }
.verify-form label { display: grid; gap: 1px; font-size: 13.5px; font-weight: 600; }
.verify-form label .sub { font-weight: 400; }
.verify-form .btn { justify-self: start; }
.ver-list { margin-top: 10px; border-top: 1px solid var(--rule); }
.ver-list li { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.ver-list .tnum { font-weight: 600; margin-right: 4px; }
.next-steps { border: 1px solid var(--rule); padding: 14px 16px 6px; }

/* ---------- 04 composer ---------- */
.step { border: 1px solid var(--rule); background: var(--surface); padding: 12px 16px; margin-bottom: 10px; }
.step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.step-h { font: 400 20px/1.2 var(--serif); display: flex; align-items: baseline; gap: 10px; }
.step-n { font: 600 13px/1 var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.step > p { font-size: 13.5px; color: var(--ink-2); }
.kv { display: grid; gap: 2px; font-size: 14px; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv.small { font-size: 13px; }
.field-l { display: block; font-size: 13px; font-weight: 600; margin: 8px 0 4px; }
#draft-body { font-size: 14.5px; min-height: 210px; resize: vertical; }
.draft-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.draft-meta { font-size: 12.5px; color: var(--ink-3); }
.approval-state { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.approval-state.ok { color: var(--green); font-weight: 600; }
.approval-state.warn { color: var(--rust-deep); font-weight: 600; }
.facts-table { margin-top: 6px; }
.facts-table td, .facts-table tbody th { font-size: 13.5px; }

.mail { border: 1px solid var(--rule); background: #fffefb; }
.mail-head { padding: 10px 14px; border-bottom: 1px solid var(--rule); display: grid; gap: 1px; font-size: 13px; }
.mail-head div { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; }
.mail-head dt { color: var(--ink-3); }
.mail-head dd { overflow-wrap: anywhere; }
.mail-head.flat { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.mail-body { white-space: pre-wrap; padding: 14px 0; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.mail-body.small { font-size: 13px; line-height: 1.55; padding: 12px 14px; }
.col-rail .mail-body.small { max-height: 240px; overflow: auto; }
.mail-body.boxed { border: 1px solid var(--rule); background: #fffefb; }
.mail-foot { font-size: 12px; color: var(--ink-3); padding: 8px 14px; border-top: 1px solid var(--rule); }
.summary div { grid-template-columns: 120px minmax(0, 1fr); }
.summary { display: grid; gap: 2px; font-size: 13.5px; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.summary dd { text-align: right; font-weight: 500; }
.notice { font-size: 14px; padding: 10px 0; margin-bottom: 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.notice.ok { border-color: var(--green); }
.workflow-picker, .workflow-form { display: grid; gap: 8px; margin: 18px 0; }
.workflow-picker { max-width: 340px; }
.workflow-picker select, .workflow-form textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--rule-strong);
  background: var(--surface); border-radius: var(--r);
}
.workflow-form textarea { resize: vertical; }
.workflow-form > .btn { justify-self: start; }
.workflow-check { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; }
.workflow-space { margin-top: 14px; }
.workflow-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.workflow-source { padding: 12px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.workflow-source.is-selected { background: var(--hilite); padding: 12px 10px; margin: 0 -10px; }
.workflow-source p { color: var(--ink-2); }
.workflow-source a { display: inline-block; margin-top: 4px; }
.prep-claims { margin: 14px 0; border-top: 1px solid var(--rule); }
.prep-claims li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.prep-actions-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-controls { margin-top: 16px; border-top: 1px solid var(--rule); padding-top: 10px; }
.demo-controls > summary { font-size: 13.5px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; min-height: 24px; }
.demo-controls-body { padding-top: 10px; display: grid; gap: 8px; }
.prep-overview { border: 1px solid var(--rule); background: var(--surface); padding: 12px 16px; margin: 12px 0; display: grid; gap: 8px; }
.prep-overview-list { display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.prep-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-3); padding: 6px 0; border-bottom: 1px solid var(--rule); }
.prep-steps .is-done { color: var(--green); font-weight: 600; }
.prep-steps .is-now { color: var(--ink); font-weight: 600; }
.print-only { display: none; }
@media print {
  body:has(.prep-page) .sidebar,
  body:has(.prep-page) .topbar,
  body:has(.prep-page) .footer,
  .prep-page .col-rail,
  .prep-page .workflow-picker,
  .prep-page .workflow-form,
  .prep-page .notice,
  .prep-page .prep-claims,
  .prep-page .changes,
  .prep-page .imp-summary { display: none !important; }
  body:has(.prep-page) .shell,
  .prep-page .layout-rail { display: block !important; }
  .prep-page .print-only { display: block !important; white-space: pre-wrap; font: 12pt/1.5 Georgia, serif; color: #000; }
}
.workflow-table { width: 100%; border-collapse: collapse; }
.workflow-table th, .workflow-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); overflow-wrap: break-word; }
.workflow-table thead th { color: var(--ink-2); font-size: 13px; }
.extra-workflow .col-rail { display: block; }

/* ---------- 03 review ---------- */
.progress { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.review-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.recipients { border: 1px solid var(--rule); background: var(--surface); padding: 12px 14px; position: sticky; top: calc(var(--top-h) + 16px); }
.recipients li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 10px 0 4px; }
.recipients li.is-current { border-left: 2px solid var(--ink); padding-left: 10px; margin-left: -14px; padding-left: 12px; }
.rc-name { font-weight: 600; font-size: 14px; }
.recipients .sub { grid-column: 1; }
.rc-state { grid-column: 2; grid-row: 1 / span 2; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.rc-state.st-approved, .rc-state.st-logged { color: var(--green); }
.scope { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); padding: 8px 12px; border: 1px solid var(--rule); background: var(--surface); margin-bottom: 10px; }
.review-panel { border: 1px solid var(--rule); background: var(--surface); padding: 12px 16px; margin-bottom: 14px; }
.review-panel .mail-body { padding: 10px 0; max-height: 190px; overflow: auto; font-size: 14.5px; line-height: 1.55; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.deliver { font-size: 13px; color: var(--ink-2); }
.sim, .sim-label { color: var(--rust-deep); font-weight: 600; }
.sim-label { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.changes { margin-top: 10px; border-top: 1px solid var(--rule); padding-top: 10px; }
.changes summary { font-size: 13.5px; font-weight: 500; min-height: 24px; }
.changes summary .muted { font-weight: 400; margin-left: 6px; }
.diff-legend { font-size: 12px; margin: 8px 0; display: flex; gap: 10px; }
.diff { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; padding: 10px 12px; border: 1px solid var(--rule); background: #fffefb; }
ins { background: var(--ins); color: #1d4632; text-decoration: underline; text-underline-offset: 2px; }
del { background: var(--del); color: var(--rust-deep); text-decoration: line-through; }
.review-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); display: grid; gap: 10px; }
.checks { border: 0; padding: 0; margin: 0; }
.checks legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 2px; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; padding: 5px 0; border-bottom: 1px solid var(--rule); cursor: pointer; font-size: 13.5px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); cursor: pointer; }
.checks[disabled] .check { color: var(--ink-3); cursor: default; }
.approve-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gate { font-size: 13px; color: var(--ink-3); }
.gate.ok { color: var(--green); font-weight: 600; }
.gate.warn { color: var(--rust-deep); font-weight: 600; }
.gate.nudge { animation: nudge .35s ease; }
@keyframes nudge { 30% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }
.record { font-size: 12px; color: var(--ink-3); margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--rule); }
.reasons li { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.reasons li:last-child { border-bottom: 0; }
.send-bar { position: sticky; bottom: 0; z-index: 10; margin-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center; padding: 12px 0; background: var(--paper); border-top: 1px solid var(--ink-2); }
.send-bar > p:first-child { font-size: 13.5px; color: var(--ink-2); }
.send-bar .btn { grid-row: 1 / span 2; grid-column: 2; }
.send-bar .gate { grid-column: 1; }
.logged-panel { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); display: grid; gap: 8px; }
.logged-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* ---------- activity ---------- */
.activity-list { border-top: 1px solid var(--rule); }
.act-item { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 4px; font-size: 14px; }
.act-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.act-type { font-weight: 600; color: var(--ink-2); }
.act-title { font-weight: 600; }
.act-item .mini-h { margin: 6px 0 2px; }
.orig summary { font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; min-height: 24px; }
.orig .mail-body { margin-top: 6px; color: var(--ink-2); }

/* ---------- dialog ---------- */
dialog { border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 0; max-width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(21, 35, 58, .4); }
.dialog-body { padding: 22px; display: grid; gap: 12px; }
.dialog-body h2 { font: 400 26px/1.1 var(--serif); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.noscript { padding: 24px; }

/* ---------- responsive / reflow ---------- */
@media (max-width: 1500px) {
  .c-done { display: none; }
}
@media (max-width: 1280px) {
  .layout-rail.wide-rail { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .c-done, .c-act { display: none; }
}
@media (max-width: 1080px) {
  .cmap-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .layout-rail, .layout-rail.wide-rail { grid-template-columns: minmax(0, 1fr); }
  .col-rail { position: static; max-height: none; overflow: visible; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
@media (max-width: 899px) {
  :root { --top-h: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .brand { font-size: 19px; }
  .brand-sub, .nav-group { display: none; }
  .nav-list { display: flex; flex-wrap: wrap; gap: 0 16px; }
  .nav-list a { margin: 0; padding: 4px 0; border-left: 0; border-bottom: 2px solid transparent; background: none !important; }
  .nav-list a[aria-current] { border-bottom-color: var(--ink); }
  .nav-count { margin-left: 4px; }
  .sidebar-foot { margin-top: 0; width: 100%; border-top: 0; padding-top: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
  .sidebar-foot .textlink { margin-top: 0; }
  .topbar { position: static; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .topbar-main { flex-wrap: wrap; }
  .user { display: none; }
  .search { max-width: none; margin-left: 0; }
  .top-actions { margin-left: 0; }
  .page { padding: 18px 16px 40px; }
  .footer { padding: 16px; }
  .review-layout { grid-template-columns: minmax(0, 1fr); }
  .two-col.even { grid-template-columns: minmax(0, 1fr); }
  .recipients { position: static; }

  .cmap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmap-head .textlink { margin-left: 0; }
  .pq-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pq-action { justify-items: start; grid-auto-flow: column; align-items: center; gap: 14px; }
  .why p { text-align: left; }

  /* caseload rows become stacked records; ARIA roles keep table semantics */
  .sort-narrow { display: inline-flex; }
  .caseload thead { display: none; }
  .caseload, .caseload tbody, .caseload tr, .caseload td, .caseload tbody th { display: block; }
  .caseload tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; }
  .caseload td, .caseload tbody th { padding: 0; }
  .caseload .c-stu { grid-column: 1; }
  .caseload .c-stu .sub { display: inline; margin-left: 6px; }
  .caseload .c-pri { grid-column: 2; grid-row: 1; text-align: right; }
  .caseload .c-pri .rank { display: none; }
  .caseload .c-need { grid-column: 1 / -1; }
  .caseload .c-need .sub { display: inline; margin-left: 6px; }
  .caseload .c-st { grid-column: 1 / -1; }
  .caseload .c-st .sub { display: inline; margin-left: 8px; white-space: normal; }
  .caseload .c-dl { grid-column: 1 / -1; white-space: normal; font-size: 13.5px; }
  .caseload .c-dl::before { content: "Deadline: "; color: var(--ink-3); }
  .caseload .c-dl .sub { display: inline; margin-left: 6px; }
  .caseload .c-done, .caseload .c-act { display: none; }
  .caseload tbody tr:hover { background: none; }

  .ms-table thead { display: none; }
  .ms-table, .ms-table tbody { display: block; }
  .ms-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .ms-table tr.group-row { display: block; border-bottom: 0; padding-bottom: 0; }
  .ms-table td, .ms-table tbody th { padding: 0; border: 0; display: block; }
  .ms-table .group-row th { padding: 12px 0 0; border: 0; }
  .ms-table td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; }
  .ms-table .obs-cell { grid-column: 1 / -1; }
  .ms-table .ev-cell { grid-column: 1 / -1; text-align: left !important; }
  .ms-table tr.is-selected { background: var(--hilite); }
  .ms-table tr.is-selected td, .ms-table tr.is-selected th { background: none; }

  .send-bar { position: static; grid-template-columns: minmax(0, 1fr); }
  .send-bar .btn { grid-row: auto; grid-column: 1; justify-self: start; }
}
@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div { border-left: 0 !important; border-top: 1px solid var(--rule); }
  .facts div:first-child { border-top: 0; }
  .profile-top { flex-direction: column; gap: 4px; }
  .step, .review-panel, .evidence { padding-left: 14px; padding-right: 14px; }
  .facts-table thead { display: none; }
  .facts-table, .facts-table tbody, .facts-table tr, .facts-table td, .facts-table tbody th { display: block; }
  .facts-table tr { padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .facts-table td, .facts-table tbody th { border: 0; padding: 1px 0; }
  .workflow-table thead { display: none; }
  .workflow-table, .workflow-table tbody, .workflow-table tr, .workflow-table td, .workflow-table tbody th { display: block; }
  .workflow-table tr { padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .workflow-table td, .workflow-table tbody th { border: 0; padding: 2px 0; }
  .workflow-table td::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: 13px; }
  .top-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .btn { border: 1px solid CanvasText; }
  .btn[aria-disabled="true"] { border-style: dashed; }
  .segment[aria-pressed="true"], .nav-list a[aria-current] { border-color: CanvasText; }
}
