/* =========================================
   OUTPUT PANEL — STATE-DRIVEN CHAT
   Root-level state + layout attributes
   cascade into all child animations.
   ========================================= */

/* ── Root Panel Container ── */
.output-pane {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  position: relative;
}

/* ── Pane Tabs ── */
.pane-tabs {
  display: flex; gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.pane-tab {
  padding: 8px 14px; font-size: 12px;
  color: var(--color-text-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s; user-select: none;
}
.pane-tab:hover { color: var(--color-text-secondary); }
.pane-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.pane-content {
  display: none; flex-direction: column;
  height: 100%; width: 100%; overflow: hidden;
}
.pane-content.active { display: flex; }

/* ── Code view pane ── */
.code-view {
  height: 100%; overflow-y: auto; padding: 0;
}
.code-view pre {
  margin: 0; padding: 20px; background: rgba(0,0,0,0.3);
  font-size: 13px; line-height: 1.6; min-height: 100%;
  box-sizing: border-box;
}
.code-view code {
  font-family: var(--font-mono); white-space: pre-wrap;
  word-break: break-word; color: var(--color-text-primary);
}

/* ── Right-panel Gemini palette ── */
.output-pane {
  --glow-start: #4f46e5;
  --glow-end: #06b6d4;
  --glass-bg: rgba(31, 40, 51, 0.45);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

/* ═══════════════════════════════════════
   STATE-DRIVEN LAYOUT SYSTEM
   One attribute on .output-pane controls
   all child visibility + animations.
   ═══════════════════════════════════════ */

/* ── STATE: idle ── */
.output-pane[data-panel-state="idle"] .chat-body {
  opacity: 0.6;
}
.output-pane[data-panel-state="idle"] .chat-footer {
  opacity: 0.3; pointer-events: none;
}

/* ── STATE: thinking ── */
.output-pane[data-panel-state="thinking"] .chat-footer {
  opacity: 0.5; pointer-events: none;
}

/* ── STATE: tooling — ambient bar visible ── */
.output-pane[data-panel-state="tooling"] .tool-chain-bar {
  height: auto; max-height: 120px; opacity: 1;
}
.output-pane[data-panel-state="tooling"] .chat-footer {
  opacity: 0.5; pointer-events: none;
}

/* ── STATE: streaming — pause btn visible, bubble active ── */
.output-pane[data-panel-state="streaming"] .pause-btn {
  opacity: 1; pointer-events: auto;
}
.output-pane[data-panel-state="streaming"] .chat-footer {
  opacity: 0.5; pointer-events: none;
}
.output-pane[data-panel-state="streaming"] .ai-bubble.streaming {
  border-color: rgba(79,70,229,0.25);
  box-shadow: 0 0 40px rgba(79,70,229,0.06), inset 0 0 40px rgba(6,182,212,0.02);
}

/* ── STATE: done — actions revealed ── */
.output-pane[data-panel-state="done"] .chat-footer {
  opacity: 1; pointer-events: auto;
}
.output-pane[data-panel-state="done"] .bubble-actions {
  opacity: 1; transform: translateY(0);
}

/* ── STATE: error ── */
.output-pane[data-panel-state="error"] .ai-bubble.error {
  border-color: rgba(255,82,82,0.4);
  background: rgba(255,82,82,0.04);
}
.output-pane[data-panel-state="error"] .chat-footer {
  opacity: 1; pointer-events: auto;
}

/* ── STATE: paused ── */
.output-pane[data-panel-state="paused"] .pause-overlay {
  display: flex;
}
.output-pane[data-panel-state="paused"] .pause-btn {
  opacity: 0; pointer-events: none;
}

/* ═══════════════════════════════════════
   LAYOUT MODES
   ═══════════════════════════════════════ */

/* ── LAYOUT: conversational ── */
.output-pane[data-panel-layout="conversational"] .chat-body {
  max-width: 720px; margin: 0 auto; width: 100%;
}
.output-pane[data-panel-layout="conversational"] .msg-user {
  opacity: 0.55;
}
.output-pane[data-panel-layout="conversational"] .msg-ai {
  max-width: 95%;
}

/* ── LAYOUT: code — pair programmer layout ── */
.output-pane[data-panel-layout="code"] {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  grid-template-areas:
    "tabs"
    "toolchain"
    "terminal"
    "code"
    "chat";
  gap: 0;
}
.output-pane[data-panel-layout="code"] .pane-tabs { grid-area: tabs; }
.output-pane[data-panel-layout="code"] .tool-chain-bar { grid-area: toolchain; }
.output-pane[data-panel-layout="code"] #pane-terminal {
  display: flex !important; grid-area: terminal;
  min-height: 120px; max-height: 30%;
}
.output-pane[data-panel-layout="code"] #pane-code {
  display: flex !important; grid-area: code;
  min-height: 80px; max-height: 35%;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.output-pane[data-panel-layout="code"] .chat-body {
  grid-area: chat; max-width: 100%;
  max-height: 35%;
}
.output-pane[data-panel-layout="code"] .chat-footer { display: none; }
.output-pane[data-panel-layout="code"] .pane-tab {
  font-size: 10px; padding: 4px 10px;
}

/* ── LAYOUT: visual ── */
.output-pane[data-panel-layout="visual"] .chat-body {
  max-width: 600px; margin: 0 auto;
}

/* ── LAYOUT: audio ── */
.output-pane[data-panel-layout="audio"] .chat-body {
  max-width: 600px; margin: 0 auto;
}

/* ═══════════════════════════════════════
   CHAT BODY
   ═══════════════════════════════════════ */

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px 12px;
  display: flex; flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb {
  background: var(--color-border); border-radius: 3px;
}

#chat-messages {
  display: flex; flex-direction: column;
  gap: 12px; min-height: 0;
}

#chat-scroll-anchor { height: 0; }

/* ═══════════════════════════════════════
   USER BUBBLE — minimal, de-emphasized
   ═══════════════════════════════════════ */

.msg-user {
  align-self: flex-end; max-width: 65%;
  animation: slideInRight 0.25s cubic-bezier(0.16,1,0.3,1) both;
}
.user-bubble {
  padding: 8px 14px;
  background: rgba(255,147,41,0.08);
  border: 1px solid rgba(255,147,41,0.15);
  border-radius: 14px 14px 4px 14px;
  font-size: 13px; line-height: 1.5;
  color: var(--color-text-secondary);
}

/* ═══════════════════════════════════════
   AI BUBBLE — full presence, glass
   ═══════════════════════════════════════ */

.msg-ai {
  display: flex; gap: 10px; max-width: 100%;
  animation: slideInLeft 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
.ai-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
  background: rgba(79,70,229,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  border: 1px solid rgba(79,70,229,0.15);
  overflow: hidden;
}
.ai-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
}
.ai-bubble {
  flex: 1; padding: 18px 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px 16px 16px 16px;
  transition: border-color 0.6s ease, box-shadow 0.6s ease, background 0.6s ease;
  overflow-wrap: break-word;
  position: relative;
}
.ai-bubble .bubble-content {
  font-size: 14px; line-height: 1.8;
  color: var(--color-text-primary);
  white-space: pre-wrap;
}

/* Streaming cursor */
.ai-bubble.streaming::after {
  content: '▊'; display: inline;
  animation: cursorBlink 0.8s step-end infinite;
  color: var(--glow-end); font-size: 14px; margin-left: 2px;
}

/* Streaming accent bar — gradient sweep across top */
.ai-bubble.streaming::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--glow-start), var(--glow-end), var(--glow-start));
  background-size: 200% 100%;
  animation: gradientSweep 2s linear infinite;
  pointer-events: none;
  border-radius: 16px 16px 0 0;
}

