/* ============================================================
   ALLMA — Narodziny Tożsamości (2026-03-12)
   Paleta: Ciepły plum + Amber/Gold + Szałwia
   Typografia: Playfair Display (wordmark) + Inter 300 (body)
   Filozofia: Ciepło, oddech, bezpieczeństwo, mniej = więcej
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Warm Therapeutic Palette — dark-first */
  --bg: #1a1118;
  --surface: #2a2025;
  --surface-hover: #352e32;
  --border: rgba(212, 160, 112, 0.1);
  --accent: #d4a070;
  --accent-light: #e0b88a;
  --accent-bg: rgba(212, 160, 112, 0.08);
  --sage: #7a9b6d;
  --sage-bg: rgba(122, 155, 109, 0.08);
  --gold: #d4a070;
  --gold-bg: rgba(212, 160, 112, 0.06);
  --text-primary: #ede8e0;
  --text-secondary: #b0a89e;
  --text-muted: #7a7068;
  --success: #7a9b6d;
  --warning: #d4a070;
  --error: #c45b5b;
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --breath-duration: 8s;
}

/* Light mode override */
[data-theme="light"] {
  --bg: #faf5f0;
  --surface: #ffffff;
  --surface-hover: #f5f0ea;
  --border: rgba(42, 32, 37, 0.1);
  --accent: #8a6540;
  --accent-light: #a07850;
  --accent-bg: rgba(138, 101, 64, 0.06);
  --sage: #5a8050;
  --sage-bg: rgba(90, 128, 80, 0.08);
  --gold: #8a6540;
  --gold-bg: rgba(138, 101, 64, 0.06);
  --text-primary: #2a2025;
  --text-secondary: #6a6060;
  --text-muted: #9a9090;
  --success: #5a8050;
  --warning: #8a6540;
  --error: #c45b5b;
}

/* ── Breathing Animations ── */
@keyframes breathe-line {
  0%, 100% { width: 40px; opacity: 0.4; }
  50% { width: 80px; opacity: 0.9; }
}

@keyframes hero-breathe {
  0%, 100% { opacity: 0.04; transform: scale(1); }
  50% { opacity: 0.10; transform: scale(1.08); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gentle-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 160, 112, 0); }
  50% { box-shadow: 0 0 24px 4px rgba(212, 160, 112, 0.08); }
}

@keyframes aurora-drift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes thinking-dots {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Noise texture overlay (futuristic grain) ── */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Scroll-driven reveal (CSS-native where supported) ── */
@supports (animation-timeline: view()) {
  .reveal {
    animation: fade-in-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
  .reveal.visible {
    /* Override not needed — CSS scroll handles it */
  }
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* iOS safe area */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   Landing Page
   ============================================================ */

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ── */
.allma-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  padding: 0.75rem 1.5rem;
  background: rgba(26, 17, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 160, 112, 0.06);
}

[data-theme="light"] .allma-nav {
  background: rgba(250, 245, 240, 0.85);
}

[data-theme="light"] .login-section {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .hero::before {
  background: radial-gradient(ellipse, rgba(138, 101, 64, 0.06), transparent 70%);
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(212, 160, 112, 0.08), transparent 70%);
  animation: hero-breathe var(--breath-duration) ease-in-out infinite;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  animation: fade-in-up 1.5s ease-out;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 0;
  -webkit-text-fill-color: var(--accent);
}

.hero-breath-line {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin: 1.5rem auto;
  animation: breathe-line var(--breath-duration) ease-in-out infinite;
}

.subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 420px;
  font-weight: 300;
  margin-left: auto;
  margin-right: auto;
}

/* Hero CTA */
.hero-cta {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--bg);
  background: var(--accent);
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
  animation: gentle-pulse 5s ease-in-out infinite;
}

.hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(212, 160, 112, 0.2);
}

/* ── ScrollReveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Section Overline ── */
.section-overline {
  font-family: var(--font);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  text-align: center;
}

/* ── Intent Cards ── */
.intent-section {
  max-width: 560px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.intent-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.intent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.3rem;
  cursor: pointer;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  text-decoration: none;
  display: block;
}

.intent-card:hover {
  border-color: rgba(212, 160, 112, 0.25);
  box-shadow: 0 0 30px rgba(212, 160, 112, 0.05);
}

.intent-card h3 {
  font-family: var(--font);
  font-weight: 300;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ── Process Timeline ── */
.process-section {
  max-width: 440px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.process-steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  padding-left: 2rem;
}

.process-steps::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0.4;
}

