/* Precedent. The look of the Case Synthesis Workbench (a law-library study desk: paper, white sheets, a deep docket
   teal, and highlighter colors for facts / issue / holding / reasoning / dicta), as an app with a step sidebar. */
:root {
  --paper: #F2F4F6; --sheet: #FFFFFF; --ink: #16212C; --muted: #56636F; --line: #D3DAE1; --line-strong: #B9C3CC;
  --docket: #0E5A6A; --docket-ink: #FFFFFF; --docket-soft: #DCEBEE;
  --hl-fact: rgba(255, 213, 46, .55); --hl-issue: rgba(170, 140, 255, .40); --hl-hold: rgba(70, 190, 235, .42);
  --hl-reason: rgba(255, 120, 170, .38); --hl-dicta: rgba(140, 150, 160, .30);
  --good: #1D7F48; --good-soft: #DDF1E4; --bad: #B83A32; --bad-soft: #F8E0DD; --warn: #9A6412; --warn-soft: #F6EBD7;
  --yes: #B83A32; --yes-soft: #F8E0DD; --no: #1D7F48; --no-soft: #DDF1E4;
  --shadow: 0 1px 2px rgba(22,33,44,.06), 0 6px 18px rgba(22,33,44,.06);
  --f-display: "Iowan Old Style", "Palatino Linotype", Palatino, "P052", "TeX Gyre Pagella", "URW Palladio L", Georgia, serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Ubuntu, Cantarell, "Noto Sans", Roboto, "Helvetica Neue", sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, "DejaVu Sans Mono", "Ubuntu Mono", Consolas, monospace;
  --f-paper: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", "Nimbus Roman No9 L", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E151C; --sheet: #16202A; --ink: #E5ECF2; --muted: #9AA8B4; --line: #2B3946; --line-strong: #3C4D5D;
    --docket: #5BB8C9; --docket-ink: #06141A; --docket-soft: #17323A;
    --hl-fact: rgba(255, 213, 46, .32); --hl-issue: rgba(170, 140, 255, .32); --hl-hold: rgba(70, 190, 235, .32);
    --hl-reason: rgba(255, 120, 170, .30); --hl-dicta: rgba(160, 170, 180, .25);
    --good: #5CC98A; --good-soft: #15301F; --bad: #F08A80; --bad-soft: #3A1C1A; --warn: #E2B060; --warn-soft: #33270F;
    --yes: #F08A80; --yes-soft: #3A1C1A; --no: #5CC98A; --no-soft: #15301F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E151C; --sheet: #16202A; --ink: #E5ECF2; --muted: #9AA8B4; --line: #2B3946; --line-strong: #3C4D5D;
  --docket: #5BB8C9; --docket-ink: #06141A; --docket-soft: #17323A;
  --hl-fact: rgba(255, 213, 46, .32); --hl-issue: rgba(170, 140, 255, .32); --hl-hold: rgba(70, 190, 235, .32);
  --hl-reason: rgba(255, 120, 170, .30); --hl-dicta: rgba(160, 170, 180, .25);
  --good: #5CC98A; --good-soft: #15301F; --bad: #F08A80; --bad-soft: #3A1C1A; --warn: #E2B060; --warn-soft: #33270F;
  --yes: #F08A80; --yes-soft: #3A1C1A; --no: #5CC98A; --no-soft: #15301F;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15.5px; line-height: 1.55; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; line-height: 1.18; margin: 0; text-wrap: balance; }
h1 { font-size: 2.1rem; } h2 { font-size: 1.65rem; } h3 { font-size: 1.25rem; } h4 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--docket); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--docket); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--f-mono); font-size: .86em; }
.eyebrow { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.note { font-size: .88rem; color: var(--muted); }
.cite { font-family: var(--f-mono); font-size: .78rem; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; align-content: start; }
.grow { flex: 1 1 auto; min-width: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--paper);
  padding: 18px 14px 24px; display: grid; gap: 14px; align-content: start; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand span { font-family: var(--f-display); font-size: 1.35rem; }
.side .ptitle { font-weight: 650; line-height: 1.3; font-size: .95rem; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a { display: grid; grid-template-columns: 1.6em 1fr auto; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 7px;
  color: var(--muted); text-decoration: none; font-size: .92rem; line-height: 1.25; }
.nav a:hover { background: var(--sheet); color: var(--ink); }
.nav a.on { background: var(--docket-soft); color: var(--ink); font-weight: 600; }
.nav .n { font-family: var(--f-mono); font-size: .78rem; text-align: center; }
.nav .sub a { padding-left: 26px; font-size: .86rem; }
.state { width: 1.1em; height: 1.1em; display: inline-grid; place-items: center; border-radius: 50%; font-size: .7rem; font-weight: 700; }
.state.done { background: var(--good); color: var(--sheet); }
.state.partial { background: var(--warn-soft); color: var(--warn); border: 1.5px solid var(--warn); }
.state.todo { border: 1.5px solid var(--line-strong); }
.side .group { display: grid; gap: 4px; }
.side .grouphead { padding: 0 8px; }
.side .foot { display: grid; gap: 6px; font-size: .84rem; }
main { min-width: 0; padding: 22px max(20px, 3vw) 80px; }
.page { max-width: 1120px; margin: 0 auto; display: grid; gap: 22px; }
.topbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.saved { font-size: .82rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.saved::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.saved.busy::before { background: var(--warn); }
.saved.err { color: var(--bad); font-weight: 600; } .saved.err::before { background: var(--bad); }
.topnav, .scrim { display: none; }
/* A phone or an iPad: a bar at the top, and the whole sidebar (every step, case and link) as a menu that slides in. */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topnav { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 8px 16px;
    padding-top: max(8px, env(safe-area-inset-top)); background: var(--paper); border-bottom: 1px solid var(--line); }
  .tn-where { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
  .tn-where strong, .tn-where .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(320px, 86vw); height: auto; transform: translateX(-105%);
    transition: transform .2s ease; box-shadow: var(--shadow); padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }
  .menu-open .side { transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); }
  main { padding: 16px 16px 64px; padding-bottom: max(64px, env(safe-area-inset-bottom)); }
  .nav a { padding: 9px 8px; }                 /* (room for a finger) */
}

/* ---------- shared components ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.sheet.tight { padding: 14px; }
.btn { border: 1px solid var(--docket); background: var(--docket); color: var(--docket-ink); padding: 8px 15px; border-radius: 8px;
  cursor: pointer; font-weight: 600; font-size: .92rem; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; line-height: 1.3; }
.btn.ghost { background: transparent; color: var(--docket); }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn.small { padding: 4px 10px; font-size: .84rem; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: 1px solid transparent; background: transparent; border-radius: 6px; cursor: pointer; padding: 2px 7px; color: var(--muted); line-height: 1.4; }
.iconbtn:hover { border-color: var(--line); color: var(--ink); background: var(--paper); }
.callout { border-left: 4px solid var(--docket); background: var(--docket-soft); padding: 12px 16px; border-radius: 0 10px 10px 0; display: grid; gap: 4px; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.badge.yes { background: var(--yes-soft); color: var(--yes); }
.badge.no { background: var(--no-soft); color: var(--no); }
.badge.none { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.badge.teal { background: var(--docket-soft); color: var(--docket); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.chipline { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: .74rem; line-height: 1.25; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line); background: var(--sheet); }
.tag.k { background: var(--hl-fact); border-color: transparent; }
.tag.c { background: var(--hl-hold); border-color: transparent; }
.tag.x { opacity: .5; text-decoration: line-through; }
.hl-fact { background: linear-gradient(transparent 10%, var(--hl-fact) 10%, var(--hl-fact) 92%, transparent 92%); }
.hl-issue { background: linear-gradient(transparent 10%, var(--hl-issue) 10%, var(--hl-issue) 92%, transparent 92%); }
.hl-hold { background: linear-gradient(transparent 10%, var(--hl-hold) 10%, var(--hl-hold) 92%, transparent 92%); }
.hl-reason { background: linear-gradient(transparent 10%, var(--hl-reason) 10%, var(--hl-reason) 92%, transparent 92%); }
.hl-dicta { background: linear-gradient(transparent 10%, var(--hl-dicta) 10%, var(--hl-dicta) 92%, transparent 92%); }
.check { color: var(--good); font-weight: 700; } .cross { color: var(--bad); font-weight: 700; }
.scroll-x { overflow-x: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: var(--sheet); flex-wrap: wrap; justify-self: start; align-self: start; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--docket); color: var(--docket-ink); }
.seg.yesno button[aria-pressed="true"][data-v="yes"] { background: var(--yes); color: var(--sheet); }
.seg.yesno button[aria-pressed="true"][data-v="no"] { background: var(--no); color: var(--sheet); }
.toggle { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--docket); }

/* forms */
label.f { display: grid; gap: 4px; font-size: .86rem; font-weight: 600; color: var(--muted); min-width: 0; }
label.f > span.h { font-weight: 400; }
input[type=text], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--line-strong); background: var(--sheet); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; color: var(--ink); font-weight: 400; }
textarea { resize: vertical; min-height: 4.2em; line-height: 1.5; }
textarea.big { min-height: 9em; font-size: 1rem; }
textarea.paper { font-family: var(--f-paper); font-size: 1.06rem; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--docket); outline-offset: 0; border-color: var(--docket); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fields .wide { grid-column: 1 / -1; }
.counter { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); }

