/* TheLaw app: green ground, mango highlight, black ink. Phone first. */
:root {
  --green: #14804f;
  --green-deep: #0a3f2b;
  --green-tint: #e7f1ea;
  --mango: #f2a33a;
  --mango-tint: #fdf0dc;
  --ink: #0f1a14;
  --ink-2: #3e4a43;
  --ink-3: #5a665e;
  --bg: #f6f7f4;
  --card: #ffffff;
  --line: #e2e6e0;
  --danger: #b3261e;
  --danger-tint: #fbe9e7;
  --ok: #1e7a46;
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 12px; --r-md: 16px; --r-lg: 24px;
  --nav-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -0.02em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }

/* App frame */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.page { flex: 1; padding: 16px max(16px, env(safe-area-inset-left)) calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 16px; }
.page.no-nav { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.topbar { position: sticky; top: 0; z-index: 20; background: var(--green-deep); color: #fff; padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 10px; min-height: 60px; }
.topbar .title { flex: 1; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-family: var(--sans); font-weight: 600; font-size: 12px; color: #cfe3d7; display: block; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: rgba(255,255,255,0.12); }
.icon-btn svg { width: 22px; height: 22px; }

.brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.brand .word { display: inline-flex; align-items: baseline; gap: 1px; font-family: var(--display); }
.brand .the { font-weight: 500; font-size: 15px; }
.brand .law { font-weight: 800; font-size: 24px; letter-spacing: -0.04em; color: var(--mango); }
.brand svg { width: 34px; height: 34px; }

/* Bottom nav */
.nav { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; margin: 0 auto; width: 100%; max-width: 560px; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right)); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none; color: var(--ink-3); font-size: 12px; font-weight: 700; border-radius: 12px; min-height: 48px; justify-content: center; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--green); }
.nav a.on svg { stroke-width: 2.4; }