.process-step {
  position: relative;
}

.process-step::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-2px);
}

.process-step h3 {
  font-family: var(--font);
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.process-step p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-weight: 300;
}

/* ── Trust Section ── */
.trust-section {
  max-width: 440px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.trust-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.trust-item {
  font-family: var(--font);
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.trust-item:last-child {
  border-bottom: none;
}

/* ── Footer (aurora line) ── */
.allma-footer {
  border-top: none;
  padding: 3rem 1.5rem 2rem;
  margin-top: 2rem;
  position: relative;
}

.allma-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--sage), var(--accent), transparent);
  background-size: 200% 100%;
  animation: aurora-drift 12s ease-in-out infinite;
}

.footer-inner {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.footer-wordmark {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.footer-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-style: italic;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-legal {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 1rem;
}

/* Login subtext */
.login-subtext {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Login Section (glassmorphism) ── */
.login-section {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
  padding: 2rem;
  background: rgba(42, 32, 37, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.login-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.login-form input {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px; /* Prevent iOS auto-zoom on focus */
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.login-form input::placeholder {
  color: var(--text-muted);
}

.btn-primary {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.04em;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212, 160, 112, 0.25);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-error {
  display: none;
  color: var(--error);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.3rem;
}

/* Disclaimer — positive framing */
.disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  max-width: 500px;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  background: var(--sage-bg);
  border-radius: 8px;
  border: 1px solid rgba(143, 174, 126, 0.15);
}


/* ============================================================
   Guide Page — How It Works
   ============================================================ */

.guide-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.guide-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.guide-back {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
  padding: 0.5rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.guide-back:hover {
  opacity: 0.7;
}

.guide-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guide-lang-switcher {
  display: flex;
  gap: 0.25rem;
}

.guide-hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  background: linear-gradient(180deg, var(--accent-bg) 0%, transparent 100%);
}

.guide-hero-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.guide-hero h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.guide-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.guide-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  width: 100%;
}

.guide-section {
  margin-bottom: 2.5rem;
}

.guide-section-icon {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

.guide-section h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.guide-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

.guide-section-important {
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  padding: 1.2rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Agent list in guide */
.guide-agents {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0.8rem;
}

.guide-agent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.guide-agent:hover {
  border-color: var(--accent);
}

.ga-emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.ga-name {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Commands reference in guide */
.guide-commands {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0.6rem;
}

.guide-cmd {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-cmd code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--accent, #7c3aed);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Steps in guide */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 1rem;
}

.guide-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* CTA button */
.guide-cta {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.guide-cta-btn {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.guide-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(74, 63, 138, 0.25);
}

/* Guide footer */
.guide-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Guide responsive */
@media (max-width: 480px) {
  .guide-hero {
    padding: 2rem 1rem 1.5rem;
  }

  .guide-hero h1 {
    font-size: 1.5rem;
  }

  .guide-content {
    padding: 1rem 1rem 2rem;
  }

  .guide-section h2 {
    font-size: 1.15rem;
  }

  .guide-lang-switcher {
    display: none;
  }

  .guide-topbar {
    padding: 0.6rem 1rem;
  }
}

/* ============================================================
   Chat Layout — 3-column dashboard
   ============================================================ */

.chat-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* iOS keyboard-safe: dynamic viewport height */
  width: 100%;
}

.chat-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.chat-center {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* ============================================================
   Left Sidebar — Agent Tiles
   ============================================================ */

.sidebar-left {
  width: 90px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.sidebar-toggle-btn {
  display: none;
}

.agent-tiles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.agent-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  aspect-ratio: 1;
  width: 100%;
}

.agent-tile:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.agent-tile.active {
  background: var(--accent-bg);
  border-color: var(--accent);
}

.agent-tile.active .agent-tile-name {
  color: var(--accent);
  font-weight: 600;
}

.agent-tile-emoji {
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.agent-tile.active .agent-tile-emoji {
  color: var(--accent);
}

.agent-tile:hover .agent-tile-emoji {
  color: var(--text-secondary);
}

.agent-tile-name {
  font-size: 0.6rem;
  font-family: var(--font);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}

/* ============================================================
   Left Sidebar — Action Buttons (Word upload, Clear chat)
   ============================================================ */

.sidebar-actions {
  margin-top: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
}

.sidebar-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-action-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

.sidebar-action-btn:active {
  transform: scale(0.93);
  transition-duration: 0.1s;
}

.sidebar-action-btn .action-emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.sidebar-action-btn .action-label {
  font-size: 0.55rem;
  font-family: var(--font);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}

.sidebar-action-btn.sidebar-action-danger:hover {
  background: rgba(196, 91, 91, 0.08);
  border-color: var(--error);
}

.sidebar-action-btn.sidebar-action-danger:hover .action-label {
  color: var(--error);
}

/* ============================================================
   Right Sidebar — Info Panel
   ============================================================ */

.sidebar-right {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.info-panel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.info-panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.info-icon {
  font-size: 1rem;
}

.info-panel-content {
  flex: 1;
}

.info-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  gap: 8px;
}

.info-placeholder-icon {
  font-size: 1.8rem;
  opacity: 0.5;
}

.info-placeholder p {
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ============================================================
   Bottom Bar — Calorie Counter
   ============================================================ */

.calorie-bar {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
}

.calorie-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.calorie-icon {
  font-size: 1.2rem;
}

.calorie-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.calorie-total {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.calorie-divider {
  color: var(--border);
  font-size: 0.8rem;
}

.calorie-macro {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.calorie-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.calorie-tip {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 4px 16px 2px;
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.4;
  opacity: 0.85;
}

.calorie-tip:empty {
  display: none;
}

.calorie-tip .tip-icon {
  margin-right: 4px;
}

/* Mini footer links on chat page */
.chat-footer-links {
  text-align: center;
  padding: 6px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.chat-footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.delete-history-link {
  color: var(--text-muted) !important;
  opacity: 0.7;
}
.delete-history-link:hover {
  color: #e74c3c !important;
  opacity: 1;
}

/* Guide page footer links */
.guide-footer-links {
  margin-top: 0.3rem;
  font-size: 0.8rem;
}

.guide-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.guide-footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  overflow: visible;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chat-header-wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.2em;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-btn {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px; /* mobile touch target */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-btn:hover, .lang-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

.logout-btn {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px; /* mobile touch target */
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--bg);
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}

/* Message bubbles */
.message {
  max-width: 85%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  line-height: 1.6;
  font-size: 0.95rem;
  word-wrap: break-word;
  animation: fadeIn 0.2s ease;
}

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

.message.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Markdown in assistant messages */
.message.assistant strong {
  color: var(--accent);
  font-weight: 600;
}

.message.assistant em {
  color: var(--text-secondary);
  font-style: italic;
}

.message.assistant code {
  background: var(--accent-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.message.assistant pre {
  background: #F0EDE8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  margin: 0.5rem 0;
  overflow-x: auto;
  font-size: 0.85rem;
}

.message.assistant pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.message.assistant ul, .message.assistant ol {
  margin: 0.4rem 0;
  padding-left: 1.5rem;
}

.message.assistant li {
  margin-bottom: 0.2rem;
}

.message.assistant blockquote {
  border-left: 3px solid var(--sage);
  padding-left: 0.8rem;
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.message.system {
  align-self: center;
  background: var(--accent-bg);
  border: 1px solid rgba(74, 63, 138, 0.12);
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 90%;
  text-align: center;
}

.message.crisis {
  border-color: var(--warning);
  background: var(--gold-bg);
}

/* Error message with retry */
.message.error-message {
  background: rgba(196, 91, 91, 0.06);
  border: 1px solid rgba(196, 91, 91, 0.2);
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.retry-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--error);
  background: transparent;
  color: var(--error);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.retry-btn:hover {
  background: var(--error);
  color: white;
}

/* ── Emotional Resonance — Rothko-inspired aura gradients ── */

.message.assistant[data-emotion="warmth"] {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(212, 168, 83, 0.08) 100%);
  border-color: rgba(212, 168, 83, 0.2);
}

.message.assistant[data-emotion="concern"] {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(143, 174, 126, 0.1) 100%);
  border-color: rgba(143, 174, 126, 0.25);
}

.message.assistant[data-emotion="celebration"] {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(212, 168, 83, 0.12) 100%);
  border-color: rgba(212, 168, 83, 0.25);
}

.message.assistant[data-emotion="reflection"] {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(74, 63, 138, 0.06) 100%);
  border-color: rgba(74, 63, 138, 0.15);
}

.message.assistant[data-emotion="calm"] {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(143, 174, 126, 0.07) 100%);
  border-color: rgba(143, 174, 126, 0.18);
}

.message.assistant[data-emotion="challenge"] {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(196, 91, 91, 0.05) 100%);
  border-color: rgba(196, 91, 91, 0.12);
}

/* Welcome message (first assistant message) */
.message.assistant.welcome-msg {
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-bg) 100%);
  border-color: rgba(74, 63, 138, 0.15);
  font-size: 1rem;
  line-height: 1.7;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.typing-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 0.3rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
.typing-dot:nth-child(4) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 100% { transform: scale(0.6); opacity: 0.3; }
  50% { transform: scale(1); opacity: 1; }
}

/* Streaming cursor */
.streaming-cursor::after {
  content: '▊';
  animation: blink 0.8s infinite;
  color: var(--accent);
  margin-left: 1px;
  font-size: 0.85em;
}

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

/* Input area */
.chat-input-area {
  padding: 0.8rem 1rem;
  padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 100%;
}

.chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px; /* Prevent iOS auto-zoom on focus (must be >= 16px) */
  line-height: 1.4;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; /* Remove iOS input styling */
  appearance: none;
}

.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

/* File upload button */
.file-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.file-btn:hover { color: var(--accent); border-color: var(--accent); }
.file-btn:active { transform: scale(0.92); }
.attach-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.attach-btn:hover { color: #4f46e5; border-color: #4f46e5; }
.attach-btn:active { transform: scale(0.92); }
.file-btn.uploading {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

/* Download/email buttons in messages */
.download-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--accent); color: white;
  border-radius: 8px; text-decoration: none; font-size: 0.85rem;
  font-weight: 500; margin-top: 8px; transition: opacity 0.2s;
}
.download-link:hover { opacity: 0.85; }
.email-doc-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem;
  cursor: pointer; margin-top: 8px; margin-left: 6px; transition: all 0.2s;
}
.email-doc-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Microphone button */
.mic-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mic-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.mic-btn:active {
  transform: scale(0.92);
  opacity: 0.8;
}

.mic-btn.recording {
  background: #dc3545;
  border-color: #dc3545;
  color: white;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
}

.mic-btn.unsupported {
  display: flex;
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Voice error toast */
.voice-error-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-color, #333);
  color: var(--bg-color, #fff);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.voice-error-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Voice mode toggle (header) */
.voice-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.voice-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.voice-toggle.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(74, 63, 138, 0.3);
}

/* Voice loop active — pulsing glow to show auto-loop is running */
.voice-toggle.loop-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: var(--accent);
  color: white;
  animation: voiceLoopPulse 1.4s ease-in-out infinite;
}

@keyframes voiceLoopPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(74, 63, 138, 0.3); }
  50% { box-shadow: 0 2px 18px rgba(74, 63, 138, 0.7), 0 0 0 4px rgba(74, 63, 138, 0.15); }
}

/* Voice play button on assistant messages */
.voice-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 8px;
  margin-top: 4px;
  transition: all 0.2s;
  vertical-align: middle;
  float: right;
  opacity: 0.6;
}

.voice-play-btn:hover {
  opacity: 1;
  background: var(--accent);
  color: white;
  transform: scale(1.1);
}

.voice-play-btn.playing {
  opacity: 1;
  background: var(--accent);
  color: white;
  animation: voice-pulse 1.5s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 63, 138, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(74, 63, 138, 0); }
}

/* Mic transcribing state (waiting for Groq Whisper) */
.mic-btn.transcribing {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  animation: transcribe-spin 1s linear infinite;
}

@keyframes transcribe-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Brief pulse when mic auto-starts from voice loop */
.mic-btn.auto-starting {
  animation: micAutoStart 0.2s ease-out;
}
@keyframes micAutoStart {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); box-shadow: 0 0 12px rgba(74,63,138,0.6); }
  100% { transform: scale(1); }
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #4A3F8A, #6B5FB5);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.send-btn:hover {
  opacity: 0.92;
  box-shadow: 0 2px 8px rgba(74, 63, 138, 0.3);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
}

