/* ═══════════════════════════════════════════════════════
   MathFlow Tutor v0 — style.css
   Cπ monochrome · Black & white duality · Split-screen
   "Black and white only. No colour."
   ═══════════════════════════════════════════════════════ */

/* ─── Reset & Variables ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Cπ monochrome palette — duality, not dualism */
  --white:   #f5f5f0;
  --black:   #0a0a0a;
  --gray-1:  #1a1a1a;
  --gray-2:  #2a2a2a;
  --gray-3:  #555555;
  --gray-4:  #888888;
  --gray-5:  #bbbbbb;
  --gray-6:  #d5d5d0;

  /* Backward-compatible aliases (dark scale) */
  --bg0:     #0a0a0a;
  --bg0-h:   #0a0a0a;
  --bg1:     #1a1a1a;
  --bg2:     #2a2a2a;
  --bg3:     #444444;
  --bg4:     #666666;

  /* Backward-compatible aliases (light scale) */
  --fg0:     #f5f5f0;
  --fg1:     #e0e0db;
  --fg2:     #bbbbbb;
  --fg3:     #888888;
  --fg4:     #666666;

  /* Accent colors → all white (no colour) */
  --red:     #f5f5f0;
  --green:   #f5f5f0;
  --yellow:  #f5f5f0;
  --blue:    #f5f5f0;
  --purple:  #f5f5f0;
  --aqua:    #f5f5f0;
  --orange:  #f5f5f0;

  /* Semantic */
  --white-panel: #f5f5f0;
  --black-panel: #0a0a0a;
  --divider-width: 0px;
  --header-height: 48px;
  --transition-speed: 0.6s;

  /* Typography */
  --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--black-panel);
  color: var(--fg1);
  -webkit-font-smoothing: antialiased;
}

/* ─── Screens: visibility controlled by body[data-state] ─── */
.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed) ease;
}

/* ════════════════════════════════════════════════════════
   SLEEPING STATE
   ════════════════════════════════════════════════════════ */
body[data-state="sleeping"] #sleeping-screen {
  opacity: 1;
  pointer-events: auto;
}

#sleeping-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--black-panel);
  cursor: pointer;
}

#lemniscate-container {
  width: 485px;
  height: 242px;
}

#lemniscate {
  width: 100%;
  height: 100%;
  opacity: 0.82;
  transition: opacity 1s ease;
}

body[data-state="sleeping"]:hover #lemniscate {
  opacity: 0.96;
}

#sleeping-tagline {
  margin-top: 24px;
  font-size: 14px;
  color: var(--fg2);
  opacity: 0.8;
  letter-spacing: 2px;
  text-transform: lowercase;
  font-weight: 300;
  animation: fadeTagline 3s ease-in-out infinite alternate;
}

@keyframes fadeTagline {
  0%   { opacity: 0.55; }
  100% { opacity: 0.85; }
}

/* ════════════════════════════════════════════════════════
   AWAKE STATE
   ════════════════════════════════════════════════════════ */
body[data-state="awake"] #awake-screen {
  opacity: 1;
  pointer-events: auto;
}

#awake-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 8vh;
  background: var(--black-panel);
  gap: 28px;
  overflow-y: auto;
  overscroll-behavior: none;    /* disable elastic bounce at scroll boundaries */
  padding-bottom: 40px;
}

#lemniscate-awake-container {
  width: 456px;
  height: 228px;
  flex-shrink: 0;
  contain: layout style;       /* isolate breathing SVG from triggering parent reflow */
  transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

#lemniscate-awake {
  width: 100%;
  height: 100%;
  opacity: 0.92;
}

#awake-prompt {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--fg0);
  letter-spacing: -0.5px;
}

#input-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  padding: 0 20px;
}

#problem-input {
  width: 100%;
  padding: 16px 4px;
  font-family: var(--font-mono);
  font-size: 15px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gray-3);
  border-radius: 0;
  color: var(--fg0);
  resize: none;
  outline: none;
  transition: border-color 0.3s;
}

#problem-input:focus {
  border-bottom-color: var(--white);
  box-shadow: none;
}

#problem-input::placeholder {
  color: var(--fg4);
  opacity: 0.6;
}

#input-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

