/* law2 — "registry" design system.
   Subject: Indian litigation practice. Palette from the registry: ink (the
   blue-black of registry stamps and nameplates), ledger paper, and red tape
   (lal fita) used only as a structural mark. Mukta (Ek Type, an Indian foundry;
   Devanagari-ready) for the interface, Literata for reading judgments.
   One bold device: case numbers set as registry stamps. Everything else quiet.
   Self-hosted fonts only (strict CSP: font-src 'self'). */

@font-face { font-family: "Mukta"; font-weight: 400; font-style: normal; font-display: swap; src: url("/app/fonts/mukta-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Mukta"; font-weight: 500; font-style: normal; font-display: swap; src: url("/app/fonts/mukta-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Mukta"; font-weight: 600; font-style: normal; font-display: swap; src: url("/app/fonts/mukta-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Mukta"; font-weight: 700; font-style: normal; font-display: swap; src: url("/app/fonts/mukta-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-weight: 400; font-style: normal; font-display: swap; src: url("/app/fonts/literata-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-weight: 400; font-style: italic; font-display: swap; src: url("/app/fonts/literata-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-weight: 600; font-style: normal; font-display: swap; src: url("/app/fonts/literata-latin-600-normal.woff2") format("woff2"); }

:root {
  --ink: #1f2b45;          /* registry ink: headings, stamps, sidebar */
  --ink-soft: #2d3a57;
  --text: #283042;         /* body */
  --muted: #667085;
  --faint: #646c7c;        /* text: >= 4.8:1 on surface and paper (WCAG 2.2 AA); was #98a0ad, 2.64:1 */
  --paper: #f3f5f1;        /* ledger paper: app background */
  --surface: #ffffff;
  --rule: #dfe3dc;         /* hairlines, faintly green like ledger rules */
  --rule-2: #c8cfc5;
  --tape: #b42335;         /* lal fita: structural mark only, never text colour */
  --brass: #efe2b5;        /* search-term highlight */
  --link: #2c4a8c;
  --ok: #2e6b4f;  --ok-bg: #e6f1ea;
  --bad: #8e3b2e; --bad-bg: #f6e8e4;
  --warn: #85601a; --warn-bg: #f5eedb;
  --info: #3b5078; --info-bg: #e8ecf4;
  --neutral-bg: #eef0ec;
  --r: 8px; --r-sm: 5px;
  /* spacing scale (4/8/12/16/24/32) and type scale; new rules use these, old literals move over as files are touched */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --fs-sm: 14px; --fs-base: 16px; --fs-lg: 18px; --fs-xl: 22px;
  /* vertical rhythm: 4 tight (inside a component) · 8 related · 12 title→content, paragraph→paragraph · 16 block→block (cards, tables, notes)
     · 24 section→section and card/page padding · 32 page side padding. Every margin below is one of these. */
  --measure: 72ch;      /* longest comfortable line of prose */
  --form-w: 720px;      /* widest a form column grows: longer inputs read worse, not better */
  --sans: "Mukta", "Segoe UI", system-ui, sans-serif;
  --serif: "Literata", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #d9e0ef; --ink-soft: #c3cce0; --text: #d3d9e4; --muted: #939cad; --faint: #8a93a3;
    --paper: #151a22; --surface: #1c222c; --rule: #2a313c; --rule-2: #38414e;
    --brass: #5a4c22; --link: #9db6ee;
    --ok: #7fc7a1; --ok-bg: #1b3027; --bad: #e79a8b; --bad-bg: #36201c; --warn: #e2bf73; --warn-bg: #332a15;
    --info: #a9b9dc; --info-bg: #222b3d; --neutral-bg: #252c36;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 var(--fs-base)/1.6 var(--sans); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums; }
p { margin: var(--s3) 0; }
ul, ol { margin: var(--s3) 0; }
:is(p, ul, ol):first-child { margin-top: 0; }
:is(p, ul, ol):last-child { margin-bottom: 0; }
a { color: var(--link); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.3; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: 20px; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: 15px; font-weight: 600; color: var(--ink-soft); margin: 0 0 var(--s3); line-height: 1.35; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; }
.spacer { flex: 1; }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin: var(--s4) 0; }
/* a row, note or group with nothing visible in it takes no space */
.row:not(:has(> :not([hidden]))), .facets:empty, .hint:empty, .note:empty { display: none; }
.row.center { justify-content: center; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- shell ---- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex: none; background: var(--ink); color: #c9d2e6; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 20px 0; }
@media (prefers-color-scheme: dark) { .sidebar { background: #10151d; border-right: 1px solid var(--rule); } }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.01em; color: #fff; padding: 0 24px 24px; }
.brand .mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--tape); color: #fff; }
.brand .mark svg.logo { width: 19px; height: 19px; }
.brand.big { color: var(--ink); font-size: 24px; padding: 0 0 16px; }
.brand.big .mark { width: 38px; height: 38px; }
.brand.big .mark svg.logo { width: 24px; height: 24px; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: var(--s3); line-height: 1.3; padding: 10px 24px; color: #c9d2e6;
  font-weight: 500; text-decoration: none; }
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar nav a.on { color: #fff; background: rgba(255,255,255,.07); }
.sidebar nav a.on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; background: var(--tape); }
.count { margin-left: auto; min-width: 22px; text-align: center; background: var(--tape); color: #fff; font-size: 12px;
  font-weight: 700; border-radius: 11px; padding: 0 7px; line-height: 20px; }
.side-foot { margin-top: auto; padding: 16px 24px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; color: #8e98b0; line-height: 1.5; }
.side-foot a { color: #c9d2e6; }
.side-foot p { margin: 8px 0 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s6); background: var(--surface);
  border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 5; }
.topbar .titles { display: flex; flex-direction: column; min-width: 0; }
.topbar h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (max-width: 860px) { .topbar h1 { font-size: 18px; } }
.subtitle { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user { color: var(--muted); font-size: 14px; }
.view { padding: var(--s5) var(--s6) 64px; max-width: 1280px; width: 100%; }

/* ---- controls ---- */
input, select, button { font: inherit; color: var(--text); }
input, select, textarea { font-size: var(--fs-base); }
input, select { height: 38px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: var(--r-sm); background: var(--surface); }
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23667085' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 9px center / 18px; }
input[type=date] { color: var(--text); }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }
button { height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--rule-2); background: var(--surface);
  cursor: pointer; font-weight: 500; white-space: nowrap; }
button:hover { border-color: var(--muted); }
/* Inside a card a long primary label wraps instead of widening the card (owner screenshot 2026-10-04); still 38px
   when it fits. Smaller buttons (small, chips, watch, copy) keep their own heights. */
.card button, .court-record button { max-width: 100%; }
.card button.primary:not(.small), .court-record button.primary:not(.small) { white-space: normal; height: auto;
  min-height: 38px; padding-top: 7px; padding-bottom: 7px; line-height: 1.3; }
button.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--ink-soft); }
@media (prefers-color-scheme: dark) { button.primary { color: #10151d; } }
button.ghost, button.secondary { background: transparent; }
button.small { height: 30px; padding: 0 11px; font-size: 13.5px; }
button.wide { width: 100%; }

/* ---- sign in ---- */
.auth { flex: 1; display: grid; place-items: center; padding: 40px 16px; min-height: 100vh; background: var(--paper); }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--tape);
  border-radius: var(--r); padding: 32px 32px 32px; }
.auth-card h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.25; margin-bottom: 8px; }
.auth-card form { display: grid; gap: 16px; margin-top: 24px; }
.auth-card label { display: grid; gap: 6px; color: var(--ink); font-weight: 500; }
.auth-card input { height: 42px; }
.auth-card button { height: 44px; margin-top: 6px; font-size: 15.5px; }

.auth-card .muted { margin-top: 0; }
.auth-card .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.auth-card .check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.auth-card .ghost.wide { margin-top: 16px; }
.auth-links { margin-top: 24px; font-size: 14px; color: var(--muted); }
.auth-note { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--rule); border-left: 4px solid var(--tape); border-radius: var(--r); }
.auth-note .ghost.wide { margin-top: 10px; }

/* ---- research ---- */
.scope-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--rule); margin-bottom: var(--s4); }
.scope-tabs button { height: auto; padding: 0 0 10px; border: 0; border-radius: 0; background: transparent; color: var(--muted);
  font-size: 15.5px; font-weight: 500; margin-bottom: -1px; border-bottom: 3px solid transparent; }
.scope-tabs button:hover { color: var(--ink); }
.scope-tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.searchbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
.searchbar .q { position: relative; }
.searchbar .q svg { position: absolute; left: 14px; top: 13px; color: var(--faint); }
.searchbar .q input { width: 100%; height: 46px; padding-left: 42px; font-size: 16px; }
.searchbar > button { height: 46px; padding: 0 26px; font-size: 15.5px; }
.filters { grid-column: 1 / -1; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { height: 34px; font-size: 14px; max-width: 100%; min-width: 0; }
.filters select { text-overflow: ellipsis; }  /* a long court name must not set the page width (390 px phones) */
.note { margin: var(--s4) 0 0; padding: 10px 16px; border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--rule)); border-radius: var(--r-sm); background: var(--warn-bg); color: var(--text); font-size: 14px; }

/* start screen: the next cause-list day */
.hero { margin-top: var(--s4); padding: var(--s5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.hero .when { font-family: var(--serif); font-size: 34px; line-height: 1.15; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.hero .what { margin: var(--s3) 0 0; font-size: 17px; color: var(--text); max-width: 62ch; }
.hero .what b { color: var(--ink); }
.hero .try { margin-top: var(--s5); display: grid; gap: var(--s3); }
.hero .try-row { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.hero .try-row .k { width: 110px; flex: none; color: var(--muted); font-size: 14px; }
.hero .held { margin: var(--s5) 0 0; padding-top: var(--s4); border-top: 1px solid var(--rule); font-size: 13.5px; color: var(--muted); max-width: 80ch; }
.hero .held + .held { margin-top: var(--s3); padding-top: 0; border-top: 0; }
.coverage, .landing:empty { display: none; }
.q-chip { background: none; border: 0; height: auto; padding: 0; color: var(--link); font-weight: 500; font-size: 15px; }
.q-chip:hover { text-decoration: underline; text-underline-offset: 2px; }

.facets { display: grid; gap: var(--s2); margin: var(--s4) 0 0; }
.facets .summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.facets .total { font-weight: 700; color: var(--ink); }
.fgroup { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fgroup .label { width: 90px; flex: none; margin: 0; font-size: 13.5px; color: var(--muted); }
.chip { height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--rule-2); background: var(--surface);
  color: var(--text); font-size: 13.5px; font-weight: 500; }
.chip .n { color: var(--faint); margin-left: 6px; font-weight: 400; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on .n { color: #c9d2e6; }
.chip.more { border-style: dashed; color: var(--muted); }
/* R48 v2: date chips beside the filters; view chips (with counts) and the CSV group under the search bar */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chips[hidden] { display: none; }
#recent-views { margin: var(--s4) 0 0; }
#recent-csv { margin: var(--s3) 0 0; }

/* ---- tables ---- */
.table-card { margin-top: var(--s4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--rule); background: var(--surface); }
td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
@media (hover: hover) { tbody tr.click:hover td { background: color-mix(in srgb, var(--paper) 70%, var(--surface)); } }
td.nowrap, #results td:first-child { white-space: nowrap; }
.sub { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
mark { background: var(--brass); color: inherit; border-radius: 2px; padding: 0 1px; }

/* the one bold device: a case number is a registry stamp */
.case { display: inline-block; padding: 1px 7px 0; border: 3px double var(--ink); border-radius: 3px; color: var(--ink);
  font-weight: 700; font-size: 13.5px; letter-spacing: .02em; line-height: 1.5; white-space: nowrap; }
.case a.ent { color: inherit; }
button.watch { height: 24px; padding: 0 8px; margin-left: 8px; font-size: 12.5px; vertical-align: middle; }
button.watch.on { border-color: transparent; background: transparent; color: var(--muted, #667); opacity: 1; cursor: default; }
@media (hover: hover) { .case a.ent:hover { color: var(--tape); text-decoration: none; } }
a.ent { color: inherit; text-decoration: none; }
a.ent:hover { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.list a.ent, .pill a.ent { color: var(--link); }

/* ---- outcome badges ---- */
.badge { display: inline-block; padding: 0 9px; border-radius: 11px; line-height: 22px; font-size: 13px; font-weight: 600;
  white-space: nowrap; background: var(--neutral-bg); color: var(--text); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.tag { display: inline-block; font-size: 13.5px; color: var(--muted); }
.tag::first-letter { text-transform: uppercase; }

/* ---- panels on main pages ---- */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 24px; margin-bottom: var(--s4); }
/* One edge treatment: the hairline. A card that opens something (.click) raises on hover by swapping the hairline for a
   shadow, so rest is flat and the lift always means "this is a link". Dark mode keeps the hairline (shadows vanish). */
.card.click { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
@media (hover: hover) { .card.click:hover { border-color: transparent; box-shadow: 0 1px 2px rgba(31,43,69,.10), 0 4px 14px rgba(31,43,69,.08); } }
@media (hover: hover) and (prefers-color-scheme: dark) { .card.click:hover { border-color: var(--rule-2); box-shadow: none; } }
/* title -> description -> content -> action: a card's own heading is its title, and its foot holds the one action */
.card > h3:first-child, .card > h4:first-child, .card-head h3, .card-head h4 { margin-bottom: var(--s3); }
.note + * { margin-top: var(--s4); }
.actions + * { margin-top: var(--s4); }
.view > h3, .view > h4 { margin: var(--s5) 0 var(--s3); }
.view > :is(h3, h4):first-child { margin-top: 0; }
.card-foot { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.card > p, .card-head p { max-width: var(--measure); }
.card-head { margin-bottom: var(--s4); }
.card-head p { margin: 4px 0 0; font-size: 14px; max-width: 70ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button.danger { color: var(--bad); }
button.danger:hover { border-color: var(--bad); }
button.icon { width: 38px; padding: 0; font-size: 20px; line-height: 1; color: var(--muted); background: transparent; }
button.icon:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .35; cursor: default; }

/* ---- watchlist ---- */
.qform { padding: 24px 24px; }
.field { display: grid; gap: 6px; color: var(--ink); font-weight: 500; font-size: 14px; }
.field input, .field select { width: 100%; font-weight: 400; }
.field-label { color: var(--ink); font-weight: 500; font-size: 14px; margin: 20px 0 6px; }
.qform-top { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
.conditions { display: grid; gap: 10px; }
.condition { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr) 38px; gap: 10px; align-items: center; }
.condition > input, .condition > select { width: 100%; min-width: 0; }
.condition > .wide { grid-column: span 2; }
.qform-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--rule); }
.list-head { display: flex; align-items: baseline; gap: var(--s3); margin: var(--s5) 0 0; }
.list-head + .table-card { margin-top: 12px; }
.queries td { vertical-align: middle; }
.queries .qname { font-weight: 600; color: var(--ink); }
.conds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cond { display: inline-flex; align-items: baseline; gap: 7px; padding: 3px 11px; border-radius: 14px; background: var(--paper);
  border: 1px solid var(--rule); font-size: 14px; }
.cond .k { color: var(--muted); font-size: 13px; }
.cond .rel { color: var(--muted); font-size: 13px; }
.join { color: var(--faint); font-size: 13px; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions button + button { margin-left: 8px; }
td .empty { padding: 16px 4px; }
.list-head.first { margin-top: 0; align-items: center; }
.alerts td { vertical-align: top; }
.alerts td.lead { width: 42%; }
.drawer-body .card > p { margin: 12px 0 0; max-width: 62ch; }
.alerts .qname, .queries .qname { font-weight: 600; color: var(--ink); }
.alerts tr.acked td { opacity: .6; }
.done { color: var(--ok); font-size: 13.5px; font-weight: 600; margin-left: 8px; }

/* ---- the case file (drawer) ---- */
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(680px, 100vw); overflow: auto; z-index: 20;
  background: var(--surface); border-left: 1px solid var(--rule); border-top: 4px solid var(--tape);
  box-shadow: -18px 0 40px rgba(31,43,69,.14); }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 12px; align-items: flex-start; padding: 24px 32px 16px;
  background: var(--surface); border-bottom: 1px solid var(--rule); }
.drawer-head .titles { flex: 1; min-width: 0; }
.drawer-head .kicker { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.drawer-head h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.drawer-head .muted { margin-top: 4px; font-size: 15px; }
.drawer-body { padding: 0 32px 48px; }
.drawer-body > * { margin: 0; padding: 24px 0; border-bottom: 1px solid var(--rule); }
.drawer-body > *:last-child { border-bottom: 0; }
.drawer-body > .card { background: none; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding: 24px 0; margin: 0; }
.drawer-body h4 { font-size: 15px; color: var(--ink); margin-bottom: 12px; }
.drawer-body > .table-card { border: 1px solid var(--rule); margin: 24px 0 0; padding: 0; }
.drawer-body > .caveat { padding: 16px 0 0; border: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--muted); font-size: 14px; margin-top: 12px; }
.meta b { color: var(--ink); font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-link { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14px; }
.btn-link:hover { text-decoration: none; border-color: var(--muted); }
.btn-link.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .btn-link.primary { color: #10151d; } }
.pills { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 11px; border-radius: 14px; background: var(--paper);
  border: 1px solid var(--rule); font-size: 14px; }
.pill .n { color: var(--faint); font-size: 13px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.list li:first-child { padding-top: 2px; }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list .when { color: var(--muted); font-size: 14px; margin-left: 10px; }
.list .badge { margin-left: 10px; }
.list .why { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 15px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.judgment-text { white-space: pre-wrap; font-family: var(--serif); font-size: 16px; line-height: 1.8; color: var(--text); max-width: 72ch; }
.lj-title { font-family: var(--serif); font-size: 17px; color: var(--ink); margin: 10px 0 2px; }
.caveat { font-size: 13.5px; color: var(--muted); max-width: 70ch; }
.empty h2 { font-size: 17px; margin-bottom: 8px; }
.empty p { margin: 8px 0 0; max-width: 62ch; }

/* ---- figures (authority pages, profiles) ---- */
.stats-row { display: flex; flex-wrap: wrap; }
.stat { flex: 1 1 130px; padding: 2px var(--s4) 2px 0; margin-right: var(--s4); border-right: 1px solid var(--rule); }
.stat:last-child { border-right: 0; margin-right: 0; }
.stat .v { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.stat .l { font-size: 14px; color: var(--muted); }
.dist { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--neutral-bg); margin: 4px 0 12px; }
.dist span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.c-ok { background: var(--ok); } .c-bad { background: var(--bad); } .c-warn { background: var(--warn); }
.c-info { background: var(--info); } .c-neutral { background: var(--faint); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 72px; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.bars span { display: block; width: 100%; max-width: 40px; border-radius: 3px 3px 0 0; background: var(--ink); opacity: .85; min-height: 2px; }
.bars small { font-size: 12.5px; color: var(--muted); }

/* ---- loading, toast, switch ---- */
.skel td { padding: 16px; }
.skel span { display: block; height: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--neutral-bg), var(--rule), var(--neutral-bg));
  background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 40; margin: 0; max-width: 560px;
  padding: 12px 16px; border-radius: var(--r-sm); background: var(--ink); color: #fff; font-size: 14.5px; box-shadow: 0 10px 30px rgba(31,43,69,.25); }
@media (prefers-color-scheme: dark) { .toast { color: #10151d; } }
.switch { gap: 10px; cursor: pointer; color: var(--text); }
.switch input { display: none; }
.switch span { width: 36px; height: 21px; border-radius: 11px; background: var(--rule-2); position: relative; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { left: 17px; }
.more-names { display: inline-block; margin-left: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--neutral-bg); border-radius: 9px; padding: 0 7px; cursor: help; }

/* ---- phones ---- */
.bottomnav { display: none; }
@media (max-width: 860px) {
  body { padding-bottom: 66px; }
  .sidebar { display: none; }
  .bottomnav:not([hidden]) { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--rule); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 11px;
    font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; border-top: 3px solid transparent; margin-top: -1px; }
  .bottomnav a.on, .bottomnav button.on { color: var(--ink); border-top-color: var(--tape); }
  .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: auto; padding: 9px 0 11px;
    font-size: 12px; font-weight: 600; color: var(--muted); border: 0; border-top: 3px solid transparent; border-radius: 0; background: transparent; margin-top: -1px; }
  .view { padding: var(--s4) var(--s4) 40px; }
  .topbar { padding: var(--s3) var(--s4); }
  .topbar .user { display: none; }
  body:has(#bottomnav:not([hidden])) .topbar :is(#org, #logout) { display: none; }   /* the More sheet holds them; a client-only account has no bottom bar and keeps Sign out here */
  .scope-tabs { gap: 20px; overflow-x: auto; }
  .scope-tabs button { flex: none; }
  .searchbar { grid-template-columns: minmax(0, 1fr); }
  .searchbar > button { width: 100%; }
  .hero { padding: 20px; }
  .hero .when { font-size: 27px; }
  .hero .try-row .k { width: 100%; }
  .fgroup .label { width: 100%; }
  .qform { padding: 16px 16px; }
  .qform-top { grid-template-columns: 1fr; }
  .condition { grid-template-columns: minmax(0, 1fr) 38px; padding-bottom: 10px; border-bottom: 1px dashed var(--rule); }
  .condition > select[name=field] { grid-column: 1; }
  .condition > input, .condition > .wide, .condition > select[name=value], .condition > select[name=court_id] { grid-column: 1 / -1; }
  .condition > button.icon { grid-column: 2; grid-row: 1; }
  .queries, .queries tbody, .queries tr, .queries td { display: block; }
  .queries thead { display: none; }
  .queries tr { padding: 16px 16px; border-bottom: 1px solid var(--rule); }
  .queries td { border: 0; padding: 3px 0; }
  .row-actions { text-align: left; padding-top: 10px !important; }
  .alerts, .alerts tbody, .alerts tr, .alerts td { display: block; }
  .alerts thead { display: none; }
  .alerts tr { padding: 16px 16px; border-bottom: 1px solid var(--rule); }
  .alerts td, .alerts td.lead { border: 0; padding: 3px 0; width: auto; }
  .alerts td:nth-child(3) { display: flex; align-items: baseline; gap: 10px; }
  .alerts td:nth-child(3) .sub { margin: 0; }
  .drawer { width: 100vw; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  #results-card thead { display: none; }
  #results-card tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 16px 16px; border-bottom: 1px solid var(--rule); }
  #results-card td { border: 0; padding: 2px 0; white-space: normal !important; width: 100%; }
  #results-card td.lead { order: -2; width: auto; flex: 0 1 auto; }
  #results-card td.m-meta { order: -1; width: auto; flex: none; font-size: 13.5px; color: var(--muted); }
}

/* ---- case story: lineage flow diagram + timeline rail ---- */
.story h4 { margin: 4px 0 10px; }
.story h4 + .hint { margin: -4px 0 10px; }
svg.flow { display: block; width: auto; max-width: 100%; height: auto; margin: 4px 0 10px; overflow: visible; }
svg.flow.vertical { max-width: 260px; }
.flow-node { cursor: pointer; outline: none; }
.flow-node rect { fill: var(--surface); stroke: var(--rule-2); stroke-width: 1.5; }
.flow-node.origin rect { stroke: var(--tape); stroke-width: 2; }
.flow-node.lower rect { stroke: var(--ink); }
.flow-node.hc rect { fill: var(--ink); stroke: var(--ink); }
.flow-node.hc .flow-title, .flow-node.hc .flow-sub { fill: #fff; }
@media (prefers-color-scheme: dark) { .flow-node.hc .flow-title, .flow-node.hc .flow-sub { fill: #10151d; } }
.flow-node.on rect { stroke-width: 3; }
.flow-node:focus-visible rect { stroke: var(--link); stroke-width: 3; }
.flow-title { font: 600 13.5px var(--sans); fill: var(--ink); }
.flow-sub { font: 400 12px var(--sans); fill: var(--muted); }
.flow-edge { stroke: var(--muted); stroke-width: 1.6; }
.flow-arrowhead { fill: var(--muted); }
blockquote.source { margin: 0 0 16px; padding: 10px 16px; border-left: 2px solid var(--rule-2);
  font-size: 14px; color: var(--text); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
blockquote.source q { font-family: var(--serif); }
ol.rail { list-style: none; margin: 0 0 8px; padding: 0 0 0 4px; position: relative; }
ol.rail::before { content: ""; position: absolute; left: 110px; top: 6px; bottom: 6px; width: 2px; background: var(--rule-2); }
.rail-item { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 0 32px; padding: 7px 0; }
.rail-item::before { content: ""; position: absolute; left: 101px; top: 12px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--ink); }
.rail-item.decided::before { background: var(--ink); }
.rail-item.listed::before { border-color: var(--muted); width: 8px; height: 8px; left: 102px; top: 13px; }
.rail-item.arrest::before, .rail-item.complaint::before, .rail-item.fir::before { border-color: var(--tape); }
.rail-date { font-size: 13.5px; color: var(--muted); text-align: right; padding-top: 1px; white-space: nowrap; }
.rail-body b { color: var(--ink); font-weight: 600; }
.rail-src { display: block; margin-top: 3px; font-family: var(--serif); font-size: 13.5px; color: var(--muted); }
@media (max-width: 860px) {
  ol.rail::before { left: 84px; }
  .rail-item { grid-template-columns: 72px 1fr; gap: 0 24px; }
  .rail-item::before { left: 79px; }
  .rail-item.listed::before { left: 80px; }
}

/* ---- citation intelligence: treatment card + network diagram ---- */
.lede { margin: 0 0 10px; font-size: 15px; max-width: 64ch; }
ul.quotes li { padding: 10px 0; }
ul.quotes .badge { margin: 0 6px 0 0; }
svg.net { display: block; width: 100%; max-width: 620px; height: auto; margin: 0 auto 6px; overflow: visible; }
.net-edge { stroke: var(--rule-2); stroke-linecap: round; }
.net-hub circle { fill: var(--ink); }
.net-hub text { font: 600 12px var(--sans); fill: #fff; }
@media (prefers-color-scheme: dark) { .net-hub text { fill: #10151d; } }
.net-node { cursor: pointer; outline: none; }
.net-node circle { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.net-node:hover circle, .net-node:focus-visible circle { fill: var(--brass); }
.net-node text { font: 500 11.5px var(--sans); fill: var(--link); }
.net-node text.net-n { font-weight: 400; fill: var(--muted); font-size: 10.5px; }
ol.net-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
ol.net-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 2.2em; gap: 10px; align-items: center; font-size: 14px; }
.net-track { height: 8px; border-radius: 4px; background: var(--neutral-bg); overflow: hidden; }
.net-bar { display: block; height: 100%; background: var(--ink); }
ol.net-list .n { color: var(--muted); text-align: right; }

/* ---- citator status ---- */
.citator { padding: 16px 16px; border-radius: var(--r-sm); font-size: 14.5px; margin: 16px 0 0; }
.citator.ok { background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--rule)); }
.citator.ok b { color: var(--ok); }
.citator.flagged { background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--rule)); }
.citator.flagged b { color: var(--bad); }
.citator .caveat { margin: 8px 0 0; }
.citator ul.list { margin-top: 8px; }
.drawer-body > .citator { padding: 16px 16px; border-bottom: 0; }

/* ---- parties ---- */
.parties { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px 16px; align-items: start; }
/* Petitioner and respondent read apart at a glance: ink-blue and amber, never green/red (those mean won/lost here). */
.parties > .party-col:first-child { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 35%, var(--rule)); }
.parties > .party-col:last-child { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, var(--rule)); }
.parties > .party-col:first-child > .party-label { color: var(--info); }
.parties > .party-col:last-child > .party-label { color: var(--warn); }
.party-col { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 16px; min-width: 0; }
.party-v { align-self: center; font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }
.party-label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.party-role { font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--rule-2); border-radius: 10px; padding: 0 8px; font-size: 12px; }
.party + .party { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--rule-2); }
.party-name { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.party-sub { font-size: 13.5px; color: var(--muted); }
.party-place { display: flex; gap: 5px; align-items: center; font-size: 13.5px; color: var(--text); margin-top: 3px; }
.party-place svg { width: 14px; height: 14px; color: var(--tape); flex: none; }
.party-counsel { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 14.5px; }
.party-counsel > div + div { margin-top: 3px; }
@media (max-width: 860px) {
  .parties { grid-template-columns: 1fr; gap: 8px; }
  .party-v { justify-self: center; font-size: 18px; }
}

/* ---- timeline v2: proportional axis + event cards ---- */
.timeline { margin: 4px 0 6px; }
svg.t-axis { display: block; width: 100%; max-width: 680px; height: auto; margin: 0 0 16px; overflow: visible; }
.t-track { stroke: var(--rule-2); stroke-width: 3; stroke-linecap: round; }
.t-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.t-dot.k-arrest, .t-dot.k-fir, .t-dot.k-complaint { stroke: var(--tape); }
.t-dot.k-listed { stroke: var(--muted); }
.t-dot.k-decided { fill: var(--ink); }
.t-span { font: 600 12px var(--sans); fill: var(--muted); }
.t-label { font: 600 12px var(--sans); fill: var(--ink); }
.t-kind { font: 400 11px var(--sans); fill: var(--muted); }
ol.tl { list-style: none; margin: 0; padding: 0; position: relative; }
ol.tl::before { content: ""; position: absolute; left: 95px; top: 18px; bottom: 18px; width: 2px; background: var(--rule-2); }
.tl-item { position: relative; display: grid; grid-template-columns: 74px 44px 1fr; gap: 0 4px; align-items: start; padding: 4px 0; }
.tl-date { text-align: right; padding: 8px 8px 0 0; line-height: 1.15; }
.tl-date b { display: block; font-size: 14px; color: var(--ink); }
.tl-date span { font-size: 12px; color: var(--muted); }
.tl-icon { position: relative; z-index: 1; width: 34px; height: 34px; margin: 2px 0 0 5px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--ink); color: var(--ink); }
.tl-icon svg { width: 16px; height: 16px; }
.k-arrest .tl-icon, .k-fir .tl-icon, .k-complaint .tl-icon { border-color: var(--tape); color: var(--tape); }
.k-listed .tl-icon, .k-registered .tl-icon { border-color: var(--rule-2); color: var(--muted); }
.k-decided .tl-icon { background: var(--ink); color: #fff; }
.tl-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 9px 13px; margin: 0 0 2px 6px; }
.k-decided .tl-card { border-color: var(--ink); border-width: 1.5px; }
.k-registered .tl-card { background: transparent; border-style: dashed; }
.tl-title { font-weight: 600; color: var(--ink); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-note { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.tl-gap { position: relative; padding: 0 0 0 128px; font-size: 12.5px; color: var(--faint); font-style: italic; line-height: 1.6; }
details.tl-src { margin-top: 5px; font-size: 13.5px; }
details.tl-src summary { cursor: pointer; color: var(--link); font-weight: 500; list-style: none; }
details.tl-src summary::before { content: "▸ "; }
details.tl-src[open] summary::before { content: "▾ "; }
details.tl-src q { display: block; margin-top: 5px; padding: 8px 10px; font-family: var(--serif); color: var(--text);
  border-left: 2px solid var(--rule-2); }
@media (prefers-color-scheme: dark) { .k-decided .tl-icon { color: #10151d; } }
@media (max-width: 860px) {
  ol.tl::before { left: 79px; }
  .tl-item { grid-template-columns: 58px 44px 1fr; }
  .tl-gap { padding-left: 110px; }
}

/* ---- case strength (M4) ---- */
.strength { display: grid; gap: 12px; }
.st-periods { display: flex; flex-wrap: wrap; gap: 6px; }
.strength .lede { margin: 0; color: var(--text); }
svg.st-bar { display: block; width: 100%; height: 28px; border-radius: 6px; overflow: hidden; background: var(--rule); }
.seg.d-for { fill: var(--ok); }
.seg.d-partly { fill: color-mix(in srgb, var(--ok) 45%, var(--surface)); }
.seg.d-against { fill: var(--bad); }
.seg.d-settled { fill: var(--info); }
.seg.d-procedural { fill: var(--rule-2); }
.seg.d-unknown { fill: color-mix(in srgb, var(--faint) 30%, var(--surface)); }
.st-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.st-legend li { display: grid; grid-template-columns: 14px 1fr 48px 72px auto; gap: 10px; align-items: center;
  padding: 6px 4px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.st-legend .lab { color: var(--ink); }
.st-legend .pc { font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.st-legend .ct { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--rule-2); }
.d-for .sw { background: var(--ok); }
.d-partly .sw { background: color-mix(in srgb, var(--ok) 45%, var(--surface)); }
.d-against .sw { background: var(--bad); }
.d-settled .sw { background: var(--info); }
.d-procedural .sw { background: var(--rule-2); }
.d-unknown .sw { background: color-mix(in srgb, var(--faint) 30%, var(--surface)); border: 1px solid var(--rule-2); }
.st-time { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; color: var(--text); font-size: 14px; }
.st-time .big { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.st-mine { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; padding: 8px 10px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; font-size: 14px; }
.st-few { margin: 0; padding: 10px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 6px; }
.st-cases h5 { margin: 6px 0; font-size: 13px; color: var(--muted); font-weight: 600; }
@media (max-width: 560px) {
  .st-legend li { grid-template-columns: 14px 1fr 44px auto; }
  .st-legend li .ct:not(.faint) { display: none; }
}
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; }
.linkish:hover { color: var(--ink); }
.linkish:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 2px; }

/* ---- verify (M5) ---- */
.verify-intro h2 { font-family: var(--serif); font-size: 26px; color: var(--ink); margin: 16px 0 6px; }
.verify-intro p { max-width: 70ch; margin: 0 0 16px; }
.verify-form textarea { width: 100%; min-height: 160px; padding: 12px 16px; font: inherit; line-height: 1.55; color: var(--text);
  background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--r-sm); resize: vertical; }
.verify-form textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent); }
.verify-form .row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
#verify-out { display: grid; gap: 16px; margin-top: 20px; }
.vsum { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-sm); font-size: 14px; color: var(--text); }
.vsum b { color: var(--ink); } .vsum .bad, .vsum .bad b { color: var(--bad); }
.vcard { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 16px; display: grid; gap: 8px; }
.vcard header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.vcard h4 { margin: 0; font-family: var(--serif); font-size: 18px; color: var(--ink); }
.vstat { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 10px; }
.vstat.ok { background: var(--ok-bg); color: var(--ok); } .vstat.warn { background: var(--warn-bg); color: var(--warn); }
.vstat.none { background: var(--neutral-bg, var(--paper)); color: var(--muted); }
.vline { margin: 0; font-size: 14px; color: var(--text); } .vclear { color: var(--ok); }
.vflag { display: grid; gap: 4px; padding: 8px 12px; background: var(--bad-bg); color: var(--bad); border-radius: 6px; font-size: 14px; }
.vflag q { color: var(--text); font-family: var(--serif); }
.vquote { border-left: 3px solid var(--rule-2); padding: 6px 0 6px 12px; display: grid; gap: 6px; }
.vquote.q-found { border-left-color: var(--ok); } .vquote.q-not_found { border-left-color: var(--bad); }
.vquote .qstat { font-weight: 600; font-size: 13px; color: var(--ink); }
.q-found .qstat { color: var(--ok); } .q-not_found .qstat { color: var(--bad); }
.vquote q.asked { font-family: var(--serif); color: var(--text); }
.vquote blockquote.source { margin: 0; }
.vquote.q-close { border-left-color: var(--warn); } .q-close .qstat { color: var(--warn); }
table.acc { width: 100%; border-collapse: collapse; font-size: 14px; }
table.acc th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--rule-2); }
table.acc td { padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.acc td.num { white-space: nowrap; text-align: right; }
table.acc td.num b { font-size: 16px; color: var(--ink); }
#accuracy-link { display: block; margin-top: 6px; }
.st-odds { display: grid; gap: 8px; padding-top: 6px; border-top: 1px solid var(--rule); }
.st-odds h5 { margin: 6px 0 0; font-family: var(--serif); font-size: 16px; color: var(--ink); }
ul.odds { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
ul.odds li { display: grid; grid-template-columns: 1fr 48px 64px 72px; gap: 10px; align-items: center; padding: 6px 4px;
  border-bottom: 1px solid var(--rule); font-size: 14px; }
ul.odds .lab { color: var(--ink); } ul.odds .pc { font-weight: 700; color: var(--ink); text-align: right; }
ul.odds .ct { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-weight: 600; text-align: center; padding: 2px 6px; border-radius: 10px; }
.delta.up { background: var(--ok-bg); color: var(--ok); } .delta.down { background: var(--bad-bg); color: var(--bad); }
.nm-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 560px) { .nm-grid { grid-template-columns: 1fr; } ul.odds li { grid-template-columns: 1fr 44px 60px; } ul.odds .ct { display: none; } }
.eval { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--rule); } .eval h5 { margin: 0 0 4px; font-size: 15px; color: var(--ink); } .eval .ok { color: var(--ok); } .eval .bad { color: var(--bad); }
@media (max-width: 560px) { .cf-ias th:nth-child(4), .cf-ias td:nth-child(4) { display: none; } }

/* ---- case strength, redesigned: three plain answers ---- */
.strength { gap: 16px; }
.st-q { display: grid; gap: 8px; }
.st-q h5 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.st-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 15px; color: var(--text); line-height: 1.45; }
.st-head .big { font-family: var(--serif); font-size: 34px; line-height: 1; font-weight: 600; color: var(--ink); }
svg.st-bar2 { display: block; width: 100%; height: 14px; border-radius: 7px; overflow: hidden; background: var(--rule); }
.st-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text); }
.st-key .k { display: inline-flex; align-items: center; gap: 6px; }
ul.st-factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.st-factors li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.5; color: var(--text); }
ul.st-factors .delta { margin-top: 2px; }
.st-periods { align-items: center; }
.st-periods .hint { margin-right: 4px; }
.st-periods .chip { height: 26px; font-size: 13px; }
details.st-more { border-top: 1px solid var(--rule); padding-top: 10px; }
details.st-more summary { cursor: pointer; color: var(--link); font-size: 14px; font-weight: 500; }
details.st-more[open] summary { margin-bottom: 8px; }
.st-mine b { color: var(--ink); }
.st-lead { margin: 0; font-size: 14px; color: var(--text); } .st-lead b { color: var(--ink); }
.court-record { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 16px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-sm); }
.court-record h5 { margin: 0; font-size: 14px; color: var(--ink); }
.cr-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cr-field { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: 6px; }
.cr-field b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cr-copy { height: 26px; padding: 0 9px; font-size: 12px; }
.court-record .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---- companies (M7) */
.co-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--neutral-bg); margin: 6px 0 2px; max-width: 220px; }
.card .co-bar { max-width: none; height: 12px; border-radius: 6px; }
.co-bar span { display: block; height: 100%; }
.co-lead { margin: 0 0 8px; line-height: 1.5; }
.co-years { display: flex; align-items: flex-end; gap: 3px; height: 72px; margin-top: 16px; }
.co-year { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.co-year span { display: block; width: 100%; max-width: 22px; background: var(--info); border-radius: 2px 2px 0 0; opacity: .75; }
.co-year small { font-size: 11px; color: var(--faint); margin-top: 3px; }
.co-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.co-tabs button { border: 1px solid var(--rule); background: var(--surface); color: var(--muted); border-radius: 14px; padding: 3px 12px; font-size: 13px; cursor: pointer; }
.co-tabs button.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.co-cases { list-style: none; margin: 0; padding: 0; }
.co-cases li { display: grid; grid-template-columns: 7.5em 1fr auto auto; gap: 4px 12px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--rule); }
.co-cases li:first-child { border-top: 0; }
.co-cases .co-date { color: var(--muted); font-size: 14px; }
.co-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 16px; }
.co-variants { margin: 8px 0; padding-left: 18px; columns: 2; font-size: 14px; }
@media (max-width: 640px) {
  .co-cases li { grid-template-columns: 1fr auto; }
  .co-cases .co-date { grid-column: 1 / -1; }
  .co-variants { columns: 1; }
}

/* ---- case status pasted by a member (0026) */
.cs-paste-box { margin-top: 12px; }
.cs-paste-box summary { cursor: pointer; font-weight: 600; }
.cs-paste { width: 100%; box-sizing: border-box; margin: 8px 0; font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--surface); color: var(--text); resize: vertical; }
.cs-prayer { margin: 4px 0 12px; padding: 8px 16px; border-left: 2px solid var(--rule-2);
  font-family: var(--serif); line-height: 1.55; }
.cs-orders { list-style: none; margin: 0 0 4px; padding: 0; }
.cs-orders li { padding: 5px 0; border-top: 1px solid var(--rule); }
.cs-orders li:first-child { border-top: 0; }
.cs-no { color: var(--faint); font-family: var(--sans); font-size: 13px; font-weight: 500; }

/* ---- the case page: one case, every known date. The History rail is the page's one bold element. */
.case-head { margin-bottom: var(--s4); }
.case-back { margin-bottom: 10px; font-size: 14px; }
.case-no { font-family: var(--serif); font-size: 34px; font-weight: 600; color: var(--ink); margin: 2px 0 4px; letter-spacing: -.01em; }
.case-title { font-family: var(--serif); font-size: 18px; color: var(--ink-soft); margin: 0 0 12px; max-width: 70ch; }
.case-facts { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: var(--s4) 20px; margin-bottom: var(--s4); }
.case-facts .stat:last-child { border-right: 0; }
.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 20px; align-items: start; }
.case-side .parties { grid-template-columns: 1fr; }
.case-side .party-v { display: none; }

.hist { list-style: none; margin: 4px 0 8px; padding: 0; position: relative; }
.hist-row { display: grid; grid-template-columns: 86px 22px minmax(0, 1fr); align-items: start; position: relative; }
.hist-row::before { content: ""; position: absolute; left: 96px; top: 0; bottom: 0; width: 2px; background: var(--rule); }
.hist-date { text-align: right; padding: 10px 10px 10px 0; line-height: 1.2; }
.hist-date b { display: block; font-family: var(--serif); font-size: 17px; color: var(--ink); white-space: nowrap; }
.hist-date span { font-size: 12px; color: var(--faint); white-space: nowrap; }
.hist-dot { width: 12px; height: 12px; border-radius: 50%; margin: 15px 0 0 5px; background: var(--surface);
  border: 2px solid var(--info); position: relative; z-index: 1; }
.hist-body { padding: 9px 0 12px 10px; border-bottom: 1px solid var(--rule); }
.hist-title { font-weight: 600; color: var(--ink); }
.hist-detail { color: var(--text); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.hist-src { font-size: 12px; color: var(--faint); margin-top: 3px; }
.k-filed .hist-dot, .k-registered .hist-dot { border-color: var(--ink); background: var(--ink); }
.k-order .hist-dot, .k-judgment .hist-dot { border-color: var(--tape); background: var(--tape); }
.k-listed .hist-dot { border-color: var(--info); }
.k-ia .hist-dot, .k-doc .hist-dot { border-color: var(--warn); }
.k-story .hist-dot { border-color: var(--faint); }
.hist-row.upcoming .hist-body { background: var(--info-bg); border-radius: var(--r-sm); padding-left: 12px; border-bottom-color: transparent; margin: 4px 0; }
.hist-row.upcoming .hist-dot { background: var(--info); }
.hist-gap { margin-left: 108px; padding: 2px 0; font-size: 12px; color: var(--faint); font-style: italic; }
.hist-today { margin: 6px 0; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--tape); }
.hist-today::before, .hist-today::after { content: ""; height: 2px; background: var(--tape); opacity: .5; }
.hist-today::before { width: 100px; }
.hist-today::after { flex: 1; }

@media (max-width: 1100px) { .case-grid { grid-template-columns: minmax(0, 1fr); } .case-side .parties { grid-template-columns: 1fr auto 1fr; } .case-side .party-v { display: block; } }
@media (max-width: 560px) {
  .case-no { font-size: 26px; }
  .hist-row { grid-template-columns: 64px 20px minmax(0, 1fr); }
  .hist-row::before { left: 73px; }
  .hist-date b { font-size: 15px; }
  .hist-gap { margin-left: 84px; }
  .hist-today::before { width: 70px; }
  .case-side .parties { grid-template-columns: 1fr; } .case-side .party-v { display: none; }
}

/* advocate identity from the court's own advocate codes (0029) */
.ident { margin: 0 0 16px; padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid var(--rule); background: var(--surface); font-size: 14.5px; }
.ident.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, var(--rule)); }
.ident.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, var(--rule)); }
.ident ul { margin: 6px 0 0; padding-left: 18px; }
.ident p { margin: 0; }

