/* Executive Coach: design system + layouts (login, coach app, admin) */
:root {
  --bg: #0e1014;
  --bg-2: #0a0c10;
  --surface: rgba(255, 255, 255, .04);
  --surface-2: rgba(255, 255, 255, .07);
  --surface-solid: #16191f;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .15);
  --text: #eceef2;
  --text-2: #b2b7c2;
  --muted: #838997;
  --accent: #cdb27a;          /* champagne, slightly quieter on dark */
  --accent-ink: #1a1408;
  --teal: #6fb8ad;
  --violet: #9a9fd6;
  --bg-image: radial-gradient(900px 520px at 50% -12%, rgba(205, 178, 122, .07), transparent 62%), linear-gradient(180deg, var(--bg), var(--bg-2));
  --danger: #f87171;
  --ok: #4ade80;
  --user-bubble: linear-gradient(135deg, rgba(212, 185, 127, .16), rgba(212, 185, 127, .07));
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f5f1; --bg-2: #ecebe5; --surface: rgba(20, 24, 40, .035); --surface-2: rgba(20, 24, 40, .06); --surface-solid: #ffffff;
    --border: rgba(20, 24, 40, .1); --border-strong: rgba(20, 24, 40, .18); --text: #141829; --text-2: #3d4460; --muted: #6b7290;
    --accent: #9a7a3c; --accent-ink: #fff; --teal: #0f766e; --violet: #6d28d9;
    --user-bubble: linear-gradient(135deg, rgba(154, 122, 60, .14), rgba(154, 122, 60, .06)); --shadow: 0 20px 50px -24px rgba(20, 24, 40, .25);
    --bg-image: radial-gradient(1200px 700px at 70% -10%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 60%), radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--teal) 10%, transparent), transparent 60%), linear-gradient(180deg, var(--bg), var(--bg-2));
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f5f1; --bg-2: #ecebe5; --surface: rgba(20, 24, 40, .035); --surface-2: rgba(20, 24, 40, .06); --surface-solid: #ffffff;
  --border: rgba(20, 24, 40, .1); --border-strong: rgba(20, 24, 40, .18); --text: #141829; --text-2: #3d4460; --muted: #6b7290;
  --accent: #9a7a3c; --accent-ink: #fff; --teal: #0f766e; --violet: #6d28d9;
  --user-bubble: linear-gradient(135deg, rgba(154, 122, 60, .14), rgba(154, 122, 60, .06)); --shadow: 0 20px 50px -24px rgba(20, 24, 40, .25);
  --bg-image: radial-gradient(1200px 700px at 70% -10%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 60%), radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--teal) 10%, transparent), transparent 60%), linear-gradient(180deg, var(--bg), var(--bg-2));
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 15px/1.6 var(--font); color: var(--text); -webkit-font-smoothing: antialiased;
  background: var(--bg-image);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: background .2s var(--ease), border-color .2s, transform .15s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: var(--danger); }
.icon-btn { width: 40px; padding: 0; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.input {
  width: 100%; height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
textarea.input { height: auto; padding: 12px 16px; resize: vertical; }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); color: var(--text-2); }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 100; padding: 10px 18px; border-radius: 999px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); transition: all .3s var(--ease); pointer-events: none; font-size: 14px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 56px; }
.login-visual .orb-host { position: absolute; inset: 0; }
.login-visual blockquote { position: relative; margin: 0; max-width: 460px; font: 400 26px/1.35 var(--display); color: var(--text); }
.login-visual cite { display: block; margin-top: 14px; font: 13px var(--font); color: var(--muted); font-style: normal; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-box { width: 100%; max-width: 400px; display: grid; gap: 22px; }
.login-box h1 { margin: 0; font: 500 36px/1.15 var(--display); letter-spacing: -.01em; }
.login-box p { margin: 0; color: var(--text-2); }
.code-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-inputs input { height: 56px; text-align: center; font: 600 22px var(--mono); padding: 0; }
.login-foot { font-size: 12px; color: var(--muted); }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: 280px auto; }
  .login-visual { padding: 24px; }
  .login-visual blockquote { font-size: 19px; }
}

/* ---------- coach app layout ---------- */
.shell { height: 100%; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  display: flex; flex-direction: column; gap: 14px; padding: 18px 14px; border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(from 200deg, var(--teal), var(--violet), var(--accent), var(--teal)); box-shadow: 0 0 24px color-mix(in srgb, var(--violet) 50%, transparent); }
.brand b { font: 600 17px var(--display); letter-spacing: .01em; }
.brand small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.side-section { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 2px; display: flex; justify-content: space-between; align-items: center; }
.conv-list { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 2px; min-height: 80px; margin: 0 -4px; padding: 0 4px; }
.conv-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: 14px;
  border: 1px solid transparent; background: none; text-align: left; width: 100%; transition: background .15s;
}
.conv-item:hover { background: var(--surface); color: var(--text); }
.conv-item.active { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.conv-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .d { font-size: 11px; color: var(--muted); }
.commit-list { display: grid; gap: 6px; max-height: 30vh; overflow-y: auto; }
.commit { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.commit button { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--accent); background: none; cursor: pointer; padding: 0; }
.commit button:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.commit.done { opacity: .55; text-decoration: line-through; }
.commit.done button { background: var(--accent); }
.me-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; width: 100%; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); flex: none; }
.me-row .who { flex: 1; min-width: 0; font-size: 13px; }
.me-row .who span { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* collapsible sidebar (desktop): an icon rail; on phones the sidebar is a drawer instead */
.shell { transition: grid-template-columns .35s var(--ease); }
.collapse-btn { margin-left: auto; width: 32px; height: 32px; color: var(--muted); }
.collapse-btn:hover { color: var(--text); }
.collapse-btn .icon { transition: transform .35s var(--ease); }
@media (max-width: 860px) { .collapse-btn { display: none; } }

.main { position: relative; display: grid; grid-template-rows: auto 1fr auto; min-height: 0; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 22px; min-height: 64px; }
.topbar h2 { flex: 1; margin: 0; font: 500 17px var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .25s var(--ease), background .2s; }
.toggle input { display: none; }
.toggle input:checked + .switch { background: color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(16px); background: var(--accent); }

.stage { position: relative; min-height: 0; display: grid; grid-template-rows: auto auto 1fr; overflow: hidden; }
.orb-wrap { position: relative; height: 210px; transition: height .7s var(--ease); display: grid; place-items: center; }
.orb-host { position: absolute; inset: 0; }
.stage.empty .orb-wrap { height: 44vh; min-height: 260px; }
.stage.talk .orb-wrap { height: 58vh; }
.status-line {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--text-2); letter-spacing: .02em;
  padding: 4px 14px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 50%, transparent); border: 1px solid var(--border); opacity: 0; transition: opacity .3s;
  white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}
.status-line.show { opacity: 1; }
.captions {
  width: min(780px, 100%); margin: 0 auto; padding: 4px 22px 12px; text-align: center; max-height: 24vh; overflow-y: auto;
  font: 400 21px/1.45 var(--display); color: var(--text); pointer-events: none; overflow-wrap: anywhere;
}
.captions:empty { display: none; }
.captions .partial { color: var(--text-2); }

.transcript { overflow-y: auto; padding: 8px 22px 24px; scroll-behavior: smooth; mask-image: linear-gradient(to bottom, transparent, #000 24px); }
.stage.talk .transcript { opacity: .35; }
.thread { max-width: 760px; margin: 0 auto; display: grid; gap: 18px; }
.msg { display: grid; gap: 8px; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.user { justify-items: end; }
.msg.user .bubble { background: var(--user-bubble); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 18px 18px 4px 18px; padding: 10px 16px; max-width: 82%; white-space: pre-wrap; }
.msg.coach .bubble { max-width: 100%; color: var(--text); }
.msg.coach .bubble p { margin: 0 0 10px; }
.msg.coach .bubble p:last-child { margin-bottom: 0; }
.msg.coach .bubble ul, .msg.coach .bubble ol { margin: 4px 0 10px; padding-left: 22px; }
.msg.coach .bubble strong { color: var(--text); font-weight: 600; }
.msg .who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.msg .who .dot { width: 8px; height: 8px; border-radius: 50%; background: conic-gradient(var(--teal), var(--violet), var(--accent)); }
.cite { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin: 0 1px; border-radius: 6px; font-size: 11px; font-weight: 600;
  vertical-align: 2px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); cursor: pointer; border: 0; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; }
.source { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 8px; font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); }
.source b { color: var(--accent); font-weight: 600; }
.source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.source.flash { border-color: var(--accent); }
.msg-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-actions .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.escalation { padding: 10px 14px; border-radius: 12px; font-size: 13px; color: var(--text-2); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.commit-note { font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: none; } }

.welcome { max-width: 860px; margin: 0 auto; text-align: center; display: grid; gap: 18px; padding: 0 12px 24px; animation: rise .6s var(--ease) both; }
.welcome h1 { margin: 0; font: 400 clamp(28px, 4vw, 40px)/1.15 var(--display); letter-spacing: -.01em; }
.welcome p { margin: 0; color: var(--text-2); }
.topics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; text-align: left; margin-top: 6px; }
.topic {
  padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: transform .25s var(--ease), border-color .2s, background .2s;
  display: grid; gap: 6px; min-height: 92px; align-content: start;
}
.topic:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--surface-2); }
.topic .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.topic b { font-weight: 600; font-size: 14px; }