/* Done state */
.ai-bubble.done {
  border-color: rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
}
.ai-bubble.done::after { content: ''; }
.ai-bubble.done::before { display: none; }
.ai-bubble.done .bubble-content {
  white-space: normal;
}

/* Error state */
.ai-bubble.error {
  border-color: rgba(255,82,82,0.3);
  background: rgba(255,82,82,0.04);
}

/* ── Bubble Actions ── */
.bubble-actions {
  display: flex; gap: 6px; margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.04);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
}
.bubble-action-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; color: var(--color-text-muted);
  padding: 4px 10px; font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.bubble-action-btn:hover {
  background: rgba(255,147,41,0.1);
  border-color: rgba(255,147,41,0.2);
  color: var(--color-primary);
}

/* ═══════════════════════════════════════
   AI BUBBLE TYPOGRAPHY (markdown)
   ═══════════════════════════════════════ */

.ai-bubble .bubble-content p { margin: 0 0 12px; }
.ai-bubble .bubble-content p:last-child { margin-bottom: 0; }
.ai-bubble .bubble-content strong { color: var(--color-text-primary); font-weight: 600; }
.ai-bubble .bubble-content em { color: var(--color-text-secondary); font-style: italic; }
.ai-bubble .bubble-content code {
  background: rgba(255,147,41,0.1); padding: 2px 8px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 13px; color: var(--color-primary-light);
}
.ai-bubble .bubble-content pre {
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 16px 20px; overflow-x: auto; margin: 12px 0;
  font-size: 13px; line-height: 1.5;
}
.ai-bubble .bubble-content pre code { background: none; padding: 0; color: rgba(245,245,245,0.9); }
.ai-bubble .bubble-content :not(pre) > code { white-space: nowrap; }
.ai-bubble .bubble-content ul, .ai-bubble .bubble-content ol { margin: 8px 0 12px; padding-left: 24px; }
.ai-bubble .bubble-content li { margin: 4px 0; }
.ai-bubble .bubble-content h1, .ai-bubble .bubble-content h2, .ai-bubble .bubble-content h3 {
  color: var(--color-text-primary); font-weight: 600; margin: 20px 0 10px; letter-spacing: -0.01em;
}
.ai-bubble .bubble-content h1 { font-size: 16px; }
.ai-bubble .bubble-content h2 { font-size: 15px; }
.ai-bubble .bubble-content h3 { font-size: 14px; }
.ai-bubble .bubble-content blockquote {
  border-left: 3px solid var(--color-primary); padding: 8px 16px; margin: 12px 0;
  background: rgba(255,147,41,0.05); border-radius: 0 8px 8px 0; color: var(--color-text-muted);
}
.ai-bubble .bubble-content hr {
  border: none; border-top: 1px solid rgba(255,255,255,0.06); margin: 20px 0;
}
.ai-bubble .bubble-content a {
  color: var(--color-primary); text-decoration: none;
  border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.ai-bubble .bubble-content a:hover { border-bottom-color: var(--color-primary); }
.ai-bubble .bubble-content table {
  border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px;
}
.ai-bubble .bubble-content th, .ai-bubble .bubble-content td {
  border: 1px solid rgba(255,255,255,0.08); padding: 6px 10px; text-align: left;
}
.ai-bubble .bubble-content th {
  background: rgba(255,255,255,0.04); color: var(--color-text-primary); font-weight: 600;
}

/* ═══════════════════════════════════════
   TOOL CHAIN BAR — ambient, non-intrusive
   ═══════════════════════════════════════ */

.tool-chain-bar {
  height: 0; overflow: hidden; opacity: 0;
  transition: height 0.25s ease, opacity 0.25s ease, max-height 0.25s ease;
  background: rgba(0,0,0,0.15);
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 0 12px; align-items: center;
}
.tool-chain-bar.active {
  padding: 6px 12px;
}
.tool-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 12px; font-size: 10px;
  font-family: var(--font-mono); white-space: nowrap;
  border: 1px solid transparent; cursor: default;
  animation: pillEnter 0.2s ease both;
}
.tool-pill.running {
  background: rgba(79,70,229,0.08);
  border-color: rgba(79,70,229,0.2);
  color: var(--glow-start);
}
.tool-pill.running .tool-pill-status { animation: pillSpin 1s linear infinite; }
.tool-pill.done {
  background: rgba(0,230,118,0.08);
  border-color: rgba(0,230,118,0.2);
  color: var(--color-success);
}
.tool-pill-icon { font-size: 10px; }
.tool-pill-name { font-weight: 500; }
.tool-pill-status { font-size: 9px; }

