:root {
  --ink: #0c0d10;
  --muted: #7a7f87;
  --line: #e4e6ea;
  --soft: #f4f5f7;
  --blue: #0877df;
  --blue-soft: #eaf4ff;
  --danger: #c9362b;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #fff; font-size: 16px; letter-spacing: 0; }
button, textarea, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.shell { width: min(100%, 760px); min-height: 100dvh; margin: 0 auto; padding-bottom: calc(82px + var(--safe-bottom)); }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 20px 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand > span:last-child { display: grid; min-width: 0; }
.brand b { font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; }
.brand-icon { width: 38px; height: 38px; display: grid; place-items: center; background: var(--ink); color: #fff; border-radius: 8px; flex: 0 0 auto; }
.brand-icon.large { width: 58px; height: 58px; }
.private { color: var(--muted); font-size: 12px; white-space: nowrap; }
main { padding: 28px 20px 20px; }
.view[hidden] { display: none !important; }
.page-heading { margin-bottom: 26px; }
.page-heading.compact { margin-bottom: 20px; }
.eyebrow { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; font-weight: 700; text-transform: uppercase; margin-bottom: 6px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(30px, 8vw, 42px); line-height: 1.06; margin-bottom: 12px; }
h2 { font-size: 21px; line-height: 1.2; margin-bottom: 8px; }
p { color: #555b63; line-height: 1.55; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; padding: 4px; margin-bottom: 30px; background: var(--soft); }
.mode-switch button { min-width: 0; border: 0; border-radius: 6px; background: transparent; padding: 11px 8px; display: grid; gap: 2px; color: var(--muted); }
.mode-switch span { font-weight: 750; }
.mode-switch small { font-size: 11px; }
.mode-switch button.selected { background: #fff; color: var(--ink); box-shadow: 0 1px 5px rgba(12,13,16,.09); }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }
.theme-list, .history-list { display: grid; border-top: 1px solid var(--line); }
.theme-row, .history-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 17px 2px; display: grid; grid-template-columns: 42px minmax(0,1fr) 24px; align-items: center; gap: 12px; text-align: left; color: var(--ink); }
.row-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #b9d9f8; border-radius: 8px; color: var(--blue); background: #fff; font-weight: 800; }
.row-copy { min-width: 0; display: grid; gap: 4px; }
.row-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-copy small { color: var(--muted); font-size: 13px; }
.row-meta { color: var(--muted); }
.adviser-intro { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 24px 0; }
.button { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); min-height: 48px; padding: 0 18px; font-weight: 700; }
.button.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.button.full { width: 100%; }
.button:disabled { opacity: .45; cursor: default; }
.text-button { border: 0; background: transparent; color: var(--blue); padding: 6px 0; font-weight: 700; }
.recent { margin-top: 30px; }
.chat-heading { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: start; gap: 10px; margin-bottom: 12px; }
.chat-heading h1 { font-size: 23px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.chat-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-button.danger { color: var(--danger); }
.icon-button .back { transform: rotate(180deg); }
.status-line { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.messages { display: grid; gap: 16px; padding: 20px 0 160px; }
.message { max-width: 92%; padding: 14px 15px; border-radius: 8px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.assistant { background: var(--soft); justify-self: start; }
.message.user { background: var(--blue); color: #fff; justify-self: end; }
.message small { display: block; margin-top: 8px; opacity: .65; font-size: 11px; }
.thinking { position: fixed; left: 50%; bottom: calc(162px + var(--safe-bottom)); transform: translateX(-50%); width: min(calc(100% - 40px), 720px); display: flex; align-items: center; gap: 6px; padding: 12px 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: pulse 1s infinite alternate; }
.thinking i:nth-child(2) { animation-delay: .2s; }.thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .2; transform: translateY(-3px); } }
.composer { position: fixed; z-index: 8; left: 50%; bottom: calc(72px + var(--safe-bottom)); transform: translateX(-50%); width: min(100%, 760px); padding: 10px 20px; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 48px; align-items: end; gap: 8px; }
.composer textarea { width: 100%; min-height: 48px; max-height: 120px; resize: none; border: 1px solid #cfd3d8; border-radius: 8px; padding: 12px; outline: none; }
.composer textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.send-button { width: 48px; height: 48px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.resume-bar { position: fixed; z-index: 9; left: 50%; bottom: calc(72px + var(--safe-bottom)); transform: translateX(-50%); width: min(100%, 760px); padding: 12px 20px; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.empty { padding: 56px 20px; display: grid; justify-items: center; text-align: center; gap: 8px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; }.empty b { color: var(--ink); }
.bottom-nav { position: fixed; z-index: 10; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 760px); height: calc(72px + var(--safe-bottom)); padding: 8px 18px var(--safe-bottom); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); }
.bottom-nav button { border: 0; background: transparent; color: #92979e; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 11px; }
.bottom-nav button.selected { color: var(--ink); font-weight: 750; }
.auth { min-height: 65dvh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 24px; }
dialog { width: min(calc(100% - 28px), 520px); border: 0; border-radius: 8px; padding: 0; box-shadow: 0 20px 70px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(5,8,12,.52); }
.dialog-body { position: relative; padding: 26px; }
.dialog-close { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border: 0; background: transparent; }
.dialog-body h2 { margin-top: 18px; }
.consent-check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 20px 0; line-height: 1.4; }
.consent-check input { width: 20px; height: 20px; accent-color: var(--blue); }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(88px + var(--safe-bottom)); transform: translateX(-50%); width: min(calc(100% - 40px), 520px); background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 8px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (min-width: 700px) { main { padding-inline: 36px; }.composer { padding-inline: 36px; } }
