/* PriorArt workbench: Night Desk v2 (.design/DESIGN.md).
   Idea line: every claim argued before it is filed.
   Every colour, glass, radius, font and duration is a token in tokens.css, linked before this file. This file names
   no colour at all: no hex, no rgb, no hsl. State hues paint only a 10px mark and the state word. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--sans);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-ink); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0 0 0.75em; }
img, iframe { max-width: 100%; }
::selection { background: var(--select); }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; margin: 8px 0 0; }
.ta-r { text-align: right; }
.cap::first-letter { text-transform: uppercase; }
.inline { display: inline; margin: 0; }
.sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); margin: 0 9px; vertical-align: middle; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.stack-s > * + * { margin-top: 12px; }

/* layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.main { padding-top: 28px; padding-bottom: 80px; }
.narrow { max-width: 560px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link { color: var(--ink-2); padding: 6px 10px; border-radius: var(--r-s); font-weight: 500; font-size: 13.5px; }
.nav-link:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.nav-link.is-active { color: var(--ink); }
.nav-btn { background: none; border: 0; font: inherit; cursor: pointer; }
.demo-strip { background: var(--med-tint); color: var(--med); border-bottom: 1px solid var(--med-line); font-size: 12px; text-align: center; padding: 5px 16px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font: 500 13.5px/1 var(--sans); white-space: nowrap; cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--surface-2); border-color: var(--line-3); text-decoration: none; color: var(--ink); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .subtab:focus-visible, .linklike:focus-visible {
  outline: 2px solid var(--accent-ring); outline-offset: 2px;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunk); border-color: transparent; }
.btn.btn-quiet { color: var(--muted); padding-left: 0; }
.btn.btn-quiet:hover { background: transparent; color: var(--high); }
.btn-warn { background: var(--high); border-color: var(--high); color: var(--on-high); }
.btn-warn:hover { background: var(--high-ink); border-color: var(--high-ink); color: var(--on-high); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-s); }
.btn-block { width: 100%; }
.btn.is-busy { pointer-events: none; opacity: 0.8; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; text-underline-offset: 2px; }

/* type */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-title { font-family: var(--display); font-size: 30px; line-height: 1.15; font-weight: 600; }
.page-sub { color: var(--muted); margin: 6px 0 0; font-size: 13.5px; }
.crumbs { color: var(--muted); font-size: 12.5px; margin: 0 0 6px; overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.lede { color: var(--ink-2); font-size: 15px; }

/* alerts */
.alert { border: 1px solid; border-radius: var(--r); padding: 10px 14px; margin: 0 0 16px; font-size: 13.5px; }
.alert-err { background: var(--high-tint); border-color: var(--high-line); color: var(--high); }
.alert-warn { background: var(--med-tint); border-color: var(--med-line); color: var(--med-ink); }
.alert-info { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent-ink); }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border-radius: 5px; font-size: 12px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* State marks (Night Desk v2): a status is a 10px square plus its word, never a fill or a glow behind a row. The
   shape carries the meaning without colour: filled blocks or needs you soon, outlined waits, a check is done. */
.st-done, .st-complete { color: var(--muted); }
.st-running { color: var(--ink); }
.st-queued { color: var(--muted); }
.st-failed { color: var(--high); }
.st-needs_input, .st-stale { color: var(--med); }
.st-ready, .st-new, .st-pending, .st-skipped { color: var(--muted); }
/* waiting for an agent handoff answer: nothing failed and nothing runs; link-blue word, outlined mark */
.st-waiting { color: var(--accent-ink); background: none; border-color: transparent; border-style: dashed; }
.lvl { display: inline-block; font: 600 10.5px/1 var(--sans); letter-spacing: 0.06em; padding: 4px 6px; border-radius: 4px; border: 1px solid; }
.lv-high { color: var(--high); background: var(--high-tint); border-color: var(--high-line); }
.lv-med { color: var(--med-ink); background: var(--med-tint); border-color: var(--med-line); }
.lv-low { color: var(--low); background: var(--low-tint); border-color: var(--low-line); }
.badge-ok, .badge-dim { display: inline-block; font: 500 10.5px/1 var(--sans); padding: 3px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }
.badge-ok { color: var(--ok); background: var(--ok-tint); }
.badge-dim { color: var(--muted); background: var(--sunk); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 6px; border-radius: 4px; background: var(--sunk); color: var(--ink-2); margin: 0 4px 4px 0; }
.tags { display: inline-flex; flex-wrap: wrap; }