.dock { padding: 10px 22px 18px; }
.chips { max-width: 760px; margin: 0 auto 10px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .2s var(--ease); animation: rise .4s var(--ease) both; }
.chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.composer {
  max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 8px; border-radius: 22px;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.composer textarea { flex: 1; border: 0; outline: none; background: none; resize: none; padding: 10px 6px; max-height: 180px; line-height: 1.5; }
.mic {
  position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: var(--text); transition: background .2s, transform .15s;
}
.mic:hover { background: var(--border-strong); }
.mic.rec { background: var(--danger); color: #fff; }
.mic.rec::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--danger); opacity: .5; transform: scale(var(--lvl, 1)); transition: transform .08s linear; }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; flex: none; transition: opacity .2s, transform .15s; }
.send:disabled { opacity: .35; cursor: default; }
.talk-btn { height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent); background: color-mix(in srgb, var(--teal) 10%, transparent); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; flex: none; font-weight: 500; }
.talk-btn:hover { background: color-mix(in srgb, var(--teal) 18%, transparent); }
.talk-bar { max-width: 760px; margin: 0 auto; display: flex; justify-content: center; gap: 10px; }
.talk-bar .btn { height: 48px; padding: 0 22px; }
.hint { text-align: center; font-size: 11px; color: var(--muted); margin-top: 8px; }