/* ---------- checks ---------- */
.checks { display: grid; gap: 6px; }
.checks .c { display: grid; grid-template-columns: 1.4em 1fr; gap: 6px; padding: 7px 10px; border-radius: 8px; font-size: .9rem; line-height: 1.4; }
.checks .c.ok { background: var(--good-soft); } .checks .c.ok b { color: var(--good); }
.checks .c.tip { background: var(--paper); border: 1px solid var(--line); } .checks .c.tip b { color: var(--docket); }
.checks .c.warn { background: var(--warn-soft); } .checks .c.warn b { color: var(--warn); }
.checks .c.miss { background: var(--bad-soft); } .checks .c.miss b { color: var(--bad); }

/* ---------- home ---------- */
.hero { display: grid; gap: 10px; padding: 8px 0 4px; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.7rem); max-width: 22ch; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 58%, var(--hl-hold) 58%, var(--hl-hold) 92%, transparent 92%); }
.hero .lede { font-size: 1.08rem; color: var(--muted); max-width: 66ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pcard { display: grid; gap: 8px; align-content: start; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .2s; }
.pcard .continue { font-size: .86rem; font-weight: 600; color: var(--docket); }
.backlink, .linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--docket); cursor: pointer; text-align: left; }
.backlink { display: block; min-width: 0; margin-top: -6px; font-size: .86rem; }
.backlink span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* (clipped inside: a clipped grid item can shrink to nothing) */
.linkbtn { font-size: .88rem; font-weight: 600; }
.backlink:hover, .linkbtn:hover { text-decoration: underline; }
.ex .linkbtn { margin-top: 6px; }
.runners { display: grid; gap: 6px; }
.runner { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.runner:has(input:checked) { border-color: var(--docket); background: var(--docket-soft); }
.runner input { margin-top: 3px; accent-color: var(--docket); }
.runner.dim strong { color: var(--muted); }
.exbanner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; max-width: 1120px;
  margin: -6px auto 18px; padding: 10px 16px; border: 1px solid var(--docket); border-radius: 10px; background: var(--docket-soft); font-size: .92rem; }
