/* Speak2Legal — "Chambers" theme (20261023m): charcoal black, champagne gold used sparingly
   (the microphone, the primary action, active marks, rules).
   Lora for the voice of the firm (headings, case titles, the answer); Inter for everything you operate.
   Loaded after styles.css: it only restyles. Every id, class and behaviour stays as it was. */
:root {
  --bg: #111316;            /* charcoal black */
  --surface: #181B1F;       /* raised charcoal */
  --surface-2: #20242A;
  --side: #14171A;          /* sidebar */
  --line: #2B3037;          /* hairline */
  --line-2: #3A4048;
  --text: #ECE7DE;          /* warm white */
  --muted: #A39E95;
  --accent: #C9A86A;        /* champagne gold */
  --accent-ink-text: #D6B97E; /* gold that reads as text on charcoal */
  --accent-soft: rgba(201,168,106,.12);
  --accent-line: rgba(201,168,106,.42);
  --accent-ink: #121417;
  --ink: #C9A86A;           /* the primary action: gold */
  --ink-hover: #D6B97E;
  --on-ink: #15171A;        /* text and icons on gold */
  --ink-2: #CFCAC1;
  --placeholder: #7D7A73;
  --dot: #6F6B64;
  --warn-bg: rgba(217,179,106,.07);
  --draft-bg: #1D2024;
  --ok: #7FB69A;
  --warn: #D9B36A;
  --bad: #E0907E;
  --font-display: 'Lora', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Noto Sans Devanagari', serif;
  --font-body: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, 'Noto Sans Devanagari', sans-serif;
  --r: 14px;
  --r-sm: 10px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.28);
  color-scheme: dark;
}
html, body { background: var(--bg); color: var(--text); }
body { font: 15.5px/1.6 var(--font-body); letter-spacing: 0; }
a { color: var(--accent-ink-text); }
::selection { background: rgba(201,168,106,.28); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Type: the serif speaks, the sans works. No tracked capitals. */
h1, h2, h3, .page-head .title, #pageTitle, h2.title, .welcome h1, .file-head .title, .sec-h { font-family: var(--font-display); font-weight: 500; letter-spacing: -.005em; color: var(--text); }
.brand { font-family: var(--font-display); font-weight: 500; color: var(--text); letter-spacing: 0; }
.brand b { color: var(--accent-ink-text); font-weight: 500; }
.brand .beta { font: 500 10.5px/1 var(--font-body); color: var(--muted); border-color: var(--line-2); }
.eyebrow, .section-h, .action .kind, table.results th, .usp-head { text-transform: none; letter-spacing: 0; }
.section-h { font: 600 13.5px/1.4 var(--font-body); color: var(--text); margin: 14px 0 4px; }
.eyebrow { font-size: 13px; color: var(--muted); }
.small { font-size: 13.5px; }
.muted { color: var(--muted); }

/* ---------- chrome: header and sidebar ---------- */
.appbar { background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid transparent; height: 60px; }
.page .page-head, .appbar.scrolled { border-bottom-color: var(--line); }
.icon-btn { color: var(--ink-2); border-radius: 10px; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.lang-btn { background: transparent !important; color: var(--muted) !important; border: 1px solid var(--line) !important; font-weight: 500 !important; }
.lang-btn:hover { color: var(--text) !important; border-color: var(--line-2) !important; }
.scrim { background: rgba(0,0,0,0.6); }
.drawer { background: var(--side); border-right: 1px solid var(--line); padding-inline: 12px; gap: 4px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 14px 8px; }
.drawer-head .brand { font-size: 22px; }
.side-collapse { width: 34px; height: 34px; color: var(--muted); }
.drawer-nav button { color: var(--ink-2); font-size: 14.5px; padding: 9px 10px; border-radius: 9px; }
.drawer-nav button svg { color: var(--muted); stroke-width: 1.6; }
.drawer-nav button:hover { background: rgba(255,255,255,.04); }
.drawer-nav .nav-new { background: var(--surface); border: 1px solid var(--line); font-weight: 600; color: var(--text); margin-bottom: 10px; }
.drawer-nav .nav-new:hover { background: var(--surface); border-color: var(--line-2); }
.drawer-nav button.on, .drawer-nav button.on:hover { background: var(--surface) !important; color: var(--text) !important; box-shadow: inset 2px 0 0 var(--accent); }
.drawer-nav button.on svg { color: var(--accent-ink-text); }
.nav-group { color: var(--muted); font-size: 12.5px; padding: 14px 10px 4px; letter-spacing: 0; text-transform: none; }
.recent-chats button, .recent-chats a { color: var(--ink-2); }
.drawer-settings { border-top-color: var(--line); }
.drawer-foot a { color: var(--accent-ink-text); }
@media (min-width: 1024px) {
  .drawer, .drawer[hidden] { width: 264px; }
  body.chat-app { padding-left: 264px; }
  .appbar { margin-left: -264px; padding-left: calc(264px + 16px); }
  .composer { left: 264px; }
  .side-collapse { display: grid; }
  body.side-collapsed { padding-left: 0; }
  body.side-collapsed .drawer, body.side-collapsed .drawer[hidden] { display: none !important; }
  body.side-collapsed .appbar { margin-left: 0; padding-left: 16px; }
  body.side-collapsed .composer { left: 0; }
  body.side-collapsed #menuBtn, body.side-collapsed .appbar .brand { display: flex; }
}
@media (max-width: 1023px) { .side-collapse { display: grid; } }

/* ---------- buttons, inputs, pills ---------- */
.btn { background: transparent; border: 1px solid var(--line-2); color: var(--text); border-radius: 10px; font-weight: 500; box-shadow: none; }
.btn:hover { border-color: var(--ink-2); background: transparent; }
.btn.primary { background: var(--ink); border-color: var(--on-ink); color: var(--on-ink); font-weight: 600; }
.btn.primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); filter: none; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: var(--line); }
.btn.danger, .btn.ghost.danger { color: var(--bad); }
.btn.small { border-radius: 8px; }
button.link, .link { color: var(--accent-ink-text); text-decoration-color: rgba(214,185,126,.4); }
.input, select.input, textarea.input { background: var(--surface); border-color: var(--line-2); border-radius: 10px; color: var(--text); }
.input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(0,0,0,0.24); }
.input::placeholder, .composer textarea::placeholder { color: var(--placeholder); }
.field span { color: var(--muted); font-size: 13px; }
.chip { border-color: var(--line-2); color: var(--ink-2); background: transparent; }
.chip:hover { border-color: var(--ink-2); color: var(--text); }
.pill { border-color: var(--line-2); color: var(--muted); background: transparent; font-weight: 500; }
.pill.yellow { color: var(--accent-ink-text); border-color: var(--accent-line); background: var(--accent-soft); }
.pill.ok, .pill.fav { color: var(--ok); border-color: rgba(127,182,154,.32); background: rgba(127,182,154,.06); }
.pill.warn { color: var(--warn); border-color: rgba(217,179,106,.3); background: rgba(217,179,106,.06); }
.pill.unfav { color: var(--bad); border-color: rgba(224,144,126,.3); background: rgba(224,144,126,.05); }
.check, .switch input { accent-color: var(--on-ink); }
.spinner { border-color: var(--line); border-top-color: var(--ink-2); }
mark { background: rgba(201,168,106,.24); color: inherit; }