/* ═══════════════════════════════════════
   PAUSE OVERLAY
   ═══════════════════════════════════════ */

.pause-overlay {
  position: absolute; inset: 0;
  background: rgba(5,5,10,0.88);
  backdrop-filter: blur(16px);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease both;
}
.pause-dialog {
  background: rgba(31,40,51,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 0;
  max-width: 520px; width: 90%;
  box-shadow: var(--glass-shadow);
}
.pause-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pause-icon { font-size: 16px; }
.pause-title {
  flex: 1; font-size: 13px; font-weight: 600;
  color: var(--color-text-primary);
}
.pause-close {
  background: none; border: none; color: var(--color-text-muted);
  font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: all 0.15s;
}
.pause-close:hover { background: rgba(255,255,255,0.05); color: var(--color-text-primary); }

.pause-body { padding: 16px 20px; }
.snapshot-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--color-text-muted); margin-bottom: 6px;
}
.snapshot-text {
  font-size: 13px; line-height: 1.6; color: var(--color-text-secondary);
  max-height: 120px; overflow-y: auto; margin-bottom: 16px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3); border-radius: 8px;
  font-family: var(--font-mono); font-size: 11px; white-space: pre-wrap;
}
.followup-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--color-text-muted); margin-bottom: 6px;
}
.followup-input {
  width: 100%; padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; color: var(--color-text-primary);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.5;
  resize: none; outline: none;
  transition: border-color 0.15s;
}
.followup-input:focus { border-color: var(--color-primary); }

