/* Speak2Legal AI — robing room: ink, paper and brass
   Layout: one centred column; microphone hero, then the working surface (tabs + panels). */
:root {
  --bg: #0F1419;
  --surface: #161C23;
  --surface-2: #1D252E;
  --line: #29323D;
  --text: #ECEEF0;
  --muted: #9AA4AF;
  --accent: #C8A35A;
  --accent-soft: rgba(200,163,90,.14);
  --accent-line: rgba(200,163,90,.42);
  --accent-ink: #12161B;
  --ok: #7FB69A;
  --warn: #D9B36A;
  --bad: #D98C7A;
  --font-display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 12px;
  --r-sm: 8px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 58px; }
.brand { font-family: var(--font-display); font-size: 24px; letter-spacing: .2px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand b { color: var(--accent); font-weight: 400; }
.brand .beta { font: 500 11px/1 var(--font-body); color: var(--accent); border: 1px solid var(--accent-line); padding: 3px 7px; border-radius: 999px; }
.topbar .spacer { flex: 1; }
.mini-mic { display: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; place-items: center; }
.mini-mic.show { display: grid; }
.mini-mic svg { width: 18px; height: 18px; }
.mini-mic.listening { animation: pulse 1.2s ease-in-out infinite; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; text-decoration: none; color: var(--text); }
.btn:hover { border-color: #3A4552; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* hero */
.hero { text-align: center; padding-block: 44px 18px; }
.hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(46px, 9vw, 84px); line-height: 1; margin: 0 0 10px; letter-spacing: -.5px; text-wrap: balance; }
.hero h1 span { color: var(--accent); }
.hero p.sub { margin: 0; color: var(--muted); font-size: clamp(16px, 2.4vw, 19px); font-style: italic; font-family: var(--font-display); }

.mic-zone { display: grid; place-items: center; padding-block: 34px 10px; }
.mic { position: relative; width: 148px; height: 148px; border-radius: 50%; border: 0; cursor: pointer; background: radial-gradient(circle at 50% 40%, #1F2730, #141A20 70%); color: var(--accent-ink); display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(200,163,90,.08), 0 0 60px 8px rgba(200,163,90,.35), inset 0 -6px 18px rgba(0,0,0,.18); transition: transform .15s ease; }
.mic:hover { transform: scale(1.03); }
.mic:active { transform: scale(.98); }
.mic svg { width: 54px; height: 54px; }
.mic::before, .mic::after { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(200,163,90,.35); opacity: 0; pointer-events: none; }
.mic.listening::before { animation: ring 1.6s ease-out infinite; }
.mic.listening::after { animation: ring 1.6s ease-out .8s infinite; }
@keyframes ring { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(200,163,90,.25); } }
.mic-state { margin-top: 18px; color: var(--muted); font-size: 14px; min-height: 20px; }
.mic-state.live { color: var(--accent); }

/* command box */
.command { max-width: 760px; margin: 18px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.command label { display: block; font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin: 2px 4px 6px; }
.command textarea { width: 100%; min-height: 64px; resize: vertical; background: transparent; border: 0; outline: none; font-size: 17px; line-height: 1.45; padding: 4px; }
.command textarea::placeholder { color: #6E7884; }
.command .interim { color: var(--muted); font-style: italic; padding: 0 4px; min-height: 0; }
.command-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.command-row .left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.switch { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; user-select: none; }
.switch input { accent-color: var(--accent); }
.examples { max-width: 760px; margin: 12px auto 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 6px 11px; border-radius: 999px; font-size: 13px; cursor: pointer; text-align: left; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.notice { max-width: 760px; margin: 10px auto 0; font-size: 12.5px; color: var(--muted); text-align: center; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 34px; overflow-x: auto; scrollbar-width: none; }
.tab { background: none; border: 0; padding: 12px 14px; color: var(--muted); cursor: pointer; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab .lock { font-size: 11px; opacity: .7; margin-left: 4px; }
.panel { padding-block: 22px 60px; }

/* results & cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
h2.title { font-family: var(--font-display); font-weight: 400; font-size: 30px; margin: 0; line-height: 1.1; }
h3 { margin: 0; font-size: 16px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.yellow { color: var(--accent); border-color: rgba(200,163,90,.35); background: rgba(200,163,90,.06); }
.pill.ok { color: var(--ok); border-color: rgba(127,182,154,.35); }
.pill.warn { color: var(--warn); border-color: rgba(217,179,106,.35); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: 32px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.results { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
table.results th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; }
table.results td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.results tr:last-child td { border-bottom: 0; }
table.results tr:hover td { background: rgba(255,255,255,.015); }
.case-link { color: var(--text); font-weight: 600; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; line-height: 1.35; }
.case-link:hover { color: var(--accent); }
.snippet { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.5; }
mark { background: rgba(200,163,90,.22); color: var(--text); padding: 0 2px; border-radius: 3px; }
.rel { display: inline-block; width: 64px; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.rel i { display: block; height: 100%; background: var(--accent); }
.tnum { font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 8px; }

/* forms */
.field { display: grid; gap: 5px; }
.field span { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; width: 100%; outline: none; }
.input:focus { border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.filters { display: grid; grid-template-columns: 2fr 1.3fr .7fr .7fr auto; gap: 8px; align-items: end; }
@media (max-width: 720px) { .filters { grid-template-columns: 1fr 1fr; } .filters .q { grid-column: 1 / -1; } }

/* action confirmation */
.actions-card { border-color: rgba(200,163,90,.45); box-shadow: 0 0 0 1px rgba(200,163,90,.08), 0 10px 40px rgba(0,0,0,.4); }
.action { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.action .kind { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* lists */
.list { display: grid; gap: 8px; }
.item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.item .main { min-width: 0; flex: 1; }
.item .title { font-weight: 600; overflow-wrap: anywhere; }
.item.done .title { text-decoration: line-through; color: var(--muted); }
.check { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; flex: none; }
.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 50; 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)); }
.modal { width: min(860px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.modal.narrow { width: min(420px, 100%); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }
.judgment-text { white-space: pre-wrap; font-size: 14px; line-height: 1.65; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; max-height: 420px; overflow: auto; }
.doc-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; max-height: 360px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; z-index: 60; max-width: calc(100% - 32px); }
.toast.error { background: var(--bad); color: #1a0505; }

.compare-bar { position: sticky; bottom: 0; z-index: 15; background: var(--surface-2); border: 1px solid rgba(200,163,90,.4); border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 14px; flex-wrap: wrap; }
table.compare { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 640px; }
table.compare th, table.compare td { border: 1px solid var(--line); padding: 10px; vertical-align: top; text-align: left; }
table.compare th[scope="row"] { color: var(--muted); font-weight: 500; width: 140px; background: var(--bg); }
table.compare .same { color: var(--ok); }

footer { border-top: 1px solid var(--line); padding-block: 24px 40px; color: var(--muted); font-size: 12.5px; }
footer .wrap { display: grid; gap: 8px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ================= Chat layout (conversation-first, like a chat assistant) ================= */
body.chat-app { min-height: 100vh; min-height: 100dvh; }
.appbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 8px; height: 56px;
  padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.appbar .spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent; color: var(--text); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 22px; height: 22px; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 41; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.drawer-head { padding: 4px 6px 14px; }
.drawer-nav { display: grid; gap: 2px; }
.drawer-nav button { text-align: left; background: none; border: 0; color: var(--text); padding: 12px 10px; border-radius: 10px; cursor: pointer; font-size: 15px; }
.drawer-nav button:hover { background: var(--surface-2); }
.drawer-setting { padding: 12px 10px; color: var(--muted); font-size: 14px; }
.drawer-foot { padding: 6px 10px; line-height: 1.5; }

.chat { max-width: 780px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 190px max(16px, env(safe-area-inset-right, 0px)); }
.welcome { padding-block: 6vh 8px; display: grid; gap: 0; text-align: center; justify-items: center; }
.welcome h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 7.6vw, 58px); line-height: 1.04; letter-spacing: -.02em; margin: 0; text-wrap: balance; font-optical-sizing: auto; max-width: 15em; }
.welcome .sub { margin: 14px 0 0; color: var(--muted); font-size: clamp(16px, 2.3vw, 18px); line-height: 1.55; max-width: 32em; text-wrap: pretty; }
.speak-row { display: grid; justify-items: center; gap: 18px; margin-top: 40px; }
.welcome .mic { width: 148px; height: 148px; flex: none; color: var(--accent-ink);
  background: radial-gradient(circle at 38% 30%, #E6CB8E, var(--accent) 55%, #9C7B3C);
  box-shadow: 0 0 0 10px rgba(200,163,90,.10), 0 0 0 22px rgba(200,163,90,.05), 0 0 70px 6px rgba(200,163,90,.28), inset 0 -8px 20px rgba(0,0,0,.22); }
.welcome .mic svg { width: 56px; height: 56px; }
.welcome .mic.listening { box-shadow: 0 0 0 10px rgba(200,163,90,.18), 0 0 90px 14px rgba(200,163,90,.45), inset 0 -8px 20px rgba(0,0,0,.22); }
.speak-row .mic-state { margin: 0; font-size: 16px; color: var(--text); }
.speak-row .mic-state small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.speak-row .mic-state.live { color: var(--accent); }
.coverage-line { margin: 40px 0 0; text-align: center; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; line-height: 1.6; max-width: 40em; }
.coverage-line b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.promises { list-style: none; margin: 16px 0 0; padding: 0; width: 100%; text-align: left; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.promises li { font-size: 13.5px; line-height: 1.5; color: var(--muted); padding-left: 12px; border-left: 2px solid var(--accent-line); }
.promises li b { display: block; color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 2px; }
@media (max-width: 560px) { .promises { grid-template-columns: 1fr; gap: 10px; } }
.suggest { width: 100%; display: grid; gap: 8px; margin-top: 34px; text-align: left; }
.suggest .eyebrow { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.suggest .examples { justify-content: flex-start; margin: 0 0 10px; max-width: none; }
.suggest .chip { border-radius: 10px; padding: 10px 13px; font-size: 14px; line-height: 1.4; color: var(--text); background: var(--surface); border-color: var(--line); }
.suggest .chip:hover { border-color: var(--accent-line); background: var(--surface-2); }
.welcome .legal-line, .welcome .notice { text-align: center; margin: 22px 0 0; }

.thread { display: grid; gap: 22px; padding-top: 18px; }
.msg-user { justify-self: end; max-width: 86%; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 14px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-bot { display: grid; gap: 12px; min-width: 0; }
.msg-bot .lead { font-size: 15.5px; line-height: 1.6; }
.msg-bot .lead b { color: var(--text); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: inline-grid; place-items: center; color: var(--accent-ink); font: 700 12px/1 var(--font-body); margin-right: 8px; vertical-align: middle; }
.bot-head { display: flex; align-items: center; gap: 0; color: var(--muted); font-size: 13px; }

.rcards { display: grid; gap: 10px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; min-width: 0; }
.rcard .t { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.rcard .meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.rcard .acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.rcard .acts a, .rcard .acts button.link { font-size: 13px; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pill.fav { color: var(--ok); border-color: rgba(127,182,154,.4); }
.pill.unfav { color: var(--bad); border-color: rgba(217,140,122,.4); }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.section-h { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 2px; display: flex; gap: 8px; align-items: center; }
.section-h .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.obar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.obar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.55; }
.callout.warn { border-left-color: var(--warn); }
.typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .2s } .typing i:nth-child(3) { animation-delay: .4s }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }

.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.composer-box { max-width: 780px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 10px 10px 8px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.composer-box:focus-within { border-color: var(--accent-line); }
.composer textarea { width: 100%; resize: none; border: 0; outline: none; background: transparent; font-size: 16px; line-height: 1.45; max-height: 30vh; padding: 4px 0; }
.composer textarea::placeholder { color: #6E7884; }
.composer .interim { color: var(--muted); font-style: italic; font-size: 13px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.composer-row .row { gap: 6px; flex-wrap: nowrap; }
.icon-btn.send { background: var(--accent); color: var(--accent-ink); border-radius: 50%; width: 38px; height: 38px; }
.icon-btn.send:disabled { opacity: .4; }
.icon-btn.mic-small { border-radius: 50%; width: 38px; height: 38px; border: 1px solid var(--line); }
.icon-btn.mic-small.listening { background: var(--accent); color: var(--accent-ink); animation: pulse 1.2s ease-in-out infinite; }
@media (max-width: 480px) { #composerHint { display: none; } }

.page { position: fixed; inset: 0; z-index: 35; background: var(--bg); overflow-y: auto; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
.page-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; height: 56px; padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.page-head .title { font-size: 24px; }
.page-body { max-width: 900px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left, 0px)) 0 max(16px, env(safe-area-inset-right, 0px)); }

/* Bench brief: answer first, numbered references */
.answer, .ai-out { background: var(--surface); border: 1px solid rgba(200,163,90,.35); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 16px; line-height: 1.6; }
.answer b { color: var(--text); }
a.ref { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
a.ref:hover, a.ref:focus-visible { text-decoration: underline; }
.rcard .refno { display: inline-block; justify-self: start; width: max-content; font: 600 12px/1 var(--font-mono); color: var(--accent-ink); background: var(--accent); border-radius: 6px; padding: 3px 6px; margin-bottom: 6px; }
.rcard:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.rcard .snippet mark { background: rgba(200,163,90,.28); color: inherit; border-radius: 3px; padding: 0 2px; }

/* AI deep analysis */
.ai-slot { display: grid; gap: 6px; }
.ai-go { justify-self: start; }
.ai-out .section-h { margin-top: 10px; }
.ai-out .ai-pt { padding-left: 14px; position: relative; margin: 4px 0; }
.ai-out .ai-pt::before { content: "•"; position: absolute; left: 2px; color: var(--accent); }
.legal-line { text-align: center; margin-top: 18px; }
.web-slot { display: grid; gap: 6px; }
.web-slot .ai-web { justify-self: start; }
.ai-src { margin: 4px 0 0; padding-left: 20px; }
.ai-src li { margin: 4px 0; overflow-wrap: anywhere; }

/* Bare act section */
.sec-card { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
.sec-ref { font-size: 13px; color: var(--accent); }
.sec-h { font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.25; margin: 0; }
.sec-body { white-space: pre-line; line-height: 1.7; font-size: 15px; max-height: 60vh; overflow: auto; overflow-wrap: anywhere; }
.sec-card details summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.sec-card details[open] .sec-body { margin-top: 8px; }
.sec-map ul { margin: 6px 0 0; padding-left: 18px; }
.sec-map li { margin: 3px 0; }

/* Drafting */
.draft-form textarea.input { resize: vertical; min-height: 120px; line-height: 1.5; }
.draft-text p { margin: 0 0 8px; }
.draft-out { display: grid; gap: 12px; }

.pair { display: grid; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }

.promises-list{margin:10px 0 12px;padding-left:1.2em;display:grid;gap:6px;line-height:1.55}
.promises-list b{color:var(--text)}

/* ---------- case files ---------- */
.files-top { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.file-card { display: grid; gap: 6px; text-align: left; padding: 16px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent-line); border-radius: var(--r-sm); color: var(--text); cursor: pointer; font: inherit; }
.file-card:hover, .file-card:focus-visible { border-color: var(--accent-line); background: var(--surface-2); }
.file-title { font-family: 'Newsreader', Georgia, serif; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.file-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 2px; }
.say-hint { padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); line-height: 1.6; }
.file-view { gap: 18px; }
.file-head { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.file-head .title { font-family: 'Newsreader', Georgia, serif; font-size: 26px; margin: 0; overflow-wrap: anywhere; }
.file-sec { display: grid; gap: 10px; }
.file-sec-h { display: flex; align-items: baseline; gap: 8px; }
.file-sec-h h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.next-box { display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.next-hearing { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.next-hearing b { font-size: 20px; color: var(--accent); }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.inline-add .input { flex: 1 1 180px; min-width: 0; }
.inline-add textarea.input { flex-basis: 100%; }
.file-item { display: block; }
.file-item summary { cursor: pointer; list-style: none; display: flex; }
.file-item summary::-webkit-details-marker { display: none; }
.file-text, .file-note { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.file-text { margin: 10px 0; max-height: 420px; overflow: auto; font-size: 14px; }
.msg-save { display: flex; justify-content: flex-end; margin-top: 8px; }
.save-card { max-width: 560px; }
@media (max-width: 560px) { .files-grid { grid-template-columns: 1fr; } .file-head .title { font-size: 22px; } }
