/* ============================================================
   BlossomAI — Design System
   ============================================================ */

:root {
  /* Brand palette */
  --pink-50:  #fff0f7;
  --pink-100: #ffd6ee;
  --pink-200: #ffb3dd;
  --pink-300: #ff80c5;
  --pink-400: #ff5aa8;
  --pink-500: #e63e8e;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --sky-400:   #38bdf8;

  /* Accent (tone-reactive, overridden via data-tone) */
  --accent-from: #ff6b9d;
  --accent-to:   #c084fc;
  --accent-gradient: linear-gradient(135deg, var(--accent-from), var(--accent-to));

  /* Surfaces */
  --bg-page:    #fff7fb;
  --bg-surface: #ffffff;
  --bg-ai-bubble:   #f5eeff;
  --bg-user-bubble: var(--accent-gradient);
  --glass:        rgba(255, 255, 255, 0.72);
  --glass-border: rgba(200, 150, 210, 0.25);
  --glass-hover:  rgba(255, 255, 255, 0.88);

  /* Text */
  --text-primary:   #1a0a2e;
  --text-secondary: #6b4f7a;
  --text-muted:     #a07cb5;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(100, 50, 130, 0.08);
  --shadow-md: 0 4px 20px rgba(180, 80, 180, 0.14);
  --shadow-lg: 0 10px 40px rgba(140, 60, 160, 0.18);

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Motion */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 140ms;
  --t-base: 240ms;
  --t-slow: 380ms;

  /* Layout */
  --sidebar-w: 256px;
  --topbar-h:  56px;
}

/* ── Dark mode overrides ──────────────────────────────────── */
body.dark {
  --bg-page:    #0d0015;
  --bg-surface: #160a22;
  --bg-ai-bubble:   rgba(255, 255, 255, 0.055);
  --glass:        rgba(22, 10, 34, 0.82);
  --glass-border: rgba(255, 180, 255, 0.1);
  --glass-hover:  rgba(30, 15, 45, 0.9);
  --text-primary:   #f5e6ff;
  --text-secondary: #c4a3d8;
  --text-muted:     #7a5a90;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.55);
}

/* ── Tone-reactive accent colors ─────────────────────────── */
body[data-tone="soft"]  { --accent-from: #ff6b9d; --accent-to: #c084fc; }
body[data-tone="sassy"] { --accent-from: #ff4d00; --accent-to: #ff1493; }
body[data-tone="pro"]   { --accent-from: #6366f1; --accent-to: #38bdf8; }
body[data-tone="wise"]  { --accent-from: #8b5cf6; --accent-to: #6366f1; }

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background:
    linear-gradient(145deg, rgba(255, 107, 157, 0.12), transparent 28%),
    linear-gradient(215deg, rgba(56, 189, 248, 0.12), transparent 34%),
    linear-gradient(180deg, var(--bg-page), #11051d 58%, #09000f);
  color: var(--text-primary);
  overflow: hidden;
  transition: background var(--t-slow) var(--ease-out),
              color var(--t-base) var(--ease-out);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent 82%);
  z-index: 0;
}

body:not(.dark) {
  background:
    linear-gradient(145deg, rgba(255, 107, 157, 0.18), transparent 28%),
    linear-gradient(215deg, rgba(56, 189, 248, 0.14), transparent 34%),
    linear-gradient(180deg, var(--bg-page), #fff7fb);
}

button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
textarea { font-family: inherit; font-size: inherit; resize: none; }
img { display: block; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 98;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  animation: fadeIn var(--t-base) ease both;
}
body.sidebar-open .sidebar-backdrop { display: block; }

.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh; z-index: 99;
  background: var(--glass);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateX(-100%);
  transition: transform var(--t-slow) var(--ease-out),
              box-shadow var(--t-slow) var(--ease-out);
  display: flex; flex-direction: column;
  padding: 16px; gap: 20px; overflow-y: auto;
}
body.sidebar-open .sidebar {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
}
.sidebar-logo { width: 28px; height: 28px; border-radius: 8px; }
.sidebar-title { font-weight: 700; font-size: 15px; flex: 1; color: var(--text-primary); }
.sidebar-close { color: var(--text-muted); }

.sidebar-section { display: flex; flex-direction: column; gap: 8px; }

.sidebar-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-muted);
}

.new-chat-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: white; font-weight: 600; font-size: 14px;
  transition: opacity var(--t-fast), transform var(--t-fast);
  box-shadow: var(--shadow-md);
}
.new-chat-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.chat-history { display: flex; flex-direction: column; gap: 4px; }
.history-empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; }