.pcard:hover { border-color: var(--docket); }
.pcard h3 { font-size: 1.15rem; }
.pcardbox { position: relative; display: grid; }
.pcardbox > .pcard { padding-bottom: 46px; }
.pnew { position: absolute; right: 12px; bottom: 12px; font: inherit; font-size: .82rem; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--sheet); color: var(--muted); cursor: pointer; }
.pnew:hover, .pnew:focus-visible { border-color: var(--docket); color: var(--docket); }

/* ---------- several windows ---------- */
.alsoopen, .clashes { max-width: 1120px; margin: -6px auto 18px; padding: 10px 16px; border-radius: 10px; font-size: .92rem;
  display: grid; gap: 6px; }
.alsoopen { border: 1px solid var(--docket); background: var(--docket-soft); }
.clashes { border: 1px solid var(--warn); background: var(--warn-soft); }
.clashes ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.clashes li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }

/* ---------- case shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.casecard { background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 7px; align-content: start;
  box-shadow: var(--shadow); min-width: 0; text-decoration: none; color: inherit; }
a.casecard:hover { border-color: var(--docket); }
.casecard .letter { font-family: var(--f-display); font-size: 1.7rem; line-height: 1; }
.casecard .name { font-weight: 600; font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.flag { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 1px; }
.flag.good { background: var(--good); } .flag.caution { background: #D9A400; } .flag.bad { background: var(--bad); } .flag.unchecked { border: 1.5px solid var(--line-strong); }

/* ---------- step page ---------- */
.stephead { display: grid; gap: 6px; }
.stephead .eyebrow::before { content: "§ "; }
.lead { max-width: 70ch; color: var(--ink); }
div.lead { display: grid; gap: 8px; }
.guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.guide > div { padding: 10px 13px; border-radius: 9px; background: var(--sheet); border: 1px solid var(--line); font-size: .92rem; display: grid; gap: 4px; align-content: start; }
.guide > div.trap { background: var(--warn-soft); border-color: transparent; }
.guide > div.ex { border: 1px dashed var(--docket); background: var(--paper); }
.guide ul { margin: 0; padding-left: 1.1em; display: grid; gap: 3px; }
details.more > summary { cursor: pointer; color: var(--docket); font-weight: 600; font-size: .9rem; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; } details.more[open] > summary::before { content: "▾ "; }
.twocol { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .twocol { grid-template-columns: minmax(0, 1fr); } }
.stepnav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }

/* step 1: cases */
.caselist { display: grid; gap: 10px; }
.caseedit { display: grid; gap: 12px; }
.caseedit > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.caseedit > summary::-webkit-details-marker { display: none; }
.caseedit .bigletter { font-family: var(--f-display); font-size: 1.6rem; text-align: center; }
.ladder { display: grid; gap: 8px; }
.rung { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; align-items: center; padding: 9px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--sheet); }
.rung .w { font-family: var(--f-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.rung.strong { border-color: var(--docket); background: var(--docket-soft); }
@media (max-width: 560px) { .rung { grid-template-columns: 1fr; gap: 2px; } }
.casechip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px 2px 3px; background: var(--sheet); font-size: .84rem; margin: 2px; }
.casechip .l { width: 1.6em; height: 1.6em; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .78rem; color: var(--sheet); background: var(--muted); }
.casechip .l.yes { background: var(--yes); } .casechip .l.no { background: var(--no); }
/* which cases are in the synthesis: one tick each, on every step */
.casebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--sheet); }
.casebar .eyebrow { margin-right: 4px; }
.incase { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px;
  padding: 3px 10px 3px 4px; background: var(--paper); font: inherit; font-size: .84rem; color: var(--ink); cursor: pointer; }
.incase:hover { border-color: var(--docket); }
.incase:focus-visible { outline: 2px solid var(--docket); outline-offset: 2px; }
.incase .box { width: 1.15em; height: 1.15em; border: 1.5px solid var(--line-strong); border-radius: 4px; display: inline-grid;
  place-items: center; font-size: .78rem; font-weight: 800; line-height: 1; color: var(--docket-ink); }
