*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f1117;
  --bg-header:   #15171f;
  --bg-msg-ai:   #1e2130;
  --bg-input:    #1a1d27;
  --bg-tool:     #252836;
  --accent:      #2563eb;
  --indigo:      #6366f1;
  --green:       #22c55e;
  --yellow:      #eab308;
  --red:         #ef4444;
  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --border:      #2d3148;
  --radius:      10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html, body { min-height: 100%; background: var(--bg); color: var(--text); }

/* ── Layout ── */
body.chat-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

header {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #0f172a;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

#health-badge { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.dot.green  { background: var(--green);  box-shadow: 0 0 6px var(--green); }
.dot.yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.dot.red    { background: var(--red);    box-shadow: 0 0 6px var(--red); }

#rl-wrapper {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 240px;
  font-size: 12px; color: var(--text-muted);
}
#rl-track {
  flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.rl-fill { height: 100%; border-radius: 3px; transition: width 0.3s, background 0.3s; }
.rl-fill.green  { background: var(--green); }
.rl-fill.yellow { background: var(--yellow); }
.rl-fill.red    { background: var(--red); }

/* ── Voice buttons (TTS toggle + Mic) ── */
.voice-btn {
  flex-shrink: 0;
  min-width: 32px; height: 32px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); font-size: 15px; line-height: 1;
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.voice-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }
.voice-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* TTS button active state */
.tts-btn.active { color: var(--accent); border-color: var(--accent); }

/* Mic button states */
.mic-btn.recording {
  color: var(--red); border-color: var(--red);
  animation: mic-pulse 1.1s ease-in-out infinite;
}
.mic-btn.processing { opacity: 0.5; cursor: not-allowed; }

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50%       { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
}

#clear-btn {
  margin-left: auto;
  padding: 5px 12px; font-size: 12px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
#clear-btn:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Chat container ── */
#chat-container {
  flex: 1; overflow-y: auto;
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Custom scrollbar */
#chat-container::-webkit-scrollbar { width: 6px; }
#chat-container::-webkit-scrollbar-track { background: transparent; }
#chat-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.message {
  max-width: 780px;
  padding: 12px 16px;
  border-radius: var(--radius);
  line-height: 1.65;
  font-size: 14px;
  word-break: break-word;
}

.message.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  white-space: pre-wrap;
}

.message.assistant {
  align-self: flex-start;
  background: var(--bg-msg-ai);
  border: 1px solid var(--border);
  width: 100%; max-width: 780px;
}

.message.error-msg {
  align-self: flex-start;
  background: #2a1515;
  border: 1px solid var(--red);
  color: #fca5a5;
}

/* ── Tool panel ── */
.tool-panel { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.tool-panel:empty { display: none; }

.tool-card {
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-tool);
  overflow: hidden;
  font-size: 13px;
}
.tool-card.running { border-left: 3px solid var(--indigo); }
.tool-card.done    { border-left: 3px solid var(--green); }

.tool-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  cursor: pointer; user-select: none;
}
.tool-card-header:hover { background: rgba(255,255,255,0.03); }

.tool-icon { font-size: 14px; }
.tool-name { font-weight: 500; color: var(--text); flex: 1; }
.tool-status { font-size: 12px; color: var(--text-muted); }
.tool-toggle { font-size: 10px; color: var(--text-muted); }

.tool-card-body {
  display: none;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.tool-card-body pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px; color: #a5b4fc;
  white-space: pre-wrap; word-break: break-all;
}

