:root {
  --g-950: #052e1c;
  --g-900: #0b3d26;
  --g-800: #14532d;
  --g-700: #15803d;
  --g-600: #16a34a;
  --g-500: #22c55e;
  --g-200: #bbf7d0;
  --g-100: #dcfce7;
  --g-50: #f0fdf4;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --text: #0f1f17;
  --muted: #5b6b63;
  --border: #e3e9e6;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(5, 46, 28, .05), 0 4px 16px rgba(5, 46, 28, .06);
  --font: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.55; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr) 340px; height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--g-700); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(21, 128, 61, .3); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; color: var(--g-900); }
.brand-text span { font-size: 13px; color: var(--g-700); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 500; text-align: left; }
.nav-item:hover { background: var(--g-50); color: var(--g-800); }
.nav-item.active { background: var(--g-700); color: #fff; box-shadow: 0 2px 8px rgba(21, 128, 61, .25); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.lang-switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--g-50); border: 1px solid var(--g-100); border-radius: 10px; padding: 3px; }
.lang-switch button { border: 0; background: transparent; border-radius: 8px; padding: 7px 4px; font-size: 13px; color: var(--g-800); }
.lang-switch button.on { background: #fff; box-shadow: var(--shadow); font-weight: 600; }
.mode-switch { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch .track { width: 36px; height: 20px; border-radius: 999px; background: #d6dfda; position: relative; flex: none; transition: background .15s; }
.mode-switch .thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.mode-switch input:checked + .track { background: var(--g-700); }
.mode-switch input:checked + .track .thumb { transform: translateX(16px); }
.mode-switch input:focus-visible + .track { outline: 3px solid var(--g-200); outline-offset: 2px; }
.mode-switch strong { display: block; font-size: 13px; color: var(--g-900); }
.mode-switch small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.source.najir { border-left: 3px solid var(--g-600); }
.ai-label { font-size: 11.5px; font-style: italic; color: var(--muted); }
.kv { font-size: 12.5px; color: #33443b; margin: 2px 0; }
.kv b { color: var(--g-900); font-weight: 600; }
.tiny { font-size: 12px; color: var(--muted); margin: 0; padding: 0 6px; }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 28px 10px; }
.topbar > div { flex: 1; min-width: 0; }
.topbar h1 { margin: 0; font-size: 22px; color: var(--g-900); letter-spacing: -.01em; }
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.menu-btn { display: none; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px 28px 20px; overflow-y: auto; }
#view-chat { overflow: hidden; }

.disclaimer { display: flex; gap: 10px; align-items: center; background: var(--g-50); border: 1px solid var(--g-100); color: var(--g-800); padding: 9px 14px; border-radius: 10px; font-size: 13px; }
.disclaimer svg { width: 18px; height: 18px; }

/* buttons */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--g-700); color: #fff; }
.btn-primary:hover { background: var(--g-800); }
.btn-primary:disabled { background: #9cb8a8; cursor: wait; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--g-800); }
.btn-ghost:hover { border-color: var(--g-200); background: var(--g-50); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.wide { width: 100%; }
.icon-btn { border: 1px solid var(--border); background: #fff; border-radius: 10px; width: 38px; height: 38px; display: grid; place-items: center; color: var(--g-800); }
:focus-visible { outline: 3px solid var(--g-200); outline-offset: 2px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--g-50); border: 1px solid var(--g-100); color: var(--g-700); display: grid; place-items: center; }
.card-icon.big { width: 54px; height: 54px; }
.card-icon.big svg { width: 26px; height: 26px; }
.welcome { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quick { padding: 18px 16px; text-align: left; display: flex; flex-direction: column; gap: 8px; transition: transform .15s, border-color .15s; }
.quick:hover { transform: translateY(-2px); border-color: var(--g-200); }
.quick strong { color: var(--g-900); font-size: 15px; }
.quick span { color: var(--muted); font-size: 13px; }
.resume { padding: 16px 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.resume strong { display: block; color: var(--g-900); }
.muted { color: var(--muted); font-size: 13px; }
.resume-row { display: flex; gap: 8px; flex: 1; max-width: 420px; }
input, textarea { font: inherit; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: #fff; width: 100%; }
input:focus, textarea:focus { outline: none; border-color: var(--g-600); box-shadow: 0 0 0 3px var(--g-100); }
.error { color: var(--red); font-size: 13px; margin: 0; width: 100%; }

/* thread */
.thread { flex: 1; overflow-y: auto; padding: 18px 2px; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 860px; }
.msg.user { align-self: flex-end; background: var(--g-700); color: #fff; padding: 11px 16px; border-radius: 16px 16px 4px 16px; max-width: 75%; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; width: 100%; padding: 16px 20px; }
.msg.assistant.emergency { border: 1.5px solid #fca5a5; background: var(--red-bg); }
.msg.assistant.refusal { background: #f8faf9; }
.msg.assistant.questions { border-color: var(--g-200); background: var(--g-50); }
.msg-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--g-700); margin-bottom: 6px; }
.emergency .msg-label { color: var(--red); }
.md p { margin: 0 0 10px; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md h3, .md h4 { margin: 12px 0 6px; color: var(--g-900); font-size: 15px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.md a { color: var(--g-700); }
.cite { display: inline-flex; align-items: center; border: 0; background: var(--g-100); color: var(--g-800); font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin: 0 2px; vertical-align: 1px; }
.cite:hover { background: var(--g-200); }
.msg-foot { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.trace { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); background: #f8faf9; border-radius: 8px; padding: 7px 10px; }
.trace svg { width: 16px; height: 16px; margin-top: 2px; color: var(--g-600); }
.sources-toggle { align-self: flex-start; border: 1px solid var(--g-200); background: #fff; color: var(--g-800); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.sources-toggle svg { width: 16px; height: 16px; }
.sources { display: flex; flex-direction: column; gap: 10px; }
.source { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; }
.source.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--g-500); } 100% { box-shadow: 0 0 0 0 transparent; } }
.source-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.source-head b { color: var(--g-900); font-size: 14px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--g-100); color: var(--g-800); }
.pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-red { background: #fee2e2; color: var(--red); }
.pill-grey { background: #eef2f0; color: var(--muted); }
.excerpt { font-size: 13px; color: #33443b; white-space: pre-wrap; max-height: 150px; overflow-y: auto; background: #fafcfb; border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; }
.source a { font-size: 12.5px; color: var(--g-700); word-break: break-all; }
.note { margin: 0; font-size: 12.5px; font-style: italic; color: var(--muted); line-height: 1.45; }
.help-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--g-900); border-left: 3px solid var(--g-200); padding: 4px 0 4px 10px; }
.help-hint svg { width: 16px; height: 16px; margin-top: 2px; color: var(--g-700); }
.link-btn { border: 0; background: none; padding: 0; margin-left: 4px; color: var(--g-700); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.lawyer-offer { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--g-50); border: 1px solid var(--g-200); border-radius: 12px; padding: 10px 14px; font-size: 14px; color: var(--g-900); }

.typing { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; background: var(--g-500); border-radius: 50%; animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

.composer { display: flex; gap: 10px; align-items: flex-end; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow); }
.composer textarea { border: 0; box-shadow: none; resize: none; max-height: 160px; padding: 8px 0; }
.composer textarea:focus { box-shadow: none; }
.send { width: 44px; height: 44px; padding: 0; border-radius: 12px; }

/* ---------- case panel ---------- */
.casepanel { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.casepanel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 8px; }
.casepanel-head h2 { margin: 0; font-size: 17px; color: var(--g-900); }
.panel-close { display: none; }
.case-body { padding: 6px 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.case-section h3 { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.case-section ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.case-section li { font-size: 13.5px; background: #fafcfb; border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; }
.case-section li b { color: var(--g-900); font-weight: 600; }
.case-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 30px 10px; }
.case-empty .card-icon { margin: 0 auto 10px; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat b { font-size: 22px; color: var(--g-700); }
.code-mini { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; background: var(--g-50); border: 1px solid var(--g-100); border-radius: 10px; padding: 8px 10px; }
.code-mini code { font-size: 12.5px; letter-spacing: .03em; }

/* ---------- other views ---------- */
.panel-card { padding: 26px; max-width: 720px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.panel-card h2 { margin: 6px 0 0; color: var(--g-900); }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--g-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center/12px no-repeat; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.lib-item { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.lib-item b { color: var(--g-900); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(5, 46, 28, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal-box { background: #fff; border-radius: 18px; padding: 26px; max-width: 440px; width: 100%; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal-box h2 { margin: 4px 0 0; color: var(--g-900); }
.modal-box p { margin: 0; color: var(--muted); }
.code-box { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--g-50); border: 1px dashed var(--g-600); border-radius: 12px; padding: 12px 14px; }
.code-box code { font-size: 16px; font-weight: 700; color: var(--g-900); letter-spacing: .04em; word-break: break-all; }

/* ---------- lawyer view: navy + gold theme ---------- */
/* Re-pointing the palette tokens re-themes every component that uses them. */
body.lawyer-mode {
  --g-950: #0a1330;
  --g-900: #13214a;
  --g-800: #1d306a;
  --g-700: #27408f;
  --g-600: #3552b8;
  --g-500: #5b74d6;
  --g-200: #c9d2f2;
  --g-100: #e2e7f8;
  --g-50: #f3f5fc;
  --bg: #f3f5fa;
  --text: #0f1730;
  --muted: #5a6480;
  --border: #e0e5f0;
  --shadow: 0 1px 2px rgba(10, 19, 48, .06), 0 4px 16px rgba(10, 19, 48, .08);
  --gold: #b8862b;
  --gold-soft: #e9c46a;
  --gold-bg: #fbf3df;
}
.mode-badge { display: none; }
body.lawyer-mode .mode-badge { display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--gold-soft); color: var(--g-950); padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }

/* dark sidebar */
body.lawyer-mode .sidebar { background: var(--g-950); border-right-color: var(--g-950); }
body.lawyer-mode .brand-mark { background: var(--gold); box-shadow: 0 4px 12px rgba(184, 134, 43, .35); }
body.lawyer-mode .brand-text strong { color: #fff; }
body.lawyer-mode .brand-text span { color: var(--gold-soft); }
body.lawyer-mode .nav-item { color: #b6c0de; }
body.lawyer-mode .nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
body.lawyer-mode .nav-item.active { background: var(--g-700); color: #fff; box-shadow: inset 3px 0 0 var(--gold-soft); }
body.lawyer-mode .mode-switch { border-color: rgba(233, 196, 106, .45); background: rgba(233, 196, 106, .08); }
body.lawyer-mode .mode-switch strong { color: #fff; }
body.lawyer-mode .mode-switch small { color: #a9b3d1; }
body.lawyer-mode .mode-switch input:checked + .track { background: var(--gold); }
body.lawyer-mode .lang-switch { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }
body.lawyer-mode .lang-switch button { color: #d5dbef; }
body.lawyer-mode .lang-switch button.on { background: #fff; color: var(--g-900); }
body.lawyer-mode .tiny { color: #8f9ac0; }

/* main area accents */
body.lawyer-mode .topbar { box-shadow: inset 0 3px 0 var(--gold); }
body.lawyer-mode .source.najir { border-left-color: var(--gold); }
body.lawyer-mode .modal { background: rgba(10, 19, 48, .5); }
.mode-banner { display: flex; gap: 10px; align-items: center; margin-top: 8px; background: var(--gold-bg); border: 1px solid #efd9a6; border-left: 4px solid var(--gold); color: var(--g-900); padding: 9px 14px; border-radius: 10px; font-size: 13px; }
.mode-banner > span { flex: 1; min-width: 0; }
.mode-banner svg { width: 18px; height: 18px; color: var(--gold); }
.mode-banner .link-btn { color: var(--g-700); white-space: nowrap; }

/* scrim behind off-canvas panels; only shown at the widths where they overlay */
.scrim { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(5, 15, 10, .35); }

/* desktop/tablet: ☰ collapses the sidebar out of the grid */
@media (min-width: 761px) {
  body.nav-collapsed .sidebar { display: none; }
  body.nav-collapsed .app { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  body.nav-collapsed .app { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  .casepanel { position: fixed; right: 0; top: 0; bottom: 0; width: min(360px, 92vw); z-index: 40; box-shadow: -10px 0 40px rgba(0, 0, 0, .12); transform: translateX(105%); transition: transform .2s; }
  .casepanel.open { transform: none; }
  .panel-close { display: grid; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.panel-open .scrim { display: block; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 45; transform: translateX(-105%); transition: transform .2s; box-shadow: 10px 0 40px rgba(0, 0, 0, .12); }
  .sidebar.open { transform: none; }
  body.nav-open .scrim { display: block; }
  .menu-btn { display: grid; }
  .topbar { padding: 14px 16px 8px; }
  .topbar h1 { font-size: 18px; }
  .view { padding: 6px 16px 14px; }
  .cards { gap: 10px; }
  .quick { padding: 14px 12px; }
  .msg.user { max-width: 88%; }
  .msg.assistant { padding: 14px; }
  #newCaseTop span { font-size: 13px; }
}

/* Phase 5: drafts, offices */
.draft-card, .office-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; margin-top: 8px; }
.draft-card .source-head .pill { margin-left: auto; }
.draft-body { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13.5px; line-height: 1.6;
  background: var(--amber-bg); border-radius: 8px; padding: 12px; max-height: 380px; overflow: auto; margin: 10px 0; }
.draft-card .checks { margin: 4px 0 8px; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.draft-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.office-card ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.office-card li { font-size: 13.5px; }
.office-card a { font-size: 12.5px; }

/* Phase 6: booking */
.booking { margin-top: 14px; align-items: stretch; }
.booking h3 { margin: 10px 0 0; font-size: 15px; color: var(--g-900); }
.small { font-size: 12.5px; }
.lawyer-card { display: flex; gap: 14px; align-items: flex-start; }
.lawyer-name { font-weight: 700; font-size: 16px; color: var(--g-900); }
.slot-day { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.slot-day-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.slot-row { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; color: var(--g-800); cursor: pointer; }
.slot:hover { border-color: var(--g-200); background: var(--g-50); }
.slot.selected { background: var(--g-700); border-color: var(--g-700); color: #fff; }
.contact-row { display: flex; gap: 8px; flex-wrap: wrap; }
.contact-row select, .contact-row input, .brief-sec textarea { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; background: #fff; }
.contact-row input { flex: 1; min-width: 180px; }
.brief-secs { display: flex; flex-direction: column; gap: 10px; }
.brief-sec { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--g-900); }
.brief-sec textarea { font-weight: 400; resize: vertical; width: 100%; box-sizing: border-box; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.booked-card { border: 1px solid var(--g-200); background: var(--g-50); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Phase 7: expandable trace, sharing view */
.trace > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trace-toggle { font-size: 12.5px; align-self: flex-start; }
.trace-steps { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.trace-steps li { line-height: 1.45; word-break: break-word; }
.trace-steps li.err b { color: var(--red); }
#sharingArea { margin-top: 14px; align-items: stretch; }
.share-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
@media (max-width: 760px) {
  .panel-card { padding: 18px 16px; }
  .draft-body { max-height: 300px; font-size: 13px; }
  .lawyer-card .card-icon { display: none; }
  .contact-row select { flex: 1 1 100%; }
  .btn { white-space: normal; text-align: center; }
}