/* case files (0030) */
.cf-form { display: grid; gap: 12px; }
.cf-form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.cf-form input, .cf-form select { font: inherit; padding: 7px 9px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--surface); color: var(--text); }
.cf-results { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.cf-results li { padding: 4px 0; }
.cf-list { margin-top: 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 20px; }
.cf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cf-head h4 { margin: 0; font: 600 var(--fs-lg)/1.3 var(--serif); color: var(--ink); }
.cf-list ul, .cf-docs, .cf-refs { list-style: none; padding: 0; margin: 10px 0 0; }
.cf-list li, .cf-docs li, .cf-refs li { padding: 8px 0; border-top: 1px solid var(--rule); }
.cf-list li:first-child, .cf-docs li:first-child, .cf-refs li:first-child { border-top: 0; }
.cf-doc-title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cf-doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 4px; font-size: 14px; }
.pdf-link { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; margin: -6px 0 -6px -8px;
  color: var(--link); border-radius: 8px; }
.pdf-link:hover { color: var(--ink); background: var(--rule); }
.pdf-link:focus-visible { outline: 2px solid var(--link); outline-offset: 0; }
svg .pdf-badge { fill: var(--surface); }
td .pdf-link { margin: -8px 0; }
.warn-text { color: var(--warn); }
.doc-text { white-space: pre; overflow-x: auto; max-width: 100%; box-sizing: border-box; margin: 0; tab-size: 4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.45; }