.history-item {
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.history-item:hover {
  background: rgba(180, 100, 220, 0.08);
  color: var(--text-primary);
  border-color: var(--glass-border);
}
.history-item.active {
  background: var(--pink-50);
  color: var(--pink-500);
  border-color: var(--pink-200);
}
body.dark .history-item.active {
  background: rgba(255, 107, 157, 0.1);
  border-color: rgba(255, 107, 157, 0.22);
}

.sidebar-shortcuts { margin-top: auto; }
.shortcut {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted); padding: 3px 0;
}
kbd {
  display: inline-block; padding: 2px 7px; font-size: 11px;
  font-family: ui-monospace, monospace;
  background: rgba(180, 140, 210, 0.12);
  border: 1px solid var(--glass-border);
  border-radius: 5px; color: var(--text-secondary);
}

/* ── Top bar ─────────────────────────────────────────────── */
.top-bar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; height: var(--topbar-h);
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}
.top-left, .top-right { display: flex; align-items: center; gap: 6px; }

.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: var(--text-primary);
}
.brand-icon { width: 22px; height: 22px; border-radius: 6px; }
.api-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 107, 157, 0.12);
  border: 1px solid rgba(255, 107, 157, 0.25);
  color: var(--pink-300);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body[data-api-mode="live"] .api-badge {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
  color: #86efac;
}

/* ── Shared icon button ───────────────────────────────────── */
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  background: rgba(180, 140, 210, 0.1);
  border: 1px solid var(--glass-border);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover {
  background: rgba(180, 140, 210, 0.2);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.icon-btn:active { transform: translateY(0) scale(0.95); }

/* ── Main layout ─────────────────────────────────────────── */
.main-layout {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100vh;
  max-width: 820px;
  margin: 0 auto;
  border-left: 1px solid rgba(255,255,255,0.06);
  border-right: 1px solid rgba(255,255,255,0.06);
}

/* ── Chat main ───────────────────────────────────────────── */
.chat-main {
  flex: 1; overflow-y: auto;
  padding: 24px 18px 12px;
  display: flex; flex-direction: column;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-main::-webkit-scrollbar { display: none; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 32px 16px 24px;
  animation: fadeInUp var(--t-slow) var(--ease-out) both;
}
.hero.hidden { display: none; }

.avatar-wrap { position: relative; display: inline-block; }
.hero-avatar {
  width: 86px; height: 86px; border-radius: 50%;
  border: 3px solid var(--pink-300);
  box-shadow: 0 0 0 7px var(--pink-100), var(--shadow-md);
  animation: avatarPulse 3.2s ease-in-out infinite;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
body.dark .hero-avatar {
  border-color: rgba(255, 107, 157, 0.5);
  box-shadow: 0 0 0 7px rgba(255, 107, 157, 0.08), var(--shadow-md);
}

.status-dot {
  position: absolute; bottom: 4px; right: 4px;
  width: 14px; height: 14px;
  background: #22c55e; border-radius: 50%;
  border: 2.5px solid var(--bg-page);
  animation: statusPulse 2.2s ease-in-out infinite;
  transition: border-color var(--t-slow);
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px); font-weight: 900; letter-spacing: 0;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: background-image var(--t-slow);
}
.tagline {
  font-size: 15px; color: var(--text-secondary); margin-top: -10px;
  max-width: 560px;
  text-align: center;
}

.demo-callout {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 560px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
}
.demo-callout[hidden] { display: none; }
.demo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink-300);
  box-shadow: 0 0 0 5px rgba(255, 107, 157, 0.12);
  flex-shrink: 0;
}