.incase.on .box { background: var(--docket); border-color: var(--docket); }
.incase .l { width: 1.5em; height: 1.5em; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700;
  font-size: .74rem; color: var(--sheet); background: var(--muted); }
.incase .l.yes { background: var(--yes); } .incase .l.no { background: var(--no); }
.incase.off { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.incase.off .l { opacity: .45; }
.changenote ul { margin: 2px 0 0; padding-left: 1.2em; }
.changenote .linkbtn { justify-self: start; }
.aside { opacity: .42; }
.matrix th.aside, .matrix td.aside { opacity: .35; }
.nav a.aside .t { text-decoration: line-through; text-decoration-color: var(--line-strong); }
svg.vis { width: 100%; height: auto; display: block; }
svg.vis text { font-family: var(--f-body); }

/* step 2: brief */
.briefgrid { display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(0, .95fr); gap: 16px; align-items: start; }
@media (max-width: 1250px) { .briefgrid { grid-template-columns: 200px minmax(0, 1fr); } .briefgrid .previewcol { grid-column: 1 / -1; } }
@media (max-width: 760px) { .briefgrid { grid-template-columns: minmax(0, 1fr); } }
.secnav { display: grid; gap: 4px; position: sticky; top: 12px; }
.secnav a { display: grid; grid-template-columns: 1.3em 1fr; gap: 6px; align-items: center; padding: 6px 9px; border-radius: 7px; text-decoration: none; color: var(--muted); font-size: .88rem; line-height: 1.25; border: 1px solid transparent; }
.secnav a:hover { background: var(--sheet); color: var(--ink); }
.secnav a.on { background: var(--sheet); border-color: var(--docket); color: var(--ink); font-weight: 600; }
.paperpage { background: #FFFFFF; color: #111; font-family: var(--f-paper); font-size: 12.5px; line-height: 1.32; padding: 34px 40px; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 10px 30px rgba(0,0,0,.10); min-height: 400px; position: sticky; top: 12px; max-height: calc(100vh - 40px); overflow-y: auto; }
.paperpage p { margin: 0 0 1.32em; }
.paperpage p.tight { margin: 0; }
.paperpage .cur { background: rgba(14, 90, 106, .10); outline: 2px solid rgba(14, 90, 106, .25); border-radius: 2px; }
.paperpage .todo { color: #B83A32; font-style: italic; }
.pagecount { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); }
.wordcount { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }
.wlimit { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.wlimit input[type=number] { width: 6.5em; padding: 4px 8px; }
.opinion { font-family: var(--f-paper); font-size: 1.04rem; line-height: 1.75; white-space: pre-wrap; max-height: 70vh; overflow-y: auto; padding: 18px 20px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; }
.opinion mark { color: inherit; border-radius: 2px; cursor: pointer; }   /* (its color comes from .hl-…: no background reset here) */
.hlbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hlbtn { border: 1px solid var(--line); background: var(--sheet); border-radius: 99px; padding: 5px 12px 5px 7px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; font-size: .88rem; }
.hlbtn .sw { width: 18px; height: 12px; border-radius: 3px; }
.hlbtn:hover { border-color: var(--ink); }
.marks { display: grid; gap: 6px; }
.marks .m { font-family: var(--f-paper); font-size: .98rem; padding: 6px 10px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); }

/* step 3: chart */
table.matrix { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.matrix th, table.matrix td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
table.matrix th:first-child, table.matrix td:first-child { text-align: left; }
table.matrix thead th { font-weight: 600; font-size: .8rem; color: var(--muted); vertical-align: bottom; }
table.matrix thead th .l { font-family: var(--f-display); font-size: 1.15rem; color: var(--ink); display: block; }
table.matrix tfoot td { font-weight: 600; }
table.matrix td.factlabel { min-width: 330px; }
table.matrix td.factlabel input { border-color: transparent; background: transparent; padding: 4px 6px; }
table.matrix td.factlabel input:hover { border-color: var(--line); }
table.matrix td.factlabel input:focus { background: var(--sheet); }
table.matrix .client { background: color-mix(in srgb, var(--docket-soft) 55%, transparent); }
.cell { width: 32px; height: 32px; border-radius: 8px; border: 1px dashed var(--line-strong); background: transparent; cursor: pointer; display: inline-grid; place-items: center; }
.cell:hover { border-color: var(--docket); }
.cell.on { border-style: solid; border-color: transparent; }
.cell.on::after { content: ""; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); }
.cell.on.yes::after { background: var(--yes); } .cell.on.no::after { background: var(--no); } .cell.on.cl::after { background: var(--docket); }
table.matrix tr.in-e0 td:first-child { background: linear-gradient(90deg, var(--hl-fact), transparent); }
table.matrix tr.in-e1 td:first-child { background: linear-gradient(90deg, var(--hl-hold), transparent); }
table.matrix tr.in-e2 td:first-child { background: linear-gradient(90deg, var(--hl-reason), transparent); }
table.matrix tr.in-e3 td:first-child { background: linear-gradient(90deg, var(--hl-issue), transparent); }
table.matrix tr.in-e4 td:first-child { background: linear-gradient(90deg, var(--hl-dicta), transparent); }
table.matrix tr.noise td:first-child input, table.matrix tr.noise td:first-child .lbl { text-decoration: line-through; color: var(--muted); }

/* step 4: separation */
.sep { display: grid; gap: 8px; }
.seprow { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr) auto; gap: 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); }
@media (max-width: 760px) { .seprow { grid-template-columns: minmax(0, 1fr); } }
.sepbar { display: grid; grid-template-columns: 1fr 2px 1fr; align-items: center; gap: 0; height: 26px; }
.sepbar .lft { display: flex; justify-content: flex-end; gap: 3px; padding-right: 6px; }
.sepbar .rgt { display: flex; gap: 3px; padding-left: 6px; }
.sepbar .mid { background: var(--line-strong); height: 26px; }
.sepbar .pill { min-width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: .74rem; font-weight: 700; color: var(--sheet); }
.sepbar .pill.yes { background: var(--yes); } .sepbar .pill.no { background: var(--no); }
.kindnote { font-size: .8rem; color: var(--muted); }
.kindnote.strong { color: var(--docket); font-weight: 600; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pair { display: grid; gap: 8px; border: 2px solid var(--docket); background: var(--docket-soft); border-radius: 12px; padding: 13px; }
.pair .vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; text-align: center; font-size: .86rem; }

