:root {
  color-scheme: light;
  --trelis-blue: #0d579b;
  --trelis-green: #329239;
  --trelis-orange: #f7931a;
  --trelis-orange-bright: #ff9f2e;
  --trelis-gray: #4d4d4d;
  --trelis-spectrum: linear-gradient(90deg,#0d579b 0%,#329239 50%,#f7931a 100%);
  --trelis-blue-dark: #0a477e;
  --trelis-blue-wash: #eef5fb;
  --card-border: rgba(13,87,155,.12);
  --bg-white: #ffffff;
  --bg-light: #fafbfc;
  --bg-subtle: #f0f4f8;
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 2px 8px rgba(15,23,42,.06);
  --shadow-lg: 0 10px 28px rgba(15,23,42,.10);
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --font-body: 'Manrope', -apple-system, system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Manrope', -apple-system, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -14rem, rgba(13,87,155,.10), transparent 32rem),
    linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 46%, var(--bg-subtle) 100%);
  color: var(--text-primary);
  font-family: var(--font-body);
}

button,
input {
  font: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
}

.spectrum-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 3px;
  background: var(--trelis-spectrum);
}

.app-shell {
  width: min(100%, 980px);
  padding: clamp(1rem, 2vw, 2rem);
}

.app-header {
  min-height: 72px;
  margin-bottom: 1rem;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
}

.wordmark-row {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.app-title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.eyebrow,
.diag-label,
.form-label {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-width: 6.6rem;
  justify-content: center;
  border: 1px solid #d9e2ec;
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0.5rem 0.85rem;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

[data-state="LISTENING"] .status-pill {
  border-color: rgba(50,146,57,.28);
  background: rgba(50,146,57,.10);
  color: var(--trelis-green);
}

[data-state="LOCAL_LOADING"] .status-pill,
[data-state="TTS_CHECKING"] .status-pill,
[data-state="BRAIN_WAKING"] .status-pill,
[data-state="WARMING"] .status-pill,
[data-state="PREPARING"] .status-pill,
[data-state="THINKING"] .status-pill {
  border-color: rgba(247,147,26,.32);
  background: rgba(247,147,26,.12);
  color: #b45f08;
}

[data-state="BRAIN_OFFLINE"] .status-pill,
[data-state="ERROR"] .status-pill {
  border-color: rgba(190,18,60,.28);
  background: rgba(190,18,60,.10);
  color: #be123c;
}

[data-state="SPEAKING"] .status-pill {
  border-color: rgba(13,87,155,.30);
  background: rgba(13,87,155,.10);
  color: var(--trelis-blue);
}

.voice-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin: 0 auto 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem) 1rem 1.25rem;
}

.voice-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.voice-pick-label {
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 0;
}

.voice-pick .form-select {
  width: auto;
  min-width: 12rem;
}

.mic-wrap {
  position: relative;
  display: grid;
  width: 148px;
  height: 148px;
  place-items: center;
}

.status-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 132px;
  height: 132px;
  border-radius: var(--radius-pill);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

[data-state="LISTENING"] .status-orbit {
  border: 1px solid rgba(50,146,57,.26);
  animation: listenPulse 1.9s ease-out infinite;
}

[data-state="LOCAL_LOADING"] .status-orbit,
[data-state="TTS_CHECKING"] .status-orbit,
[data-state="BRAIN_WAKING"] .status-orbit,
[data-state="PREPARING"] .status-orbit,
[data-state="WARMING"] .status-orbit {
  border: 1px solid rgba(247,147,26,.32);
  animation: speakPulse 0.95s ease-in-out infinite alternate;
}

[data-state="SPEAKING"] .status-orbit {
  border: 1px solid rgba(247,147,26,.32);
  animation: speakPulse 0.95s ease-in-out infinite alternate;
}

.mic-button {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 104px;
  height: 104px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--trelis-blue);
  color: #ffffff;
  padding: 0.9rem 0.65rem 0.75rem;
  transition: transform var(--transition), background var(--transition);
}

.mic-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.mic-button:disabled {
  cursor: default;
  opacity: 0.95;
}

[data-state="LISTENING"] .mic-button {
  background: var(--trelis-green);
}

[data-state="LOCAL_LOADING"] .mic-button,
[data-state="TTS_CHECKING"] .mic-button,
[data-state="BRAIN_WAKING"] .mic-button,
[data-state="PREPARING"] .mic-button,
[data-state="WARMING"] .mic-button {
  background: var(--trelis-orange);
}

[data-state="BRAIN_OFFLINE"] .mic-button,
[data-state="ERROR"] .mic-button {
  background: #be123c;
}

[data-state="SPEAKING"] .mic-button {
  background: var(--trelis-orange);
}

.mic-button:focus-visible,
.stop-button:focus-visible {
  outline: 3px solid rgba(13,87,155,.30);
  outline-offset: 4px;
}

/* The call button's own icon is the brand mark's signal bars, not a stock mic glyph —
   the same shape reappears in the favicon and the landing hero trace. */
.mic-glyph {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 3px;
  width: 26px;
  height: 30px;
  margin-bottom: 0.55rem;
}

.mic-glyph i {
  width: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.92;
}

.mic-glyph i:nth-child(1) { height: 45%; }
.mic-glyph i:nth-child(2) { height: 100%; }
.mic-glyph i:nth-child(3) { height: 65%; }
.mic-glyph i:nth-child(4) { height: 80%; }

[data-state="LISTENING"] .mic-glyph i,
[data-state="SPEAKING"] .mic-glyph i {
  animation: hero-eq 1s ease-in-out infinite;
}
.mic-glyph i:nth-child(2) { animation-delay: -0.6s; }
.mic-glyph i:nth-child(3) { animation-delay: -0.2s; }
.mic-glyph i:nth-child(4) { animation-delay: -0.85s; }

@media (prefers-reduced-motion: reduce) {
  .mic-glyph i { animation: none !important; }
}

.mic-label {
  position: relative;
  z-index: 1;
  max-width: 100%;
  min-height: 0.9rem;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-button {
  min-width: 9.25rem;
  border: 1px solid rgba(247,147,26,.32);
  border-radius: var(--radius-pill);
  background: #fff8ef;
  color: #b45f08;
  font-weight: 700;
  padding: 0.7rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stop-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.stop-button:disabled {
  display: none;
}

.status-detail {
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: min(100%, 42rem);
  text-align: center;
}

.warmup-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(247,147,26,.22);
  border-radius: var(--radius-pill);
  background: rgba(247,147,26,.10);
  color: #9a5208;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
}

.warmup-notice[hidden] {
  display: none;
}

.conversation-wrap {
  border: 1px solid #d9e2ec;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem 0.6rem clamp(1rem, 3vw, 1.5rem);
  border-bottom: 1px solid #e6edf4;
}

.conversation-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-muted);
}

.conversation-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}

.responsiveness-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  border: 1px solid rgba(50,146,57,.22);
  border-radius: var(--radius-pill);
  background: rgba(50,146,57,.08);
  color: var(--trelis-green);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.reset-btn {
  border: 1px solid #d9e2ec;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.reset-btn:hover {
  color: var(--trelis-blue);
  border-color: var(--trelis-blue);
  background: rgba(13,87,155,.05);
}

.transcript-panel {
  height: min(48vh, 520px);
  min-height: 320px;
  overflow: auto;
  padding: clamp(1rem, 3vw, 1.5rem);
  scroll-behavior: smooth;
}