/* forms */
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; font: 14px/1.5 var(--sans); color: var(--ink);
  background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--r);
  padding: 8px 11px; transition: border-color var(--t), box-shadow var(--t);
}
input[type=text], input[type=password], input[type=search], select { height: 36px; padding-top: 0; padding-bottom: 0; }
textarea { resize: vertical; min-height: 72px; }
input:focus, textarea:focus, select:focus { outline: 2px solid transparent; outline-offset: 1px; border-color: var(--accent); box-shadow: none; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
::placeholder { color: var(--faint); }
.field { display: block; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.label { display: block; font-weight: 500; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.hint { display: block; color: var(--muted); font-size: 12.5px; margin: -2px 0 6px; }
.mono-area, .code-area { font: 12.5px/1.6 var(--mono); }
.code-area { background: var(--surface-2); tab-size: 2; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.segmented { display: inline-flex; padding: 3px; background: var(--sunk); border-radius: 8px; margin-bottom: 20px; gap: 2px; }
.seg { padding: 6px 14px; border-radius: 6px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.seg:hover { text-decoration: none; color: var(--ink); }
.seg.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.fsec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 22px 6px; margin-bottom: 16px; }
.fsec-title { font-family: var(--display); font-size: 18px; margin-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.form-side .panel { padding: 18px; }
.panel-title { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.sticky { position: sticky; top: 76px; }
.radio, .toggle { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; cursor: pointer; transition: border-color var(--t), background var(--t); }
.radio:hover, .toggle:hover { border-color: var(--line-2); }
.radio:has(input:checked) { border-color: var(--accent-line); background: var(--accent-tint); }
.radio input { margin-top: 3px; accent-color: var(--accent); }
.radio strong, .toggle strong { display: block; font-weight: 500; font-size: 13.5px; }
.radio small, .toggle small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.toggle { margin: 4px 0 16px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { flex: 0 0 auto; width: 30px; height: 18px; border-radius: 5px; background: var(--line-2); position: relative; margin-top: 2px; transition: background var(--t); }
.toggle-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 4px; background: var(--knob); transition: transform var(--t); box-shadow: var(--shadow); }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(12px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.side-stages { margin: 4px 0 16px; }
.mini-steps { margin: 6px 0 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-wrap: wrap; gap: 4px; }
.mini-steps li { counter-increment: s; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; }
.mini-steps li::before { content: counter(s, decimal-leading-zero) " "; font-family: var(--mono); color: var(--faint); font-size: 11px; }
.form-side .btn + .btn { margin-top: 8px; }

.drop { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 8px; background: var(--surface-2); cursor: pointer; min-width: 0; transition: border-color var(--t), background var(--t); }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-tint); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop:focus-within { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.drop-btn { flex: 0 0 auto; height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); font-weight: 500; font-size: 12.5px; }
.drop-names { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.drop.has-files .drop-names { color: var(--ink); }

/* auth */
.is-auth .main { display: flex; justify-content: center; padding-top: 12vh; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 32px; box-shadow: var(--shadow); }
.auth-title { font-family: var(--display); font-size: 24px; margin-bottom: 6px; }
.auth-card form { margin-top: 20px; }
.setup-list { margin: 16px 0; }
.setup-list div { display: grid; grid-template-columns: 170px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.setup-list dt { font-weight: 500; }
.setup-list dd { margin: 0; color: var(--ink-2); }

/* matters list */
.filters { display: flex; gap: 8px; margin-bottom: 16px; }
.filters input { max-width: 320px; }
.filters select { max-width: 200px; }
.mtable { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 120px 170px 120px 90px 80px; gap: 16px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--ink); transition: background var(--t); }
a.mrow:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.mrow.mhead { border-top: 0; padding-top: 10px; padding-bottom: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 500; }
.m-title { min-width: 0; }
.m-title .t { display: block; font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-title .v { display: block; color: var(--muted); font-size: 12.5px; }
.m-mode, .m-upd { color: var(--ink-2); font-size: 13px; }
.m-stage { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); }
.segbar { display: flex; gap: 3px; }
.segbar i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); max-width: 22px; }
.segbar i.on { background: var(--accent); }
.empty { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 48px 24px; text-align: center; }
.empty .row-gap { justify-content: center; margin-top: 14px; }
.empty-title { font-family: var(--display); font-size: 20px; margin-bottom: 6px; }
.empty-note { color: var(--muted); padding: 14px 0; margin: 0; }

/* matter page */
.mhead-wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 16px; }
.mhead-l { min-width: 0; }
.matter-title { font-family: var(--display); font-size: 28px; line-height: 1.2; font-weight: 600; overflow-wrap: anywhere; }
.mhead-r { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.cost-total { color: var(--ink-2); font-size: 14px; }
.actionbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0 18px; border-top: 1px solid var(--line); }
.runline { color: var(--ink-2); font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; }
.done-line { margin-left: 0; margin-right: 8px; color: var(--ok); font-weight: 500; }

.stepper { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.step-a { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); overflow: hidden; height: 100%; transition: border-color var(--t), background var(--t), box-shadow var(--t); }
.step-a:hover { text-decoration: none; border-color: var(--line-2); color: var(--ink); }
.step.is-sel .step-a { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.step-n { color: var(--faint); font-size: 11.5px; padding-top: 1px; }
.step-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.step-name { font-weight: 600; font-size: 13.5px; }
.step-meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--muted); white-space: nowrap; }
.step-cost { font-size: 11px; color: var(--faint); }
.step-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.step.st-done .step-bar { background: var(--ok); }
.step.st-done .step-st { color: var(--ok); }
.step.st-failed .step-bar { background: var(--high); }
.step.st-failed .step-st { color: var(--high); }
.step.st-needs_input .step-bar, .step.st-stale .step-bar { background: var(--med); }
.step.st-needs_input .step-st, .step.st-stale .step-st { color: var(--med-ink); }
.step.st-waiting .step-bar { background: var(--accent-line); }
.step.st-waiting .step-st { color: var(--accent-ink); }
.step.st-skipped .step-a { background: var(--surface-2); }
.step.st-skipped .step-name { color: var(--muted); }
.step.st-queued .step-st, .step.st-running .step-st { color: var(--accent); }
.step.st-queued .step-bar { background: var(--accent-line); }
.step.st-running .step-a { background: var(--accent-tint); border-color: var(--accent-line); }

.mgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.mmain { min-width: 0; }
.mside { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.out-panel { padding: 22px 24px 24px; }
.out-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.out-title { font-family: var(--display); font-size: 22px; line-height: 1.2; }
.out-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.sub-h { font-family: var(--display); font-size: 15px; font-weight: 500; color: var(--ink-2); margin: 22px 0 10px; }
.working { padding: 8px 0 4px; }

.confirm-wrap { position: relative; flex: 0 0 auto; }
.confirm-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 280px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow-pop); font-size: 13px; }
.mside .confirm-box { position: static; width: auto; margin-top: 8px; box-shadow: none; }

.panel-ask { padding: 20px 22px; margin-bottom: 16px; border-color: var(--med-line); background: var(--med-tint); }
.panel-head { margin-bottom: 14px; }
.panel-h { font-family: var(--display); font-size: 19px; margin-bottom: 4px; }
.q-label { display: flex; gap: 10px; font-weight: 500; }
.q-n { color: var(--med); font-size: 12px; padding-top: 1px; }

.side-panel { padding: 14px 16px; }
.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.side-title { font-family: var(--display); font-size: 15px; font-weight: 500; color: var(--ink); }
.log { margin: 0; max-height: 300px; min-height: 80px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; font: 11.5px/1.65 var(--mono); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.usage { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.usage th { text-align: left;
}
.usage th.ta-r { text-align: right; }
.usage th { font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 0 0 6px; }
.usage td { padding: 5px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.usage .mono { font-size: 11.5px; }
.vers { list-style: none; margin: 0; padding: 0; }
.vers a { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; padding: 6px 6px; margin: 0 -6px; border-radius: var(--r-s); color: var(--ink-2); font-size: 12.5px; }
.vers a:hover { background: var(--sunk); text-decoration: none; color: var(--ink); }
.vers li.is-on a { background: var(--accent-tint); color: var(--accent-ink); }
.vers-o { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vers-t { color: var(--faint); }
.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink-2); text-align: right; }
.side-links { margin: 10px 0 4px; font-size: 13px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 12px; background: var(--toast-bg); color: var(--toast-ink); padding: 8px 8px 8px 16px; border-radius: var(--r); box-shadow: var(--shadow-pop); font-size: 13.5px; }

/* outputs */
.details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details summary::before { content: ""; display: inline-block; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); margin-right: 9px; vertical-align: 2px; transition: transform var(--t); }
.details[open] summary::before { transform: rotate(45deg); vertical-align: 3px; }
.details > *:not(summary) { margin-top: 12px; }
.raw { margin-top: 24px; }
.pre { margin: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px 14px; font: 12px/1.6 var(--mono); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 520px; overflow: auto; }
.pre-tall { max-height: 70vh; }

.prose { font-size: 14.5px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { font-family: var(--display); margin: 1.1em 0 0.4em; }
.prose h1 { font-size: 22px; } .prose h2 { font-size: 19px; } .prose h3 { font-size: 16px; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--sunk); padding: 1px 4px; border-radius: 3px; }

.cols-2-1 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.box { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--surface-2); margin-bottom: 12px; }
.box-note { background: var(--med-tint); border-color: var(--med-line); }
.box-h { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.feat { list-style: none; margin: 0; padding: 0; }
.feat li { display: grid; grid-template-columns: 34px 1fr; gap: 6px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.feat li:first-child { border-top: 0; }
.plain { margin: 0; padding-left: 1.1em; font-size: 13.5px; }
.plain li + li { margin-top: 3px; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 18px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; background: var(--surface-2); }
.stat-n { display: block; font-size: 22px; font-weight: 500; color: var(--ink); }
.stat-l { color: var(--muted); font-size: 12px; }

.rtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rtable th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.rtable td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rtable td:first-child, .rtable th:first-child { padding-left: 0; }
.r-doc { min-width: 0; }
.r-num { font-weight: 500; }
.r-title { font-weight: 500; margin-top: 2px; overflow-wrap: anywhere; }
.r-teach { color: var(--ink-2); margin-top: 4px; }
.threat { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.label-inline { color: var(--muted); margin-right: 6px; }

.verdict { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; border: 1px solid; border-radius: var(--r); padding: 14px 18px; margin-bottom: 16px; }
.verdict-l { font-size: 13px; font-weight: 500; opacity: 0.8; }
.verdict-v { font-family: var(--display); font-size: 21px; font-weight: 600; }
.verdict-x { font-size: 12.5px; margin-left: auto; }
.v-ok { color: var(--ok); background: var(--ok-tint); border-color: var(--ok-line); }
.v-med { color: var(--med-ink); background: var(--med-tint); border-color: var(--med-line); }
.v-high { color: var(--high); background: var(--high-tint); border-color: var(--high-line); }
.v-low { color: var(--low); background: var(--low-tint); border-color: var(--low-line); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 4px; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--surface); }
.card-h { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.card-h .tag { margin: 0; }
.card-t { flex: 1; min-width: 0; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-s { border-top: 1px solid var(--line); padding-top: 9px; margin-top: 9px; font-size: 13.5px; }
.card-sh { font-size: 13px; color: var(--accent); margin-bottom: 5px; font-weight: 500; }
.kvs { margin: 0; }
.kv { margin-bottom: 6px; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.vlist { margin: 0; padding-left: 1.1em; }
.vstack { display: grid; gap: 8px; }
.vcard { border-left: 2px solid var(--line); padding-left: 10px; }

.audit-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; margin-bottom: 8px; align-items: stretch; }
.audit-top .verdict { margin: 0; flex-direction: column; gap: 4px; justify-content: center; }
.audit-top .verdict-x { margin-left: 0; }
.scores { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; display: grid; gap: 7px; }
.score { display: grid; grid-template-columns: 52px 1fr 40px; gap: 10px; align-items: center; }
.score-k { color: var(--ink-2); font-size: 12px; }
.score-v { text-align: right; font-size: 12px; color: var(--ink-2); }
.score-bar { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: 3px; transition: width 300ms ease; }
.sb-ok { background: var(--accent); }
.sb-med { background: var(--med-bar); }
.sb-low { background: var(--high); }
.fgroup { margin-top: 18px; }
.fgroup-h { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.findings { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); }
.findings li { padding: 10px 14px; border-top: 1px solid var(--line); }
.findings li:first-child { border-top: 0; }
.findings p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-2); }
.f-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.f-check { font-weight: 500; }
.f-loc { color: var(--muted); font-size: 11.5px; text-align: right; }

/* draft document preview */
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; overflow-x: auto; }
.subtab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; margin-bottom: -1px; font: 500 13.5px var(--sans); color: var(--muted); cursor: pointer; white-space: nowrap; transition: color var(--t), border-color var(--t); }
.subtab:hover:not(:disabled) { color: var(--ink); }
.subtab.is-on { color: var(--ink); border-bottom-color: var(--ink); }
.subtab:disabled { opacity: 0.45; cursor: default; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.paper { background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); border-radius: var(--r-s); padding: 44px 56px; max-height: 78vh; overflow-y: auto; box-shadow: none; }
.doc { font-family: var(--serif); font-size: 15px; line-height: 1.7; color: var(--paper-ink); max-width: 720px; margin: 0 auto; }
.doc-title { font-family: var(--serif); font-size: 16px; text-align: center; font-weight: 600; letter-spacing: 0.02em; line-height: 1.45; margin: 0 0 26px; }
.doc-head { font-family: var(--serif); font-size: 14.5px; text-align: center; font-weight: 600; letter-spacing: 0.04em; margin: 26px 0 12px; }
.doc-break { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc-sub { font-family: var(--serif); font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.doc-lead { margin: 0 0 12px; }
.para { margin: 0 0 12px; text-align: left; }
.pnum { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-right: 10px; }
.claim { display: grid; grid-template-columns: 30px 1fr; gap: 4px; margin: 0 0 14px; }
.claim.dep { margin-left: 22px; }
.cnum { font-weight: 600; }
.cbody p { margin: 0 0 4px; }
.ccont { padding-left: 24px; }
.abstract { text-indent: 0; }
.numerals { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 18px; font-size: 13px; }
.numerals div { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.numerals .mono { color: var(--accent); min-width: 34px; }
.note-input { flex: 1; min-width: 200px; }

.fig-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.pdf-frame { border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; display: flex; flex-direction: column; background: var(--sunk); min-height: 520px; }
.pdf-frame iframe { flex: 1; width: 100%; min-height: 520px; border: 0; background: var(--paper); }
.pdf-tall, .pdf-tall iframe { min-height: 720px; }
.pdf-bar { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pdf-empty { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }

.pkg { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
.pkg-list .btn-block { margin-bottom: 12px; }
.files { list-style: none; margin: 0 0 14px; padding: 0; }
.files li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.files li:first-child { border-top: 0; }
.files-pkg li { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 7px 8px; margin: 0 -8px; border-radius: var(--r-s); border-top: 0; }
.files-pkg li.is-on { background: var(--accent-tint); }
.files-pkg .linklike, .files li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftype { font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 0; text-align: center; background: var(--surface); }
.intake { margin: 0; }
.intake > div { padding: 12px 0; border-top: 1px solid var(--line); }
.intake > div:first-child { border-top: 0; padding-top: 0; }
.intake dt { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.intake dd { margin: 0; overflow-wrap: anywhere; }

/* versions */
.vgrid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.vgrid .side-title { margin-bottom: 8px; }
.diff { margin: 0; font: 12px/1.6 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 0; max-height: 75vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff span { display: block; padding: 0 14px; }
.d-add { background: var(--ok-tint); color: var(--ok-ink); }
.d-del { background: var(--high-tint); color: var(--high); }
.d-hunk { color: var(--accent); background: var(--accent-tint); margin-top: 6px; }
.d-ctx { color: var(--muted); }

/* responsive */
@media (max-width: 1080px) {
  .mgrid { grid-template-columns: minmax(0, 1fr); }
  .mside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mrow { grid-template-columns: minmax(0, 1fr) 150px 110px 80px 70px; }
  .mrow .m-mode, .mhead > div:nth-child(2) { display: none; }
}
@media (max-width: 860px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .stepper { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-2-1, .fig-grid, .pkg, .audit-top, .vgrid { grid-template-columns: minmax(0, 1fr); }
  .paper { padding: 28px 26px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .main { padding-top: 20px; }
  .brand-name { font-size: 16.5px; }
  .nav { gap: 2px; }
  .nav-link { padding: 6px 8px; }
  .nav > .nav-link:first-child { display: none; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn, .page-head form .btn { width: 100%; }
  .page-title { font-size: 26px; }
  .matter-title { font-size: 23px; }
  .mhead-wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .filters { flex-wrap: wrap; }
  .filters input { max-width: none; flex: 1 1 100%; }
  .filters select { max-width: none; flex: 1 1 auto; width: auto; }
  .mrow.mhead { display: none; }
  .mrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title status" "stage cost"; gap: 8px 12px; padding: 14px 16px; }
  .m-title { grid-area: title; }
  .m-status { grid-area: status; justify-self: end; }
  .m-stage { grid-area: stage; flex-direction: row; align-items: center; gap: 10px; }
  .m-stage .segbar { flex: 0 0 84px; }
  .m-cost { grid-area: cost; align-self: center; }
  .m-upd { display: none; }
  .stepper { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .step-a { align-items: center; padding: 9px 12px 11px; }
  .step-body { flex-direction: row; justify-content: space-between; align-items: baseline; flex: 1; gap: 8px; }
  .mside { display: flex; }
  .actionbar .btn, .actionbar form { flex: 1 1 auto; }
  .actionbar form .btn { width: 100%; }
  .runline { margin-left: 0; width: 100%; }
  .out-panel { padding: 16px; }
  .out-head { flex-direction: column; }
  .confirm-box { position: static; width: auto; margin-top: 8px; box-shadow: none; }
  .fsec { padding: 18px 16px 4px; }
  .paper { padding: 20px 16px; max-height: none; }
  .doc { font-size: 14.5px; }
  .claim.dep { margin-left: 10px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; }
  .rtable td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  .rtable td::before { content: attr(data-label); flex: 0 0 72px; color: var(--muted); font-size: 12px; font-family: var(--sans); text-transform: none; letter-spacing: 0; }
  .rtable td.r-doc { display: block; }
  .rtable td.r-doc::before { display: block; margin-bottom: 2px; }
  .pdf-frame, .pdf-frame iframe, .pdf-tall, .pdf-tall iframe { min-height: 420px; }
  .auth-card { padding: 24px 20px; }
  .is-auth .main { padding-top: 6vh; }
  .setup-list div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .code-area { font-size: 12px; }
  .toast { left: 16px; right: 16px; transform: none; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Wave 1: review gate, confidentiality, portfolio, corpus */
.review-panel { border-color: var(--med-line); }
.reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.review { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--surface-2); }
.review.rv-approved { background: var(--ok-tint); border-color: var(--ok-line); }
.review-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-kind { font-weight: 600; }
.rv-chip { margin-left: auto; }
.rv-approved .rv-chip { background: var(--ok-tint); color: var(--ok); border-color: var(--ok-line); }
.review-banner { margin: 8px 0; padding: 6px 10px; border-radius: var(--r-s); background: var(--med-tint);
  border: 1px solid var(--med-line); color: var(--med); font-weight: 600; font-size: 13px; }
.review-by { margin: 6px 0 0; color: var(--ok); }
.review-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.review-form input[type=text] { flex: 1 1 180px; min-width: 0; }
.review-inline { margin: 6px 0 10px; }
.conf-sec summary { cursor: pointer; }
.narrow-form { max-width: 920px; }
.olog td { vertical-align: top; }
.olog tr.is-blocked td { background: var(--med-tint); }
.olog .pre { max-height: 360px; overflow: auto; white-space: pre-wrap; }
.families { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 14px; }
.fam-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fam-rank { margin: 0; color: var(--muted); font-size: 12px; }
.fam-urgent, .fam-expired { background: var(--high-tint); color: var(--high); border-color: var(--high-line); }
.fam-soon { background: var(--med-tint); color: var(--med); border-color: var(--med-line); }
.fam-facts dd { overflow-wrap: anywhere; }
.kit { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px; }
.kit-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.kit-form details { flex: 1 1 260px; }
.pf-row { grid-template-columns: minmax(0, 3fr) 1fr 1.4fr 1fr; }

/* ---------------------------------------------------------------- Wave 3: shell, rail, theme */
.page-title, .matter-title { letter-spacing: -0.018em; font-weight: 650; }
.out-title, .fsec-title, .panel-h, .empty-title { letter-spacing: -0.01em; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.demo-strip { background: var(--med-tint); color: var(--med-ink); border-bottom: 1px solid var(--med-line); }
.skip { position: absolute; left: 8px; top: -64px; z-index: 50; background: var(--raised); color: var(--ink); padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); }
.skip:focus { top: 8px; }

/* dense, calm tables */
.dtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dtable th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.dtable td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable td.num, .dtable th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dtable a.cell { display: block; color: inherit; }
.dtable a.cell:hover { color: var(--accent); }
.dtable .zero { color: var(--line-3); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.section { margin: 0 0 28px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.section-t { font-size: 15px; font-weight: 650; letter-spacing: -0.005em; }
.section-n { font: 500 12px var(--mono); color: var(--muted); }

/* ---------------------------------------------------------------- dashboard (docket) */
.docket { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.docket-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tally { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin: 0 0 24px; }
.tally > div { flex: 1 1 120px; padding: 12px 16px; border-left: 1px solid var(--line); }
.tally > div:first-child { border-left: 0; }
.tally dt { font-size: 12px; color: var(--muted); }
.tally dd { margin: 2px 0 0; font: 500 22px/1.2 var(--mono); color: var(--ink); }
.tally .is-attn dd { color: var(--high); }
.dl { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.dl > li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 10px 14px; border-top: 1px solid var(--line); }
.dl > li:first-child { border-top: 0; }
.dl-date { font: 500 12.5px var(--mono); color: var(--ink); }
.dl-what { min-width: 0; }
.dl-what a { font-weight: 500; }
.dl-what .small { display: block; overflow-wrap: anywhere; }
.dl-days { font: 500 12px var(--mono); white-space: nowrap; color: var(--muted); }
.u-now .dl-days, .u-past .dl-days { color: var(--high); }
.u-now .dl-date, .u-past .dl-date { color: var(--high); }
.u-soon .dl-days { color: var(--med); }
.u-now { box-shadow: inset 2px 0 0 var(--high); }
.u-soon { box-shadow: inset 2px 0 0 var(--med-bar); }
.sev { font: 500 13px var(--sans); color: var(--muted); margin-left: 6px; }
.watch-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-top: 10px; }
.watch-form .field { margin: 0; flex: 1 1 160px; }
.watch-form select { width: auto; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.mini-list li:first-child { border-top: 0; }
.mini-list .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- the Judge gauge (signature) */
.gauge { position: relative; height: 26px; margin: 6px 0 4px; }
.gauge-track { position: absolute; left: 0; right: 0; top: 11px; height: 4px; background: var(--sunk); border-radius: 2px; }
.gauge-ticks { position: absolute; left: 0; right: 0; top: 7px; height: 12px;
  background-image: linear-gradient(to right, var(--line-2) 1px, transparent 1px); background-size: 10% 100%; }
.gauge-band { position: absolute; top: 8px; height: 10px; background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 2px;
  transition: left var(--t-slow), width var(--t-slow); }
.gauge-tick { position: absolute; top: 2px; width: 2px; height: 22px; background: var(--accent); margin-left: -1px; transition: left var(--t-slow); }
.gauge.is-uncal .gauge-band { background: repeating-linear-gradient(135deg, var(--med-tint) 0 4px, transparent 4px 8px); border-color: var(--med-line); }
.gauge.is-uncal .gauge-tick { background: var(--med-bar); }
.gauge-scale { display: flex; justify-content: space-between; font: 10.5px var(--mono); color: var(--muted); }
.jcard { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 16px 18px; margin: 0 0 14px; }
.jcard-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.jcard-subj { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.jcard-score { font: 500 30px/1 var(--mono); letter-spacing: -0.02em; color: var(--ink); }
.jcard-score small { font: 500 12px var(--sans); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.jcard-meta { color: var(--muted); font-size: 12.5px; margin: 2px 0 8px; }
.jcard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; margin-top: 12px; }
.ground { display: grid; grid-template-columns: 74px minmax(0, 1fr) 42px; gap: 10px; align-items: center; padding: 4px 0; font-size: 12.5px; }
.ground-bar { height: 5px; background: var(--sunk); border-radius: 3px; overflow: hidden; }
.ground-bar i { display: block; height: 100%; background: var(--accent); }
.ground.is-uncal .ground-bar i { background: var(--med-bar); }
.ground-v { text-align: right; font-family: var(--mono); }
.spots { list-style: none; margin: 0; padding: 0; }
.spots li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.spots li:first-child { border-top: 0; padding-top: 0; }
.spots .fix { display: block; color: var(--ink-2); margin-top: 2px; }
.jcard-basis { color: var(--muted); font-size: 12px; margin: 12px 0 0; border-top: 1px solid var(--line); padding-top: 8px; }
.judge-mini { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 4px 10px; align-items: center; }
.judge-mini .gauge { height: 18px; margin: 0; grid-column: 1 / -1; }
.judge-mini .gauge-track { top: 7px; } .judge-mini .gauge-ticks { top: 3px; } .judge-mini .gauge-band { top: 4px; } .judge-mini .gauge-tick { top: 0; height: 18px; }

/* ---------------------------------------------------------------- new matter: mode picker */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin: 0 0 22px; overflow: hidden; }
.mode-opt { display: block; padding: 12px 14px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); color: var(--ink); margin: -1px 0 0 -1px; }
.mode-opt:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.mode-opt.is-on { background: var(--accent-tint); box-shadow: inset 0 -2px 0 var(--accent); }
.mode-opt strong { display: block; font-size: 13.5px; font-weight: 600; }
.mode-opt span { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; border: 0; padding: 0; margin: 0 0 16px; }
.checks legend { font-weight: 500; font-size: 13px; margin-bottom: 6px; padding: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.omit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
.omit-grid .label { font-weight: 400; color: var(--ink-2); }
input[type=date], input[type=number], input[type=email], input[type=url] {
  width: 100%; height: 36px; font: 14px/1.5 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--r); padding: 0 11px; }
input[type=date]:focus, input[type=number]:focus { outline: 2px solid transparent; outline-offset: 1px; border-color: var(--accent); box-shadow: none; }
input, select, textarea { background-color: var(--surface); color: var(--ink); }

/* ---------------------------------------------------------------- office action */
.oa-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 18px; }
.oa-head > div { padding: 10px 14px; border-left: 1px solid var(--line); min-width: 0; }
.oa-head > div:first-child { border-left: 0; }
.oa-head dt { font-size: 11.5px; color: var(--muted); }
.oa-head dd { margin: 2px 0 0; font: 500 14px var(--mono); overflow-wrap: anywhere; }
.rej { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r); }
.rej > li { padding: 12px 14px; border-top: 1px solid var(--line); }
.rej > li:first-child { border-top: 0; }
.rej-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rej-ground { font-weight: 600; }
.rej-claims { font: 500 12.5px var(--mono); color: var(--ink-2); }
.rej p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }
.opt-list { list-style: none; margin: 8px 0 0; padding: 0; }
.opt-list li { padding: 6px 0 6px 12px; border-left: 2px solid var(--line); font-size: 13px; margin-top: 4px; }
.opt-list li.is-rec { border-left-color: var(--accent); }
.opt-list b { font-weight: 600; }
.listing { font: 12.5px/1.65 var(--mono); }
.listing .lc { padding: 8px 0; border-top: 1px solid var(--line); }
.listing .lc:first-child { border-top: 0; }
.listing .lc-n { font-weight: 600; margin-right: 8px; }
.listing .lc-s { font: 500 13px var(--sans); color: var(--muted); }
.seg-add { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; color: var(--ok-ink); background: var(--ok-tint); }
.seg-del { text-decoration: line-through; color: var(--high); background: var(--high-tint); }

/* ---------------------------------------------------------------- design */
.parts-table select { width: auto; min-width: 150px; height: 32px; }
.views-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.views-strip figure { margin: 0; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper); padding: 8px; }
.views-strip img { display: block; width: 100%; height: auto; }
.views-strip figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.ref-look { width: 72px; height: 72px; object-fit: contain; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s); }

.tbl-pad { padding: 4px 18px 8px; overflow-x: auto; }
.raw-link { display: inline-block; margin-top: 18px; font-size: 12px; color: var(--muted); }
.quiet-note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

@media (max-width: 1180px) {
  .docket { grid-template-columns: minmax(0, 1fr); }
}
/* ---------------------------------------------------------------- CSP: no style attributes anywhere.
   Utilities that replace the old inline styles, and whole-percent widths and offsets for bars and the gauge
   (the templates pick a class through the pct filter). */
.d-block { display: block; }
.row-between { justify-content: space-between; }
.dtable th.row-h { font-weight: 500; text-align: left; padding: 9px 12px; color: var(--ink); font-size: inherit; white-space: normal; }
.box-h.box-h-gap { margin-top: 14px; }
.mini-list li.d-block { display: block; }
.watch-line { margin: 4px 0 0; }
.watch-err { margin: 4px 0 0; color: var(--high); }
.watch-form .field.field-fixed { flex: 0 0 auto; }
.ics-link { white-space: nowrap; }
.empty-hint { margin: 6px 0 0; }
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }
.x-0 { left: 0%; }
.x-1 { left: 1%; }
.x-2 { left: 2%; }
.x-3 { left: 3%; }
.x-4 { left: 4%; }
.x-5 { left: 5%; }
.x-6 { left: 6%; }
.x-7 { left: 7%; }
.x-8 { left: 8%; }
.x-9 { left: 9%; }
.x-10 { left: 10%; }
.x-11 { left: 11%; }
.x-12 { left: 12%; }
.x-13 { left: 13%; }
.x-14 { left: 14%; }
.x-15 { left: 15%; }
.x-16 { left: 16%; }
.x-17 { left: 17%; }
.x-18 { left: 18%; }
.x-19 { left: 19%; }
.x-20 { left: 20%; }
.x-21 { left: 21%; }
.x-22 { left: 22%; }
.x-23 { left: 23%; }
.x-24 { left: 24%; }
.x-25 { left: 25%; }
.x-26 { left: 26%; }
.x-27 { left: 27%; }
.x-28 { left: 28%; }
.x-29 { left: 29%; }
.x-30 { left: 30%; }
.x-31 { left: 31%; }
.x-32 { left: 32%; }
.x-33 { left: 33%; }
.x-34 { left: 34%; }
.x-35 { left: 35%; }
.x-36 { left: 36%; }
.x-37 { left: 37%; }
.x-38 { left: 38%; }
.x-39 { left: 39%; }
.x-40 { left: 40%; }
.x-41 { left: 41%; }
.x-42 { left: 42%; }
.x-43 { left: 43%; }
.x-44 { left: 44%; }
.x-45 { left: 45%; }
.x-46 { left: 46%; }
.x-47 { left: 47%; }
.x-48 { left: 48%; }
.x-49 { left: 49%; }
.x-50 { left: 50%; }
.x-51 { left: 51%; }
.x-52 { left: 52%; }
.x-53 { left: 53%; }
.x-54 { left: 54%; }
.x-55 { left: 55%; }
.x-56 { left: 56%; }
.x-57 { left: 57%; }
.x-58 { left: 58%; }
.x-59 { left: 59%; }
.x-60 { left: 60%; }
.x-61 { left: 61%; }
.x-62 { left: 62%; }
.x-63 { left: 63%; }
.x-64 { left: 64%; }
.x-65 { left: 65%; }
.x-66 { left: 66%; }
.x-67 { left: 67%; }
.x-68 { left: 68%; }
.x-69 { left: 69%; }
.x-70 { left: 70%; }
.x-71 { left: 71%; }
.x-72 { left: 72%; }
.x-73 { left: 73%; }
.x-74 { left: 74%; }
.x-75 { left: 75%; }
.x-76 { left: 76%; }
.x-77 { left: 77%; }
.x-78 { left: 78%; }
.x-79 { left: 79%; }
.x-80 { left: 80%; }
.x-81 { left: 81%; }
.x-82 { left: 82%; }
.x-83 { left: 83%; }
.x-84 { left: 84%; }
.x-85 { left: 85%; }
.x-86 { left: 86%; }
.x-87 { left: 87%; }
.x-88 { left: 88%; }
.x-89 { left: 89%; }
.x-90 { left: 90%; }
.x-91 { left: 91%; }
.x-92 { left: 92%; }
.x-93 { left: 93%; }
.x-94 { left: 94%; }
.x-95 { left: 95%; }
.x-96 { left: 96%; }
.x-97 { left: 97%; }
.x-98 { left: 98%; }
.x-99 { left: 99%; }
.x-100 { left: 100%; }

@media (max-width: 960px) {
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oa-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oa-head > div:nth-child(3) { border-left: 0; }
  .oa-head > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .jcard-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .modes { grid-template-columns: minmax(0, 1fr); }
  .tally > div { flex: 1 1 45%; border-left: 0; border-top: 1px solid var(--line); }
  .tally > div:nth-child(-n+2) { border-top: 0; }
  .dl > li { grid-template-columns: minmax(0, 1fr) auto; }
  .dl-date { grid-column: 1; }
  .dl-days { grid-column: 2; grid-row: 1; }
  .dl-what { grid-column: 1 / -1; }
  .dtable.stack-sm thead { display: none; }
  .dtable.stack-sm, .dtable.stack-sm tbody, .dtable.stack-sm tr, .dtable.stack-sm td { display: block; width: 100%; }
  .dtable.stack-sm tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .dtable.stack-sm td { border: 0; padding: 2px 0; }
  .dtable.stack-sm td.num { text-align: left; }
  .dtable.stack-sm td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-family: var(--sans); font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .gauge-band, .gauge-tick { transition: none; }
}

/* accessibility (wave 10): a focus ring on everything that takes focus, kept in Windows high contrast (where box
   shadows are dropped and a transparent outline is drawn in the system colour), text kept for screen readers */
:where(a, button, summary, select, textarea, input, iframe, [tabindex]):focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.step-a:focus-visible, .mode-opt:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; outline-offset: 2px; }
  .chip, .lvl, .tag { border: 1px solid CanvasText; }
}
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fieldset-plain { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.fieldset-plain > legend { padding: 0; margin-bottom: 4px; }

/* ================================================================ Night Desk v2 layer (.design/DESIGN.md)
   Below the wave rules so it wins on equal specificity. Tokens only. */

/* ---- type */
body { font: 500 15px/1.55 var(--sans); background: var(--bg); color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-weight: 400; letter-spacing: -0.01em; }
.small { font-size: 13px; }
.tiny, .quiet-note { font-size: 13px; }
.muted { color: var(--muted); }
::selection { background: var(--select); color: var(--ink); }
.page-title, .matter-title { font: 500 24px/1.2 var(--display); letter-spacing: -0.012em; }
.out-title, .panel-h, .fsec-title, .empty-title { font: 500 18px/1.25 var(--display); letter-spacing: -0.006em; }
.page-sub, .lede { color: var(--ink-2); }
/* no eyebrow labels: small section heads read as plain words */
.eyebrow, .panel-title, .sub-h, .box-h, .side-title, .card-sh, .verdict-l, .mrow.mhead, .rtable th, .gauge-scale, .lvl, .sev, .listing .lc-s {
  text-transform: none; letter-spacing: 0; }
.box-h, .sub-h, .side-title, .panel-title { font: 500 13px/1.4 var(--display); color: var(--ink-2); }
.side-title { font-size: 15px; color: var(--ink); }
.rtable th, .dtable th { font: 500 13px var(--sans); color: var(--muted); }
.basis { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--r-s); background: var(--raised); color: var(--ink-2); font: 400 12px var(--mono); }
a { color: var(--accent-ink); }
a:hover { color: var(--ink); }

/* ---- shell: the glass top bar (tier 1) */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 20px; min-height: var(--bar-h);
  padding: env(safe-area-inset-top) 16px 0; background: var(--glass-bar); box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); border-bottom: 0; }
.brand { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink); }
.brand-name { font: 600 18px/1 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.topnav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.topnav-a { display: inline-flex; align-items: center; height: 36px; padding: 0 10px; border-radius: var(--r-seg);
  color: var(--ink-2); font-size: 14px; white-space: nowrap; transition: color var(--t-fast), background var(--t-fast); }
.topnav-a:hover { color: var(--ink); background: var(--raised); text-decoration: none; }
.topnav-a.is-active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--select-bar); border-radius: var(--r-seg) var(--r-seg) 0 0; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bar-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-seg);
  background: none; color: var(--ink-2); font: 500 14px var(--sans); cursor: pointer; }
.bar-btn:hover { background: var(--raised); color: var(--ink); }
.bar-btn svg { flex: 0 0 auto; }
@media (min-width: 1180px) {
  .topbar { top: 12px; margin: 12px 12px 0; border-radius: var(--r-seg-lg); padding-top: 0; }
}
.demo-strip { background: none; color: var(--ink-2); border: 0; border-bottom: 1px solid var(--line); font-size: 13px;
  text-align: left; padding: 8px 20px; }
@media (min-width: 1180px) { .demo-strip { margin: 8px 12px 0; padding: 6px 16px; } }
.main.desk { max-width: 1440px; margin: 0 auto; padding: 24px 28px 96px; }
.wrap.main { max-width: 1240px; }
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 0 12px; padding-bottom: 4px; }
  .topnav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .main.desk { padding: 16px 16px 120px; }
}
@media (max-width: 640px) {
  .bar-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bar-btn { width: 44px; justify-content: center; padding: 0; }
}

/* glass falls back to the solid surface where it cannot be drawn or must not be */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .toast, .glass-panel, .facts-panel { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .toast, .glass-panel, .facts-panel { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .topbar, .toast, .glass-panel, .facts-panel { background: Canvas; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---- buttons: quiet by default; cobalt only on the one lit control (data-lamp) */
.btn { height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent;
  color: var(--ink); font: 500 14px/1 var(--sans); box-shadow: none; transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.btn:hover { background: var(--raised); border-color: var(--line-3); color: var(--ink); }
.btn-primary { background: var(--raised); border-color: var(--raised); color: var(--ink); }
.btn-primary:hover { background: var(--raised); border-color: var(--line-3); color: var(--ink); }
.btn[data-lamp], .btn-primary[data-lamp] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn[data-lamp]:hover { background: color-mix(in oklab, var(--accent) 86%, var(--ink)); border-color: transparent; color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-warn { background: transparent; border-color: var(--high); color: var(--high); }
.btn-warn:hover { background: var(--raised); border-color: var(--high); color: var(--high); }
.btn.btn-quiet:hover { color: var(--high); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--r); }
:where(a, button, summary, select, textarea, input, iframe, [tabindex]):focus-visible, .btn:focus-visible, .step-a:focus-visible {
  outline: 2px solid var(--accent-ring); outline-offset: 2px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=number], input[type=email], input[type=url], select, textarea {
  background-color: var(--surface); border-color: var(--field-line); border-radius: var(--r); font-family: var(--sans); }
input:focus, textarea:focus, select:focus { border-color: var(--accent-ring); box-shadow: none; }

/* ---- state marks */
.chip { height: auto; padding: 0; border: 0; border-radius: 0; background: none; gap: 6px; font: 500 13px/1.3 var(--sans); }
.chip::before { content: ""; flex: 0 0 auto; width: 10px; height: 10px; box-sizing: border-box; border-radius: var(--r-mark); border: 1.5px solid currentColor; }
.chip.st-failed::before, .chip.st-needs_input::before, .chip.st-stale::before { background: currentColor; }
.chip.st-done::before, .chip.st-complete::before { width: 5px; height: 9px; border-width: 0 1.5px 1.5px 0; border-radius: 0; transform: translateY(-1px) rotate(45deg); margin: 0 2px 0 3px; }
.chip.st-running::before { display: none; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.chip.st-queued .dot { display: none; }
.rv-approved .rv-chip, .badge-ok { color: var(--ok); background: none; }
.smark { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.3 var(--sans); white-space: nowrap; color: var(--muted); }
.smark-i { flex: 0 0 auto; display: inline-block; width: 10px; height: 10px; box-sizing: border-box; border-radius: var(--r-mark); border: 1.5px solid currentColor; }
.sm-high { color: var(--high); } .sm-high .smark-i, .sm-med .smark-i { background: currentColor; }
.sm-med { color: var(--med); }
.sm-warn { color: var(--ink-2); }
.sm-run { color: var(--ink); } .sm-run .smark-i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; border: 0; margin: 0 1px; }
.sm-wait, .sm-quiet { color: var(--muted); }
.sm-ok { color: var(--ok); } .sm-ok .smark-i { width: 5px; height: 9px; border-width: 0 1.5px 1.5px 0; border-radius: 0; transform: translateY(-1px) rotate(45deg); margin: 0 2px 0 3px; }
.lvl { background: none; border-color: var(--line-2); font: 500 12px/1 var(--sans); }
.lv-high { color: var(--high); } .lv-med { color: var(--med); } .lv-low { color: var(--ink-2); }
.tag, .badge-dim { background: var(--raised); color: var(--ink-2); }

/* alerts: a mark and a sentence, no colour wash */
.alert { background: var(--surface); border-color: var(--line-2); color: var(--ink); display: block; }
.alert-err::before, .alert-warn::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: var(--r-mark);
  margin-right: 8px; vertical-align: 0; }
.alert-err::before { background: var(--high); }
.alert-warn::before { background: var(--med); }
.alert-info { color: var(--ink); }
.review-banner { background: none; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  border-radius: 0; color: var(--ink); font-weight: 500; padding: 6px 0; }
.box-note { background: var(--surface-2); border-color: var(--line-2); }

/* ---- panels and the work surface (solid, never glass) */
.panel { background: var(--surface); border-color: var(--line); border-radius: var(--r-seg-lg); }
.out-panel { padding: var(--pad-work) 24px 24px; }
.out-head { border-bottom-color: var(--line); }
.box { background: var(--surface-2); border-color: var(--line); border-radius: var(--r); }
.log, .pre, .diff { background: var(--sunk); border-color: var(--line); color: var(--ink-2); font-family: var(--mono); font-size: 13px; }
.empty { background: var(--surface); border-color: var(--line-2); }

/* ---- glass, tier 2: one panel of question sections */
.glass-panel, .facts-panel { background: var(--glass-desk); box-shadow: var(--shadow-glass); border-radius: var(--r-card);
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); padding: 4px 20px 16px; }
.mside.facts-panel { display: block; gap: 0; }
.fq { border-top: 1px solid var(--line); }
.fq:first-child { border-top: 0; }
.fq-s { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 0; cursor: pointer; list-style: none; }
.fq-s::-webkit-details-marker { display: none; }
.fq-q { font: 500 15px/1.3 var(--display); color: var(--ink); }
.fq-a { flex: 0 1 auto; min-width: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 13px; color: var(--ink-2); }
.fq[open] > .fq-s .fq-a { color: var(--muted); }
.fq > :not(summary) { margin-bottom: 12px; }
.fq .log { max-height: 220px; min-height: 0; }
.fq .facts div { font-size: 13px; }
.facts dd { color: var(--ink); }

/* ---- the stage strip: proportional cells, done stages collapse, selection is an ivory underline */
.steps-sum { display: none; margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.stepper { display: flex; gap: 4px; margin: 0 0 12px; }
.stepper .step { flex: 1 1 0; min-width: 0; }
.stepper .step.is-cur, .stepper .step.is-sel { flex: 2.4 1 0; }
.stepper .step.st-done:not(.is-sel):not(.is-cur) { flex: 0 0 auto; }
.step-a { border-color: var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 12px 12px; gap: 8px; }
.step-a:hover { border-color: var(--line-2); }
.step.is-sel .step-a { border-color: var(--line-2); box-shadow: inset 0 -2px 0 var(--select-bar); }
.step-n { font: 400 12px var(--mono); color: var(--muted); }
.step-name { font: 500 13px/1.3 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.step-meta { white-space: normal; flex-wrap: wrap; font-size: 13px; gap: 2px 8px; }
.step-cost { font: 400 12px var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); }
.step.st-done:not(.is-sel):not(.is-cur) .step-body { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.step.st-done:not(.is-sel):not(.is-cur) .step-a::after { content: ""; width: 5px; height: 9px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: translateY(2px) rotate(45deg); margin-right: 2px; }
.step-bar { height: 2px; background: transparent; }
.step.st-done .step-bar { background: var(--line-2); }
.step.st-done .step-st { color: var(--muted); }
.step.st-failed .step-bar { background: var(--high); }
.step.st-needs_input .step-bar, .step.st-stale .step-bar { background: var(--med); }
.step.st-needs_input .step-st, .step.st-stale .step-st { color: var(--med); }
.step.st-running .step-bar { background: var(--ink); }
.step.st-running .step-a { background: var(--surface); border-color: var(--line-2); }
.step.st-queued .step-st, .step.st-running .step-st { color: var(--ink); }
.step.st-queued .step-bar { background: var(--line-2); }
.step.st-skipped .step-a { background: transparent; }

/* ---- the Next line: one sentence, one lit control */
.nextline.actionbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin: 0 0 20px; padding: 12px 12px 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.next-say { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font: 500 15px/1.4 var(--sans); color: var(--ink); }
.next-say .runline { margin: 0; font-size: 15px; color: var(--ink); }
.done-line { color: var(--ink); }
.next-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- matter grid */
.mhead-wrap { margin-bottom: 18px; }
.cost-total { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.mgrid { grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 20px; }
.working { padding: 8px 0; }
.panel-ask { background: var(--surface); border-color: var(--line-2); }
.q-n { font: 400 13px var(--mono); color: var(--muted); }
.q-why { color: var(--ink-2); }
.review-panel { border-color: var(--line-2); }
.review { background: var(--surface-2); border-color: var(--line); border-radius: var(--r); }
.review.rv-approved { background: var(--surface-2); border-color: var(--line); }
.review-by { color: var(--ink-2); }
.vers li.is-on a { background: var(--select); color: var(--ink); box-shadow: inset 2px 0 0 var(--select-bar); }

/* ---- paper: the reading sheet, solid ivory, Source Serif 4 at 16/1.7 */
.paper { background: var(--paper); color: var(--paper-ink); border: 0; border-radius: var(--r); padding: 44px 56px; }
.doc { font: 500 16px/1.7 var(--serif); color: var(--paper-ink); max-width: 70ch; }
.doc-title, .doc-head, .doc-sub { font-family: var(--serif); font-weight: 600; color: var(--paper-ink); }
.doc-break { border-top-color: var(--paper-line); }
.pnum { font: 400 13px var(--mono); color: var(--paper-muted); }
.claim { grid-template-columns: 34px 1fr; }
.cnum { font-variant-numeric: tabular-nums; }
.numerals .mono { color: var(--ink-2); }
.numerals div { border-bottom-color: var(--line); }

/* ---- the Judge card and the odds ring (accent 2) */
.jcard { background: var(--surface); border-color: var(--line); border-radius: var(--r-seg-lg); padding: 20px; }
.jcard-top { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 20px; align-items: center; }
.jcard-head { min-width: 0; }
.jcard-subj { font: 500 18px/1.25 var(--display); margin: 0 0 4px; overflow-wrap: anywhere; }
.jcard-meta { color: var(--ink-2); font-size: 13px; margin: 0 0 6px; }
.jcard-score { font: 500 13px/1.4 var(--sans); color: var(--ink-2); letter-spacing: 0; margin: 0 0 6px; }
.jcard-weak { font-size: 14px; color: var(--ink); margin: 0; }
.jcard-k { display: block; font-size: 13px; color: var(--muted); }
.jcard-basis { color: var(--muted); font-size: 13px; border-top-color: var(--line); }
.oring { position: relative; width: 168px; aspect-ratio: 1; }
.oring-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.oring-track { stroke: var(--line-3); stroke-width: 1; }
.oring-band { stroke: var(--ink-2); stroke-width: 10; }
.oring-tick { stroke: var(--ink); stroke-width: 2; stroke-linecap: butt; }
.oring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.oring-num { font: 500 36px/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--ink); }
.oring-pc { font-size: 0.4em; letter-spacing: 0; margin-left: 2px; }
.oring-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.oring-uncal { font-size: 13px; color: var(--ink-2); }
.odds-delta { position: absolute; top: 22%; font: 500 13px var(--sans); color: var(--ink); opacity: 0; }
.odds-steps { margin-top: 12px; }
.odds-steps-l { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.odds-range { width: 100%; accent-color: var(--ink); min-height: 32px; }
.odds-step-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.odds-step-list li { cursor: pointer; }
.odds-step-list li.is-on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--select-bar); }
.odds-safer { color: var(--ink-2); }
.ground-bar, .score-bar { background: var(--raised); }
.ground-bar i { background: var(--ink-2); }
.ground.is-uncal .ground-bar i { background: repeating-linear-gradient(135deg, var(--ink-2) 0 3px, transparent 3px 6px); }
.ground-v { font-family: var(--sans); font-variant-numeric: tabular-nums; }
/* a ground's name reads on its own line, so long grounds never wrap a word at a time */
.jcard .ground { grid-template-columns: minmax(0, 1fr) 42px; row-gap: 4px; padding: 6px 0; }
.jcard .ground > :first-child { grid-column: 1 / -1; color: var(--ink-2); }
.gauge-track { background: var(--raised); }
.gauge-band { background: color-mix(in oklab, var(--ink-2) 35%, transparent); border-color: var(--line-2); }
.gauge.is-uncal .gauge-band { background: repeating-linear-gradient(135deg, var(--line-2) 0 3px, transparent 3px 6px); border-color: var(--line-2); }
.gauge-tick, .gauge.is-uncal .gauge-tick { background: var(--ink); }
.gauge-scale { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 12px; }
.sb-ok { background: var(--ink-2); } .sb-med { background: var(--med); } .sb-low { background: var(--high); }
.verdict { background: var(--surface); border-color: var(--line); }
.verdict-v { font: 500 24px var(--display); }
.v-ok, .v-med, .v-high, .v-low { background: var(--surface); border-color: var(--line); }
.v-ok { color: var(--ok); } .v-med { color: var(--med); } .v-high { color: var(--high); } .v-low { color: var(--ink-2); }
.findings { border-color: var(--line); border-radius: var(--r); }
.stat-row { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { flex: 1 1 120px; border: 0; border-radius: 0; background: none; padding: 12px 16px 12px 0; }
.stat-n { font: 500 24px/1.2 var(--display); font-variant-numeric: tabular-nums; }

/* ---- the evidence map (accent 1) */
.emap { margin: 0 0 20px; padding: 18px 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-seg-lg); }
.emap-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.emap-t { font: 500 18px/1.25 var(--display); }
.emap-sum { margin: 0; font-size: 13px; color: var(--muted); }
.emap-stage { display: none; position: relative; grid-template-columns: minmax(0, 1.5fr) minmax(72px, 0.5fr) minmax(0, 1fr); margin: 16px 0 6px; }
.emap-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.emap-col { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; position: relative; z-index: 1; }
.emap-els { grid-column: 1; }
.emap-refs { grid-column: 3; }
.emap-node { width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-height: var(--row); padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--ink); text-align: left;
  font: 500 14px/1.35 var(--sans); cursor: pointer; transition: opacity var(--t), border-color var(--t-fast); }
.emap-node:hover { border-color: var(--line-3); }
.emap-key { font: 400 13px var(--mono); color: var(--muted); }
.emap-txt { flex: 1 1 0; min-width: 0; }
.emap-flag { flex: 0 0 auto; font-size: 13px; color: var(--ink-2); }
.emap-flag.f-unknown { color: var(--muted); }
.emap-rl { font: 400 13px var(--mono); }
.emap-rs { display: block; width: 100%; font-size: 13px; color: var(--muted); }
.emap .beam { stroke: var(--ink); stroke-width: 1.25; stroke-linecap: round; opacity: 0.85; transition: opacity var(--t); }
.emap .beam.k-part { stroke: var(--ink-2); stroke-dasharray: 4 5; }
.emap .stub { stroke: var(--ink-2); stroke-width: 1.25; stroke-linecap: square; transition: opacity var(--t); }
.emap .stub.k-unknown { stroke: var(--muted); }
.emap .beam-light { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.emap.is-focus .emap-node:not(.is-on) { opacity: 0.35; }
.emap.is-focus path:not(.is-on):not(.beam-light) { opacity: 0.2; }
.emap-node.is-on { border-color: var(--line-3); }
.emap-node.is-pin { box-shadow: inset 0 -2px 0 var(--select-bar); }
.emap-cite { margin: 8px 0 0; min-height: 2.9em; font-size: 13px; color: var(--ink-2); }
.emap-gridwrap { position: relative; max-width: 100%; overflow-x: auto; }
.emap-grid { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.emap-grid th, .emap-grid td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.emap-grid thead th { color: var(--muted); font-weight: 500; }
.emap-grid td { text-align: center; }
.emap-grid .smark-i { color: var(--ink); }
.emap-grid .g-full .smark-i { background: currentColor; }
.emap-gtxt { color: var(--ink-2); }
@media (min-width: 640px) {
  .emap.is-live .emap-stage { display: grid; }
  .emap.is-live .emap-gridwrap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .emap.is-live { position: relative; }
}
@media (max-width: 639px) { .emap .emap-cite { display: none; } }

/* ---- the Docket: counts on a hairline row, the queue, one glass side panel */
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; margin: 0 0 24px; padding: 14px 0 16px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.counts > div { min-width: 0; }
.counts dt { font-size: 13px; color: var(--ink-2); }
.counts dd { margin: 0; }
.counts dd.tnum { font: 500 36px/1.15 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.pastdue { margin: 0 0 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pastdue-h { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.section-t { font: 500 18px/1.25 var(--display); }
.section-n { font: 500 13px var(--sans); color: var(--muted); }
.queue { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.qrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto auto; gap: 4px 16px; align-items: center;
  min-height: var(--row); padding: 8px 0; border-bottom: 1px solid var(--line); }
.q-what { min-width: 0; }
.q-link { display: block; color: var(--ink); font-size: 15px; }
.q-link:hover { color: var(--ink); }
.q-where { display: block; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.q-fact { font-size: 13px; color: var(--ink-2); text-align: right; white-space: nowrap; }
.dl { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.dl > li { border-top: 0; border-bottom: 1px solid var(--line); padding: 10px 0; }
.dl-date, .dl-days { font: 500 13px var(--sans); font-variant-numeric: tabular-nums; }
.u-now, .u-soon { box-shadow: none; }
.u-now .dl-days, .u-past .dl-days { color: var(--med); }
.u-now .dl-date, .u-past .dl-date, .u-soon .dl-days { color: var(--ink); }
.docket { grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 28px; }
.docket-side.glass-panel { display: block; }
.dside-sec { padding: 16px 0; border-top: 1px solid var(--line); }
.dside-sec:first-child { border-top: 0; }
.ddate-n { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
.ddate-days { font: 500 48px/1 var(--display); letter-spacing: -0.03em; }
.ddate-u { font-size: 15px; color: var(--ink-2); margin-right: 8px; }
.ddate-what { margin: 0 0 2px; }
.dside-foot { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.mini-list li { border-top-color: var(--line); }
.dtable td { border-bottom-color: var(--line); }
.dtable td.num, .dtable th.num { font-family: var(--sans); }
.dtable .zero { color: var(--muted); }

/* ---- toasts: tier 1 glass at the bottom left */
.toast { left: 16px; bottom: 16px; transform: none; background: var(--toast-bg); color: var(--toast-ink); box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); border-radius: var(--r); }
.toast-host { position: fixed; left: 16px; bottom: 16px; z-index: 40; }
.confirm-box { background: var(--raised); border-color: var(--line-2); box-shadow: none; }

/* ---- responsive */
@media (max-width: 1180px) {
  .mgrid { grid-template-columns: minmax(0, 1fr); }
  .docket { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .jcard-top { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .jcard-head { text-align: left; width: 100%; }
}
@media (max-width: 640px) {
  .steps-sum { display: block; }
  .stepper { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper .step.st-done:not(.is-sel):not(.is-cur), .stepper .step:not(.is-cur):not(.is-next):not(.is-sel) { display: none; }
  .stepper .step.is-cur:only-child, .stepper .step.is-sel.is-cur { grid-column: 1 / -1; }
  .step-a { padding: 10px 12px 12px; }
  .step-body { flex-direction: column; align-items: flex-start; }
  .qrow { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 0; }
  .qrow .smark { grid-column: 1; grid-row: 1; }
  .q-fact { grid-column: 2; grid-row: 1; }
  .q-what { grid-column: 1 / -1; }
  .q-act { grid-column: 1 / -1; width: 100%; }
  .paper { padding: 20px 16px; border-radius: 0; margin: 0 -16px; }
  .out-panel { padding: 16px; }
  .glass-panel, .facts-panel { padding: 4px 16px 12px; }
  .nextline.actionbar { padding: 12px; }
  .next-acts, .next-acts form, .next-acts .btn { width: 100%; }
  .oring { width: 152px; }
  .ddate-days { font-size: 40px; }
}
/* a coarse pointer gets 44px targets everywhere */
@media (pointer: coarse) {
  .btn, .btn-sm, .bar-btn, .topnav-a, .step-a, .q-act, .emap-node, .linklike, .subtab, .seg, .vers a,
  input[type=text], input[type=password], input[type=search], input[type=date], input[type=number], input[type=email], input[type=url], select, .fq-s, .details summary {
    min-height: var(--hit); }
  .btn-sm { padding: 0 14px; }
  .topnav-a { height: var(--hit); }
  .bar-btn { height: var(--hit); min-width: var(--hit); }
  .details summary { display: flex; align-items: center; }
  .side-links a, .crumbs a, .q-link, .dl-what a, .raw-link, .ics-link, .section-h a, .mini-list a { display: inline-flex; align-items: center; min-height: var(--hit); }
  .brand, .skip { min-height: var(--hit); }
}
@media (prefers-reduced-motion: reduce) {
  .emap .beam, .emap .stub, .emap-node, .btn, .topnav-a { transition: none; }
}
/* the work surface holds rows and hairlines, never a card inside a card */
.review-panel { padding: 20px; }
.review-panel .review { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 14px 0 4px; }
.out-panel .jcard { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 20px 0 0; }
.audit-top { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; }
.audit-top .verdict { border: 0; padding: 0; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 12px; }
.audit-top .scores { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 12px 0 0; }
@media (max-width: 640px) {
  .review-panel { padding: 16px; }
}
.emap-flag { margin-left: auto; }
.out-panel .emap { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 18px 0 4px; }
.dtable th.row-h { border-bottom-color: var(--line); }
.dtable tr:last-child th { border-bottom: 0; }
.fq-a { white-space: normal; overflow: visible; text-overflow: clip; max-width: 60%; }
/* cobalt is the lamp, focus and link text only */
.linklike { color: var(--accent-ink); }
.segbar i.on { background: var(--ink-2); }
.toggle input:checked + .toggle-ui { background: var(--line-3); }
.opt-list li.is-rec { border-left-color: var(--ink); }
.dtable a.cell:hover { color: var(--ink); }
.card-sh { color: var(--ink-2); }
.out-panel .emap:first-child { border-top: 0; padding-top: 4px; }
.emap-grid th[scope=row] { width: 60%; font-weight: 500; }
.emap-gtxt { font-size: 13px; }
.emap-grid abbr { text-decoration: none; }
.out-panel .box { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px 0 4px; margin: 0; }
@media (max-width: 640px) {
  .out-panel .rtable tr { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 10px 0; margin: 0; }
}
@media (pointer: coarse) {
  .rtable td a { display: inline-flex; align-items: center; min-height: var(--hit); }
}
.emap-rl { font: 500 14px/1.35 var(--sans); }
.emap-rl.mono { font: 400 13px/1.35 var(--mono); }
/* ---- phone pass (390): no fixed side columns, nothing cut, 44px targets */
/* a panel that holds plain content gets an inner gutter (zero specificity: any panel kind with its own padding wins) */
:where(.panel) { padding: 18px 20px; }
:where(.panel.tbl-wrap) { padding: 4px 16px; }
/* a block button carries long names ("Download all (...zip)") on two lines instead of past both edges */
.btn-block { white-space: normal; height: auto; padding-top: 8px; padding-bottom: 8px; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.pf-row > :last-child { white-space: nowrap; }
/* done stages stay compact but keep their names ("01 Disclose" and a check), not a bare "01" cell */
.stepper .step.st-done:not(.is-sel):not(.is-cur) { flex: 0 1 auto; }
.step.st-done:not(.is-sel):not(.is-cur) .step-body { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
.step.st-done:not(.is-sel):not(.is-cur) .step-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* a facts answer that does not fit beside its question drops under it, right aligned, instead of squeezing both */
.fq-s { flex-wrap: wrap; row-gap: 2px; }
.fq-q { flex: 1 1 auto; }
.fq-a { margin-left: auto; max-width: 100%; }
/* family facts: labels in a column, long answers left aligned beside them (stacked on a phone) */
.fam-facts div { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); gap: 4px 16px; }
.fam-facts dd { text-align: left; }
/* the kit form reads top to bottom under Start a matter: type, markup, drawings, build */
.kit-form { flex: 1 1 100%; flex-direction: column; align-items: flex-start; gap: 0; }
.kit-form details { flex: none; width: 100%; margin-top: 12px; }
.kit-form > .btn { margin-top: 14px; }
.kit-form select { max-width: 320px; }
@media (max-width: 640px) {
  :where(.panel) { padding: 16px; }
  :where(.panel.tbl-wrap) { padding: 4px 12px; }
  /* a stacked table cell without a label runs as plain flow, not a row of flex columns */
  .rtable td:not([data-label]) { display: block; }
  .rtable td:not([data-label])::before { content: none; }
  /* every section link fits one row: no clipped "Libra" */
  .topnav { justify-content: space-between; gap: 0; margin: 0 -10px; width: calc(100% + 20px); }
  .topnav-a { padding: 0 5px; font-size: 13px; }
  /* list titles wrap instead of ending in an ellipsis */
  .m-title .t { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  /* long fact answers read under their label, left aligned */
  .fam-facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  /* the Docket's type by state matrix fits the phone: state headers stand upright, columns stay narrow */
  [aria-labelledby="h-modes"] .dtable thead th.num { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; white-space: nowrap; vertical-align: bottom; padding: 8px 4px; }
  [aria-labelledby="h-modes"] .dtable td.num { padding-left: 3px; padding-right: 3px; }
  [aria-labelledby="h-modes"] .dtable th.row-h { padding-right: 8px; }
  [aria-labelledby="h-modes"] .dtable thead th { vertical-align: bottom; }
  /* the reviewer field gets the full row so its placeholder is never cut */
  .review-form input[type=text] { flex-basis: 100%; }
}
@media (pointer: coarse) {
  .files li a, .ics-link { min-width: var(--hit); justify-content: center; }
  .pdf-bar a, .files li a { display: inline-flex; align-items: center; min-height: var(--hit); }
  /* a past-due line's matter link stays inline in its sentence; vertical padding widens the hit box only */
  .pastdue a { padding: 12px 0; }
  /* a link inside a table cell grows its hit box with padding the line box does not see, so rows stay aligned */
  .rtable td a, .dtable a:not(.cell) { display: inline-block; min-height: 0; min-width: var(--hit); text-align: inherit; padding: 14px 0; margin: -14px 0; }
  /* a count's hit box widens sideways the same way, so the count columns stay as narrow as their numbers */
  .dtable td.num a { min-width: 0; padding: 14px 20px; margin: -14px -20px; }
}
/* Night Desk: ndshell */
/* ---- FIG. 1 (a separable fastener after US 1,219,881, public domain): patent line work in slate, numerals in mono */
.fig1 { display: block; overflow: visible; }
.fig1 path, .fig1 circle { stroke: var(--line-3); stroke-width: 1.1; }
.fig1-ground path { stroke-width: 1; stroke: var(--line-2); }
.fig1 .fig1-axis { stroke: var(--line); }
.fig1 text { stroke: none; fill: var(--muted); font: 400 17px var(--mono); }
.fig1 .fig1-label { font-size: 16px; letter-spacing: 0.08em; fill: var(--ink-2); }

/* ---- the Dimension landing (Login, Setup, Message): one centred glass sheet over FIG. 1, a single primary */
.is-land .wrap.main, .is-auth.is-land .main { display: block; padding: 0; max-width: none; }
.land { position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center;
  min-height: 100vh; min-height: 100dvh; padding: 48px 16px 64px; }
.main.desk .land { min-height: 0; padding: 32px 0 48px; }
.land-in { width: 100%; max-width: 920px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.land-mark { margin: 0; display: flex; align-items: center; min-height: 40px; }
.land-display { margin: 8px 0 0; max-width: 15ch; text-align: center; color: var(--ink); text-wrap: balance;
  font: 500 clamp(48px, 5.4vw, 72px)/1.06 var(--sans); letter-spacing: -0.018em; }
.land-stage { position: relative; isolation: isolate; width: 100%; display: flex; justify-content: center; padding: 88px 0 72px; }
.land-fig { position: absolute; z-index: -1; left: 50%; top: 50%; width: 780px; max-width: none; height: auto;
  transform: translate(-50%, -50%); pointer-events: none; }
.land-sheet { position: relative; width: 100%; max-width: 440px; padding: 10px; border-radius: var(--r-panel);
  background: var(--glass); box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(9px) saturate(140%); backdrop-filter: blur(9px) saturate(140%); }
.land-read { border-radius: calc(var(--r-panel) - 10px); background: var(--frost); padding: 28px 28px 24px; }
.land-h { font: 500 24px/1.2 var(--display); letter-spacing: -0.012em; margin: 0 0 6px; color: var(--ink); }
.land-say { margin: 0 0 20px; color: var(--ink-2); overflow-wrap: anywhere; }
.land-read .alert { margin: 0 0 16px; }
.land-form .field { margin: 0 0 16px; }
.land-read .btn-block { min-height: 44px; }
.land-steps { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); }
.land-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.land-n { font-size: 13px; color: var(--muted); padding-top: 2px; }
.land-st { margin: 0; color: var(--ink); }
.land-sd { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.land-foot { margin: 0 0 20px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.land-acts { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.land-alt { display: inline-flex; align-items: center; min-height: 36px; font-size: 14px; color: var(--ink-2); }
.land-alt:hover { color: var(--ink); }
@media (max-width: 640px) {
  .land { padding: 32px 16px 48px; }
  .land-stage { padding: 48px 0; }
  .land-fig { width: 600px; }
  .land-read { padding: 24px 20px 20px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .land-sheet { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .land-sheet { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .land-read { background: var(--surface); }
}
@media (forced-colors: active) {
  .land-sheet, .land-read { background: Canvas; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .land-fig { display: none; }
}

/* ---- the reading column (Version, Changed in another tab): Linear issue body plus one facts panel */
.rd { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 28px; align-items: start;
  max-width: calc(var(--work-max) + var(--side-w) + 28px); margin: 0 auto; }
.rd-main { min-width: 0; }
.rd-head { margin: 0 0 16px; }
.rd-head .page-sub { margin-top: 6px; }
.rd-tabs { margin: 0 0 16px; }
.rd-paper { max-height: none; overflow: visible; overflow-wrap: anywhere; }
.rd-head .page-sub, .rd-side .facts dd { overflow-wrap: anywhere; min-width: 0; }
.rd-main > .rd-sec { padding: 20px 0 8px; border-top: 1px solid var(--line); }
.rd-main > .rd-sec .section-t { margin: 0 0 12px; }
.rd-side { min-width: 0; }
.rd-side .rd-sec { padding: 16px 0; border-top: 1px solid var(--line); }
.rd-side .rd-sec:first-child { border-top: 0; }
.rd-side .side-title { margin: 0 0 8px; }
.rd-form { margin: 14px 0 6px; }
.rd-mark { margin: 0 0 8px; }
.rd-say { display: flex; align-items: baseline; gap: 10px; }
.rd-say::before { flex: 0 0 auto; margin-right: 0; }
.rd-say p { margin: 0; }
.empty-act { margin-left: 4px; }
@media (max-width: 1180px) {
  .rd { grid-template-columns: minmax(0, 1fr); }
}
@media (pointer: coarse) {
  .land-alt, .empty-act { min-height: var(--hit); }
  .empty-act { display: inline-flex; align-items: center; }
}
/* end Night Desk: ndshell */
/* Night Desk: ndlists */
/* Library and Corpus as the Linear list view (.design/DESIGN.md, Pattern product per screen): dense 44px rows under a
   sticky header, a cursor row (ivory bar plus obsidian fill, never cobalt), a Kbd hint only on that row, and a solid
   facts column for the row under the cursor. No lamp and no glass below the top bar on these pages. */
.lst { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 28px; align-items: start; }
.lst-main { min-width: 0; }
.lst-main > .section:last-child { margin-bottom: 0; }
.lside { position: sticky; top: calc(var(--bar-h) + 24px); max-height: calc(100vh - var(--bar-h) - 48px); overflow-y: auto;
  min-width: 0; padding-left: 20px; border-left: 1px solid var(--line); }
.lside .dside-sec:first-child { padding-top: 0; }
.lwrap { max-width: 100%; overflow-x: auto; }

/* the filter row: '/' focuses the first field; its Kbd sits inside the field's right edge */
.lfilters { flex-wrap: wrap; align-items: center; }
.lsearch { position: relative; display: flex; flex: 1 1 280px; min-width: 0; max-width: 420px; }
.lsearch input { width: 100%; max-width: none; padding-right: 40px; }
.lsearch .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.lcheck { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }

/* tables: a hairline header that stays put while the rows scroll under the glass bar */
.ltable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ltable th { position: sticky; top: var(--bar-h); z-index: 2; text-align: left; font: 500 13px var(--sans); color: var(--muted);
  padding: 8px 12px; background: var(--bg); box-shadow: inset 0 -1px 0 var(--line-2); white-space: nowrap; }
.ltable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.ltable td.ta-r, .ltable th.ta-r { text-align: right; }
.ltable tr[hidden] { display: none; }
.lwrap .ltable th { position: static; }
.lph { display: none; }

/* cursor rows */
.lrows { table-layout: fixed; }
.lrows td { height: var(--row); padding-top: 0; padding-bottom: 0; vertical-align: middle; white-space: nowrap; overflow: hidden; }
.lrows tbody tr { cursor: default; }
.lrows tbody tr:hover td { background: var(--surface-2); }
.lrows tr.is-cur td { background: var(--select); }
.lrows tr.is-cur td:first-child { box-shadow: inset 2px 0 0 var(--select-bar); }
.lrows .c-k { width: 76px; text-align: right; }
.lrows .c-k .kbd { visibility: hidden; }
.lrows tr.is-cur .c-k .kbd { visibility: visible; }
.lrows td a { color: var(--ink); }
.lcut { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrows .c-pat { width: 150px; }
.lrows .c-area { width: 80px; color: var(--ink-2); }
.lrows .c-class { width: 180px; color: var(--ink-2); }
.lrows .c-out { width: 96px; color: var(--ink-2); }
.lrows .c-w { width: 84px; }
.ljobs .c-st { width: 120px; }
.ljobs .c-job { width: 28%; }
.ljobs .c-done { width: 120px; }
.ljobs .c-upd { width: 170px; color: var(--ink-2); }
.ljobs .c-msg { color: var(--ink-2); }
.lpager { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.olog .lsent { overflow-wrap: anywhere; word-break: break-word; color: var(--ink-2); }

/* the facts column: the row under the cursor, then the totals */
.lpick-n { margin: 0; font-size: 15px; }
.lpick-n a { color: var(--ink); }
.lpick-t { margin: 2px 0 10px; font-size: 15px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.lpick-m { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.lfact { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.lfact > .smark { margin-right: 8px; }
.lside .lfact { margin: 10px 0 0; }
.lfact-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 2px 0 8px; }
.lfact-big .tnum { font: 500 36px/1.1 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.lfact-u { font-size: 15px; color: var(--ink-2); }
.lside-list { list-style: none; margin: 10px 0 0; padding: 0; }
.lside-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.lside-links { margin: 10px 0 0; }
.lside .facts dt a { color: var(--ink); }

/* pattern state, findings in words, the statistics sheet */
.lstate { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 12px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.lsub { font: 500 15px/1.3 var(--display); margin: 16px 0 8px; }
.lnamed { margin: 0 0 12px; padding-left: 18px; font-size: 14px; }
.lnamed li { margin: 4px 0; }
.lfind { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.lfind-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 150px; gap: 4px 16px; align-items: center;
  min-height: var(--row); padding: 8px 0; border-bottom: 1px solid var(--line); }
.lfind-what { min-width: 0; }
.lfind-w { display: block; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.lfind-u { display: block; font-size: 13px; color: var(--muted); }
.lfind-v { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.lsheet { margin-top: 12px; }

/* one entry: claims on the paper sheet, the key line in the paper's muted ink */
.lpaper { max-height: none; }
.lclaim-k { margin: 2px 0 0; font: 500 13px/1.45 var(--sans); color: var(--paper-muted); }
.lclaim-k .sep { background: var(--paper-muted); }

/* the corpus's last error: a mark and one line, the detail behind a disclosure */
.lerr { margin-top: 18px; padding-top: 4px; }
.lerr-l { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.lerr .pre { background: var(--sunk); }

@media (min-width: 1180px) {
  .ltable th { top: calc(var(--bar-h) + 12px); }
  .lside { top: calc(var(--bar-h) + 36px); }
}
@media (max-width: 860px) {
  .ltable th { position: static; }
}
@media (max-width: 1279px) {
  .lst { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lside { position: static; max-height: none; overflow: visible; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .lside .dside-sec:first-child { padding-top: 16px; }
  .lside .lsel { display: none; }
  .lside .lsel + .dside-sec { border-top: 0; padding-top: 16px; }
}
@media (max-width: 640px) {
  .lsearch { flex: 1 1 100%; max-width: none; }
  .lsearch .kbd { display: none; }
  .lsearch input { padding-right: 12px; }
  .lfilters .btn { flex: 1 1 auto; }
  .ltable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ltable, .ltable tbody, .ltable tr, .ltable td { display: block; width: 100%; }
  .ltable tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .ltable td { border: 0; padding: 2px 0; }
  .ltable td.ta-r { text-align: left; }
  .ltable td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 96px; margin-right: 8px; color: var(--muted); font: 500 13px var(--sans); }
  .lrows tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; min-height: var(--row); padding: 10px 12px; }
  .lrows td { height: auto; width: auto; padding: 0; white-space: normal; overflow: visible; background: none; }
  .lrows tr.is-cur { background: var(--select); box-shadow: inset 2px 0 0 var(--select-bar); }
  .lrows tr.is-cur td, .lrows tbody tr:hover td { background: none; }
  .lrows tr.is-cur td:first-child { box-shadow: none; }
  .lrows .c-k, .lrows .c-area { display: none; }
  .lcut { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .lph { display: inline; }
  .lrows .c-pat { grid-column: 1; grid-row: 1; }
  .lrows .c-w { grid-column: 2; grid-row: 1; text-align: right; }
  .lrows .c-title { grid-column: 1 / -1; grid-row: 2; }
  .lrows .c-class { grid-column: 1; grid-row: 3; font-size: 13px; }
  .lrows .c-out { grid-column: 2; grid-row: 3; text-align: right; font-size: 13px; }
  .ljobs .c-st { grid-column: 1; grid-row: 1; }
  .ljobs .c-done { grid-column: 2; grid-row: 1; text-align: right; }
  .ljobs .c-job { grid-column: 1 / -1; grid-row: 2; overflow-wrap: anywhere; }
  .ljobs .c-msg { grid-column: 1 / -1; grid-row: 3; font-size: 13px; }
  .ljobs .c-upd { grid-column: 1 / -1; grid-row: 4; font-size: 13px; color: var(--muted); }
  .lfind-row { grid-template-columns: minmax(0, 1fr); padding: 10px 0; }
  .lfind-v { white-space: normal; }
}
@media (pointer: coarse) {
  .ltable td a, .lpick-n a, .lside .facts dt a, .lside-links a, .lpager a { display: inline-flex; align-items: center; min-height: var(--hit); }
  .lrows .c-k .kbd, .lsearch .kbd { display: none; }
}
.nd-lists .page-sub .mono { white-space: nowrap; }
.lfilters > input { flex: 1 1 150px; max-width: 220px; }
.lfilters > select { flex: 0 1 180px; }
.lfilters > .lsearch { flex: 2 1 240px; }
.olog .lwhen { white-space: nowrap; }
.lfilters + .lstate, .lfilters + .basis, .lstate + .basis { margin-bottom: 16px; }
@media (max-width: 640px) {
  .lfilters > input { flex: 1 1 100%; max-width: none; }
  .lfilters > select { flex: 1 1 140px; max-width: none; }
  .lfilters > .lsearch { flex: 1 1 100%; }
  .lrows .c-pat, .lrows .c-w, .lrows .c-class, .lrows .c-out, .ljobs .c-st, .ljobs .c-job, .ljobs .c-done, .ljobs .c-upd { width: auto; }
}
/* end Night Desk: ndlists */
/* Night Desk: ndstages1 */
/* Stage outputs (.design/DESIGN.md, Linear issue body plus Stripe Docs reading column): the text on a paper sheet
   at 70ch, findings as a dense cursor list, facts in a side column of hairline sections. Solid surface, no glass. */
.sd { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 20px 28px; align-items: start; }
.sd.sd-solo { grid-template-columns: minmax(0, 1fr); }
.sd-read { min-width: 0; }
.sd-read > * + * { margin-top: 16px; }
.sd-read > .details { margin-top: 20px; }
.sd-side { min-width: 0; font-size: 13px; }
.sd-sec { padding: 14px 0; border-top: 1px solid var(--line); }
.sd-sec:first-child { border-top: 0; padding-top: 0; }
.sd-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; font: 500 13px/1.4 var(--display); color: var(--ink-2); }
.sd-n { font: 500 13px var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); }
.sd-side .facts div { font-size: 13px; padding: 7px 0; }
.sd-side .facts dd { overflow-wrap: anywhere; }
.sd-side .basis { margin-top: 8px; }
.sd-side .plain li, .sd-qs li { padding: 4px 0; color: var(--ink-2); line-height: 1.45; }
.sd-terms { margin: 0; }
.sd-qs { margin: 0; padding-left: 20px; }
.sd-qs li { color: var(--ink); }
.sd-qs li::marker { font: 400 13px var(--mono); color: var(--muted); }
.sd-side .feat li { grid-template-columns: 30px minmax(0, 1fr); font-size: 13px; line-height: 1.45; color: var(--ink-2); border-top-color: var(--line); }
.sd-side .feat .mono { color: var(--muted); font-size: 12px; padding-top: 1px; }
.sd-side .details { margin: 0; border-top: 0; padding-top: 0; }
.sd-side .numerals { grid-template-columns: minmax(0, 1fr); }
.sd-note .vlist { margin: 0; padding-left: 18px; }

/* paper: the reading sheet, solid ivory, Source Serif 4 at 16/1.7, 70ch */
.paper.sd-paper { max-height: none; overflow: visible; padding: 36px 40px 40px; }
.sd-paper .doc { margin: 0; max-width: 70ch; }
.sd-paper .prose { font: 500 16px/1.7 var(--serif); color: var(--paper-ink); max-width: 70ch; }
.sd-paper .prose h1, .sd-paper .prose h2, .sd-paper .prose h3 { font: 600 16px/1.4 var(--serif); letter-spacing: 0.02em; color: var(--paper-ink); margin: 1.6em 0 0.5em; }
.sd-paper .prose > :first-child { margin-top: 0; }
.sd-paper .prose code { background: none; color: var(--paper-ink); font-size: 0.86em; }
.sd-paper .prose th, .sd-paper .prose td { border-color: var(--paper-line); }
.sd-paper a, .sd-paper .prose a { color: var(--paper-ink); text-decoration: underline; text-decoration-color: var(--paper-mark); text-underline-offset: 3px; }
.sd-paper .muted, .sd-paper .pnum, .sd-paper .vlist::marker { color: var(--paper-muted); }
.sd-paper .doc-sub:first-child { margin-top: 0; }
.sd-text { margin: 0 0 18px; }
.sd-pre { margin: 0; font: 500 15px/1.65 var(--serif); color: var(--paper-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
/* a pasted claim set or record on paper keeps its own line breaks; the matter's description fields read as labelled prose */
.sd-doc { margin: 0; max-width: 70ch; font: 500 16px/1.7 var(--serif); color: var(--paper-ink); }
.sd-doc > div { padding: 0 0 18px; border-top: 0; }
.sd-doc dt { font: 600 13px/1.4 var(--sans); color: var(--paper-muted); margin-bottom: 4px; }
/* claim elements: keys as hanging labels in mono, text in serif */
.sd-claim + .sd-claim { margin-top: 28px; }
.sd-els { margin: 0; }
.sd-els > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 6px 0; }
.sd-els dt { font: 400 13px/1.9 var(--mono); color: var(--paper-muted); }
.sd-els dd { margin: 0; overflow-wrap: anywhere; }

/* the property list: label left, value right, Linear issue properties */
.sd-props > div { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 4px 20px; padding: 10px 0; }
.sd-props > div:first-child { padding-top: 0; }
.sd-props dt { margin: 0; font-size: 13px; color: var(--muted); }
.sd-props dd .pre { margin: 0; }

/* findings and MUST FIX rows: a dense cursor list, one hairline per row, the ivory bar marks the row in hand */
.sd-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sd-list > li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; align-items: baseline; min-height: var(--row);
  padding: 11px 12px 11px 10px; border-bottom: 1px solid var(--line); transition: background var(--t-fast), box-shadow var(--t-fast); }
.sd-list > li > .smark { align-self: start; padding-top: 4px; }
.sd-list > li:hover, .sd-list > li:focus-visible { background: var(--select); box-shadow: inset 2px 0 0 var(--select-bar); }
.sd-list > li:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: -2px; }
.sd-row { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.findings.sd-list { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.findings.sd-list > li { border-top: 0; padding: 11px 12px 11px 10px; }
.findings.sd-list p { margin: 3px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.sd-list .f-top { font-size: 15px; align-items: baseline; }
.sd-list .f-check { color: var(--ink); }
.sd-list .f-loc { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sd-read .fgroup { margin-top: 0; }
.sd-read .fgroup + .fgroup { margin-top: 24px; }
.sd-read .fgroup-h { margin: 0 0 6px; gap: 10px; font: 500 15px/1.4 var(--display); }
.sd-done .smark-i, .smark.sd-done .smark-i { width: 5px; height: 9px; border-width: 0 1.5px 1.5px 0; border-radius: 0; transform: translateY(-1px) rotate(45deg); margin: 0 2px 0 3px; }
.smark.sd-done { color: var(--muted); }

/* audit: the verdict is the page heading; the section scores read in the facts column */
.audit-top.sd-verdict { margin: 0 0 20px; }
.sd-verdict .verdict { gap: 12px; }
.sd-verdict .verdict-l { font: 500 13px var(--sans); color: var(--ink-2); opacity: 1; }
.sd-side .scores { border: 0; padding: 0; gap: 4px; }
.sd-side .score { grid-template-columns: 52px minmax(0, 1fr) 24px; gap: 8px; min-height: 24px; }
.sd-side .score-k, .sd-side .score-v { font-size: 12px; }
.sd-side .scores .quiet-note { margin: 0 0 8px 60px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.sd-read > .jcard { margin-top: 28px; }

/* package: ready or not ready first, the MUST FIX rows under it; the PDF is the reading surface */
.sd-ready { margin: 0 0 20px; padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.sd-ready-h { display: flex; align-items: baseline; gap: 10px; margin: 0; font: 500 18px/1.35 var(--display); color: var(--ink); }
.sd-ready-h strong { font-weight: 500; }
.sd-ready-h .smark { flex: 0 0 auto; transform: translateY(1px); }
.sd-ready-sub { margin: 6px 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.sd-ready .sd-list { margin: 12px 0 0; }
.sd-ready .sd-list + .sd-ready-sub { margin-top: 10px; }
.sd-fix > li { font-size: 14px; line-height: 1.5; }
.sd-fix .sd-row .muted { color: var(--muted); }
.pkg.sd { grid-template-columns: minmax(0, 1fr) 272px; }
.pkg.sd > .pkg-list { grid-column: 2; grid-row: 1; }
.pkg.sd > .sd-read { grid-column: 1; grid-row: 1; }
.pkg.sd .pdf-frame { margin: 0; }
.pkg-list .btn-block { width: 100%; margin: 0 0 14px; }
.notes-list li { padding: 4px 0; color: var(--ink-2); line-height: 1.45; }
.sd-files li { grid-template-columns: 40px minmax(0, 1fr); row-gap: 0; padding: 7px 0; }
.sd-files .sd-fmeta { grid-column: 2; }
.sd-table td, .sd-table th { padding-top: 9px; padding-bottom: 9px; }
.out-panel .details .paper.sd-paper { margin-top: 12px; }

@media (max-width: 860px) {
  .sd, .pkg.sd { grid-template-columns: minmax(0, 1fr); }
  .pkg.sd > .pkg-list, .pkg.sd > .sd-read { grid-column: 1; grid-row: auto; }
  .sd-read + .sd-side { border-top: 1px solid var(--line); padding-top: 16px; }
}
@media (max-width: 640px) {
  .paper.sd-paper { padding: 20px 16px; }
  .sd-els > div { grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
  .sd-props > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .sd-ready-h { font-size: 16px; }
  .sd-ready-sub { margin-left: 0; }
  .sd-list > li { padding-left: 8px; padding-right: 8px; }
  .sd-list .f-top { flex-wrap: wrap; gap: 2px 10px; }
  .sd-list .f-loc { white-space: normal; text-align: left; }
}
@media (pointer: coarse) {
  .sd-list > li { min-height: var(--hit); }
}
@media (prefers-reduced-motion: reduce) {
  .sd-list > li { transition: none; }
}
.files-pkg li.is-on { background: var(--select); box-shadow: inset 2px 0 0 var(--select-bar); }
.pkg-list .files-pkg { margin: 0; }
.pkg-list .files-pkg li { margin: 0; padding: 7px 8px; }
.pkg-list .facts div { flex-wrap: wrap; row-gap: 2px; }
.pkg-list .facts dt { flex: 0 0 auto; }
.pkg-list .facts dd { flex: 1 1 auto; }
.pkg.sd .pdf-frame { border-radius: var(--r); }
.sd-nopdf .empty-note { padding-top: 0; }
.sd-ready .sd-list > li:last-child { border-bottom: 0; }
.sd-ready:has(+ .review-banner) { margin-bottom: 0; border-bottom: 0; }
.sd-read > .jcard { border-top: 0; padding-top: 0; }
.alert[data-chart-plan] { margin: 0 0 20px; padding: 0 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.alert[data-chart-plan] > strong { font: 500 15px/1.4 var(--display); }
.alert[data-chart-plan] .plain { margin: 8px 0 0 18px; }
.alert[data-chart-plan] .plain li { padding: 3px 0; color: var(--ink-2); }
/* end Night Desk: ndstages1 */
/* Night Desk: ndforms */
/* New matter (Dimension numbered rows plus the Linear create flow), matter settings and the outbound log (one
   reading column of numbered sections, facts in a side column), the continuation form and the portfolio's existing
   application rows (the same field rhythm). Tokens only; cobalt only on the one data-lamp, focus and link text. */
.ndf-n { display: inline-block; min-width: 2.4em; margin-right: 8px; font: 400 13px/1 var(--mono); letter-spacing: -0.01em;
  color: var(--muted); font-variant-numeric: tabular-nums; }
.ndf-wrap { max-width: 1060px; margin: 0 auto; }
/* a long unbroken value (a venture name, an error, a pasted cite) wraps inside the column, never past a phone's edge */
.ndf-wrap, .ndf-read { overflow-wrap: break-word; }

/* the mode picker: numbered rows, name left, one line blurb, two digit index right; selection is ivory, never cobalt */
.ndf-modes { display: block; margin: 0 0 32px; border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: none; overflow: visible; }
.ndf-modes .mode-opt { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; align-items: baseline;
  gap: 2px 24px; min-height: var(--row); margin: 0; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: none; box-shadow: none; color: var(--ink); transition: background var(--t-fast); }
.ndf-modes .mode-opt:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.ndf-modes .mode-opt.is-on { background: var(--select); box-shadow: inset 2px 0 0 var(--select-bar); }
.ndf-modes .mode-opt .ndf-mname { display: block; font: 500 16px/1.3 var(--display); letter-spacing: -0.006em; }
.ndf-modes .mode-opt .ndf-mblurb { display: block; min-width: 0; margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.ndf-modes .mode-opt .ndf-mi { display: block; margin: 0; font: 400 13px/1.3 var(--mono); color: var(--muted); }
.ndf-modes .mode-opt.is-on .ndf-mi { color: var(--ink); }

/* the create flow: a sticky section index beside one column of fields */
.ndf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; align-items: start; }
.ndf-index { display: none; }
.ndf-col { min-width: 0; max-width: 760px; }
.ndf-index-l { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ndf-index-a { display: flex; align-items: baseline; gap: 0; min-height: 40px; padding: 10px 0; border-bottom: 1px solid var(--line);
  color: var(--ink-2); font-size: 14px; line-height: 1.3; }
.ndf-index-a:hover { color: var(--ink); text-decoration: none; }
.ndf-index-t { flex: 1 1 auto; min-width: 0; }
.ndf-req { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.ndf-ok { flex: 0 0 auto; display: inline-block; width: 5px; height: 9px; margin: 0 4px 0 8px; border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0; transform: translateY(-1px) rotate(45deg); }
@media (min-width: 1180px) {
  .ndf { grid-template-columns: 200px minmax(0, 1fr); }
  .ndf-index { display: block; position: sticky; top: 92px; }
}

/* sections are hairline rows with a numbered head, never cards; fields run in one column */
.ndf .fsec, .ndf-sec { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0;
  padding: 24px 0 8px; scroll-margin-top: 92px; }
.ndf .fsec-title, .ndf-sec .fsec-title { display: flex; align-items: baseline; margin: 0 0 18px; color: var(--ink); }
.ndf .grid-2, .ndf-readcol .grid-2 { grid-template-columns: minmax(0, 1fr); }
.ndf .field, .ndf-readcol .field { margin-bottom: 20px; }
.ndf .label, .ndf-readcol .label, .ndf-exrow .label { font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.ndf .hint, .ndf-readcol .hint, .ndf-exrow .hint { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0 0 8px; max-width: 70ch; }
.ndf .field > .hint:last-child { margin: 6px 0 0; }
.ndf .details, .ndf-readcol .details { margin-top: 4px; }
.ndf .conf-sec { margin-top: 0; }
.ndf .conf-sec > summary.fsec-title { font: 500 18px/1.25 var(--display); color: var(--ink); min-height: 32px; }
.ndf .conf-sec > summary.fsec-title::before { order: 2; margin: 0 6px 0 auto; }
.ndf .radio:has(input:checked) { border-color: var(--line-3); background: var(--select); box-shadow: inset 2px 0 0 var(--select-bar); }
.ndf .radio input, .ndf .check input, .ndf-readcol .check input { accent-color: var(--ink); }
.ndf .drop:hover { border-color: var(--line-3); background: var(--surface-2); }
.ndf .drop.is-over { border-color: var(--line-3); background: var(--glass-bar); box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); }
.ndf .box { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px 0 4px; margin: 0 0 16px; }
.ndf .side-stages { margin: 8px 0 16px; }
.ndf .mini-steps { gap: 4px 16px; }
.ndf .mini-steps li { background: none; border: 0; border-radius: 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.ndf .mini-steps li::before { font: 400 12px var(--mono); color: var(--muted); }
.ndf .alert { margin: 0 0 20px; }

/* the submit row sticks to the bottom of the window (tier 1 glass, chrome over the form); the lamp sits on it */
.ndf-submit { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 16px; margin: 24px 0 0; padding: 10px 10px 10px 18px; border-radius: var(--r-seg-lg);
  background: var(--glass-bar); box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); }
.ndf-submit-say { margin: 0; min-width: 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.ndf-submit .btn { min-width: 168px; }
.ndf-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 0; }
.ndf-more .hint { flex: 1 1 100%; margin: 0; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ndf-submit, .ndf .drop.is-over { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .ndf-submit, .ndf .drop.is-over { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .ndf-submit, .ndf .drop.is-over { background: Canvas; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ndf-modes .mode-opt.is-on { outline: 2px solid CanvasText; }
}

/* settings and the outbound log: one reading column on the solid surface, facts in one glass side panel */
.ndf-read { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.ndf-readcol { min-width: 0; padding: 4px 28px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-seg-lg); }
.ndf-readcol > .ndf-sec:first-of-type { border-top: 0; }
.ndf-lede { margin: 0 0 18px; max-width: 70ch; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.ndf-facts .facts div { padding: 10px 0; font-size: 13px; align-items: baseline; }
.ndf-facts .facts dt { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.ndf-facts .facts dd { min-width: 0; overflow-wrap: anywhere; }
.ndf-facts .basis { padding-top: 10px; border-top: 1px solid var(--line); }
.ndf-readcol .olog tr.is-blocked td { background: none; }
.ndf-readcol .olog td, .ndf-readcol .olog .pre { overflow-wrap: anywhere; min-width: 0; }
.ndf-when { white-space: nowrap; color: var(--ink-2); }
.ndf-notes div { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; font-size: 13px; }
.ndf-notes dd { text-align: left; }
@media (min-width: 1180px) {
  .ndf-read { grid-template-columns: minmax(0, 820px) var(--side-w); gap: 32px; }
  .ndf-facts { position: sticky; top: 92px; }
}

/* the portfolio's existing applications: one numbered row each, a label over every input */
.ndf-exrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 0 16px; margin: 0; padding: 14px 0 0;
  border: 0; border-top: 1px solid var(--line); min-width: 0; }
.ndf-exrow > .ndf-exrow-h { float: left; grid-column: 1 / -1; display: flex; align-items: baseline; width: 100%; margin: 0 0 10px; padding: 0;
  font: 500 15px/1.3 var(--display); color: var(--ink); }
.ndf-exrow .field { margin-bottom: 14px; }

@media (max-width: 860px) {
  .ndf-modes .mode-opt { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
  .ndf-modes .mode-opt .ndf-mname { grid-column: 1; grid-row: 1; }
  .ndf-modes .mode-opt .ndf-mi { grid-column: 2; grid-row: 1; }
  .ndf-modes .mode-opt .ndf-mblurb { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 640px) {
  .ndf-readcol { padding: 4px 16px 16px; }
  .ndf-submit { padding: 10px; }
  .ndf-submit .btn { flex: 1 1 100%; }
  .ndf-more .btn { flex: 1 1 auto; }
  .ndf-notes div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (pointer: coarse) {
  .ndf-index-a { min-height: var(--hit); }
  .ndf .conf-sec > summary.fsec-title { min-height: var(--hit); }
}
@media (prefers-reduced-motion: reduce) {
  .ndf-modes .mode-opt { transition: none; }
}
/* end Night Desk: ndforms */
/* Night Desk: ndstages2 */
/* Research, design and office action stage pages (stage/assassinate, chart, locate, targets, design_*, oa_*): a
   reading column and a fact column inside the solid work surface. Two columns only when the stage panel itself is
   wide enough (a container query), so the matter's own fact panel never squeezes the paper. Tokens only. */
.out-panel:has(.ndr) { container-type: inline-size; container-name: ndr; }
.ndr { display: block; margin-top: 4px; }
/* a long unbroken value (a cite, a URL, a model's phrase) wraps inside its column, never past a phone's edge;
   break-word, not anywhere, so a scrolling table keeps its column widths */
.ndr-main, .ndr-side { overflow-wrap: break-word; }
.ndr-main { min-width: 0; }
.ndr-side { min-width: 0; margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--line); }
.ndr-facts-first > .ndr-side { margin: 0 0 24px; padding: 0 0 4px; border-top: 0; border-bottom: 1px solid var(--line); }
@container ndr (min-width: 820px) {
  .ndr { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 0 32px; align-items: start; }
  .ndr > .ndr-main { grid-column: 1; grid-row: 1; }
  .ndr > .ndr-side, .ndr-facts-first > .ndr-side { grid-column: 2; grid-row: 1; margin: 0; padding: 0 0 0 20px;
    border: 0; border-left: 1px solid var(--line); }
}
.ndr-read { max-width: 70ch; }
.ndr-h { margin: 28px 0 8px; }
.ndr-main > .ndr-h:first-child, .ndr-main > .review-banner:first-child + .ndr-h { margin-top: 4px; }
.ndr-block { margin: 20px 0 0; }
.ndr .review-banner { margin-top: 0; }
.ndr .lede { margin: 8px 0 0; font-size: 15px; line-height: 1.55; }
.ndr .basis { max-width: 70ch; }
/* the sieve and other counts: numbers on one hairline row, never cards */
.ndr-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0 0; padding: 12px 0 14px; }
.ndr-counts dd.tnum { font-size: 30px; }
.ndr .stat-row { margin: 0; }
.ndr .stat-n { font-family: var(--display); letter-spacing: -0.01em; }
/* the verdict: one word in Geist, its label quiet; the state is told by the mark in the side column, not a hue */
.ndr-verdict { border: 0; padding: 0; margin: 16px 0 0; background: none; gap: 4px 12px; }
.ndr-verdict .verdict-l { font: 500 13px var(--sans); color: var(--muted); opacity: 1; }
.ndr-verdict .verdict-v { color: var(--ink); }
/* dense rows: one hairline per item, no card borders */
.ndr-rows, .cards[data-ndr-rows], .rej.ndr-rows { display: block; list-style: none; margin: 0; padding: 0; border: 0;
  border-top: 1px solid var(--line); border-radius: 0; }
.ndr-rows > .ndr-row, .cards[data-ndr-rows] > .ndr-row, .rej.ndr-rows > li { padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.ndr-row-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ndr-id { font-size: 13px; color: var(--muted); }
.ndr-t { flex: 1 1 16em; min-width: 0; font: 500 15px/1.4 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.ndr-row > p { margin: 6px 0 0; }
.ndr-row-s { margin-top: 12px; font-size: 14px; }
.ndr-row-s .card-sh { margin: 0 0 4px; font: 500 13px var(--display); color: var(--ink-2); }
.ndr-row .kvs { display: grid; gap: 0; }
.ndr-row .kv { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 2px 16px; margin: 0; padding: 4px 0; }
.ndr-row .kv dt { font-size: 13px; color: var(--muted); }
.ndr-row .kv dd { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.ndr-row .vstack { gap: 4px; }
.ndr-row .vcard { border-left: 0; padding-left: 0; }
.rej.ndr-rows .rej-claims { font: 500 13px var(--sans); }
.rej.ndr-rows p { font-size: 14px; }
.ndr-empty { list-style: none; }
.ndr-lines li { padding: 6px 0; border-bottom: 1px solid var(--line); }
/* claim charts: the element on the left, the evidence on the right, the state mark last */
.ndr-lead + .ndr-lead { margin-top: 32px; }
.ndr-lead-h { margin: 0; font: 500 18px/1.3 var(--display); overflow-wrap: anywhere; }
.ndr-lead > p { margin: 4px 0 0; }
.ndr-src a { overflow-wrap: anywhere; }
.ndr-chart { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.ndr-crow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 88px; gap: 4px 20px; align-items: baseline;
  min-height: var(--row); padding: 10px 0; border-bottom: 1px solid var(--line); }
.ndr-el { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.ndr-key { font-size: 13px; color: var(--muted); margin-right: 4px; }
.ndr-ev { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.ndr-check { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.ndr-met { justify-self: end; }
.c-no .ndr-ev, .c-unknown .ndr-ev { color: var(--muted); }
.sm-full { color: var(--ink); }
.sm-full .smark-i { background: currentColor; }
@container ndr (max-width: 560px) {
  .ndr-main .ndr-facts div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ndr-crow { grid-template-columns: minmax(0, 1fr) auto; }
  .ndr-el { grid-column: 1; grid-row: 1; }
  .ndr-met { grid-column: 2; grid-row: 1; }
  .ndr-ev { grid-column: 1 / -1; }
  .ndr-row .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ndr-counts dd.tnum { font-size: 24px; }
  .ndr-counts { gap: 0 12px; }
}
/* the fact column: question headers with a one line answer and one Basis line each */
.ndr-sec { padding: 14px 0; border-top: 1px solid var(--line); }
.ndr-sec:first-child { border-top: 0; padding-top: 4px; }
.ndr-q { margin: 0 0 6px; font: 500 15px/1.3 var(--display); color: var(--ink); }
.ndr-a { margin: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.ndr-big { margin: 2px 0 6px; font: 500 30px/1.1 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.ndr-list, .ndr-index { list-style: none; margin: 0; padding: 0; }
.ndr-list li, .ndr-index li { padding: 5px 0; font-size: 14px; overflow-wrap: anywhere; }
.ndr-list li + li, .ndr-index li + li { border-top: 1px solid var(--line); }
.ndr-side .facts div { font-size: 13px; }
.ndr-side .facts dd { overflow-wrap: anywhere; min-width: 0; }
.ndr-due { margin: 0; }
.ndr-say { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
.ndr-due .basis { overflow-wrap: anywhere; }
.ndr-dates { list-style: none; margin: 0; padding: 0; }
.ndr-dates li { padding: 8px 0; border-top: 1px solid var(--line); }
.ndr-dates li:first-child { border-top: 0; padding-top: 0; }
.ndr-date { font: 500 15px var(--sans); color: var(--ink); }
.ndr-what, .ndr-rule { display: block; font-size: 13px; overflow-wrap: anywhere; }
.ndr-what { color: var(--ink-2); }
.ndr-rule { color: var(--muted); }
.ndr-dates .is-passed .ndr-date { color: var(--muted); }
.ndr-facts dd.tnum { font-variant-numeric: tabular-nums; }
/* the main column's facts read label left, value right, at reading width */
.ndr-main .ndr-facts { max-width: 70ch; }
.ndr-main .ndr-facts div { display: grid; grid-template-columns: minmax(8em, 13em) minmax(0, 1fr); gap: 2px 16px; font-size: 14px; }
.ndr-main .ndr-facts dd { text-align: left; overflow-wrap: anywhere; }
/* open questions as numbered rows */
.ndr-ask { padding-top: 4px; }
.ndr-qs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ndr-qs li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ndr-qt { font-size: 15px; color: var(--ink); max-width: 70ch; }
/* figures and paper inside the reading column */
.ndr-figs { grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.ndr .paper { padding: 36px 40px; }
.ndr-record { margin-top: 28px; border-top: 1px solid var(--line); }
.ndr-record .ndr-h { margin-top: 16px; }
@media (max-width: 640px) {
  .ndr .paper { padding: 20px 16px; border-radius: 0; margin: 0 -16px; }
  .ndr-big { font-size: 26px; }
}
/* a long phrase or address in a warning wraps inside the column, never past the phone's edge */
.ndr .alert, .ndr .opt-list li, .ndr .box, .ndr .listing { overflow-wrap: anywhere; min-width: 0; }
/* a date never breaks at its hyphens; side facts read label over value, so long answers keep their width */
.ndr-say .tnum, .ndr-date, .ndr-rule .tnum, .ndr-side .facts dd .tnum { white-space: nowrap; }
.ndr-side .facts div { display: block; padding: 7px 0; }
.ndr-side .facts dt { font-size: 13px; }
.ndr-side .facts dd { text-align: left; font-size: 14px; }
/* an alert that holds only a list: its mark beside the first line, the lines unbulleted */
.ndr .alert:has(> ul.plain:only-child) { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 0 10px; align-items: start; }
.ndr .alert:has(> ul.plain:only-child)::before { margin: 6px 0 0; }
.ndr .alert-info:has(> ul.plain:only-child)::before { content: ""; width: 10px; height: 10px; box-sizing: border-box;
  border: 1.5px solid var(--ink-2); border-radius: var(--r-mark); }
.ndr .alert > ul.plain:only-child { list-style: none; padding: 0; }
.ndr .alert > ul.plain:only-child li + li { margin-top: 6px; }
/* a stacked table cell keeps its value as one piece beside its label, so a name and its role do not split into columns */
.ndr .rtable .ndr-cv { min-width: 0; flex: 1 1 auto; }
.ndr .rtable td { overflow-wrap: anywhere; }
/* a Basis line keeps its air above the finding that follows it */
.ndr .basis + .alert { margin-top: 14px; }
/* end Night Desk: ndstages2 */
/* Night Desk: ndpages */
/* The Matters list (Linear list view: 44px rows under a sticky header, a cursor row with the ivory bar, a Kbd hint
   only on that row, the facts column from ndlists) and the Portfolio pages (Dimension numbered accordion: numbered
   block rows that open into a family). Tokens only; cobalt only on the one data-lamp, focus and link text. */

/* a filed office action reply reads like complete: the muted word with its tick */
.st-filed { color: var(--muted); }
.chip.st-filed::before { width: 5px; height: 9px; border-width: 0 1.5px 1.5px 0; border-radius: 0; transform: translateY(-1px) rotate(45deg); margin: 0 2px 0 3px; }

/* ---- the Matters list */
.ndm-head, .ndm-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 120px minmax(0, 220px) 96px 72px 60px;
  gap: 0 16px; align-items: center; padding: 0 12px; }
.ndm-head { position: sticky; top: var(--bar-h); z-index: 2; min-height: 36px; background: var(--bg); box-shadow: inset 0 -1px 0 var(--line-2);
  font: 500 13px var(--sans); color: var(--muted); }
.ndm-list { list-style: none; margin: 0; padding: 0; }
.ndm-li { border-bottom: 1px solid var(--line); }
.ndm-row { min-height: var(--row); padding-top: 6px; padding-bottom: 6px; color: var(--ink); font-size: 14px; }
.ndm-row:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.ndm-li.is-cur .ndm-row { background: var(--select); box-shadow: inset 2px 0 0 var(--select-bar); }
.ndm-row > span { min-width: 0; }
.ndm-c-t { display: flex; flex-direction: column; }
.ndm-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--ink); }
.ndm-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.ndm-c-mode, .ndm-c-upd { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.ndm-c-stage { display: flex; flex-direction: column; font-size: 13px; color: var(--ink-2); }
.ndm-steps { color: var(--muted); }
.ndm-sl { overflow-wrap: anywhere; }
.ndm-c-cost, .ndm-head .ndm-c-cost, .ndm-c-upd, .ndm-head .ndm-c-upd { text-align: right; }
.ndm-c-cost { font-size: 13px; color: var(--ink-2); }
.ndm-c-k { text-align: right; }
.ndm-c-k .kbd { visibility: hidden; }
.ndm-li.is-cur .ndm-c-k .kbd { visibility: visible; }
.ndm-c-st .chip, .ndm-c-st .smark { white-space: normal; }
.ndm-none { margin: 12px 0 0; }
@media (min-width: 1180px) { .ndm-head { top: calc(var(--bar-h) + 12px); } }
@media (max-width: 1279px) { .ndm-head, .ndm-row { grid-template-columns: 140px minmax(0, 1fr) 110px minmax(0, 200px) 90px 64px; }
  .ndm-c-k { display: none; }
  .nd-mlist .lside { display: none; } }
@media (max-width: 860px) {
  .ndm-head { display: none; }
  .ndm-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; }
  .ndm-c-t { grid-column: 1; grid-row: 1; }
  .ndm-c-st { grid-column: 2; grid-row: 1; justify-self: end; }
  .ndm-c-stage { grid-column: 1; grid-row: 2; }
  .ndm-c-cost { grid-column: 2; grid-row: 2; align-self: end; }
  .ndm-c-mode { grid-column: 1; grid-row: 3; }
  .ndm-c-upd { grid-column: 2; grid-row: 3; }
  .ndm-t, .ndm-v { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
}

/* ---- the Portfolio: Next line, counts, numbered block rows that open */
.nd-port .page-sub, .nd-port .page-title { overflow-wrap: anywhere; }
.ndp-next { margin-top: 4px; }
.ndp-next .next-text { overflow-wrap: anywhere; }
.ndp-counts .ndp-word { margin: 0; font: 500 24px/1.4 var(--display); color: var(--ink); }
.ndp-counts .ndp-fee { margin: 0; font: 500 18px/1.4 var(--display); color: var(--ink); }
.ndp-counts .ndp-fee .tnum { font: inherit; font-variant-numeric: tabular-nums; }
.ndp-lede { margin: -12px 0 24px; }
.ndp-sec { margin: 0 0 32px; }
.ndp-say { margin: 0 0 10px; max-width: 70ch; font-size: 15px; line-height: 1.5; color: var(--ink); }
.ndp-lines li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.ndp-lines li:first-child { border-top: 0; }
.ndp-src { overflow-wrap: anywhere; }

/* the accordion: each family a hairline block row, number left, title, its date, its state; no card */
.families.ndp-acc { display: block; margin: 0; border-top: 1px solid var(--line); }
.ndp-acc > .panel.family { margin: 0; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; scroll-margin-top: 92px; }
.ndp-sets { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ndp-set { border-bottom: 1px solid var(--line); }
.ndp-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 190px; align-items: center; gap: 4px 20px;
  min-height: 56px; padding: 12px 12px 12px 4px; color: var(--ink); cursor: pointer; list-style: none; }
.ndp-row::-webkit-details-marker { display: none; }
.ndp-row:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.ndp-fam[open] > .ndp-row { box-shadow: inset 2px 0 0 var(--select-bar); }
.ndp-n { font: 400 13px/1 var(--mono); letter-spacing: -0.01em; color: var(--muted); padding-left: 8px; }
.ndp-fam[open] > .ndp-row .ndp-n { color: var(--ink); }
.ndp-what { display: flex; flex-direction: column; min-width: 0; }
.ndp-t { font: 500 16px/1.3 var(--display); letter-spacing: -0.006em; color: var(--ink); overflow-wrap: anywhere; }
.ndp-id { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ndp-when { font-size: 13px; color: var(--ink-2); text-align: right; overflow-wrap: anywhere; }
.ndp-st { display: flex; justify-content: flex-end; }
.ndp-st .smark, .ndp-st .chip { white-space: normal; text-align: right; }
.ndp-body { padding: 4px 12px 24px 48px; min-width: 0; overflow-wrap: break-word; }
.ndp-body .review-inline { margin: 0 0 14px; }
.ndp-body .fam-facts { margin: 0 0 8px; }
.ndp-body .fam-facts div { font-size: 13px; padding: 8px 0; }
.ndp-body .fam-facts dt { color: var(--ink-2); }
.ndp-body .cites { overflow-wrap: anywhere; }
.ndp-body .kit { margin-top: 16px; padding-top: 14px; }
.ndp-body .sub-h { margin: 0 0 8px; font: 500 15px/1.3 var(--display); color: var(--ink); }
.ndp-body .files li a { min-width: 0; }
.review-by::before { content: ""; display: inline-block; width: 5px; height: 9px; margin: 0 8px 0 3px; border: solid var(--ok);
  border-width: 0 1.5px 1.5px 0; transform: translateY(-1px) rotate(45deg); }
.ndp-kit-acts { align-items: flex-start; }
.ndp-kind { margin: 0; max-width: 320px; }
.ndp-fs { min-width: 0; margin: 12px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); }
.ndp-fs > .label { padding: 0; }
.ndp-sheet .tbl-wrap { max-width: 100%; overflow-x: auto; }
.ndp-sheet .dtable { min-width: 640px; }

/* Planning in progress: the last three log lines, the newest in ivory; the full log behind a disclosure */
.ndp-run { margin: 0 0 24px; }
.ndp-tail { list-style: none; margin: 0; padding: 0; }
.ndp-tail li { font-size: 13px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.ndp-tail li.is-new { color: var(--ink); }
.ndp-wait { margin: 0; color: var(--ink-2); }

/* the upload form inside the last numbered row */
.ndp-new .ndp-row { grid-template-columns: 44px minmax(0, 1fr); }
.ndp-form { max-width: 640px; }
.ndp-form .field { margin-bottom: 18px; }
.ndp-setrow .ndp-when { white-space: nowrap; }

@media (max-width: 860px) {
  .ndp-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .ndp-when { grid-column: 2; grid-row: 2; text-align: left; }
  .ndp-st { grid-column: 3; grid-row: 1; }
  .ndp-body { padding: 4px 4px 20px 40px; }
}
@media (max-width: 640px) {
  .ndp-row { grid-template-columns: 32px minmax(0, 1fr); padding: 12px 4px; }
  .ndp-st { grid-column: 2; grid-row: 3; justify-content: flex-start; }
  .ndp-st .smark, .ndp-st .chip { text-align: left; }
  .ndp-body { padding: 4px 0 20px; }
  .ndp-setrow .ndp-when { white-space: normal; }
  .ndp-lede { margin-top: 0; }
  /* the score table stacks (dtable.stack-sm) at phone width: no 640px floor that would make it scroll sideways */
  .ndp-sheet .dtable { min-width: 0; }
}
@media (pointer: coarse) {
  .ndp-row { min-height: var(--hit); }
  .ndm-row { min-height: 48px; }
}
@media (forced-colors: active) {
  .ndm-li.is-cur .ndm-row, .ndp-fam[open] > .ndp-row { outline: 2px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  .ndm-row, .ndp-row { transition: none; }
}
/* end Night Desk: ndpages */

/* Night Desk: ndresearch */
/* Search, Teardown and Judge stage pages: the ndstages2 reading column (.ndr) with these few additions. Tokens only. */
.ndr-main > .stat-row:first-child, .ndr-main > .lede + .stat-row, .ndr-lead > .stat-row, .ndr-lead > .ndr-read + .stat-row { margin-top: 14px; }
.ndr-main > .stat-row + .basis { margin-top: 8px; }
.ndr-lead > .ndr-read { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink); }
.ndr-lead + .ndr-lead, .ndr-lead + .ndr-record { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
/* a weak point's open check reads as its own line under the reason, with its state mark */
.rtable .ndr-check { display: block; margin-top: 6px; line-height: 1.5; }
.ndr-check .smark { margin-right: 4px; }
.r-sub .smark { margin-right: 4px; }
/* references set aside as not prior art: dense rows, the reason under the number */
[data-not-prior-art] .ndr-row > p { color: var(--ink-2); overflow-wrap: anywhere; }
/* Judge: one card per block; the first card needs no rule above it */
.ndr-judge { margin: 0; }
.ndr-main > .ndr-judge:first-child > .jcard, .ndr-main > .quiet-note + .ndr-judge > .jcard { border-top: 0; padding-top: 0; }
.ndr-side .ndr-list a { overflow-wrap: anywhere; }
.ndr-side .ndr-list .smark { margin-right: 4px; }
@media (pointer: coarse) {
  .ndr-side .ndr-list a { display: inline-flex; align-items: center; min-height: var(--hit); }
}
/* end Night Desk: ndresearch */

/* Clean: shared */
/* Wave 15c, foundation: the shared parts of the clean UI pass. Tokens only, no colour, no motion of its own. */
/* the info tip: a quiet 'i' beside a label; the panel floats over the page and never moves the layout */
.basis { margin: 8px 0 0; }
.itip { position: relative; display: inline-block; vertical-align: middle; margin: 0; font: 500 13px/1.45 var(--sans); }
.itip > .itip-i { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 20px; cursor: pointer;
  color: var(--muted); border-radius: var(--r-s); }
.itip > .itip-i::-webkit-details-marker { display: none; }
.itip > .itip-i::marker { content: ""; }
.itip-g { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; box-sizing: border-box;
  border: 1px solid var(--line-2); border-radius: var(--r-s); font: 500 11px/1 var(--display); color: var(--ink-2); }
.itip-word { font-size: 13px; color: var(--muted); }
.itip > .itip-i:hover .itip-g, .itip[open] > .itip-i .itip-g { border-color: var(--line-3); color: var(--ink); }
.itip > .itip-i:hover .itip-word, .itip[open] > .itip-i .itip-word { color: var(--ink-2); }
.itip-p { position: absolute; z-index: 20; top: calc(100% + 8px); left: -8px; width: max-content;
  max-width: min(320px, calc(100vw - 32px)); padding: 8px 12px; background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-pop); font: 500 13px/1.5 var(--sans);
  text-align: left; white-space: normal; overflow-wrap: anywhere; text-transform: none; letter-spacing: 0; }
/* in a side column the panel opens toward the page, so it never runs off the right edge */
:is(aside, .lside, .glass-panel, .facts-panel, .ndf-facts) .itip-p { left: auto; right: -8px; }
/* phones: the panel spans the column it sits in, under the 'i', inside the 16px gutter */
@media (max-width: 640px) {
  .itip { position: static; }
  .itip-p, :is(aside, .lside, .glass-panel, .facts-panel, .ndf-facts) .itip-p { top: auto; left: 16px; right: 16px;
    width: auto; max-width: none; margin-top: 8px; }
}
@media (pointer: coarse) {
  .itip > .itip-i { min-height: var(--hit); min-width: var(--hit); }
  .itip-w > .itip-i { min-width: 0; }
}
dt .itip, .side-title .itip, .section-t .itip, .label .itip { margin-left: 4px; }
.counts dt { display: flex; align-items: center; gap: 4px; }
.stat-u { font: 500 13px/1 var(--sans); color: var(--muted); letter-spacing: 0; }
/* one clean empty state: title, one line, at most one button */
.estate { padding: 32px 0; border-top: 1px solid var(--line); }
.estate:first-child { border-top: 0; }
.estate-t { margin: 0; font: 500 18px/1.25 var(--display); letter-spacing: -0.006em; color: var(--ink); }
.estate-l { margin: 8px 0 0; color: var(--ink-2); max-width: 60ch; }
.estate-a { margin-top: 16px; }
/* the expand row: a one line summary, the rest on demand */
.xrow { border-top: 1px solid var(--line); }
.xrow > .xrow-s { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--row); padding: 8px 0; cursor: pointer; }
.xrow > .xrow-s::-webkit-details-marker { display: none; }
.xrow > .xrow-s::marker { content: ""; }
.xrow-l { font: 500 15px/1.3 var(--display); color: var(--ink); }
.xrow-h { font-size: 13px; color: var(--muted); white-space: nowrap; }
.xrow-b { padding: 0 0 16px; }
/* How to set this: the exact command, closed until asked for */
.howto { margin-top: 8px; }
.howto > .howto-s { list-style: none; display: inline-flex; align-items: center; min-height: 28px; cursor: pointer;
  font-size: 13px; color: var(--accent-ink); }
.howto > .howto-s::-webkit-details-marker { display: none; }
.howto > .howto-s::marker { content: ""; }
.howto-b { margin-top: 8px; }
.howto-n { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.howto-c { display: block; padding: 8px 12px; background: var(--sunk); border-radius: var(--r-s); font: 400 13px/1.5 var(--mono);
  color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.jcard-note { color: var(--muted); }
.jcard-src { margin-top: 8px; }
/* end Clean: shared */