.status-panel {
  display: grid;
  gap: 2px;
  min-width: min(100%, 360px);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
.status-panel span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-panel strong {
  color: var(--text-primary);
  font-size: 13px;
}

/* ── Tone selector (hero) ────────────────────────────────── */
.tone-selector { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.workflow-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 560px;
}

.tone-btn,
.workflow-btn {
  padding: 8px 18px; border-radius: 100px; font-size: 14px; font-weight: 600;
  border: 1.5px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-secondary);
  backdrop-filter: blur(10px);
  transition: all var(--t-fast);
}
.workflow-btn {
  padding: 7px 14px;
  font-size: 12.5px;
}
.tone-btn:hover,
.workflow-btn:hover {
  background: var(--pink-50); border-color: var(--pink-300);
  color: var(--pink-500); transform: translateY(-1px);
}
.tone-btn.active,
.workflow-btn.active {
  background: var(--accent-gradient);
  border-color: transparent; color: white;
  box-shadow: var(--shadow-md);
}
body.dark .tone-btn,
body.dark .workflow-btn { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
body.dark .tone-btn:hover,
body.dark .workflow-btn:hover {
  background: rgba(255, 107, 157, 0.12);
  border-color: rgba(255, 107, 157, 0.3);
  color: var(--pink-300);
}

/* ── Prompt chips ────────────────────────────────────────── */
.prompts-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 9px; width: 100%; max-width: 520px; margin-top: 6px;
  max-height: 260px; overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.prompts-grid::-webkit-scrollbar { display: none; }
.prompt-chip {
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--glass-border);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  text-align: left; line-height: 1.45;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast);
}
.prompt-chip:hover {
  border-color: var(--pink-300); color: var(--pink-500);
  background: var(--pink-50); transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
body.dark .prompt-chip { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.07); }
body.dark .prompt-chip:hover {
  background: rgba(255, 107, 157, 0.1);
  border-color: rgba(255, 107, 157, 0.28);
  color: var(--pink-300);
}

.feature-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 620px;
}
.feature-strip span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
}
body:not(.dark) .feature-strip span,
body:not(.dark) .demo-callout,
body:not(.dark) .status-panel {
  background: rgba(255,255,255,0.72);
  border-color: var(--glass-border);
}

/* ── Chat box ────────────────────────────────────────────── */
.chat-box { display: flex; flex-direction: column; gap: 18px; flex: 1; }

/* ── Message row ─────────────────────────────────────────── */
.message-row {
  display: flex; gap: 10px;
  animation: bubbleIn var(--t-base) var(--ease-spring) both;
}
.message-row.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 17px; align-self: flex-end;
}
.message-row.blossom .msg-avatar {
  background: var(--pink-100);
}
body.dark .message-row.blossom .msg-avatar { background: rgba(255, 107, 157, 0.12); }
.message-row.user .msg-avatar {
  background: var(--accent-gradient);
  color: white; font-size: 13px; font-weight: 700;
  transition: background var(--t-slow);
}

.bubble-wrap {
  display: flex; flex-direction: column; gap: 4px;
  max-width: 74%;
}
.message-row.user .bubble-wrap { align-items: flex-end; }

.bubble {
  padding: 11px 15px; border-radius: 18px;
  font-size: 15px; line-height: 1.65;
  word-break: break-word; white-space: pre-wrap;
}
.message-row.user .bubble {
  background: var(--accent-gradient);
  color: white; border-bottom-right-radius: 4px;
  transition: background var(--t-slow);
}
.message-row.blossom .bubble {
  background: var(--bg-ai-bubble);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--glass-border);
}
body.dark .message-row.blossom .bubble {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.09);
}

/* Streaming cursor */
.bubble.streaming::after {
  content: '▋'; display: inline;
  color: var(--accent-from);
  animation: blink 0.75s step-end infinite;
}

/* Markdown in AI bubbles */
.bubble strong { font-weight: 700; }
.bubble em { font-style: italic; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 6px 0; }
.bubble li { margin: 3px 0; }
.bubble code {
  background: rgba(0,0,0,0.09); padding: 1px 5px;
  border-radius: 4px; font-size: 13px;
  font-family: ui-monospace, 'Fira Code', monospace;
}
.message-row.user .bubble code { background: rgba(255,255,255,0.22); }

/* Bubble meta (time + actions) */
.bubble-meta {
  display: flex; align-items: center; gap: 8px;
  opacity: 0; transition: opacity var(--t-fast);
}
.message-row:hover .bubble-meta { opacity: 1; }

.bubble-time { font-size: 11px; color: var(--text-muted); }
.bubble-actions { display: flex; gap: 4px; }