.pause-actions {
  display: flex; gap: 8px;
  padding: 12px 20px 20px;
}
.pause-action-btn {
  flex: 1; padding: 10px 16px; border-radius: 10px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: none; transition: all 0.15s;
  font-family: var(--font-sans);
}
.pause-action-btn.primary {
  background: linear-gradient(135deg, var(--glow-start), var(--glow-end));
  color: #fff;
  box-shadow: 0 2px 12px rgba(79,70,229,0.3);
}
.pause-action-btn.primary:hover { opacity: 0.9; }
.pause-action-btn.secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--color-text-secondary);
}
.pause-action-btn.secondary:hover {
  background: rgba(255,255,255,0.1);
  color: var(--color-text-primary);
}

/* ═══════════════════════════════════════
   PAUSE BUTTON (floating, during streaming)
   ═══════════════════════════════════════ */

.pause-btn {
  position: absolute; top: 44px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--color-text-muted); cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, background 0.15s;
  z-index: 10; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.pause-btn:hover {
  background: rgba(255,147,41,0.1);
  border-color: rgba(255,147,41,0.2);
  color: var(--color-primary);
}

/* ═══════════════════════════════════════
   CHAT FOOTER (follow-up input)
   ═══════════════════════════════════════ */

.chat-footer {
  flex-shrink: 0; padding: 10px 12px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
  transition: opacity 0.3s;
}
.chat-footer-inner {
  display: flex; gap: 8px; align-items: center;
}
.followup-input-bar {
  flex: 1; padding: 10px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px; color: var(--color-text-primary);
  font-family: var(--font-sans); font-size: 13px;
  outline: none; transition: border-color 0.15s;
}
.followup-input-bar:focus { border-color: rgba(255,147,41,0.3); }
.followup-input-bar::placeholder { color: var(--color-text-muted); }

.send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-primary); border: none;
  color: #000; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.send-btn:hover { transform: scale(1.08); }

/* ═══════════════════════════════════════
   KEYFRAME ANIMATIONS
   ═══════════════════════════════════════ */

@keyframes slideInRight {
  0% { opacity: 0; transform: translateX(16px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  0% { opacity: 0; transform: translateX(-12px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes gradientSweep {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes pillEnter {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes pillSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ═══════════════════════════════════════
   TERMINAL SURFACE — sandbox
   ═══════════════════════════════════════ */

.term-surface { display: flex; flex-direction: column; height: 100%; background: #0a0a0d; }
.term-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid rgba(255,147,41,0.1);
  background: rgba(0,0,0,0.3); flex-shrink: 0;
}
.term-label {
  font-size: 11px; color: var(--color-text-muted);
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .8px; font-weight: 600;
}
.term-label::before { content: '⬡ '; color: var(--color-primary); }
.term-status {
  font-size: 10px; color: var(--color-text-muted);
  font-family: var(--font-mono); margin-left: auto;
}
.term-viewport {
  flex: 1; background: #0a0a0d; overflow: hidden;
  padding: 8px;
}
.term-viewport .terminal { height: 100%; }
.term-viewport .xterm { height: 100%; padding: 4px; }
.term-viewport .xterm-viewport { scrollbar-width: thin; }
.term-viewport:empty::after {
  content: 'Click into terminal to activate sandbox';
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 12px; color: var(--color-text-muted);
  font-family: var(--font-mono); opacity: 0.5;
}

/* ═══════════════════════════════════════
   DEBUG OVERLAY — hold D to show SSE events
   ═══════════════════════════════════════ */

body.debug-active #debug-overlay { transform: translateX(0); opacity: 1; }
#debug-overlay {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 45vw; max-width: 600px;
  background: rgba(5,5,10,0.94);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--color-primary);
  z-index: 9000;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
  display: flex; flex-direction: column;
  font-family: var(--font-mono);
  pointer-events: none;
}
#debug-overlay .debug-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
#debug-overlay .debug-header h3 {
  margin: 0; font-size: 11px; font-weight: 600; color: var(--color-primary);
  text-transform: uppercase; letter-spacing: 1px;
}
#debug-overlay .debug-body {
  flex: 1; overflow-y: auto; padding: 8px 0;
}
#debug-overlay .debug-entry {
  padding: 5px 16px; border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 11px; line-height: 1.5;
}
#debug-overlay .debug-entry .entry-time {
  color: var(--color-text-muted); font-size: 10px; margin-right: 8px;
}
#debug-overlay .debug-entry .entry-type {
  font-weight: 600; margin-right: 8px;
}
#debug-overlay .debug-entry .entry-content {
  color: var(--color-text-secondary); word-break: break-all;
}
#debug-overlay .debug-entry.type-tool_call .entry-type { color: #58a6ff; }
#debug-overlay .debug-entry.type-tool_result .entry-type { color: #3fb950; }
#debug-overlay .debug-entry.type-thought .entry-type { color: #d29922; }
#debug-overlay .debug-entry.type-token .entry-type { color: #ff9329; }
#debug-overlay .debug-entry.type-done .entry-type { color: #f5f5f5; }
#debug-overlay .debug-entry.type-error .entry-type { color: #f85149; }