/* drawer (profile / memory) */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 50; background: var(--surface-solid); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform .4s var(--ease); display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.drawer.show { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer header h3 { margin: 0; font: 500 19px var(--display); }
.drawer .body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 18px; align-content: start; }
.memory-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.memory-item span { flex: 1; }
.memory-item button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 16px; line-height: 1; }
.memory-item button:hover { color: var(--danger); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* modal (session summary) */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal.show { opacity: 1; pointer-events: auto; }
.modal .card { width: min(560px, 100%); max-height: 86vh; overflow-y: auto; padding: 26px; background: var(--surface-solid); box-shadow: var(--shadow); transform: translateY(10px); transition: transform .3s var(--ease); }
.modal.show .card { transform: none; }
.modal h3 { margin: 4px 0 12px; font: 500 24px var(--display); }
.modal ul { padding-left: 20px; color: var(--text-2); }

@media (max-width: 1000px) { .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: 290px; transform: translateX(-100%); transition: transform .35s var(--ease); background: var(--surface-solid); }
  .sidebar.show { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  .transcript, .dock { padding-left: 14px; padding-right: 14px; }
  .orb-wrap { height: 150px; }
  .stage.empty .orb-wrap { height: 32vh; min-height: 200px; }
  .toggle .lbl { display: none; }
  .talk-btn .lbl { display: none; }
  .talk-btn { width: 44px; padding: 0; justify-content: center; }
}

/* ---------- admin ---------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 20px; }
.admin header.top { display: flex; align-items: center; gap: 14px; }
.admin header.top h1 { flex: 1; margin: 0; font: 500 28px var(--display); }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); width: fit-content; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--text-2); }
.tabs button.active { background: var(--surface-2); color: var(--text); }
.panel { padding: 20px; display: grid; gap: 16px; }
.panel h2 { margin: 0; font: 500 19px var(--display); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl-wrap { overflow-x: auto; }
.secret { font-family: var(--mono); font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--accent); word-break: break-all; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--text-2); }
.checks label { display: inline-flex; gap: 6px; align-items: center; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: 12px; border-radius: 10px; overflow-x: auto; }

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

/* ---------- orb fallback (no WebGL) — from js/orb.js ---------- */
.orb-fallback {
  --orb-level: 0;
  position: relative;
  width: 100%;
  height: 100%;
}
.orb-fallback::before,
.orb-fallback::after {
  content: "";
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  scale: calc(1 + var(--orb-level) * 0.08);
  transition: scale 160ms ease-out, filter 600ms ease;
}
.orb-fallback::before {
  background: radial-gradient(circle, rgba(63, 224, 208, 0.28), rgba(155, 123, 255, 0.14) 45%, transparent 70%);
  inset: 6%;
  animation: orb-fb-halo 7s ease-in-out infinite;
}
.orb-fallback::after {
  background:
    radial-gradient(circle at 34% 28%, rgba(243, 217, 164, 0.85), transparent 22%),
    radial-gradient(circle at 70% 78%, rgba(63, 224, 208, 0.55), transparent 45%),
    radial-gradient(circle at 50% 50%, #2a2470 0%, #141a4a 55%, #0a0f2e 78%, #6f5bd6 100%);
  box-shadow: 0 0 0 1px rgba(155, 123, 255, 0.25), 0 0 48px rgba(63, 224, 208, 0.25);
  animation: orb-fb-breathe 6s ease-in-out infinite;
}
.orb-fallback[data-theme="light"]::before {
  background: radial-gradient(circle, rgba(10, 163, 154, 0.18), rgba(122, 79, 230, 0.10) 45%, transparent 70%);
}
.orb-fallback[data-state="listening"]::after { animation-duration: 3.2s; filter: saturate(1.2) brightness(1.08); }
.orb-fallback[data-state="thinking"]::after  { animation: orb-fb-think 2.4s linear infinite; }
.orb-fallback[data-state="speaking"]::after  { animation-duration: 1.4s; filter: brightness(1.12); }
.orb-fallback[data-state="error"]::after     { filter: grayscale(0.7) sepia(0.4) hue-rotate(-40deg) saturate(2.2); }
.orb-fallback.is-pulsing::before { animation: orb-fb-pulse 1.2s ease-out 1; }
@keyframes orb-fb-breathe { 0%, 100% { transform: scale(0.97); } 50% { transform: scale(1.03); } }
@keyframes orb-fb-halo    { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes orb-fb-think   { from { transform: rotate(0deg) scale(1); } to { transform: rotate(360deg) scale(1); } }
@keyframes orb-fb-pulse   { from { transform: scale(0.9); opacity: 1; } to { transform: scale(1.25); opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .orb-fallback::before, .orb-fallback::after { animation: none !important; }
}

/* ---------- topic cards: icon and label centred ---------- */
.topics { text-align: center; }
.topic { justify-items: center; align-content: center; text-align: center; gap: 10px; }

/* ---------- voice turns are kept in the thread ---------- */
.stage.talk .transcript { opacity: .9; }
.stage.talk .orb-wrap { height: 42vh; }
.voice-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.voice-badge .icon { width: 12px; height: 12px; }
.msg.user .voice-badge { margin-top: -4px; }

/* ---------- settings & preferences ---------- */
.set-group { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.set-group:first-of-type { border-top: 0; padding-top: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.set-row .lbl2 { display: grid; gap: 2px; font-size: 14px; }
.set-row .lbl2 span { color: var(--muted); font-size: 12px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.segmented button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---------- coaching plan modal ---------- */
.plan-goal { padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; font: 400 18px/1.45 var(--display); }
.plan-actions { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; counter-reset: a; }
.plan-actions li { counter-increment: a; display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.plan-actions li::before { content: counter(a); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.plan-actions .meta { font-size: 12px; color: var(--muted); }
.plan-q { font: italic 400 18px/1.45 var(--display); color: var(--text); }
.email-ask { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); margin-top: 18px; }
.email-ask p { margin: 0; flex: 1; min-width: 200px; font-size: 14px; }

/* ---------- API docs ---------- */
.docs { display: grid; grid-template-columns: 250px 1fr; min-height: 100%; }
.docs-nav { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.docs-nav a { padding: 6px 10px; border-radius: 8px; color: var(--text-2); font-size: 14px; }
.docs-nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.docs-nav #ref-nav { display: grid; gap: 2px; }
.docs-main { max-width: 900px; padding: 40px 40px 80px; }
.docs-main section { padding: 10px 0 26px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.docs-main h1 { font: 400 40px/1.15 var(--display); margin: 8px 0 14px; }
.docs-main h2 { font: 500 26px var(--display); margin: 8px 0 12px; }
.docs-main h3 { font: 600 16px var(--font); margin: 22px 0 10px; }
.docs-main p, .docs-main li { color: var(--text-2); }
.docs-main code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--text); }
.docs-main pre code { background: none; padding: 0; }
.docs-main .tbl td, .docs-main .tbl th { font-size: 13.5px; }
.docs-main .kv td:first-child { color: var(--muted); width: 160px; }
.note { padding: 12px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--text-2); font-size: 14px; margin: 14px 0; }
.small { font-size: 12px; }
.req { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--danger); margin-left: 4px; }
.endpoint { border: 1px solid var(--border); border-radius: 12px; margin: 8px 0; background: var(--surface); }
.endpoint summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.endpoint summary::-webkit-details-marker { display: none; }
.endpoint .path { font-size: 13px; background: none !important; }
.endpoint .sum { flex: 1; color: var(--muted); font-size: 13px; }
.endpoint .ep-body { padding: 0 14px 14px; }
.method { font: 700 11px var(--mono); padding: 3px 8px; border-radius: 6px; min-width: 58px; text-align: center; }
.method.get { background: color-mix(in srgb, var(--teal) 18%, transparent); color: var(--teal); }
.method.post { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.method.patch, .method.put { background: color-mix(in srgb, var(--violet) 20%, transparent); color: var(--violet); }
.method.delete { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.auth { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.auth.admin { color: var(--danger); } .auth.key { color: var(--violet); } .auth.open { color: var(--ok); }
.schema { margin-top: 6px; }
@media (max-width: 860px) { .docs { grid-template-columns: 1fr; } .docs-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); } .docs-main { padding: 24px 16px 60px; } }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  html, body { height: 100dvh; }
  .shell { grid-template-columns: minmax(0, 1fr); height: 100dvh; }
  .main, .stage { grid-template-columns: minmax(0, 1fr); }
  .main, .stage, .transcript, .thread, .dock { min-width: 0; max-width: 100%; }
  .msg, .msg .bubble { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .msg.user .bubble { max-width: 88%; }
  .sources, .source { max-width: 100%; }
  .source span { max-width: 62vw; }
  .chips { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-left: -14px; margin-right: -14px; padding: 0 14px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .topbar { gap: 4px; }
  .topbar h2 { min-width: 0; font-size: 16px; }
  #end-btn { flex: none; padding: 0 10px; }
  .dock { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .composer { max-width: 100%; border-radius: 24px; }
  .composer textarea { font-size: 16px; min-width: 0; }
  .input, select.input, textarea.input { font-size: 16px; }      /* 16px stops iOS from zooming the page on focus */
  .hint { font-size: 10.5px; padding: 0 6px; }
  .welcome { padding: 0 4px 16px; }
  .welcome h1 { font-size: 28px; }
  .topic { min-height: 84px; padding: 12px 8px; font-size: 13px; }
  .topic b { font-size: 13px; }
  .captions { font-size: 17px; padding: 2px 16px 10px; max-height: 20vh; }
  .stage.talk .orb-wrap { height: 36vh; }
  .modal { padding: 10px; align-items: end; }
  .modal .card { padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 88dvh; border-radius: 22px; }
  .drawer { width: 100%; }
  .drawer .body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .grid2 { grid-template-columns: 1fr; }
  .sidebar { padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .toast { max-width: calc(100vw - 24px); text-align: center; bottom: calc(20px + env(safe-area-inset-bottom)); }
  .btn, .conv-item, .chip, .topic, .mic, .send, .talk-btn, .commit button { touch-action: manipulation; }
  .msg-actions { opacity: 1; }                                    /* no hover on touch: always show Listen / Copy */
}
@media (max-width: 420px) {
  .topics { gap: 8px; }
  .orb-wrap { height: 128px; }
  .stage.empty .orb-wrap { height: 28vh; min-height: 170px; }
  .plan-actions li { grid-template-columns: 24px 1fr; gap: 8px; }
  .login-box h1 { font-size: 30px; }
  .code-inputs { gap: 6px; }
  .code-inputs input { height: 50px; font-size: 20px; }
}
/* admin & docs: wide tables scroll inside their own box instead of widening the page */
.admin { min-width: 0; } .tbl-wrap { max-width: 100%; }
@media (max-width: 720px) { .admin { padding: 16px 12px 48px; } .admin header.top h1 { font-size: 22px; } .tabs { width: 100%; } .tabs button { flex: 1; padding: 8px 10px; font-size: 13px; } .panel { padding: 14px; } .docs-main pre { font-size: 11.5px; } }

/* mobile: sign-in visual, docs */
@media (max-width: 860px) {
  .login { grid-template-rows: 300px auto; }
  .login-visual { justify-content: flex-end; padding: 20px 22px; }
  .login-visual .orb-host { inset: -26% 0 24% 0; }
  .login-visual blockquote { font-size: 18px; text-shadow: 0 2px 18px var(--bg); }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding: 10px 12px; align-items: center; scrollbar-width: none; }
  .docs-nav::-webkit-scrollbar { display: none; }
  .docs-nav > * { flex: none; white-space: nowrap; }
  .docs-nav .brand { padding-right: 10px; } .docs-nav .side-section, .docs-nav #ref-nav { display: none; }
  .docs-main { min-width: 0; padding: 22px 16px 60px; }
  .docs-main h1 { font-size: 30px; }
  .docs-main table { display: block; overflow-x: auto; max-width: 100%; }
  .docs-main pre { max-width: 100%; }
  .docs-main code { overflow-wrap: anywhere; }
  .endpoint summary { gap: 8px; } .endpoint .sum { flex-basis: 100%; order: 3; }
}

/* ---------- no flash: the page is hidden until sign-in is confirmed; the canvas colour always matches the theme ---------- */
html { background: var(--bg); }
html.booting body, html.leaving body { visibility: hidden; }
body { transition: opacity .25s; }

/* segmented controls (theme, plan emails) */
.segmented { max-width: 100%; }
.segmented button { min-height: 34px; }

/* ---------- sign-in on phones: the orb floats softly behind the form ---------- */
@media (max-width: 860px) {
  .login { display: block; position: relative; min-height: 100dvh; overflow: hidden; }
  .login-visual { position: absolute; inset: 0; z-index: 0; padding: 0; pointer-events: none; opacity: .42; }
  .login-visual .orb-host { inset: -6% 0 38% 0; filter: saturate(.9) blur(.4px); }
  .login-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 18%, color-mix(in srgb, var(--bg) 78%, transparent) 52%, var(--bg) 88%); }
  .login-visual blockquote, .login-visual cite { display: none; }
  .login-panel { position: relative; z-index: 1; min-height: 100dvh; align-items: flex-end; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
  .login-box { max-width: 440px; gap: 16px; padding: 26px 22px 22px; border-radius: 26px; background: color-mix(in srgb, var(--surface-solid) 74%, transparent);
    border: 1px solid var(--border); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: var(--shadow); }
  .login-box h1 { font-size: 30px; }
  .login-box p { font-size: 15px; }
  .login-box .btn.primary { height: 50px; font-size: 16px; }
  .login-box .input { height: 50px; }
  .login-foot { font-size: 12px; }
}
@media (max-width: 860px) and (max-height: 640px) { .login-visual .orb-host { inset: -30% 0 30% 0; } .login-box { padding: 18px; gap: 12px; } .login-box h1 { font-size: 24px; } }

/* =====================================================================
   Settings: collapsible sections (memory has its own)
   ===================================================================== */
.acc-list { gap: 10px !important; }
.acc { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.acc summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; min-height: 52px; user-select: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .t { flex: 1; font-weight: 500; font-size: 15px; }
.acc summary .meta { font-size: 12.5px; color: var(--muted); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .chev { width: 8px; height: 8px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg); transition: transform .25s var(--ease); margin: 0 4px 3px 2px; flex: none; }
.acc[open] .chev { transform: rotate(-135deg); margin-top: 5px; }
.acc[open] summary { border-bottom: 1px solid var(--border); }
.acc-body { display: grid; gap: 14px; padding: 16px; }
.small-note { margin: 0; font-size: 13px; line-height: 1.5; }
.save-state { min-height: 18px; font-size: 12.5px; color: var(--ok); text-align: right; }
.acc-foot { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.acc-foot .btn { flex: 1 1 auto; }

/* profile prompt on the home screen */
.prompt-card { display: flex; align-items: center; gap: 14px; width: min(560px, 100%); margin: 2px auto 0; padding: 14px 18px; text-align: left; cursor: pointer;
  border-radius: 16px; border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.prompt-card span { flex: 1; display: grid; gap: 2px; font-size: 14px; }
.prompt-card small { color: var(--text-2); font-size: 12.5px; }
.prompt-card i { font: 300 26px/1 var(--font); color: var(--accent); font-style: normal; }
.prompt-card:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* session menu (phones) */
.more-btn { display: none; }
.more-menu { position: absolute; right: 12px; top: 54px; z-index: 55; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); display: grid; }
.more-menu[hidden] { display: none; }
.more-menu button { border: 0; background: none; text-align: left; padding: 12px 14px; border-radius: 10px; font-size: 15px; cursor: pointer; color: var(--text); }
.more-menu button:hover { background: var(--surface-2); }
.more-menu .danger { color: var(--danger); }

/* =====================================================================
   Sign-in: one centred card
   ===================================================================== */
.brand-mark.lg { width: 52px; height: 52px; box-shadow: 0 0 36px color-mix(in srgb, var(--violet) 50%, transparent); }
.login-panel { align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 420px; display: grid; gap: 22px; padding: 38px 34px 30px; text-align: center; border-radius: 24px;
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow); }
.login-card[hidden] { display: none; }
.lc-brand { display: grid; justify-items: center; gap: 12px; }
.lc-head h1 { margin: 0 0 10px; font: 500 30px/1.15 var(--display); letter-spacing: -.01em; }
.lc-head p { margin: 0 auto; max-width: 340px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.login-card .field { text-align: left; }
.login-card .input { height: 50px; }
.btn.block { width: 100%; height: 50px; font-size: 16px; }
.lc-foot { display: block; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-wrap: balance; }
.lc-foot .icon { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 6px; }
.lc-links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.login-card .code-inputs { text-align: center; }

@media (max-width: 860px) {
  .login-panel { align-items: center; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .login-card { max-width: 400px; padding: 30px 22px 24px; gap: 20px; border-radius: 26px; background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
    backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
  .lc-head h1 { font-size: 27px; }
  .lc-head p { font-size: 14.5px; }
  .brand-mark.lg { width: 46px; height: 46px; }
  .login-visual .orb-host { inset: -4% 0 34% 0; }
}
@media (max-width: 860px) and (max-height: 700px) { .login-card { padding: 20px 18px 18px; gap: 14px; } .lc-head h1 { font-size: 23px; } .lc-head p { display: none; } .brand-mark.lg { width: 38px; height: 38px; } }

/* =====================================================================
   Phones: fewer elements, more air
   ===================================================================== */
@media (max-width: 860px) {
  /* top bar: menu · title · ⋯ */
  .topbar { padding: 6px 8px 6px 6px; min-height: 52px; }
  .topbar h2 { font-size: 15.5px; text-align: left; padding-left: 4px; }
  #end-btn, #delete-btn { display: none; }
  .more-btn { display: inline-flex; }
  .topbar .icon-btn { width: 40px; height: 40px; }

  /* home */
  .stage.empty .orb-wrap { height: 22vh; min-height: 140px; }
  .welcome { gap: 14px; padding: 0 16px 18px; }
  .welcome h1 { font-size: 25px; }
  .welcome > p { display: none; }
  .prompt-card { padding: 12px 14px; width: 100%; }
  .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  .topic { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 14px; }
  .topic .ic { width: 30px; height: 30px; border-radius: 9px; flex: none; }
  .topic .ic .icon { width: 16px; height: 16px; }
  .topic b { font-size: 12.5px; line-height: 1.25; font-weight: 500; }

  /* conversation */
  .orb-wrap { height: 80px; }
  .transcript { padding: 4px 18px 22px; }
  .thread { gap: 18px; }
  .msg { gap: 6px; }
  .msg .who { display: none; }
  .msg.coach .bubble { font-size: 15.5px; line-height: 1.6; }
  .msg.coach .bubble p { margin-bottom: 12px; }
  .msg.user .bubble { padding: 9px 14px; border-radius: 18px 18px 5px 18px; font-size: 15px; max-width: 86%; }
  .sources { flex-wrap: nowrap; overflow-x: auto; margin: 0 -18px; padding: 0 18px 2px; scrollbar-width: none; }
  .sources::-webkit-scrollbar { display: none; }
  .source { flex: none; font-size: 11.5px; padding: 3px 9px; border-radius: 8px; }
  .source span { max-width: 52vw; }
  .msg-actions { opacity: .7; gap: 0; margin-top: -2px; }
  .msg.coach:not(.latest) .msg-actions { display: none; }
  .msg-actions .btn { width: 32px; height: 32px; padding: 0; }
  .msg-actions .t { display: none; }
  .escalation { font-size: 12.5px; padding: 9px 12px; }
  .commit-note { font-size: 12px; }

  /* dock: one calm bar */
  .dock { padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); }
  .chips { margin: 0 -12px 8px; padding: 0 12px 2px; gap: 6px; }
  .chip { font-size: 12.5px; padding: 6px 12px; }
  .composer { padding: 5px 5px 5px 8px; gap: 4px; box-shadow: none; border-radius: 26px; align-items: center; }
  .composer textarea { padding: 9px 4px; }
  .mic, .send, .talk-btn { width: 40px; height: 40px; }
  .talk-btn { padding: 0; justify-content: center; }
  .composer.has-text .mic, .composer.has-text .talk-btn { display: none; }
  .composer:not(.has-text) .send { display: none; }
  .hint { display: none; }
}

/* =====================================================================
   Commitments, reminders, calendar
   ===================================================================== */
.row-gap { display: inline-flex; align-items: center; gap: 8px; }
.mini { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; font: 500 16px/1 var(--font); padding: 0; display: grid; place-items: center; transition: transform .2s var(--ease), background .2s; }
.mini:hover { background: var(--surface-2); color: var(--text); }
.commit-form { padding: 0 2px 8px; }
.commit-form .input { height: 40px; font-size: 14px; }
.commit-list { gap: 6px; }
.commit { align-items: center; gap: 8px; padding: 8px 6px 8px 10px; transition: background .2s, opacity .3s; }
.commit .tick { flex: none; width: 20px; height: 20px; margin: 0; border-radius: 50%; border: 1.6px solid var(--accent); background: none; cursor: pointer; padding: 0; transition: transform .25s var(--ease), background .2s; }
.commit .tick:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.commit .tick:active { transform: scale(.82); }
.commit.done .tick { background: var(--accent); }
.commit.done .tick::after { content: "\2713"; display: block; font: 700 12px/17px var(--font); color: var(--accent-ink); text-align: center; }
.commit .ct { flex: 1; min-width: 0; display: grid; gap: 1px; }
.commit .tx { font-size: 13px; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.commit .meta, .remind .meta { font-size: 11.5px; color: var(--muted); }
.commit.done .tx { text-decoration: line-through; color: var(--muted); }
.cbtn { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; transition: background .2s, color .2s; }
.cbtn:hover { background: var(--surface-2); color: var(--text); }
.cbtn .icon { width: 15px; height: 15px; }
.commit.done button.cbtn, .commit .cbtn { background-color: transparent; border-radius: 8px; width: 28px; height: 28px; margin: 0; }
.commit.done .cbtn { opacity: .6; }
.remind-list { display: grid; gap: 4px; }
.remind { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 10px; border-radius: 10px; font-size: 12.5px; }
.remind .rt { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); }
.remind .rt .icon { width: 14px; height: 14px; margin-top: 3px; color: var(--accent); flex: none; }
.remind .rt > span { display: grid; min-width: 0; } .remind .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-badge { position: absolute; top: 6px; left: 30px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 10px/16px var(--font); text-align: center; pointer-events: none; }
.menu-badge[hidden] { display: none; }
.topbar { position: relative; }

.reminder-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--teal) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--teal) 32%, transparent); font-size: 13px; transition: opacity .3s, transform .3s; }
.reminder-chip.gone { opacity: 0; transform: scale(.98); pointer-events: none; }
.rc-main { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.rc-main .icon { width: 17px; height: 17px; color: var(--teal); margin-top: 2px; flex: none; }
.rc-main > span { display: grid; gap: 1px; overflow-wrap: anywhere; } .rc-main b { font-weight: 600; margin-right: 4px; } .rc-main small { color: var(--muted); font-size: 12px; }
.rc-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.rc-actions a, .rc-actions button { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 500 12px var(--font); cursor: pointer; text-decoration: none; }
.rc-actions a:hover, .rc-actions button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

#remind-modal { z-index: 65; }
#remind-modal .card { display: grid; gap: 14px; }
.rp-text { margin: 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; font: 400 17px/1.4 var(--display); overflow-wrap: anywhere; }
.rp-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-quick .chip { display: grid; gap: 0; text-align: left; padding: 7px 14px; animation: none; }
.rp-quick .chip small { font-size: 11px; color: var(--muted); }
.rp-cal { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.rp-cal a, .rp-cal button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 13px var(--font); cursor: pointer; text-decoration: none; }
.rp-cal a:hover, .rp-cal button:hover { background: var(--surface-2); text-decoration: none; }
.plan-actions li { grid-template-columns: 26px 1fr auto; align-items: start; }
.plan-bell { color: var(--accent); align-self: center; }

/* =====================================================================
   The orb is a control
   ===================================================================== */
.orb-host { cursor: pointer; transition: filter .35s var(--ease); -webkit-tap-highlight-color: transparent; border-radius: 50%; }
.orb-host:hover { filter: brightness(1.1) saturate(1.12) drop-shadow(0 0 28px color-mix(in srgb, var(--violet) 45%, transparent)); }
.orb-host:focus-visible { outline: 2px solid var(--accent); outline-offset: -8px; }
.orb-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 5px 14px; border-radius: 999px; font-size: 12.5px; letter-spacing: .02em; color: var(--text-2);
  background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--border); pointer-events: none; opacity: 0; transition: opacity .5s; }
.stage.empty:not(.orb-active):not(.talk) .orb-hint { opacity: 1; animation: hintbob 3.4s ease-in-out infinite; }
@keyframes hintbob { 50% { transform: translate(-50%, -4px); } }

/* =====================================================================
   Fluid motion
   ===================================================================== */
body { animation: pagein .45s var(--ease) both; }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } }
.welcome { transition: opacity .3s var(--ease), transform .3s var(--ease); }
.welcome.out { opacity: 0; transform: translateY(-10px) scale(.99); pointer-events: none; }
.msg.coach.fresh .bubble > * { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
.msg.coach.fresh .sources, .msg.coach.fresh .msg-actions, .msg.coach.fresh .reminder-chip, .msg.coach.fresh .commit-note { animation: rise .6s var(--ease) .35s both; }
.btn, .chip, .topic, .conv-item, .cbtn, .mini, .mic, .send, .talk-btn, .more-menu button, .acc summary, .prompt-card { transition: transform .18s var(--ease), background .2s, border-color .2s, color .2s, box-shadow .2s; }
.btn:active, .chip:active, .topic:active, .conv-item:active, .mic:active, .send:active, .talk-btn:active, .cbtn:active, .prompt-card:active, .acc summary:active { transform: scale(.97); }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.input:focus-visible { outline: none; }
.scrim { transition: opacity .35s var(--ease), backdrop-filter .35s; }
.scrim.show { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.drawer, .sidebar { transition: transform .45s cubic-bezier(.22, 1, .36, 1), box-shadow .3s; }
.modal .card { transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .3s; transform: translateY(18px) scale(.985); opacity: 0; }
.modal.show .card { transform: none; opacity: 1; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
.transcript { scroll-behavior: smooth; overscroll-behavior: contain; }
@media (prefers-reduced-motion: reduce) { body { animation: none; } .orb-hint { animation: none !important; } }

/* =====================================================================
   Sign-in v3: immersive on desktop, orb-first on phones
   ===================================================================== */
.login { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); min-height: 100dvh; overflow: hidden; }
.login::before { content: ""; position: absolute; inset: -20%; z-index: 0; pointer-events: none;
  background: radial-gradient(40% 36% at 22% 38%, color-mix(in srgb, var(--violet) 22%, transparent), transparent 70%), radial-gradient(34% 32% at 78% 72%, color-mix(in srgb, var(--teal) 15%, transparent), transparent 70%);
  animation: aurora 22s ease-in-out infinite alternate; }
@keyframes aurora { to { transform: translate3d(3%, -2%, 0) scale(1.06); } }
.login-visual { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 56px; overflow: hidden; opacity: 1; pointer-events: none; height: auto; }
.login-visual::after { content: none; }
.login-visual .orb-host { position: absolute; inset: 0 0 16% 0; filter: none; pointer-events: auto; cursor: default; }
.lv-top { position: relative; display: flex; align-items: center; gap: 12px; font: 600 19px var(--display); }
.lv-copy { position: relative; max-width: 540px; }
.lv-copy h2 { margin: 0 0 22px; font: 400 clamp(34px, 3.6vw, 54px)/1.07 var(--display); letter-spacing: -.02em; }
.lv-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--text-2); font-size: 15px; }
.lv-points li { display: flex; align-items: center; gap: 12px; }
.lv-points li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.login-panel { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; padding: 32px; min-height: 100dvh; }
.login-card { max-width: 440px; padding: 42px 38px 32px; border-radius: 28px; text-align: center;
  background: color-mix(in srgb, var(--surface-solid) 68%, transparent); backdrop-filter: blur(24px) saturate(1.35); -webkit-backdrop-filter: blur(24px) saturate(1.35);
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent); box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .55), inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent); animation: cardin .7s var(--ease) both; }
@keyframes cardin { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.login-card .input { background: color-mix(in srgb, var(--surface) 80%, transparent); }

@media (max-width: 860px) {
  .login { display: flex; flex-direction: column; min-height: 100dvh; }
  .login::before { inset: -10%; }
  .login-visual { flex: none; position: relative; inset: auto; height: 42dvh; min-height: 230px; padding: 0; opacity: 1; }
  .login-visual .orb-host { inset: 0; }
  .login-visual::after { content: ""; position: absolute; inset: auto 0 0 0; height: 46%; background: linear-gradient(180deg, transparent, var(--bg)); pointer-events: none; }
  .lv-top { position: absolute; left: 22px; top: calc(18px + env(safe-area-inset-top)); font-size: 17px; z-index: 2; }
  .lv-copy { display: none; }
  .login-panel { flex: 1; min-height: 0; align-items: flex-start; padding: 0 22px calc(22px + env(safe-area-inset-bottom)); }
  .login-card { max-width: 420px; margin: -10px auto 0; padding: 0; gap: 18px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; animation: none; }
  .login-card .lc-brand .brand-mark { display: none; }
  .login-card .lc-brand { gap: 0; }
  .lc-head h1 { font-size: 30px; }
  .login-card .input { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: var(--border-strong); }
  .btn.block { box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
}
@media (max-width: 860px) and (max-height: 700px) { .login-visual { height: 30dvh; min-height: 170px; } .lc-head p { display: none; } .lc-head h1 { font-size: 25px; } .login-card { gap: 14px; } }
@media (prefers-reduced-motion: reduce) { .login::before, .login-card { animation: none; } }

.toast { width: max-content; max-width: calc(100vw - 32px); text-align: center; line-height: 1.35; }

/* =====================================================================
   v4: fluid sidebar, header actions, edit/stop, first-run survey, dashboard
   ===================================================================== */
.ni { display: inline-flex; }
.icon { flex: none; }

/* settings drawer: long lists scroll inside the panel (the body needs min-height:0 to be a scroll container) */
.drawer { height: 100vh; height: 100dvh; max-height: 100dvh; }
.drawer .body { min-height: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
#memory { max-height: min(46vh, 380px); overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; scrollbar-width: thin; }
.acc-body { max-width: 100%; }
.memory-item span { min-width: 0; overflow-wrap: anywhere; }

/* ---- sidebar: width glides, nothing reflows or pops (labels fade and clip instead of disappearing) ---- */
.shell { --nav-w: 280px; grid-template-columns: var(--nav-w) minmax(0, 1fr); transition: grid-template-columns .5s cubic-bezier(.22, 1, .36, 1); }
.shell.no-anim, .shell.no-anim * { transition: none !important; }
.sidebar { overflow: hidden; min-width: 0; }
.brand .nav-label { padding-top: 2px; }
.nav-text, .nav-label, .me-row .who { white-space: nowrap; overflow: hidden; max-width: 220px; transition: opacity .22s ease, max-width .45s cubic-bezier(.22, 1, .36, 1), margin .45s cubic-bezier(.22, 1, .36, 1); }
.brand { position: relative; height: 42px; padding: 0 0 0 8px; gap: 10px; align-items: flex-start; transition: height .45s cubic-bezier(.22, 1, .36, 1); }
.brand-mark { flex: none; margin-top: 6px; transition: transform .45s cubic-bezier(.22, 1, .36, 1); }
.collapse-btn { position: absolute; right: 0; top: 5px; margin: 0; transition: top .45s cubic-bezier(.22, 1, .36, 1), right .45s cubic-bezier(.22, 1, .36, 1), color .2s; }
#new-session { gap: 0; overflow: hidden; white-space: nowrap; justify-content: center; transition: background .2s, transform .15s, padding .45s cubic-bezier(.22, 1, .36, 1); }
#new-session .nav-text { margin-left: 8px; }
.side-section { max-height: 32px; overflow: hidden; white-space: nowrap; transition: opacity .22s, max-height .45s cubic-bezier(.22, 1, .36, 1), padding .45s cubic-bezier(.22, 1, .36, 1); }
.conv-list { transition: opacity .25s; }
.nav-link { display: flex; align-items: center; gap: 0; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; border: 1px solid transparent; overflow: hidden; white-space: nowrap; text-decoration: none; transition: background .2s, color .2s, padding .45s cubic-bezier(.22, 1, .36, 1), transform .18s var(--ease); }
.nav-link:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-link:active { transform: scale(.98); }
.nav-link .nav-text { margin-left: 10px; flex: 1; }
.nav-link .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); font: 600 11.5px/20px var(--font); text-align: center; transition: opacity .2s; }
.nav-link .count:empty { display: none; }
.me-row { overflow: hidden; transition: padding .45s cubic-bezier(.22, 1, .36, 1), gap .45s cubic-bezier(.22, 1, .36, 1), background .3s, border-color .3s; }
.me-row .avatar { flex: none; }
@media (min-width: 861px) {
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) { --nav-w: 72px; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .nav-text, :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .nav-label, :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .me-row .who { max-width: 0; opacity: 0; margin-left: 0; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .side-section { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .conv-list { opacity: 0; pointer-events: none; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .brand { height: 86px; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .brand-mark { transform: translateX(-1px); }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .collapse-btn { top: 48px; right: 5px; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .collapse-btn .icon { transform: scaleX(-1); }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .nav-link { padding-left: 13px; padding-right: 13px; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .nav-link .count { opacity: 0; width: 0; padding: 0; min-width: 0; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) .me-row { padding: 6px; gap: 0; border-color: transparent; background: none; }
  :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) #new-session { padding: 0; }
  .sidebar { align-items: stretch; }
}
@media (max-width: 860px) {
  .shell { transition: none; grid-template-columns: minmax(0, 1fr); }
  .brand .collapse-btn { display: none; }
  body:has(.stage.empty) .topbar h2 { visibility: hidden; }
}

/* ---- header actions: commitments, reminders, call ---- */
.topbar { position: relative; }
.tb-btn { position: relative; flex: none; height: 38px; min-width: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; border: 1px solid transparent;
  background: none; color: var(--text-2); cursor: pointer; font: 500 13.5px var(--font); text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .18s var(--ease); }
.tb-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tb-btn:active { transform: scale(.94); }
.tb-btn .icon { width: 19px; height: 19px; }
.tb-btn .tb-n { position: absolute; top: -1px; right: -1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 700 10.5px/17px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.tb-btn .tb-n.pop { animation: badgepop .5s var(--ease); }
@keyframes badgepop { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.tb-btn.call { margin-left: 4px; padding: 0 16px 0 12px; border-color: color-mix(in srgb, var(--teal) 50%, transparent); background: color-mix(in srgb, var(--teal) 10%, transparent); color: var(--text); }
.tb-btn.call:hover { background: color-mix(in srgb, var(--teal) 20%, transparent); }
.tb-btn.call.live { background: color-mix(in srgb, var(--danger) 16%, transparent); border-color: color-mix(in srgb, var(--danger) 55%, transparent); animation: calllive 1.8s ease-in-out infinite; }
.tb-btn.call.live .lbl::after { content: " · live"; opacity: .7; }
@keyframes calllive { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 12%, transparent); } }
@media (max-width: 860px) {
  .tb-btn { height: 40px; min-width: 40px; padding: 0; }
  .tb-btn.call { margin-left: 2px; padding: 0; }
  .tb-btn .lbl { display: none; }
  .topbar { gap: 0; }
}

/* ---- stop while Aspasia is writing ---- */
.send.stop { opacity: 1 !important; background: var(--text); color: var(--bg); animation: stopring 1.6s ease-in-out infinite; }
.send.stop .icon { width: 16px; height: 16px; fill: currentColor; }
@keyframes stopring { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--text) 14%, transparent); } }

/* ---- edit a sent message ---- */
.user-actions { justify-content: flex-end; }
.msg.user.editing .bubble { width: min(620px, 100%); max-width: 100%; padding: 10px; }
.edit-box { width: 100%; resize: none; border: 0; outline: none; background: none; color: var(--text); font: inherit; line-height: 1.5; padding: 4px 6px; min-height: 52px; }
.edit-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 6px; }
.msg.user.editing .user-actions { display: none; }
.msg.gone { animation: goneout .22s ease forwards; }
@keyframes goneout { to { opacity: 0; transform: translateY(-6px) scale(.97); } }
@media (hover: none) { .msg-actions { opacity: .75; } .user-actions .t { display: none; } }

/* ---- first sign-in survey ---- */
.onboard { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); opacity: 0; transition: opacity .35s; }
.onboard.show { opacity: 1; }
.ob-card { width: min(520px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; border-radius: 26px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); padding: 20px 0 20px; transform: translateY(14px) scale(.98); transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.onboard.show .ob-card { transform: none; }
.ob-top { display: flex; align-items: center; justify-content: space-between; padding: 0 24px 14px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 22px; height: 4px; border-radius: 4px; background: var(--border-strong); transition: background .3s, width .4s var(--ease); }
.ob-dots i.done { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.ob-dots i.now { background: var(--accent); width: 34px; }
.ob-skip { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.ob-skip:hover { color: var(--text); background: var(--surface); }
.ob-steps { display: flex; flex: 1; min-height: 0; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.ob-step { flex: 0 0 100%; min-width: 0; padding: 4px 24px 8px; display: grid; gap: 14px; align-content: start; overflow-y: auto; opacity: 0; transition: opacity .35s; }
.ob-step.on { opacity: 1; }
.ob-step h2 { margin: 2px 0 0; font: 500 26px/1.2 var(--display); letter-spacing: -.01em; }
.ob-step p { margin: 0; }
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 13.5px; cursor: pointer; transition: all .2s var(--ease); touch-action: manipulation; }
.ob-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.ob-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: var(--accent); color: var(--text); font-weight: 500; transform: scale(1.03); }
.ob-cards { display: grid; gap: 8px; }
.ob-cards button { text-align: left; display: grid; gap: 2px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; transition: all .2s var(--ease); }
.ob-cards button span { font-size: 13px; color: var(--text-2); }
.ob-cards button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ob-nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px 0; }
.ob-nav .btn.primary { min-width: 150px; height: 46px; }
@media (max-width: 600px) {
  .onboard { padding: 0; align-items: end; }
  .ob-card { width: 100%; border-radius: 26px 26px 0 0; max-height: 92dvh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .ob-top, .ob-nav { padding-left: 18px; padding-right: 18px; }
  .ob-step { padding-left: 18px; padding-right: 18px; }
  .ob-step h2 { font-size: 23px; }
}

/* ---- dashboard page ---- */
.dash-body { overflow-y: auto; height: auto; min-height: 100%; }
.dash { max-width: 920px; margin: 0 auto; padding: 22px 20px calc(48px + env(safe-area-inset-bottom)); display: grid; gap: 22px; animation: rise .5s var(--ease) both; }
.dash-top { display: grid; gap: 14px; }
.dash-back { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--text-2); font-size: 14px; padding: 6px 12px 6px 8px; margin-left: -8px; border-radius: 999px; transition: background .2s, color .2s; }
.dash-back:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.dash-title h1 { margin: 2px 0 0; font: 500 clamp(26px, 5vw, 36px)/1.15 var(--display); letter-spacing: -.01em; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 2px; transition: transform .25s var(--ease), border-color .2s; }
.stat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.stat b { font: 500 32px/1.1 var(--display); color: var(--text); }
.stat b.small { font: 500 17px/1.5 var(--display); min-height: 36px; display: flex; align-items: flex-end; }
.stat span { font-size: 12.5px; color: var(--muted); }
.dash-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); width: fit-content; max-width: 100%; }
.dash-tabs button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: background .25s var(--ease), color .2s; }
.dash-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.dash-tabs .tn { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: color-mix(in srgb, currentColor 18%, transparent); font: 600 11.5px/20px var(--font); text-align: center; }
.panel { display: grid; gap: 14px; animation: rise .4s var(--ease) both; }
.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel-head .btn { gap: 6px; }
.add-row { display: flex; gap: 10px; }
.add-row .input { flex: 1; min-width: 0; }
.filter { width: fit-content; }
.d-list { display: grid; gap: 10px; }
.d-card { display: flex; align-items: flex-start; gap: 14px; padding: 14px 12px 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); transition: transform .25s var(--ease), border-color .2s, opacity .3s, background .2s; animation: rise .4s var(--ease) both; }
.d-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.d-card.gone { opacity: 0; transform: translateX(14px) scale(.98); pointer-events: none; }
.d-card .tick { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 1.8px solid var(--accent); background: none; cursor: pointer; padding: 0; transition: transform .25s var(--ease), background .2s; }
.d-card .tick:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.d-card .tick:active { transform: scale(.8); }
.d-card.done .tick { background: var(--accent); animation: tickpop .4s var(--ease); }
.d-card.done .tick::after { content: "\2713"; display: block; font: 700 14px/21px var(--font); color: var(--accent-ink); text-align: center; }
@keyframes tickpop { 50% { transform: scale(1.25); } }
.d-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.d-text { font-size: 15.5px; line-height: 1.4; color: var(--text); overflow-wrap: anywhere; }
.d-card.done .d-text { text-decoration: line-through; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.pill .icon { width: 12px; height: 12px; }
.pill.rem { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pill.warn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 9%, transparent); }
a.pill.link:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); }
.d-actions { display: flex; gap: 2px; flex: none; }
.d-actions .cbtn { width: 34px; height: 34px; }
.d-actions .cbtn .icon { width: 17px; height: 17px; }
.r-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.r-ic .icon { width: 17px; height: 17px; }
.r-cal { display: flex; gap: 14px; font-size: 12.5px; }
.r-cal a, .r-cal button { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.r-cal a:hover, .r-cal button:hover { text-decoration: underline; }
.empty-state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 44px 20px; border-radius: 18px; border: 1px dashed var(--border-strong); color: var(--muted); }
.empty-state .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.empty-state b { color: var(--text); font-weight: 500; font-size: 16px; }
.empty-state span { font-size: 13.5px; max-width: 420px; }
@media (max-width: 640px) {
  .dash { padding: calc(10px + env(safe-area-inset-top)) 14px calc(40px + env(safe-area-inset-bottom)); gap: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat b { font-size: 27px; }
  .dash-tabs { width: 100%; } .dash-tabs button { flex: 1; justify-content: center; }
  .d-card { padding: 12px 6px 12px 12px; gap: 10px; }
  .d-text { font-size: 15px; }
  .panel-head .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .shell, .sidebar *, .ob-card, .ob-steps { transition-duration: .01ms !important; } }

/* =====================================================================
   v5: interface styles, speech controls, drag cursor, support, flags
   ===================================================================== */
/* ---- interface styles: Original is the default above. Each style re-tints the tokens in dark and light. ---- */
html[data-look="minimal"] {
  --bg: #0c0c0d; --bg-2: #0c0c0d; --surface: rgba(255, 255, 255, .035); --surface-2: rgba(255, 255, 255, .065); --surface-solid: #151516;
  --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .17); --text: #ededee; --text-2: #b4b4b8; --muted: #86868c;
  --accent: #e8e8ea; --accent-ink: #0c0c0d; --teal: #9a9aa0; --violet: #7c7c82; --bg-image: none; --radius: 12px; --display: "Inter", -apple-system, "Segoe UI", sans-serif;
  --user-bubble: rgba(255, 255, 255, .07); --shadow: 0 16px 40px -20px rgba(0, 0, 0, .7);
}
@media (prefers-color-scheme: light) {
  html[data-look="minimal"]:not([data-theme="dark"]) { --bg: #fafafa; --bg-2: #fafafa; --surface: rgba(0, 0, 0, .03); --surface-2: rgba(0, 0, 0, .055); --surface-solid: #fff; --border: rgba(0, 0, 0, .09); --border-strong: rgba(0, 0, 0, .18); --text: #111113; --text-2: #46464c; --muted: #77777d; --accent: #18181b; --accent-ink: #fafafa; --user-bubble: rgba(0, 0, 0, .05); --shadow: 0 16px 40px -22px rgba(0, 0, 0, .25); }
}
html[data-look="minimal"][data-theme="light"] { --bg: #fafafa; --bg-2: #fafafa; --surface: rgba(0, 0, 0, .03); --surface-2: rgba(0, 0, 0, .055); --surface-solid: #fff; --border: rgba(0, 0, 0, .09); --border-strong: rgba(0, 0, 0, .18); --text: #111113; --text-2: #46464c; --muted: #77777d; --accent: #18181b; --accent-ink: #fafafa; --bg-image: none; --user-bubble: rgba(0, 0, 0, .05); --shadow: 0 16px 40px -22px rgba(0, 0, 0, .25); }
html[data-look="minimal"] body { background: var(--bg); }
html[data-look="minimal"] .orb-host canvas { filter: grayscale(.85) contrast(1.02); }
html[data-look="minimal"] .brand-mark { background: var(--text); box-shadow: none; }
html[data-look="minimal"] .sidebar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-look="minimal"] .topic, html[data-look="minimal"] .conv-item.active, html[data-look="minimal"] .d-card, html[data-look="minimal"] .stat { box-shadow: none; }
html[data-look="minimal"] .login-aurora, html[data-look="minimal"] .lv-aurora { display: none; }

html[data-look="executive"] {
  --bg: #0b1120; --bg-2: #0a0f1c; --surface: rgba(148, 176, 220, .05); --surface-2: rgba(148, 176, 220, .09); --surface-solid: #111a2d;
  --border: rgba(148, 176, 220, .12); --border-strong: rgba(148, 176, 220, .22); --text: #e8edf6; --text-2: #aeb9cf; --muted: #7f8ca6;
  --accent: #8db0e0; --accent-ink: #08101f; --teal: #6fa8c9; --violet: #8a95d6;
  --bg-image: radial-gradient(900px 520px at 50% -14%, rgba(110, 150, 220, .12), transparent 62%), linear-gradient(180deg, var(--bg), var(--bg-2));
  --user-bubble: linear-gradient(135deg, rgba(141, 176, 224, .17), rgba(141, 176, 224, .07));
}
@media (prefers-color-scheme: light) {
  html[data-look="executive"]:not([data-theme="dark"]) { --bg: #f2f5f9; --bg-2: #e8edf4; --surface: rgba(16, 36, 70, .04); --surface-2: rgba(16, 36, 70, .07); --surface-solid: #fff; --border: rgba(16, 36, 70, .11); --border-strong: rgba(16, 36, 70, .2); --text: #0f1b30; --text-2: #3b4a66; --muted: #6a778f; --accent: #1f4f8b; --accent-ink: #fff; --teal: #1d6f8a; --violet: #4a56b0; --bg-image: radial-gradient(1000px 560px at 60% -12%, rgba(31, 79, 139, .1), transparent 62%), linear-gradient(180deg, var(--bg), var(--bg-2)); --user-bubble: linear-gradient(135deg, rgba(31, 79, 139, .13), rgba(31, 79, 139, .05)); }
}
html[data-look="executive"][data-theme="light"] { --bg: #f2f5f9; --bg-2: #e8edf4; --surface: rgba(16, 36, 70, .04); --surface-2: rgba(16, 36, 70, .07); --surface-solid: #fff; --border: rgba(16, 36, 70, .11); --border-strong: rgba(16, 36, 70, .2); --text: #0f1b30; --text-2: #3b4a66; --muted: #6a778f; --accent: #1f4f8b; --accent-ink: #fff; --teal: #1d6f8a; --violet: #4a56b0; --bg-image: radial-gradient(1000px 560px at 60% -12%, rgba(31, 79, 139, .1), transparent 62%), linear-gradient(180deg, var(--bg), var(--bg-2)); --user-bubble: linear-gradient(135deg, rgba(31, 79, 139, .13), rgba(31, 79, 139, .05)); }
html[data-look="executive"] .orb-host canvas { filter: hue-rotate(-8deg) saturate(.9); }

.looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.looks button { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 10px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; transition: border-color .2s, background .2s, transform .18s var(--ease); }
.looks button:active { transform: scale(.97); }
.looks button b { font-size: 13.5px; font-weight: 600; } .looks button span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.looks button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sw { width: 100%; height: 34px; border-radius: 9px; margin-bottom: 6px; border: 1px solid var(--border); }
.sw-original { background: radial-gradient(60px 30px at 30% 0, rgba(205, 178, 122, .5), transparent), linear-gradient(135deg, #1b1e26, #0e1014); }
.sw-minimal { background: linear-gradient(90deg, #111 50%, #f4f4f4 50%); }
.sw-executive { background: radial-gradient(60px 30px at 70% 0, rgba(110, 150, 220, .55), transparent), linear-gradient(135deg, #13203a, #0b1120); }
@media (max-width: 420px) { .looks { grid-template-columns: 1fr; } .looks button { grid-template-columns: 56px 1fr; column-gap: 12px; align-items: center; } .sw { grid-row: span 2; margin: 0; height: 40px; } }

/* ---- the orb is draggable ---- */
.orb-host { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
.orb-host.is-held { cursor: grabbing; }

/* ---- stop / restart speech ---- */
.speak-ctl { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; animation: rise .35s var(--ease) both; }
.speak-ctl[hidden] { display: none; }
.speak-ctl button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface-solid) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--text); font: 500 13px var(--font); cursor: pointer; transition: transform .18s var(--ease), background .2s, border-color .2s; touch-action: manipulation; }
.speak-ctl button:hover { border-color: var(--accent); }
.speak-ctl button:active { transform: scale(.94); }
.speak-ctl .icon { width: 15px; height: 15px; }
.speak-ctl[data-mode="done"] #spk-stop { display: none; }
.stage.empty .speak-ctl { bottom: 38px; }
.status-line.show ~ .speak-ctl { bottom: 40px; }

/* ---- composer: text, then mic, then send ---- */
.composer .mic { order: 2; } .composer textarea { order: 1; } .composer .send { order: 3; }
.composer .mic { margin-left: 2px; }

/* ---- sidebar "+" is centred in both states ---- */
#new-session { display: flex; align-items: center; justify-content: center; }
#new-session .icon { margin: 0; }
@media (min-width: 861px) { :is(.shell.nav-collapsed, html[data-nav="collapsed"] .shell) #new-session .nav-text { margin-left: 0; } }

/* ---- long sections scroll inside themselves ---- */
.acc[open] .acc-body { max-height: min(58vh, 520px); max-height: min(58dvh, 520px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; touch-action: pan-y; }
.drawer .body { touch-action: pan-y; }

/* ---- safety banner ---- */
.escalation { display: flex; gap: 10px; align-items: flex-start; }
.escalation .icon { flex: none; margin-top: 3px; width: 16px; height: 16px; }

/* ---- support page ---- */
.support { gap: 26px; }
.emergency { padding: 16px 18px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.emergency b { display: block; margin-bottom: 4px; } .emergency p { margin: 0; color: var(--text-2); }
.sup-h { margin: 0 0 12px; font: 500 20px var(--display); }
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sup-card { display: grid; gap: 4px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: transform .25s var(--ease), border-color .2s; }
a.sup-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.sup-card span { font-size: 13.5px; color: var(--text-2); } .sup-card em { font-style: normal; font-size: 13px; color: var(--accent); overflow-wrap: anywhere; }
.faq { display: grid; gap: 10px; }

/* ---- admin: flags and tabs ---- */
.tn { display: inline-block; min-width: 18px; height: 18px; margin-left: 8px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 11px/18px var(--font); text-align: center; }
.flag-list { display: grid; gap: 12px; }
.flag { display: grid; gap: 10px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); border-left: 4px solid var(--border-strong); }
.flag.high { border-left-color: var(--danger); } .flag.medium { border-left-color: #e0a23b; } .flag.resolved { opacity: .6; }
.flag-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.flag-sum { margin: 0; } .flag blockquote { margin: 0; padding: 8px 12px; border-left: 2px solid var(--border-strong); color: var(--text-2); font-size: 13.5px; overflow-wrap: anywhere; }
.pill.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.pill.warn { color: #e0a23b; border-color: color-mix(in srgb, #e0a23b 45%, transparent); background: color-mix(in srgb, #e0a23b 10%, transparent); }

/* =====================================================================
   v6: login layout (symmetry), skeleton loaders, stop popup
   ===================================================================== */
@media (min-width: 861px) {
  .login { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .login-visual { padding: 40px 64px 52px; }
  .login-visual .orb-host { inset: 64px 0 270px 0; }                       /* the orb is centred in the space between the brand and the words */
  .lv-top { font-size: 20px; }
  .lv-copy { max-width: 560px; display: grid; gap: 22px; }
  .lv-copy h2 { margin: 0; font-size: clamp(34px, 3.3vw, 50px); }
  .lv-quote { margin: 0; padding-top: 20px; border-top: 1px solid var(--border-strong); max-width: 420px; display: grid; gap: 6px; }
  .lv-quote blockquote { margin: 0; font: italic 400 19px/1.45 var(--display); color: var(--text); }
  .lv-quote figcaption { font-size: 13px; color: var(--muted); }
  .lv-quote figcaption i { font-style: italic; }
  .lv-sub { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .01em; }
  .login-panel { padding: 40px 64px; }
  .login-card { width: 100%; max-width: 440px; margin: 0 auto; }
}
@media (max-width: 860px) { .lv-quote, .lv-sub { display: none; } }

/* ---- skeletons ---- */
.sk { display: block; border-radius: 8px; height: 14px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 220% 100%; animation: shimmer 1.5s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sk.round { width: 100%; height: 100%; border-radius: 50%; min-width: 24px; min-height: 24px; }
.sk-rows { display: grid; gap: 10px; padding: 6px 4px; } .sk-rows .sk { height: 34px; border-radius: 10px; } .sk-rows .sk.short { width: 70%; }
.sk-title { width: min(320px, 70%); height: 38px; margin: 0 auto; border-radius: 10px; }
.topics .sk-card, .sup-grid .sk-card { height: 92px; border-radius: 14px; }
.sup-grid .sk-card { height: 84px; }
.sk-thread { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; padding-top: 10px; }
.sk-thread .sk { height: 16px; } .sk-thread .sk.user { height: 44px; border-radius: 18px 18px 4px 18px; justify-self: end; }
.w40 { width: 40%; } .w45 { width: 45%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; }
.sk-card-row { align-items: center; } .sk-card-row .sk.round { width: 24px; height: 24px; flex: none; } .sk-card-row .d-main { gap: 10px; }
.avatar .sk.round { min-width: 0; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* ---- stop popup ---- */
.modal .card.compact { width: min(440px, 100%); padding: 24px; }
.stop-quote { margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; max-height: 28vh; overflow-y: auto; }

/* speech controls sit beside the orb, clear of the status line and captions */
.speak-ctl { left: auto; right: 22px; bottom: auto; top: 50%; transform: translateY(-50%); flex-direction: column; align-items: stretch; }
.stage.empty .speak-ctl, .status-line.show ~ .speak-ctl { bottom: auto; }
@media (max-width: 860px) { .speak-ctl { right: 10px; } .speak-ctl button { height: 32px; padding: 0 12px 0 9px; } }
@media (min-width: 861px) {
  .lv-copy { margin: 0 auto; text-align: center; justify-items: center; }
  .lv-quote { justify-items: center; }
}

/* =====================================================================
   v7: a logo gradient that is tuned for every theme and style; compact theme cards
   ===================================================================== */
:root { --logo: conic-gradient(from 200deg, #6fb8ad, #9a9fd6, #cdb27a, #6fb8ad); --logo-glow: rgba(154, 159, 214, .42); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --logo: conic-gradient(from 200deg, #2f9a8c, #6d62d0, #c19a45, #2f9a8c); --logo-glow: rgba(109, 98, 208, .3); } }
:root[data-theme="light"] { --logo: conic-gradient(from 200deg, #2f9a8c, #6d62d0, #c19a45, #2f9a8c); --logo-glow: rgba(109, 98, 208, .3); }

html[data-look="minimal"] { --logo: conic-gradient(from 200deg, #f4f4f5, #8e8e95, #d9d9dc, #f4f4f5); --logo-glow: rgba(255, 255, 255, .16); }
@media (prefers-color-scheme: light) { html[data-look="minimal"]:not([data-theme="dark"]) { --logo: conic-gradient(from 200deg, #1b1b1e, #74747b, #323236, #1b1b1e); --logo-glow: rgba(0, 0, 0, .14); } }
html[data-look="minimal"][data-theme="light"] { --logo: conic-gradient(from 200deg, #1b1b1e, #74747b, #323236, #1b1b1e); --logo-glow: rgba(0, 0, 0, .14); }

html[data-look="executive"] { --logo: conic-gradient(from 200deg, #a9c6ee, #5f86c6, #8db0e0, #a9c6ee); --logo-glow: rgba(110, 150, 220, .45); }
@media (prefers-color-scheme: light) { html[data-look="executive"]:not([data-theme="dark"]) { --logo: conic-gradient(from 200deg, #3b6fb0, #1f4f8b, #5b8fcf, #3b6fb0); --logo-glow: rgba(31, 79, 139, .32); } }
html[data-look="executive"][data-theme="light"] { --logo: conic-gradient(from 200deg, #3b6fb0, #1f4f8b, #5b8fcf, #3b6fb0); --logo-glow: rgba(31, 79, 139, .32); }

.brand-mark, html[data-look="minimal"] .brand-mark { background: var(--logo); box-shadow: 0 0 22px var(--logo-glow), inset 0 0 0 1px rgba(255, 255, 255, .12); }
.msg .who .dot { background: var(--logo); }

/* theme cards: small, one row of icon + label, the same in every mode */
.welcome { gap: 14px; }
.topics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 900px; margin: 2px auto 0; }
.topic { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; gap: 10px; min-height: 48px; padding: 7px 12px; border-radius: 12px; }
.topic .ic { width: 28px; height: 28px; border-radius: 8px; flex: none; }
.topic .ic .icon { width: 15px; height: 15px; }
.topic b { font-size: 13px; line-height: 1.25; font-weight: 500; }
@media (max-width: 1000px) { .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; } }
.topics .sk-card { height: 48px; border-radius: 12px; }

/* =====================================================================
   v8: phones: a locked page (no endless scroll) and a calmer home screen
   ===================================================================== */
@media (max-width: 860px) {
  html:has(.shell), body:has(.shell) { overflow: hidden; overscroll-behavior: none; height: 100%; }
  .shell { position: fixed; inset: 0; height: auto; width: 100%; }
  .transcript { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .drawer .body, .sidebar { overscroll-behavior: contain; }

  /* home: orb, then a single quiet hint, then the greeting with room around it, then the themes */
  .stage.empty .orb-wrap { height: 30vh; height: 30dvh; min-height: 190px; max-height: 280px; }
  .orb-wrap .orb-host { inset: 0 0 34px 0; }
  .orb-hint { bottom: 4px; max-width: 92%; white-space: nowrap; padding: 4px 12px; font-size: 12px; background: none; border-color: transparent; color: var(--muted); }
  .welcome { gap: 20px; padding: 6px 18px 28px; }
  .welcome h1 { font-size: 26px; line-height: 1.2; }
  .topics { gap: 10px; margin-top: 4px; }
  .topic { min-height: 54px; padding: 8px 12px; gap: 10px; }
  .topic b { font-size: 13px; line-height: 1.25; }
}

/* ---- environment ribbon (dev / staging only) ---- */
.env-ribbon { position: fixed; z-index: 90; right: 12px; bottom: 10px; padding: 3px 10px; border-radius: 999px; font: 700 10.5px/1.6 var(--font); letter-spacing: .14em; color: #1a1408; background: #e0a23b; box-shadow: 0 2px 10px rgba(0,0,0,.25); pointer-events: none; opacity: .92; }

/* ---- my team ---- */
.team-list { display: grid; gap: 8px; }
.team-item { display: flex; align-items: flex-start; gap: 8px; padding: 10px 6px 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.ti-main { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13.5px; }
.ti-main b { font-weight: 600; } .ti-role { color: var(--text-2); font-size: 12.5px; } .ti-traits { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ti-actions { display: flex; flex: none; }
.team-form { display: grid; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); }
.trait-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.trait-chips .ob-chip { padding: 5px 11px; font-size: 12.5px; }

/* =====================================================================
   v9: a closed settings pane is really gone (hidden, inert, and nothing to scroll sideways to)
   ===================================================================== */
.drawer { visibility: hidden; transition: transform .4s var(--ease), visibility 0s linear .4s; }
.drawer.show { visibility: visible; transition: transform .4s var(--ease), visibility 0s; }
html:has(.shell), body:has(.shell) { overflow-x: clip; max-width: 100%; }
.sidebar:not(.show) { /* the phone menu behaves the same way */ }
@media (max-width: 860px) { .sidebar { visibility: hidden; transition: transform .45s cubic-bezier(.22, 1, .36, 1), box-shadow .3s, visibility 0s linear .45s; } .sidebar.show { visibility: visible; transition: transform .45s cubic-bezier(.22, 1, .36, 1), box-shadow .3s, visibility 0s; } }

/* =====================================================================
   v10: loading skeletons everywhere, and a calm failure state
   ===================================================================== */
.sk-lines { display: grid; gap: 12px; } .sk-lines .sk { height: 14px; }
.sk-stack { display: grid; gap: 10px; margin-top: 14px; }
tr.sk-tr td { padding: 14px 12px; border-bottom: 1px solid var(--border); } tr.sk-tr .sk { height: 14px; }
.load-fail { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 14px; }
#reference-body .sk-lines { max-width: 820px; }
.flag-list .sk, #kb-status .sk { width: 100%; }
#team-list .sk, #memory .sk { width: 100%; }
@keyframes skfade { from { opacity: 0; } to { opacity: 1; } }
.sk { animation: shimmer 1.5s ease-in-out infinite, skfade .3s ease both; }

/* =====================================================================
   v11: tidy composer footer, legal pages, privacy controls
   ===================================================================== */
.hint { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 0; margin-top: 10px; padding: 0 12px; font-size: 11.5px; line-height: 1.6; color: var(--muted); text-wrap: balance; }
.hint > * + *::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 11px; border-radius: 50%; background: currentColor; opacity: .45; vertical-align: middle; }
.hint .h-priv { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.hint .h-priv .icon { width: 12px; height: 12px; }
.hint .h-links { display: inline-flex; align-items: center; }
.hint .h-links > a + a::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 9px; border-radius: 50%; background: currentColor; opacity: .45; vertical-align: middle; }
.hint a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.hint a:hover { color: var(--text); border-bottom-color: var(--border-strong); text-decoration: none; }
@media (max-width: 860px) { .hint .h-mid { display: none; } .hint { font-size: 11px; margin-top: 6px; } }

.lc-legal { margin: -6px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.lc-legal a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

.legal { max-width: 760px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.legal-tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.legal-tabs a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.legal-tabs a.on { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.draft-note { padding: 12px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, #e0a23b 50%, transparent); background: color-mix(in srgb, #e0a23b 10%, transparent); font-size: 13.5px; color: var(--text-2); }
.legal-body { display: grid; gap: 4px; }
.legal-body .lead { margin: 0 0 8px; font-size: 17px; line-height: 1.6; color: var(--text); }
.legal-body section { padding: 22px 0 6px; border-top: 1px solid var(--border); }
.legal-body h2 { margin: 0 0 8px; font: 500 21px/1.3 var(--display); }
.legal-body p { margin: 0 0 10px; color: var(--text-2); line-height: 1.7; }
.legal-body ul { margin: 0 0 10px; padding-left: 20px; color: var(--text-2); line-height: 1.7; display: grid; gap: 6px; }

/* settings: every section keeps its full height and the pane scrolls (grid rows were being squashed to fit) */
.drawer .body { grid-auto-rows: max-content; }