/* step 5: rule lab, shapes */
.shapes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.shape { text-align: left; cursor: pointer; display: grid; gap: 6px; align-content: start; border: 2px solid var(--line); }
.shape[aria-pressed="true"] { border-color: var(--docket); background: var(--docket-soft); }
.shape svg { width: 100%; height: auto; }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.bin { border: 2px dashed var(--line); border-radius: 12px; padding: 11px; display: grid; gap: 7px; align-content: start; min-height: 120px; background: var(--sheet); }
.bin.e { border-color: color-mix(in srgb, var(--docket) 55%, var(--line)); }
.bin .head { display: flex; gap: 6px; align-items: center; }
.bin .head input { font-weight: 600; }
.bin .join { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 7px 9px; cursor: pointer; text-align: left; font-size: .87rem; line-height: 1.3;
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.chip:hover { border-color: var(--docket); }
.chip .move { font-family: var(--f-mono); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.chip.noise .t { text-decoration: line-through; color: var(--muted); }
.formula { font-family: var(--f-mono); font-size: .86rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; overflow-wrap: anywhere; }
.verdict { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.verdict.win { background: var(--good-soft); border-color: var(--good); }
.verdict .big { font-family: var(--f-display); font-size: 1.8rem; }
.phrases { display: grid; gap: 6px; }
.phrase { text-align: left; font-family: var(--f-paper); font-size: .96rem; padding: 7px 11px; border-left: 3px solid var(--docket); background: var(--paper); border-radius: 0 6px 6px 0; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; }
.phrase:hover { background: var(--docket-soft); }

/* step 6: flow */
.flow { display: grid; gap: 0; }
.flowstep { display: grid; grid-template-columns: 32px 1fr; gap: 12px; position: relative; padding-bottom: 14px; }
.flowstep:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.flowstep .q { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--docket); color: var(--docket-ink); font-family: var(--f-mono); font-size: .82rem; }
.flowstep > div { display: grid; gap: 4px; }

/* step 7 */
.elcard { display: grid; gap: 10px; }
.met { font-weight: 700; } .met.y { color: var(--good); } .met.n { color: var(--bad); }
.simbar { display: grid; grid-template-columns: 9em 1fr 3em; gap: 8px; align-items: center; font-size: .86rem; }
.simbar .bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.simbar .bar span { display: block; height: 100%; background: var(--docket); }

/* model panel */
.assist { border: 1px solid var(--docket); border-radius: 12px; background: var(--sheet); display: grid; gap: 10px; padding: 14px; }
.assist.off { border-style: dashed; border-color: var(--line-strong); }
.assist .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.assist .out { font-size: .94rem; line-height: 1.55; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; max-height: 460px; overflow-y: auto; white-space: normal; }
.assist .out ul { margin: 4px 0; padding-left: 1.2em; }
.assist .out p { margin: 0 0 8px; }
.assist .q { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.quotes { display: grid; gap: 4px; font-size: .84rem; }
.quotes .y { color: var(--good); } .quotes .n { color: var(--bad); font-weight: 600; }
.cursor::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--docket); }
@keyframes blink { 50% { opacity: 0; } }

/* settings */
.layoutrow { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); }
.servers { display: grid; gap: 8px; }
.server { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.dot.on { background: var(--good); }

/* checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist label { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--sheet); cursor: pointer; }
.checklist input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--docket); }
.checklist label:has(input:checked) span { color: var(--muted); text-decoration: line-through; }
.org { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 680px) { .org { grid-template-columns: minmax(0, 1fr); } }

/* toast + modal */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow); z-index: 50; max-width: min(90vw, 560px); }
.toast.err { background: var(--bad); color: #fff; }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--sheet); color: var(--ink); padding: 22px; max-width: min(92vw, 560px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 20, 28, .45); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 12px; }

/* memo: the parts in order */
.flowchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; }
.flowchips .fc { padding: 4px 10px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--paper); font-weight: 600; }
.flowchips .fc.disc { background: var(--hl-hold); border-color: transparent; }
.flowchips .fc.on { background: var(--docket); color: var(--docket-ink); border-color: var(--docket); }
.flowchips .arr { color: var(--muted); }