/* strategy plan + reports (M8) */
.plan-sec { margin: 16px 0 6px; }
.plan-sec h5 { margin: 0 0 6px; }
.plan-lines { margin: 0; padding-left: 20px; }
.plan-lines li { padding: 5px 0; line-height: 1.5; }
.plan-srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.src-chip { font-size: 12px; color: var(--muted); border: 1px solid var(--rule); border-radius: 10px; padding: 0 8px; background: var(--surface); }
a.src-chip { color: var(--link); }
.fn { color: var(--muted); margin-left: 2px; }
.report-offer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 10px 0; }
.tier { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 16px; background: var(--surface); display: grid; gap: 4px; }
.tier-name { font-weight: 600; color: var(--ink); }
.tier-price { font-family: var(--serif); font-size: 22px; color: var(--ink); }
.report { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 24px 32px; max-width: 860px; }
.report-actions { display: flex; justify-content: space-between; align-items: center; max-width: 860px; margin-bottom: 12px; }
.report-notes { font-size: 13px; padding-left: 20px; }
/* M9: tomorrow, work card, invoice */
.tm-list { list-style: none; margin: 0; padding: 0; }
.tm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.tm-row:last-child { border-bottom: 0; }
.tm-main { min-width: 0; }
.tm-row > .btn-link, .tm-row > span:last-child { white-space: nowrap; flex: none; }
.tm-main .case { font-weight: 600; }
label.task { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; margin: 0; font-weight: 400; color: var(--text); }
label.task input { width: auto; margin: 3px 0 0; flex: none; }
.work-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.work-form input { flex: 1 1 120px; min-width: 0; }
.work-form input[name=description], .work-form input[name=client_name], .work-form input[name=client_address] { flex: 3 1 220px; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--rule); padding-bottom: 12px; margin-bottom: 16px; }
.inv-to { margin-bottom: 12px; }
.inv-lines { width: 100%; border-collapse: collapse; margin-top: 8px; }
.inv-lines th, .inv-lines td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.inv-lines .num { text-align: right; white-space: nowrap; padding-left: 16px; }
.inv-lines tfoot th { border-bottom: 0; font-size: 16px; }
@media print {
  .sidebar, .topbar, .bottomnav, .no-print, #detail { display: none !important; }
  .view { padding: 0 !important; }
  .report { border: 0; padding: 0; max-width: none; }
}
.case-main, .case-side { min-width: 0; }   /* grid items: a long row must wrap, not widen the page on a phone */