#input-controls select {
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gray-3);
  border-radius: 0;
  color: var(--fg1);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

#input-controls select:hover { border-bottom-color: var(--white); }

#generate-btn {
  padding: 10px 28px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  background: var(--yellow);
  color: var(--bg0-h);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#generate-btn:hover {
  background: var(--gray-6);
  transform: translateY(-1px);
}

#generate-btn:active { transform: translateY(0); }

#generate-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

#viz-toggle-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg4);
  cursor: pointer;
  user-select: none;
}

#viz-toggle-label input[type="checkbox"] {
  accent-color: var(--yellow);
  cursor: pointer;
}

/* ─── Progress ─── */
#progress-area {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px;
}

#progress-stage-label {
  display: none;
}

#progress-stage-label.fading {
  opacity: 0;
}

#progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg2);
  border-radius: 3px;
  overflow: hidden;
}

#progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--gray-5);
  border-radius: 3px;
  transition: width 0.4s ease;
}

#progress-label {
  font-size: 14px;
  color: var(--fg1);
  font-weight: 500;
}

#progress-detail {
  display: none;
}

/* ─── Lesson Library ─── */
#library-area {
  width: 100%;
  max-width: 560px;
  padding: 0 20px;
}

#library-area h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg4);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 35vh;
  overflow-y: scroll;            /* always show scrollbar — eliminates show/hide jitter */
  overscroll-behavior: none;     /* disable elastic bounce at scroll boundaries */
  contain: layout;               /* isolate from parent layout recalculations */
}

.lesson-card {
  padding: 14px 18px;
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lesson-card:hover {
  border-color: var(--yellow);
  background: var(--bg2);
}

.lesson-card-info {
  flex: 1;
  min-width: 0;
}

.lesson-card-title {
  font-size: 14px;
  color: var(--fg0);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--fg4);
  font-family: var(--font-mono);
}

.lesson-card-badge {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg2);
  color: var(--fg3);
  border-radius: 12px;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════
   BLOOMING STATE (fade transition to lesson)
   Awake screen fades out, lesson screen fades in.
   Taper clip-path is applied immediately; CSS opacity does the rest.
   ════════════════════════════════════════════════════════ */
body[data-state="blooming"] #awake-screen {
  pointer-events: none;
}

body[data-state="blooming"] #lesson-screen {
  opacity: 1;
  pointer-events: none;
}

body[data-state="blooming"] #lesson-header {
  opacity: 0;
}
body[data-state="lesson"] #lesson-header {
  opacity: 1;
  transition: opacity 0.5s 0.1s ease-in;
}

/* ════════════════════════════════════════════════════════
   LESSON STATE
   ════════════════════════════════════════════════════════ */
body[data-state="lesson"] #lesson-screen {
  opacity: 1;
  pointer-events: auto;
}

#lesson-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--black);
}

/* ─── Lesson Header ─── */
#lesson-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg0);
  border-bottom: 1px solid var(--bg2);
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

#back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: 8px;
  color: var(--fg1);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

#back-btn:hover {
  background: var(--bg2);
  border-color: var(--fg4);
}

#header-logo {
  width: 48px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.7;
  margin-right: 8px;
}

#lesson-title {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  color: var(--fg0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* KaTeX in lesson title — white math on dark header */
#lesson-title .katex { color: var(--fg0); font-size: 14px; }

#lesson-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

#lesson-step-counter {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--fg4);
  padding: 4px 10px;
  background: var(--bg1);
  border-radius: 12px;
}

/* ─── Lesson Body (split screen below header) ─── */
#lesson-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
  /* Black base — subtle taper gaps barely visible */
  background: var(--black);
  position: relative;
}

/* Left panel — black (video + steps) */
#left-panel {
  flex: 7;
  background: var(--black);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#video-container {
  flex: 0 0 auto;
  padding: 16px 20px 8px;
  position: relative;
}

#lesson-video {
  width: 100%;
  border-radius: 10px;
  background: #000;
  max-height: 45vh;
  display: block;
}

/* Custom video controls bar */
#video-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 4px;
}

.video-ctrl-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-2);
  border: none;
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.video-ctrl-btn:hover {
  background: var(--gray-3);
  transform: scale(1.08);
}