.bubble-action {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  background: rgba(180, 140, 210, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.bubble-action:hover { background: rgba(180, 140, 210, 0.2); color: var(--text-primary); }
.bubble-action.copied {
  background: #dcfce7; border-color: #86efac; color: #16a34a;
}

/* ── Typing indicator ────────────────────────────────────── */
.typing-indicator {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 4px;
  animation: fadeIn var(--t-base) ease both;
}
.typing-indicator.hidden { display: none; }

.typing-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--pink-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
body.dark .typing-avatar { background: rgba(255,107,157,0.12); }

.dots {
  display: flex; gap: 4px; padding: 10px 14px;
  background: var(--bg-ai-bubble);
  border: 1px solid var(--glass-border);
  border-radius: 18px; border-bottom-left-radius: 4px;
}
body.dark .dots {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.09);
}
.dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pink-300);
  animation: dotBounce 1.4s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

/* ── Compact tone bar ────────────────────────────────────── */
.tone-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.tone-bar.hidden { display: none; }

.tone-btn-sm {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; border: 1.5px solid transparent;
  background: rgba(180, 140, 210, 0.1);
  transition: all var(--t-fast);
}
.tone-btn-sm.active {
  border-color: var(--accent-from);
  background: rgba(180, 100, 220, 0.12);
  box-shadow: 0 0 0 3px rgba(200, 100, 220, 0.14);
}
.tone-btn-sm:hover:not(.active) {
  background: rgba(180, 140, 210, 0.2);
  transform: scale(1.1);
}

.tone-label {
  font-size: 12px; color: var(--text-muted);
  font-weight: 600; margin-left: 2px;
}

/* ── Input footer ────────────────────────────────────────── */
.input-footer {
  padding: 12px 16px 18px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.input-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-surface);
  border: 1.5px solid var(--glass-border);
  border-radius: 22px; padding: 8px 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-wrap:focus-within {
  border-color: var(--accent-from);
  box-shadow: 0 0 0 3px rgba(200, 100, 220, 0.12), var(--shadow-sm);
}
body.dark .input-wrap {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.09);
}
body.dark .input-wrap:focus-within {
  border-color: rgba(200, 100, 220, 0.45);
  box-shadow: 0 0 0 3px rgba(200,100,220,0.1);
}

.voice-btn {
  flex-shrink: 0; border-radius: 50%;
  color: var(--text-muted);
  background: transparent; border: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.voice-btn:hover { background: var(--pink-100); color: var(--pink-500); }
.voice-btn.recording {
  background: #fee2e2; color: #ef4444;
  animation: avatarPulse 1s ease-in-out infinite;
}
body.dark .voice-btn:hover { background: rgba(255,107,157,0.15); color: var(--pink-300); }

#userInput {
  flex: 1; border: none; background: none; outline: none;
  font-size: 15px; color: var(--text-primary);
  line-height: 1.5; max-height: 130px; overflow-y: auto;
  padding: 2px 0;
}
#userInput::placeholder { color: var(--text-muted); }

.send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-gradient);
  color: white; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-slow);
}
.send-btn:hover { transform: scale(1.06); box-shadow: var(--shadow-md); }
.send-btn:active { transform: scale(0.93); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

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

/* ── Toast notifications ─────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 88px; right: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 10px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  background: var(--text-primary); color: var(--bg-page);
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--t-base) var(--ease-spring) both;
  pointer-events: auto;
}
.toast.success { background: #15803d; color: white; }
.toast.error   { background: #dc2626; color: white; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes bubbleIn {
  from { opacity: 0; transform: scale(0.82) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes avatarPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  50%       { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
}
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.45; }
  40%            { transform: scale(1.25); opacity: 1; }
}
@keyframes blink {
  0%, 100% { opacity: 1; } 50% { opacity: 0; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.88); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .main-layout { max-width: 100%; }
  .prompts-grid { grid-template-columns: 1fr; }
  .sidebar-shortcuts { display: none; }
  .bubble-wrap { max-width: 86%; }
  .hero h1 { font-size: 24px; }
  .hero { padding: 20px 12px 16px; gap: 14px; }
}

/* ── Accessibility ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
:focus-visible {
  outline: 2px solid var(--accent-from);
  outline-offset: 2px;
}