/* Client accounts (0033) */
#client-link { height: 30px; }
#practice-tab { height: 30px; display: none; }                                  /* desktop has it in the sidebar */
@media (max-width: 860px) { #practice-tab:not([hidden]) { display: inline-flex; } }
.client-next .v { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.client-next > div + div { margin-top: 4px; }
.client-updates { list-style: none; margin: 8px 0 0; padding: 0; }
.client-updates li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.client-updates li:last-child { border-bottom: 0; }
.client-updates p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.client-upd-form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 8px 0; }
.client-upd-form textarea { width: 100%; box-sizing: border-box; font: inherit; }
.copy-field { width: 100%; box-sizing: border-box; margin: 6px 0; font-family: ui-monospace, monospace; font-size: 13px; }
.work-form label.check { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; white-space: nowrap; }
.work-form select { flex: 2 1 200px; min-width: 0; }
.plan-footnotes { font-size: 13px; color: var(--muted); padding-left: 20px; }
#v-clientaccept .kicker { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 640px) { .tm-row { flex-wrap: wrap; } }
.case-no-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.case-no-row .case-no { margin: 0; }
.case-no-row button.watch { height: 32px; padding: 0 12px; margin-left: 0; font-size: 14px; }
.overdue-note { margin: 0 0 16px; }
button.saved, button.saved:disabled { background: var(--ok-bg); border-color: transparent; color: var(--ok); opacity: 1; cursor: default; font-weight: 600; }
/* the advocate's day board */
.adv-board tr.clash td { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.adv-board .badge.warn { background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
@media print {
  body.print-board #v-person > :not(.adv-board):not(.case-head) { display: none !important; }
  body.print-board .case-back { display: none !important; }
  body.print-board .adv-board .card { break-inside: avoid; border: 0; padding: 0; }
}

/* Table sizing (2026-10-01 UI review): one padding rhythm everywhere; short columns hug their content and never
   wrap; free text gets a readable minimum width; nothing is clipped (the card scrolls only as a last resort). */
th, td { padding: 12px 16px; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
table.sized { table-layout: auto; }
table.sized .c-fit { white-space: nowrap; width: 1%; }
table.sized .c-text { min-width: 16ch; }
table.sized td.c-text { overflow-wrap: break-word; }
table.sized .c-num { white-space: nowrap; text-align: right; width: 1%; }
.table-card td .case { white-space: nowrap; }
.card .table-card { margin-top: 12px; }
.members-card td { vertical-align: middle; }   /* role selects and action links sit level with the name */

/* the side column's durations: a two-column list, not a four-column table squeezed into 400px */
.dur-list { list-style: none; margin: 8px 0 0; padding: 0; }
.dur-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.dur-list li:last-child { border-bottom: 0; }
.dur-list li:hover .dur-type span:first-child, .dur-list li:focus-visible .dur-type span:first-child { text-decoration: underline; }
.dur-type { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dur-val { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.dur-val b { font-size: 16px; color: var(--ink); }
table.sized .c-ref { width: 1%; min-width: 13ch; }
table.sized .c-ref .case { white-space: nowrap; }
table.sized .c-ref .case:has(wbr) { white-space: normal; overflow-wrap: normal; }   /* only an unusually long ref breaks */
table.sized .c-wide { min-width: 20ch; }
table.sized .c-stage { min-width: 14ch; max-width: 26ch; }

/* Phone: a sized table becomes one card per row, each value under its column's name -- no sideways scrolling. */
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: auto; }
  table.stack tr { padding: 10px 16px; border-bottom: 1px solid var(--rule); }
  table.stack tr:last-child { border-bottom: 0; }
  table.sized.stack td, table.sized.stack th { border: 0; padding: 3px 0 !important; white-space: normal; min-width: 0;
    max-width: none; width: auto; }
  table.sized.stack .case, table.sized.stack .badge { white-space: normal; }
  table.stack td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 12px;
    font-weight: 600; color: var(--muted); }
  table.stack td:empty { display: none; }
  .adv-board tr.clash { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
  .adv-board tr.clash td { background: none; }
}
/* The advocate/party pages are table-heavy: below 1360px the side column goes under the tables, not beside them. */
@media (max-width: 1360px) { #v-person .case-grid { grid-template-columns: minmax(0, 1fr); } }
/* advocate matter list */
.ml-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 10px; }
.ml-tools input[type=search] { flex: 1 1 240px; min-width: 0; }
.ml-tools .spacer { flex: 1; }
.ml-chips .fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.ml-chips .fgroup .label { min-width: 92px; font-size: 13px; color: var(--muted); }
.ml-chips .chip:disabled { opacity: .45; cursor: default; }
.ml-bulk { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 8px 0; background: var(--info-bg);
  border: 1px solid color-mix(in srgb, var(--info) 30%, var(--rule)); border-radius: var(--r-sm); }
@media (max-width: 640px) { .ml-chips .fgroup .label { min-width: 100%; } .ml-tools .spacer { display: none; } }
table.sized .c-next { min-width: 12ch; max-width: 18ch; }
table.sized td:first-child:has(> input[type=checkbox]), table.sized th:first-child:empty { padding-right: 4px; width: 1%; }
.card table.sized .c-stage { max-width: 20ch; }
.ml table.sized .c-wide { min-width: 16ch; }
/* inside a card the column is narrower: text columns may shrink further before the table outgrows it */
.card table.sized .c-text { min-width: 11ch; }

/* ---- drafting (R21) */
.draft-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.draft-form .field { display: grid; gap: 4px; margin: 0 0 12px; min-width: 0; }
.draft-form .field span { font-size: 14px; color: var(--muted); }
.draft-form, #v-startdocs > .card { max-width: var(--form-w); }
.draft-form .field input, .draft-form .field select { width: 100%; min-width: 0; }
.rep-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; padding: 12px 0;
  border-bottom: 1px solid var(--rule); align-items: end; }
.rep-row > button { justify-self: start; }
.rep > button { margin: var(--s2) 0 var(--s4); }
.draft-form h4 { margin-top: var(--s4); }
/* the wizard: progress card (steps with a state), the form, then the kind-of-suit panel */
.draft-grid.wizard { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto 1fr; grid-template-areas: "main progress" "main route"; }
.draft-grid.wizard > .draft-main { grid-area: main; min-width: 0; }
.draft-grid.wizard > .draft-progress { grid-area: progress; margin: 0; }
.draft-grid.wizard > .route-panel { grid-area: route; margin: 0; }
.draft-progress summary { cursor: pointer; font-weight: 600; color: var(--ink); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.steps { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 2px; font-size: 15px; }
.steps li a { display: flex; gap: var(--s2); align-items: baseline; padding: 6px var(--s2); border-radius: var(--r-sm); color: var(--text); }
.steps li a:hover { background: var(--neutral-bg); text-decoration: none; }
.steps li.on a { background: var(--neutral-bg); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--ink); }
.mark { flex: none; width: 1.25em; text-align: center; color: var(--muted); }
.st-done .mark, .st-ready .mark { color: var(--ok); }
.st-needs .mark { color: var(--bad); font-weight: 700; }
.draft-head { margin-bottom: var(--s4); }
.draft-name { font-size: var(--fs-lg); }
.draft-head .hint { margin: var(--s1) 0 0; }
.review-steps { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; }
.review-steps li { display: grid; grid-template-columns: 1.5em minmax(0, 1fr) auto auto; gap: var(--s3); align-items: baseline; padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.review-steps li:last-child { border-bottom: 0; }
.rs-state { color: var(--muted); font-size: var(--fs-sm); }
.gen-why { margin-bottom: var(--s4); }
@media (max-width: 860px) {
  .draft-grid.wizard { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "progress" "main" "route"; }
  .steps li a { min-height: 44px; align-items: center; }
  .review-steps li { grid-template-columns: 1.5em minmax(0, 1fr) auto; }
  .rs-state { display: none; }
}
.draft-grid .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 12px; }
.route-panel .route-kind { font-weight: 700; }
.route-panel ul { padding-left: 18px; margin: 6px 0 12px; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 24px; }
.doc-card { margin: 0; display: flex; flex-direction: column; gap: var(--s2); }
.doc-card .btn-link { margin-top: auto; }
.doc-card > :is(p, h4) { margin: 0; }
.doc-card > h4:first-child { margin: 0; font-size: var(--fs-base); color: var(--ink); }
.doc-card .btn-link { align-self: flex-start; }
.route-panel { border-top: 3px solid var(--ink); }
mark.cited { background: var(--warn-bg); outline: 2px solid color-mix(in srgb, var(--warn) 45%, transparent); }
@media (max-width: 860px) { .draft-grid { grid-template-columns: minmax(0, 1fr); } }
/* draft from matter (R28/R29) */
.draft-form .field textarea { width: 100%; min-width: 0; font: inherit; }
.draft-form .field small { color: var(--muted); }
.scrutiny ol.findings { padding-left: 20px; margin: 8px 0; display: grid; gap: 10px; }
.scrutiny ol.findings li { overflow-wrap: anywhere; }
dl.filled { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0; font-size: 14px; }
dl.filled dt { color: var(--muted); }
dl.filled dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 860px) { .draft-grid > .scrutiny-wrap { order: -1; } dl.filled { grid-template-columns: minmax(0, 1fr); } }
#v-draftset .cf-head { flex-wrap: wrap; }
#v-draftset .cf-head .btn-link { white-space: nowrap; }

/* change password (settings) */
.pw-form { display: grid; gap: 12px; max-width: 420px; margin-top: 10px; }
.pw-form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.pw-form button { justify-self: start; }

/* ---- drafting front door (audit step B) ---- */
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s4); margin: var(--s3) 0 var(--s4); }
button.start-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); height: auto; margin: 0;
  padding: var(--s4) var(--s5); text-align: left; white-space: normal; font-weight: 400; color: var(--text); }