/* authority, citations, review */
.badge.wt.teal { background: var(--docket); color: var(--docket-ink); }
.badge.wt.teal.soft { background: var(--docket-soft); color: var(--docket); }
.citehelp { gap: 6px; }
.citeline { display: grid; grid-template-columns: 3.4em 1fr auto; gap: 8px; align-items: center; font-family: var(--f-paper); font-size: .98rem; }
.citeline .eyebrow { font-family: var(--f-mono); }
.diff { font-family: var(--f-paper); line-height: 1.6; white-space: pre-wrap; }
ins { background: var(--good-soft); color: inherit; text-decoration: none; border-bottom: 2px solid var(--good); }
del { background: var(--bad-soft); color: var(--muted); }
.side form input[type=search] { padding: 6px 9px; font-size: .86rem; }

/* sync between your computers */
.pairbox { border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px 18px; display: grid; gap: 10px; background: var(--sheet); justify-items: start; }
.pairbox form { justify-self: stretch; }
.bigcode { font-variant-numeric: tabular-nums; font-size: 2.6rem; font-weight: 700; letter-spacing: .14em; color: var(--ink); line-height: 1.1; }
.peerlist { display: grid; gap: 6px; justify-self: stretch; }
.syncline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.syncline::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.syncline.ok::before { background: var(--good); }
.syncline.warn { color: var(--warn); }
.syncline.warn::before { background: var(--warn); }
.syncline.off::before { display: none; }
.callout.good { border-color: var(--good); background: var(--good-soft); }