/* ── Standalone thinking indicator (shown before first token arrives) ── */
.thinking-indicator {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: var(--bg-msg-ai);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.thinking-indicator span {
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: ti-bounce 1.3s ease-in-out infinite;
}
.thinking-indicator span:nth-child(2) { animation-delay: 0.18s; }
.thinking-indicator span:nth-child(3) { animation-delay: 0.36s; }

/* ── Typing indicator (three bouncing dots) ── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
}
.typing-indicator span {
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: ti-bounce 1.3s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.36s; }
@keyframes ti-bounce {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.4; }
  35%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid var(--text-muted);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Response content (markdown) ── */
.response-content h1,.response-content h2,.response-content h3 {
  margin: 14px 0 6px; color: #c7d2fe;
}
.response-content p  { margin: 6px 0; }
.response-content ul,.response-content ol { margin: 6px 0 6px 20px; }
.response-content li { margin: 3px 0; }
.response-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: #0f172a; color: #7dd3fc;
  padding: 1px 5px; border-radius: 4px;
}
.response-content pre {
  background: #0f172a; border-radius: 6px;
  padding: 12px; margin: 8px 0;
  overflow-x: auto; font-size: 13px;
}
.response-content pre code { background: none; padding: 0; color: inherit; }
.response-content blockquote {
  border-left: 3px solid var(--indigo);
  padding-left: 12px; color: var(--text-muted); margin: 8px 0;
}
.response-content table { border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.response-content th, .response-content td {
  border: 1px solid var(--border); padding: 5px 10px;
}
.response-content th { background: var(--bg-tool); }
.response-content a { color: #60a5fa; }

/* ── Input area ── */
footer {
  flex-shrink: 0;
  padding: 14px 20px;
  background: var(--bg-header);
  border-top: 1px solid var(--border);
}

#input-row { display: flex; gap: 8px; align-items: flex-end; max-width: 780px; margin: 0 auto; }

/* Mic button inside input row needs taller height to match send button */
#input-row .mic-btn { min-width: 44px; height: 44px; flex-shrink: 0; font-size: 18px; }

#input-box {
  flex: 1;
  min-height: 44px; max-height: 160px;
  resize: none; overflow-y: auto;
  background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 14px; line-height: 1.5;
  padding: 10px 14px;
  outline: none; transition: border-color 0.15s;
  font-family: inherit;
}
#input-box:focus { border-color: var(--accent); }
#input-box::placeholder { color: var(--text-muted); }

#send-btn {
  flex-shrink: 0;
  height: 44px; padding: 0 20px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
#send-btn:hover:not(:disabled) { background: #1d4ed8; }
#send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#input-hint { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* ── Empty state ── */
#empty-hint {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--text-muted);
  pointer-events: none;
}
#empty-hint h2 { font-size: 20px; color: var(--text); }
#empty-hint p  { font-size: 13px; max-width: 420px; text-align: center; }
.hint-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hint-pill {
  padding: 6px 12px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--bg-msg-ai); color: var(--text-muted);
  cursor: pointer; pointer-events: all; transition: border-color 0.15s, color 0.15s;
}
.hint-pill:hover { border-color: var(--accent); color: var(--text); }

/* ── Maintenance overlay ─────────────────────────────────────────────── */
.maint-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 20px;
}
.maint-hidden { display: none !important; }
.maint-card { max-width: 420px; }
.maint-icon { font-size: 52px; margin-bottom: 18px; }
.maint-card h2 { font-size: 22px; margin-bottom: 10px; }
.maint-card p  { color: var(--text-muted); font-size: 15px; line-height: 1.8; }
.maint-card a  { color: #60a5fa; text-decoration: none; }
.maint-card a:hover { text-decoration: underline; }
.maint-back {
  display: inline-block; margin-top: 26px;
  padding: 9px 20px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-muted) !important;
  font-size: 14px; text-decoration: none !important;
  transition: color 0.15s, border-color 0.15s;
}
.maint-back:hover { color: var(--text) !important; border-color: var(--text-muted); }

/* ── Voice conversation overlay ──────────────────────────────────────── */
.vo-hidden { display: none !important; }

#voice-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: #07090f;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 56px 0 48px;
}

.vo-title {
  font-size: 15px; font-weight: 500;
  color: rgba(226,232,240,0.4);
  letter-spacing: 0.08em;
}

/* ── Orb container (holds ripple rings + orb) ── */
#vo-orb-wrap {
  position: relative;
  width: 260px; height: 260px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Ripple rings — visible only during listening ── */
.vo-ripple {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(96,165,250,0.3);
  opacity: 0;
  pointer-events: none;
  width: 190px; height: 190px;
}
#vo-orb-wrap[data-state="listening"] .vo-ripple {
  animation: vo-ripple 2.6s ease-out infinite;
}
#vo-orb-wrap[data-state="listening"] .vo-ripple-2 { animation-delay: 0.85s; }
#vo-orb-wrap[data-state="listening"] .vo-ripple-3 { animation-delay: 1.7s; }

@keyframes vo-ripple {
  0%   { width: 190px; height: 190px; opacity: 0.55; }
  100% { width: 320px; height: 320px; opacity: 0; }
}

