@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
/* The optional light palette uses the same scene and typography. */
:root {
  color-scheme: dark;
  --bg: #090c18;
  --paper: #141a2b;
  --text: #eff1fc;
  --muted: #a0a9c2;
  --accent: #c5ccff;
  --accent-hover: #dce1ff;
  --accent-ink: #17203e;
  --line: #2c344c;
  --soft: #202941;
  --warm: #deb393;
  --danger: #e7a8a4;
  --notice: #2d2834;
  --end: #342832;
  --end-hover: #43323d;
  --end-text: #efbdba;
  --support: #302935;
  --sheet-shadow: #00000055;
  --scene-color: #7671b3;
  --word-start: #d7cefa;
  --word-end: #8ca9e1;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
  font-synthesis: none;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f7;
  --paper: #f8f9fc;
  --text: #232b43;
  --muted: #5d6680;
  --accent: #515e96;
  --accent-hover: #424e87;
  --accent-ink: #ffffff;
  --line: #d0d5e5;
  --soft: #dfe5f3;
  --warm: #936644;
  --danger: #9b4b3d;
  --notice: #eee2e5;
  --end: #eadde4;
  --end-hover: #e1cfd9;
  --end-text: #804b5c;
  --support: #ede3e8;
  --sheet-shadow: #27345422;
  --scene-color: #8484b9;
  --word-start: #655189;
  --word-end: #436899;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; scrollbar-gutter: stable both-edges; }
body { margin: 0; isolation: isolate; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-underline-offset: 4px; }
button, a, select, summary, input { outline-offset: 5px; }
:focus-visible { outline: 2px solid var(--accent); }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
button { border: 0; }
.universe { position: fixed; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.atmosphere { position: absolute; width: min(1200px, 140vw); height: 100%; left: 50%; top: 5%; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 54%, #4e448d20, transparent 51%), radial-gradient(ellipse at 28% 62%, #25538210, transparent 45%); }
.universe::after { content: ""; position: absolute; inset: 0; opacity: .028; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); }
.stars { position: absolute; inset: 0; }
.star { position: absolute; width: var(--size); height: var(--size); left: var(--x); top: var(--y); border-radius: 50%; background: #b8c8f2; opacity: var(--alpha); animation: starlight var(--duration) ease-in-out var(--delay) infinite alternate; }
.star:nth-child(7n) { box-shadow: 0 0 5px #bfc9ff44; }
.horizon { position: absolute; width: max(1500px, 155vw); height: 70vh; left: 50%; top: 78%; transform: translateX(-50%) rotate(-11deg); border-radius: 50%; border-top: 1px solid #8587c510; box-shadow: 0 -24px 60px -32px #9a8fd91a; }
:root[data-theme="light"] .star { background: #5c6390; opacity: .18; }
.in-session .star { animation-play-state: paused; }
@keyframes starlight { from { opacity: var(--alpha); } to { opacity: calc(var(--alpha) * .3); } }
@keyframes title-arrive { from { opacity: 0; transform: translateY(18px); filter: blur(7px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes word-leave { to { opacity: 0; transform: translateY(-12px); filter: blur(5px); } }
.app { position: relative; z-index: 1; max-width: 1600px; min-height: 100svh; margin: auto; padding: max(24px, env(safe-area-inset-top)) 48px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.top { display: flex; align-items: center; min-height: 52px; padding-bottom: 8px; gap: 24px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.brand span { display: block; font: italic 400 37px/1 Georgia, "Times New Roman", serif; letter-spacing: -2.2px; padding: 0 7px 5px 0; }
.tagline { color: var(--muted); font-size: 11px; padding-top: 2px; letter-spacing: .2px; }
.preferences-trigger { margin-left: auto; }
.text-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; background: transparent; padding: 10px 4px; min-height: 44px; font-size: 13px; color: var(--muted); text-decoration: none; transition: color 160ms, background 160ms; border-radius: 4px; }
.text-btn:hover:not(:disabled) { color: var(--text); }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 10px; background: transparent; border-radius: 8px; }
.icon-btn:hover { background: var(--soft); }
.main { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 0 24px; outline: none; }
.stage { width: 100%; max-width: 800px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.intro { animation: arrive 900ms var(--ease) both; width: 100%; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: .3px; line-height: 1.5; }
h1 { font: 400 clamp(44px, 4.8vw, 68px)/1.14 var(--font); letter-spacing: -3.8px; margin: 12px 0 18px; text-wrap: balance; }
.headline-lead { display: block; animation: title-arrive 1100ms var(--ease) both; }
.word-window { display: grid; place-items: center; min-height: 1.18em; overflow: hidden; padding: 0 6px 6px; }
#headline-word { display: block; color: var(--accent); background: linear-gradient(110deg, var(--word-start), var(--word-end)); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: title-arrive 1200ms 120ms var(--ease) both; }
#headline-word.word-leaving { animation: word-leave 380ms ease-in both; }
#headline-word.word-entering { animation: title-arrive 1000ms var(--ease) both; }
h1.session-title { font-size: clamp(38px, 4.4vw, 56px); letter-spacing: -2.4px; }
.welcome-copy { color: var(--muted); font-size: 13px; line-height: 1.8; }
.orb-wrap { position: relative; width: 250px; height: 216px; margin: 0; flex: none; transition: width 600ms var(--ease), height 600ms var(--ease); animation: arrive 1400ms var(--ease) both; }

.orb { position: absolute; width: 100%; height: auto; aspect-ratio: 1; left: 0; top: 50%; transform: translateY(-50%); }
.ring { position: absolute; width: 76%; height: auto; aspect-ratio: 1; left: 12%; top: 50%; }
.ring { transform: translateY(-50%) rotate(-90deg); padding: 3px; opacity: .6; }
.ring circle { fill: none; stroke-width: .5; }
.ring-track { stroke: var(--line); opacity: 0; }
.ring-progress { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 351.86; stroke-dashoffset: 351.86; opacity: 0; transition: stroke-dashoffset 1s linear, opacity 500ms; }
.in-session .ring-track, .in-session .ring-progress { opacity: 1; }
.session-state { margin-top: 0; }
.status { color: var(--muted); font-size: 13px; min-height: 22px; }
.session-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.session-time:has(:not([hidden])) { margin-top: 6px; }
#phase:not([hidden])::before { content: "·"; margin: 0 9px; }
.controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 52px; padding: 13px 23px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 500; transition: background 180ms, transform 180ms var(--ease), box-shadow 180ms; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 6px 24px #91a1f51c; transform: translateY(-1px); }
#start { min-width: 200px; }
.btn-secondary { border-color: var(--line); background: transparent; }
.btn-secondary:hover { background: var(--soft); }
.btn-end { background: var(--end); color: var(--end-text); }
.btn-end:hover { background: var(--end-hover); }
.icon-mic-off { display: none; }
#mute[aria-pressed="true"] .icon-mic { display: none; }
#mute[aria-pressed="true"] .icon-mic-off { display: block; }
#mute[aria-pressed="true"] { background: var(--soft); }
.session-preferences { gap: 12px; font-size: 11px; margin-top: 3px; }
.change-label { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.transcript-toggle { margin-top: 6px; font-size: 12px; gap: 7px; }
.transcript-toggle svg { width: 16px; height: 16px; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: 10px; padding-top: 8px; }
.footer nav { display: flex; gap: 24px; }
.footer .text-btn { font-size: 10px; }
.conversation { width: min(100%, 680px); margin-top: 28px; border-top: 1px solid var(--line); padding-top: 19px; animation: arrive 350ms var(--ease); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2, h3 { font-size: 14px; font-weight: 500; }
.meta { color: var(--muted); font-size: 11px; }
.transcript { display: flex; flex-direction: column; gap: 20px; max-height: 360px; min-height: 100px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain; padding: 6px 12px 18px 0; text-align: left; }
.empty { color: var(--muted); font-size: 13px; padding: 20px 0; }
.bubble { max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; animation: arrive 260ms var(--ease); font-size: 15px; line-height: 1.8; }
.bubble.user { align-self: flex-end; background: var(--soft); padding: 13px 18px; border-radius: 10px 10px 2px 10px; }
.bubble.assistant { align-self: flex-start; padding: 0 8px 0 0; }
.bubble.assistant::before { content: attr(data-speaker); display: block; color: var(--accent); font-size: 9px; letter-spacing: 1.5px; margin-bottom: 5px; }
.bubble.live::after { content: ""; display: inline-block; width: 4px; height: 12px; margin-left: 4px; background: var(--accent); animation: blink 1s infinite; }
.bubble.error { color: var(--danger); font-size: 13px; }
.thinking { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); min-height: 26px; }
.thinking i { width: 4px; height: 4px; background: var(--accent); border-radius: 50%; animation: dots 1.5s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; }
.thinking i:nth-child(3) { animation-delay: .3s; }
.thinking span { margin-left: 6px; }
.transcript-foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding-top: 7px; }
.transcript-foot .text-btn { font-size: 11px; }
.latest { display: flex; margin: auto; }
.transcript-open .main { justify-content: flex-start; }
.transcript-open .orb-wrap { width: 188px; height: 150px; }
.transcript-open h1 { font-size: 40px; letter-spacing: -2px; }
.transcript-open .intro .welcome-copy { display: none; }
.transcript-open .transcript-toggle { margin-top: 8px; }
.notice { display: flex; align-items: center; text-align: left; width: min(100%, 480px); background: var(--notice); border-left: 2px solid #a98461; padding: 9px 8px 9px 16px; margin-top: 18px; gap: 10px; font-size: 13px; animation: arrive 250ms var(--ease); }
.notice p { flex: 1; }
.notice .text-btn { flex: none; }
.login-actions, .device-code { display: flex; align-items: center; gap: 20px; margin-top: 10px; flex-wrap: wrap; }
.device-code code { font-size: 23px; letter-spacing: 2px; }
.device-code { flex-direction: column; align-items: flex-start; gap: 14px; }
.device-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--muted); }
.device-steps li::marker { color: var(--text); font-weight: 600; }
.code-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.device-code code { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); user-select: all; }
.login-actions .btn { text-decoration: none; }
.crisis { display: flex; align-items: flex-start; gap: 8px; max-width: 760px; width: 100%; margin: 22px auto 0; background: var(--support); padding: 18px 20px; border-left: 2px solid #9a6c4a; font-size: 13px; }
.crisis strong { font-size: 15px; font-weight: 500; }
.crisis p { margin-top: 5px; }
.crisis-actions { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; }
.crisis-actions a { min-height: 44px; display: flex; align-items: center; }
/* Native dialogs give every sheet keyboard focus management and an inert background. */
dialog { width: min(520px, calc(100% - 40px)); max-height: min(90dvh, 860px); padding: 28px 30px; color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 90px var(--sheet-shadow); overscroll-behavior: contain; }
dialog[open] { animation: sheet-in 250ms var(--ease); }
dialog::backdrop { background: #10161188; backdrop-filter: blur(3px); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.dialog-head .eyebrow { font-size: 9px; margin: 4px 0 8px; }
.dialog-head h2 { font: 500 27px/1.2 var(--font); letter-spacing: -1px; }
.dialog-head .icon-btn { margin: -8px -10px 0 0; }
dialog > p { color: var(--muted); font-size: 14px; margin: 12px 0 20px; }
dialog > h3 { margin-top: 24px; }
.appearance { margin-bottom: 22px; }
.motion-setting { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.settings { display: flex; flex-direction: column; gap: 25px; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-size: 14px; margin-bottom: 10px; font-weight: 500; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.segmented button { border-right: 1px solid var(--line); background: transparent; min-height: 44px; font-size: 13px; }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.segmented button:focus-visible { outline-offset: -4px; outline-color: var(--text); }
.field-note { display: block; font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 8px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 14px; }
select { min-height: 44px; padding: 8px 12px; min-width: 140px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; text-transform: capitalize; font-size: 14px; }
.toggle { display: flex; align-items: flex-start; gap: 24px; cursor: pointer; }
.toggle strong { font-size: 14px; font-weight: 500; }
.toggle .field-note { margin-top: 4px; }
.toggle input { color-scheme: light; flex: none; appearance: none; margin: 2px 0 0; width: 40px; height: 24px; border-radius: 12px; background: #677088; transition: background 180ms; position: relative; cursor: pointer; }
.toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); transition: transform 180ms; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); }
.settings.locked { opacity: .6; }
#settings-locked { margin: -6px 0 18px; }
.memory, .account-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.memory .section-head { margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.memory summary { font-size: 13px; cursor: pointer; padding: 9px 0; }
.memory pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; font-family: inherit; font-size: 13px; line-height: 1.7; background: var(--bg); padding: 14px; border-radius: 6px; }
.danger-text { color: var(--danger); }
.account { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.account .text-btn { color: var(--accent); text-decoration: underline; }
.account-section .field-note { margin: 0; }
.dialog-done { width: 100%; margin-top: 24px; }
.saving { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.spinner { width: 13px; height: 13px; border: 1px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.support-links { margin: 20px 0; }
.support-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--line); font-size: 13px; text-decoration: none; }
.support-links a:hover { color: var(--accent); }
.support-links strong { font-weight: 500; white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 20px; background: var(--paper); padding: 8px 16px; z-index: 5; }
.skip-link:focus { top: 10px; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes dots { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@media (min-width: 1600px) {
  .orb-wrap { width: 285px; height: 245px; }
  .main { padding-top: 32px; padding-bottom: 36px; }
}
@media (max-width: 760px) {
  html { scrollbar-gutter: auto; }
  .app { padding: max(16px, env(safe-area-inset-top)) 24px max(12px, env(safe-area-inset-bottom)); }
  .top { gap: 16px; min-height: 48px; padding-bottom: 4px; }
  .tagline { display: none; }
  .brand span { font-size: 35px; }
  .main { padding: 24px 0 22px; }
  h1 { font-size: 48px; letter-spacing: -2.8px; }
  h1.session-title { font-size: 39px; }
  .orb-wrap { width: 250px; height: 215px; }
  .welcome-copy { font-size: 13px; }
  .footer { flex-direction: column; gap: 0; padding-top: 12px; text-align: center; }
  .footer nav { gap: 24px; }
  .transcript-open .orb-wrap { width: 166px; height: 130px; }
  .transcript-open h1 { font-size: 34px; margin: 12px 0 6px; }
  .transcript { max-height: 40svh; }
  .transcript-open .controls { margin-top: 14px; }
  .crisis { padding: 14px; }
  .horizon { opacity: .5; }
}
@media (max-width: 480px) {
  .app { padding-left: 20px; padding-right: 20px; }
  .preferences-trigger { font-size: 11px; gap: 7px; }
  .eyebrow { font-size: 10px; }
  h1 { font-size: 43px; letter-spacing: -2.6px; }
  dialog { width: 100%; max-width: 100%; max-height: calc(100dvh - max(20px, env(safe-area-inset-top))); margin: auto 0 0; border: 0; border-radius: 16px 16px 0 0; padding: 26px 24px max(24px, env(safe-area-inset-bottom)); }
  .dialog-head h2 { font-size: 26px; }
  .dialog-head .eyebrow { letter-spacing: 1.5px; }
  .bubble { max-width: 94%; font-size: 14px; }
  .notice { font-size: 12px; gap: 4px; }
  .notice .icon-btn { width: 36px; }
}
@media (max-height: 780px) {
  .main { padding-top: 12px; padding-bottom: 12px; }
  h1 { font-size: 52px; margin: 8px 0 12px; }
  .orb-wrap { width: 220px; height: 174px; }
  .controls { margin-top: 12px; }
  .transcript-toggle { margin-top: 0; }
  .session-preferences { margin-top: 0; }
}
@media (max-height: 750px) and (max-width: 760px) {
  h1 { font-size: 38px; }
  .orb-wrap { width: 208px; height: 162px; }
  .welcome-copy { font-size: 12px; }
}
@media (max-height: 620px) and (max-width: 760px) {
  .main { padding-top: 10px; }
  h1 { font-size: 34px; margin-bottom: 8px; }
  .orb-wrap { width: 176px; height: 126px; }
  .eyebrow { font-size: 9px; }
  .welcome-copy { line-height: 1.55; }
  .footer { padding-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root[data-motion="still"] *, :root[data-motion="still"] *::before, :root[data-motion="still"] *::after { animation: none !important; transition: none !important; }

/* Sign-in dialog */
.login-dialog #login-text { margin: 0 0 16px; color: var(--text); }
.login-dialog .login-actions { margin-top: 22px; }
@media (max-width: 640px) {
  .login-dialog .login-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .login-dialog .login-actions .btn { width: 100%; }
}
.login-checking { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; color: var(--text); font-size: 14px; }