/* Step Cards */
#step-cards {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable; /* reserve scrollbar space — prevents width jitter */
  padding: 8px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-card {
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 4px solid var(--gray-3);
  background: var(--gray-1);
  color: var(--white);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s, background 0.2s;
  position: relative;
}

.step-card:hover {
  background: var(--gray-2);
  box-shadow: 0 2px 16px rgba(255,255,255,0.04);
  transform: translateX(2px);
}

.step-card.active {
  border-left-color: var(--white) !important;
  background: var(--gray-2);
  box-shadow: 0 2px 20px rgba(255,255,255,0.08);
}

.step-card.completed {
  opacity: 0.6;
}

/* No category colours — monochrome only */

.step-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.step-card-index {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.step-card-actions {
  display: flex;
  gap: 4px;
}

.step-hint-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  color: var(--fg0);
}

.step-card:hover .step-hint-btn { opacity: 1; }
.step-hint-btn:hover { background: var(--yellow); }

.step-card-math {
  font-size: 15px;
  color: var(--white);
  line-height: 1.6;
  margin: 4px 0;
  font-family: var(--font-serif);
}

/* KaTeX overrides for black cards — white math text */
.step-card .katex { color: var(--white); }
.step-card .katex .mord,
.step-card .katex .mbin,
.step-card .katex .mrel,
.step-card .katex .mopen,
.step-card .katex .mclose,
.step-card .katex .mpunct { color: var(--white); }

.step-card-narration {
  font-size: 13px;
  color: var(--gray-5);
  line-height: 1.5;
}

.step-card-footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-card-confidence {
  display: flex;
  gap: 3px;
}

.confidence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fg3);
  opacity: 0.25;
}

.confidence-dot.filled { opacity: 1; background: var(--white); }
.confidence-dot.medium { opacity: 1; background: var(--gray-4); }
.confidence-dot.low    { opacity: 1; background: var(--gray-3); }

.step-card-concepts {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.concept-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--gray-1);
  color: var(--gray-4);
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Center divider — absolute overlay at the seam where the two lobes interlock.
   No flex participation; just the breathing lemniscate SVG centered on seam.
   Position must match SPLIT_FRAC in lemniscate.js (70/30 split). */
#divider {
  position: absolute;
  left: 70%;
  top: 0;
  bottom: 0;
  width: 0;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
}

#lemniscate-divider {
  width: 50px;
  height: 100%;
  opacity: 0.25;
  overflow: visible;
  position: absolute;
  left: -25px; /* center the 50px SVG on the 0-width divider */
  top: 0;
}

/* ─── Right panel — warm parchment (chat tutor) ─── */
#right-panel {
  flex: 3;
  background: #ede8df;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Default: logo centered with generous padding */
#avatar-container {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px auto 12px;
  padding: 20px;
}

/* Tutor lemniscate — same logo family as sleep/awake screens */
#tutor-lemniscate {
  width: 180px;
  height: 90px;
  opacity: 0.88;
  transition: opacity 0.3s ease;
}

/* Viz video — replaces lemniscate when viz exists */
#viz-video {
  display: none;
  width: 100%;
  max-height: 45vh;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 10px;
  background: #1a1a1a;
}

#avatar-container.has-viz {
  padding: 8px 16px;
}

#avatar-container.has-viz #tutor-lemniscate {
  display: none;
}

#avatar-container.has-viz #viz-video {
  display: block;
}

/* ─── Chat Area ─── */
#chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  min-height: 0;
}

#chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.chat-bubble {
  max-width: 90%;
  font-size: 14px;
  line-height: 1.6;
  animation: fadeInUp 0.25s ease;
  word-wrap: break-word;
  flex-shrink: 0;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* AI: left rule, no bubble */
.chat-bubble.ai {
  align-self: flex-start;
  background: none;
  border: none;
  border-left: 2px solid #888;
  border-radius: 0;
  padding: 3px 0 3px 14px;
  color: #1a1a1a;
  overflow-x: auto;
  white-space: pre-line;
}