/* ── The orb itself ── */
#vo-orb {
  width: 190px; height: 190px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  position: relative; z-index: 1;
  /* layered gradients: white highlight + sky blue mid + deep blue edge */
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,0.88) 0%, transparent 42%),
    radial-gradient(circle at 70% 74%, rgba(147,197,253,0.5)  0%, transparent 44%),
    radial-gradient(ellipse at 50% 50%, #93c5fd 0%, #3b82f6 44%, #1d4ed8 74%, #1e3a8a 100%);
  box-shadow:
    0 0 72px rgba(59,130,246,0.5),
    0 0 144px rgba(59,130,246,0.18),
    inset 0 0 32px rgba(255,255,255,0.08);
  animation: vo-idle 4s ease-in-out infinite;
  transition: box-shadow 0.4s;
}

/* idle: gentle breathing */
@keyframes vo-idle {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.042); }
}

/* listening: faster pulse + bright glow */
#vo-orb-wrap[data-state="listening"] #vo-orb {
  animation: vo-listen 1.5s ease-in-out infinite;
  box-shadow:
    0 0 96px rgba(59,130,246,0.78),
    0 0 192px rgba(59,130,246,0.24),
    inset 0 0 32px rgba(255,255,255,0.1);
}
@keyframes vo-listen {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.07); }
}

/* thinking: hue-shift shimmer */
#vo-orb-wrap[data-state="thinking"] #vo-orb {
  animation: vo-think 1.1s ease-in-out infinite;
  cursor: default;
}
@keyframes vo-think {
  0%   { transform: scale(0.97); filter: brightness(0.93) hue-rotate(0deg); }
  50%  { transform: scale(1.03); filter: brightness(1.12) hue-rotate(22deg); }
  100% { transform: scale(0.97); filter: brightness(0.93) hue-rotate(0deg); }
}

/* speaking: morphing blob + vibrant glow */
#vo-orb-wrap[data-state="speaking"] #vo-orb {
  animation: vo-speak 0.85s ease-in-out infinite;
  box-shadow:
    0 0 108px rgba(59,130,246,0.88),
    0 0 216px rgba(59,130,246,0.3),
    inset 0 0 40px rgba(255,255,255,0.12);
}
@keyframes vo-speak {
  0%   { transform: scale(1.02); border-radius: 50%; }
  20%  { transform: scale(0.97); border-radius: 46% 54% 52% 48% / 50% 48% 52% 50%; }
  40%  { transform: scale(1.05); border-radius: 50%; }
  60%  { transform: scale(0.98); border-radius: 53% 47% 47% 53% / 48% 53% 47% 52%; }
  80%  { transform: scale(1.03); border-radius: 50%; }
  100% { transform: scale(1.02); border-radius: 50%; }
}

/* error state: red orb */
#vo-orb-wrap[data-state="error"] #vo-orb {
  background:
    radial-gradient(circle at 30% 26%, rgba(255,255,255,0.7) 0%, transparent 42%),
    radial-gradient(ellipse at 50% 50%, #fca5a5 0%, #ef4444 48%, #b91c1c 100%);
  box-shadow:
    0 0 72px rgba(239,68,68,0.5),
    0 0 144px rgba(239,68,68,0.18);
  animation: vo-idle 3s ease-in-out infinite;
}

/* ── Status text ── */
#vo-status {
  font-size: 16px;
  color: rgba(226,232,240,0.6);
  letter-spacing: 0.04em;
  min-height: 24px;
  text-align: center;
}

/* ── Close button ── */
#vo-close-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: rgba(226,232,240,0.55);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
#vo-close-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.28);
  color: var(--text);
}

/* ── Voice chat launch button (header) ── */
.vc-btn.active { color: #60a5fa; border-color: #60a5fa; }

/* Landing page */
.landing-page {
  min-height: 100vh;
  overflow-x: hidden;
  color: #172033;
  background:
    linear-gradient(135deg, rgba(20, 83, 45, 0.12), transparent 28%),
    linear-gradient(225deg, rgba(37, 99, 235, 0.16), transparent 32%),
    #f6f7f3;
}

.landing-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.landing-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-mark, .nav-action, .primary-action, .secondary-action { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #172033;
  font-weight: 700;
}

.brand-symbol {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  background: #172033;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.18);
}

.nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  color: #172033;
  border: 1px solid rgba(23, 32, 51, 0.16);
  background: rgba(255, 255, 255, 0.62);
}