/* ═══════════════════════════════════════
   VOICE LYRICS OVERLAY
   ═══════════════════════════════════════ */

.voice-lyrics {
  position: absolute; bottom: 58%; left: 50%;
  transform: translateX(-50%); width: 80%; max-width: 520px;
  text-align: center; z-index: 15;
  transition: opacity 0.4s ease, transform 0.4s ease;
  padding: 12px 20px; background: rgba(0,0,0,0.35);
  backdrop-filter: blur(12px); border-radius: 16px;
  border: 1px solid rgba(255,147,41,0.15);
}
.voice-lyrics.hidden { opacity: 0; transform: translateX(-50%) translateY(10px); pointer-events: none; }
.voice-lyrics.active { opacity: 1; transform: translateX(-50%) translateY(0); }
.voice-lyrics-prompt {
  font-size: 1.05rem; color: rgba(255,147,41,0.65);
  font-style: italic; margin-bottom: 4px;
  animation: statePulse 2s ease-in-out infinite;
  transition: opacity 0.3s ease, max-height 0.3s ease;
  max-height: 40px; overflow: hidden;
}
.voice-lyrics-prompt.fade-out { opacity: 0; max-height: 0; margin-bottom: 0; }
.voice-lyrics-stream {
  font-size: 1.35rem; line-height: 1.8; font-weight: 500;
  min-height: 30px; color: rgba(245,245,245,0.95);
}
.voice-lyrics-stream .lyric-word {
  display: inline; opacity: 0;
  animation: wordReveal 0.35s ease forwards;
  text-shadow: 0 0 12px rgba(255,147,41,0.4);
}
.voice-lyrics.fade-out { opacity: 0; transform: translateX(-50%) translateY(-10px); }
.voice-lyrics::before {
  content: '🎤'; position: absolute; top: -14px; left: 50%;
  transform: translateX(-50%); font-size: 18px;
  animation: micPulse 1s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.7; }
  50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}
.voice-lyrics.fade-out { opacity: 0; transform: translateX(-50%) translateY(-10px); }

/* ═══════════════════════════════════════
   STATE MESSAGE (above orb)
   ═══════════════════════════════════════ */

.state-message {
  position: absolute; top: 20px; left: 50%;
  transform: translateX(-50%); padding: 8px 16px;
  background: rgba(255,147,41,0.1); border: 1px solid var(--glass-border);
  border-radius: 20px; font-size: 0.85rem; color: var(--accent-orange);
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none; z-index: 10;
}
.state-message.visible { opacity: 1; }
.state-message.thinking { animation: statePulse 1.5s ease-in-out infinite; }

@keyframes statePulse { 0%,100% { opacity: 0.8; } 50% { opacity: 1; } }

/* ═══════════════════════════════════════
   HAS-RESPONSE STATE
   ═══════════════════════════════════════ */

.has-response .preview-empty { display: none; }
.gen-cards {
  flex: 1; overflow-y: auto; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.preview-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 8px; color: var(--color-text-muted);
}
.preview-empty .empty-icon { font-size: 28px; }
.preview-empty p { margin: 0; font-size: 13px; }