button.start-card:hover { border-color: var(--rule); }
button.start-card.on, button.start-card.on:hover { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }   /* beats .card.click:hover */
.start-title { font: 600 var(--fs-lg)/1.3 var(--serif); color: var(--ink); }
.start-text { font-size: 15px; line-height: 1.5; }
.start-when { font-size: var(--fs-sm); color: var(--muted); margin-top: auto; }
.start-form { max-width: var(--form-w); }
.start-form .field { margin: 0 0 var(--s3); }
.start-form .field input, .start-form .field select { width: 100%; }
.form-error { color: var(--bad); margin: 0 0 var(--s2); }
.start-list-head { margin-top: var(--s5); }

@media (max-width: 560px) {
  .stats-row.case-facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) 0; }
  .case-facts .stat { margin-right: 0; padding: var(--s1) var(--s3) var(--s1) 0; }
  .case-facts .stat:nth-child(2n) { border-right: 0; padding-left: var(--s3); padding-right: 0; }
}

/* ---- sign-in: a split card, brand and what law2 does on the left, the form on the right. No menus on this screen. ---- */
.auth-card.auth-split { width: min(920px, 100%); padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; }
.auth-intro, .auth-form { padding: var(--s6); }
.auth-intro { border-right: 1px solid var(--rule); }
.auth-intro h1 { font-size: 28px; line-height: 1.2; margin-bottom: var(--s2); }
.auth-points { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; gap: var(--s4); }
.auth-points li { border-left: 3px solid var(--ink); padding-left: var(--s4); display: grid; gap: 2px; }
.auth-points b { color: var(--ink); font-weight: 600; }
.auth-points span { color: var(--muted); font-size: 15px; }
.auth-form h2 { margin-bottom: 0; }
.auth-form form { margin-top: var(--s4); }
.auth-form .auth-links { margin-top: var(--s4); }
.auth-form .auth-links + .auth-links { margin-top: var(--s2); }
@media (max-width: 760px) {
  .auth-card.auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-intro { border-right: 0; border-bottom: 1px solid var(--rule); padding: var(--s5) var(--s4) var(--s4); }
  .auth-intro h1 { font-size: 22px; }
  .auth-intro .muted, .auth-points { display: none; }
  .auth-form { padding: var(--s4) var(--s4) var(--s5); }
}