.hero-section {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: 54px;
  padding: 38px 0 86px;
}

.eyebrow {
  color: #0f766e;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-copy h1 {
  max-width: 720px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: 0;
  color: #0f172a;
  background: linear-gradient(110deg, #0f172a 0%, #1d4ed8 56%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lede {
  max-width: 620px;
  margin-top: 24px;
  color: #55606f;
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-action, .secondary-action {
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 22px;
  font-weight: 700;
}

.primary-action {
  color: #ffffff;
  background: #14532d;
  box-shadow: 0 18px 36px rgba(20, 83, 45, 0.22);
}

.secondary-action {
  color: #172033;
  border: 1px solid rgba(23, 32, 51, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.product-preview {
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #101827;
  box-shadow: 0 36px 90px rgba(23, 32, 51, 0.28);
}

.preview-topbar {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(226, 232, 240, 0.12);
  background: #0b1220;
}

.preview-topbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
}

.preview-topbar span:nth-child(1) { background: #ef4444; }
.preview-topbar span:nth-child(2) { background: #eab308; }
.preview-topbar span:nth-child(3) { background: #22c55e; }
.preview-topbar strong { margin-left: 8px; font-size: 13px; }

.preview-body {
  min-height: 454px;
  display: grid;
  grid-template-columns: 154px 1fr;
}

.preview-sidebar {
  padding: 18px;
  border-right: 1px solid rgba(226, 232, 240, 0.1);
  background: rgba(15, 23, 42, 0.78);
}

.mini-stat {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
}

.mini-stat span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  margin-bottom: 4px;
}

.mini-stat strong { color: #e2e8f0; font-size: 14px; }

.mini-line {
  height: 9px;
  width: 72%;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.25);
  margin: 14px 0;
}

.mini-line.wide { width: 100%; }
.mini-line.short { width: 46%; }

.preview-chat {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
}

.preview-message {
  max-width: 82%;
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.7;
  font-size: 14px;
}

.preview-message.user {
  align-self: flex-end;
  color: #ffffff;
  background: #2563eb;
}

.preview-message.assistant {
  color: #dbeafe;
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: rgba(30, 41, 59, 0.78);
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  margin: 0 6px 10px 0;
  border-radius: 6px;
  color: #99f6e4;
  background: rgba(20, 184, 166, 0.13);
  font-size: 12px;
}

.preview-input {
  margin-top: auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px 0 18px;
  border-radius: 8px;
  color: #94a3b8;
  border: 1px solid rgba(226, 232, 240, 0.14);
  background: rgba(15, 23, 42, 0.92);
}

.preview-input b {
  color: #ffffff;
  background: #14532d;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
}

.capability-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 0 0 56px;
}

.capability-band article {
  min-height: 190px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid rgba(23, 32, 51, 0.12);
  background: rgba(255, 255, 255, 0.68);
}

.cap-index {
  display: block;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 28px;
}

.capability-band h2 {
  color: #172033;
  font-size: 20px;
  margin-bottom: 12px;
}

.capability-band p {
  color: #5f6b7a;
  line-height: 1.75;
}

.nav-author {
  margin-right: auto;
  margin-left: 20px;
  font-size: 0.82rem;
  color: #5f6b7a;
}
.nav-author a {
  color: #5f6b7a;
  text-decoration: none;
}
.nav-author a:hover {
  color: var(--accent);
}

@media (max-width: 900px) {
  .landing-shell { width: min(100% - 28px, 680px); }
  .landing-nav { min-height: 68px; }
  .brand-mark span:last-child { max-width: 210px; }
  .hero-section {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 36px 0 46px;
  }
  .hero-copy h1 { font-size: 44px; }
  .product-preview { width: 100%; }
  .preview-body { grid-template-columns: 1fr; min-height: 390px; }
  .preview-sidebar { display: none; }
  .capability-band { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   Theme toggle button
   ══════════════════════════════════════════════ */
#theme-btn {
  flex-shrink: 0;
  min-width: 32px; height: 32px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); font-size: 15px; line-height: 1;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
  display: flex; align-items: center; justify-content: center;
}
#theme-btn:hover { color: var(--text); border-color: var(--text-muted); }

/* Landing-page theme button */
.landing-theme-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  padding: 0;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(23,32,51,0.14); border-radius: 8px;
  color: #5f6b7a; font-size: 16px; line-height: 1;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.landing-theme-btn:hover { background: rgba(255,255,255,0.9); }

/* Smooth background transitions on theme change */
html { transition: background-color 0.25s; }

/* ══════════════════════════════════════════════
   LIGHT MODE — chat page
   ══════════════════════════════════════════════ */
:root[data-theme="light"] {
  --bg:         #f8fafc;
  --bg-header:  #ffffff;
  --bg-msg-ai:  #f1f5f9;
  --bg-input:   #ffffff;
  --bg-tool:    #e8edf3;
  --text:       #0f172a;
  --text-muted: #64748b;
  --border:     #e2e8f0;
}

[data-theme="light"] .message.error-msg {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}
[data-theme="light"] .home-link { background: #0f172a; color: #f8fafc; }

[data-theme="light"] .response-content h1,
[data-theme="light"] .response-content h2,
[data-theme="light"] .response-content h3 { color: #1d4ed8; }
[data-theme="light"] .response-content code { background: #e8edf3; color: #1d4ed8; }
[data-theme="light"] .response-content pre  { background: #e8edf3; }
[data-theme="light"] .response-content a    { color: #2563eb; }
[data-theme="light"] .tool-card-header:hover { background: rgba(0,0,0,0.03); }
[data-theme="light"] .tool-card-body pre    { color: #4f46e5; }

[data-theme="light"] #voice-overlay { background: #f8fafc; }
[data-theme="light"] .vo-title  { color: rgba(15,23,42,0.45); }
[data-theme="light"] #vo-status { color: rgba(15,23,42,0.65); }
[data-theme="light"] .vo-ripple { border-color: rgba(37,99,235,0.3); }
[data-theme="light"] #vo-close-btn {
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
  color: rgba(15,23,42,0.5);
}
[data-theme="light"] #vo-close-btn:hover {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.2);
  color: #0f172a;
}

/* ══════════════════════════════════════════════
   DARK MODE — landing page
   ══════════════════════════════════════════════ */
[data-theme="dark"] .landing-page {
  color: #cbd5e1;
  background:
    linear-gradient(135deg, rgba(20,83,45,0.15), transparent 28%),
    linear-gradient(225deg, rgba(37,99,235,0.18), transparent 32%),
    #0f1117;
}
[data-theme="dark"] .brand-mark { color: #e2e8f0; }
[data-theme="dark"] .brand-symbol { background: #e2e8f0; color: #0f172a; }
[data-theme="dark"] .hero-copy h1 {
  background: linear-gradient(110deg, #e2e8f0 0%, #60a5fa 56%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .eyebrow         { color: #34d399; }
[data-theme="dark"] .hero-lede        { color: #94a3b8; }
[data-theme="dark"] .nav-action {
  color: #e2e8f0;
  border-color: rgba(226,232,240,0.18);
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .nav-action:hover { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .primary-action {
  background: #1d4ed8;
  box-shadow: 0 18px 36px rgba(29,78,216,0.3);
  color: #fff;
}
[data-theme="dark"] .secondary-action {
  color: #e2e8f0;
  border-color: rgba(226,232,240,0.16);
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .capability-band article {
  border-color: rgba(226,232,240,0.08);
  background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .capability-band h2 { color: #e2e8f0; }
[data-theme="dark"] .cap-index          { color: #34d399; }
[data-theme="dark"] .capability-band p  { color: #94a3b8; }
[data-theme="dark"] .nav-author,
[data-theme="dark"] .nav-author a       { color: #4b5563; }
[data-theme="dark"] .landing-theme-btn {
  background: rgba(255,255,255,0.06);
  border-color: rgba(226,232,240,0.16);
  color: #94a3b8;
}
[data-theme="dark"] .landing-theme-btn:hover { background: rgba(255,255,255,0.12); }

@media (max-width: 560px) {
  .landing-shell { width: min(100% - 24px, 520px); }
  .landing-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0 8px;
  }
  .nav-action { width: 100%; }
  .hero-copy h1 { font-size: 36px; }
  .hero-lede { font-size: 16px; }
  .primary-action, .secondary-action { width: 100%; }
  .preview-chat { padding: 20px; }
  .preview-message { max-width: 100%; }
}