/* ---------- surfaces: fewer boxes, more paper ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; }
.item { background: var(--surface); border-color: var(--line); border-radius: var(--r-sm); }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: 10px; color: var(--text); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.empty { border-color: var(--line-2); color: var(--muted); background: transparent; }
.modal-bg { background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-color: var(--line); border-radius: 18px; box-shadow: 0 24px 80px rgba(0,0,0,0.6); }
.toast { background: var(--text); color: var(--bg); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.6); }
.toast.error { background: var(--bad); color: #fff; }
.table-wrap { border-color: var(--line); border-radius: 12px; background: var(--surface); }
table.results th { background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
table.results td { border-bottom-color: var(--line); }
table.results tr:hover td { background: rgba(201,168,106,.04); }
table.mini-table th, table.mini-table td { border-color: var(--line); }
table.mini-table thead th, table.mini-table th[scope="row"] { background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
table.compare th, table.compare td { border-color: var(--line); }
table.compare th[scope="row"] { background: var(--surface-2); }
.judgment-text, .doc-text { background: var(--surface); border-color: var(--line); }

/* ---------- the console: one place to speak, type or upload ---------- */
.welcome { max-width: 760px; }
body.home .welcome { padding-block: clamp(20px, 6vh, 64px) 28px; }
.console { width: 100%; margin-top: 18px; display: grid; justify-items: center; }
.mic-row { gap: 28px; margin-top: 4px; align-items: center; }
.big-mic, .mic-row .big-mic, body.signed-in .big-mic { position: relative; width: 96px; height: 96px; border-radius: 50%; border: 0; color: var(--on-ink);
  background: radial-gradient(circle at 50% 32%, #E4CB95 0%, #C9A86A 58%, #A6844C 100%);
  box-shadow: 0 0 0 1px rgba(201,168,106,.55) inset, 0 0 0 7px var(--bg), 0 0 0 8px var(--accent-line), 0 14px 34px rgba(0,0,0,0.6); transition: transform .15s ease, background .2s ease; }
.big-mic svg, .mic-row .big-mic svg { width: 36px; height: 36px; }
.big-mic:hover { transform: translateY(-1px); }
.big-mic.listening { background: var(--surface-2); color: var(--accent); }
.big-mic::before, .big-mic::after { border-color: rgba(201,168,106,.55); inset: -14px; }
.mic-side { width: auto; min-width: 76px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--ink-2); display: inline-flex; gap: 7px; align-items: center; font: 500 13.5px/1 var(--font-body); }
.mic-side svg { width: 17px; height: 17px; stroke: var(--ink-2); }
.mic-side:hover, .mic-side:focus-visible { border-color: var(--ink-2); background: transparent; }
.big-mic-label, body.signed-in .big-mic-label { margin: 18px 0 0; color: var(--muted); font-size: 14px; font-weight: 400; }
.home-slot, body.signed-in .home-slot { margin-top: 18px; }
.big-mic-label + .home-slot { margin-top: 18px; }

/* composer (home and conversation) */
.composer { background: linear-gradient(to top, var(--bg) 72%, transparent); }
.composer-box, .home-slot .composer-box, body.signed-in .home-slot .composer-box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-1); padding: 12px 10px 10px 16px; }
.composer-box:focus-within { border-color: var(--line-2); box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 10px 32px rgba(0,0,0,0.32); }
.composer textarea { color: var(--text); font-size: 16px; }
.home-slot .composer textarea, body.signed-in .home-slot .composer textarea { min-height: 48px; }
.composer .interim { color: var(--muted); font-style: normal; }
.composer-row { gap: 10px; }
.composer-box .icon-btn.plus { width: 36px; height: 36px; border: 1px solid var(--line-2); color: var(--ink-2); }
.composer-box .icon-btn.plus:hover { border-color: var(--ink-2); background: transparent; }
.composer-box .mic { width: 40px; height: 40px; background: var(--ink); color: var(--on-ink); box-shadow: 0 0 0 1px rgba(201,168,106,.5) inset; }
.composer-box .mic svg { width: 19px; height: 19px; }
.composer-box .mic.listening { background: var(--accent); color: var(--on-ink); box-shadow: 0 0 0 5px var(--accent-soft); }
.icon-btn.mic-small { border-color: var(--line-2); color: var(--ink-2); width: 36px; height: 36px; }
#commandForm:not(.has-text) #miniMic { display: none; }
#commandForm .composer-box.rec-on #miniMic { display: none; }
#miniMic.listening { background: var(--accent); color: var(--on-ink); }
.icon-btn.send { background: var(--ink); color: var(--on-ink); width: 40px; height: 40px; }
#send.ready { background: var(--ink); color: var(--on-ink); box-shadow: 0 0 0 1px var(--accent) inset; animation: none; }
.composer .mic-state { color: var(--accent-ink-text); }
.s2l-busy { color: var(--muted); }
.s2l-busy .typing i { background: var(--accent); }
.rec-dot { background: var(--bad); }
.rec-wave i { background: var(--accent); }

