/* Sage — light, quietly luxurious UI: warm ivory, deep navy, antique gold, serif display type.
   Responsive from 360px phones to wide laptops. Fonts are self-hosted (privacy + CSP: no third-party
   requests). The CSP forbids inline style attributes: use classes. */
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/static/fonts/inter-latin.woff2) format("woff2-variations"), url(/static/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Playfair Display Variable"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(/static/fonts/playfair-latin.woff2) format("woff2-variations"), url(/static/fonts/playfair-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Playfair Display Variable"; font-style: italic; font-display: swap; font-weight: 400 900;
  src: url(/static/fonts/playfair-latin-italic.woff2) format("woff2-variations"), url(/static/fonts/playfair-latin-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #f7f4ee;
  --bg-2: #f1ece2;
  --surface: #ffffff;
  --surface-2: #fbf9f5;
  --surface-3: #f3efe7;
  --ink: #0f1b2d;
  --ink-2: #3b4454;
  --muted: #6b6559;
  --line: #e9e3d7;
  --line-strong: #d8cfbf;
  --primary: #15284b;
  --primary-2: #0c1a35;
  --primary-ink: #ffffff;
  --primary-soft: #eef1f6;
  --primary-line: #cdd5e4;
  --link: #1d3a74;
  --navy: #15284b;
  --gold: #b3894a;
  --gold-2: #d4b27a;
  --gold-ink: #8a6628;
  --gold-soft: #f7f0e3;
  --gold-line: #e6d4b0;
  --pm: #9a5b12;
  --ok: #1f6b4f;       --ok-soft: #edf6f1;
  --final: #1f6b4f;    --final-soft: #eaf5ef;
  --partial: #8c6414;  --partial-soft: #fbf3e2;
  --waiting: #28457f;  --waiting-soft: #eef2f9;
  --revised: #6b3fa0;  --revised-soft: #f4effa;
  --error: #b42323;    --error-soft: #fcefee;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(31, 27, 20, .05);
  --shadow: 0 1px 2px rgba(31, 27, 20, .04), 0 10px 30px -14px rgba(31, 27, 20, .14);
  --shadow-lg: 0 30px 60px -28px rgba(15, 27, 45, .35);
  --sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Playfair Display Variable", "Playfair Display", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --container: 1180px;
  --appbar-h: 68px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; scroll-padding-top: calc(var(--appbar-h) + 12px); }
body {
  margin: 0; color: var(--ink); font: 15.5px/1.6 var(--sans); font-feature-settings: "cv11", "ss01";
  background: radial-gradient(1100px 420px at 100% -8%, #efe6d4 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
h1, h2, h3 { font-weight: 650; letter-spacing: -.012em; margin: 0 0 .4em; line-height: 1.2; color: var(--ink); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(1.65rem, 1.3rem + 1.2vw, 2.2rem); line-height: 1.12; }
h2 { font-size: 1.28rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.mono { font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 2px; }
::selection { background: var(--gold-soft); }
svg.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------- app bar ---------- */
.demo-ribbon {
  background: var(--gold-soft); color: var(--gold-ink); text-align: center; font-size: .8rem; padding: 7px 16px;
  border-bottom: 1px solid var(--gold-line);
}
.appbar { position: sticky; top: 0; z-index: 30; background: rgba(251, 249, 245, .86);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset; }
.appbar .inner { max-width: var(--container); margin: 0 auto; padding: 0 20px; height: var(--appbar-h);
  display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(150deg, #20386a 0%, #0c1a35 100%); color: var(--gold-2);
  box-shadow: 0 0 0 1px rgba(212, 178, 122, .45) inset, 0 6px 16px -8px rgba(12, 26, 53, .6); }
.brand-mark svg { width: 20px; height: 20px; stroke: var(--gold-2); stroke-width: 1.6; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; letter-spacing: .01em; }
.brand-text span { font-size: .64rem; color: var(--gold-ink); letter-spacing: .14em; text-transform: uppercase; font-weight: 600; margin-top: 2px; }
.appbar nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.appbar nav a.desk, .linkbtn {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none; padding: 8px 12px; border-radius: 10px;
  font-size: .92rem; font-weight: 520; color: var(--ink-2); background: none; border: 0; font-family: inherit;
  cursor: pointer; line-height: 1.2; white-space: nowrap; position: relative;
}
.appbar nav a.desk svg { width: 18px; height: 18px; }
.appbar nav a.desk:hover, .linkbtn:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.appbar nav a.desk[aria-current="page"] { color: var(--primary); font-weight: 640; background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line) inset; }
.appbar nav a.desk[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.appbar .sep { width: 1px; height: 24px; background: var(--line-strong); margin: 0 8px; }
@media (max-width: 760px) {
  .appbar nav a.desk, .appbar .sep { display: none; }
  .appbar .inner { padding: 0 16px; height: 60px; }
  :root { --appbar-h: 60px; }
}

/* ---------- layout ---------- */
.page { width: 100%; max-width: var(--container); margin: 0 auto; padding: 32px 20px 48px; flex: 1; }
.narrow-page .page { max-width: 760px; }
@media (max-width: 760px) { .page { padding: 20px 16px 28px; } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line); position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.layout-split { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: start; }
@media (max-width: 999px) {
  .layout-split > .aside { order: -1; }
  .layout-split > .aside .tip-card { display: none; }
  .layout-split > .aside .status { padding: 10px 12px; }
}
@media (min-width: 1000px) {
  .layout-split { grid-template-columns: minmax(0, 1fr) 340px; }
  .layout-split > .aside { position: sticky; top: calc(var(--appbar-h) + 20px); }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; }
@media (max-width: 760px) { .card { padding: 16px; } }
.card.flat { box-shadow: none; background: var(--surface-2); }
.card h3 { margin-bottom: .6em; }
a.card { color: inherit; text-decoration: none; transition: border-color .18s, box-shadow .18s; }
a.card:hover { border-color: var(--gold-line); box-shadow: var(--shadow), 0 0 0 1px var(--gold-line); text-decoration: none; }
.card-title { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink);
  margin: 0 0 12px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 14px; }
.section-title:first-child { margin-top: 0; }
.section-title h2 { margin: 0; }
.section-title .count { color: var(--gold-ink); font-size: .78rem; background: var(--gold-soft); border: 1px solid var(--gold-line);
  border-radius: 999px; padding: 1px 10px; font-weight: 650; letter-spacing: .02em; }

/* ---------- Today ---------- */
.day-tabs { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.day-tabs a { text-decoration: none; padding: 7px 16px; border-radius: 9px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.day-tabs a:hover { color: var(--ink); text-decoration: none; }
.day-tabs a.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.hero { display: flex; align-items: center; gap: 16px; margin: 0 0 20px; flex-wrap: wrap; }
.hero .kicker, .kicker { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); }
.hero .date { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); font-weight: 600; line-height: 1.1; }
.today-hero { display: flex; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.today-hero .display { font-size: clamp(1.85rem, 1.3rem + 2vw, 2.75rem); margin: 6px 0 4px; line-height: 1.05; }
.today-hero .display em { font-style: italic; color: var(--gold-ink); font-weight: 500; }
.today-hero .sub { color: var(--muted); margin: 0; }
@media (max-width: 520px) { .today-hero .display em { display: block; } }
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.glance a, .glance > div { display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: border-color .18s, box-shadow .18s; }
.glance a:hover { border-color: var(--gold-line); text-decoration: none; box-shadow: var(--shadow), 0 0 0 1px var(--gold-line); }
.glance .v { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; line-height: 1; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.glance .l { font-size: .8rem; color: var(--muted); font-weight: 560; margin-top: 8px; }
.glance .hl { border-color: var(--gold-line); background: linear-gradient(160deg, #fffaf0 0%, #ffffff 70%); }
.glance .hl .v { color: var(--primary); }
.glance .hl::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.glance .alert-v .v { color: var(--error); }
@media (max-width: 760px) {
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .glance a, .glance > div { padding: 14px; }
  .glance .v { font-size: 1.8rem; }
}
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 30px; }
.quick a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s, transform .18s; min-width: 0; }
.quick a:hover { border-color: var(--gold-line); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.quick .qi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(150deg, #20386a, #0c1a35); color: var(--gold-2); box-shadow: 0 0 0 1px rgba(212, 178, 122, .35) inset; }
.quick .qi svg { width: 20px; height: 20px; }
.quick strong { display: block; font-size: .95rem; font-weight: 650; line-height: 1.25; }
.quick span.s { display: block; font-size: .78rem; color: var(--muted); line-height: 1.3; margin-top: 2px; }
@media (max-width: 900px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 420px) { .quick a { padding: 12px; gap: 10px; } .quick .qi { width: 36px; height: 36px; } .quick span.s { display: none; } }
@media (prefers-reduced-motion: reduce) { .quick a:hover { transform: none; } }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow); }
.summary > div { background: var(--surface); padding: 16px 18px; }
.summary .v { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.summary .l { font-size: .8rem; color: var(--muted); font-weight: 520; }
.summary .v.accent { color: var(--primary); }
@media (max-width: 480px) { .summary > div { padding: 12px; } .summary .v { font-size: 1.5rem; } }
.big { font-family: var(--serif); font-size: 2.8rem; line-height: 1; font-weight: 600; font-variant-numeric: lining-nums; }

/* ---------- status banners ---------- */
.status { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: 0 0 auto; background: var(--muted); }
.status .body { flex: 1; min-width: 0; }
.status .title { font-weight: 650; }
.status .meta { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.status.waiting { background: var(--waiting-soft); border-color: color-mix(in srgb, var(--waiting) 16%, transparent); }
.status.waiting .dot { background: var(--waiting); animation: pulse 1.8s infinite; }
.status.partial { background: var(--partial-soft); border-color: color-mix(in srgb, var(--partial) 20%, transparent); }
.status.partial .dot { background: var(--partial); }
.status.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 18%, transparent); }
.status.ok .dot { background: var(--ok); }
.status.final { background: var(--final-soft); border-color: color-mix(in srgb, var(--final) 18%, transparent); }
.status.final .dot { background: var(--final); }
.status.revised { background: var(--revised-soft); border-color: color-mix(in srgb, var(--revised) 18%, transparent); }
.status.revised .dot { background: var(--revised); }
.status.error { background: var(--error-soft); border-color: color-mix(in srgb, var(--error) 18%, transparent); }
.status.error .dot { background: var(--error); }
.status .bench { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .status.waiting .dot, .typing, .mic.on { animation: none; } }

/* ---------- matter card ---------- */
.matter { display: grid; grid-template-columns: 96px 1fr; padding: 0; overflow: hidden; transition: box-shadow .18s, border-color .18s; }
.matter:hover { border-color: var(--gold-line); box-shadow: var(--shadow), 0 0 0 1px var(--gold-line); }
.matter .rail { background: linear-gradient(170deg, #fbf6ec 0%, #f5eddd 100%); border-right: 1px solid var(--gold-line); padding: 16px 8px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.matter .rail .lbl { font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.matter .rail .hall { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; line-height: 1.05; color: var(--navy);
  font-variant-numeric: lining-nums; }
.matter .rail .time { font-size: .78rem; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; color: var(--ink-2);
  background: var(--surface); border-radius: 999px; padding: 2px 8px; border: 1px solid var(--gold-line); white-space: nowrap; }
.matter .rail .time.pm { color: var(--pm); border-color: #ecd0a6; }
.matter .main { padding: 16px 18px 14px; min-width: 0; }
.matter .case { font-size: 1.15rem; font-weight: 700; letter-spacing: -.005em; font-variant-numeric: tabular-nums; color: var(--ink); }
.matter .judges { color: var(--ink-2); font-size: .92rem; margin-top: 2px; }
.matter .parties { color: var(--muted); font-size: .86rem; margin-top: 8px; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .matter { grid-template-columns: 80px 1fr; }
  .matter .rail { padding: 14px 5px; }
  .matter .rail .hall { font-size: 1.75rem; }
  .matter .rail .time { font-size: .7rem; padding: 2px 6px; }
  .matter .main { padding: 14px; }
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 520;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; font-family: inherit; }
.chip.strong { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 650; }
.chip.accent { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-ink); font-weight: 600; }
.chip.warn { background: var(--partial-soft); border-color: #ecdcb4; color: var(--partial); }
.chip.side { background: var(--ok-soft); border-color: #cfe6da; color: var(--ok); }
.notes { list-style: none; padding: 0; margin: 12px 0 0; font-size: .86rem; }
.notes li { padding: 7px 12px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 8px 8px 0; margin-top: 6px; color: var(--ink-2); }
.notes li.call { border-left-color: var(--waiting); background: var(--waiting-soft); }
.matter .foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .84rem; }
.matter .foot a { font-weight: 600; text-decoration: none; }
.matter .foot a:hover { text-decoration: underline; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 28px 0 10px; }
.group-head .avatar { width: 32px; height: 32px; font-size: .85rem; }

.possible { border-style: dashed; border-color: var(--gold-line); box-shadow: none; background: #fffdf8; }
.possible .q { font-size: .88rem; color: var(--ink-2); margin: 10px 0; }
.removed { opacity: .8; }
.removed .case { text-decoration: line-through; text-decoration-color: var(--error); }

.empty { text-align: center; padding: 44px 20px; }
.empty .icon { font-size: 28px; margin-bottom: 10px; width: 60px; height: 60px; border-radius: 18px; background: var(--gold-soft);
  border: 1px solid var(--gold-line); display: inline-grid; place-items: center; }
.empty h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 6px; color: var(--ink); }
.hint { font-size: .84rem; color: var(--muted); margin: 6px 0 0; font-weight: 400; }
input[type=text], input[type=tel], input[type=email], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 11px 14px; min-height: 46px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #a39d91; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); }
input.code { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; padding-left: .5em; }
.field + .field { margin-top: 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.check:hover { border-color: var(--line-strong); }
.check:has(input:checked) { border-color: var(--gold-line); background: var(--gold-soft); }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); flex: 0 0 auto; }
.check + .check { margin-top: 8px; }
.check strong { display: block; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; font: inherit; font-weight: 600; line-height: 1.2;
  padding: 11px 20px; min-height: 44px; border-radius: 11px; border: 1px solid var(--primary-2);
  background: linear-gradient(180deg, #1d3461 0%, var(--primary) 100%); color: var(--primary-ink); cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 6px 14px -8px rgba(12, 26, 53, .55); transition: background .15s, box-shadow .15s, transform .15s;
  letter-spacing: .005em; }
.btn:hover { background: linear-gradient(180deg, #17294d 0%, var(--primary-2) 100%); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--gold-line); }
.btn.small { min-height: 34px; padding: 6px 13px; font-size: .86rem; border-radius: 9px; }
.btn.lg { min-height: 52px; padding: 13px 24px; font-size: 1rem; border-radius: 13px; }
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn.accent { background: linear-gradient(180deg, #c89c57 0%, var(--gold) 100%); border-color: #9c7535; color: #fff; }
.btn.accent:hover { background: linear-gradient(180deg, #bb8f4b 0%, #a27a3d 100%); }
.inline-form { display: inline; }
.alert { padding: 12px 15px; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid transparent; }
.alert.error { background: var(--error-soft); color: #7a1a1a; border-color: #f0c9c6; }
.alert.ok { background: var(--ok-soft); color: #134634; border-color: #c9e4d6; }
.alert.info { background: var(--waiting-soft); color: #1d3461; border-color: #d3dcee; }

/* auth + onboarding: centred card */
.onb { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 32px;
  position: relative; overflow: hidden; }
.onb::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-2), var(--gold)); }
@media (max-width: 520px) { .onb { padding: 22px 18px; border-radius: 18px; } }
.onb h1 { font-size: 1.75rem; }
.auth-icon { width: 50px; height: 50px; border-radius: 14px; background: linear-gradient(150deg, #20386a, #0c1a35); color: var(--gold-2);
  display: grid; place-items: center; margin-bottom: 16px; box-shadow: 0 0 0 1px rgba(212, 178, 122, .4) inset; }
.steps { display: flex; gap: 6px; margin: 0 0 22px; }
.steps span { height: 4px; flex: 1; border-radius: 4px; background: var(--line); }
.steps span.on { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.preview { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.alias-row { display: flex; gap: 8px; }
.alias-row + .alias-row { margin-top: 8px; }
.bench-grid { display: grid; gap: 10px; }
.bench-grid .check { padding: 16px; }

/* settings */
.settings-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin-bottom: 8px; }
.settings-nav a { flex: 0 0 auto; text-decoration: none; padding: 7px 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); font-size: .86rem; font-weight: 520; color: var(--ink-2); }
.settings-nav a:hover { border-color: var(--gold-line); color: var(--ink); text-decoration: none; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.kind { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }

/* tables (admin + evidence + source) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
tbody tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
dl.kv { display: grid; grid-template-columns: minmax(120px, 32%) 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { dl.kv { grid-template-columns: 1fr; gap: 2px; } dl.kv dd { margin-bottom: 8px; } }
pre.box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto;
  font-size: .8rem; white-space: pre-wrap; }
.pill { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.pill.FINAL, .pill.OK, .pill.SENT, .pill.DELIVERED, .pill.READ { background: var(--final-soft); color: var(--final); }
.pill.PUBLISHED { background: var(--ok-soft); color: var(--ok); }
.pill.REVISED { background: var(--revised-soft); color: var(--revised); }
.pill.PARTIALLY_PUBLISHED, .pill.LOW_CONFIDENCE, .pill.QUEUED { background: var(--partial-soft); color: var(--partial); }
.pill.WAITING_FOR_PUBLICATION, .pill.NOT_PUBLISHED, .pill.EMPTY { background: var(--waiting-soft); color: var(--waiting); }
.pill.PARSE_FAILED, .pill.SOURCE_UNAVAILABLE, .pill.FAILED { background: var(--error-soft); color: var(--error); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi .v { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.kpi .l { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 650; }

/* ---------- landing ---------- */
.landing .page { max-width: none; padding: 0; }
.lp-section { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.lp-hero { background: radial-gradient(900px 420px at 88% 0%, #efe3c9 0%, transparent 62%),
  radial-gradient(700px 380px at -10% 110%, #e8edf6 0%, transparent 58%), var(--surface-2); border-bottom: 1px solid var(--line); }
.lp-hero .lp-section { display: grid; grid-template-columns: 1fr; gap: 44px; padding-top: 60px; padding-bottom: 60px; align-items: center; }
@media (min-width: 960px) { .lp-hero .lp-section { grid-template-columns: 1.1fr .9fr; padding-top: 92px; padding-bottom: 92px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; color: var(--gold-ink);
  background: var(--gold-soft); border: 1px solid var(--gold-line); padding: 6px 13px; border-radius: 999px; margin-bottom: 20px;
  letter-spacing: .08em; text-transform: uppercase; }
.eyebrow svg { width: 16px; height: 16px; }
.lp-hero h1 { font-size: clamp(2.2rem, 1.3rem + 3.4vw, 3.8rem); line-height: 1.04; letter-spacing: -.012em; margin-bottom: 20px; font-weight: 600; }
.lp-hero h1 em { font-style: italic; color: var(--gold-ink); font-weight: 500; }
.lead { font-size: clamp(1.02rem, .95rem + .3vw, 1.18rem); color: var(--ink-2); max-width: 36em; }
.lp-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
@media (max-width: 480px) { .lp-cta .btn { width: 100%; } }
.trust { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 28px; font-size: .86rem; color: var(--muted); }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 16px; height: 16px; color: var(--gold); }
.phone { justify-self: center; width: 100%; max-width: 360px; background: #111b21; border-radius: 36px; padding: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(212, 178, 122, .35); border: 1px solid #1f2c34; }
.phone .screen { background: #0b141a; border-radius: 26px; overflow: hidden; }
.phone .wa-head { display: flex; align-items: center; gap: 10px; background: #202c33; color: #e9edef; padding: 12px 14px; font-size: .9rem; }
.phone .wa-head .av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(150deg, #20386a, #0c1a35);
  display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(212, 178, 122, .5) inset; }
.phone .wa-head .av svg { width: 17px; height: 17px; stroke: var(--gold-2); }
.phone .wa-head small { display: block; color: #8696a0; font-size: .72rem; }
.phone .wa-body { padding: 16px 12px 20px; min-height: 380px; }
.phone-mock .bubble, .phone .bubble { background: #005c4b; color: #e9edef; border-radius: 10px 10px 10px 2px; padding: 10px 12px;
  white-space: pre-line; font-size: .84rem; line-height: 1.45; max-width: 92%; }
.phone .bubble .t { display: block; text-align: right; font-size: .68rem; color: #9fd7c9; margin-top: 4px; }
.lp-block { padding: 72px 20px; }
.lp-tight { padding-top: 0; }
.lp-block h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); text-align: center; margin-bottom: 10px; }
.lp-block .sub { text-align: center; color: var(--muted); max-width: 40em; margin: 0 auto 40px; }
.lp-rule { display: block; width: 56px; height: 2px; margin: 0 auto 18px; border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.features { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature .fi { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(150deg, #20386a, #0c1a35); color: var(--gold-2);
  display: grid; place-items: center; margin-bottom: 16px; box-shadow: 0 0 0 1px rgba(212, 178, 122, .35) inset; }
.feature h3 { font-size: 1.02rem; }
.feature p { margin: 0; }
.how { display: grid; gap: 16px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 800px) { .how { grid-template-columns: repeat(3, 1fr); } }
.how .card { position: relative; padding-top: 24px; }
.how .n { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); font-family: var(--serif);
  font-weight: 600; font-size: 1.05rem; font-variant-numeric: lining-nums; border: 1px solid var(--gold-line); display: grid; place-items: center; margin-bottom: 12px; }
.lp-final { background: radial-gradient(600px 240px at 50% -20%, #2a4679 0%, transparent 70%), linear-gradient(160deg, #15284b, #0c1a35);
  color: #d9e0ee; border-radius: 24px; padding: 48px 28px; text-align: center; margin-bottom: 72px; border: 1px solid rgba(212, 178, 122, .35); }
.lp-final h2 { color: #fff; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); }
.lp-final .btn { background: linear-gradient(180deg, #d9b87f 0%, var(--gold) 100%); color: #1a1406; border-color: #9c7535; }

/* ---------- bottom tab bar (mobile) ---------- */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(251, 249, 245, .95);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -18px rgba(31, 27, 20, .3); }
.tabbar a { flex: 1; max-width: 120px; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: .68rem; font-weight: 600; color: var(--muted); padding: 6px 4px; border-radius: 12px; position: relative; letter-spacing: .01em; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--primary); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.1; color: var(--primary); }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -7px; left: 30%; right: 30%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
body.has-tabbar { padding-bottom: 74px; }
@media (min-width: 761px) { .tabbar { display: none; } body.has-tabbar { padding-bottom: 0; } }

.footer { border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.footer .inner { max-width: var(--container); margin: 0 auto; padding: 20px; display: flex; gap: 8px 18px; flex-wrap: wrap; }
.footer a { color: var(--ink-2); text-decoration: none; }

/* ---------- assistant ---------- */
.chat-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 1000px) { .chat-layout { grid-template-columns: 260px minmax(0, 1fr); } }
.chat-side { display: none; }
@media (min-width: 1000px) {
  .chat-side { display: block; position: sticky; top: calc(var(--appbar-h) + 20px); align-self: start; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); max-height: calc(100vh - 120px); overflow: auto; }
}
.thread-list { margin-top: 12px; }
.thread-list a { display: block; text-decoration: none; font-size: .88rem; padding: 7px 10px; border-radius: 8px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-list a.on, .thread-list a:hover { background: var(--gold-soft); color: var(--ink); text-decoration: none; }
.thread-list li { padding: 0; border: 0; }
.chat-main { min-width: 0; max-width: 860px; }
.chat-log { display: flex; flex-direction: column; gap: 16px; margin: 18px 0; }
.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg .bubble { max-width: 88%; padding: 12px 16px; border-radius: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.msg.user .bubble { background: linear-gradient(180deg, #1d3461, var(--primary)); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg.bot .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow-sm); max-width: 100%; }
.answer p { margin: 0 0 .6em; } .answer p:last-child { margin-bottom: 0; }
.answer ul { margin: .2em 0 .6em; padding-left: 1.2em; } .answer li { margin: .25em 0; }
.answer code { font-family: var(--mono); font-size: .86em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.cite { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 4px; margin: 0 1px; font-size: .7em; font-weight: 700;
  vertical-align: super; line-height: 1; border-radius: 6px; background: var(--gold-soft); color: var(--gold-ink); text-decoration: none;
  border: 1px solid var(--gold-line); }
a.cite:hover { background: var(--gold); color: #fff; text-decoration: none; }
.sources { margin: 8px 0 0; padding: 10px 14px 10px 32px; font-size: .82rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.sources li { margin: 5px 0; } .sources a { font-weight: 600; text-decoration: none; }
.sources .quote { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.msg .status, .chat-status { display: block; margin: 0 0 6px 4px; padding: 0; border: 0; background: none; }
.typing { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulse 1s infinite; vertical-align: middle; }
.suggestions { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0 16px; }
@media (min-width: 640px) { .suggestions { grid-template-columns: 1fr 1fr; } }
.suggestion { cursor: pointer; font: inherit; font-size: .88rem; padding: 12px 14px; text-align: left; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); transition: border-color .15s, color .15s; }
.suggestion:hover { border-color: var(--gold-line); color: var(--ink); }
.chat-form { position: sticky; bottom: 78px; display: flex; gap: 8px; align-items: flex-end; background: var(--surface);
  padding: 8px; border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow); }
@media (min-width: 761px) { .chat-form { bottom: 16px; } }
.chat-form:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 15%, transparent), var(--shadow); }
.chat-form textarea { flex: 1; resize: none; border: 0; box-shadow: none; padding: 10px 8px; min-height: 44px; max-height: 160px; background: transparent; }
.chat-form textarea:focus { box-shadow: none; }

/* ---------- source viewer ---------- */
.src-row.hit td { background: #fff6d8 !important; }
.src-row.hit td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
.source-table td { scroll-margin-top: calc(var(--appbar-h) + 30px); }
.source-table td strong { white-space: nowrap; }
@media print {
  .appbar, .tabbar, .footer, .noprint, .demo-ribbon { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; }
  .src-row.hit td { background: #fff3cd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- utilities ---------- */
.u-m0{margin:0}.u-mt6{margin-top:6px}.u-mt10{margin-top:10px}.u-mt12{margin-top:12px}.u-mt14{margin-top:14px}
.u-mt16{margin-top:16px}.u-mt22{margin-top:22px}.u-mt26{margin-top:26px}.u-mb14{margin-bottom:14px}.u-mb12{margin-bottom:12px}
.u-serif{font-weight:700}.u-lg{font-size:1.1rem}.u-pre{white-space:pre-line}.u-flex1{flex:1}
.u-narrow{max-width:460px;margin:28px auto}.u-onb{max-width:600px;margin:0 auto}.u-sub{margin:-4px 0 8px}.u-nolist{list-style:none}

/* ---------- search ---------- */
.search-form { padding: 16px; }
.search-main { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 13px;
  padding: 4px 4px 4px 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.search-main:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 16%, transparent); }
.search-main svg { color: var(--gold-ink); }
.search-main input { border: 0; box-shadow: none; padding: 10px 4px; min-height: 44px; }
.search-main input:focus { box-shadow: none; }
.search-filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
@media (min-width: 900px) { .search-filters { grid-template-columns: 150px 180px 190px 130px 1fr; } }
.search-filters .f { font-size: .74rem; font-weight: 650; color: var(--muted); margin: 0; letter-spacing: .02em; }
.search-filters .f select, .search-filters .f input { margin-top: 4px; min-height: 40px; padding: 8px 10px; font-size: .9rem; }
@media (max-width: 899px) { .search-filters .f.wide { grid-column: 1 / -1; } }
.result .res-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result .case { font-size: 1.08rem; font-weight: 700; }
.result .res-meta { margin-top: 4px; }
.result .judges { color: var(--ink-2); margin-top: 6px; }
.result .parties { margin-top: 6px; font-size: .92rem; overflow-wrap: anywhere; }
.result .advs { color: var(--ink-2); margin-top: 6px; overflow-wrap: anywhere; }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
mark { background: #fbe9b7; color: inherit; padding: 0 2px; border-radius: 3px; }
.ctx-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--gold-soft); color: var(--gold-ink);
  border: 1px solid var(--gold-line); border-radius: 999px; padding: 5px 12px; font-size: .84rem; font-weight: 600; margin: 4px 0 8px; }
.ctx-chip a { color: inherit; text-decoration: none; font-weight: 700; }
.src-links { display: inline-flex; gap: 10px; margin-left: 6px; font-size: .78rem; }
.src-links a { font-weight: 600; text-decoration: none; }
.row-links { display: flex; gap: 10px; margin-top: 4px; }
.row-links a { font-weight: 600; text-decoration: none; white-space: nowrap; }
@media (max-width: 420px) { .appbar .linkbtn span { display: none; } }

/* ---------- my cases ---------- */
.case-row { display: grid; grid-template-columns: 88px 1fr; gap: 0; padding: 0; overflow: hidden; text-decoration: none; color: inherit; }
.case-row:hover { text-decoration: none; border-color: var(--gold-line); }
.case-date { background: linear-gradient(170deg, #fbf6ec 0%, #f5eddd 100%); border-right: 1px solid var(--gold-line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 14px 6px; text-align: center; }
.case-date .lbl { font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.case-date .d { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.05; color: var(--navy); font-variant-numeric: lining-nums; }
.case-date .m { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.case-main { padding: 14px 16px; min-width: 0; }
.case-title { font-weight: 700; font-size: 1.05rem; }
.date-pair { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .date-pair { grid-template-columns: 1fr 1fr; } }
.dp { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--surface-2); }
.dp.next { background: var(--gold-soft); border-color: var(--gold-line); }
.dp .lbl { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dp.next .lbl { color: var(--gold-ink); }
.dp .v { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin: 2px 0 4px; font-variant-numeric: lining-nums; }
.captcha-box { display: flex; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.captcha-box img { max-width: 100%; height: auto; image-rendering: auto; }
.steps-list { margin: 0; padding-left: 1.2em; color: var(--ink-2); }
.steps-list li { margin: 4px 0; }
input[type=file] { font: inherit; font-size: .88rem; width: 100%; }

/* ---------- diary ---------- */
.kicker-sm { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); }
.date-pick { min-height: 34px; padding: 5px 8px; font-size: .88rem; width: auto; }
.diary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.diary-row { display: grid; grid-template-columns: 124px 130px minmax(0, 1fr) 150px 300px; border-top: 1px solid var(--line); }
.diary-row > div:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.diary-row:first-child { border-top: 0; }
.diary-row > div { padding: 13px 14px; border-left: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.diary-row > div:first-child { border-left: 0; }
.diary-headrow { background: var(--surface-2); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.diary-headrow > div { padding: 11px 14px; }
.diary-row .part a { text-decoration: none; color: var(--ink); font-weight: 560; }
.diary-row .part a:hover { color: var(--link); }
.diary-row.done { background: #fbfcfa; }
.diary-row.hc { background: #fdfbf6; }
.diary-row:target { box-shadow: inset 4px 0 0 var(--gold); background: var(--gold-soft); }
.next-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.next-form input { min-height: 36px; padding: 6px 9px; font-size: .86rem; }
.next-form input[name=note], .next-form input[name=stage] { grid-column: 1 / -1; }
.next-form button { grid-row: 1; grid-column: 2; }
.hall-link { font-weight: 700; text-decoration: none; }
.diary-empty { padding: 30px; text-align: center; border-top: 1px solid var(--line); }
.pending-card { border-color: var(--gold-line); background: #fffaf0; }
.add-case summary { cursor: pointer; }
.add-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.add-grid label { font-size: .8rem; color: var(--muted); margin: 0; }
.add-grid label input { margin-top: 4px; }
.add-grid .wide { grid-column: 1 / -1; }
.print-only { display: none; }
@media (max-width: 900px) {
  .diary-headrow { display: none; }
  .diary-row { grid-template-columns: 1fr 1fr; padding: 6px 0; }
  .diary-row > div { border-left: 0; padding: 6px 14px; }
  .diary-row > .part, .diary-row > .next { grid-column: 1 / -1; }
  .diary-row > div::before { content: attr(data-label); display: block; font-size: .64rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
  .add-grid { grid-template-columns: 1fr; }
}
.hall-card.on { border-color: var(--gold-line); box-shadow: 0 0 0 2px var(--gold-soft), var(--shadow); }
.hall-code { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.stack label, .card label { display: block; }
@media print {
  .diary { box-shadow: none; border-color: #999; }
  .diary-row, .diary-row > div { border-color: #999 !important; }
  .print-only { display: inline; }
  .diary-row.done, .diary-row.hc { background: #fff; }
}
.scan-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 30px 16px;
  border: 1.5px dashed var(--gold-line); border-radius: var(--radius); background: #fffaf0; color: var(--ink); cursor: pointer; }
.scan-drop svg { width: 34px; height: 34px; color: var(--gold-ink); }
.scan-drop input[type=file] { margin-top: 8px; max-width: 280px; }
.scan-row.unclear { border-color: #ecd0a6; background: #fffaf2; }
.check-inline { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; margin-right: 10px; }

/* ---------- CRM ---------- */
.client-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.client-row:hover { text-decoration: none; border-color: var(--gold-line); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); display: grid;
  place-items: center; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; flex: 0 0 auto; border: 1px solid var(--gold-line); }
.avatar.lg { width: 56px; height: 56px; font-size: 1.45rem; }
.note-form, .task-form { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.note-form textarea { flex: 1 1 100%; min-height: 60px; }
.task-form input[type=text] { flex: 1 1 200px; }
.task-form input[type=date] { width: auto; }
.note { border-top: 1px solid var(--line); padding-top: 10px; }
.task { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task.overdue .task-title { color: var(--error); }
.tick { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer;
  color: #fff; font-weight: 800; line-height: 1; display: grid; place-items: center; padding: 0; transition: border-color .15s; }
.tick:hover { border-color: var(--gold); }
.task.done .tick { background: var(--ok); border-color: var(--ok); }
.client-box select { width: auto; min-height: 36px; padding: 6px 10px; }
.client-box input { width: auto; min-height: 36px; padding: 6px 10px; }
.cal-day.is-today { border-color: var(--gold-line); box-shadow: 0 0 0 2px var(--gold-soft), var(--shadow); }
.cal-date { width: 64px; text-align: center; display: flex; flex-direction: column; align-self: flex-start; }
.cal-date .dow { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.cal-date .dnum { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums; }
.cal-date .mon { font-size: .78rem; color: var(--muted); }
.cal-list { list-style: none; padding: 0; margin: 8px 0 0; }
.cal-list li { padding: 5px 0; border-top: 1px dashed var(--line); }
.cal-list li:first-child { border-top: 0; }

/* nav: icon buttons */
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); text-decoration: none; }
.iconbtn:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.iconbtn[aria-current="page"] { background: var(--gold-soft); color: var(--gold-ink); box-shadow: 0 0 0 1px var(--gold-line) inset; }
.iconbtn svg { width: 19px; height: 19px; }
.mob-only { display: none; }
.brand-text span { white-space: nowrap; }
@media (max-width: 1480px) { .appbar nav a.desk { padding: 8px 10px; } .appbar nav a.desk svg { display: none; } }
@media (max-width: 1100px) { .appbar nav a.desk { padding: 8px 8px; font-size: .88rem; } .brand-text span { display: none; } }
@media (max-width: 760px) {
  .mob-only { display: inline-grid; }
  .desk-only { display: none; }
  .appbar nav { gap: 0; }
  .appbar .linkbtn { padding: 8px; }
}

/* voice */
.mic { width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--primary);
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.mic svg { width: 21px; height: 21px; }
.mic:hover { background: var(--gold-soft); border-color: var(--gold-line); }
.mic.on { background: var(--error); border-color: var(--error); color: #fff; animation: pulse 1.4s infinite; }
.mic:disabled { opacity: .5; cursor: not-allowed; }
.voice-note { min-height: 1.2em; margin: 6px 0 0; color: var(--gold-ink); font-weight: 600; }
input[type=date], input[type=url], input[type=search] { font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 42px; outline: none; }
input[type=date]:focus, input[type=url]:focus, input[type=search]:focus { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); }
.card label > input, .card label > select, .card label > textarea, .stack label > input { display: block; width: 100%; margin-top: 4px; }
.task-form input[type=date], .date-pick, .next-form input[type=date] { width: auto; display: inline-block; margin-top: 0; }
.next-form input[type=date] { width: 100%; }
@media (max-width: 420px) { .brand-text span { display: none; } .iconbtn { width: 34px; } }

/* ---------- Talk to Sage (hands-free voice) ---------- */
.talk-open { gap: 8px; }
.talk-open svg { width: 18px; height: 18px; color: var(--gold-2); }
body.talk-lock { overflow: hidden; }
.talk { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; overflow-y: auto;
  background: radial-gradient(900px 520px at 50% 0%, rgba(239, 227, 201, .9) 0%, transparent 65%), rgba(247, 244, 238, .97);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.talk[hidden] { display: none; }
.talk-inner { width: 100%; max-width: 720px; padding: calc(18px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; min-height: 100%; }
.talk-top { display: flex; align-items: center; }
.talk-close { width: 44px; height: 44px; border: 0; cursor: pointer; background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line) inset; }
.talk-stage { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(24px, 8vh, 72px) 0 18px; }
.orb { position: relative; width: 176px; height: 176px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: transparent; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.orb::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid var(--gold-line);
  background: radial-gradient(circle, rgba(212, 178, 122, .18) 0%, transparent 70%); transition: transform .3s, opacity .3s; }
.orb-core { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, #2e4c85 0%, #15284b 55%, #0a1630 100%); color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(212, 178, 122, .55) inset, 0 24px 60px -20px rgba(12, 26, 53, .65); transition: transform .25s; }
.orb-core svg { width: 54px; height: 54px; stroke-width: 1.5; }
.orb:hover .orb-core { transform: scale(1.02); }
.orb:focus-visible { outline: none; }
.orb:focus-visible .orb-core { box-shadow: 0 0 0 3px rgba(212, 178, 122, .55) inset, 0 0 0 6px color-mix(in srgb, var(--gold) 45%, transparent); }
.talk[data-state="listening"] .orb::before { animation: talk-ring 1.6s ease-out infinite; }
.talk[data-state="listening"] .orb-core { box-shadow: 0 0 0 3px var(--gold-2) inset, 0 24px 60px -20px rgba(12, 26, 53, .65); }
.talk[data-state="thinking"] .orb::before { border: 3px solid transparent; border-top-color: var(--gold); border-right-color: var(--gold-2);
  background: none; animation: talk-spin 1.1s linear infinite; }
.talk[data-state="speaking"] .orb-core { animation: talk-breathe 1.3s ease-in-out infinite; }
.talk[data-state="error"] .orb-core { box-shadow: 0 0 0 3px rgba(180, 35, 35, .6) inset, 0 24px 60px -20px rgba(12, 26, 53, .65); }
@keyframes talk-ring { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.28); opacity: 0; } }
@keyframes talk-spin { to { transform: rotate(360deg); } }
@keyframes talk-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) {
  .talk[data-state] .orb::before, .talk[data-state] .orb-core { animation: none; }
}
.talk-state { margin-top: 26px; font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); min-height: 1.2em; }
.talk[data-state="error"] .talk-state { color: var(--error); text-transform: none; letter-spacing: 0; font-size: .95rem; max-width: 30em; }
.talk-you { font-family: var(--serif); font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); line-height: 1.3; margin: 14px 0 0; min-height: 1.3em;
  color: var(--ink); max-width: 30em; overflow-wrap: anywhere; }
.talk-answer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; font-size: 1.02rem; line-height: 1.65; max-height: 38vh; overflow-y: auto; }
.talk-answer:empty { display: none; }
.talk-cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.talk-cites a.chip { text-decoration: none; }
.talk-foot { margin: auto 0 0; padding-top: 18px; text-align: center; }
@media (max-width: 520px) { .orb { width: 148px; height: 148px; } .orb-core svg { width: 46px; height: 46px; } .talk-answer { max-height: 34vh; } }

/* ---------- Drafting ---------- */
.draft-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.draft-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); }
.block-line { display: block; margin-top: 2px; }
.draftpage .page { max-width: 1440px; padding-top: 20px; }
.draft-head .draft-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); width: min(360px, 90vw); z-index: 20; box-shadow: var(--shadow-lg); }
.draft-tabs { display: none; }
.draft-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 20px; margin-top: 16px;
  height: calc(100vh - var(--appbar-h) - 150px); min-height: 520px; }
.draft-chat { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.papers summary { cursor: pointer; }
.papers .list li { gap: 8px; padding: 8px 0; }
.papers .list svg { width: 16px; height: 16px; color: var(--gold-ink); }
.draft-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.draft-log .msg .bubble { max-width: 94%; font-size: .94rem; white-space: pre-wrap; }
.draft-log .msg.bot .bubble { max-width: 100%; }
.draft-log .chip { display: inline-flex; }
.draft-hint { padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.draft-form { position: static; }
.draft-docpane { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.doc-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.doc-status { font-weight: 600; color: var(--gold-ink); }
.paper { flex: 1; overflow-y: auto; margin: 18px auto; width: calc(100% - 36px); max-width: 820px; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 56px 64px;
  font-family: "Times New Roman", Times, Georgia, serif; font-size: 1.04rem; line-height: 1.75; color: #111; }
.paper .para { border-radius: 4px; transition: background-color 1.2s ease; margin: 0 -8px; padding: 0 8px; }
.paper .para p { margin: 0 0 1em; text-align: justify; }
.paper .para h2 { font-family: inherit; font-size: 1.12rem; font-weight: 700; text-align: center; margin: 0 0 .9em; letter-spacing: .02em; }
.paper .para h3 { font-family: inherit; font-size: 1.04rem; font-weight: 700; margin: 1.2em 0 .6em; text-decoration: underline; text-underline-offset: 3px; }
.paper .para h4 { font-family: inherit; font-size: 1rem; font-weight: 700; margin: 1em 0 .5em; }
.paper .para.chg { background: #fff4d6; box-shadow: inset 3px 0 0 var(--gold); }
.paper .para.writing::after { content: "▍"; color: var(--gold); animation: pulse 1s infinite; }
.paper mark.tbc { background: #fde8e6; color: #8f1d1d; padding: 0 3px; border-radius: 3px; font-family: var(--sans); font-size: .85em; }
.paper-empty { text-align: center; padding: 80px 0; font-family: var(--sans); }
.paper-edit { flex: 1; display: flex; flex-direction: column; padding: 14px; min-height: 0; }
.paper-edit textarea { flex: 1; min-height: 300px; font-family: "Times New Roman", Times, Georgia, serif; font-size: 1rem; line-height: 1.6; resize: none; }
.skill-card.is-off { opacity: .72; }
.subtabs { display: inline-flex; gap: 2px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 0 0 18px; }
.subtabs a { padding: 7px 18px; border-radius: 9px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.subtabs a:hover { color: var(--ink); text-decoration: none; }
.subtabs a[aria-current="page"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.skill-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; }
.skill-row.is-off { opacity: .72; }
.skill-main { min-width: 0; }
.skill-name { gap: 8px; flex-wrap: wrap; }
.skill-peek { margin: 8px 0 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-actions { margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.linkbtn.danger-link { color: var(--error); }
.u-narrow-field { max-width: 140px; }
@media (max-width: 999px) {
  .draft-tabs { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-top: 14px; }
  .draft-tabs button { border: 0; background: none; font: inherit; font-weight: 600; padding: 7px 18px; border-radius: 9px; color: var(--ink-2); cursor: pointer; }
  .draft-tabs button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
  .draft-layout { grid-template-columns: 1fr; height: calc(100vh - var(--appbar-h) - 210px); min-height: 460px; }
  .draft-layout[data-show="chat"] .draft-docpane, .draft-layout[data-show="doc"] .draft-chat { display: none; }
  .paper { padding: 28px 22px; width: calc(100% - 20px); margin: 10px auto; font-size: 1rem; }
  body.has-tabbar.draftpage .draft-layout { height: calc(100vh - var(--appbar-h) - 270px); }
}
@media (prefers-reduced-motion: reduce) { .paper .para.writing::after { animation: none; } }
@media print {
  .draftpage .draft-head, .draftpage .draft-tabs, .draftpage .draft-chat, .draftpage .doc-toolbar { display: none !important; }
  .draftpage .draft-layout { display: block; height: auto; }
  .draftpage .draft-docpane { border: 0; background: #fff; }
  .draftpage .paper { box-shadow: none; border: 0; padding: 0; margin: 0; width: 100%; max-width: none; overflow: visible; }
  .paper .para.chg { background: none; box-shadow: none; }
}

/* Drafting voice bar: a compact live voice control above the instruction box */
.voicebar { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: linear-gradient(160deg, #fffaf0, #ffffff 70%);
  border: 1px solid var(--gold-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.voicebar[hidden] { display: none; }
.orb.orb-sm { width: 52px; height: 52px; flex: 0 0 auto; }
.orb.orb-sm::before { inset: -6px; }
.orb.orb-sm .orb-core svg { width: 22px; height: 22px; }
.vb-text { flex: 1; min-width: 0; }
.vb-state { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.voicebar[data-state="error"] .vb-state { color: var(--error); text-transform: none; letter-spacing: 0; font-size: .86rem; }
.vb-heard { font-family: var(--serif); font-size: 1.02rem; color: var(--ink); margin-top: 2px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 1.3em; }
.voicebar[data-state="listening"] .orb::before { animation: talk-ring 1.6s ease-out infinite; }
.voicebar[data-state="listening"] .orb-core { box-shadow: 0 0 0 3px var(--gold-2) inset, 0 10px 24px -12px rgba(12, 26, 53, .65); }
.voicebar[data-state="thinking"] .orb::before, .voicebar[data-state="connecting"] .orb::before { border: 3px solid transparent; border-top-color: var(--gold); border-right-color: var(--gold-2);
  background: none; animation: talk-spin 1.1s linear infinite; }
.voicebar[data-state="speaking"] .orb-core { animation: talk-breathe 1.3s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .voicebar[data-state] .orb::before, .voicebar[data-state] .orb-core { animation: none; } }
.draft-form .mic { align-self: flex-end; }
.voice-hint { padding: 0 4px; }

/* Use desktop width while retaining compact reading pages and phone gutters. */
.has-tabbar { --container: 1680px; }
.cause-list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.list-controls { flex-wrap: wrap; align-items: end; gap: 14px; }
@media (min-width: 1500px) { .has-tabbar .page, .has-tabbar .appbar .inner, .has-tabbar .footer .inner { padding-left: 40px; padding-right: 40px; } }
@media (min-width: 761px) and (max-width: 1250px) { .has-tabbar .appbar .inner { height: auto; min-height: var(--appbar-h); flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 8px; } .has-tabbar .appbar nav { flex-wrap: wrap; } }
@media (max-width: 760px) { .tabbar a { min-width: 0; font-size: .65rem; } }