.transcript-panel:empty::before {
  content: "Your conversation will appear here.";
  display: grid;
  min-height: 100%;
  place-items: center;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

.turn {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.turn-user {
  align-items: flex-end;
}

.turn-assistant {
  align-items: flex-start;
}

.role {
  margin: 0 0 0.28rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.text {
  max-width: min(78%, 42rem);
  border: 1px solid #d9e2ec;
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-primary);
  line-height: 1.48;
  padding: 0.82rem 1rem;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

.turn-user .text {
  border-color: rgba(13,87,155,.20);
  background: var(--trelis-blue);
  color: #ffffff;
}

.turn-pending .text {
  opacity: 0.62;
}

.diagnostics-panel {
  margin-top: 1.5rem;
  border: 1px solid #d9e2ec;
  border-radius: var(--radius-lg);
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 3vw, 1.4rem);
}

.panel-title {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 800;
}

.diagnostic-badge {
  border-radius: var(--radius-pill);
  background: rgba(50,146,57,.10);
  color: var(--trelis-green);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  text-transform: uppercase;
}

.diag-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.diag-card,
.settings-panel,
.event-log-wrap {
  border: 1px solid #d9e2ec;
  border-radius: var(--radius-md);
  background: var(--bg-white);
  padding: 1rem;
}

.diag-value {
  min-height: 1.45rem;
  margin-top: 0.5rem;
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.form-control {
  border-color: #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  min-height: 2.45rem;
}

.form-control:focus {
  border-color: rgba(13,87,155,.68);
  box-shadow: 0 0 0 0.2rem rgba(13,87,155,.12);
}

.event-log {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow: auto;
}

.event-row {
  border-radius: var(--radius-sm);
  background: var(--bg-light);
  color: var(--trelis-gray);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.5rem 0.6rem;
  overflow-wrap: anywhere;
}

@keyframes listenPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(50,146,57,.24);
    transform: translate(-50%, -50%) scale(0.96);
  }
  100% {
    box-shadow: 0 0 0 24px rgba(50,146,57,0);
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes speakPulse {
  from {
    box-shadow: 0 0 0 6px rgba(247,147,26,.16);
    transform: translate(-50%, -50%) scale(0.98);
  }
  to {
    box-shadow: 0 0 0 18px rgba(247,147,26,.04);
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@media (max-width: 760px) {
  .app-header {
    align-items: center !important;
    flex-direction: row;
    gap: 0.75rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .status-pill {
    min-width: 5.85rem;
  }

  .mic-button {
    width: 92px;
    height: 92px;
    gap: 0.25rem;
    padding: 0.75rem 0.55rem 0.65rem;
  }

  .mic-wrap {
    width: 124px;
    height: 124px;
  }

  .status-orbit {
    width: 108px;
    height: 108px;
  }

  .mic-glyph {
    width: 23px;
    height: 34px;
    margin-bottom: 0.9rem;
  }

  .mic-label {
    font-size: 0.66rem;
  }

  .text {
    max-width: 92%;
  }

  .conversation-head {
    align-items: flex-start;
  }

  .conversation-actions {
    flex-wrap: wrap;
  }

  .responsiveness-badge {
    font-size: 0.68rem;
    padding-inline: 0.5rem;
  }

  .diag-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Demo sign-in gate ------------------------------------------------------------------------ */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
  background:
    radial-gradient(circle at 50% -10rem, rgba(13,87,155,.12), transparent 30rem),
    linear-gradient(180deg, var(--bg-white) 0%, var(--bg-light) 46%, var(--bg-subtle) 100%);
}

.login-card {
  width: min(100%, 400px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--bg-white);
  border: 1px solid rgba(13,87,155,.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-card::before {
  content: "";
  height: 3px;
  margin: -0.25rem -0.5rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--trelis-spectrum);
}

.auth-pending-card {
  align-items: center;
}

.auth-retry { margin-top: 0; }

.auth-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid rgba(13,87,155,.14);
  border-top-color: var(--trelis-blue);
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation: none; }
}

.login-brand {
  justify-content: center;
  gap: .6rem;
}

.login-brand .brand-mark {
  width: 40px;
  height: 40px;
}

.login-sub {
  margin: -.25rem 0 .25rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: .95rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.login-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.login-input {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid #d7e0ea;
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-input:focus {
  outline: none;
  border-color: var(--trelis-blue);
  box-shadow: 0 0 0 3px rgba(13,87,155,.12);
}

.login-submit {
  margin-top: .25rem;
  padding: .75rem 1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--trelis-blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: filter var(--transition), transform var(--transition);
}

.login-submit:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.login-submit:disabled {
  opacity: .65;
  cursor: default;
}

.login-alt {
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  color: #718096;
  text-align: center;
}
.login-alt a { color: #0d579b; font-weight: 600; }

.login-error {
  margin: 0;
  text-align: center;
  color: #c0392b;
  font-size: .9rem;
  font-weight: 600;
}

/* --- post-session feedback card --------------------------------------------------------- */
.feedback-card[hidden] { display: none; }   /* class display:flex would beat the UA [hidden] rule */
.feedback-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.feedback-title {
  font-weight: 600;
  color: var(--text-primary);
}
.feedback-thumbs {
  display: flex;
  gap: 10px;
}
.fb-thumb {
  font-size: 1.3rem;
  line-height: 1;
  padding: 8px 16px;
  border: 1px solid var(--bg-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-light);
  transition: var(--transition);
}
.fb-thumb:hover { box-shadow: var(--shadow-sm); }
.fb-thumb.selected {
  border-color: var(--trelis-blue);
  background: var(--bg-subtle);
  box-shadow: inset 0 0 0 1px var(--trelis-blue);
}
.fb-select-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fb-select-label {
  min-width: 64px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.fb-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* Provider toggle: reuses the .fb-chip idiom; it drives the NEXT session's backend, so it
   locks (dimmed, inert) while a session is live — switching mid-call isn't a thing. */
.provider-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.provider-chip:disabled { opacity: 0.55; pointer-events: none; }
.search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.search-toggle input { width: 18px; height: 18px; accent-color: var(--trelis-blue); }
.search-toggle:has(input:disabled) { opacity: 0.55; }
.fb-chip {
  font-size: 0.85rem;
  line-height: 1;
  padding: 7px 14px;
  border: 1px solid var(--bg-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-light);
  color: var(--text-secondary);
  transition: var(--transition);
}
.fb-chip:hover { box-shadow: var(--shadow-sm); }
.fb-chip.selected {
  border-color: var(--trelis-blue);
  background: var(--bg-subtle);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--trelis-blue);
}
.feedback-text {
  border: 1px solid var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  color: var(--text-primary);
  resize: vertical;
}
.feedback-text:focus { outline: 2px solid var(--trelis-blue); outline-offset: 1px; }
.feedback-actions {
  display: flex;
  gap: 10px;
}
.feedback-send {
  padding: 8px 22px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--trelis-blue);
  color: #fff;
  font-weight: 600;
  transition: var(--transition);
}
.feedback-send:disabled { opacity: 0.45; }
.feedback-skip {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
}
.feedback-skip:hover { color: var(--text-secondary); }

/* Header sign-out: a text action, not a competing button. */
.link-button {
  background: none; border: 0; padding: 0;
  font-size: 0.85rem; color: #718096; cursor: pointer; text-decoration: underline;
}
.link-button:hover { color: #0d579b; }

/* Labelled control cluster (voice picker) under the mic button. */
.control-group { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.control-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: #718096;
}
.search-toggle input:disabled + span { opacity: 0.5; }

/* ---------------------------------------------------------------------------------------
   Account menu (header dropdown) + the API & Billing page (account.html).
   Reuses the design tokens above; no new colours beyond the brand spectrum.
--------------------------------------------------------------------------------------- */

/* Header "Account ▾" dropdown — a native <details> so it needs no JS and stays accessible. */
.account-menu { position: relative; }
.account-summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 12px;
  border: 1px solid #d9e2ec;
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  user-select: none;
}
.account-summary::-webkit-details-marker { display: none; }
.account-summary::after { content: " ▾"; color: var(--text-muted); }
.account-menu[open] .account-summary { border-color: var(--trelis-blue); color: var(--trelis-blue); }
.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 176px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--bg-white);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 20;
}
.account-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}
.account-item:hover { background: var(--bg-subtle); color: var(--trelis-blue); }

/* Let the global header breathe; the account controls keep a narrower reading measure below it. */
.account-shell { width: min(100%, 980px); padding-bottom: 3rem; }
.account-content { width: min(100%, 760px); margin: 1.75rem auto 0; }
.brand-link { text-decoration: none; }
.account-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
/* The mono eyebrow is the site's instrumentation voice — measurement is the brand. */
.account-eyebrow, .section-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin: 0 0 0.3rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--trelis-blue);
}
.account-sub { margin: 0; min-height: 1.35em; color: var(--text-muted); font-size: 0.9rem; }
.account-signout { flex: 0 0 auto; margin-bottom: 0.1rem; }

.account-error {
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: #fdecea;
  color: #a83228;
  font-size: 0.9rem;
}

.account-card {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 1rem;
  background: var(--bg-white);
  border: 1px solid rgba(13,87,155,.11);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(31, 48, 69, .07);
}
.balance-card {
  background:
    linear-gradient(120deg, rgba(13,87,155,.055), transparent 48%),
    var(--bg-white);
}
.account-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.4rem; }
.account-h2 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.account-note { margin: 0.5rem 0 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.account-footer { margin-top: 1.25rem; color: var(--text-muted); font-size: 0.85rem; text-align: center; }
.page-footer { margin-top: 0.5rem; color: var(--text-muted); font-size: 0.9rem; }
/* The site's one prose-link style — landing, docs and account share it. */
.account-footer a, .account-note a, .page-footer a, .doc-body a,
.land-note a, .stat-footnote a, .price-points a { color: var(--trelis-blue); font-weight: 600; }

.mode-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: #eef5fb;
  color: var(--trelis-blue);
  border: 1px solid rgba(13,87,155,.2);
}
.mode-badge.mode-live { background: rgba(50,146,57,.09); color: #27742d; border-color: rgba(50,146,57,.25); }

.balance-line { margin: 0.15rem 0 0; display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.balance-amount { font-family: var(--font-display); font-size: clamp(2.25rem, 5vw, 3rem); line-height: 1.1; font-weight: 800; color: var(--text-primary); }
.balance-sub { color: var(--text-muted); font-size: 0.9rem; }

.pack-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.1rem; }

/* Shared button treatments for this page. */
.btn-primary, .btn-secondary {
  min-height: 42px;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.btn-primary { background: var(--trelis-blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--trelis-blue-dark); transform: translateY(-1px); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.5; cursor: default; }
.btn-secondary { background: var(--bg-white); color: var(--trelis-blue); border-color: rgba(13,87,155,.35); }
.btn-secondary:hover:not(:disabled) { background: var(--trelis-blue-wash); border-color: rgba(13,87,155,.55); }
.btn-primary:focus-visible, .btn-secondary:focus-visible, .link-button:focus-visible {
  outline: 3px solid rgba(13,87,155,.2);
  outline-offset: 3px;
}

/* API keys. */
.key-create { display: flex; gap: 0.6rem; margin-top: 1.15rem; }
.key-create .login-input { flex: 1 1 220px; }
.key-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.key-empty { margin-top: 0; }
.key-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  min-height: 52px;
  padding: 0.65rem 0.9rem;
  border: 1px solid #e6edf3;
  border-radius: var(--radius-sm);
  background: #fbfcfe;
}
.key-revoked { opacity: 0.5; }
.key-meta { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.key-name { font-weight: 600; color: var(--text-primary); }
.key-hint { color: var(--text-muted); font-size: 0.85rem; }
.key-when { color: var(--text-muted); font-size: 0.8rem; }
.key-revoke { white-space: nowrap; }

.new-key {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(50,146,57,.28);
  border-radius: var(--radius-md);
  background: rgba(50,146,57,.07);
}
.new-key-label { margin: 0 0 0.5rem; font-size: 0.85rem; font-weight: 700; color: #27742d; }
.new-key-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.new-key-value {
  flex: 1 1 260px;
  padding: 0.5rem 0.7rem;
  background: var(--bg-white);
  border: 1px solid #cfe0dc;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  word-break: break-all;
  color: var(--text-primary);
}

/* Hide the account page's data cards until the first /billing load resolves — a signed-out
   visitor is redirected to sign in before any empty shell paints. The header stays visible. */
.account-loading .account-card,
.account-loading .account-intro,
.account-loading .account-footer { visibility: hidden; }

@media (max-width: 760px) { .account-content { margin-top: 1rem; } }

@media (max-width: 520px) {
  .account-intro { align-items: center; }
  .account-card { padding: 1.15rem; }
  .key-create { flex-direction: column; }
  .key-create .login-input { flex-basis: auto; }
  .key-create .btn-primary { width: 100%; }
  .key-row { align-items: flex-start; }
  .key-meta { gap: 0.35rem 0.65rem; }
}

/* ===== Utilities (Bootstrap replacement — only the classes the markup actually uses).
   The mb-/mt- spacing utilities keep !important to match the Bootstrap semantics the
   pages were built against. (NB: never write a star-slash sequence inside this comment —
   it terminates the comment early and the stray text swallows the NEXT rule.) */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-3 { gap: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.small { font-size: 0.875em; }
.text-muted { color: var(--text-muted); }
/* Element defaults Bootstrap's reboot used to provide. The [hidden] rule is LOAD-BEARING:
   JS toggles .hidden on elements whose classes set display (login-gate is display:grid,
   search-toggle inline-flex, …) — without !important the class wins and hidden does nothing
   (a signed-in user would be stuck behind the login overlay forever). */
[hidden] { display: none !important; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0 0 0.5rem; }
summary { cursor: pointer; }

/* ===== Landing page ===== */
.land-shell { padding-bottom: 2rem; }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.site-nav-link:hover { color: var(--trelis-blue); }
.site-nav-link.active {
  color: var(--trelis-blue);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}
.site-nav-cta {
  white-space: nowrap;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--trelis-blue);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background var(--transition), transform var(--transition);
}
.site-nav-cta:hover { background: var(--trelis-blue-dark); transform: translateY(-1px); }
.site-nav-link:focus-visible, .site-nav-cta:focus-visible,
.btn-cta:focus-visible, .btn-cta-ghost:focus-visible {
  outline: 3px solid rgba(13,87,155,.2);
  outline-offset: 4px;
}
@media (max-width: 860px) {
  .site-nav { gap: 0.9rem; }
  .site-nav-link { display: none; }   /* mobile: brand + API-key CTA; sections remain in-page */
}
@media (max-width: 520px) {
  .app-shell { padding-inline: 1rem; }
  .app-title { font-size: 1.85rem; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-lockup { gap: 0.55rem; }
  .site-nav-cta { padding: 0.48rem 0.85rem; font-size: 0.85rem; }
}

.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 1rem; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-bottom: clamp(2.4rem, 6vw, 4.2rem);
}
.hero-kicker {
  margin: 0 0 1rem;
  color: var(--trelis-blue);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* The hero's signature: the same three-color bar language as the call button and favicon,
   quiet and unlabelled — a mark, not an infographic. */
.hero-trace {
  width: min(100%, 260px);
  justify-self: end;
}
.trace-visual {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  height: 108px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d9e2ec;
}
.trace-bars {
  display: flex;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 6px;
  height: 100%;
}
.trace-bars i {
  width: 8px;
  border-radius: 3px;
  animation: hero-eq 2.2s ease-in-out infinite;
}
.trace-bars i:nth-child(2) { animation-delay: -.6s; }
.trace-bars i:nth-child(3) { animation-delay: -1.2s; }
.trace-speak i { background: var(--trelis-orange); }
.trace-listen i { background: var(--trelis-green); }
.trace-reply i { background: var(--trelis-blue); }
@keyframes hero-eq {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) { .trace-bars i { animation: none; } }
.hero-title {
  margin: 0 0 1rem;
  font-size: clamp(2.7rem, 6.6vw, 4.65rem);
  font-weight: 800;
  line-height: .94;
  letter-spacing: -0.045em;
  color: var(--text-primary);
}
.hero-sub {
  margin: 0 0 1.6rem;
  max-width: 58ch;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.hero-copy .cta-row { margin-bottom: 0; }
.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2.2rem; }
.section-cta { margin-top: 1.2rem; margin-bottom: 0; }
.btn-cta, .btn-cta-ghost {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}
.btn-cta { background: var(--trelis-blue); color: #fff; }
.btn-cta:hover { background: var(--trelis-blue-dark); transform: translateY(-1px); }
.btn-cta-ghost {
  color: var(--trelis-blue);
  border: 1.5px solid rgba(13,87,155,.35);
  background: var(--bg-white);
}
.btn-cta-ghost:hover { background: var(--trelis-blue-wash); }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
@media (max-width: 760px) { .stat-strip { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.7rem;
  }
  .hero-trace {
    width: min(80vw, 320px);
    justify-self: center;
  }
  .hero-title { font-size: clamp(2.65rem, 13vw, 4rem); }
}
/* One card chrome for the landing surfaces. */
.stat, .pricing-card, .bench-table, .why-card {
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.stat { padding: 1rem 1.2rem; }
.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.stat-unit { font-size: 1.05rem; font-weight: 700; color: var(--text-muted); margin-left: 2px; }
.stat-label { display: block; margin-top: 0.2rem; font-size: 0.83rem; line-height: 1.45; color: var(--text-muted); }
.stat-footnote { margin: 0.9rem 0 0; font-size: 0.83rem; color: var(--text-muted); }

.land-section { margin-top: clamp(2.6rem, 6vw, 4rem); }
.land-section-first { margin-top: clamp(1.2rem, 3vw, 2rem); }
/* A signed-out sign-out… isn't one: the button variant matches the link styling. */
button.site-nav-link { background: none; border: 0; padding: 0; cursor: pointer; }
.land-h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.land-note { max-width: 68ch; color: var(--text-secondary); line-height: 1.65; }
/* Inline-code chip, shared by the landing sections and the docs prose. */
.land-section code, .doc-body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
  background: var(--bg-subtle);
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--trelis-blue-dark);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.4rem;
}
@media (max-width: 860px) { .why-grid { grid-template-columns: 1fr; } }
.why-card { padding: 1.15rem 1.3rem; }
.why-card h3 { margin: 0 0 0.45rem; font-family: var(--font-body); font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.why-card p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--text-secondary); }

/* The two objections everyone raises, answered in the strategy doc's own words. */
.qa {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid #e6edf3;
}
@media (max-width: 860px) { .qa { grid-template-columns: 1fr; } }
.qa-item h3 { margin: 0 0 0.35rem; font-family: var(--font-body); font-size: 1rem; font-weight: 700; font-style: italic; color: var(--text-primary); }
.qa-item p { margin: 0; font-size: 0.94rem; line-height: 1.6; color: var(--text-secondary); }
.qa-item a { color: var(--trelis-blue); font-weight: 600; }

.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
}
@media (max-width: 860px) { .how-grid { grid-template-columns: 1fr; } }
/* Real sequence (connect → stream → play), so the numbers carry information. */
.how-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.how-steps li { position: relative; padding-left: 2.55rem; counter-increment: step; }
.how-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: rgba(13,87,155,.1);
  color: var(--trelis-blue);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.how-steps strong { color: var(--text-primary); }

/* Stripe-style framed code panel: window bar + filename tab + copy. */
.code-panel {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #0f1b1a;
}
.code-panel-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.95rem;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.code-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.16); }
.code-panel-tab {
  margin-left: 0.4rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.74rem;
  color: #9fb8b3;
}
.code-panel .copy-btn { position: static; margin-left: auto; opacity: 0.75; }
.code-panel .copy-btn:hover { opacity: 1; }
.code-panel .code-block { margin: 0; box-shadow: none; border-radius: 0; background: transparent; }

/* The dark code block, shared by the landing snippet and the docs page.
   position:relative is load-bearing — .copy-btn positions against it. */
.code-block {
  position: relative;
  margin: 0;
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  background: #0f1b1a;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.code-block code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  background: none;
  padding: 0;
  color: #cfe0dc;
}
.tok-kw { color: #7dd3c8; }
.tok-str { color: #e8b96b; }
.tok-com { color: #6b8a85; }

.bench-h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}
.bench-when { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-left: 0.4rem; white-space: nowrap; }
.bench-scroll { overflow-x: auto; }
/* One table base for landing benchmarks and docs prose tables. */
.bench-table, .doc-body table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.bench-table th, .bench-table td,
.doc-body th, .doc-body td { text-align: left; padding: 0.6rem 0.9rem; border-bottom: 1px solid #e6edf3; }
.bench-table th, .doc-body th { font-weight: 700; color: var(--text-primary); }
.doc-body table { margin: 0.8rem 0; }
.doc-body td code { white-space: nowrap; }
.bench-table { overflow: hidden; }   /* clips row borders to the card radius */
.bench-table tbody tr:last-child td { border-bottom: none; }
.bench-table th { background: var(--bg-light); font-size: 0.85rem; }
.bench-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bench-us td { background: rgba(13,87,155,.06); font-weight: 700; color: var(--text-primary); }
.bench-model {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}
.bench-caveat { margin-top: 1.2rem; font-size: 0.88rem; }

.pricing-card { padding: 1.4rem 1.6rem; max-width: 560px; }
.price-points {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.94rem;
}

.data-promise {
  max-width: 760px;
  padding: clamp(1.25rem, 3vw, 1.8rem);
  border-left: 4px solid var(--trelis-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: linear-gradient(110deg, rgba(13,87,155,.09), rgba(255,255,255,.86) 62%);
  color: var(--text-secondary);
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
}
.data-promise p:last-child { margin-bottom: 0; }
.data-promise strong { color: var(--text-primary); }

.site-footer {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-top: 1.2rem;
  border-top: 1px solid #e6edf3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.site-footer-nav { display: flex; gap: 1.1rem; }
.site-footer-nav a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.site-footer-nav a:hover { color: var(--trelis-blue); }

/* ===== Docs (quickstart) ===== */
.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 2.2rem;
  align-items: start;
}
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; } .docs-toc { display: none; } }
.docs-toc {
  position: sticky;
  top: 1.2rem;
  font-size: 0.85rem;
}
.docs-toc-label { margin: 0 0 0.5rem; }   /* pairs with the shared .eyebrow class in markup */
.docs-toc a {
  display: block;
  padding: 0.22rem 0;
  color: var(--text-secondary);
  text-decoration: none;
}
.docs-toc a:hover { color: var(--trelis-blue); }
.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  color: #cfe0dc;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,.14); }


/* Developer docs: shared by the short guide and the complete reference. */
.docs-hero { padding: 2.2rem 0 1rem; }
.docs-section { padding-top: 2rem; }
.doc-title { margin: .2rem 0 .65rem; font-size: clamp(2rem, 5vw, 2.7rem); color: var(--text-primary); }
.doc-lead { max-width: 70ch; font-size: 1.05rem; color: var(--text-secondary); line-height: 1.65; }
.doc-updated { margin: 0 0 1.4rem; color: var(--text-muted); font-size: .84rem; }
.doc-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; margin: 1rem 0; }
.doc-card { padding: 1rem 1.1rem; border: 1px solid var(--card-border); border-radius: var(--radius-md); background: var(--bg-white); box-shadow: var(--shadow-sm); }
.doc-card h2, .doc-card h3 { margin: 0 0 .3rem; font-size: 1.04rem; color: var(--text-primary); }
.doc-card p { margin: 0; font-size: .92rem; color: var(--text-secondary); }
.support { display: inline-block; margin-bottom: .45rem; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.support-primary { color: var(--trelis-green); background: rgba(50,146,57,.11); }
.support-advanced { color: #8a5800; background: rgba(247,147,26,.13); }
.support-planned { color: var(--text-muted); background: var(--bg-subtle); }
.quickstart-steps { margin: 1rem 0; padding-left: 1.4rem; color: var(--text-secondary); }
.quickstart-steps li { margin: .75rem 0; padding-left: .25rem; line-height: 1.55; }
.reference-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .8rem; margin: 1rem 0; }
.reference-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; border: 1px solid var(--card-border); border-radius: var(--radius-md); background: var(--bg-white); box-shadow: var(--shadow-sm); text-decoration: none; }
.reference-card:hover { border-color: var(--trelis-blue); }
.reference-card strong { color: var(--text-primary); }
.reference-card span { color: var(--text-secondary); font-size: .9rem; line-height: 1.45; }
.integration-card .support { align-self: flex-start; }
.doc-body { line-height: 1.65; color: var(--text-secondary); min-width: 0; }
.doc-body h2 { margin: 2.7rem 0 .65rem; font-size: 1.35rem; font-weight: 800; color: var(--text-primary); scroll-margin-top: 1rem; }
.doc-body h2:first-of-type { margin-top: .6rem; }
.doc-body h3 { margin: 1.55rem 0 .45rem; font-size: 1.04rem; color: var(--text-primary); scroll-margin-top: 1rem; }
.doc-body h2 a, .doc-body h3 a { color: inherit; text-decoration: none; }
.doc-body h2 a:hover::after, .doc-body h3 a:hover::after { content: " #"; color: var(--trelis-blue); }
.doc-body p { margin: .55rem 0; }
.doc-body ul { padding-left: 1.25rem; }
.doc-body li { margin: .35rem 0; }
.doc-body .code-block { margin: .85rem 0; }
.doc-callout { margin: 1rem 0; padding: .9rem 1rem; border-left: 3px solid var(--trelis-blue); border-radius: 0 8px 8px 0; background: rgba(13,87,155,.07); }
.doc-callout strong { color: var(--text-primary); }
.api-signature { color: var(--text-primary); font-weight: 700; overflow-wrap: anywhere; }
.doc-body td { vertical-align: top; }
.doc-body td:first-child { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.doc-footer { margin-top: 2.2rem; }
.playground-toolbar, .account-toolbar { min-height: 2.7rem; margin: -.65rem 0 1rem; }
.account-toolbar { display: flex; justify-content: flex-end; }
@media (max-width:700px) {
  .doc-grid, .reference-grid { grid-template-columns:1fr; }
  .doc-body td:first-child { white-space:normal; }
}

/* ===== Landing page: warm technical editorial ===== */
.landing-page {
  --landing-ink: #11110f;
  --landing-paper: #f8f4ec;
  --landing-paper-deep: #f0eade;
  --landing-rule: rgba(17,17,15,.16);
  --landing-orange: #f7931a;
  --landing-orange-ink: #a94f00;
  --landing-green: #329239;
  --landing-green-ink: #216d28;
  --landing-blue: #0d579b;
  background:
    radial-gradient(circle at 52% 20%, rgba(255,255,255,.9), transparent 31rem),
    var(--landing-paper);
  color: var(--landing-ink);
}
.landing-page .spectrum-bar {
  position: fixed;
  right: 0;
  left: 0;
  height: 2px;
}
.landing-page .land-shell {
  width: min(100%, 1480px);
  padding: 0 clamp(1.5rem, 4.7vw, 4.75rem) 2.4rem;
}
.landing-page .app-header {
  min-height: 64px;
  margin: 0 calc(clamp(1.5rem, 4.7vw, 4.75rem) * -1);
  padding: 0 clamp(1.5rem, 4.7vw, 4.75rem);
  border-bottom: 1px solid var(--landing-rule);
}
.landing-page .brand-lockup { gap: .55rem; }
.landing-page .brand-mark { width: 29px; height: 29px; }
.landing-page .app-title {
  color: var(--landing-ink);
  font-family: var(--font-body);
  font-size: 1.33rem;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}
.landing-page .site-nav { gap: clamp(.85rem, 2.4vw, 2.25rem); }
.landing-page .site-nav-link {
  color: var(--landing-ink);
  font-size: .78rem;
  font-weight: 650;
}
.landing-page .site-nav-link:hover { color: var(--landing-orange); }
.landing-page .site-nav-cta {
  padding: .68rem 1.05rem;
  border-radius: 7px;
  background: var(--landing-orange);
  color: var(--landing-ink);
  font-size: .78rem;
  font-weight: 750;
}
.landing-page .site-nav-cta:hover { background: #df7d09; color: var(--landing-ink); }

.landing-eyebrow {
  margin: 0 0 .75rem;
  color: var(--landing-orange-ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.landing-hero {
  display: grid;
  grid-template-columns: minmax(330px, .86fr) minmax(550px, 1.45fr);
  gap: clamp(2.2rem, 5vw, 6rem);
  align-items: center;
  min-height: 485px;
  padding: clamp(2.7rem, 6vw, 5.4rem) 0 2.6rem;
}
.landing-hero-copy h1,
.landing-product h2,
.landing-evidence h2,
.landing-pricing h2,
.landing-detail h2,
.landing-objections h2 {
  color: var(--landing-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
}
.landing-hero-copy h1 {
  margin: 0 0 1.35rem;
  font-size: clamp(4.2rem, 6.8vw, 6.35rem);
  letter-spacing: -.045em;
  line-height: .81;
}
.landing-hero-copy h1 em {
  color: var(--landing-orange);
  font-style: normal;
}
.landing-lede,
.landing-support {
  max-width: 39ch;
  color: #292925;
  font-size: .96rem;
  line-height: 1.55;
}
.landing-lede { margin: 0 0 .45rem; font-weight: 600; }
.landing-support { margin: 0 0 1.45rem; }
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}
.landing-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .68rem 1.05rem;
  border: 1px solid var(--landing-ink);
  border-radius: 7px;
  color: var(--landing-ink);
  font-size: .86rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.landing-button:hover { transform: translateY(-2px); }
.landing-button-primary {
  border-color: var(--landing-orange);
  background: var(--landing-orange);
  color: var(--landing-ink);
  box-shadow: 0 7px 20px rgba(247,147,26,.18);
}
.landing-button-primary:hover { background: #df7d09; color: var(--landing-ink); }
.landing-button-secondary { background: rgba(255,255,255,.42); }
.landing-button-secondary:hover { background: #fff; }
.button-wave {
  display: inline-flex;
  height: 19px;
  align-items: center;
  gap: 2px;
}
.button-wave i {
  display: block;
  width: 2px;
  height: 45%;
  border-radius: 3px;
  background: currentColor;
  animation: landing-wave 1.2s ease-in-out infinite alternate;
}
.button-wave i:nth-child(2) { height: 100%; animation-delay: -.3s; }
.button-wave i:nth-child(3) { height: 65%; animation-delay: -.6s; }
.button-wave i:nth-child(4) { height: 85%; animation-delay: -.9s; }
.button-wave i:nth-child(5) { height: 36%; animation-delay: -.45s; }
@keyframes landing-wave {
  from { transform: scaleY(.55); }
  to { transform: scaleY(1); }
}
.landing-aside {
  margin: .55rem 0 0 .35rem;
  color: #484741;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: .82rem;
  font-style: italic;
  transform: rotate(-1.5deg);
}

.turn-story {
  position: relative;
  min-width: 0;
  margin: 1.8rem 0 0;
  padding-top: 1.9rem;
}
.turn-story figcaption {
  position: absolute;
  top: -1.15rem;
  left: -3rem;
  color: #292925;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.05;
  transform: rotate(-5deg);
}
.turn-story figcaption::after {
  content: "↘\FE0E";
  display: inline-block;
  margin-left: .45rem;
  font-family: Georgia, serif;
  font-size: 1.55rem;
  transform: rotate(13deg);
}
.turn-card {
  position: relative;
  min-height: 0;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--landing-rule);
  border-radius: 16px;
  background: rgba(255,255,255,.3);
}
.exchange-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .15rem .2rem .8rem;
  border-bottom: 1px solid var(--landing-rule);
}
.exchange-live,
.exchange-note {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
}
.exchange-live { color: var(--landing-green-ink); }
.exchange-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--landing-green);
  box-shadow: 0 0 0 4px rgba(75,145,68,.12);
}
.exchange-note { color: #737169; font-weight: 500; }
.exchange-thread {
  display: grid;
  gap: .55rem;
  padding: .85rem .1rem .1rem;
}
.exchange-turn {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: .65rem;
  max-width: 88%;
}
.exchange-turn-user { justify-self: end; width: 84%; }
.exchange-turn-converse { justify-self: start; width: 88%; }
.speaker-icon {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.speaker-user::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.speaker-user::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 9px;
  width: 18px;
  height: 9px;
  border-radius: 12px 12px 5px 5px;
  background: currentColor;
}
.speaker-converse::before,
.speaker-converse::after {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 3px;
  background: currentColor;
}
.speaker-converse::before { left: 12px; box-shadow: 5px -4px currentColor, 10px 3px currentColor; }
.speaker-converse::after { left: 9px; height: 9px; top: 14px; box-shadow: 16px -2px currentColor; }
.exchange-turn-user .speaker-icon { color: var(--landing-orange); }
.exchange-turn-converse .speaker-icon { color: var(--landing-green-ink); }
.exchange-copy {
  position: relative;
  min-width: 0;
  padding: .55rem .75rem .62rem;
  border: 1px solid rgba(17,17,15,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.68);
}
.exchange-turn-user .exchange-copy { background: rgba(242,146,49,.1); }
.exchange-turn-converse .exchange-copy { background: rgba(75,145,68,.09); }
.exchange-name {
  display: block;
  margin-bottom: .16rem;
  color: #737169;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
}
.exchange-copy p {
  margin: 0;
  color: var(--landing-ink);
  font-size: .77rem;
  line-height: 1.35;
}
.exchange-cut-short .exchange-copy {
  border-color: rgba(75,145,68,.2);
  border-bottom-right-radius: 2px;
}
.exchange-cut-short .exchange-copy::after {
  content: "yields";
  position: absolute;
  right: .55rem;
  bottom: -.42rem;
  border: 1px solid rgba(13,87,155,.2);
  border-radius: 999px;
  background: var(--landing-paper);
  color: var(--landing-blue);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .45rem;
  font-weight: 700;
  padding: .1rem .35rem;
  text-transform: uppercase;
}
.exchange-interruption {
  display: flex;
  align-items: center;
  gap: .65rem;
  justify-self: end;
  width: min(82%, 430px);
  margin: -.1rem 0 0;
  padding: .55rem .7rem;
  border-radius: 10px;
  background: var(--landing-orange);
  color: #fff;
}
.exchange-interruption span {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .43rem;
  font-weight: 700;
  padding: .16rem .36rem;
  text-transform: uppercase;
}
.exchange-interruption strong {
  min-width: 0;
  font-size: .72rem;
  line-height: 1.3;
}
.exchange-final { margin-top: -.05rem; }
.exchange-final .exchange-copy {
  border-color: rgba(75,145,68,.24);
}

.landing-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border-radius: 11px;
  background: var(--landing-ink);
  color: #fff;
}
.landing-metric {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: .9rem;
  align-items: center;
  min-height: 108px;
  padding: 1.25rem clamp(1rem, 2.5vw, 2rem);
  color: inherit;
  text-decoration: none;
}
.landing-metric + .landing-metric::before {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 0;
  width: 1px;
  background: rgba(255,255,255,.22);
}
.landing-metric:hover { background: rgba(255,255,255,.035); }
.metric-index {
  align-self: start;
  color: rgba(255,255,255,.38);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .57rem;
}
.metric-number {
  color: var(--landing-orange);
  font-family: var(--font-body);
  font-size: clamp(2.1rem, 3.2vw, 3rem);
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: 1;
}
.metric-number small { margin: 0 .08em; font-size: .45em; letter-spacing: 0; }
.metric-copy {
  color: #c7c6c0;
  font-size: .78rem;
  line-height: 1.5;
}
.metric-copy strong { display: block; color: #fff; font-size: .86rem; }
.metric-caveat {
  margin: .65rem 0 0;
  color: #716f67;
  font-size: .76rem;
  text-align: right;
}
.metric-caveat a { color: var(--landing-blue); font-weight: 700; }

.landing-product {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  column-gap: clamp(2rem, 6vw, 6rem);
  row-gap: clamp(3rem, 5vw, 4.5rem);
  align-items: stretch;
  padding: clamp(3.8rem, 6vw, 5.25rem) 0;
}
.landing-product h2,
.landing-evidence h2,
.landing-detail h2 {
  margin: 0 0 1.05rem;
  font-size: clamp(2rem, 3.5vw, 3rem);
  letter-spacing: -.025em;
  line-height: .98;
}
.capability-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.4rem, 2.5vw, 2.2rem) clamp(1.6rem, 4vw, 4rem);
  align-self: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.capability-intro {
  max-width: 42ch;
  margin: .9rem 0 0;
  color: #4e4d47;
  font-size: .95rem;
  line-height: 1.65;
}
.capability-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: .7rem;
}
.capability-mark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--landing-orange);
  border-radius: 50%;
  color: var(--landing-orange);
  font-size: .85rem;
}
.capability-list strong { display: block; margin-bottom: .14rem; font-size: .88rem; }
.capability-list p {
  margin: 0;
  color: #4e4d47;
  font-size: .875rem;
  line-height: 1.6;
}
.playground-preview {
  position: relative;
  display: flex;
  min-height: 430px;
  flex-direction: column;
  padding: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--landing-rule);
  border-radius: 16px;
  background: rgba(255,255,255,.31);
  color: var(--landing-ink);
  text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}