.send-btn.sending {
  animation: sendPulse 1.5s ease-in-out infinite;
}

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

/* Session limit warning */
.session-warning {
  padding: 0.5rem 0.8rem;
  text-align: center;
  font-size: 0.8rem;
  color: #B8860B;
  background: var(--gold-bg);
  border-top: 1px solid rgba(212, 168, 83, 0.2);
}

/* ============================================================
   Onboarding Modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 45, 45, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.modal p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  text-align: center;
  line-height: 1.5;
}

.onboarding-question {
  margin-bottom: 1.2rem;
}

.onboarding-question label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.onboarding-question textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px; /* Prevent iOS auto-zoom */
  resize: vertical;
  min-height: 60px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.onboarding-question textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* ============================================================
   Responsive — Tablet (max 768px)
   ============================================================ */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.4rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .features {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
  }

  .feature-card {
    padding: 0.8rem 0.6rem;
  }

  /* Disable hover transform on touch — feels janky */
  .feature-card:hover {
    transform: none;
    box-shadow: none;
  }

  .feature-card h3 {
    font-size: 0.8rem;
  }

  .feature-card p {
    font-size: 0.68rem;
  }

  .login-section {
    max-width: 360px;
  }

  /* Value comparison responsive — tablet */
  .value-comparison {
    gap: 0.8rem;
  }

  .value-card {
    padding: 1rem;
  }

  .value-title {
    font-size: 1.4rem;
  }

  .chat-messages {
    padding: 0.8rem;
  }

  .message {
    max-width: 90%;
  }

  /* Right sidebar hidden on tablet */
  .sidebar-right {
    display: none;
  }

  /* Left sidebar narrower on tablet */
  .sidebar-left {
    width: 70px;
  }

  .agent-tile-emoji {
    font-size: 1.3rem;
  }

  .agent-tile-name {
    font-size: 0.55rem;
  }

  /* Modal responsive */
  .modal {
    padding: 1.5rem;
    border-radius: 12px;
    max-height: 85vh;
  }

  .onboarding-question label {
    font-size: 0.85rem;
  }

  /* Landing footer touch targets */
  .footer {
    padding: 1.2rem 1rem;
  }

  .footer a {
    display: inline-block;
    padding: 0.3rem 0.2rem;
    min-height: 44px;
    line-height: 2.5;
  }
}

