:root {
  --bg: #f3f4ef;
  --paper: #ffffff;
  --paper-soft: #f8f9f5;
  --ink: #171a16;
  --ink-mid: #41483f;
  --ink-soft: #71786e;
  --line: #dde1d9;
  --line-strong: #cbd1c6;
  --rail: #181b17;
  --rail-soft: #21261f;
  --rail-ink: #f3f5ed;
  --rail-muted: #aeb7a8;
  --echo: #4d7c5a;
  --echo-bright: #78a96b;
  --amber: #c9782a;
  --sky: #287e9e;
  --red: #bd433a;
  --yellow: #d6aa32;
  --tracer-sky: #0ea5e9;
  --tracer-orange: #f97316;
  --tracer-red: #dc2626;
  --code-bg: #101510;
  --code-ink: #dce8d7;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sidebar: 276px;
  --topbar: 66px;
  --composer-max: 860px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, textarea, input { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.sidebar {
  position: relative;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  padding: 18px 13px 15px;
  overflow: hidden;
  background: var(--rail);
  color: var(--rail-ink);
  border-right: 1px solid #30362d;
  z-index: 30;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 3px solid var(--echo);
  opacity: .75;
}
.brand-row {
  position: relative;
  z-index: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--rail-ink);
  text-decoration: none;
  font: 700 17px/1 var(--sans);
  letter-spacing: 0;
}
.tracer-echo-mark {
  --mark-h: 16px;
  --bar-w: 2px;
  --bar-gap: 1px;
  width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bar-gap);
  height: var(--mark-h);
  vertical-align: middle;
}
.tracer-echo-mark i {
  --bar: var(--tracer-sky);
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: var(--bar-w);
  border-radius: 0;
  background: var(--bar);
}
.tracer-echo-mark i:nth-child(1) { --bar: var(--tracer-sky); height: 35%; }
.tracer-echo-mark i:nth-child(2) { --bar: var(--tracer-orange); height: 80%; }
.tracer-echo-mark i:nth-child(3) { --bar: var(--tracer-red); height: 52%; }
.tracer-echo-mark i:nth-child(4) { --bar: var(--echo); height: 100%; }
.tracer-echo-mark i:nth-child(5) { --bar: var(--tracer-sky); height: 44%; }
.tracer-echo-mark-xs { --mark-h: 11px; --bar-w: 1px; --bar-gap: 1px; margin-right: 4px; }
.tracer-echo-mark-sm { --mark-h: 18px; --bar-w: 2px; --bar-gap: 1px; flex: 0 0 auto; padding: 3px; }
.tracer-echo-mark-lg { --mark-h: 44px; --bar-w: 4px; --bar-gap: 3px; padding: 5px; }

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { background: var(--paper-soft); border-color: var(--line); }
.sidebar .icon-button { color: var(--rail-muted); }
.sidebar .icon-button:hover { color: var(--rail-ink); background: var(--rail-soft); border-color: #394036; }
.icon-button[aria-pressed="true"] { color: var(--echo); background: #e8efe6; border-color: #b9cbb7; }
.icon-button.small { width: 32px; height: 32px; flex-basis: 32px; }
.icon-button svg { width: 19px; height: 19px; stroke-width: 1.8; }
.icon-button.small svg { width: 16px; height: 16px; }

.new-chat-button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 20px;
  padding: 10px 12px;
  border: 1px solid #aebba9;
  border-radius: 6px;
  background: #edf1e9;
  color: #171a16;
  font-weight: 750;
  cursor: pointer;
}
.new-chat-button:hover { background: #dfe8dc; border-color: var(--echo-bright); }
.new-chat-button svg { width: 18px; height: 18px; }

.history-heading {
  position: relative;
  z-index: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  color: var(--rail-muted);
  font: 700 10px/1 var(--sans);
  letter-spacing: 0;
  text-transform: uppercase;
}
.conversation-list {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 3px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: #515b4d transparent;
}
.conversation-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 4px;
  margin: 2px 0;
  padding: 4px 5px 4px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
}
.conversation-item:hover { background: var(--rail-soft); }
.conversation-item.active { background: #262c23; border-color: #394136; }
.conversation-title {
  width: 100%;
  overflow: hidden;
  color: var(--rail-muted);
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.conversation-item.active .conversation-title { color: var(--rail-ink); font-weight: 700; }
.conversation-delete { opacity: 0; }
.conversation-item:hover .conversation-delete, .conversation-item:focus-within .conversation-delete { opacity: 1; }

.sidebar-footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) 24px;
  gap: 10px;
  align-items: start;
  width: 100%;
  margin: 0;
  padding: 15px 7px 2px;
  border: 0;
  border-top: 1px solid #343a31;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.sidebar-footer:hover { background: var(--rail-soft); }
.identity-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--amber); }
.identity-dot.ready { background: var(--echo-bright); box-shadow: 0 0 0 3px rgba(120,169,107,.12); }
.identity-copy { min-width: 0; display: flex; flex-direction: column; }
.identity-copy strong { overflow: hidden; color: var(--rail-ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.identity-copy span { color: var(--rail-muted); font-size: 11px; }
.sidebar-settings-icon { width: 16px; height: 16px; margin-top: 2px; color: var(--rail-muted); stroke-width: 1.8; }

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--topbar) minmax(0, 1fr) auto;
  background: var(--bg);
}
.topbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 0 18px 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-leading { min-width: 0; display: flex; align-items: center; gap: 10px; }
.product-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.product-name strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 700 13px/1.2 var(--sans);
  letter-spacing: 0;
}
.product-name strong .brand-by { color: var(--ink-soft); font-size: 10px; font-weight: 560; }
.product-name span { overflow: hidden; color: var(--ink-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.product-name strong > span:nth-child(2) { color: var(--ink); font-size: inherit; font-weight: inherit; }
.cost-comparison {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--mono);
  white-space: nowrap;
}
.cost-comparison > svg { width: 16px; height: 16px; flex: 0 0 auto; }
.cost-values { display: grid; gap: 2px; }
.cost-values > span { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.cost-values span span { color: var(--ink-soft); font-size: 9px; }
.cost-values strong { color: var(--ink-mid); font-size: 10px; font-variant-numeric: tabular-nums; }
.cost-ratio {
  min-width: 43px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
  color: var(--echo);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

.thread {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.message-list { width: min(860px, 100%); margin: 0 auto; padding: 34px 28px 24px; }
.empty-state {
  width: 100%;
  min-height: 100%;
  display: block;
  margin: 0;
  padding: 0;
}
.home-intro {
  width: min(var(--composer-max), 100%);
  min-height: calc(100dvh - var(--topbar) - 198px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 42px 28px 36px;
}
.mode-resolver {
  position: relative;
  width: min(600px, 100%);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto 23px;
}
.mode-resolver-line {
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, transparent, var(--line-strong));
}
.mode-resolver-line:last-child { transform: scaleX(-1); }
.tracer-echo-mark-resolver {
  --mark-h: 34px;
  --bar-w: 3px;
  --bar-gap: 3px;
  width: 0;
  flex: 0 0 auto;
  overflow: hidden;
  opacity: 0;
  transform: scale(.75);
  transition: width .24s ease, margin .24s ease, opacity .24s ease, transform .24s ease;
}
.mode-resolver.is-echo .tracer-echo-mark-resolver { width: 25px; margin-left: 18px; margin-right: 11px; opacity: 1; transform: scale(1); }
.mode-resolver-label {
  width: 190px;
  flex: 0 0 190px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 50px;
  font-weight: 620;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  filter: blur(0);
  opacity: .58;
  transform: scale(1);
  transition: color .18s ease, filter .15s ease, opacity .15s ease, transform .15s ease;
}
.mode-resolver.is-defocusing .mode-resolver-label { filter: blur(10px); opacity: 0; transform: scale(.96); }
.mode-resolver.is-echo .mode-resolver-label { color: var(--ink); font-weight: 720; opacity: 1; }
.home-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: 38px;
  font-weight: 520;
  line-height: 1.13;
  text-align: center;
  letter-spacing: 0;
}
.home-intro h1 span, .home-intro h1 strong { display: block; }
.home-intro h1 strong { color: var(--echo); font-weight: 720; }
.empty-subtitle { margin: 13px 0 25px; color: var(--ink-soft); font-size: 14px; text-align: center; }
.prompt-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-strong); }
.prompt-grid button {
  min-height: 74px;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink-mid);
  text-align: left;
  cursor: pointer;
}
.prompt-grid button:nth-child(even) { border-right: 0; }
.prompt-grid button:hover { background: var(--paper); color: var(--ink); }
.prompt-grid button:hover svg { color: var(--echo); }
.prompt-grid svg { width: 19px; height: 19px; margin-top: 1px; color: var(--ink-soft); stroke-width: 1.7; }