.playground-preview:hover { background: rgba(255,255,255,.64); transform: translateY(-3px); }
.preview-status {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #55534d;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.preview-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--landing-green); }
.playground-preview h3 {
  margin: .65rem 0 2.1rem;
  color: var(--landing-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.05;
}
.preview-wave {
  display: flex;
  height: 70px;
  align-items: center;
  margin: auto 0 1.2rem;
}
.preview-segment {
  display: flex;
  height: 54px;
  flex: 1;
  align-items: center;
  gap: 3px;
}
.preview-segment i {
  flex: 1;
  height: var(--h);
  min-height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.preview-user { color: var(--landing-orange); }
.preview-ai { color: var(--landing-green); }
.preview-gap {
  position: relative;
  width: 26%;
  height: 1px;
  background: var(--landing-rule);
}
.preview-gap b {
  position: absolute;
  top: .6rem;
  left: 50%;
  color: var(--landing-blue);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .58rem;
  transform: translateX(-50%);
}
.preview-button {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  align-self: center;
  border-radius: 50%;
  background: var(--landing-orange);
  color: var(--landing-ink);
}
.preview-link {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--landing-rule);
  color: var(--landing-blue);
  font-size: .8rem;
  font-weight: 750;
}
.integration-column > p:not(.landing-eyebrow),
.evidence-copy > p:not(.landing-eyebrow),
.pricing-details > p,
.landing-detail > p:not(.landing-eyebrow),
.landing-objections p {
  color: #4e4d47;
  font-size: .9rem;
  line-height: 1.65;
}
.integration-column h2 { margin-bottom: .35rem; }
.integration-column > p:not(.landing-eyebrow) { margin: 0 0 .8rem; }
.integration-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.integration-column .landing-text-link { margin-top: auto; padding-top: .9rem; }
.landing-code {
  overflow: hidden;
  border-radius: 11px;
  background: #121817;
  box-shadow: 0 12px 32px rgba(17,17,15,.12);
}
.landing-code-bar {
  display: flex;
  justify-content: space-between;
  padding: .6rem .8rem;
  border-bottom: 1px solid rgba(255,255,255,.09);
  color: #aeb7b2;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .58rem;
}
.landing-code pre {
  margin: 0;
  padding: .9rem 1rem 1rem;
  overflow-x: auto;
  color: #cfe0dc;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(.72rem, .8vw, .82rem);
  line-height: 1.55;
}
.landing-text-link {
  display: inline-flex;
  gap: .7rem;
  align-items: center;
  margin-top: .85rem;
  color: var(--landing-blue);
  font-size: .85rem;
  font-weight: 750;
  text-decoration: none;
}
.landing-text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.landing-evidence {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: clamp(2.5rem, 8vw, 8rem);
  align-items: center;
  margin: 0 calc(clamp(1.5rem, 4.7vw, 4.75rem) * -1);
  padding: clamp(3.5rem, 5vw, 5rem) clamp(1.5rem, 4.7vw, 4.75rem);
}
.landing-evidence::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 50%;
  margin-inline: -50vw;
  background: var(--landing-paper-deep);
}
.evidence-copy > p:not(.landing-eyebrow) { max-width: 53ch; font-size: .95rem; }
.evidence-table-wrap {
  padding: clamp(1.1rem, 2.2vw, 2rem);
  border: 1px solid var(--landing-rule);
  border-radius: 14px;
  background: rgba(255,255,255,.38);
}
.evidence-caption {
  display: flex;
  justify-content: space-between;
  margin: 0 0 1.25rem;
  color: var(--landing-ink);
  font-size: .86rem;
  font-weight: 750;
}
.evidence-caption span {
  color: #77746b;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .6rem;
  font-weight: 400;
}
.evidence-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: .8rem;
  align-items: center;
  min-height: 42px;
  padding: .45rem .55rem;
  overflow: hidden;
  border-top: 1px solid var(--landing-rule);
  font-size: .86rem;
}
.evidence-row i {
  position: absolute;
  bottom: 4px;
  left: 0;
  width: var(--score);
  height: 3px;
  border-radius: 3px;
  background: rgba(17,17,15,.2);
}
.evidence-row-us { color: var(--landing-blue); font-weight: 750; }
.evidence-row-us i { background: var(--landing-orange); }
.evidence-row strong { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .76rem; }
.evidence-note { margin: .8rem 0 0; color: #68665f; font-size: .7rem; line-height: 1.5; }

.landing-pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 10vw, 10rem);
  align-items: center;
  padding: clamp(3.75rem, 6vw, 5.5rem) 0;
  border-bottom: 1px solid var(--landing-rule);
}
.landing-pricing h2 {
  display: flex;
  margin: 0;
  align-items: flex-end;
  color: var(--landing-orange);
  font-size: clamp(5.5rem, 10vw, 9.5rem);
  letter-spacing: -.06em;
  line-height: .75;
}
.landing-pricing h2 sup { align-self: flex-start; margin-top: .1em; font-family: var(--font-body); font-size: .28em; }
.landing-pricing h2 span {
  max-width: 9rem;
  margin: 0 0 .08rem .75rem;
  color: var(--landing-ink);
  font-family: var(--font-body);
  font-size: .09em;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}