/* ---- breadcrumbs: the way back is the real parent ---- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); margin: 0 0 var(--s3); padding: 0; font-size: var(--fs-sm); color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: var(--s2); color: var(--faint); }
.crumbs li { min-width: 0; overflow-wrap: anywhere; }
.crumbs [aria-current] { color: var(--text); }
.draft-head .crumbs ol { margin-bottom: var(--s2); }

/* ---- the phone's More sheet ---- */
.sheet { display: none; }
@media (max-width: 860px) {
  .sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 40; }
  .sheet-backdrop { position: absolute; inset: 0; background: rgba(16,21,29,.45); }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 85svh; overflow-y: auto; background: var(--surface);
    border-radius: var(--r) var(--r) 0 0; border-top: 3px solid var(--tape); padding: var(--s4) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom, 0px)); outline: none; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s2); }
  .sheet-head h2 { font-size: var(--fs-lg); }
  .sheet-links { display: grid; }
  .sheet-links a { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s2); color: var(--text); font-size: var(--fs-base); border-bottom: 1px solid var(--rule); }
  .sheet-links a.on { color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--tape); }
  .sheet-links a svg { color: var(--muted); }
  .sheet .field { margin: var(--s4) 0 0; }
  .sheet-foot { display: grid; gap: var(--s1); margin-top: var(--s4); font-size: var(--fs-sm); }
  .sheet-foot a { display: flex; align-items: center; min-height: 44px; }
  .sheet-foot .wide { margin-top: var(--s3); }
}