.emergence-section {
  --symphony-progress: 0;
  --symphony-shift: 0px;
  --symphony-gather-one: 0px;
  --symphony-gather-two: 0px;
  --symphony-gather-four: 0px;
  --symphony-gather-five: 0px;
  --emergent-offset: 24px;
  --emergent-blur: 9px;
  position: relative;
  min-height: 720px;
  padding: 38px max(28px, calc((100% - 1080px) / 2)) 74px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.emergence-copy {
  width: min(780px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .82fr);
  gap: 30px 72px;
  align-items: end;
}
.emergence-kicker {
  grid-column: 1 / -1;
  margin: 0 0 -15px;
  color: var(--echo);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}
.emergence-copy h2 { margin: 0; font-size: 36px; font-weight: 620; line-height: 1.12; letter-spacing: 0; }
.emergence-copy > p:last-child { margin: 0 0 2px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.symphony-score {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(310px, 1.2fr) 116px minmax(250px, .75fr);
  gap: 28px;
  align-items: center;
  margin: 70px auto 60px;
}
.voice-staves { min-width: 0; display: grid; gap: 7px; padding: 0 0 0 2px; }
.score-voice {
  --voice-color: var(--tracer-sky);
  --voice-gather: 0px;
  min-width: 0;
  height: 38px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--voice-color);
  opacity: .88;
  transform: translate(var(--symphony-shift), var(--voice-gather));
  transition: opacity .18s linear;
}
.score-voice > span { color: var(--ink-soft); font: 9px/1 var(--mono); font-variant-numeric: tabular-nums; opacity: var(--voice-label-opacity, 1); }
.score-voice > div {
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.4vw, 14px);
  border-bottom: 1px solid var(--line);
}
.score-voice i {
  position: relative;
  bottom: -1px;
  width: 4px;
  height: 36%;
  flex: 0 0 4px;
  transform-origin: center bottom;
  border-radius: 1px 1px 0 0;
  background: currentColor;
}
.score-voice i:nth-child(2), .score-voice i:nth-child(8) { height: 68%; }
.score-voice i:nth-child(3), .score-voice i:nth-child(7) { height: 42%; }
.score-voice i:nth-child(4), .score-voice i:nth-child(10) { height: 88%; }
.score-voice i:nth-child(5) { height: 54%; }
.score-voice i:nth-child(6) { height: 100%; }
.score-voice i:nth-child(9) { height: 76%; }
.score-voice i:nth-child(11) { height: 48%; }
.score-voice-one { --voice-color: var(--tracer-sky); --voice-gather: var(--symphony-gather-one); }
.score-voice-two { --voice-color: var(--echo); --voice-gather: var(--symphony-gather-two); }
.score-voice-three { --voice-color: var(--tracer-orange); }
.score-voice-four { --voice-color: var(--tracer-red); --voice-gather: var(--symphony-gather-four); }
.score-voice-five { --voice-color: var(--yellow); --voice-gather: var(--symphony-gather-five); }
.score-voice-two i:nth-child(3n), .score-voice-four i:nth-child(2n) { height: 94%; }
.score-voice-three i:nth-child(3n + 1), .score-voice-five i:nth-child(4n + 1) { height: 72%; }
.symphony-convergence {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.symphony-convergence span { height: 1px; background: var(--line-strong); transform: scaleX(var(--symphony-progress)); }
.symphony-convergence span:first-child { transform-origin: right center; }
.symphony-convergence span:last-child { transform-origin: left center; }
.symphony-convergence strong { color: var(--ink-soft); font-size: 9px; font-weight: 700; white-space: nowrap; }
.emergent-phrase {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateX(var(--emergent-offset));
  filter: blur(var(--emergent-blur));
  opacity: var(--symphony-progress);
}
.emergent-phrase p { margin: 0 0 16px; color: var(--ink); font-size: 13px; font-weight: 760; }
.emergent-phrase > span { margin-top: 15px; color: var(--ink-soft); font-size: 9px; }
.emergent-bars { height: 106px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.emergent-bars i {
  width: 5px;
  height: 44%;
  flex: 0 0 5px;
  border-radius: 1px;
  background: var(--tracer-sky);
  transform: scaleY(var(--symphony-progress));
  transform-origin: center;
}
.emergent-bars i:nth-child(5n + 1) { height: 34%; background: var(--tracer-sky); }
.emergent-bars i:nth-child(5n + 2) { height: 68%; background: var(--echo); }
.emergent-bars i:nth-child(5n + 3) { height: 92%; background: var(--tracer-orange); }
.emergent-bars i:nth-child(5n + 4) { height: 54%; background: var(--tracer-red); }
.emergent-bars i:nth-child(5n) { height: 78%; background: var(--yellow); }
.emergent-bars i:nth-child(3), .emergent-bars i:nth-child(8), .emergent-bars i:nth-child(13) { height: 100%; }
.emergence-equation {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin: 0 auto;
  padding-top: 25px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}
.emergence-equation strong { color: var(--echo); font: 720 24px/1 var(--sans); }
.emergence-equation span:last-child { text-align: right; }

.message {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}
.message:last-child { border-bottom: 0; }
.message-avatar {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--paper);
  font: 800 9px/1 var(--mono);
}
.message.assistant .message-avatar { border-color: #30362d; background: var(--rail); color: var(--echo-bright); }
.message-avatar .tracer-echo-mark { --mark-h: 12px; --bar-w: 1px; --bar-gap: 1px; }
.message-main { min-width: 0; }
.message-header { min-height: 24px; display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.message-header strong { font-size: 13px; }
.message-time { color: var(--ink-soft); font: 10px/1 var(--mono); }
.message-body { color: var(--ink); font-size: 15px; line-height: 1.68; overflow-wrap: anywhere; }
.message.user .message-body { white-space: pre-wrap; }
.message-body > :first-child { margin-top: 0; }
.message-body > :last-child { margin-bottom: 0; }
.message-body p, .message-body ul, .message-body ol, .message-body blockquote, .message-body pre, .message-body table { margin: 0 0 15px; }
.message-body h1, .message-body h2, .message-body h3 { margin: 23px 0 10px; line-height: 1.25; letter-spacing: 0; }
.message-body h1 { font-size: 22px; }
.message-body h2 { font-size: 19px; }
.message-body h3 { font-size: 16px; }
.message-body ul, .message-body ol { padding-left: 23px; }
.message-body li { margin: 4px 0; }
.message-body a { color: var(--sky); text-decoration: underline; text-underline-offset: 2px; }
.message-body blockquote { padding-left: 15px; border-left: 3px solid var(--amber); color: var(--ink-mid); }
.message-body code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper-soft); font: 13px/1.5 var(--mono); }
.message-body pre { position: relative; max-width: 100%; overflow: auto; padding: 42px 16px 16px; border-radius: 6px; background: var(--code-bg); color: var(--code-ink); }
.message-body pre code { padding: 0; border: 0; background: transparent; color: inherit; font-size: 12.5px; white-space: pre; }
.message-body .echo-math { color: inherit; overflow-wrap: normal; }
.message-body .echo-math-inline {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: -0.18em;
  -webkit-overflow-scrolling: touch;
}
.message-body .echo-math-display {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 15px 0;
  padding: 3px 0 5px;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
.message-body .echo-math-display .katex-display {
  width: max-content;
  min-width: 100%;
  margin: 0;
}
.message-body .katex { font-size: 1.04em; line-height: 1.25; }
.message-body .echo-math-error { color: var(--red); font-family: var(--mono); }
.message-body.streaming::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 15px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--echo);
  animation: cursor-blink .75s steps(1, end) infinite;
}
.code-copy { position: absolute; top: 7px; right: 7px; min-height: 28px; padding: 4px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 4px; background: rgba(16,21,16,.86); color: #cad7c6; font: 11px/1 var(--mono); cursor: pointer; }
.code-copy:hover { color: white; border-color: rgba(255,255,255,.5); }
.message-body table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.message-body th, .message-body td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.message-body th { background: var(--paper-soft); }
.message-actions { min-height: 30px; display: flex; align-items: center; gap: 2px; margin-top: 9px; }
.message-actions .icon-button { width: 30px; height: 30px; flex-basis: 30px; color: var(--ink-soft); }
.message-actions svg { width: 15px; height: 15px; }
.message.error .message-body { color: var(--red); }

.thinking-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
}
.thinking-glyph {
  --mark-h: 18px;
  --bar-w: 2px;
  --bar-gap: 1px;
  width: 24px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.thinking-glyph i {
  animation: echo-thinking-dot 1.35s ease-in-out infinite;
}
.thinking-glyph i:nth-child(1) { animation-delay: 0s; }
.thinking-glyph i:nth-child(2) { animation-delay: .06s; }
.thinking-glyph i:nth-child(3) { animation-delay: .12s; }
.thinking-glyph i:nth-child(4) { animation-delay: .18s; }
.thinking-glyph i:nth-child(5) { animation-delay: .24s; }
.thinking-label { color: var(--ink-mid); font-weight: 650; }
.thinking-elapsed { color: var(--ink-soft); font: 10px/1 var(--mono); }
@keyframes echo-thinking-dot { 0%, 70%, 100% { transform: scaleY(.6); opacity: .48; } 28% { transform: scaleY(1); opacity: 1; } }
@keyframes cursor-blink { 0%, 48% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes symphony-arrive { from { transform: scaleY(.25); opacity: .25; } to { transform: scaleY(1); opacity: 1; } }

.composer-shell { padding: 12px 24px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer {
  width: min(var(--composer-max), 100%);
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 0 auto;
  padding: 9px 9px 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(23,26,22,.06);
}
.composer:focus-within { border-color: var(--echo); box-shadow: 0 8px 28px rgba(39,78,48,.1); }
.composer textarea {
  width: 100%;
  min-height: 36px;
  max-height: 190px;
  resize: none;
  overflow-y: auto;
  padding: 7px 0 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.45;
}
.composer textarea::placeholder { color: #969d93; }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.input-count { color: var(--ink-soft); font: 10px/1 var(--mono); }
.input-count.warn { color: var(--red); }
.send-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--rail);
  color: white;
  cursor: pointer;
}
.send-button:hover { background: var(--echo); }
.send-button:disabled { background: var(--line); color: var(--ink-soft); cursor: default; }
.send-button.stop { background: var(--red); }
.send-button svg { width: 18px; height: 18px; stroke-width: 2.1; }
.composer-note { width: min(var(--composer-max), 100%); margin: 7px auto 0; color: var(--ink-soft); font-size: 10.5px; text-align: center; }
.composer-note strong { color: var(--ink-mid); }
.api-cta { display: none; }
.chat-start {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px 130px;
  text-align: center;
}
.tracer-echo-mark-chat-start { --mark-h: 42px; --bar-w: 4px; --bar-gap: 4px; }
.chat-start h1 { margin: 4px 0 0; font-size: 38px; line-height: 1; }
.chat-start p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.settings-dialog {
  width: min(720px, calc(100% - 32px));
  height: min(720px, calc(100dvh - 32px));
  max-width: 720px;
  max-height: 720px;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(23,26,22,.24);
}
.settings-dialog::backdrop { background: rgba(15,18,14,.58); }
.invite-welcome-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: 560px;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(23,26,22,.26);
}
.invite-welcome-dialog::backdrop { background: rgba(15,18,14,.58); }
.invite-welcome-layout { display: grid; }
.invite-welcome-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 0 24px; }
.invite-welcome-body { padding: 22px 24px 24px; }
.invite-welcome-body h2 { max-width: 430px; margin: 4px 0 12px; font-size: 30px; line-height: 1.08; letter-spacing: 0; }
.invite-welcome-body > p:not(.settings-kicker) { max-width: 470px; margin: 0; color: var(--ink-mid); font-size: 13px; line-height: 1.65; }
.invite-welcome-count { display: flex; align-items: baseline; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.invite-welcome-count strong { font-size: 38px; font-weight: 690; line-height: 1; }
.invite-welcome-count span { color: var(--ink-mid); font-size: 12px; font-weight: 720; }
.invite-welcome-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 16px 24px; border-top: 1px solid var(--line); background: var(--paper-soft); }
.invite-welcome-actions > div { display: flex; align-items: center; gap: 8px; }
.invite-welcome-actions .quiet-action { padding-inline: 0; border-color: transparent; background: transparent; color: var(--ink-soft); }
.invite-welcome-actions .quiet-action:hover { color: var(--ink); }
.settings-layout { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.settings-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.settings-title-lockup { min-width: 0; display: flex; align-items: center; gap: 11px; }
.settings-title-lockup > div { min-width: 0; }
.settings-title-lockup p, .settings-title-lockup h2 { margin: 0; letter-spacing: 0; }
.settings-title-lockup p { color: var(--echo); font-size: 10px; font-weight: 750; }
.settings-title-lockup h2 { font-size: 18px; line-height: 1.25; }
.settings-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.account-summary {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}
.settings-kicker { margin: 0 0 4px; color: var(--ink-soft); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: 0; }
.account-summary strong { display: block; max-width: 460px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.session-status { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; color: var(--ink-mid); font-size: 11px; font-weight: 700; }
.session-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--echo-bright); box-shadow: 0 0 0 3px rgba(120,169,107,.13); }
.usage-section, .api-key-section { padding: 25px 24px 32px; border-bottom: 1px solid var(--line); }
.settings-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.settings-section-heading h3 { margin: 0; font-size: 19px; line-height: 1.25; letter-spacing: 0; }
.billing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}
.billing-badge.active { border-color: #a9c2a4; color: var(--echo); }
.account-loading { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); }
.account-loading span { display: block; height: 72px; background: var(--paper-soft); animation: key-loading-pulse 1.15s ease-in-out infinite alternate; }
.account-loading span:nth-child(2) { animation-delay: .12s; }
.account-loading span:nth-child(3) { animation-delay: .24s; }
.account-error-state { min-height: 128px; border: 1px solid var(--line); }
.billing-notice {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0 15px;
  border-bottom: 1px solid var(--line);
}
.billing-notice > svg { width: 19px; height: 19px; color: var(--echo); stroke-width: 1.7; }
.billing-notice > div { min-width: 0; display: flex; flex-direction: column; }
.billing-notice strong { font-size: 12px; }
.billing-notice span { color: var(--ink-soft); font-size: 10px; }
.usage-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.usage-metrics > div { min-width: 0; padding: 17px 14px 17px 0; }
.usage-metrics > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.usage-metrics span { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 10px; }
.usage-metrics strong { display: block; overflow: hidden; font-size: 17px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.usage-limit-list { display: grid; gap: 15px; padding: 17px 0 7px; }
.usage-limit-list > div > span { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 7px; color: var(--ink-soft); font-size: 10px; }
.usage-limit-list > div > span strong { color: var(--ink-mid); font-weight: 700; }
.usage-limit-list progress { width: 100%; height: 5px; display: block; overflow: hidden; border: 0; border-radius: 2px; background: var(--paper-soft); color: var(--echo); }
.usage-limit-list progress::-webkit-progress-bar { background: var(--paper-soft); }
.usage-limit-list progress::-webkit-progress-value { background: var(--echo); }
.usage-limit-list progress::-moz-progress-bar { background: var(--echo); }
.usage-footnote { margin: 7px 0 0; color: var(--ink-soft); font-size: 9.5px; line-height: 1.5; }
.legal-account-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px calc(24px + env(safe-area-inset-bottom));
}
.legal-account-section h3 { margin: 0 0 5px; font-size: 15px; letter-spacing: 0; }
.legal-account-section p:not(.settings-kicker) { margin: 0; color: var(--ink-soft); font-size: 10px; }
.legal-account-section nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px 14px; }
.legal-account-section a { color: var(--ink-mid); font-size: 10px; text-underline-offset: 2px; }
.legal-account-section a:hover { color: var(--echo); }
.key-create-form { margin-bottom: 24px; }
.key-create-form > label { display: block; margin-bottom: 7px; color: var(--ink-mid); font-size: 12px; font-weight: 700; }
.key-create-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.key-create-controls input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
  background: var(--paper);
  color: var(--ink);
}
.key-create-controls input:focus { border-color: var(--echo); box-shadow: 0 0 0 3px rgba(77,124,90,.1); }
.key-create-controls input::placeholder { color: #969d93; }
.primary-button, .secondary-button, .copy-key-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.primary-button { border: 1px solid var(--rail); background: var(--rail); color: white; }
.primary-button:hover { border-color: var(--echo); background: var(--echo); }
.secondary-button, .copy-key-button { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-mid); }
.secondary-button:hover, .copy-key-button:hover { border-color: var(--echo); color: var(--echo); }
.primary-button:disabled, .secondary-button:disabled, .copy-key-button:disabled { opacity: .55; cursor: default; }
.primary-button svg, .secondary-button svg, .copy-key-button svg { width: 16px; height: 16px; }
.key-reveal {
  margin: 0 0 22px;
  padding: 15px;
  border: 1px solid #b9cbb7;
  border-radius: 6px;
  background: #f1f6ef;
}
.key-reveal-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.key-reveal-heading > div { min-width: 0; display: flex; flex-direction: column; }
.key-reveal-heading strong { font-size: 13px; }
.key-reveal-heading span { color: var(--ink-soft); font-size: 11px; }
.key-secret-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.key-secret-row code { min-width: 0; overflow-x: auto; padding: 10px 11px; border: 1px solid #cbd8c8; border-radius: 4px; background: var(--paper); color: var(--ink); font: 12px/1.4 var(--mono); white-space: nowrap; scrollbar-width: thin; }
.settings-feedback { margin: 0 0 18px; padding: 10px 12px; border-left: 3px solid var(--red); background: #fff4f2; color: #8e2f29; font-size: 12px; }
.settings-feedback.success { border-left-color: var(--echo); background: #f1f6ef; color: #355b3e; }
.key-loading { display: grid; gap: 1px; border-top: 1px solid var(--line); }
.key-loading span { display: block; height: 70px; border-bottom: 1px solid var(--line); background: var(--paper-soft); animation: key-loading-pulse 1.15s ease-in-out infinite alternate; }
.key-loading span:nth-child(2) { animation-delay: .15s; }
@keyframes key-loading-pulse { from { opacity: .42; } to { opacity: 1; } }
.key-error-state, .key-empty-state { min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-top: 1px solid var(--line); color: var(--ink-soft); text-align: center; }
.key-error-state > svg, .key-empty-state > svg { width: 22px; height: 22px; stroke-width: 1.6; }
.key-error-state p, .key-empty-state p { margin: 0; font-size: 12px; }
.api-key-list { border-top: 1px solid var(--line); }
.api-key-row { min-height: 76px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.api-key-row:last-child { border-bottom: 0; }
.api-key-main { min-width: 0; }
.api-key-title { display: flex; align-items: center; gap: 9px; min-width: 0; margin-bottom: 5px; }
.api-key-title strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.api-key-status { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; color: var(--ink-soft); font-size: 10px; }
.api-key-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--echo-bright); }
.api-key-status.revoked i { background: var(--red); }
.api-key-status.expired i { background: var(--amber); }
.api-key-prefix { display: block; overflow: hidden; margin-bottom: 3px; color: var(--ink-mid); font: 11px/1.35 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.api-key-meta { color: var(--ink-soft); font-size: 10px; }
.api-key-revoke { color: var(--ink-soft); }
.api-key-revoke:hover { border-color: #e4bbb7; background: #fff4f2; color: var(--red); }

.menu-popover {
  position: fixed;
  top: 58px;
  right: 18px;
  width: 220px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 14px 38px rgba(23,26,22,.15);
  z-index: 60;
}
.menu-popover button { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 4px; background: transparent; text-align: left; cursor: pointer; }
.menu-popover button:hover { background: var(--paper-soft); }
.menu-popover svg { width: 17px; height: 17px; }
.toast { position: fixed; left: 50%; bottom: calc(102px + env(safe-area-inset-bottom)); max-width: min(420px, calc(100% - 32px)); transform: translateX(-50%); padding: 9px 13px; border-radius: 5px; background: var(--rail); color: white; font-size: 12px; box-shadow: 0 10px 30px rgba(23,26,22,.2); z-index: 80; }
.mobile-only { display: none; }
.mobile-backdrop { position: fixed; inset: 0; background: rgba(15,18,14,.5); z-index: 20; }

html.vintage { color-scheme: dark; }
html.vintage body {
  --bg: #050a06;
  --paper: #081109;
  --paper-soft: #0b180d;
  --ink: #9aef8a;
  --ink-mid: #78c96d;
  --ink-soft: #4f9150;
  --line: #183a20;
  --line-strong: #285b31;
  --rail: #020603;
  --rail-soft: #071009;
  --rail-ink: #a5f596;
  --rail-muted: #4e8d50;
  --echo: #72e36f;
  --echo-bright: #a5f596;
  --amber: #d6a94a;
  --sky: #77de86;
  --red: #ef725f;
  --yellow: #d6a94a;
  --code-bg: #020603;
  --code-ink: #a5f596;
  font-family: var(--mono);
  text-shadow: 0 0 5px rgba(100,230,100,.055);
}
html.vintage body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(112,227,111,.018) 4px);
  mix-blend-mode: screen;
}
html.vintage .sidebar { border-right-color: #24512b; }
html.vintage .sidebar::after { border-top-color: var(--echo); opacity: 1; }
html.vintage .topbar { background: rgba(5,10,6,.94); }
html.vintage .tracer-echo-mark i { --bar: var(--echo-bright); box-shadow: 0 0 7px rgba(120,169,107,.28); }
html.vintage .cost-comparison, html.vintage .cost-ratio { border-color: #24512b; }
html.vintage .cost-values strong, html.vintage .cost-ratio { color: var(--echo-bright); }
html.vintage .new-chat-button { background: #0a1a0d; border-color: #326e3a; color: var(--ink); }
html.vintage .new-chat-button:hover { background: #102616; }
html.vintage .icon-button:hover, html.vintage .icon-button[aria-pressed="true"] { color: var(--echo-bright); background: #0d1f11; border-color: #326e3a; }
html.vintage .prompt-grid button:hover { background: #081109; }
html.vintage .mode-resolver-line, html.vintage .symphony-convergence span { background: var(--line-strong); }
html.vintage .emergence-section,
html.vintage .emergence-sticky { background: #050a06; }
html.vintage .symphony-stage,
html.vintage .score-chapters { border-color: #17331d; }
html.vintage .symphony-canvas { filter: saturate(.86) brightness(.8); }
html.vintage .score-scroll-cue,
html.vintage .score-chapters > span { color: #4f9150; }
html.vintage .score-chapters > span.is-active { color: #8edb82; background: #0a140b; }
html.vintage .score-progress-rail::before { background: #17331d; }
html.vintage .score-progress-rail i { background: #4f9150; }
html.vintage .score-voice { --voice-color: var(--echo-bright); }
html.vintage .emergent-bars i { background: var(--echo-bright) !important; }
html.vintage .message.assistant .message-avatar { box-shadow: 0 0 11px rgba(114,227,111,.12); }
html.vintage .composer { box-shadow: 0 0 18px rgba(114,227,111,.05); }
html.vintage .send-button { background: var(--echo); color: #020603; }
html.vintage .send-button:hover { background: var(--echo-bright); }
html.vintage .send-button:disabled { background: #183a20; color: #4f9150; }
html.vintage .menu-popover { box-shadow: 0 10px 30px rgba(0,0,0,.65); }
html.vintage .toast { color: #020603; background: var(--echo); text-shadow: none; }
html.vintage .settings-dialog,
html.vintage .invite-welcome-dialog { border-color: var(--line-strong); box-shadow: 0 24px 80px rgba(0,0,0,.7); }
html.vintage .settings-header, html.vintage .key-create-controls input, html.vintage .key-secret-row code { background: var(--paper); }
html.vintage .account-summary, html.vintage .key-loading span { background: var(--paper-soft); }
html.vintage .account-loading span, html.vintage .usage-limit-list progress, html.vintage .usage-limit-list progress::-webkit-progress-bar { background: var(--paper-soft); }
html.vintage .key-reveal { border-color: var(--line-strong); background: #0d1f11; }
html.vintage .settings-feedback { background: #24100e; color: var(--red); }
html.vintage .settings-feedback.success { background: #0d1f11; color: var(--echo-bright); }
html.vintage .primary-button { border-color: var(--echo); background: var(--echo); color: #020603; }
html.vintage .secondary-button, html.vintage .copy-key-button { background: var(--paper); }

@media (max-width: 900px) {
  :root { --sidebar: 252px; }
  .topbar { padding: 0 12px 0 16px; gap: 9px; }
  .symphony-score { grid-template-columns: minmax(270px, 1.15fr) 90px minmax(220px, .8fr); gap: 18px; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .mobile-only { display: inline-flex; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 12px 0 35px rgba(8,10,7,.32); }
  .sidebar.open { transform: translateX(0); }
  .workspace { width: 100%; height: 100vh; height: 100dvh; }
  .topbar { grid-template-columns: minmax(72px, 1fr) minmax(110px, auto) auto; height: 64px; padding: env(safe-area-inset-top) 8px 0; gap: 4px; }
  .topbar-leading { gap: 4px; }
  .cost-comparison { gap: 5px; padding-left: 7px; }
  .cost-comparison > svg, .cost-ratio { display: none; }
  .cost-values > span { gap: 5px; }
  .cost-values span span { font-size: 8px; }
  .cost-values strong { font-size: 9px; }
  .topbar-actions { gap: 0; }
  .product-name strong { font-size: 11px; }
  .product-name span { max-width: 105px; font-size: 9px; }
  .message-list { padding: 18px 16px 14px; }
  .home-intro { min-height: calc(100dvh - 238px); padding: 27px 16px 23px; }
  .mode-resolver { width: min(430px, 100%); height: 56px; margin-bottom: 17px; }
  .mode-resolver-label { width: 138px; flex-basis: 138px; font-size: 38px; }
  .tracer-echo-mark-resolver { --mark-h: 28px; --bar-w: 2px; --bar-gap: 2px; }
  .mode-resolver.is-echo .tracer-echo-mark-resolver { width: 18px; margin-left: 12px; margin-right: 8px; }
  .home-intro h1 { font-size: 27px; }
  .empty-subtitle { margin: 10px 0 18px; font-size: 13px; }
  .prompt-grid { grid-template-columns: 1fr 1fr; }
  .prompt-grid button, .prompt-grid button:nth-child(even) { min-height: 64px; padding: 11px 8px; border-right: 1px solid var(--line); font-size: 12px; line-height: 1.35; }
  .prompt-grid button:nth-child(even) { border-right: 0; }
  .prompt-grid svg { width: 17px; height: 17px; }
  .emergence-section { min-height: 760px; padding: 28px 18px 48px; }
  .emergence-copy { grid-template-columns: 1fr; gap: 12px; }
  .emergence-kicker { grid-column: auto; margin: 0 0 4px; }
  .emergence-copy h2 { font-size: 29px; }
  .emergence-copy > p:last-child { max-width: 480px; font-size: 13px; }
  .symphony-score { grid-template-columns: 1fr; gap: 22px; margin: 48px auto 42px; }
  .voice-staves { width: 100%; max-width: 560px; min-height: 218px; margin: 0 auto; }
  .score-voice > div { gap: clamp(7px, 3.2vw, 16px); }
  .symphony-convergence { width: min(300px, 82%); margin: 0 auto; }
  .emergent-phrase { min-height: 138px; }
  .emergent-bars { height: 88px; gap: 5px; }
  .emergent-bars i { width: 4px; flex-basis: 4px; }
  .emergence-equation { gap: 12px; font-size: 9px; }
  .emergence-equation strong { font-size: 21px; }
  .message { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 18px 0; }
  .message-avatar { width: 26px; height: 26px; }
  .message-body { font-size: 14.5px; }
  .message-body .echo-math-display { margin: 12px 0; text-align: left; }
  .message-body .echo-math-display .katex-display { min-width: 0; text-align: left; }
  .message-body .echo-math-display .katex { font-size: 1em; }
  .composer-shell { padding: 8px 10px calc(9px + env(safe-area-inset-bottom)); }
  .composer { min-height: 52px; padding: 7px 7px 7px 12px; }
  .composer textarea { max-height: 130px; }
  .composer textarea { font-size: 16px; }
  .composer-note { margin-top: 5px; padding: 0 8px; font-size: 9.5px; line-height: 1.35; }
  .menu-popover { top: calc(52px + env(safe-area-inset-top)); right: 8px; }
  .toast { bottom: calc(94px + env(safe-area-inset-bottom)); }
  .settings-dialog { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .settings-header { min-height: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 16px; }
  .account-summary { min-height: 82px; padding: 17px 18px; }
  .account-summary strong { max-width: calc(100vw - 150px); }
  .usage-section, .api-key-section { padding: 22px 18px; }
  .usage-metrics > div { padding: 15px 9px 15px 0; }
  .usage-metrics > div + div { padding-left: 9px; }
  .usage-metrics strong { font-size: 14px; }
  .legal-account-section { align-items: start; flex-direction: column; padding: 20px 18px calc(30px + env(safe-area-inset-bottom)); }
  .legal-account-section nav { justify-content: start; }
  .key-create-controls { grid-template-columns: 1fr; }
  .invite-welcome-dialog { width: calc(100% - 20px); }
  .invite-welcome-body { padding: 18px 18px 22px; }
  .invite-welcome-body h2 { font-size: 26px; }
  .invite-welcome-actions { align-items: stretch; flex-direction: column-reverse; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
  .invite-welcome-actions > div { width: 100%; }
  .invite-welcome-actions > div > button { flex: 1 1 0; }
  .invite-welcome-actions .quiet-action { width: auto; align-self: center; }
  .primary-button { width: 100%; }
  .api-key-row { gap: 8px; padding: 14px 0; }
}

@media (max-width: 380px) {
  .product-name > #connection-label { display: none; }
  .topbar .icon-button { width: 38px; height: 38px; flex-basis: 38px; }
  .mode-resolver-label { width: 118px; flex-basis: 118px; font-size: 34px; }
  .home-intro h1 { font-size: 24px; }
  .empty-subtitle { font-size: 12px; }
  .prompt-grid button, .prompt-grid button:nth-child(even) { min-height: 62px; grid-template-columns: 17px minmax(0, 1fr); gap: 7px; padding: 10px 6px; font-size: 11px; }
  .emergence-section { padding-left: 14px; padding-right: 14px; }
  .score-voice { grid-template-columns: 20px minmax(0, 1fr); gap: 7px; }
  .score-voice > div { gap: 6px; }
  .emergence-equation span { max-width: 80px; }
  .input-count { display: none; }
  .account-summary { align-items: start; flex-direction: column; gap: 8px; }
  .account-summary strong { max-width: calc(100vw - 36px); }
  .usage-metrics { grid-template-columns: 1fr; }
  .usage-metrics > div, .usage-metrics > div + div { padding: 11px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .usage-metrics > div:last-child { border-bottom: 0; }
  .key-reveal { padding: 12px; }
  .copy-key-button { width: 40px; padding: 0; }
  .copy-key-button span { display: none; }
}

@media (max-width: 720px) and (max-height: 650px) {
  .home-intro { min-height: auto; padding-top: 16px; padding-bottom: 14px; }
  .mode-resolver { height: 48px; margin-bottom: 11px; }
  .home-intro h1 { font-size: 23px; }
  .empty-subtitle { margin: 8px 0 12px; line-height: 1.4; }
  .prompt-grid button:nth-child(n + 3) { display: none; }
  .emergence-section { padding-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .mode-resolver-label { filter: none !important; opacity: 1 !important; transform: none !important; }
  .score-voice { transform: none !important; }
  .symphony-convergence span { transform: scaleX(1) !important; }
  .emergent-phrase { filter: none !important; opacity: 1 !important; transform: none !important; }
  .emergent-bars i { transform: none !important; }
}

/* Public arrival experience. The conversation shell returns after the first prompt. */
.app-shell.home-active { grid-template-columns: minmax(0, 1fr); }
.home-active .sidebar { display: none; }
.home-active .workspace { position: relative; grid-template-rows: var(--topbar) minmax(0, 1fr); }
.home-active .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0 max(22px, calc((100% - 1240px) / 2));
  background: rgba(248,249,245,.94);
}
.home-active .topbar-leading { min-width: 120px; }
.home-active #open-sidebar, .home-active .cost-comparison { display: none !important; }
.home-active .product-name { flex-direction: row; align-items: center; gap: 10px; }
.home-active .product-name strong { font-size: 15px; }
.home-active .product-name strong .brand-by { font-size: 10px; }
.home-active .product-name > span { padding-left: 10px; border-left: 1px solid var(--line-strong); }
.home-active .thread { background: var(--paper-soft); }
.home-active .empty-state { min-height: 100%; }

.home-intro {
  position: relative;
  width: 100%;
  min-height: min(690px, calc(100dvh - var(--topbar) - 72px));
  justify-content: center;
  padding: 54px max(24px, calc((100% - 1180px) / 2)) 62px;
  overflow: hidden;
  background: var(--paper-soft);
}
.home-intro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1180px, calc(100% - 48px));
  height: 1px;
  background: var(--line-strong);
  transform: translateX(-50%);
}
.hero-brand-signal {
  width: min(700px, 88%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin: 0 auto 22px;
}
.hero-brand-signal > span:first-child,
.hero-brand-signal > span:last-child { height: 1px; background: var(--line-strong); }
.hero-brand-lockup { display: flex; align-items: center; gap: 20px; }
.hero-brand-lockup h1 { margin: 0; color: var(--ink); font-size: 82px; font-weight: 720; line-height: .92; }
.tracer-echo-mark-hero { --mark-h: 64px; --bar-w: 6px; --bar-gap: 6px; }
.tracer-echo-mark-hero i { transform-origin: center; animation: echo-breathe 4.8s ease-in-out infinite; }
.tracer-echo-mark-hero i:nth-child(2) { animation-delay: -.65s; }
.tracer-echo-mark-hero i:nth-child(3) { animation-delay: -1.3s; }
.tracer-echo-mark-hero i:nth-child(4) { animation-delay: -1.95s; }
.tracer-echo-mark-hero i:nth-child(5) { animation-delay: -2.6s; }
@keyframes echo-breathe {
  0%, 100% { transform: scaleY(.78); opacity: .76; }
  50% { transform: scaleY(1); opacity: 1; }
}
.mode-choice-section {
  min-height: 350px;
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(520px, 1.28fr);
  gap: 72px;
  align-items: center;
  padding: 70px max(28px, calc((100% - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.mode-choice-copy p { margin: 0 0 15px; color: var(--echo); font: 760 9px/1 var(--mono); text-transform: uppercase; }
.mode-choice-copy h2 { max-width: 390px; margin: 0; font-size: 36px; font-weight: 620; line-height: 1.08; }
.mode-resolver {
  position: relative;
  width: min(650px, 100%);
  min-height: 102px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0 auto;
}
.selector-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: 14px 46px 13px;
  gap: 7px;
  align-items: center;
}
.model-menu-heading {
  color: var(--ink-soft);
  font: 700 9px/1 var(--mono);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.model-menu-list {
  position: relative;
  width: 100%;
  height: 46px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255,255,255,.68);
  box-shadow: 0 8px 24px rgba(23,26,22,.035);
}
.model-menu-list > span {
  position: absolute;
  inset: 0 38px 0 13px;
  display: flex;
  align-items: center;
  padding: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .16s ease, transform .16s ease;
}
.model-menu-list small { margin-right: 8px; color: var(--ink-soft); font: 700 7px/1 var(--mono); }
.model-menu-list > span.is-active {
  color: var(--ink);
  opacity: 1;
  transform: translateY(0);
}
.model-menu-list > span.is-active small { color: var(--amber); }
.mode-resolver.is-defocusing .model-menu-list > span.is-active { opacity: 0; transform: translateY(-6px); }
.model-menu-chevron { position: absolute; top: 14px; right: 12px; width: 15px; height: 15px; color: var(--ink-soft); stroke-width: 1.8; }
.selector-caption {
  overflow: hidden;
  color: var(--ink-soft);
  font: 650 8px/1 var(--mono);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selector-bridge {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  margin-top: -4px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--echo);
  background: var(--paper);
}
.selector-bridge svg { width: 16px; height: 16px; stroke-width: 1.8; }
.echo-selector-heading {
  color: var(--echo);
  font: 760 9px/1 var(--mono);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}
.echo-resolution {
  position: relative;
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid #9cac98;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 9px 26px rgba(66,107,74,.09);
  pointer-events: none;
  opacity: 1;
  transform: none;
}
.tracer-echo-mark-resolver {
  --mark-h: 20px;
  --bar-w: 2px;
  --bar-gap: 2px;
  width: auto;
  overflow: visible;
  opacity: 1;
  transform: none;
}
.echo-resolution > span:last-child { min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.echo-resolution small { display: none; }
.echo-resolution strong { color: var(--ink); font-size: 14px; line-height: 1; }
.echo-resolution em { color: var(--echo); font: 700 7px/1 var(--mono); text-transform: uppercase; white-space: nowrap; }
.hero-message { position: relative; width: min(1060px, 100%); min-height: 164px; margin: 0 auto 22px; text-align: center; }
.resolved-thesis {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 164px;
  opacity: 1;
  transform: none;
}
.resolved-thesis > p { margin: 0 0 11px; color: var(--echo); font: 760 10px/1 var(--mono); text-transform: uppercase; }
.resolved-thesis h2 { max-width: 980px; margin: 0; color: var(--ink); font-size: 43px; font-weight: 720; line-height: 1.06; }
.hero-explainer {
  max-width: 650px;
  margin-top: 15px;
  color: var(--ink-mid);
  font-size: 14px;
  line-height: 1.5;
}
.home-composer-slot { width: min(880px, 100%); margin: 0 auto; }
.home-composer-slot .composer-shell { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 10px; padding: 0; background: transparent; }
.home-composer-slot .composer { width: 100%; min-height: 66px; padding: 12px 12px 12px 18px; border-color: #b8c1b3; box-shadow: 0 18px 50px rgba(23,26,22,.09); }
.home-composer-slot .composer textarea { min-height: 40px; font-size: 16px; }
.home-composer-slot .composer-note { display: none; }
.home-composer-slot .api-cta {
  min-width: 0;
  height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink-mid);
  background: var(--paper);
  font: 750 10px/1 var(--mono);
  text-decoration: none;
  box-shadow: 0 18px 50px rgba(23,26,22,.06);
}
.home-composer-slot .api-cta:hover { border-color: var(--echo); color: var(--echo); }
.home-composer-slot .api-cta svg { width: 16px; height: 16px; stroke-width: 1.8; }
.legacy-mode-demo {
  position: relative;
  width: 154px;
  height: 40px;
  display: none;
  grid-template-columns: auto minmax(0, 1fr) 12px;
  gap: 5px;
  align-items: center;
  overflow: hidden;
  padding: 0 8px;
  border: 1px solid #aab4a6;
  border-radius: 5px;
  color: var(--ink-mid);
  background: #fff;
  box-shadow: 0 7px 18px rgba(26,31,25,.08);
  opacity: 1;
  transform: scale(1);
  transition: width .44s cubic-bezier(.22, 1, .36, 1), padding .38s ease, border-width .2s ease, opacity .24s ease .08s, transform .44s cubic-bezier(.22, 1, .36, 1), filter .3s ease;
}
.home-active .legacy-mode-demo { display: grid; }
.legacy-mode-demo::before,
.legacy-mode-demo::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 7px;
  left: 7px;
  height: 1px;
  background: rgba(189, 67, 58, .68);
  pointer-events: none;
  transform-origin: center;
}
.legacy-mode-demo::before { transform: rotate(9deg); }
.legacy-mode-demo::after { transform: rotate(-9deg); }
.legacy-mode-demo.is-struck { border-color: var(--line); background: var(--paper-soft); opacity: .62; transform: scale(.94); }
.legacy-mode-demo.is-dismissed { width: 0; padding-right: 0; padding-left: 0; border-width: 0; opacity: 0; filter: blur(5px); transform: translateX(10px) scale(.58); }
.legacy-mode-demo > small { color: var(--amber); font: 700 6px/1 var(--mono); }
.legacy-mode-demo > svg { width: 12px; height: 12px; color: var(--ink-soft); stroke-width: 1.8; }
.legacy-mode-demo-list { position: relative; min-width: 0; height: 16px; }
.legacy-mode-demo-list > span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease;
}
.legacy-mode-demo-list > span.is-active { opacity: 1; transform: translateY(0); }
.one-endpoint-note { display: none; white-space: nowrap; }
.home-active .one-endpoint-note {
  width: 0;
  display: inline-flex;
  overflow: hidden;
  justify-content: flex-end;
  color: var(--echo);
  font: 760 9px/1 var(--mono);
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(8px);
  transition: width .44s cubic-bezier(.22, 1, .36, 1), opacity .28s ease .12s, transform .44s cubic-bezier(.22, 1, .36, 1);
}
.home-active .composer.mode-resolved .one-endpoint-note { width: 92px; opacity: 1; transform: translateX(0); }
.composer.mode-resolved .send-button:not(.stop) { animation: echo-release .72s cubic-bezier(.2, .9, .25, 1); }
@keyframes echo-release {
  0% { transform: scale(.92); box-shadow: 0 0 0 0 rgba(77,124,90,0); }
  45% { transform: scale(1.1); box-shadow: 0 0 0 7px rgba(77,124,90,.10); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(77,124,90,0); }
}
.prompt-grid {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 17px auto 0;
  border: 0;
}
.prompt-grid button, .prompt-grid button:nth-child(even) {
  min-height: 38px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}
.prompt-grid button:last-child { border-right: 0; }
.prompt-grid button > svg { width: 16px; height: 16px; }
.prompt-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.prompt-copy strong { overflow: hidden; color: var(--ink-mid); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.prompt-copy small { color: var(--ink-soft); font: 650 7px/1 var(--mono); text-transform: uppercase; }
.prompt-depth { height: 20px; display: flex; align-items: center; gap: 2px; }
.prompt-depth i { width: 2px; height: 7px; border-radius: 1px; background: var(--line-strong); }
.prompt-depth i:nth-child(2) { height: 12px; background: var(--tracer-sky); }
.prompt-depth-deep i:nth-child(1) { background: var(--tracer-sky); }
.prompt-depth-deep i:nth-child(2) { background: var(--echo); }
.prompt-depth-deep i:nth-child(3) { height: 17px; background: var(--tracer-orange); }
.prompt-depth-deep i:nth-child(4) { height: 11px; background: var(--tracer-red); }
.prompt-depth-full i:nth-child(1) { background: var(--tracer-sky); }
.prompt-depth-full i:nth-child(2) { background: var(--echo); }
.prompt-depth-full i:nth-child(3) { height: 17px; background: var(--tracer-orange); }
.prompt-depth-full i:nth-child(4) { height: 11px; background: var(--tracer-red); }
.prompt-depth-full i:nth-child(5) { height: 15px; background: var(--yellow); }
.prompt-grid button:hover { background: transparent; color: var(--ink); }
.prompt-grid svg { width: 15px; height: 15px; margin: 0; }

.emergence-section { --symphony-progress: 0; min-height: 260vh; padding: 0; overflow: visible; background: #f7f8f3; }
.emergence-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: calc(100dvh - var(--topbar));
  min-height: 0;
  padding: 34px max(28px, calc((100% - 1240px) / 2)) 18px;
  overflow: hidden;
  background: #f7f8f3;
}
.emergence-copy { width: min(980px, 100%); display: block; opacity: var(--section-copy-opacity, 1); transition: opacity .16s linear; }
.emergence-kicker { margin: 0 0 17px; color: var(--echo); font: 760 10px/1 var(--mono); text-transform: uppercase; }
.emergence-copy h2 { margin: 0; color: var(--ink); font-size: 43px; font-weight: 690; line-height: 1.02; }
.emergence-copy h2 span { color: var(--echo); }
.emergence-copy > p:last-child { max-width: 760px; margin: 12px 0 0; color: var(--ink-mid); font-size: 15px; line-height: 1.45; }
.symphony-stage {
  position: relative;
  width: min(1240px, 100%);
  height: clamp(240px, calc(100% - 190px), 690px);
  margin: 10px auto 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  transform: translateY(0);
  transform-origin: top center;
  transition: height .56s cubic-bezier(.22, 1, .36, 1), transform .56s cubic-bezier(.22, 1, .36, 1), border-color .3s ease;
}
.emergence-section.is-resolved .symphony-stage {
  height: calc(100% - 88px);
  border-top-color: transparent;
  transform: translateY(-286px);
}
.symphony-canvas { position: absolute; inset: 0 0 118px; width: 100%; height: calc(100% - 118px); display: block; opacity: 0; transition: opacity .4s ease; }
.symphony-stage.is-webgl .symphony-canvas { opacity: 1; }
.symphony-stage.is-webgl .frequency-key { opacity: 0; }
.score-scroll-cue {
  position: absolute;
  z-index: 4;
  top: 25px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font: 700 8px/1 var(--mono);
  text-transform: uppercase;
  opacity: var(--scroll-cue-opacity, 1);
  transform: translateX(-50%);
  transition: opacity .16s linear;
}
.score-scroll-cue svg { width: 14px; height: 14px; color: var(--echo); animation: score-cue-drop 1.45s ease-in-out infinite; }
@keyframes score-cue-drop {
  0%, 100% { transform: translateY(-2px); opacity: .55; }
  50% { transform: translateY(3px); opacity: 1; }
}
.score-progress-rail {
  position: absolute;
  z-index: 4;
  top: 92px;
  right: 2px;
  bottom: 145px;
  width: 14px;
}
.score-progress-rail::before,
.score-progress-rail > span {
  content: "";
  position: absolute;
  top: 0;
  left: 6px;
  width: 1px;
  height: 100%;
  background: var(--line-strong);
}
.score-progress-rail > span { background: var(--echo); transform: scaleY(var(--symphony-progress)); transform-origin: top center; }
.score-progress-rail i { position: absolute; right: 4px; width: 5px; height: 2px; background: var(--ink-soft); }
.score-progress-rail i:nth-of-type(1) { top: 0; }
.score-progress-rail i:nth-of-type(2) { top: 50%; }
.score-progress-rail i:nth-of-type(3) { bottom: 0; }
.symphony-fallback { position: absolute; inset: 0 0 60px; transition: opacity .25s ease; }
.symphony-stage.is-webgl .symphony-fallback { opacity: 0; }
.fallback-frequencies {
  position: absolute;
  top: 95px;
  left: 3%;
  width: 55%;
  height: 230px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  perspective: 700px;
  transform: rotateY(8deg);
  transform-origin: left center;
}
.fallback-phrase { display: flex; align-items: center; gap: clamp(6px, .7vw, 10px); color: var(--tracer-sky); opacity: .92; }
.fallback-phrase i { width: 4px; height: 12px; flex: 0 0 4px; background: currentColor; transform-origin: center; }
.fallback-phrase i:nth-child(3n) { height: 22px; }
.fallback-phrase i:nth-child(5n) { height: 31px; }
.fallback-phrase i:nth-child(7n) { height: 17px; }
.phrase-focused { color: var(--echo); }
.phrase-deep { color: var(--tracer-orange); }
.phrase-expansive { color: var(--tracer-red); }
.phrase-expansive i { height: 7px; }
.phrase-expansive i:nth-child(4n) { height: 29px; }
.tracer-echo-mark-stage { --mark-h: 72px; --bar-w: 7px; --bar-gap: 6px; }
.symphony-fallback > .tracer-echo-mark-stage { position: absolute; top: 178px; right: 7%; }
.conductor-overlay { position: absolute; inset: 0 0 60px; pointer-events: none; }
.frequency-key {
  position: absolute;
  top: 76px;
  bottom: 42px;
  left: 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  align-items: center;
  color: var(--ink-soft);
  opacity: var(--voice-key-opacity, 1);
  transition: opacity .16s linear;
}
.frequency-key > span { display: flex; align-items: center; gap: 7px; font: 700 8px/1 var(--mono); text-transform: uppercase; }
.frequency-key svg { width: 16px; height: 16px; stroke-width: 1.6; }
.frequency-key b { font-weight: 700; }
.frequency-quick { color: var(--tracer-sky); }
.frequency-focused { color: var(--echo); }
.frequency-deep { color: var(--tracer-orange); }
.frequency-expansive { color: var(--tracer-red); }
.coherent-output { position: absolute; bottom: 32px; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transform: translate(-50%, 10px); transition: opacity .32s ease, transform .32s ease; }
.emergence-section.is-resolved .coherent-output {
  top: 70%;
  bottom: auto;
  opacity: 1;
  transform: translate(-50%, 0);
}
.coherent-output strong { color: var(--ink); font-size: 22px; line-height: 1; }
.coherent-output small { color: var(--ink-soft); font: 700 9px/1 var(--mono); text-transform: uppercase; }
.score-chapters {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}
.score-chapters > span { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-right: 1px solid var(--line); color: #a0a69d; font-size: 11px; transition: color .25s ease, background .25s ease; }
.score-chapters > span:first-child { padding-left: 0; }
.score-chapters > span:last-child { border-right: 0; }
.score-chapters > span.is-active { color: var(--ink); background: rgba(255,255,255,.5); }
.score-chapters small { color: var(--echo); font: 700 8px/1 var(--mono); }

.your-echo-section {
  min-height: 560px;
  display: grid;
  grid-template-columns: 120px minmax(260px, .9fr) minmax(320px, 1.1fr);
  gap: 48px;
  align-items: center;
  padding: 88px max(28px, calc((100% - 1180px) / 2));
  background: var(--rail);
  color: var(--rail-ink);
}
.your-echo-index { align-self: start; padding-top: 14px; color: var(--rail-muted); font: 700 9px/1 var(--mono); }
.your-echo-copy p { margin: 0 0 22px; color: var(--echo-bright); font: 760 10px/1 var(--mono); text-transform: uppercase; }
.your-echo-copy h2 { margin: 0; font-size: 64px; line-height: 1; }
.your-echo-copy strong { display: block; margin-top: 18px; color: var(--rail-muted); font-size: 18px; font-weight: 560; }
.your-echo-detail { max-width: 520px; }
.your-echo-detail > p:first-child { margin: 0; color: #d7ddd2; font-size: 22px; line-height: 1.48; }
.your-echo-rule { height: 94px; display: flex; align-items: center; gap: 10px; margin: 36px 0 24px; }
.your-echo-rule span { height: 1px; flex: 1 1 auto; background: #394136; }
.your-echo-rule i { width: 5px; background: var(--tracer-sky); }
.your-echo-rule i:nth-of-type(1) { height: 24px; }
.your-echo-rule i:nth-of-type(2) { height: 58px; background: var(--tracer-orange); }
.your-echo-rule i:nth-of-type(3) { height: 82px; background: var(--tracer-red); }
.your-echo-rule i:nth-of-type(4) { height: 46px; background: var(--echo-bright); }
.your-echo-rule i:nth-of-type(5) { height: 30px; background: var(--tracer-sky); }
.your-echo-footnote { margin: 0; color: var(--rail-muted); font: 700 10px/1 var(--mono); text-transform: uppercase; }

@media (max-width: 900px) {
  .home-intro { padding-top: 38px; }
  .mode-choice-section { grid-template-columns: minmax(220px, .62fr) minmax(470px, 1.38fr); gap: 36px; }
  .model-menu-list > span { font-size: 14px; }
  .emergence-copy h2 { font-size: 40px; }
  .symphony-stage { height: clamp(240px, calc(100% - 185px), 610px); }
  .emergence-section.is-resolved .symphony-stage { height: calc(100% - 56px); transform: translateY(-220px); }
  .your-echo-section { grid-template-columns: 70px minmax(220px, .9fr) minmax(280px, 1.1fr); gap: 28px; }
}

@media (max-width: 720px) {
  .home-active .topbar { grid-template-columns: minmax(0, 1fr) auto; padding: env(safe-area-inset-top) 10px 0 14px; }
  .home-active .product-name { margin-left: 3px; }
  .home-intro { min-height: calc(100dvh - var(--topbar) - 58px); padding: 38px 16px 46px; }
  .home-intro::before { width: calc(100% - 32px); }
  .hero-brand-signal { width: min(330px, 86%); gap: 15px; margin-bottom: 22px; }
  .hero-brand-lockup { gap: 12px; }
  .hero-brand-lockup h1 { font-size: 58px; }
  .tracer-echo-mark-hero { --mark-h: 50px; --bar-w: 5px; --bar-gap: 5px; }
  .mode-choice-section { min-height: 430px; grid-template-columns: 1fr; gap: 34px; padding: 54px 16px 58px; }
  .mode-choice-copy { text-align: center; }
  .mode-choice-copy p { margin-bottom: 11px; font-size: 8px; }
  .mode-choice-copy h2 { max-width: 330px; margin: 0 auto; font-size: 30px; }
  .mode-resolver { width: 100%; min-height: 90px; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); gap: 6px; margin: 0; }
  .selector-panel { grid-template-rows: 12px 42px 11px; gap: 5px; }
  .model-menu-heading, .echo-selector-heading { font-size: 7px; }
  .model-menu-list { top: auto; left: auto; width: 100%; height: 42px; transform: none; }
  .model-menu-list > span { inset: 0 36px 0 12px; padding: 0; font-size: 13px; }
  .model-menu-list small { margin: 0 7px 0 0; font-size: 7px; }
  .selector-caption { font-size: 6.5px; }
  .selector-bridge { width: 27px; height: 27px; margin-top: -2px; }
  .selector-bridge svg { width: 13px; height: 13px; }
  .tracer-echo-mark-resolver { --mark-h: 18px; --bar-w: 2px; --bar-gap: 2px; }
  .echo-resolution { top: auto; width: 100%; height: 42px; gap: 7px; padding: 0 9px; }
  .echo-resolution strong { font-size: 13px; }
  .echo-resolution em { font-size: 6px; }
  .hero-message { min-height: 180px; margin-bottom: 18px; }
  .choice-thesis { padding: 0 14px; font-size: 23px; }
  .resolved-thesis > p { margin-bottom: 10px; font-size: 8px; }
  .resolved-thesis h2 { max-width: 350px; font-size: 30px; line-height: 1.04; }
  .hero-explainer { max-width: 360px; margin-top: 13px; font-size: 12px; line-height: 1.42; }
  .home-composer-slot .composer { min-height: 58px; padding: 8px 8px 8px 14px; }
  .home-composer-slot .composer-shell { grid-template-columns: minmax(0, 1fr) 62px; gap: 7px; }
  .home-composer-slot .composer {
    min-height: 78px;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 2px;
    padding: 6px 7px 6px 12px;
  }
  .home-composer-slot .composer textarea { min-height: 28px; max-height: 44px; padding: 2px 0; line-height: 1.35; }
  .home-composer-slot .composer-actions { width: 100%; min-height: 32px; justify-content: flex-end; gap: 5px; }
  .home-composer-slot .legacy-mode-demo { height: 32px; }
  .home-composer-slot .send-button { width: 34px; height: 34px; }
  .home-composer-slot .api-cta { height: auto; min-height: 78px; align-self: stretch; gap: 4px; font-size: 8px; }
  .home-composer-slot .api-cta svg { width: 14px; height: 14px; }
  .chat-start { padding-bottom: 105px; }
  .tracer-echo-mark-chat-start { --mark-h: 36px; }
  .chat-start h1 { font-size: 32px; }
  .prompt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
  .prompt-grid button, .prompt-grid button:nth-child(even) { min-height: 58px; grid-template-columns: 1fr; justify-items: center; gap: 4px; padding: 6px 5px; border-right: 1px solid var(--line); font-size: 10px; line-height: 1.2; }
  .prompt-grid button:last-child { border-right: 0; }
  .prompt-grid button > svg { display: none; }
  .prompt-copy { align-items: center; gap: 2px; text-align: center; }
  .prompt-copy strong { max-width: 100%; font-size: 9.5px; }
  .prompt-copy small { font-size: 6.5px; }
  .prompt-depth { height: 17px; }
  .emergence-section { min-height: 285vh; padding: 0; }
  .emergence-sticky { height: calc(100dvh - var(--topbar)); min-height: 0; padding: 18px 16px 8px; }
  .emergence-kicker { margin-bottom: 11px; font-size: 8px; }
  .emergence-copy h2 { font-size: 30px; line-height: 1.02; }
  .emergence-copy > p:last-child { margin-top: 11px; font-size: 13.5px; line-height: 1.38; }
  .symphony-stage { height: clamp(220px, calc(100% - 155px), 560px); margin-top: 6px; }
  .emergence-section.is-resolved .symphony-stage { height: calc(100% - 24px); transform: translateY(-128px); }
  .score-scroll-cue { top: 113px; font-size: 7px; }
  .score-progress-rail { top: 165px; right: 0; bottom: 152px; }
  .symphony-canvas { bottom: 138px; height: calc(100% - 138px); }
  .symphony-fallback { bottom: 74px; height: calc(100% - 74px); }
  .fallback-frequencies { top: 116px; left: 2%; width: 75%; height: 210px; }
  .fallback-conductor { top: 176px; left: 76%; height: 88px; }
  .symphony-fallback > .tracer-echo-mark-stage { top: 188px; right: 2%; }
  .tracer-echo-mark-stage { --mark-h: 52px; --bar-w: 5px; --bar-gap: 4px; }
  .conductor-overlay { bottom: 74px; }
  .frequency-key { top: 142px; bottom: 52px; }
  .frequency-key > span { gap: 5px; font-size: 7px; }
  .frequency-key svg { width: 13px; height: 13px; }
  .coherent-output { right: auto; bottom: 24px; }
  .emergence-section.is-resolved .coherent-output { top: 69%; bottom: auto; }
  .score-chapters { bottom: 0; height: 74px; }
  .score-chapters > span { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 0 8px; font-size: 9px; line-height: 1.15; }
  .score-chapters > span:first-child { padding-left: 0; }
  .your-echo-section { min-height: 610px; grid-template-columns: 1fr; gap: 24px; padding: 64px 22px 70px; }
  .your-echo-index { padding: 0; }
  .your-echo-copy h2 { font-size: 52px; }
  .your-echo-detail > p:first-child { font-size: 19px; }
}

@media (max-width: 380px) {
  .mode-resolver { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 4px; }
  .model-menu-heading, .echo-selector-heading { font-size: 6.5px; }
  .selector-caption { font-size: 5.8px; }
  .echo-resolution em { display: none; }
  .hero-brand-lockup h1 { font-size: 50px; }
  .resolved-thesis h2 { font-size: 27px; }
  .legacy-mode-demo { width: 132px; padding-right: 6px; padding-left: 6px; }
  .prompt-grid button span { max-width: 84px; }
  .emergence-copy h2 { font-size: 28px; }
}

@media (max-width: 720px) and (max-height: 700px) {
  .emergence-sticky { padding: 10px 12px 5px; }
  .emergence-kicker { margin-bottom: 7px; }
  .emergence-copy h2 { font-size: 25px; }
  .emergence-copy > p:last-child { margin-top: 7px; font-size: 12px; line-height: 1.3; }
  .symphony-stage { height: calc(100% - 130px); min-height: 0; }
  .emergence-section.is-resolved .symphony-stage { height: calc(100% - 40px); transform: translateY(-92px); }
  .score-scroll-cue { top: 72px; }
  .score-progress-rail { top: 116px; bottom: 112px; }
}

@media (max-height: 460px) {
  .emergence-section { min-height: 0; }
  .emergence-sticky { position: relative; top: auto; height: auto; min-height: 0; overflow: visible; }
  .symphony-stage,
  .emergence-section.is-resolved .symphony-stage {
    height: clamp(380px, 50vw, 500px);
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-menu-heading, .model-menu-list { display: block; }
  .echo-resolution { opacity: 1; transform: none; }
  .choice-thesis { display: none; }
  .resolved-thesis { opacity: 1; transform: none; }
  .tracer-echo-mark-hero i { animation: none; transform: none; opacity: 1; }
  .score-scroll-cue svg { animation: none; }
  .symphony-canvas { display: none; }
  .symphony-fallback { opacity: 1 !important; }
  .emergence-section { min-height: auto !important; }
  .emergence-sticky { position: relative; height: auto; min-height: calc(100dvh - var(--topbar)); overflow: visible; }
  .emergence-copy { opacity: 1 !important; }
  .emergence-section.is-resolved .symphony-stage { height: clamp(380px, calc(100dvh - 230px), 690px); transform: none; }
  .score-scroll-cue, .score-progress-rail { display: none; }
}