.pricing-details > p { max-width: 56ch; font-size: .95rem; }
.pricing-details ul {
  display: grid;
  gap: .55rem;
  margin: 1.2rem 0 1.5rem;
  padding: 0;
  color: #41403a;
  font-size: .82rem;
  list-style: none;
}
.pricing-details li::before { content: "✓"; margin-right: .55rem; color: var(--landing-green); font-weight: 800; }

.landing-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 9vw, 9rem);
  padding: clamp(3.5rem, 5vw, 4.75rem) 0;
}
.landing-detail h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.landing-detail > p:not(.landing-eyebrow) { max-width: 55ch; font-size: .92rem; }
.landing-detail a { color: var(--landing-blue); font-weight: 700; }
.landing-objections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 8vw, 8rem);
  padding: 2.1rem 0;
  border-top: 1px solid var(--landing-rule);
  border-bottom: 1px solid var(--landing-rule);
}
.landing-objections h2 { margin: 0 0 .45rem; font-size: 1.35rem; font-style: italic; }
.landing-objections p { max-width: 56ch; margin: 0; font-size: .9rem; }
.landing-page .site-footer {
  margin-top: 0;
  padding: 2rem 0 .5rem;
  border-top: 0;
  color: #6d6b64;
  font-size: .8rem;
}
.landing-page .site-footer-nav a { color: #6d6b64; font-size: .8rem; }
.landing-page .site-footer-nav a:hover { color: var(--landing-orange); }
.landing-page .site-nav-link:focus-visible,
.landing-page .site-nav-cta:focus-visible,
.landing-button:focus-visible,
.playground-preview:focus-visible,
.landing-metric:focus-visible,
.landing-text-link:focus-visible,
.landing-page .site-footer-nav a:focus-visible {
  outline: 3px solid rgba(13,87,155,.35);
  outline-offset: 4px;
}

@media (max-width: 1120px) {
  .landing-hero {
    grid-template-columns: minmax(300px, .8fr) minmax(480px, 1.2fr);
    gap: 3rem;
  }
  .turn-story figcaption { left: -1rem; }
}
@media (max-width: 900px) {
  .landing-page .site-nav-link { display: inline; }
  .landing-page .site-nav { gap: 1rem; }
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 4rem;
  }
  .landing-hero-copy { max-width: 650px; }
  .landing-hero-copy h1 { font-size: clamp(4.5rem, 11.5vw, 6.3rem); }
  .turn-story { width: 100%; max-width: 780px; justify-self: center; }
  .turn-story figcaption { left: 1rem; }
  .landing-metrics { grid-template-columns: 1fr; }
  .landing-metric { min-height: 96px; }
  .landing-metric + .landing-metric::before { top: 0; right: 4%; bottom: auto; left: 4%; width: auto; height: 1px; }
  .landing-product { grid-template-columns: 1fr 1fr; }
  .capability-column { grid-column: 1 / -1; grid-row: auto; }
  .capability-list { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .integration-column { grid-column: auto; }
  .landing-evidence { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 720px) {
  .landing-page .land-shell { padding-inline: 1.05rem; }
  .landing-page .app-header {
    margin-inline: -1.05rem;
    padding-inline: 1.05rem;
  }
  .landing-page .site-nav-link { display: none; }
  .landing-page .app-title { font-size: 1.08rem; }
  .landing-page .brand-mark { width: 26px; height: 26px; }
  .landing-page .site-nav-cta { padding: .56rem .72rem; font-size: .7rem; }
  .landing-hero { min-height: 0; padding-top: 3.4rem; }
  .landing-hero-copy h1 { font-size: clamp(3.65rem, 18vw, 5rem); line-height: .84; }
  .landing-lede, .landing-support { font-size: .9rem; }
  .landing-actions { align-items: stretch; }
  .landing-button { min-height: 46px; }
  .turn-story { margin-top: 1rem; padding-top: 2.5rem; }
  .turn-story figcaption { top: -.25rem; left: .5rem; }
  .turn-card { min-height: 0; padding: .8rem; }
  .exchange-note { display: none; }
  .exchange-thread { gap: .5rem; padding-top: .7rem; }
  .exchange-turn { grid-template-columns: 30px minmax(0, 1fr); gap: .45rem; max-width: 96%; }
  .exchange-turn-user { width: 92%; }
  .exchange-turn-converse { width: 96%; }
  .speaker-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .speaker-user::before { top: 6px; left: 11px; width: 7px; height: 7px; }
  .speaker-user::after { bottom: 6px; left: 7px; width: 15px; }
  .speaker-converse::before { left: 9px; box-shadow: 4px -3px currentColor, 8px 2px currentColor; }
  .speaker-converse::after { left: 6px; box-shadow: 14px -2px currentColor; }
  .exchange-copy { padding: .48rem .58rem .54rem; }
  .exchange-copy p { font-size: .68rem; }
  .exchange-interruption { width: 88%; gap: .4rem; padding: .5rem .55rem; }
  .exchange-interruption strong { font-size: .64rem; }
  .landing-metric { grid-template-columns: 24px minmax(85px, .65fr) 1fr; padding: 1rem; }
  .metric-number { font-size: 2.2rem; }
  .metric-caveat { text-align: left; line-height: 1.5; }
  .landing-product { grid-template-columns: 1fr; padding: 4rem 0; }
  .capability-column, .integration-column { grid-column: auto; }
  .capability-list { grid-column: auto; grid-template-columns: 1fr; }
  .playground-preview { min-height: 350px; }
  .landing-evidence {
    margin-inline: -1.05rem;
    padding: 4rem 1.05rem;
  }
  .evidence-caption { flex-direction: column; gap: .25rem; }
  .landing-pricing { grid-template-columns: 1fr; gap: 2.2rem; }
  .landing-pricing h2 { font-size: clamp(6rem, 30vw, 8rem); }
  .landing-details, .landing-objections { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 430px) {
  .landing-hero-copy h1 { font-size: clamp(3.3rem, 17vw, 4.1rem); }
  .landing-actions { flex-direction: column; }
  .landing-button { width: 100%; }
  .exchange-interruption span { display: none; }
  .metric-copy { font-size: .72rem; }
  .metric-copy strong { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .landing-page *, .landing-page *::before, .landing-page *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Shared public-site surfaces ===== */
.site-page {
  --site-ink: #11110f;
  --site-paper: #f8f4ec;
  --site-paper-deep: #f0eade;
  --site-rule: rgba(17,17,15,.16);
  --site-orange-ink: #a94f00;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -18rem, rgba(255,255,255,.95), transparent 34rem),
    var(--site-paper);
  color: var(--site-ink);
}
.site-page .spectrum-bar {
  position: fixed;
  right: 0;
  left: 0;
  height: 2px;
}
.site-page .app-shell {
  width: min(100%, 1120px);
  padding: 0 clamp(1.25rem, 3.5vw, 3rem) 3rem;
}
.benchmarks-page .app-shell { width: min(100%, 1260px); }
.docs-page .app-shell { width: min(100%, 1180px); }
.account-page .app-shell { width: min(100%, 1100px); }
.site-page .app-header {
  min-height: 66px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--site-rule);
}
.site-page .brand-lockup { gap: .55rem; }
.site-page .brand-mark { width: 29px; height: 29px; }
.site-page .app-title {
  color: var(--site-ink);
  font-family: var(--font-body);
  font-size: 1.33rem;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}
.site-page .site-nav { gap: clamp(.85rem, 2.4vw, 2.1rem); }
.site-page .site-nav-link {
  color: var(--site-ink);
  font-size: .8rem;
  font-weight: 650;
}
.site-page .site-nav-link:hover,
.site-page .site-nav-link.active { color: var(--site-orange-ink); }
.site-page .site-nav-link.active {
  text-decoration-color: var(--trelis-orange);
  text-underline-offset: 7px;
}
.site-page .site-nav-cta {
  padding: .68rem 1.05rem;
  border-radius: 7px;
  background: var(--trelis-orange);
  color: var(--site-ink);
  font-size: .8rem;
  font-weight: 750;
}
.site-page .site-nav-cta:hover { background: #df7d09; color: var(--site-ink); }
.site-page .site-nav-cta.active { box-shadow: inset 0 0 0 2px var(--site-ink); }
.site-page .section-eyebrow,
.site-page .account-eyebrow,
.site-page .eyebrow,
.site-page .diag-label {
  color: var(--site-orange-ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.site-page .site-footer {
  color: #6d6b64;
  border-color: var(--site-rule);
  font-size: .8rem;
}
.site-page .site-footer-nav a { color: #6d6b64; font-size: .8rem; }
.site-page .site-footer-nav a:hover { color: var(--site-orange-ink); }

/* Evidence / benchmark page. */
.benchmarks-page .land-section-first { margin-top: 0; padding-top: clamp(3.5rem, 7vw, 6rem); }
.benchmarks-page .section-eyebrow { margin-bottom: .8rem; }
.benchmarks-page .land-h2 {
  max-width: 12ch;
  margin-bottom: 1.1rem;
  color: var(--site-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .9;
}
.benchmarks-page .land-note {
  max-width: 76ch;
  color: #4e4d47;
  font-size: .98rem;
  line-height: 1.75;
}
.benchmarks-page .bench-h3 {
  margin: clamp(2.75rem, 6vw, 4.5rem) 0 .75rem;
  color: var(--site-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  font-weight: 400;
}
.benchmarks-page .bench-when {
  color: #6f6c64;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .68rem;
  font-weight: 400;
}
.benchmarks-page .bench-table {
  border: 1px solid var(--site-rule);
  border-radius: 11px;
  background: rgba(255,255,255,.34);
  box-shadow: none;
}
.benchmarks-page .bench-table th {
  background: rgba(17,17,15,.035);
  color: var(--site-ink);
  font-size: .82rem;
}
.benchmarks-page .bench-table th,
.benchmarks-page .bench-table td { padding: .85rem 1rem; border-color: var(--site-rule); }
.benchmarks-page .bench-us td { background: rgba(247,147,26,.09); }
.benchmarks-page .bench-model { margin-top: .2rem; color: #706e67; }

/* Playground and its authentication states. */
.playground-page .playground-toolbar { margin: 1.1rem 0 .25rem; }
.playground-page .status-pill,
.playground-page .account-summary {
  border-color: var(--site-rule);
  border-radius: 7px;
  background: rgba(255,255,255,.42);
  box-shadow: none;
}
.playground-page .voice-stage {
  margin-bottom: 1.4rem;
  padding: clamp(1.6rem, 4vw, 2.6rem) 1rem 1.5rem;
  border: 1px solid var(--site-rule);
  border-radius: 14px;
  background: rgba(255,255,255,.28);
}
.playground-page .mic-button {
  background: var(--trelis-orange);
  color: var(--site-ink);
  box-shadow: 0 10px 28px rgba(247,147,26,.24);
}
.playground-page[data-state="LISTENING"] .mic-button { background: var(--trelis-green); color: #fff; }
.playground-page[data-state="SPEAKING"] .mic-button,
.playground-page[data-state="LOCAL_LOADING"] .mic-button,
.playground-page[data-state="TTS_CHECKING"] .mic-button,
.playground-page[data-state="BRAIN_WAKING"] .mic-button,
.playground-page[data-state="PREPARING"] .mic-button,
.playground-page[data-state="WARMING"] .mic-button { color: var(--site-ink); }
.playground-page .provider-toggle { gap: .5rem; }
.playground-page .fb-chip {
  min-height: 36px;
  border-color: var(--site-rule);
  border-radius: 7px;
  background: rgba(255,255,255,.34);
  color: #4e4d47;
}
.playground-page .fb-chip.selected {
  border-color: var(--site-ink);
  background: var(--site-ink);
  color: #fff;
  box-shadow: none;
}
.playground-page .search-toggle { min-height: 32px; color: #4e4d47; }
.playground-page .search-toggle input { accent-color: var(--trelis-orange); }
.playground-page .status-detail { color: #34332e; }
.playground-page .recording-notice { max-width: 66ch; text-align: center; line-height: 1.55; }
.playground-page .conversation-wrap,
.playground-page .diagnostics-panel,
.playground-page .feedback-card {
  border: 1px solid var(--site-rule);
  border-radius: 12px;
  background: rgba(255,255,255,.42);
  box-shadow: none;
}
.playground-page .conversation-head { border-color: var(--site-rule); }
.playground-page .conversation-title { color: var(--site-orange-ink); font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .07em; }
.playground-page .reset-btn { border-color: var(--site-rule); border-radius: 6px; background: transparent; }
.playground-page .turn-user .text {
  border-color: rgba(247,147,26,.45);
  background: rgba(247,147,26,.16);
  color: var(--site-ink);
  box-shadow: none;
}
.playground-page .turn-assistant .text {
  border-color: rgba(50,146,57,.28);
  background: rgba(255,255,255,.62);
  box-shadow: none;
}
.playground-page .diagnostics-panel { background: rgba(240,234,222,.55); }
.playground-page .diag-card,
.playground-page .event-log-wrap { border-color: var(--site-rule); background: rgba(255,255,255,.38); }
.playground-page .event-row { background: rgba(17,17,15,.04); }
.playground-page .login-gate {
  background:
    radial-gradient(circle at 50% 10%, rgba(255,255,255,.9), transparent 26rem),
    var(--site-paper);
}
.playground-page .login-card {
  border: 1px solid var(--site-rule);
  border-radius: 14px;
  background: rgba(255,255,255,.48);
  box-shadow: 0 20px 60px rgba(17,17,15,.09);
}
.playground-page .login-card::before { background: var(--trelis-orange); }
.playground-page .login-input,
.account-page .login-input {
  min-height: 45px;
  border-color: var(--site-rule);
  border-radius: 7px;
  background: rgba(255,255,255,.62);
}
.playground-page .login-input:focus,
.account-page .login-input:focus { border-color: var(--trelis-orange); box-shadow: 0 0 0 3px rgba(247,147,26,.16); }
.playground-page .login-submit {
  min-height: 45px;
  border-radius: 7px;
  background: var(--trelis-orange);
  color: var(--site-ink);
}

/* Account / billing. */
.account-page .account-content { width: min(100%, 820px); margin-top: clamp(2.5rem, 6vw, 5rem); }
.account-page .account-intro { align-items: center; margin-bottom: 1.75rem; }
.account-page .account-eyebrow { margin-bottom: .4rem; }
.account-page .account-title {
  margin: 0;
  color: var(--site-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: .95;
}
.account-page .account-sub { margin-top: .6rem; color: #65635c; }
.account-page .account-card {
  margin-bottom: 1.1rem;
  border: 1px solid var(--site-rule);
  border-radius: 12px;
  background: rgba(255,255,255,.38);
  box-shadow: none;
}
.account-page .balance-card { background: rgba(255,255,255,.52); }
.account-page .account-h2 {
  color: var(--site-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 400;
}
.account-page .balance-amount { color: var(--trelis-orange); font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; }
.account-page .btn-primary,
.account-page .login-submit {
  border-color: var(--trelis-orange);
  border-radius: 7px;
  background: var(--trelis-orange);
  color: var(--site-ink);
}
.account-page .btn-primary:hover:not(:disabled) { background: #df7d09; }
.account-page .btn-secondary { border-color: var(--site-rule); border-radius: 7px; background: rgba(255,255,255,.45); color: var(--trelis-blue); }
.account-page .key-row { border-color: var(--site-rule); background: rgba(255,255,255,.38); }

/* Developer documentation. */
.docs-page .docs-hero { padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--site-rule); }
.docs-home .docs-hero { padding: clamp(2.75rem, 4.5vw, 4rem) 0 clamp(2.25rem, 3.5vw, 3rem); }
.docs-page .doc-title {
  max-width: 15ch;
  margin: .2rem 0 .8rem;
  color: var(--site-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .92;
}
.docs-guide .doc-title,
.docs-reference .doc-title { margin-top: clamp(2.5rem, 5vw, 4.5rem); font-size: clamp(2.8rem, 5vw, 4.5rem); }
.docs-page .doc-lead { max-width: 72ch; color: #4e4d47; font-size: 1.02rem; line-height: 1.75; }
.docs-page .btn-cta,
.docs-page .btn-cta-ghost {
  border-radius: 7px;
  padding: .75rem 1.15rem;
}
.docs-page .btn-cta { background: var(--trelis-orange); color: var(--site-ink); }
.docs-page .btn-cta:hover { background: #df7d09; }
.docs-page .btn-cta-ghost { border-color: var(--site-rule); background: rgba(255,255,255,.4); color: var(--site-ink); }
.docs-page .docs-section { margin-top: clamp(2.75rem, 6vw, 5rem); }
.docs-home .docs-section { margin-top: clamp(2rem, 3.5vw, 3rem); padding-top: 0; }
.docs-page .land-h2,
.docs-page .doc-body h2,
.docs-page .doc-card h2 {
  color: var(--site-ink);
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
}
.docs-page .land-h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.docs-page .reference-card,
.docs-page .doc-card {
  border-color: var(--site-rule);
  border-radius: 10px;
  background: rgba(255,255,255,.34);
  box-shadow: none;
}
.docs-page .reference-card { min-height: 128px; padding: 1.2rem 1.25rem; }
.docs-page .reference-card:hover { border-color: var(--trelis-orange); background: rgba(255,255,255,.64); }
.docs-page .reference-card strong { font-size: 1.02rem; }
.docs-page .reference-card span { color: #54534c; font-size: .92rem; line-height: 1.55; }
.docs-page .support { border-radius: 4px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .63rem; }
.docs-page .quickstart-steps { max-width: 76ch; color: #4e4d47; font-size: .98rem; }
.docs-page .docs-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: clamp(2rem, 5vw, 4.5rem); margin-top: 2.5rem; }
.docs-page .doc-body { color: #45443f; font-size: .98rem; line-height: 1.75; }
.docs-page .doc-body h2 { margin-top: 3.5rem; font-size: 1.8rem; }
.docs-page .doc-body h3 { color: var(--site-ink); font-size: 1.08rem; }
.docs-page .docs-toc { top: 1.5rem; padding-left: 1rem; border-left: 1px solid var(--site-rule); }
.docs-page .docs-toc a { padding: .32rem 0; color: #65635c; }
.docs-page .docs-toc a:hover { color: var(--site-orange-ink); }
.docs-page .doc-callout { border-color: var(--trelis-orange); background: rgba(247,147,26,.09); }
.docs-page .doc-body table { border: 1px solid var(--site-rule); background: rgba(255,255,255,.28); }
.docs-page .doc-body th,
.docs-page .doc-body td { border-color: var(--site-rule); }
.docs-page .code-block,
.docs-page .code-panel { border-radius: 10px; box-shadow: none; }
.docs-page .code-block code { color: #d4ded9; }
.docs-page .doc-tok-keyword { color: #7dd3c8; font-weight: 600; }
.docs-page .doc-tok-string { color: #e8b96b; }
.docs-page .doc-tok-number { color: #f19a67; }
.docs-page .doc-tok-literal { color: #d5a6e6; }
.docs-page .doc-tok-comment { color: #78928b; font-style: italic; }
.docs-page .page-footer { color: #6b6961; }

.playground-page.local-static-preview .mic-button {
  cursor: not-allowed;
  filter: saturate(.72);
  box-shadow: none;
}
.playground-page.local-static-preview .status-detail {
  max-width: 54ch;
  padding: .65rem .85rem;
  border: 1px solid rgba(13,87,155,.2);
  border-radius: 7px;
  background: rgba(13,87,155,.07);
  color: var(--trelis-blue-dark);
  font-size: .86rem;
  line-height: 1.5;
}
.account-page.local-static-preview .account-sub { max-width: 52ch; color: var(--trelis-blue-dark); }
[data-debug-only][hidden] { display: none !important; }

@media (max-width: 900px) {
  .site-page .site-nav { gap: 1rem; }
  .docs-page .docs-layout { grid-template-columns: 1fr; }
  .docs-page .docs-toc { display: none; }
}
@media (max-width: 720px) {
  .site-page .app-shell { padding-inline: 1rem; }
  .site-page .app-header { min-height: 60px; }
  .site-page .brand-mark { width: 26px; height: 26px; }
  .site-page .app-title { font-size: 1.05rem; }
  .site-page .site-nav-link { display: none; }
  .site-page .site-nav-cta { padding: .58rem .72rem; font-size: .7rem; }
  .benchmarks-page .land-section-first { padding-top: 3.25rem; }
  .benchmarks-page .land-h2 { font-size: clamp(3.5rem, 18vw, 5rem); }
  .benchmarks-page .bench-h3 { line-height: 1.15; }
  .benchmarks-page .bench-when { display: block; margin: .5rem 0 0; }
  .playground-page .playground-toolbar { margin-top: .8rem; }
  .playground-page .voice-stage { padding-inline: .75rem; }
  .playground-page .provider-toggle { width: 100%; }
  .playground-page .provider-chip { flex: 1 1 calc(50% - .5rem); }
  .playground-page .conversation-wrap { border-radius: 10px; }
  .playground-page .transcript-panel { min-height: 280px; }
  .account-page .account-content { margin-top: 2.5rem; }
  .account-page .account-intro { align-items: flex-start; }
  .docs-page .docs-hero { padding-top: 3.25rem; }
  .docs-page .doc-title { font-size: clamp(3.25rem, 16vw, 4.5rem); }
  .docs-guide .doc-title,
  .docs-reference .doc-title { font-size: clamp(2.8rem, 14vw, 4rem); }
  .docs-page .doc-grid,
  .docs-page .reference-grid { grid-template-columns: 1fr; }
  .docs-page .reference-card { min-height: 0; }
  .docs-page .doc-body { font-size: .94rem; }
}