.role-help { margin: var(--s3) 0 0; font-size: var(--fs-sm); }
.role-help summary { cursor: pointer; color: var(--link); }
.role-help ul { margin: var(--s2) 0 0; padding-left: 18px; }
.role-help li { margin-bottom: var(--s1); }

/* matter team (0042) */
.team-list { list-style: none; margin: 0; padding: 0; }
.team-list li { display: flex; gap: var(--s2); align-items: baseline; padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.team-list li:last-child { border-bottom: 0; }
.team-list li .linkish { margin-left: auto; }
.team-add select { flex: 1; min-width: 0; }

/* 0045 corporate clients */
.company-form { margin-top: var(--s1); font-size: var(--fs-sm); }
.company-form summary { cursor: pointer; color: var(--link); }
.company-form .row { margin: var(--s2) 0; }
.company-form input { flex: 1; min-width: 0; }

/* 0047 personal workspace: no drafting or invoices in any menu */
body.personal a[data-view="drafts"], body.personal a[data-view="invoices"] { display: none !important; }
.kind-choice { border: 1px solid var(--rule); border-radius: var(--r-sm); padding: var(--s3) var(--s4); margin: 0; display: grid; gap: var(--s2); }
.kind-choice legend { padding: 0 var(--s1); color: var(--ink); font-weight: 500; }
.kind-choice .check { font-weight: 400; color: var(--text); }
.start-form-inline .field { max-width: var(--form-w); }

/* review 2026-10-10: menus a role cannot use */
body.no-watch a[data-view="watchlist"], body.no-watch a[data-view="alerts"] { display: none !important; }
body.no-matters a[data-view="cases"], body.no-matters a[data-view="drafts"], body.no-matters a[data-view="tomorrow"] { display: none !important; }
.draft-tie { margin: var(--s1) 0 var(--s2); font-size: var(--fs-sm); }
.draft-tie summary { cursor: pointer; color: var(--link); }
.draft-tie .field { margin: var(--s2) 0; }

/* R34: same-name links between a firm's document and the case's parties */
.doc-links { margin-top: var(--s2); display: grid; gap: var(--s1); }
.doc-link .party-sub { overflow-wrap: anywhere; }
.party-sub.doc-named { color: var(--warn); }

/* R49: Indian Kanoon's logo at its own pixel size, never scaled (their terms); a white plate keeps it legible in dark mode. */
.ik-logo { display: inline-block; background: #fff; padding: 6px 8px; border-radius: 6px; line-height: 0; margin: 8px 0 4px; }
.ik-logo img { max-width: none; min-width: 0; flex: none; }
.ik-logo .ik-logo-wide { width: 150px; height: 61px; }
.ik-logo .ik-logo-narrow { display: none; width: 28px; height: 42px; }
@media (max-width: 480px) { .ik-logo .ik-logo-wide { display: none; } .ik-logo .ik-logo-narrow { display: inline; } }

/* R7 arbitration page: the court + section picker wraps on a phone */
.arb-pick label { display: block; }
.arb-pick select { display: block; width: 100%; max-width: 100%; margin-top: 6px; }
/* R20: the taxonomy normaliser's court list holds long court names; it must never widen the page on a phone. */
#v-taxonomy form.row label { max-width: 100%; min-width: 0; }
#v-taxonomy form.row select, #v-taxonomy form.row input { max-width: 100%; min-width: 0; }
#v-taxonomy td button.linkish { white-space: normal; text-align: left; overflow-wrap: anywhere; }