/* Find & extract */
.fx-hold { --fx: var(--hl-hold); } .fx-reason { --fx: var(--hl-reason); } .fx-facts { --fx: var(--hl-fact); }
.fx-issue { --fx: var(--hl-issue); } .fx-dicta { --fx: var(--hl-dicta); } .fx-cases { --fx: rgba(40, 170, 150, .38); }
.fx-policy { --fx: rgba(120, 190, 70, .40); } .fx-disp { --fx: rgba(245, 150, 60, .42); } .fx-sep { --fx: rgba(170, 120, 80, .38); }
.fx-custom { --fx: rgba(200, 200, 60, .45); }
.finder mark { background: var(--fx); color: inherit; border-radius: 2px; padding: 0 1px; }
.fxdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--fx); border: 1px solid var(--line-strong); flex: none; }
.fxtag { display: inline-flex; gap: 5px; align-items: center; font-size: .78rem; color: var(--muted); }
.fword { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--line); background: var(--sheet); color: var(--muted);
  border-radius: 999px; padding: 2px 10px; font-size: .84rem; cursor: pointer; font: inherit; font-size: .84rem; }
.fword.common { border-style: dashed; }
.fword[aria-pressed="true"], .fword.on { background: var(--docket-soft); border-color: var(--docket); color: var(--ink); }
.fword .iconbtn { padding: 0 2px; }
.fgroup { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.passage { display: grid; gap: 8px; }
.passage.saved-p { border-color: var(--docket); }
.sents { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sent { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; padding: 4px 6px; border-radius: 6px;
  font-family: var(--f-paper); font-size: 1.04rem; line-height: 1.5; }
.sent input { width: 17px; height: 17px; margin-top: 4px; accent-color: var(--docket); cursor: pointer; }
.sent.hit { background: var(--paper); }
.sent.keep { background: var(--good-soft); }
.sent.cross .t { text-decoration: line-through; color: var(--muted); }
.sent .strike { font-family: var(--f-body); }
@media (max-width: 640px) { .sent { font-size: 1rem; } }
.sent .strike { font-size: .76rem; color: var(--muted); white-space: nowrap; opacity: .55; }
.sent:hover .strike, .sent.cross .strike, .sent .strike:focus-visible { opacity: 1; }
@media (hover: none) { .sent .strike { opacity: 1; } }
/* where a passage is in the opinion */
.fwhere { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: var(--paper); }
.fsec { font-family: var(--f-paper); font-size: .98rem; color: var(--ink); }
.fwhy { flex-basis: 100%; }
.passage.role-editorial { border-color: var(--warn); }
.passage.role-dissent, .passage.role-concurrence { border-style: dashed; }
.sent.br { margin-top: 10px; }
.sent.br::before { content: "¶"; position: absolute; margin-left: -14px; color: var(--muted); font-family: var(--f-paper); }
.sent { position: relative; }
.sent.rest { color: var(--muted); font-style: italic; }
.fpart { list-style: none; margin: 10px 0 2px; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* citations */
.fciteline { display: grid; gap: 2px; font-size: .95rem; padding: 4px 6px; }
.fciteline .warnline { color: var(--warn); }
.fauth { margin: 0; }
.fcite summary { font-size: .88rem; }
/* hosted: signing in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin .sheet { width: min(440px, 100%); }
/* ticked sentences, flowing on (flow.js) */
.keptpanel { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 12px; background: var(--sheet); }
.keptitem { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line); }
.keptitem:first-child { border-top: 0; }
.keptitem .kt { font-family: var(--f-paper); font-size: 1.02rem; }