/* voice state: Ready · Listening · Transcribing · Processing · Review */
.voice-status { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 7px; font: 500 12.5px/1 var(--font-body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); flex: none; }
.voice-status[data-state="listening"] { color: var(--text); }
.voice-status[data-state="listening"] i { background: var(--bad); animation: recblink 1.1s ease-in-out infinite; }
.voice-status[data-state="transcribing"] { color: var(--accent-ink-text); }
.voice-status[data-state="transcribing"] i { background: var(--accent); }
.voice-status[data-state="processing"] { color: var(--ink-2); }
.voice-status[data-state="processing"] i { background: transparent; border: 1.5px solid var(--line-2); border-top-color: var(--ink-2); width: 9px; height: 9px; animation: spin .8s linear infinite; }
.voice-status[data-state="review"] { color: var(--ok); }
.voice-status[data-state="review"] i { background: var(--ok); }
body:not(.home) .voice-status[data-state="ready"] span { visibility: hidden; }
body:not(.home) .voice-status[data-state="ready"] i { visibility: hidden; }

/* ---------- signed-in home ---------- */
body.signed-in .welcome { padding-top: clamp(18px, 4vh, 44px); text-align: left; justify-items: stretch; }
.lh-brand { display: none !important; }
body.signed-in .welcome .office { margin: 0 0 6px; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
body.signed-in .office-head { margin-bottom: 14px; align-items: baseline; }
body.signed-in .office-head h2 { font: 500 21px/1.2 var(--font-display); color: var(--text); }
body.signed-in .office-head .small { font-size: 13.5px; }
body.signed-in .otiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
body.signed-in .otile { all: unset; box-sizing: border-box; display: grid; gap: 2px; align-content: start; padding: 2px 16px 2px 0; margin-right: 16px; border-right: 1px solid var(--line); cursor: pointer; text-align: left; min-width: 0; }
body.signed-in .otile:last-child { border-right: 0; margin-right: 0; }
body.signed-in .otile:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
body.signed-in .otile b { font: 500 30px/1.1 var(--font-display); color: var(--text); }
body.signed-in .otile span { font-size: 13px; line-height: 1.3; color: var(--muted); }
body.signed-in .otile small { display: none; }
body.signed-in .otile.warn b { color: var(--bad); }
body.signed-in .otile.warn small { display: block; font-size: 12px; color: var(--bad); }
body.signed-in .otile:hover span { color: var(--text); }
.cd-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.cd-list li { padding-left: 14px; position: relative; }
.cd-list li::before { content: ''; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.cd-open, body.signed-in .cd-open { all: unset; margin-top: 14px; display: inline-block; cursor: pointer; color: var(--accent-ink-text); font-weight: 500; font-size: 14px; }
.cd-open::after { content: ' →'; }
.cd-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.ask-h, body.signed-in .ask-h { font: 500 clamp(26px, 3.4vw, 34px)/1.2 var(--font-display); color: var(--text); text-align: center; margin: 34px 0 0; letter-spacing: -.01em; }
body.signed-in .console { margin-top: 22px; }
body.signed-in .mic-row { margin-top: 0; }
body.signed-in .mic-side { padding: 9px 12px; }
body.signed-in #homeType { display: none; }
/* shortcuts: four quiet entries, no tiles */
.primary-acts, body.signed-in .primary-acts { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 6px; margin: 20px 0 0; }
.primary-acts .pa, body.signed-in .primary-acts .pa { flex-direction: row; min-height: 0; gap: 8px; padding: 9px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 14.5px; font-weight: 500; }
.primary-acts .pa svg { width: 18px; height: 18px; stroke-width: 1.6; color: var(--accent-ink-text); }
.primary-acts .pa:hover { background: var(--surface-2); color: var(--text); }
#actTeam { display: none !important; }
.welcome .legal-line { color: var(--muted); font-size: 12.5px; margin-top: 26px; }
.welcome .legal-line + .legal-line { margin-top: 4px; }

/* ---------- visitor home ---------- */
.welcome h1 { font: 500 clamp(34px, 5.4vw, 52px)/1.08 var(--font-display); letter-spacing: -.015em; color: var(--text); }
.welcome .tagline { color: var(--accent-ink-text); font-weight: 500; font-family: var(--font-display); font-style: italic; font-size: clamp(16px, 2vw, 19px); }
.home-sub { color: var(--muted); font-size: 15px; }
.usp-head { color: var(--accent-ink-text); font: 500 15px/1.3 var(--font-display); }
.usp-list { border-top-color: var(--line-2); }
.usp-item b { font-family: var(--font-display); font-weight: 500; }
.feat-grid { gap: 0; border-top: 1px solid var(--line); }
.feat-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 14px 12px 14px 0; }
.feat-card:hover, .feat-card:focus-visible { background: transparent; }
.feat-card:hover b { color: var(--accent-ink-text); }
.feat-card svg { stroke: var(--accent-ink-text); stroke-width: 1.5; }
.feat-card b { font: 500 15px/1.3 var(--font-display); }
.feat-alt { color: var(--accent-ink-text); }
.feat-more { border-color: var(--line-2); color: var(--ink-2); }
.feat-more:hover { background: transparent; border-color: var(--ink-2); }
.pub-plans { border-color: var(--line); background: var(--surface); }
.pp { background: transparent; border-color: var(--line); }
.pp-pro { border-color: var(--accent-line); }
.pp-price { color: var(--text); font-family: var(--font-display); font-weight: 500; }

/* ---------- conversation ---------- */
.thread { gap: 28px; }
.msg-user { background: var(--surface-2); border: 0; color: var(--text); border-radius: 18px 18px 6px 18px; padding: 10px 16px; }
.avatar { background: var(--ink); color: var(--on-ink); font: 600 10px/1 var(--font-body); box-shadow: 0 0 0 1px rgba(201,168,106,.5) inset; }
.bot-head { color: var(--muted); }
.msg-bot .lead { color: var(--text); }
.rcard { background: var(--surface); border-color: var(--line); border-radius: 12px; }
.rcard .t { font: 500 16px/1.35 var(--font-display); }
.rcard .refno { background: var(--surface-2); color: var(--ink-2); font-family: var(--font-body); }

/* research answer: the answer first, sources clearly, the long part folds away */
.answer, .ai-out { background: var(--surface); border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow-1); line-height: 1.65; }
.ai-out .section-h:first-child { margin-top: 0; color: var(--accent-ink-text); font-size: 13px; }
.ai-out .section-h:first-child + * , .ai-out .ans-lead { font: 400 19px/1.55 var(--font-display); color: var(--text); }
.ai-out .ai-pt::before { color: var(--accent); }
.ai-out a.ref-name, a.ref { color: var(--accent-ink-text); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(214,185,126,.35); }
.ai-out a.ref-name:hover, a.ref:hover { border-bottom-color: var(--accent-ink-text); }
.ans-more { border-top-color: var(--line); }
.ans-more > summary { padding: 8px 0; font-weight: 600; color: var(--ink-2); }
.ans-more > summary::before { color: var(--accent-ink-text); }
.ans-actions { gap: 4px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.ans-actions .btn, .ans-actions button { border-color: transparent; color: var(--ink-2); padding-inline: 10px; }
.ans-actions .btn:hover, .ans-actions button:hover { background: var(--surface-2); border-color: transparent; }
.compare-bar { background: var(--surface); border-color: var(--accent-line); box-shadow: var(--shadow-1); }

/* ---------- Court Clerk review ---------- */
.order-card { gap: 16px; padding: 22px; }
.order-card .callout { border-left-width: 2px; }
.order-card .section-h { font: 500 18px/1.3 var(--font-display); color: var(--text); margin: 18px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.order-card .dir-list { gap: 0; counter-reset: none; }
.order-card .dir-item { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.order-card .dir-item:last-child { border-bottom: 0; }
.order-card .dir-item > div:first-child { font-size: 16px; color: var(--text); }
.order-card .dir-item blockquote { font: italic 400 15px/1.55 var(--font-display); color: var(--ink-2); border-left: 2px solid var(--accent); background: transparent; padding: 2px 12px; margin: 2px 0; }
.order-card .task-edit { padding: 10px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.review-list { gap: 10px !important; }
.review-list li { padding-bottom: 8px; border-bottom: 1px solid var(--line); list-style: none; }
.review-list { padding-left: 0 !important; }
.review-list li:last-child { border-bottom: 0; }
.client-draft { background: var(--draft-bg); border-color: var(--line); font-family: var(--font-display); font-size: 15px; }
.saved-card .lead b { font-family: var(--font-display); font-weight: 500; }
.dup-box .callout { background: var(--warn-bg); }

/* ---------- pages: case files, case file, my court day ---------- */
.page { background: var(--bg); }
.page-head { background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 1px solid var(--line); }
.page-head .title { font-size: 22px; }
.page-body { max-width: 920px; }
.file-card { background: var(--surface); border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; }
.file-card:hover, .file-card:focus-visible { border-color: var(--line-2); background: var(--surface); box-shadow: var(--shadow-1); }
.file-title { font-family: var(--font-display); font-weight: 500; }
.file-head .title { font-size: clamp(26px, 3.4vw, 32px); line-height: 1.15; }
.kpis { gap: 0 !important; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.kpis .kpi { background: transparent !important; border: 0 !important; border-right: 1px solid var(--line) !important; border-radius: 0 !important; padding: 2px 16px !important; }
.kpis .kpi:last-child { border-right: 0 !important; }
.kpis .kpi b { font: 500 26px/1.15 var(--font-display) !important; color: var(--text) !important; }
.kpis .kpi.warn b { color: var(--warn) !important; }
.kpis .kpi.bad b { color: var(--bad) !important; }
.kpis .kpi span { color: var(--muted); font-size: 13px; }
.file-sec { border-top: 0; }
.file-sec-h h3 { font: 500 19px/1.3 var(--font-display); }
.court-rec { background: var(--surface); }
.brief-text h4 { color: var(--accent-ink-text); font: 600 13px/1.4 var(--font-body); letter-spacing: 0; }
.cd-box { background: var(--surface); border-color: var(--line); }
.file-item summary .title { font-family: var(--font-body); }
.od-table td .btn.small { padding: 5px 9px; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .appbar { height: 56px; }
  body.home .welcome, body.signed-in .welcome { padding-top: 14px; }
  body.signed-in .otiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.signed-in .otile { padding-right: 8px; margin-right: 8px; }
  body.signed-in .otile b { font-size: 24px; }
  body.signed-in .otile span { font-size: 11.5px; }
  .ask-h, body.signed-in .ask-h { font-size: 24px; margin-top: 22px; }
  .big-mic, .mic-row .big-mic, body.signed-in .big-mic { width: 84px; height: 84px; }
  .mic-row { gap: 18px; }
  .big-mic-label, body.signed-in .big-mic-label { margin-top: 14px; font-size: 13.5px; }
  .primary-acts, body.signed-in .primary-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 14px; border-top: 1px solid var(--line); }
  .primary-acts .pa, body.signed-in .primary-acts .pa { justify-content: flex-start; border-radius: 0; padding: 13px 4px; border-bottom: 1px solid var(--line); }
  .bottom-nav { background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line); }
  .bottom-nav button { color: var(--muted); }
  .bottom-nav .bn-speak { color: var(--text); font-weight: 600; }
  .bottom-nav .bn-speak svg { width: 52px; height: 52px; padding: 13px; background: var(--ink); color: var(--on-ink); stroke: var(--on-ink); margin-top: -22px; box-shadow: 0 0 0 1px rgba(201,168,106,.55) inset, 0 0 0 4px var(--bg), 0 8px 20px rgba(0,0,0,0.6); }
  body[data-voice="listening"] .bottom-nav .bn-speak svg, body[data-voice="transcribing"] .bottom-nav .bn-speak svg { background: var(--accent); color: var(--on-ink); stroke: var(--ink); }
  .kpis { display: grid !important; grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .kpis .kpi:nth-child(2n) { border-right: 0 !important; }
  .order-card { padding: 16px; }
  .answer, .ai-out { padding: 16px; }
  .ai-out .section-h:first-child + *, .ai-out .ans-lead { font-size: 17.5px; }
}
@media (prefers-reduced-motion: reduce) { .voice-status i { animation: none !important; } }
/* the mic stays dead centre whether Type is shown (visitors) or not (advocates) */
.mic-row { display: grid; grid-template-columns: 1fr auto 1fr; width: 100%; }
.mic-row #homeType { justify-self: end; }
.mic-row #homeFiles { justify-self: start; }
body.signed-in .mic-row #homeType { display: inline-flex !important; visibility: hidden; }

/* one microphone on the home screen: the big one. The composer's mic returns in the conversation. */
body.home #commandForm:not(.has-text) .composer-box:not(.rec-on) #mic { display: none; }
/* pages keep the sidebar beside them on wide screens */
@media (min-width: 1024px) { body:not(.side-collapsed) .page { left: 264px; } }
.file-head + .kpis, .kpis { border-top: 0; }
/* phones: a quieter header (language as a globe), orders as rows, not a sideways table */
@media (max-width: 520px) {
  .appbar .lang-btn { width: 36px; max-width: 36px !important; padding: 0 !important; font-size: 0 !important; border: 0 !important; height: 36px;
    background: center / 20px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CFCAC1' stroke-width='1.6'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3Z'/%3E%3C/svg%3E") !important; }
  .appbar .brand { font-size: 21px; }
}
@media (max-width: 760px) {
  .od-table { min-width: 0 !important; }
  .od-table thead tr { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
  .od-table thead th { display: none; padding: 0 !important; border: 0 !important; background: transparent !important; }
  .od-table thead th:first-child { display: flex; align-items: center; gap: 10px; }
  .od-table thead th:first-child::after { content: 'Select all'; font-weight: 500; color: var(--muted); }
  .od-table thead { display: block; background: var(--surface-2); border-bottom: 1px solid var(--line); }
  .od-table tbody { display: block; }
  .od-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .od-table tr:last-child { border-bottom: 0; }
  .od-table td { border: 0 !important; padding: 0 !important; }
  .od-table td:first-child { grid-row: span 4; }
  .od-table td.od-act { padding-top: 6px !important; }
  .od-table td.od-act .btn { margin: 0 6px 6px 0; }
  .composer textarea { min-height: 0; }
}

/* ---------- legal news bar: a slim terminal-style line under the header, on every screen ---------- */
.ticker.newsbar, body.signed-in .ticker.newsbar, body.home .ticker.newsbar { position: sticky; top: 60px; z-index: 29; display: flex; align-items: center; gap: 0; height: 36px; margin: 0; max-width: none;
  border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: color-mix(in srgb, var(--surface) 92%, var(--bg)); color: var(--text); overflow: hidden; }
.ticker.newsbar[hidden] { display: none !important; }
.newsbar .ticker-label { flex: none; height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 18px; background: transparent; color: var(--accent-ink-text); font: 600 12.5px/1 var(--font-body); border-right: 1px solid var(--line); }
.newsbar .ticker-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.newsbar .ticker-track { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.newsbar .ticker-move { display: inline-flex; white-space: nowrap; animation: tick 160s linear infinite; will-change: transform; }
.newsbar:hover .ticker-move, .newsbar:focus-within .ticker-move, .newsbar.paused .ticker-move, .newsbar.held .ticker-move { animation-play-state: paused; }
.newsbar .tick-dup { display: inline-flex; }
.newsbar .tick-item { display: inline-flex; align-items: baseline; gap: 8px; padding: 0 22px 0 0; margin-left: 22px; line-height: 34px; font-size: 13.5px; color: var(--text); text-decoration: none; position: relative; }
.newsbar .tick-item::before { content: ''; position: absolute; left: -14px; top: 50%; width: 4px; height: 4px; transform: translate(-50%, -50%) rotate(45deg); background: var(--accent); opacity: .7; }
.newsbar .tick-item b { color: var(--text); font-weight: 600; margin: 0; }
.newsbar .tick-item time { color: var(--muted); font-size: 12px; }
.newsbar .tick-item:hover .tick-t, .newsbar .tick-item:focus-visible .tick-t { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.newsbar .tick-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.newsbar .ticker-age { flex: none; padding: 0 10px; color: var(--warn); font-size: 12px; white-space: nowrap; }
.tick-btn { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tick-btn:first-of-type { border-left: 1px solid var(--line); }
.tick-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tick-btn[aria-pressed="true"] svg { fill: currentColor; stroke: none; }
.tick-btn:hover, .tick-btn:focus-visible { color: var(--text); background: var(--surface-2); }
.news-show { position: fixed; right: 16px; bottom: 16px; z-index: 24; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 13px; font: 500 12.5px/1 var(--font-body); cursor: pointer; box-shadow: var(--shadow-1); }
body:not(.home) .news-show { display: none; }
@media (max-width: 760px) {
  .ticker.newsbar, body.signed-in .ticker.newsbar, body.home .ticker.newsbar { top: 56px; height: 32px; }
  .newsbar .ticker-label { padding: 0 10px 0 12px; font-size: 0; gap: 0; }
  .newsbar .ticker-label::after { content: 'News'; font-size: 12px; margin-left: 6px; }
  .newsbar .tick-item { line-height: 30px; font-size: 13px; }
  .newsbar .ticker-age { display: none; }
  .tick-btn { width: 32px; height: 32px; }
  .news-show { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .newsbar .ticker-move { animation: none; } .newsbar .ticker-track { overflow-x: auto; scrollbar-width: none; } .newsbar .tick-dup { display: none; } }

/* pages open under the header (and the news bar), so the top navigation and the news stay in place everywhere */
.page { top: 60px; }
body.news-on .page { top: 96px; }
.page .page-head { top: 0; }
@media (max-width: 760px) { .page { top: 56px; } body.news-on .page { top: 88px; } }
.modal h2, .modal h3 { font-size: clamp(20px, 2.4vw, 24px); line-height: 1.3; }
.appbar { background: var(--bg); }
/* a wide table scrolls inside its own frame; it never widens the page (owner console, firm report) */
.stack { grid-template-columns: minmax(0, 1fr); }
.owner > section, .owner .table-wrap { min-width: 0; max-width: 100%; }
@media (max-width: 760px) {
  /* invoices on phones: the work on one line, quantity and rate side by side under it; actions under the invoice */
  .inv-line { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
  .inv-line [data-ld] { grid-column: 1 / -1; }
  .inv-line .input { width: 100% !important; max-width: none !important; min-width: 0; }
  .inv-item { flex-direction: column; align-items: stretch; gap: 8px; }
  .inv-item .row { justify-content: flex-start; }
}

/* review forms: every choice and the Confirm / Cancel buttons stay reachable */
.choice-list { display: grid; gap: 6px; margin-top: 8px; }
.choice-list .switch { align-items: flex-start; line-height: 1.45; }
.choice-list .switch input { margin-top: 3px; flex: none; }
.deadline-warn { margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(224,144,126,.35); background: rgba(224,144,126,.05); border-radius: 8px; color: var(--bad); display: grid; gap: 8px; }
.deadline-warn .switch { color: var(--text); }
.deadline-court { color: var(--warn); padding-left: 26px; }
.review-actions { justify-content: flex-end; align-items: center; gap: 10px; }
.review-actions [data-why] { margin-right: auto; }
.msg-bot, .msg-user { scroll-margin-top: 108px; }
html { scroll-padding-top: 108px; scroll-padding-bottom: 96px; }
.composer-peek { display: none; }
@media (max-width: 760px) {
  /* the chat box steps aside while something is waiting for approval; "Type a message" brings it back */
  body.reviewing:not(.compose-open) .composer { display: none; }
  body.reviewing:not(.compose-open) .chat { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .composer-peek:not([hidden]) { display: inline-flex; align-items: center; gap: 8px; position: fixed; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(74px + env(safe-area-inset-bottom, 0px)); z-index: 26;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 9px 14px; font: 500 13.5px/1 var(--font-body); box-shadow: var(--shadow-1); cursor: pointer; }
  .composer-peek svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .review-actions { padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
  .review-actions [data-why]:empty { display: none; }
  .review-actions [data-why] { flex: 1 1 100%; margin: 0; }
  .review-actions .btn { flex: 1 1 0; min-height: 46px; }
  .actions-card .grid2 { grid-template-columns: 1fr; }
  html { scroll-padding-top: 96px; scroll-padding-bottom: 150px; }
  .msg-bot, .msg-user { scroll-margin-top: 96px; }
  /* the keyboard is up: the bottom bar and the peek button give way to the field being typed in */
  body.kb-open .bottom-nav, body.kb-open .composer-peek { display: none !important; }
  body.kb-open .composer { bottom: 0; }
}
@media (max-width: 360px) {
  .actions-card { padding: 14px; }
  .choice-list .switch { font-size: 13px; }
}
@media (max-width: 760px) {
  .update-card > .row:last-child, .order-card > .row:last-child { padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
  .update-card > .row:last-child .btn, .order-card > .row:last-child .btn { flex: 1 1 0; min-height: 46px; }
}
@media (max-width: 360px) {
  .appbar { gap: 2px; padding-inline: 8px; }
  .appbar .brand { font-size: 18px; }
  .appbar .icon-btn { width: 34px; height: 34px; }
  .appbar .lang-btn { width: 32px; max-width: 32px !important; }
  .appbar #authArea .btn { padding: 5px 7px; font-size: 12px; }
  .appbar .spacer { min-width: 0; }
  #menuBtn { width: 32px !important; }
}

/* ---------- the microphone is the centrepiece ---------- */
.big-mic, .mic-row .big-mic, body.signed-in .big-mic { width: 120px; height: 120px; box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 0 0 8px var(--bg), 0 0 0 9px var(--accent-line), 0 16px 40px rgba(0,0,0,.45); }
.big-mic svg, .mic-row .big-mic svg { width: 44px; height: 44px; }
.big-mic.listening { box-shadow: 0 0 0 1px var(--accent) inset, 0 0 0 8px var(--bg), 0 0 0 9px var(--accent), 0 16px 40px rgba(0,0,0,.45); }
.big-mic-label, body.signed-in .big-mic-label { color: var(--text); font: 500 15px/1.4 var(--font-body); margin-top: 20px; }
@media (max-width: 760px) {
  .big-mic, .mic-row .big-mic, body.signed-in .big-mic { width: 104px; height: 104px; }
  .big-mic svg, .mic-row .big-mic svg { width: 40px; height: 40px; }
  .big-mic-label, body.signed-in .big-mic-label { font-size: 14px; margin-top: 16px; }
}

/* ---------- Home, everywhere ---------- */
.drawer-nav .nav-home { font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 6px; }
.drawer-nav .nav-home svg { color: var(--accent); }
.drawer-nav .nav-home.on, .drawer-nav .nav-home:hover { border-color: var(--accent-line); }
.home-btn { display: none; color: var(--accent); }
.home-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 761px) and (max-width: 1023px) { .home-btn { display: grid; } }
@media (min-width: 1024px) { body.side-collapsed .home-btn { display: grid; } }
/* the section you are in: one mark, everywhere */
.bottom-nav button.on, .bottom-nav button[aria-current="page"] { color: var(--text); }
.bottom-nav button.on svg { color: var(--accent); }
.bottom-nav button.on span { font-weight: 600; }
.leave-ask { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: rgba(0,0,0,.55); }
.leave-ask[hidden] { display: none; }
.leave-box { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; display: grid; gap: 12px; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.leave-box h3 { margin: 0; font-size: 20px; }
.leave-box p { margin: 0; color: var(--muted); }
.leave-box .row { justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@media (max-width: 420px) { .leave-box .row .btn { flex: 1 1 100%; min-height: 46px; } }
/* pop-ups never cover the way Home: the sidebar (desktop), the header (tablet) and the bottom bar (phones) stay usable */
@media (min-width: 1024px) { body:not(.side-collapsed) .modal-bg { left: 264px; } body.side-collapsed .modal-bg { top: 60px; } }
@media (min-width: 761px) and (max-width: 1023px) { .modal-bg { top: 60px; } }
@media (max-width: 760px) { .modal-bg { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); } .bottom-nav { z-index: 52; } }
@media (max-width: 760px) { .drawer { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); } }
/* clear choice marks on charcoal: an empty ring, or a gold ring with a gold centre when chosen */
input[type="radio"] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 3px 0 0; border: 1.5px solid var(--line-2); border-radius: 50%; background: var(--bg); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
input[type="radio"]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .12s ease; }
input[type="radio"]:checked { border-color: var(--accent); }
input[type="radio"]:checked::before { transform: scale(1); }
input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }
input[type="radio"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"] { accent-color: var(--accent); }
@media (max-width: 360px) { .mic-row .mic-side { min-width: 0; width: 44px; height: 44px; padding: 0; justify-content: center; } .mic-row .mic-side span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .mic-row { gap: 14px; } }

/* ---------- My Court Day (20261023i): grouped task rows that use the width of the screen ---------- */
#page[data-page="today"] .page-body { max-width: 1480px; }
.myday { container: myday / inline-size; gap: 18px; }
.cd-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.cd-kpis .kpi { font: inherit; color: inherit; text-align: left; cursor: pointer; display: grid; gap: 2px; }
.cd-kpis .kpi:hover span, .cd-kpis .kpi:focus-visible span { color: var(--text); }
.cd-kpis .kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 760px) {
  .cd-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; row-gap: 12px; }
  .cd-kpis .kpi:nth-child(2n) { border-right: 1px solid var(--line) !important; }
  .cd-kpis .kpi:nth-child(3n), .cd-kpis .kpi:last-child { border-right: 0 !important; }
  .cd-kpis .kpi { padding: 2px 10px !important; }
  .cd-kpis .kpi b { font-size: 22px !important; }
}
/* Laptop and tablet: court, approvals, tomorrow and orders in a band of cards, the tasks across the full width below.
   Wide screens: tasks on the left, court and approvals in a column on the right. Phones: one column. */
.md-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.md-main, .md-side { display: contents; }
.md-side > .cd-box { margin: 0; }
.md-side .cd-court { order: 1; } .md-side .cd-appr { order: 2; } .md-side .cd-tmr { order: 3; } .md-side .cd-orders { order: 4; }
.md-tasks { order: 5; grid-column: 1 / -1; container: tasks / inline-size; display: grid; gap: 12px; min-width: 0; }
.md-side .verify-q { order: 6; } .md-side .cd-team { order: 7; } .md-side .demo-row { order: 8; grid-column: 1 / -1; }
@media (max-width: 760px) { .md-side .cd-tmr, .md-side .cd-orders { order: 6; } }
@container myday (min-width: 1240px) {
  .md-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
  .md-main { display: block; min-width: 0; }
  .md-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
}
.md-side .cd-box .tcard { margin-bottom: 8px; }
.md-side .cd-box .tcard:last-child, .md-side .cd-box .item:last-child { margin-bottom: 0; }
.cd-appr { border-color: var(--accent-line); }
.cd-appr h3 { color: var(--accent-ink-text); }
.quickadd { margin: 0; }
.cd-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cd-tools .input { height: 38px; padding-block: 6px; font-size: 14px; }
.cd-tools [data-q] { flex: 1 1 220px; min-width: 0; }
.cd-tools select { flex: 0 1 auto; max-width: 240px; min-width: 0; }
@media (max-width: 560px) { .cd-tools select { flex: 1 1 calc(50% - 4px); max-width: none; } .cd-tools [data-q] { flex-basis: 100%; } }
/* groups */
.tgroup2 { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; scroll-margin-top: 72px; }
.tgroup2 > header, .tgroup2 > summary { display: flex; align-items: baseline; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tgroup2 > summary { cursor: pointer; list-style: none; }
.tgroup2 > summary::-webkit-details-marker { display: none; }
.tgroup2 > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); align-self: center; transition: transform .15s ease; }
.tgroup2[open] > summary::after { transform: rotate(45deg); }
.tgroup2:not([open]) > summary { border-bottom: 0; }
.tgroup2 h3 { margin: 0; font: 500 17px/1.25 var(--font-display); }
.tg-n { color: var(--muted); font-size: 14px; }
.tg-n .tnum { color: var(--text); font-weight: 600; }
.g-overdue h3, .g-overdue .tg-n .tnum { color: var(--bad); }
.g-today h3 { color: var(--accent-ink-text); }
.tg-empty { padding: 12px 14px; }
.tg-more { display: block; margin: 10px 14px 12px; }
/* one task row */
.tr-cols { display: none; }
.trow { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); align-items: start; }
.tg-list > .trow:last-of-type { border-bottom: 0; }
.trow .check { margin: 3px 0 0; width: 18px; height: 18px; }
.trow.late { box-shadow: inset 2px 0 0 var(--bad); }
.trow:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.trow.open { background: var(--surface-2); }
.tr-main { all: unset; box-sizing: border-box; cursor: pointer; position: relative; min-width: 0; display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 4px; padding-right: 26px; }
.tr-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.tr-title { flex: 1 1 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tr-t { color: var(--text); font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.trow.open .tr-t { -webkit-line-clamp: unset; display: block; }
.trow.is-done .tr-t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.tag { display: inline-block; font-size: 11.5px; line-height: 1.5; padding: 0 7px; border-radius: 999px; white-space: nowrap; }
.tag.court { color: var(--accent-ink-text); border: 1px solid var(--accent-line); }
.tr-case, .tr-due, .tr-who { font-size: 13px; color: var(--muted); min-width: 0; }
.tr-case { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-case { flex: 1 1 100%; }
.tr-who::before { content: '·'; margin-right: 10px; color: var(--line-2); }
.due small { color: var(--muted); font-size: 12px; }
.due.late { color: var(--bad); font-weight: 600; } .due.late small { font-weight: 400; }
.due.now { color: var(--accent-ink-text); font-weight: 600; }
.due.soon { color: var(--text); }
.due.none, .due.done { color: var(--muted); }
.tr-chev { position: absolute; right: 0; top: 3px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.trow.open .tr-chev { transform: rotate(180deg); }
.tdetail { grid-column: 2 / -1; padding: 6px 0 4px; }
.td-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 22px; margin: 8px 0 12px; }
.td-grid dt { font-size: 12.5px; color: var(--muted); margin: 0 0 2px; }
.td-grid dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.td-grid .td-wide, .td-grid > div:first-child { grid-column: 1 / -1; }
.td-acts { gap: 8px; flex-wrap: wrap; }
.td-edit { margin-top: 10px; padding: 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.td-review ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
/* wide task column: one line per task, in columns */
@container tasks (min-width: 820px) {
  .tr-cols { display: grid; grid-template-columns: 22px minmax(0, 2.2fr) minmax(0, 1fr) 150px 120px 18px; column-gap: 14px; padding: 0 14px; font-size: 12.5px; color: var(--muted); }
  .trow { column-gap: 14px; }
  .tr-main { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) 150px 120px 18px; column-gap: 14px; align-items: baseline; padding-right: 0; }
  .tr-title, .tr-case { flex: none; }
  .tr-case, .tr-due, .tr-who { font-size: 13.5px; }
  .tr-case { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tr-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tr-due::before, .tr-who::before { content: none; }
  .tr-chev { position: static; align-self: center; }
}
@media (max-width: 760px) {
  .trow { padding: 12px; column-gap: 10px; }
  .tgroup2 > header, .tgroup2 > summary { padding: 11px 12px; }
  .td-grid { grid-template-columns: 1fr 1fr; }
  .td-acts .btn { flex: 1 1 calc(50% - 4px); min-height: 42px; }
}
@media (max-width: 360px) { .td-grid { grid-template-columns: 1fr; } }

/* ---------- approvals: the actual items waiting for the lawyer's OK ---------- */
.approvals { gap: 16px; }
.appr-card { display: grid; gap: 12px; padding: 18px; scroll-margin-top: 72px; }
.appr-card.focus { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.appr-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.appr-h h3 { margin: 2px 0 2px; font: 500 19px/1.3 var(--font-display); }
.appr-card .kind { color: var(--accent-ink-text); font-size: 12.5px; font-weight: 600; }
.appr-text[readonly] { background: var(--surface-2); }
.appr-note { margin: 0; }
.appr-confirm { display: grid; gap: 8px; }
.appr-late { margin-top: 4px; }
.appr-late .small + .small { margin-top: 4px; }

/* ---------- Home: My Court Day, the question, the microphone and the message box in one view ---------- */
body.signed-in .welcome .office { padding-bottom: 14px; }
body.signed-in .office-head { margin-bottom: 10px; justify-content: flex-start; flex-wrap: wrap; column-gap: 12px; }
body.signed-in .office-head .od-date { margin-right: auto; }
.office-head .cd-open, body.signed-in .office-head .cd-open { margin-top: 0; }
body.signed-in .otile b { font-size: 26px; }
body.signed-in .otile.warn small { font-weight: 500; }
body.signed-in .otile[data-urgent] small { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--bad) 45%, transparent); text-underline-offset: 3px; }
.cd-list { margin-top: 10px; }
.ask-h, body.signed-in .ask-h { margin-top: 24px; font-size: clamp(24px, 3vw, 30px); }
body.signed-in .console { margin-top: 16px; }
body.signed-in .primary-acts { margin-top: 14px; }
@media (min-width: 761px) and (max-height: 900px) {
  body.signed-in .welcome { padding-top: 12px; }
  .ask-h, body.signed-in .ask-h { margin-top: 14px; font-size: 24px; }
  body.signed-in .console { margin-top: 12px; }
  .big-mic-label, body.signed-in .big-mic-label { margin-top: 14px; }
  body.signed-in .primary-acts { margin-top: 8px; }
  .welcome .legal-line { margin-top: 14px; }
}
@media (max-width: 760px) {
  body.signed-in .office-head .od-date { flex-basis: 100%; order: 3; margin-right: 0; }
  body.signed-in .office-head h2 { margin-right: auto; }
  .ask-h, body.signed-in .ask-h { margin-top: 16px; font-size: 22px; }
}
/* a passing message never blocks a tap on the button under it */
.toast { pointer-events: none; }

/* ---------- 20261023j: attachments in the message box, document answers, latest judgments ---------- */
.attach-tray { display: grid; gap: 8px; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.att-chip svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent-ink-text); stroke-width: 1.7; }
.att-name { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.att-st { color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.att-st .spinner { width: 12px; height: 12px; }
.att-chip.ready .att-st { color: var(--ok); }
.att-chip.error .att-st, .att-chip.scanned .att-st { color: var(--warn); }
.att-x { all: unset; cursor: pointer; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); font-size: 18px; line-height: 1; }
.att-x:hover, .att-x:focus-visible { background: var(--surface); color: var(--text); outline: none; }
.att-acts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.att-acts::-webkit-scrollbar { display: none; }
.att-acts .chip, .att-next .chip { white-space: nowrap; font-size: 12.5px; padding: 5px 10px; }
.doc-ctx { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 auto 6px; max-width: 760px; padding: 6px 12px; border: 1px solid var(--accent-line); border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--text); }
.doc-ctx[hidden] { display: none; }
.msg-user.has-att .att-sent { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.att-pill { font-size: 12.5px; padding: 3px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.stages { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 6px; }
.stages li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.stages .st-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; }
.stages li.done { color: var(--text); } .stages li.done .st-dot { background: var(--ok); border-color: var(--ok); }
.stages li.now { color: var(--text); } .stages li.now .st-dot { border-color: var(--accent); background: var(--accent); animation: stPulse 1.2s ease-in-out infinite; }
.stages li.fail { color: var(--bad); } .stages li.fail .st-dot { background: var(--bad); border-color: var(--bad); }
.st-ms { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); }
@keyframes stPulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .stages li.now .st-dot { animation: none; } }
.doc-timing { margin-top: 8px; }
.rj-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.rj-tools .input { height: 36px; padding-block: 4px; font-size: 13.5px; max-width: 260px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.seg button { all: unset; cursor: pointer; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rj-fresh { margin: 4px 0 6px; }
.rj-date { color: var(--text); font-weight: 600; }
.rj-ver { margin-top: 6px; color: var(--muted); }
.rj-next { gap: 8px; margin-top: 4px; }
@media (max-width: 560px) { .rj-tools .input { flex: 1 1 calc(50% - 4px); max-width: none; } .att-name { max-width: 150px; } }
/* a file in the box can be sent on its own: Send shows as soon as something is attached */
#commandForm.has-files:not(.has-text) #send { display: grid; }
.attach-tray { grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; }
.att-list, .att-acts { min-width: 0; max-width: 100%; }
.att-chip { min-width: 0; }
/* the "questions now go to this file" line sits above the message box; the conversation keeps clear of it */
body.has-docctx:not(.home) .chat { padding-bottom: calc(320px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 761px) { body.has-docctx:not(.home) .chat { padding-bottom: 240px; } }
@media (max-width: 760px) {
  .doc-ctx { padding: 5px 10px; gap: 4px 10px; font-size: 12.5px; }
  .doc-ctx b { display: inline-block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
}
.doc-ctx { background: var(--surface); box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--accent) 6%, transparent); }

/* D9: keyboard focus on the My Court Day link (its all:unset removed the global ring). */
.cd-open:focus-visible { outline: 2px solid var(--accent, #c9a96e); outline-offset: 2px; }

/* 20261023l: account deletion entry shows only when signed in */
body:not(.signed-in) .signed-only { display: none; }
#deleteAcct { text-align: left; color: var(--muted); }

/* 20261023m: phone-alert prompt on Home and the library scope note under answers */
.push-nudge { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-top: 12px; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #c9a96e) 45%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--accent, #c9a96e) 8%, transparent); }
.push-nudge .row { gap: 8px; }
.scope-note { margin-top: 6px; }