/* ============================================================
   Responsive — Small Mobile (max 480px)
   ============================================================ */

@media (max-width: 480px) {
  .landing-lang-switcher {
    gap: 0.3rem;
    align-items: center;
  }

  .hero {
    padding: 1.5rem 1rem;
    padding-top: 3rem;
  }

  .hero-logo {
    font-size: 3rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .feature-card .emoji {
    font-size: 1.2rem;
  }

  .feature-card h3 {
    font-size: 0.75rem;
  }

  .feature-card p {
    display: none;
  }

  .login-section h2 {
    font-size: 1.1rem;
  }

  /* Value comparison — mobile stack */
  .value-comparison {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .value-card {
    padding: 0.8rem;
  }

  .value-card-header {
    font-size: 0.85rem;
  }

  .value-list li {
    font-size: 0.78rem;
  }

  .value-title {
    font-size: 1.2rem;
  }

  /* Hero CTA mobile */
  .hero-cta {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    width: 100%;
    max-width: 320px;
    text-align: center;
  }

  /* Testimonial mobile */
  .testimonial-quote {
    font-size: 0.95rem;
  }

  /* Exercises section mobile */
  .exercises-section {
    padding: 1.2rem 1rem;
  }

  .exercises-title {
    font-size: 1.2rem;
  }

  .exercises-desc {
    font-size: 0.82rem;
  }

  .exercise-cat {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }

  .exercises-footnote {
    font-size: 0.72rem;
  }

  /* Help link bigger touch target */
  .help-link {
    padding: 10px 24px;
    min-height: 44px;
  }

  .chat-messages {
    padding: 0.5rem;
  }

  .message {
    max-width: 95%;
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
  }

  .chat-input-area {
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }

  .chat-header {
    padding: 0.6rem 0.8rem;
  }

  .chat-header h1 {
    font-size: 0.95rem;
  }

  .chat-header-right {
    gap: 0.3rem;
  }

  .lang-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
  }

  /* Mobile: left sidebar becomes collapsible overlay */
  .sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .sidebar-left.open {
    transform: translateX(0);
  }

  .sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: max(0.45rem, env(safe-area-inset-top, 0px));
    left: max(0.4rem, env(safe-area-inset-left, 0px));
    z-index: 55;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .sidebar-toggle-btn:active {
    background: var(--accent-bg);
  }

  /* Right sidebar hidden on mobile */
  .sidebar-right {
    display: none;
  }

  /* Calorie bar compact on mobile */
  .calorie-bar {
    padding: 6px 12px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .calorie-bar-inner {
    gap: 8px;
  }

  .calorie-total {
    font-size: 0.85rem;
  }

  .calorie-macro {
    font-size: 0.7rem;
  }

  .calorie-label {
    display: none;
  }

  .calorie-tip {
    font-size: 0.68rem;
    padding: 3px 12px 1px;
  }

  /* Chat header: add left padding for hamburger */
  .chat-header-left {
    padding-left: 42px;
  }

  /* Specialist badge smaller on mobile */
  .specialist-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }

  .specialist-badge .badge-emoji {
    font-size: 0.75rem;
  }

  /* Chat footer links bigger for touch */
  .chat-footer-links {
    padding: 8px 0;
    font-size: 0.75rem;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .chat-footer-links a {
    display: inline-block;
    padding: 0.2rem 0.4rem;
  }

  /* Disclaimer text */
  .disclaimer {
    font-size: 0.75rem;
    padding: 0.7rem;
  }

  /* Modal optimized for mobile */
  .modal {
    padding: 1.2rem;
    border-radius: 12px;
    max-height: 88vh;
    margin: 0.5rem;
  }

  .modal h2 {
    font-size: 1.15rem;
  }

  .modal p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .onboarding-question {
    margin-bottom: 0.8rem;
  }

  .onboarding-question label {
    font-size: 0.82rem;
  }

  .onboarding-question textarea {
    min-height: 55px;
  }

  /* Guide page on mobile */
  .guide-section-important {
    padding: 0.8rem 1rem;
  }

  .guide-cta-btn {
    padding: 0.8rem 2rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
  }
}

/* ============================================================
   Responsive — Very small (< 360px)
   ============================================================ */

@media (max-width: 360px) {
  .features {
    grid-template-columns: 1fr;
  }

  .feature-card p {
    display: block;
    font-size: 0.7rem;
  }
}

/* Mobile keyboard — 100dvh is now set as default in .chat-layout and .chat-container above */

/* ============================================================
   Specialist badge in chat header
   ============================================================ */

.specialist-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--accent-bg);
  border: 1px solid rgba(74, 63, 138, 0.12);
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.specialist-badge .badge-emoji {
  font-size: 0.85rem;
}

/* ============================================================
   Streak badge — 🔥 N days in a row
   ============================================================ */

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.15), rgba(239, 68, 68, 0.10));
  border: 1px solid rgba(251, 146, 60, 0.30);
  font-size: 0.78rem;
  font-weight: 700;
  color: #ea580c;
  cursor: default;
  white-space: nowrap;
  animation: badgePop 0.4s ease;
  margin-right: 0.25rem;
}