/* Press feedback: every tappable thing visibly reacts the moment it is touched */
button, .btn, a.card, .nav a, [role="button"], .row-link, .settings > a, label.pick { transition: transform 0.08s ease, filter 0.12s ease, background-color 0.15s ease, box-shadow 0.12s ease; }
button:not(:disabled):active, .btn:not(:disabled):active, [role="button"]:active, .nav a:active, .settings > a:active, .settings > button:active, a.card:active { transform: scale(0.95); filter: brightness(0.88); }
.btn-primary:not(:disabled):active, .btn-mango:not(:disabled):active { box-shadow: inset 0 3px 8px rgba(0,0,0,0.25); }
button.tapped:not(:disabled), .btn.tapped:not(:disabled) { filter: brightness(0.85); transform: scale(0.96); }
.btn.is-busy, button.is-busy { opacity: 0.8; pointer-events: none; }
@media (hover: hover) { .btn:not(:disabled):hover { filter: brightness(0.96); } }
@media (prefers-reduced-motion: reduce) { button:active, .btn:active { transform: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 18px; border-radius: var(--r-md); border: 0; font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform 0.08s ease, background 0.15s ease; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-deep); }
.btn-mango { background: var(--mango); color: var(--ink); }
.btn-ghost { background: var(--green-tint); color: var(--green); }
.btn-line { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-text { background: transparent; color: var(--green); padding: 8px 4px; min-height: 40px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 8px 12px; font-size: 14px; border-radius: 10px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.tight { gap: 8px; padding: 14px; }
.card.green { background: var(--green-deep); color: #fff; border-color: var(--green-deep); }
.card.green .muted { color: #cfe3d7; }
.card.mango { background: var(--mango-tint); border-color: #f2d7a8; }
.card.danger { background: var(--danger-tint); border-color: #f1c5c1; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row > svg { width: 22px; height: 22px; flex: none; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: inherit; min-width: 0; cursor: pointer; }
.list-item:hover { border-color: #c5d4ca; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--ink-3); flex: none; width: 18px; height: 18px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--green-tint); color: var(--green); white-space: nowrap; }
.pill.mango { background: var(--mango); color: var(--ink); }
.pill.grey { background: #eceeec; color: var(--ink-2); }
.pill.red { background: var(--danger-tint); color: var(--danger); }
.pill.dark { background: var(--ink); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--card); padding: 12px 14px; font-size: 16px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-tint); }
.hint { font-size: 12px; color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 40px; }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #e8ece9; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 8px; font-weight: 800; font-size: 14px; cursor: pointer; min-height: 38px; }
.seg button.on { background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #cfd6d1; border-radius: 999px; transition: background 0.15s; }
.switch span::after { content: ''; position: absolute; width: 24px; height: 24px; top: 3px; left: 3px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--mango); outline-offset: 2px; }

/* Welcome */
.welcome { min-height: 100%; background: var(--green-deep); color: #fff; display: flex; flex-direction: column; padding: calc(28px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); gap: 22px; }
.welcome .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.welcome h1 { font-size: 46px; line-height: 0.98; letter-spacing: -0.04em; }
.welcome h1 em { font-style: normal; color: var(--mango); }
.welcome .lede { font-size: 17px; color: #e3efe8; max-width: 34ch; }
.welcome .mark { width: 88px; height: 88px; }
.stripe { height: 10px; background: repeating-linear-gradient(90deg, var(--mango) 0 22px, var(--green-deep) 22px 44px); border-radius: 4px; }
.lang-pick .chip { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.lang-pick .chip.on { background: var(--mango); color: var(--ink); border-color: var(--mango); }

/* Home */
.hello h1 { font-size: 26px; }
.ask { background: var(--green-deep); color: #fff; border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ask h2 { font-size: 26px; }
.ask h2 em { font-style: normal; color: var(--mango); }
.ask .box { display: flex; gap: 8px; background: #fff; border-radius: var(--r-md); padding: 6px; align-items: flex-end; }
.ask .box textarea { flex: 1; border: 0; resize: none; min-height: 44px; max-height: 140px; padding: 10px; font-size: 16px; color: var(--ink); background: transparent; outline: none; }
.ask .examples { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.ask .examples::-webkit-scrollbar { display: none; }
.ask .examples button { flex: none; background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.emergency-card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 2px solid var(--danger); border-radius: var(--r-lg); padding: 14px; cursor: pointer; text-align: left; width: 100%; }
.emergency-card .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--danger); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.emergency-card .ic svg { width: 24px; height: 24px; }
.balance-strip { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }

/* Chat */
.chat-page { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; right: 0; width: 100%; overflow: hidden; max-width: 560px; margin: 0 auto; background: #ece5dd; }
.msgs { flex: 1; overflow-y: auto; padding: 16px max(12px, env(safe-area-inset-left)) 8px max(12px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.bubble { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.45; white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: 0 1px 0.5px rgba(0,0,0,0.08); }
.bubble.user { align-self: flex-end; background: #d9fdd3; border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.bubble.system { align-self: center; background: #fff8e8; color: var(--ink-2); font-size: 13px; text-align: center; max-width: 92%; }
.bubble .meta { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.bubble p + p, .bubble p + ol, .bubble ol + p { margin-top: 8px; }
.bubble ol { margin: 6px 0 0; padding-left: 20px; }
.bubble em { color: var(--ink-3); }
.play { border: 0; background: var(--green-tint); color: var(--green); border-radius: 999px; padding: 4px 10px 4px 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; cursor: pointer; min-height: 30px; }
.play svg { width: 16px; height: 16px; }
.typing { align-self: flex-start; background: #fff; border-radius: 16px; padding: 12px 14px; display: flex; gap: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa39d; animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; } .typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.composer { background: #f0f2ef; padding: 8px max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right)); display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; min-height: 46px; max-height: 140px; resize: none; border: 0; border-radius: 22px; padding: 12px 16px; font-size: 16px; background: #fff; outline: none; line-height: 1.35; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; background: var(--green); color: #fff; }
.round svg { width: 22px; height: 22px; }
.round.rec { background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(179,38,30,0.45); } 100% { box-shadow: 0 0 0 14px rgba(179,38,30,0); } }
.chat-banner { padding: 10px max(14px, env(safe-area-inset-left)); display: flex; gap: 10px; align-items: center; font-size: 14px; }
.chat-banner.red { background: var(--danger); color: #fff; }
.chat-banner.red a { color: #fff; font-weight: 800; }
.chat-banner.mango { background: var(--mango-tint); color: var(--ink); border-bottom: 1px solid #f2d7a8; }
.lawyer-cta { background: var(--mango); color: var(--ink); border: 0; border-radius: 999px; padding: 8px 12px; font-weight: 800; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 38px; }
.lawyer-cta svg { width: 16px; height: 16px; }
@media (max-width: 420px) { .chat-av { display: none !important; } .topbar .icon-btn { width: 38px; } }
.rec-bar { display: flex; align-items: center; gap: 10px; flex: 1; background: #fff; border-radius: 22px; padding: 0 16px; min-height: 46px; font-weight: 700; color: var(--danger); }

/* Sheet */
.sheet-back { position: fixed; inset: 0; background: rgba(17,17,17,0.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 10px max(16px, env(safe-area-inset-left)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -8px 24px rgba(0,0,0,0.18); }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #cfd6d1; align-self: center; margin-bottom: 4px; }

/* Request status */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.steps li::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps .b { width: 28px; height: 28px; border-radius: 50%; background: #e3e8e4; color: var(--ink-3); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; z-index: 1; }
.steps li.done .b { background: var(--green); color: #fff; }
.steps li.now .b { background: var(--mango); color: var(--ink); }
.steps .b svg { width: 16px; height: 16px; }
.stars { display: flex; gap: 6px; }
.stars button { border: 0; background: transparent; cursor: pointer; padding: 2px; color: #cfd6d1; }
.stars button.on { color: var(--mango); }
.stars svg { width: 34px; height: 34px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--ink-2); font-weight: 700; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Wallet */
.big { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan-card { border: 2px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.plan-card.best { border-color: var(--green); }
.plan-card .price { font-family: var(--display); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; }
.plan-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }

/* Toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 100; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.toast.err { background: var(--danger); }
.empty { text-align: center; padding: 28px 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty svg { width: 46px; height: 46px; color: var(--ink-3); }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(0,0,0,0.12); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
.btn .spinner { border-color: rgba(255,255,255,0.35); border-top-color: #fff; width: 18px; height: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }

/* Desktop: lawyer and admin get wider pages */
.wide .app, .wide .nav { max-width: 1100px; }
.wide .page { padding-bottom: 32px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); background: #fafbfa; white-space: nowrap; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; border-radius: 10px; font-weight: 800; color: var(--ink-2); cursor: pointer; white-space: nowrap; min-height: 42px; }
.tabs button.on { background: var(--green); color: #fff; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.stat .v { font-family: var(--display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }

/* Live call */
.call { position: fixed; inset: 0; z-index: 50; background: radial-gradient(120% 80% at 50% 30%, #12382a 0%, #0b1a14 60%, #070f0c 100%); color: #fff; display: flex; flex-direction: column; padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 560px; margin: 0 auto; }
.call-top { display: flex; align-items: center; gap: 10px; }
.call-top .who { flex: 1; min-width: 0; }
.call-top .who strong { font-family: var(--display); font-size: 18px; display: block; }
.call-top .who span { font-size: 13px; color: #b9cfc2; }
.call-top .timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14px; background: rgba(255,255,255,0.1); padding: 6px 10px; border-radius: 999px; }
.call-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; position: relative; min-height: 0; }
.avatar { --lvl: 0; position: relative; width: 190px; height: 190px; display: flex; align-items: center; justify-content: center; }
.avatar .core { width: 150px; height: 150px; border-radius: 50%; background: var(--green-deep); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px rgba(244,160,36,0.35); position: relative; z-index: 2; transition: transform 0.08s linear; transform: scale(calc(1 + var(--lvl) * 0.08)); }
.avatar .core svg { width: 104px; height: 104px; }
.avatar .ring { position: absolute; inset: 20px; border-radius: 50%; border: 2px solid rgba(244,160,36,0.55); opacity: 0; }
.call[data-state="speaking"] .avatar .ring { animation: ring 1.8s ease-out infinite; }
.call[data-state="speaking"] .avatar .ring:nth-child(2) { animation-delay: 0.6s; }
.call[data-state="speaking"] .avatar .ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes ring { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.45); opacity: 0; } }
.call[data-state="thinking"] .avatar .core { animation: think 1.4s ease-in-out infinite; }
@keyframes think { 0%, 100% { box-shadow: 0 0 0 4px rgba(244,160,36,0.25); } 50% { box-shadow: 0 0 0 14px rgba(244,160,36,0.12); } }
.call-state { font-weight: 800; font-size: 15px; color: #e3efe8; display: flex; align-items: center; gap: 8px; min-height: 24px; text-align: center; }
.meter { display: flex; gap: 4px; align-items: center; height: 22px; }
.meter i { width: 4px; border-radius: 2px; background: var(--mango); height: 4px; transition: height 0.06s linear; }
.captions { width: 100%; display: flex; flex-direction: column; gap: 8px; max-height: 32vh; overflow-y: auto; }
.cap { font-size: 15px; line-height: 1.45; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.07); }
.cap b { display: block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mango); margin-bottom: 2px; }
.cap.you b { color: #9fd4b6; }
.call-controls { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); justify-items: center; align-items: start; gap: 6px; padding-top: 10px; }
.cbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; text-align: center; line-height: 1.2; padding: 0; min-width: 0; }
.cbtn .c { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; }
.cbtn .c svg { width: 24px; height: 24px; }
.cbtn.on .c { background: #fff; color: var(--ink); }
.cbtn.end .c { background: var(--danger); }
.cbtn.go .c { background: #1e9e5a; width: 72px; height: 72px; }
.cbtn.go .c svg { width: 32px; height: 32px; }
.cbtn:disabled { opacity: 0.4; }
.selfview { position: absolute; top: 0; right: 0; width: 104px; height: 140px; border-radius: 14px; overflow: hidden; background: #000; border: 2px solid rgba(255,255,255,0.25); z-index: 3; }
.selfview video { width: 100%; height: 100%; object-fit: cover; }
.photo-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--mango); color: var(--ink); font-weight: 800; font-size: 13px; padding: 6px 8px 6px 6px; border-radius: 999px; }
.photo-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.photo-chip button { border: 0; background: rgba(0,0,0,0.12); border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-weight: 800; }
.call-note { font-size: 12px; color: #9fb6a8; text-align: center; }
.call-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; gap: 14px; align-items: center; }
.call-card .av { width: 56px; height: 56px; border-radius: 50%; background: var(--green-deep); display: flex; align-items: center; justify-content: center; flex: none; }
.call-card .acts { display: flex; gap: 8px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Lawyers and consultations */
.av-c { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; flex: none; position: relative; letter-spacing: -0.02em; }
.av-c.live::after { content: ''; position: absolute; right: 1px; bottom: 1px; width: 26%; height: 26%; max-width: 16px; max-height: 16px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; }
.progress { display: flex; gap: 6px; }
.progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.progress i.done { background: var(--green); }
.progress i.now { background: var(--mango); }
.lawyer-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: left; width: 100%; cursor: pointer; font: inherit; color: inherit; }
.lawyer-card:hover { border-color: #c5d4ca; }
.lawyer-card.busy { opacity: 0.6; cursor: default; }
.lawyer-card .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.lawyer-card .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lawyer-card .who strong { font-size: 16px; }
.lawyer-card .meta { font-size: 13px; color: var(--ink-2); }
.lawyer-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; }
.profile-head { background: var(--green-deep); color: #fff; border-radius: var(--r-lg); padding: 18px; display: flex; gap: 14px; align-items: center; }
.profile-head h2 { color: #fff; }
.profile-head .small { color: #cfe3d7; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.trio .v { font-family: var(--display); font-weight: 800; font-size: 20px; }
.trio .k { font-size: 12px; color: var(--ink-2); }
.mode-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-pick button { min-height: 76px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 800; cursor: pointer; color: var(--ink); }
.mode-pick button svg { width: 24px; height: 24px; }
.mode-pick button.on { border-color: var(--green); background: var(--green-tint); color: var(--green); }
.wait-ring { --p: 1; width: 196px; height: 196px; border-radius: 50%; background: conic-gradient(var(--mango) calc(var(--p) * 360deg), var(--mango-tint) 0); display: flex; align-items: center; justify-content: center; align-self: center; }
.wait-ring > .inner { width: 172px; height: 172px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist li { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.checklist .b { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--green); color: #fff; }
.checklist .b svg { width: 14px; height: 14px; }
.checklist li.todo { color: var(--ink-2); }
.checklist li.todo .b { background: transparent; border: 2px dashed var(--mango); }
.checklist .t { margin-left: auto; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.accepted { background: var(--green-deep); color: #fff; border-radius: var(--r-lg); padding: 24px 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.accepted h1 { color: #fff; font-size: 28px; }
.accepted p { color: #cfe3d7; }
.accepted .eyebrow { color: var(--mango); }
.accepted .mode-pick button { background: var(--green-deep); border-color: transparent; color: #fff; }
.accepted .mode-pick button.on { background: #fff; border-color: var(--mango); color: var(--green); }
.notes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.files { display: flex; flex-direction: column; gap: 6px; }
.filelink { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--green); text-decoration: none; background: var(--green-tint); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.filelink svg { width: 16px; height: 16px; flex: none; }

/* Consultation room */
.consult .remote { position: absolute; inset: 0; background: #13291f; display: flex; align-items: center; justify-content: center; z-index: 0; overflow: hidden; }
.consult .remote video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.consult[data-live="1"][data-media="video"]:not([data-peercam="off"]) .remote video { opacity: 1; }
.consult[data-live="1"][data-media="video"]:not([data-peercam="off"]) .remote .ph { display: none; }
.consult > :not(.remote) { position: relative; z-index: 2; }
.consult .call-top { background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0)); margin: calc(-14px - env(safe-area-inset-top)) -16px 0; padding: calc(14px + env(safe-area-inset-top)) 16px 20px; }
.consult .timer.mango { background: var(--mango); color: var(--ink); }
.consult .selfview { position: absolute; top: calc(78px + env(safe-area-inset-top)); right: 16px; }
.consult .call-stage { justify-content: flex-end; padding-bottom: 8px; }
.consult .call-state { background: rgba(0,0,0,0.5); border-radius: 999px; padding: 6px 14px; }
.consult .call-state:empty { display: none; }
.consult .call-controls { background: rgba(8,20,14,0.85); margin: 0 -16px calc(-18px - env(safe-area-inset-bottom)); padding: 12px 10px calc(16px + env(safe-area-inset-bottom)); }
.cbtn .c { position: relative; }
.badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--mango); color: var(--ink); font-style: normal; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.peek { display: flex; justify-content: flex-start; padding: 0 0 8px; }
.peek .cmsg { border: 0; cursor: pointer; text-align: left; max-width: 85%; }
.cmsg { background: rgba(255,255,255,0.14); color: #fff; border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 14px; line-height: 1.4; align-self: flex-start; max-width: 85%; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px; }
.cmsg b { font-size: 11px; color: #b9cfc2; font-weight: 700; }
.cmsg.me { align-self: flex-end; background: var(--mango); color: var(--ink); border-radius: 14px 14px 4px 14px; }
.cmsg.me b { color: #6b4300; }
.cmsg img { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; }
.cmsg .filelink { background: rgba(255,255,255,0.9); }
.cmsg svg { width: 16px; height: 16px; vertical-align: -3px; }
.cpanel { position: absolute !important; left: 0; right: 0; bottom: 0; z-index: 5 !important; max-height: 58%; background: var(--bg); color: var(--ink); border-radius: 22px 22px 0 0; padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -8px 24px rgba(0,0,0,0.3); }
.cpanel .icon-btn { color: var(--ink); }
.cpanel .icon-btn:hover { background: var(--green-tint); }
.cmsgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.cpanel .cmsg { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.cpanel .cmsg b { color: var(--ink-2); }
.cpanel .cmsg.me { background: var(--mango-tint); border-color: #f2d7a8; }
.cpanel .cmsg.me b { color: #6b4300; }
.ccomp { display: flex; gap: 8px; }
.ccomp .input { min-height: 46px; }
.card.invite { border: 3px solid var(--mango); }
.speakfor-banner { display: flex; gap: 10px; align-items: flex-start; background: var(--mango); color: var(--ink); border-radius: 14px; padding: 10px 12px; font-size: 14px; max-width: 420px; }
.speakfor-banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.pw { position: relative; }
.pw .input { padding-right: 72px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--green); font-weight: 800; font-size: 14px; padding: 8px 10px; min-height: 40px; cursor: pointer; border-radius: 8px; }
.code-input { font-size: 26px !important; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 800; }
.gbtn-wrap { min-height: 44px; width: 100%; display: flex; justify-content: center; }
.home-actions { display: grid; gap: 10px; }
.action-card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 14px; cursor: pointer; text-align: left; width: 100%; color: var(--ink); font: inherit; }
.action-card .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.action-card strong { font-family: var(--display); font-size: 17px; }
.action-card .small { color: var(--ink-2); }
.action-card .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.action-card .ic svg { width: 24px; height: 24px; }
.action-card.mango { background: var(--mango-tint); border-color: #f2d7a8; }
.action-card.mango .ic { background: var(--mango); color: var(--ink); }
.auth { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--green-tint); color: var(--green-deep); font-size: 13px; line-height: 1.45; display: flex; flex-direction: column; gap: 2px; }
.auth-k { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); }
.settings { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.settings > a, .settings > button { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; text-decoration: none; color: var(--ink); font: 700 15px var(--sans); background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.settings > * + * { border-top: 1px solid var(--line); }
.settings > a:hover, .settings > button:hover { background: #fafbfa; }
.settings .si { width: 34px; height: 34px; border-radius: 10px; background: var(--green-tint); color: var(--green); display: flex; align-items: center; justify-content: center; flex: none; }
.settings .si svg { width: 18px; height: 18px; }
.settings .grow { flex: 1; }
.settings .danger-row { color: var(--danger); }
.settings .danger-row .si { background: var(--danger-tint); color: var(--danger); }

/* ------------------------------------------------------------ Tablets, laptops and desktops */
.nav .nav-brand { display: none; }
@media (min-width: 700px) {
  h1 { font-size: 32px; }
  .app { max-width: 820px; }
  .nav { max-width: 820px; }
  .page { padding-left: 28px; padding-right: 28px; gap: 20px; }
  .app.narrow .page { max-width: 560px; width: 100%; margin: 0 auto; }
  .app-full { max-width: none; }
  .welcome { padding-left: 40px; padding-right: 40px; }
  .welcome > * { width: 100%; max-width: 1040px; margin-left: auto; margin-right: auto; }
  .welcome h1 { font-size: 64px; }
  .welcome .lede { font-size: 19px; max-width: 46ch; }
  .chat-page { max-width: 900px; box-shadow: 0 0 0 1px var(--line); }
  .sheet-back { align-items: center; padding: 24px; }
  .sheet { max-width: 540px; border-radius: 22px; max-height: 88dvh; padding-bottom: 22px; box-shadow: 0 18px 50px rgba(0,0,0,0.25); }
  .sheet .grab { display: none; }
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .call { max-width: none; }
  .call:not(.consult) > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
  .consult .cpanel { max-width: 760px; margin: 0 auto; }
  .consult .selfview { width: 168px; height: 126px; }
  .captions { max-height: 36vh; }
}
@media (min-width: 1100px) {
  /* Bottom bar becomes a sidebar */
  .nav { top: 0; bottom: 0; left: 0; right: auto; margin: 0; transform: none; width: 248px; max-width: none; display: flex; flex-direction: column; gap: 4px; border-top: 0; border-right: 1px solid var(--line); padding: 0 14px 20px; }
  .nav .nav-brand { display: flex; align-items: center; background: var(--green-deep); margin: 0 -14px 14px; padding: 10px 22px; min-height: 60px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; font-size: 15px; min-height: 48px; }
  .nav a.on { background: var(--green-tint); }
  .app:has(> .nav) { max-width: none; margin: 0; padding-left: 248px; }
  .app:has(> .nav) > .topbar > .brand { display: none; }
  .app:has(> .nav) > .topbar { height: 60px; min-height: 60px; box-sizing: border-box; }
  .app:has(> .nav) .page { max-width: 1040px; width: 100%; margin: 0 auto; padding: 28px 40px 48px; }
  .toast { bottom: 28px; left: calc(50% + 124px); }
  .app:has(> .nav) .page > section > .grid2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #plans > p { grid-column: 1 / -1; }
  .list:has(> .lawyer-card) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ask { padding: 28px; }
  .ask h2 { font-size: 34px; }
  .chat-page { max-width: 1000px; }
  .bubble { max-width: 72%; }
  .wide .app, .wide .nav { max-width: 1200px; }
}

.nav .nav-brand a { color: #fff; padding: 0; min-height: 0; flex-direction: row; background: none; gap: 8px; font-size: inherit; }
.app-full { min-height: 100dvh; }
.app-full .welcome { flex: 1; }
@media (min-width: 700px) {
  .welcome .welcome-go { max-width: 1040px; align-items: flex-start; }
  .welcome .welcome-go > * { width: 100%; max-width: 420px; text-align: left !important; }
  .welcome .hero { justify-content: center; }
}


/* ------------------------------------------------------------ The new look: calm, pale ground, forest green, one mango accent */
.topbar { border-radius: 0; }
.chat-page .topbar { position: relative; flex: none; }
.chat-page .composer { flex: none; }
.page { gap: 18px; }
.btn { border-radius: 999px; }
.btn-primary { background: var(--green); }
.btn-primary:hover { background: var(--green-deep); }
.card, .list-item, .settings, .action-card, .balance-strip { box-shadow: none; }
.list-item, .again-card { border-radius: 20px; }
.sheet { border-radius: 28px 28px 0 0; }
.nav { background: var(--bg); }
.nav a.on { color: var(--green); }
.credit-chip { text-decoration: none; background: rgba(255,255,255,0.14); color: #fff; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 7px 12px; white-space: nowrap; }

/* Home */
.hero-home { background: var(--green-deep); color: #fff; margin: -18px calc(-1 * var(--gutter, 16px)) 0; padding: 12px var(--gutter, 16px) 26px; border-radius: 0 0 34px 34px; display: flex; flex-direction: column; gap: 0; margin-top: -16px; }
.page { --gutter: 16px; }
.hero-home .hh-hello { font-size: 14px; font-weight: 600; color: #c8e0d2; margin-top: 10px; }
.hero-home h1 { font-size: 38px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; margin-top: 4px; color: #fff; }
.hh-ask { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; text-align: left; cursor: pointer; background: var(--mango); color: var(--ink); border-radius: 22px; padding: 17px 18px 17px 20px; font: inherit; }
.hh-ask strong { display: block; font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.hh-ask small { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; color: #3a2a08; }
.hh-ask .go { width: 44px; height: 44px; border-radius: 50%; background: var(--green-deep); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.hh-ask .go svg { width: 22px; height: 22px; }
.hh-ghosts { display: flex; gap: 10px; margin-top: 10px; }
.hh-ghosts button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid rgba(255,255,255,0.35); background: transparent; color: #fff; border-radius: 18px; padding: 13px 10px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 48px; }
.hh-ghosts button svg { width: 20px; height: 20px; }
.sec-label { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.again-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); padding: 13px 16px; text-decoration: none; color: var(--ink); }
.again-card .grow { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.again-card strong { font-weight: 700; font-size: 15px; }
.again-card svg { width: 20px; height: 20px; color: var(--green); flex: none; }
.ask-list { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.ask-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--ink); }
.ask-row svg { width: 18px; height: 18px; color: var(--green); flex: none; }
.lawyer-home .ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--mango); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.lawyer-home .ic svg { width: 22px; height: 22px; }
.lawyer-home { display: flex; align-items: center; gap: 12px; width: 100%; border: 2px solid var(--green); cursor: pointer; text-align: left; background: var(--green-tint); color: var(--green-deep); border-radius: 20px; padding: 14px 16px; font: inherit; }
.lawyer-home .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lawyer-home strong { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.lawyer-home .small { color: var(--green-deep); font-weight: 600; }
.lawyer-home > svg { width: 20px; height: 20px; flex: none; }

/* Chat */
.chat-page { background: var(--bg); }
.chat-title { display: flex; flex-direction: column; gap: 0; line-height: 1.1; overflow: visible; }
.chat-title .wm { display: inline-flex; align-items: baseline; font-family: var(--sans); }
.chat-title .the { font-weight: 500; font-size: 14px; color: #fff; }
.chat-title .law { font-weight: 800; font-size: 22px; letter-spacing: -0.04em; color: var(--mango); }
.chat-title .sub { margin-top: 3px; }
.msgs { gap: 14px; padding-top: 18px; }
.bubble { box-shadow: none; border-radius: 22px; max-width: 92%; padding: 13px 16px; font-size: 15px; line-height: 1.6; }
.bubble.user { background: var(--green-deep); color: #fff; border-bottom-right-radius: 6px; max-width: 82%; }
.bubble.user .meta, .bubble.user .tiny { color: #c8e0d2; }
.bubble.assistant { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 22px; }
.bubble.system { background: var(--green-tint); color: var(--green-deep); }
.bubble.assistant strong { color: var(--green-deep); }
.composer { background: var(--bg); border-top: 0; padding-top: 10px; }
.composer textarea { border: 1px solid var(--line); border-radius: 999px; padding: 13px 18px; }
.composer .round.soft, .composer .round[id="mic"] { background: var(--green-tint) !important; color: var(--green-deep) !important; }
.attach-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 12px; padding: 9px 14px; background: var(--green-tint); color: var(--green-deep); border-radius: 14px; font-size: 13px; font-weight: 700; }
.attach-chip button { border: 0; background: transparent; color: inherit; width: 28px; height: 28px; cursor: pointer; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.attach-chip svg { width: 16px; height: 16px; }
.lawyer-cta { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.45); }

@media (min-width: 700px) {
  .page { --gutter: 28px; }
  .hero-home { margin: 0; border-radius: 30px; padding: 24px; }
}
@media (min-width: 1100px) {
  .hero-home h1 { font-size: 46px; }
}

.kb .chat-page .composer { padding-bottom: 8px; }

/* Composer: one pill, with the buttons tucked inside so the typing space stays wide */
.composer { align-items: center; }
.composer { gap: 4px; margin: 0 max(10px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)); padding: 5px 5px 5px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.kb .chat-page .composer { margin-bottom: 8px; }
.composer textarea { order: 2; flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 0; padding: 10px 6px; min-height: 40px; }
.composer #cam { order: 1; }
.composer #mic { order: 3; }
.composer #sendb { order: 4; }
.composer .round { width: 40px; height: 40px; }
.composer .round svg { width: 20px; height: 20px; }
.composer .round.soft, .composer .round[id="mic"] { background: transparent !important; color: var(--green-deep) !important; }
.composer .round.rec { background: var(--danger) !important; color: #fff !important; }

/* Tighter bar: text sits right next to the camera, and the bar sits close to the bottom edge */
.composer { margin-bottom: max(8px, calc(env(safe-area-inset-bottom) - 14px)); padding-left: 4px; }
.composer textarea { padding-left: 2px; padding-right: 4px; }
.composer #cam { margin-right: -4px; }
.composer #mic { margin-left: -2px; }

/* Only while the keyboard is up do we size to the visible area */
.kb .chat-page { top: var(--vvt, 0px); bottom: auto; height: var(--vvh); }

/* Sit the bar low, just above the home line */
.composer { margin-bottom: max(6px, calc(env(safe-area-inset-bottom) - 22px)); }
.chat-page { padding-bottom: 0; }

.attach-chip[hidden] { display: none !important; }


/* With the keyboard up, never let the page itself scroll */
html.kb, html.kb body { overflow: hidden; overscroll-behavior: none; }

.composer { margin-bottom: 8px; }
.chat-page { transition: none; }

.kb .chat-page { top: 0; }

/* In the chat the page itself never moves: no rubber-band stretch when the keyboard rises */
html:has(.chat-page), html:has(.chat-page) body { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
.msgs { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

.mode-row { display: flex; align-items: center; gap: 8px; padding: 6px 14px 0; flex: none; }
.mode-seg { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--green-tint, #e6efe9); }
.mode-seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 800; color: var(--green-deep, #08442b); cursor: pointer; }
.mode-seg button.on { background: var(--green, #0a6b43); color: #fff; }
.quick-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.05); font-size: 12px; line-height: 1.35; }
.quick-note.warn { background: #fdecc8; color: #5a3b00; }
.quick-note button { flex: none; border: 0; background: var(--green, #0a6b43); color: #fff; font: inherit; font-weight: 800; font-size: 12px; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.mode-seg button { min-height: 0; }

.quick-note:not(.warn) { background: none; padding: 0; justify-content: flex-start; }

.install-card { display: flex; align-items: center; gap: 12px; background: var(--mango-tint, #fdf0dc); border-radius: 20px; padding: 12px 12px 12px 14px; }
.install-card .ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.install-card .ic svg { width: 22px; height: 22px; }
.install-card .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.install-card strong { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.install-card .small { color: var(--ink-2); font-weight: 600; font-size: 13px; }

/* The + menu in the chat box: add a photo or a document */
.plus-menu { position: absolute; left: 10px; bottom: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(15,26,20,.18); padding: 6px; display: flex; flex-direction: column; min-width: 250px; z-index: 5; }
.plus-menu[hidden] { display: none; }
.plus-menu button { display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 12px; cursor: pointer; font: inherit; color: var(--ink); min-height: 48px; }
.plus-menu button:hover, .plus-menu button:focus-visible { background: var(--green-tint); }
.plus-menu svg { width: 22px; height: 22px; color: var(--green); flex: none; }
.plus-menu span { display: flex; flex-direction: column; }
.plus-menu small { color: var(--ink-3); font-size: 12px; font-weight: 600; }