/* KaTeX in AI messages — dark on parchment */
.chat-bubble.ai .katex { color: #1a1a1a; }
.chat-bubble.ai .katex-display { margin: 6px 0; }

/* User: right-aligned italic, no bubble */
.chat-bubble.user {
  align-self: flex-end;
  background: none;
  border: none;
  border-radius: 0;
  padding: 2px 6px 2px 0;
  color: #666;
  font-style: italic;
  text-align: right;
}

.chat-bubble.system {
  align-self: center;
  background: transparent;
  color: var(--gray-3);
  font-size: 11px;
  font-style: italic;
  padding: 4px 8px;
}

/* Typing indicator */
#typing-indicator {
  display: flex;
  gap: 5px;
  padding: 8px 14px;
  align-self: flex-start;
}

#typing-indicator.hidden { display: none; }

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-3);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* Chat input */
#chat-input-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

#chat-input {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  background: transparent;
  border: 1px solid #bbb;
  border-radius: 4px;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s;
}

#chat-input:focus {
  border-color: #666;
}

#chat-input::placeholder {
  color: #aaa;
}

#chat-send-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

#chat-send-btn:hover {
  background: var(--gray-2);
  transform: scale(1.05);
}

#chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ════════════════════════════════════════════════════════
   ENDING STATE
   ════════════════════════════════════════════════════════ */
body[data-state="ending"] #ending-overlay {
  opacity: 1;
  pointer-events: auto;
  background: var(--black-panel);
  transition: opacity 1.5s ease;
}

/* ════════════════════════════════════════════════════════
   Hint Overlay
   ════════════════════════════════════════════════════════ */
#hint-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

#hint-content {
  background: var(--black);
  border: 1px solid var(--gray-3);
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 460px;
  width: 90%;
  text-align: center;
}

#hint-level-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

#hint-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg0);
  margin-bottom: 20px;
}

#hint-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.hint-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-family: var(--font-sans);
  border: 1px solid var(--bg3);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  background: var(--bg2);
  color: var(--fg1);
}

.hint-btn:hover { background: var(--bg3); }

.hint-btn-primary {
  background: var(--aqua);
  color: var(--bg0-h);
  border-color: var(--aqua);
}

.hint-btn-primary:hover { background: var(--gray-6); }

/* ─── Utilities ─── */
.hidden { display: none !important; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg4); }

/* Left panel scrollbar (dark panel) */
#left-panel ::-webkit-scrollbar-thumb { background: var(--gray-3); }
#left-panel ::-webkit-scrollbar-thumb:hover { background: var(--gray-4); }

/* Right panel scrollbar (light panel) */
#right-panel ::-webkit-scrollbar-thumb { background: var(--gray-5); }
#right-panel ::-webkit-scrollbar-thumb:hover { background: var(--gray-4); }

/* ════════════════════════════════════════════════════════
   VOICE CHAT
   ════════════════════════════════════════════════════════ */

#voice-toggle-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #888;
  border: 1px solid #bbb;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

#voice-toggle-btn:hover {
  color: #1a1a1a;
  border-color: #888;
}

#voice-toggle-btn.active {
  background: #1a1a1a;
  color: #f5f5f0;
  border-color: #1a1a1a;
}

/* Pulse ring when listening */
#voice-toggle-btn[data-voice-state="listening"],
#voice-toggle-btn[data-voice-state="user-speaking"] {
  animation: voicePulse 2s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26, 26, 26, 0.3); }
  50%      { box-shadow: 0 0 0 8px rgba(26, 26, 26, 0); }
}

/* Thinking: opacity pulse */
#voice-toggle-btn[data-voice-state="thinking"] {
  animation: voiceThink 1s ease-in-out infinite alternate;
}

@keyframes voiceThink {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Speaking: solid calm */
#voice-toggle-btn[data-voice-state="agent-speaking"] {
  background: #555;
  border-color: #555;
}

/* Connecting: spin */
#voice-toggle-btn[data-voice-state="connecting"] {
  animation: voiceSpin 1s linear infinite;
}

@keyframes voiceSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Voice indicator: status text, replaces input visually */
#voice-indicator {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 13px;
  color: #888;
  padding: 9px 12px;
  font-style: italic;
  letter-spacing: 0.3px;
}

#voice-indicator[data-voice-state="user-speaking"] { color: #1a1a1a; }
#voice-indicator[data-voice-state="agent-speaking"] { color: #555; }

/* Hidden class for toggling elements */
#chat-input.hidden,
#chat-send-btn.hidden {
  display: none;
}