/* ============================================================
   Language dropdown (mobile-friendly)
   ============================================================ */

.lang-dropdown {
  position: relative;
}

.lang-dropdown-toggle {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
}

.lang-dropdown-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 200;
  min-width: 140px;
  padding: 0.3rem;
}

.lang-dropdown-menu.open {
  display: block;
  animation: fadeIn 0.15s ease;
}

.lang-dropdown-menu .lang-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.7rem;
  border: none;
  border-radius: 6px;
}

.lang-dropdown-menu .lang-btn:hover,
.lang-dropdown-menu .lang-btn.active {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ============================================================
   New chat / Clear button
   ============================================================ */

.new-chat-btn {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.new-chat-btn:hover {
  border-color: var(--sage);
  color: var(--sage);
  background: var(--sage-bg);
}

/* ============================================================
   Mobile — sidebar backdrop overlay
   ============================================================ */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 59;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-backdrop.active {
  display: block;
}

/* Agent tiles — touch feedback */
.agent-tile:active {
  transform: scale(0.93);
  transition-duration: 0.1s;
}

.agent-tile {
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   Touch-only: disable hover effects on touch devices
   ============================================================ */

@media (hover: none) and (pointer: coarse) {
  .feature-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
  }

  .guide-agent:hover {
    border-color: var(--border);
  }

  .help-link:hover {
    transform: none;
  }

  .guide-cta-btn:hover {
    transform: none;
  }

  .exercise-cat:hover {
    transform: none;
    border-color: var(--border);
  }

  .pride-highlight-inner:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ============================================================
   Dark mode — dark is now default, overrides for chat elements
   ============================================================ */

/* Dark mode: :root IS the dark theme now. No separate [data-theme="dark"] variables needed. */

/* Chat message overrides for dark */
[data-theme="dark"] .message.user,
html:not([data-theme="light"]) .message.user {
  background: var(--accent);
  color: var(--bg);
}

[data-theme="dark"] .message.assistant pre,
html:not([data-theme="light"]) .message.assistant pre {
  background: var(--surface);
  border-color: var(--border);
}

/* Chat header wordmark */
.chat-header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  background: none;
}

/* Light mode chat overrides */
[data-theme="light"] .message.user {
  background: var(--accent);
  color: white;
}

[data-theme="light"] .message.assistant pre {
  background: var(--surface);
  border-color: var(--border);
}

/* Responsive: intent cards single column on mobile */
@media (max-width: 500px) {
  .intent-cards {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    letter-spacing: 0.15em;
  }
  .allma-nav {
    padding: 0.6rem 1rem;
  }
}

/* Guide link in chat header */
.guide-link {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
  min-width: 32px;
}

.guide-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* Theme toggle button */
.theme-toggle {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
  min-width: 32px;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* ============================================================
   Animations — reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Mobile: hide language buttons, show dropdown
   ============================================================ */

@media (max-width: 600px) {
  .chat-header-right .lang-btn {
    display: none;
  }

  .chat-header-right .lang-dropdown {
    display: block;
  }

  .chat-header-right .logout-btn {
    padding: 0.25rem 0.5rem;
    min-height: 36px;
    min-width: 36px;
  }

  /* Dropdown menu: constrained height + scroll on small screens */
  .lang-dropdown-menu {
    max-height: 60vh;
    overflow-y: auto;
    min-width: 160px;
  }

  .lang-dropdown-menu .lang-btn {
    display: flex;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.8rem;
    min-height: 44px;
    align-items: center;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
  }

  .lang-dropdown-toggle {
    min-height: 36px;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }

  /* Guide link smaller */
  .guide-link {
    min-height: 36px;
    min-width: 36px;
    font-size: 0.9rem;
  }

  /* Theme toggle */
  .theme-toggle {
    min-height: 36px;
    min-width: 36px;
    font-size: 0.9rem;
  }
}

@media (min-width: 601px) {
  .lang-dropdown {
    display: none;
  }

  .lang-btn-desktop {
    display: inline-flex;
  }
}

/* Landing page: on mobile hide desktop buttons, show dropdown */
@media (max-width: 600px) {
  .lang-btn-desktop {
    display: none !important;
  }

  .lang-dropdown-landing {
    display: block;
  }
}

/* ============================================================
   PWA Install Banner
   ============================================================ */

.install-banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  background: var(--accent-bg, rgba(108, 92, 231, 0.08));
  border: 1px solid var(--border, rgba(74, 63, 138, 0.15));
  border-radius: 16px;
  margin: 1rem 0;
  max-width: 420px;
  width: 90%;
  animation: fadeIn 0.3s ease;
}


/* ============================================================
   Exercise Engine UI
   ============================================================ */

/* Exercise button in input bar (next to mic) */
.exercise-input-btn {
  background: none;
  border: none;
  color: var(--sage);
  cursor: pointer;
  padding: 6px;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.exercise-input-btn:hover {
  background: var(--sage-bg);
}

.exercise-input-btn:active {
  transform: scale(0.9);
}

/* Sidebar exercise button */
.sidebar-exercise {
  padding: 0.5rem 0.6rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.exercise-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--sage);
  background: var(--sage-bg);
  color: var(--sage);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.exercise-btn:hover {
  background: var(--sage);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(143, 174, 126, 0.3);
}

.exercise-btn-emoji {
  font-size: 1.1rem;
}

/* Exercise Panel (fullscreen overlay) */
.exercise-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
  padding: 1.5rem;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.exercise-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.exercise-panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
  margin: 0;
}

.exercise-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.exercise-close:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

/* Exercise stats bar */
.exercise-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.exercise-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.exercise-stat strong {
  color: var(--accent);
  font-weight: 600;
}

/* Recommended section */
.exercise-recommended h3,
.exercise-categories h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 0.8rem;
}

/* Exercise cards */
.exercise-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.exercise-card {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.exercise-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(74, 63, 138, 0.1);
}

.exercise-card.recommended {
  border-color: var(--sage);
  background: var(--sage-bg);
}

.exercise-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.exercise-card-emoji {
  font-size: 1.3rem;
}

.exercise-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.exercise-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.exercise-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.exercise-card-meta .duration {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.exercise-card-meta .difficulty {
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 500;
}

.difficulty-beginner { background: var(--sage-bg); color: var(--sage); }
.difficulty-intermediate { background: var(--gold-bg); color: var(--gold); }
.difficulty-advanced { background: rgba(196, 91, 91, 0.1); color: var(--error); }

/* Category filter */
.exercise-filter {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.exercise-filter-btn {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.exercise-filter-btn:hover,
.exercise-filter-btn.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

/* Mobile exercise panel */
@media (max-width: 768px) {
  .exercise-panel {
    padding: 1rem;
  }

  .exercise-cards {
    grid-template-columns: 1fr;
  }

  .exercise-panel-header h2 {
    font-size: 1.2rem;
  }
}

.install-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.install-btn {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.install-dismiss {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.install-dismiss:hover {
  opacity: 1;
}


/* (Old sections removed: how-it-works, pride, engines-detail, about) */

/* ============================================================
   CC Signature Features — 6 living elements
   ============================================================ */

/* ── 1. Breathing Orb ── */
@keyframes orb-breathe {
  0%, 100% { transform: scale(0.85); opacity: 0.3; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

@keyframes orb-ring-breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.15; }
  50% { transform: scale(1.4); opacity: 0.05; }
}

.breathing-orb {
  --breath-speed: 8s;
  position: absolute;
  bottom: 90px;
  right: 18px;
  width: 36px;
  height: 36px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-orb-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, rgba(212,160,112,0.3) 70%, transparent 100%);
  animation: orb-breathe var(--breath-speed) ease-in-out infinite;
}

.breathing-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(212,160,112,0.15);
  animation: orb-ring-breathe var(--breath-speed) ease-in-out infinite;
}

/* ── 2. Silence Whisper ── */
.silence-whisper {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 1.5s ease, transform 1.5s ease;
  pointer-events: none;
  z-index: 10;
  text-align: center;
  white-space: nowrap;
}

.silence-whisper.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 3. Mood Trail ── */
.mood-trail {
  height: 2px;
  width: 100%;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--bg), rgba(212,160,112,0.05), var(--bg));
  opacity: 0;
  transition: background 2s ease, opacity 2s ease;
}

/* ── 4. Fireflies Canvas ── */
.fireflies-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

/* ── 5. Night Awareness ── */
.night-whisper {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 2s ease, transform 2s ease;
  pointer-events: none;
  z-index: 10;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.night-whisper.visible {
  opacity: 0.6;
  transform: translateX(-50%) translateY(0);
}

/* Night mode — warmer everything */
body.allma-night {
  --accent: #e0b88a;
  --accent-light: #ecc99e;
}

body.allma-night .breathing-orb {
  --breath-speed: 12s;
}

body.allma-night .chat-messages {
  background: #161014;
}

body.allma-night .mood-trail {
  height: 1px;
}

/* ── 6. Rhythm Mirror ── */
/* Typing indicator adjusts based on user rhythm */
body[data-rhythm="slow"] .typing-dot {
  animation-duration: 2s;
}

body[data-rhythm="fast"] .typing-dot {
  animation-duration: 0.8s;
}

body[data-rhythm="slow"] .typing-label {
  letter-spacing: 0.05em;
}

/* ── Chat Warm Footer ── */
.chat-warm-footer {
  position: relative;
  padding: 2rem 1.5rem 1.5rem;
  background: rgba(0,0,0,0.15);
  text-align: center;
}

.chat-warm-footer-line {
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--sage), var(--accent), transparent);
  background-size: 200% 100%;
  animation: aurora-drift 12s ease-in-out infinite;
}

.chat-warm-footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.chat-warm-footer-wordmark {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.25em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.75rem;
}

.chat-warm-footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.chat-warm-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.chat-warm-footer-links a:hover {
  color: var(--accent);
}

.chat-warm-footer-copy {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── Chat center needs position:relative for absolute children ── */
.chat-center {
  position: relative;
}

/* ── 7. Farewell Whisper ── */
.farewell-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: var(--accent);
  letter-spacing: 0.15em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.farewell-overlay.visible {
  opacity: 1;
}

/* ── 8. Touch Memory (Breathing Orb) ── */
.breathing-orb-touch {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--accent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1s ease, transform 1s ease;
  pointer-events: none;
}

.breathing-orb-touch.visible {
  opacity: 0.8;
  transform: translateY(0);
}

.breathing-orb.touched .breathing-orb-core {
  animation: none;
  transform: scale(1.8);
  opacity: 0.9;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

.breathing-orb.touched .breathing-orb-ring {
  animation: none;
  transform: scale(2);
  opacity: 0.25;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.8s ease;
}

/* ── Mobile adjustments for CC features ── */
@media (max-width: 768px) {
  .breathing-orb {
    bottom: 80px;
    right: 12px;
    width: 28px;
    height: 28px;
  }

  .breathing-orb-core {
    width: 8px;
    height: 8px;
  }

  .silence-whisper,
  .night-whisper {
    font-size: 0.75rem;
    bottom: 68px;
  }
}
