/* ═══════════════════════════════════════════════════════════════════════════
   PRISMA · ALUZAR — 15 Aesthetic Worlds + Circular Neon Portrait + Unified Menu
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --rx-bass: 0;
  --rx-mid: 0;
  --rx-high: 0;
  --rx-energy: 0;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* 1. Diablita Esmeralda (Default) */
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Plus Jakarta Sans", -apple-system, sans-serif;
  --bg-1: #050908;
  --bg-2: #0a1713;
  --surface: rgba(12, 26, 21, 0.78);
  --surface-strong: rgba(10, 22, 18, 0.96);
  --text-main: #ecfdf5;
  --text-muted: #86efac;
  --text-dim: rgba(209, 250, 229, 0.6);
  --accent: #10b981;
  --accent-2: #e879f9;
  --neon-1: #10b981;
  --neon-2: #e879f9;
  --neon-3: #38bdf8;
  --border-subtle: rgba(16, 185, 129, 0.26);

  --user-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 95, 70, 0.46));
  --user-text: #f0fdf4;
  --user-border: rgba(52, 211, 153, 0.45);
  --ai-bg: rgba(13, 25, 22, 0.84);
  --ai-text: #ecfdf5;
  --ai-border: rgba(232, 121, 249, 0.28);

  --bubble-radius-ai: 20px 20px 20px 5px;
  --bubble-radius-user: 20px 20px 5px 20px;
  --bubble-shadow: 0 6px 22px rgba(0, 0, 0, 0.34);
  --rx-glow-ai: rgba(16, 185, 129, 0.52);
  --rx-glow-user: rgba(232, 121, 249, 0.48);
  --rx-aura-1: rgba(16, 185, 129, 0.38);
  --rx-aura-2: rgba(217, 70, 239, 0.28);
  --composer-radius: 26px;
}

/* ─── 2. Cyberpunk Neo-Tokyo ─── */
html[data-theme="neotokyo"] {
  --font-body: "JetBrains Mono", monospace;
  --font-display: "Space Grotesk", sans-serif;
  --bg-1: #07060e;
  --bg-2: #120924;
  --surface: rgba(14, 11, 28, 0.86);
  --surface-strong: rgba(11, 9, 22, 0.97);
  --text-main: #f0f9ff;
  --text-muted: #00f0ff;
  --text-dim: rgba(165, 243, 252, 0.62);
  --accent: #00f0ff;
  --accent-2: #ff2a85;
  --neon-1: #00f0ff;
  --neon-2: #ff2a85;
  --neon-3: #a855f7;
  --border-subtle: rgba(0, 240, 255, 0.38);
  --user-bg: linear-gradient(135deg, rgba(255, 42, 133, 0.26), rgba(88, 28, 135, 0.5));
  --user-text: #fdf2f8;
  --user-border: #ff2a85;
  --ai-bg: rgba(8, 18, 32, 0.9);
  --ai-text: #e0f2fe;
  --ai-border: #00f0ff;
  --bubble-radius-ai: 2px 16px 2px 14px;
  --bubble-radius-user: 16px 2px 14px 2px;
  --bubble-shadow: 0 0 14px rgba(0, 240, 255, 0.16);
  --rx-glow-ai: rgba(0, 240, 255, 0.68);
  --rx-glow-user: rgba(255, 42, 133, 0.68);
  --rx-aura-1: rgba(0, 240, 255, 0.42);
  --rx-aura-2: rgba(255, 42, 133, 0.38);
  --composer-radius: 6px;
}

/* ─── 3. Carta Antigua ─── */
html[data-theme="editorial"] {
  --font-body: "Cormorant Garamond", Georgia, serif;
  --font-display: "Cinzel", Georgia, serif;
  --bg-1: #f4ede0;
  --bg-2: #eadec9;
  --surface: rgba(251, 246, 236, 0.9);
  --surface-strong: #f9f3e6;
  --text-main: #261c14;
  --text-muted: #7c2d12;
  --text-dim: rgba(68, 49, 34, 0.66);
  --accent: #8b2635;
  --accent-2: #b4833e;
  --neon-1: #d4af37;
  --neon-2: #b91c1c;
  --neon-3: #f59e0b;
  --border-subtle: rgba(139, 98, 52, 0.32);
  --user-bg: #efe4ce;
  --user-text: #241911;
  --user-border: rgba(139, 38, 53, 0.42);
  --ai-bg: #fcf8ef;
  --ai-text: #1f1610;
  --ai-border: rgba(180, 131, 62, 0.55);
  --bubble-radius-ai: 4px;
  --bubble-radius-user: 4px;
  --bubble-shadow: 0 3px 12px rgba(68, 44, 18, 0.09);
  --rx-glow-ai: rgba(180, 131, 62, 0.55);
  --rx-glow-user: rgba(139, 38, 53, 0.45);
  --rx-aura-1: rgba(196, 138, 53, 0.34);
  --rx-aura-2: rgba(139, 38, 53, 0.24);
  --composer-radius: 8px;
}

/* ─── 4. Terminal CRT ─── */
html[data-theme="crt"] {
  --font-body: "JetBrains Mono", monospace;
  --font-display: "JetBrains Mono", monospace;
  --bg-1: #030904;
  --bg-2: #061409;
  --surface: rgba(5, 18, 8, 0.92);
  --surface-strong: #041107;
  --text-main: #4ade80;
  --text-muted: #86efac;
  --text-dim: rgba(74, 222, 128, 0.58);
  --accent: #22c55e;
  --accent-2: #facc15;
  --neon-1: #22c55e;
  --neon-2: #86efac;
  --neon-3: #facc15;
  --border-subtle: rgba(34, 197, 94, 0.42);
  --user-bg: rgba(20, 48, 26, 0.72);
  --user-text: #bbf7d0;
  --user-border: #4ade80;
  --ai-bg: rgba(4, 16, 7, 0.92);
  --ai-text: #4ade80;
  --ai-border: rgba(34, 197, 94, 0.6);
  --bubble-radius-ai: 0px;
  --bubble-radius-user: 0px;
  --bubble-shadow: 0 0 10px rgba(34, 197, 94, 0.18);
  --rx-glow-ai: rgba(34, 197, 94, 0.72);
  --rx-glow-user: rgba(250, 204, 21, 0.58);
  --rx-aura-1: rgba(34, 197, 94, 0.35);
  --rx-aura-2: rgba(163, 230, 53, 0.25);
  --composer-radius: 0px;
}

/* ─── 5. Terciopelo Carmesí ─── */
html[data-theme="carmesi"] {
  --font-body: "Cormorant Garamond", Georgia, serif;
  --font-display: "Cinzel", serif;
  --bg-1: #110408;
  --bg-2: #260711;
  --surface: rgba(34, 8, 17, 0.86);
  --surface-strong: rgba(26, 5, 12, 0.97);
  --text-main: #ffe4e6;
  --text-muted: #fda4af;
  --text-dim: rgba(254, 205, 211, 0.6);
  --accent: #e11d48;
  --accent-2: #eab308;
  --neon-1: #ff1e56;
  --neon-2: #fde047;
  --neon-3: #fb7185;
  --border-subtle: rgba(234, 179, 8, 0.34);
  --user-bg: linear-gradient(135deg, rgba(159, 18, 57, 0.6), rgba(76, 5, 25, 0.85));
  --user-text: #fff1f2;
  --user-border: rgba(251, 113, 133, 0.48);
  --ai-bg: rgba(28, 6, 13, 0.88);
  --ai-text: #ffe4e6;
  --ai-border: rgba(234, 179, 8, 0.45);
  --bubble-radius-ai: 18px 18px 18px 3px;
  --bubble-radius-user: 18px 18px 3px 18px;
  --bubble-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  --rx-glow-ai: rgba(225, 29, 72, 0.62);
  --rx-glow-user: rgba(234, 179, 8, 0.55);
  --rx-aura-1: rgba(225, 29, 72, 0.42);
  --rx-aura-2: rgba(234, 179, 8, 0.26);
  --composer-radius: 22px;
}

/* ─── 6. Cristal Líquido ─── */
html[data-theme="cristal"] {
  --font-body: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", sans-serif;
  --bg-1: #0c1222;
  --bg-2: #1d2646;
  --surface: rgba(255, 255, 255, 0.11);
  --surface-strong: rgba(18, 25, 46, 0.94);
  --text-main: #f8fafc;
  --text-muted: #bae6fd;
  --text-dim: rgba(226, 232, 240, 0.65);
  --accent: #38bdf8;
  --accent-2: #c084fc;
  --neon-1: #38bdf8;
  --neon-2: #e0f2fe;
  --neon-3: #c084fc;
  --border-subtle: rgba(255, 255, 255, 0.25);
  --user-bg: linear-gradient(135deg, rgba(56, 189, 248, 0.36), rgba(129, 140, 248, 0.38));
  --user-text: #ffffff;
  --user-border: rgba(255, 255, 255, 0.42);
  --ai-bg: rgba(255, 255, 255, 0.12);
  --ai-text: #f8fafc;
  --ai-border: rgba(255, 255, 255, 0.28);
  --bubble-radius-ai: 26px 26px 26px 8px;
  --bubble-radius-user: 26px 26px 8px 26px;
  --bubble-shadow: 0 10px 30px rgba(4, 9, 24, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --rx-glow-ai: rgba(56, 189, 248, 0.58);
  --rx-glow-user: rgba(192, 132, 252, 0.58);
  --rx-aura-1: rgba(56, 189, 248, 0.42);
  --rx-aura-2: rgba(192, 132, 252, 0.4);
  --composer-radius: 30px;
}

/* ─── 7. Brutalista Suizo ─── */
html[data-theme="brutalista"] {
  --font-body: "Space Grotesk", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
  --bg-1: #efece6;
  --bg-2: #e5e0d5;
  --surface: #f7f5f0;
  --surface-strong: #ffffff;
  --text-main: #111111;
  --text-muted: #ff4d00;
  --text-dim: rgba(17, 17, 17, 0.64);
  --accent: #ff4d00;
  --accent-2: #111111;
  --neon-1: #ff4d00;
  --neon-2: #84cc16;
  --neon-3: #2563eb;
  --border-subtle: #111111;
  --user-bg: #d9f99d;
  --user-text: #111111;
  --user-border: #111111;
  --ai-bg: #ffffff;
  --ai-text: #111111;
  --ai-border: #111111;
  --bubble-radius-ai: 0px;
  --bubble-radius-user: 0px;
  --bubble-shadow: 4px 4px 0px #111111;
  --rx-glow-ai: rgba(255, 77, 0, 0.58);
  --rx-glow-user: rgba(37, 99, 235, 0.52);
  --rx-aura-1: rgba(255, 77, 0, 0.34);
  --rx-aura-2: rgba(163, 230, 53, 0.45);
  --composer-radius: 0px;
}

/* ─── 8. Tinta Japonesa ─── */
html[data-theme="sumie"] {
  --font-body: "Plus Jakarta Sans", sans-serif;
  --font-display: "Cormorant Garamond", serif;
  --bg-1: #f6f4ef;
  --bg-2: #ece8df;
  --surface: rgba(250, 249, 245, 0.9);
  --surface-strong: #fbfaf7;
  --text-main: #1c1917;
  --text-muted: #b91c1c;
  --text-dim: rgba(41, 37, 36, 0.58);
  --accent: #dc2626;
  --accent-2: #292524;
  --neon-1: #ef4444;
  --neon-2: #1c1917;
  --neon-3: #f97316;
  --border-subtle: rgba(41, 37, 36, 0.18);
  --user-bg: rgba(231, 229, 228, 0.72);
  --user-text: #1c1917;
  --user-border: #292524;
  --ai-bg: rgba(255, 255, 255, 0.86);
  --ai-text: #1c1917;
  --ai-border: #dc2626;
  --bubble-radius-ai: 2px 12px 12px 2px;
  --bubble-radius-user: 12px 2px 2px 12px;
  --bubble-shadow: 0 2px 10px rgba(28, 25, 23, 0.06);
  --rx-glow-ai: rgba(220, 38, 38, 0.42);
  --rx-glow-user: rgba(41, 37, 36, 0.35);
  --rx-aura-1: rgba(220, 38, 38, 0.25);
  --rx-aura-2: rgba(120, 113, 108, 0.24);
  --composer-radius: 14px;
}

/* ─── 9. Bosque Oscuro ─── */
html[data-theme="bosque"] {
  --font-body: "Plus Jakarta Sans", sans-serif;
  --font-display: "Cinzel", serif;
  --bg-1: #060f0b;
  --bg-2: #0d2118;
  --surface: rgba(11, 28, 20, 0.84);
  --surface-strong: rgba(8, 21, 15, 0.97);
  --text-main: #e2f5ea;
  --text-muted: #6ee7b7;
  --text-dim: rgba(167, 243, 208, 0.58);
  --accent: #34d399;
  --accent-2: #a7f3d0;
  --neon-1: #34d399;
  --neon-2: #a3e635;
  --neon-3: #2dd4bf;
  --border-subtle: rgba(52, 211, 153, 0.28);
  --user-bg: linear-gradient(145deg, rgba(20, 83, 45, 0.65), rgba(6, 78, 59, 0.65));
  --user-text: #ecfdf5;
  --user-border: rgba(110, 231, 183, 0.42);
  --ai-bg: rgba(9, 24, 18, 0.88);
  --ai-text: #d1fae5;
  --ai-border: rgba(52, 211, 153, 0.34);
  --bubble-radius-ai: 24px 8px 24px 6px;
  --bubble-radius-user: 8px 24px 6px 24px;
  --bubble-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --rx-glow-ai: rgba(52, 211, 153, 0.6);
  --rx-glow-user: rgba(163, 230, 53, 0.5);
  --rx-aura-1: rgba(16, 185, 129, 0.4);
  --rx-aura-2: rgba(45, 212, 191, 0.32);
  --composer-radius: 20px;
}

/* ─── 10. Vaporwave 1989 ─── */
html[data-theme="vaporwave"] {
  --font-body: "JetBrains Mono", monospace;
  --font-display: "Space Grotesk", sans-serif;
  --bg-1: #1c0b33;
  --bg-2: #3b1254;
  --surface: rgba(212, 208, 200, 0.94);
  --surface-strong: #e2dfd7;
  --text-main: #1a0933;
  --text-muted: #b8007a;
  --text-dim: rgba(26, 9, 51, 0.68);
  --accent: #ff4fd8;
  --accent-2: #00f5d4;
  --neon-1: #ff4fd8;
  --neon-2: #00f5d4;
  --neon-3: #fde047;
  --border-subtle: #ffffff;
  --user-bg: #c9f7f2;
  --user-text: #120624;
  --user-border: #ffffff;
  --ai-bg: #ece9d8;
  --ai-text: #120624;
  --ai-border: #ffffff;
  --bubble-radius-ai: 0px;
  --bubble-radius-user: 0px;
  --bubble-shadow: inset 1.5px 1.5px 0 #ffffff, inset -1.5px -1.5px 0 #5b4b73, 3px 3px 0 rgba(11, 3, 24, 0.55);
  --rx-glow-ai: rgba(255, 79, 216, 0.72);
  --rx-glow-user: rgba(0, 245, 212, 0.72);
  --rx-aura-1: rgba(255, 79, 216, 0.5);
  --rx-aura-2: rgba(0, 245, 212, 0.42);
  --composer-radius: 0px;
}

/* ─── 11. Noir 35mm ─── */
html[data-theme="noir"] {
  --font-body: "Cormorant Garamond", Georgia, serif;
  --font-display: "Cinzel", serif;
  --bg-1: #080809;
  --bg-2: #161618;
  --surface: rgba(22, 22, 25, 0.88);
  --surface-strong: #121214;
  --text-main: #f4f4f5;
  --text-muted: #d4d4d8;
  --text-dim: rgba(161, 161, 170, 0.66);
  --accent: #e4e4e7;
  --accent-2: #a1a1aa;
  --neon-1: #ffffff;
  --neon-2: #a1a1aa;
  --neon-3: #e4e4e7;
  --border-subtle: rgba(228, 228, 231, 0.25);
  --user-bg: rgba(63, 63, 70, 0.55);
  --user-text: #fafafa;
  --user-border: rgba(244, 244, 245, 0.42);
  --ai-bg: rgba(18, 18, 20, 0.92);
  --ai-text: #e4e4e7;
  --ai-border: rgba(161, 161, 170, 0.35);
  --bubble-radius-ai: 6px;
  --bubble-radius-user: 6px;
  --bubble-shadow: 0 10px 28px rgba(0, 0, 0, 0.72);
  --rx-glow-ai: rgba(255, 255, 255, 0.48);
  --rx-glow-user: rgba(212, 212, 216, 0.45);
  --rx-aura-1: rgba(244, 244, 245, 0.26);
  --rx-aura-2: rgba(161, 161, 170, 0.22);
  --composer-radius: 8px;
}

/* ─── 12. Café Lluvioso Lo-Fi ─── */
html[data-theme="lofi"] {
  --font-body: "Quicksand", sans-serif;
  --font-display: "Quicksand", sans-serif;
  --bg-1: #19120e;
  --bg-2: #2b1d15;
  --surface: rgba(45, 31, 23, 0.88);
  --surface-strong: #261a13;
  --text-main: #fef3c7;
  --text-muted: #fbbf24;
  --text-dim: rgba(253, 230, 138, 0.62);
  --accent: #f59e0b;
  --accent-2: #fb923c;
  --neon-1: #fbbf24;
  --neon-2: #fb923c;
  --neon-3: #fde68a;
  --border-subtle: rgba(245, 158, 11, 0.3);
  --user-bg: rgba(146, 64, 14, 0.48);
  --user-text: #fffbeb;
  --user-border: rgba(251, 191, 36, 0.42);
  --ai-bg: rgba(38, 26, 19, 0.9);
  --ai-text: #fef3c7;
  --ai-border: rgba(217, 119, 6, 0.36);
  --bubble-radius-ai: 22px 22px 22px 8px;
  --bubble-radius-user: 22px 22px 8px 22px;
  --bubble-shadow: 0 6px 20px rgba(10, 6, 3, 0.46);
  --rx-glow-ai: rgba(245, 158, 11, 0.56);
  --rx-glow-user: rgba(251, 146, 60, 0.56);
  --rx-aura-1: rgba(245, 158, 11, 0.36);
  --rx-aura-2: rgba(234, 88, 12, 0.28);
  --composer-radius: 24px;
}

/* ─── 13. Nebulosa Profunda ─── */
html[data-theme="galaxia"] {
  --font-body: "Plus Jakarta Sans", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
  --bg-1: #040510;
  --bg-2: #0f1035;
  --surface: rgba(16, 18, 52, 0.82);
  --surface-strong: rgba(11, 12, 38, 0.96);
  --text-main: #eef2ff;
  --text-muted: #a5b4fc;
  --text-dim: rgba(199, 210, 254, 0.6);
  --accent: #818cf8;
  --accent-2: #f472b6;
  --neon-1: #818cf8;
  --neon-2: #f472b6;
  --neon-3: #38bdf8;
  --border-subtle: rgba(129, 140, 248, 0.34);
  --user-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.4));
  --user-text: #eef2ff;
  --user-border: rgba(165, 180, 252, 0.5);
  --ai-bg: rgba(14, 16, 46, 0.84);
  --ai-text: #e0e7ff;
  --ai-border: rgba(244, 114, 182, 0.35);
  --bubble-radius-ai: 24px 24px 24px 4px;
  --bubble-radius-user: 24px 24px 4px 24px;
  --bubble-shadow: 0 8px 26px rgba(3, 4, 18, 0.55);
  --rx-glow-ai: rgba(129, 140, 248, 0.65);
  --rx-glow-user: rgba(244, 114, 182, 0.62);
  --rx-aura-1: rgba(99, 102, 241, 0.45);
  --rx-aura-2: rgba(236, 72, 153, 0.36);
  --composer-radius: 28px;
}

/* ─── 14. Synthwave Arcade ─── */
html[data-theme="outrun"] {
  --font-body: "Space Grotesk", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
  --bg-1: #0d0221;
  --bg-2: #240b36;
  --surface: rgba(22, 6, 44, 0.86);
  --surface-strong: #16052b;
  --text-main: #fff0f6;
  --text-muted: #ff71ce;
  --text-dim: rgba(255, 180, 226, 0.62);
  --accent: #ff2a85;
  --accent-2: #ffbe0b;
  --neon-1: #ff2a85;
  --neon-2: #01cdfe;
  --neon-3: #ffbe0b;
  --border-subtle: rgba(255, 42, 133, 0.48);
  --user-bg: rgba(58, 12, 163, 0.52);
  --user-text: #ffffff;
  --user-border: #01cdfe;
  --ai-bg: rgba(25, 6, 48, 0.9);
  --ai-text: #ffe5f1;
  --ai-border: #ff2a85;
  --bubble-radius-ai: 14px;
  --bubble-radius-user: 14px;
  --bubble-shadow: 0 0 16px rgba(255, 42, 133, 0.24);
  --rx-glow-ai: rgba(255, 42, 133, 0.75);
  --rx-glow-user: rgba(1, 205, 254, 0.72);
  --rx-aura-1: rgba(255, 42, 133, 0.48);
  --rx-aura-2: rgba(255, 190, 11, 0.38);
  --composer-radius: 16px;
}

/* ─── 15. Prisma Holo Y2K ─── */
html[data-theme="holoy2k"] {
  --font-body: "Quicksand", sans-serif;
  --font-display: "Space Grotesk", sans-serif;
  --bg-1: #eef6ff;
  --bg-2: #f9ecff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text-main: #1e1b4b;
  --text-muted: #9333ea;
  --text-dim: rgba(49, 46, 129, 0.62);
  --accent: #a855f7;
  --accent-2: #06b6d4;
  --neon-1: #ec4899;
  --neon-2: #06b6d4;
  --neon-3: #a855f7;
  --border-subtle: rgba(168, 85, 247, 0.35);
  --user-bg: linear-gradient(135deg, rgba(224, 242, 254, 0.92), rgba(243, 232, 255, 0.92));
  --user-text: #1e1b4b;
  --user-border: rgba(6, 182, 212, 0.55);
  --ai-bg: rgba(255, 255, 255, 0.88);
  --ai-text: #1e1b4b;
  --ai-border: rgba(236, 72, 153, 0.48);
  --bubble-radius-ai: 26px;
  --bubble-radius-user: 26px;
  --bubble-shadow: 0 6px 20px rgba(147, 51, 234, 0.12), inset 0 2px 3px rgba(255, 255, 255, 0.9);
  --rx-glow-ai: rgba(236, 72, 153, 0.55);
  --rx-glow-user: rgba(6, 182, 212, 0.55);
  --rx-aura-1: rgba(236, 72, 153, 0.36);
  --rx-aura-2: rgba(6, 182, 212, 0.36);
  --composer-radius: 30px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BASE RESET & VIEWPORT SHELL
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-1);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUDIO-REACTIVE MULTI-THEME BACKGROUND STAGE
   ═══════════════════════════════════════════════════════════════════════════ */

#bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 100%);
  overflow: hidden;
  transition: background 0.35s ease;
}

#bg-pattern {
  position: absolute;
  inset: 0;
  opacity: calc(0.45 + var(--rx-mid) * 0.35);
}

html[data-theme="neotokyo"] #bg-pattern {
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 42, 133, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

html[data-theme="crt"] #bg-pattern {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.36) 0px,
    rgba(0, 0, 0, 0.36) 1px,
    rgba(34, 197, 94, 0.05) 2px,
    rgba(34, 197, 94, 0.05) 3px
  );
}

html[data-theme="brutalista"] #bg-pattern {
  background-image: radial-gradient(#111111 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.16;
}

html[data-theme="editorial"] #bg-pattern,
html[data-theme="sumie"] #bg-pattern {
  background-image: radial-gradient(rgba(120, 88, 42, 0.08) 1px, transparent 0);
  background-size: 16px 16px;
}

html[data-theme="vaporwave"] #bg-pattern,
html[data-theme="outrun"] #bg-pattern {
  background:
    linear-gradient(to bottom, transparent 55%, rgba(255, 42, 133, 0.16) 100%),
    repeating-linear-gradient(90deg, rgba(255, 79, 216, 0.11) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(0deg, rgba(0, 245, 212, 0.09) 0 1px, transparent 1px 28px);
}

html[data-theme="galaxia"] #bg-pattern {
  background-image:
    radial-gradient(1.5px 1.5px at 18% 24%, #ffffff, transparent),
    radial-gradient(1px 1px at 72% 16%, #c7d2fe, transparent),
    radial-gradient(1.5px 1.5px at 42% 68%, #fbcfe8, transparent),
    radial-gradient(1px 1px at 86% 77%, #ffffff, transparent),
    radial-gradient(1.5px 1.5px at 12% 82%, #a5b4fc, transparent);
  background-size: 240px 240px;
}

html[data-theme="noir"] #bg-pattern {
  background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.78) 100%);
}

#bg-reactive-aura {
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(circle at 22% 20%, var(--rx-aura-1) 0%, transparent 52%),
    radial-gradient(circle at 80% 78%, var(--rx-aura-2) 0%, transparent 54%);
  opacity: calc(0.28 + var(--rx-bass) * 0.65);
  transform: scale(calc(1 + var(--rx-bass) * 0.14));
  will-change: transform, opacity;
}

#bg-reactive-pulse {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 92vw;
  height: 92vw;
  max-width: 560px;
  max-height: 560px;
  transform: translate(-50%, -50%) scale(calc(0.82 + var(--rx-energy) * 0.42));
  border-radius: 50%;
  background: radial-gradient(circle, var(--rx-aura-1) 0%, transparent 68%);
  opacity: calc(var(--rx-energy) * 0.55);
  will-change: transform, opacity;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN APP LAYOUT & CIRCULAR THIN NEON ANIMATED PORTRAIT
   ═══════════════════════════════════════════════════════════════════════════ */

#app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 780px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
}

#chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: calc(9px + var(--safe-top)) 16px 9px 10px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 5;
}

.chats-back-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.14s ease, background 0.15s ease;
}
.chats-back-btn:active {
  transform: scale(0.9);
  background: rgba(127, 127, 127, 0.16);
}

.unread-badge {
  position: absolute;
  top: 2px;
  right: 0px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
html[data-theme="noir"] .unread-badge {
  color: #09090b;
}

/* ─── WhatsApp-Style Multi-Chat Screen (#chats-screen) ─── */
.chats-screen {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
}

.chats-panel {
  width: 100%;
  max-width: 780px;
  height: 100dvh;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
}

.chats-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 18px 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
}

.chats-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.chats-horns-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.chats-brand-title {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
}

.rooms-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px calc(20px + var(--safe-bottom)) 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 13px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}
.room-row:active {
  transform: scale(0.985);
}
.room-row.active {
  background: var(--surface);
  border-color: var(--border-subtle);
}

.room-avatar-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2), var(--neon-3));
  flex-shrink: 0;
}
.room-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #050608;
}

.room-meta {
  flex: 1;
  min-width: 0;
}
.room-top-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.room-title {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
.room-bottom-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}
.room-preview {
  font-size: 0.83rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
html[data-theme="noir"] .room-unread {
  color: #09090b;
}

#portrait-trigger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
}

/* ALWAYS Circular Across All 15 Themes + Larger Photo + Thin Hugged Rotating Neon Frame! */
@keyframes neonSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes neonPulseSoft {
  0%, 100% {
    box-shadow:
      0 0 calc(7px + var(--rx-bass) * 18px) color-mix(in srgb, var(--neon-1) 78%, transparent),
      0 0 calc(3px + var(--rx-mid) * 12px) color-mix(in srgb, var(--neon-2) 65%, transparent);
  }
  50% {
    box-shadow:
      0 0 calc(12px + var(--rx-bass) * 20px) color-mix(in srgb, var(--neon-2) 85%, transparent),
      0 0 calc(5px + var(--rx-mid) * 14px) color-mix(in srgb, var(--neon-3) 72%, transparent);
  }
}

#portrait-frame {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50% !important;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: neonPulseSoft 3.8s ease-in-out infinite;
  transition: transform 0.18s ease;
}

/* Rotating thin neon light stream hugged tight right around the circle */
#portrait-frame::before {
  content: "";
  position: absolute;
  inset: -28%;
  background: conic-gradient(
    from 0deg,
    var(--neon-1) 0deg,
    var(--neon-2) 115deg,
    var(--neon-3) 225deg,
    color-mix(in srgb, var(--neon-1) 35%, var(--neon-2)) 305deg,
    var(--neon-1) 360deg
  );
  animation: neonSpin 4.4s linear infinite;
  z-index: 0;
}

#portrait-trigger:active #portrait-frame {
  transform: scale(0.95);
}

.portrait-pic {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-1);
}

#prisma-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
}

html[data-theme="noir"] #prisma-avatar {
  filter: grayscale(0.75) contrast(1.12);
}

.header-name-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.header-title {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.radio-mini-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 13px;
}
.radio-mini-wave i {
  display: block;
  width: 2.5px;
  background: var(--accent);
  border-radius: 2px;
}
.radio-mini-wave i:nth-child(1) { height: calc(3px + var(--rx-bass) * 10px); }
.radio-mini-wave i:nth-child(2) { height: calc(4px + var(--rx-mid) * 9px); }
.radio-mini-wave i:nth-child(3) { height: calc(3px + var(--rx-high) * 10px); }

/* ═══════════════════════════════════════════════════════════════════════════
   MESSAGES AREA & AUDIO-REACTIVE BUBBLES (ALL 15 THEMES)
   ═══════════════════════════════════════════════════════════════════════════ */

#messages-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px 14px 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

#messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-row {
  display: flex;
  width: 100%;
}
.msg-row.user { justify-content: flex-end; }
.msg-row.assistant { justify-content: flex-start; }

.msg-bubble {
  position: relative;
  max-width: 84%;
  padding: 11px 15px;
  font-size: 0.97rem;
  line-height: 1.48;
  word-wrap: break-word;
  overflow-wrap: break-word;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.25s ease, color 0.25s ease, border-radius 0.25s ease;
}

html[data-theme="editorial"] .msg-bubble,
html[data-theme="carmesi"] .msg-bubble,
html[data-theme="noir"] .msg-bubble {
  font-size: 1.09rem;
  line-height: 1.5;
}

.msg-row.assistant .msg-bubble {
  background: var(--ai-bg);
  color: var(--ai-text);
  border: 1px solid var(--ai-border);
  border-radius: var(--bubble-radius-ai);
  box-shadow:
    var(--bubble-shadow),
    0 0 calc(var(--rx-bass) * 22px) calc(var(--rx-energy) * 2px) var(--rx-glow-ai);
}

.msg-row.assistant[data-sender="bismuto"] .msg-bubble {
  border-color: rgba(56, 189, 248, 0.55);
}

.msg-sender-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  color: var(--accent);
}
.msg-sender-tag.bismuto {
  color: #38bdf8;
}

.msg-row.user .msg-bubble {
  background: var(--user-bg);
  color: var(--user-text);
  border: 1px solid var(--user-border);
  border-radius: var(--bubble-radius-user);
  box-shadow:
    var(--bubble-shadow),
    0 0 calc(var(--rx-mid) * 20px) calc(var(--rx-energy) * 2px) var(--rx-glow-user);
}

html[data-theme="brutalista"] .msg-bubble {
  border-width: 2.5px;
  backdrop-filter: none;
  transform: translateY(calc(var(--rx-bass) * -1.5px));
}

html[data-theme="sumie"] .msg-row.assistant .msg-bubble {
  border: none;
  border-left: 3px solid var(--ai-border);
}
html[data-theme="sumie"] .msg-row.user .msg-bubble {
  border: none;
  border-right: 3px solid var(--user-border);
}

html[data-theme="crt"] .msg-row.assistant .msg-bubble::before {
  content: "PRISMA > ";
  font-weight: 700;
  color: var(--accent-2);
}
html[data-theme="crt"] .msg-row.user .msg-bubble::before {
  content: "EDGAR > ";
  font-weight: 700;
  color: var(--accent);
}

.msg-text p { margin: 0 0 8px 0; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text pre {
  margin: 8px 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #f8fafc;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  overflow-x: auto;
}
.msg-text code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.86em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(127, 127, 127, 0.18);
}

.msg-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.msg-media-img {
  max-width: 220px;
  max-height: 240px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}
.msg-media-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(127, 127, 127, 0.16);
}

.msg-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 4px;
  font-size: 0.66rem;
  opacity: 0.55;
}

.typing-row { margin-top: 10px; }
.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: var(--bubble-radius-ai);
  background: var(--ai-bg);
  border: 1px solid var(--ai-border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.15); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM COMPOSER + 3-OPTION ATTACHMENT MENU (Cámara · Galería · Audio)
   ═══════════════════════════════════════════════════════════════════════════ */

#composer-wrap {
  position: relative;
  flex-shrink: 0;
  padding: 8px 14px calc(10px + var(--safe-bottom)) 14px;
  background: linear-gradient(to top, var(--bg-1) 40%, transparent);
  z-index: 6;
}

.composer-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 8px;
  background: var(--surface-strong);
  border: 1px solid var(--border-subtle);
  border-radius: var(--composer-radius);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.25),
    0 0 calc(var(--rx-bass) * 14px) var(--rx-glow-ai);
}

html[data-theme="brutalista"] .composer-bar {
  border-width: 2.5px;
  box-shadow: 4px 4px 0 #111111;
}

#msg-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.38;
  max-height: 120px;
  padding: 7px 4px;
  resize: none;
}
#msg-input::placeholder { color: var(--text-dim); }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.icon-btn:active { transform: scale(0.92); }
.attach-trigger {
  background: rgba(127, 127, 127, 0.15);
  color: var(--text-main);
}
.action-trigger {
  background: var(--accent);
  color: #ffffff;
}
html[data-theme="brutalista"] .icon-btn,
html[data-theme="crt"] .icon-btn,
html[data-theme="vaporwave"] .icon-btn { border-radius: 4px; }
html[data-theme="noir"] .action-trigger { color: #09090b; }

.action-trigger.mode-mic .ico-send { display: none; }
.action-trigger.mode-send .ico-mic { display: none; }

.staging-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px 10px 4px;
}
.staged-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  flex-shrink: 0;
}
.staged-thumb {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  object-fit: cover;
}
.staged-remove {
  border: none;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
}

.attach-popover {
  position: absolute;
  left: 14px;
  bottom: calc(64px + var(--safe-bottom));
  width: 162px;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.56);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
}
.attach-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.attach-opt:hover,
.attach-opt:active {
  background: rgba(127, 127, 127, 0.16);
}
.attach-ico { font-size: 1.08rem; }

.voice-rec-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: var(--surface-strong);
  border: 1px solid var(--accent);
  border-radius: var(--composer-radius);
}
.rec-status { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  animation: dotPulse 1s infinite;
}
.rec-cancel, .rec-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-weight: 700;
}
.rec-cancel { background: rgba(239, 68, 68, 0.18); color: #ef4444; }
.rec-send { background: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   UNIFIED MENU (#prisma-menu — Opened by Tapping Prisma's Photo)
   ═══════════════════════════════════════════════════════════════════════════ */

.prisma-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
}

.menu-panel {
  width: 100%;
  max-width: 680px;
  height: 88dvh;
  max-height: 88dvh;
  padding: 14px 16px calc(16px + var(--safe-bottom)) 16px;
  border-radius: 26px 26px 0 0;
  background: var(--surface-strong);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.pc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #6b7280;
}
.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}
.status-dot.cloud {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.menu-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-pill-btn {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(127, 127, 127, 0.12);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.menu-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-main);
  font-size: 1rem;
  cursor: pointer;
}

.menu-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.block-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.block-label.no-mb {
  margin-bottom: 0;
}
.block-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

/* ─── Gemini-Only Credits HUD (Argon & 3.8 Flash · ZERO Claude) ─── */
.quota-reset-btn {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(127, 127, 127, 0.12);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.gemini-quota-card {
  padding: 12px 13px;
  border-radius: 16px;
  background: rgba(127, 127, 127, 0.09);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.quota-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quota-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.81rem;
  font-weight: 600;
}

.quota-model-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.quota-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.argon-dot {
  background: #e879f9;
  box-shadow: 0 0 7px #e879f9;
}
.flash-dot {
  background: #10b981;
  box-shadow: 0 0 7px #10b981;
}

.quota-pct {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.quota-track-wrap {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
}

.quota-bar-bg {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.22);
  overflow: hidden;
  pointer-events: none;
}

.quota-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.2s ease;
}
.argon-fill {
  background: linear-gradient(90deg, #a855f7, #ec4899, #f59e0b);
}
.flash-fill {
  background: linear-gradient(90deg, #10b981, #06b6d4, #38bdf8);
}

.quota-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.quota-route-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(127, 127, 127, 0.16);
}

.quota-route-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.quota-only-note {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* ─── Minimalist Theme Orbs: Just Styled Circle + Name Only! ─── */
.themes-orb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
@media (max-width: 395px) {
  .themes-orb-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.theme-orb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(127, 127, 127, 0.22);
  background: rgba(127, 127, 127, 0.08);
  color: var(--text-main);
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  transition: transform 0.14s ease, border-color 0.15s ease;
}
.theme-orb-item:active {
  transform: scale(0.96);
}
.theme-orb-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
  background: rgba(127, 127, 127, 0.16);
}

.theme-orb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.28);
}

.theme-orb-name {
  font-size: 0.77rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Radio Player & 30 Visually-Themed Station Cards ─── */
.radio-player-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(127, 127, 127, 0.1);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}
#radio-spectrum {
  width: 100%;
  height: 38px;
  display: block;
  margin-bottom: 6px;
}
.np-name {
  font-weight: 700;
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-genre {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.ctrl-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ctrl-btn.play-main {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 0.95rem;
}
#radio-vol {
  flex: 1;
  accent-color: var(--accent);
}

.genre-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 6px;
}
.genre-chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.genre-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
html[data-theme="noir"] .genre-chip.active,
html[data-theme="noir"] .ctrl-btn.play-main,
html[data-theme="noir"] .rec-send {
  color: #09090b;
}

.stations-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}
@media (max-width: 500px) {
  .stations-list {
    grid-template-columns: 1fr;
  }
}

.station-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 15px;
  border: 1px solid color-mix(in srgb, var(--st-a) 42%, var(--border-subtle));
  border-left: 3.5px solid var(--st-a);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--st-a) 18%, var(--surface)),
    color-mix(in srgb, var(--st-b) 14%, var(--surface))
  );
  color: var(--text-main);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.station-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--st-b) 35%, transparent) 0%, transparent 72%);
  pointer-events: none;
}
.station-card:active {
  transform: scale(0.985);
}
.station-card.active {
  border-color: var(--st-a);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--st-a) 45%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--st-b) 18%, transparent);
}

.st-emblem {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.22rem;
  background: linear-gradient(135deg, var(--st-a), var(--st-b));
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--st-a) 38%, rgba(0, 0, 0, 0.35)),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.st-info {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.st-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.st-title {
  font-size: 0.87rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.st-tag {
  font-size: 0.63rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--st-a) 26%, transparent);
  border: 1px solid color-mix(in srgb, var(--st-a) 45%, transparent);
  color: var(--text-main);
  flex-shrink: 0;
}

.st-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.74rem;
  line-height: 1.32;
  color: var(--text-dim);
  margin-top: 3px;
  overflow: hidden;
}

.st-playing-ind {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--st-a);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHTBOX & LOCK SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
  cursor: zoom-out;
}
#lightbox-img {
  max-width: 94vw;
  max-height: 88dvh;
  border-radius: 14px;
  object-fit: contain;
}

#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top, #0d231c 0%, #050807 70%);
}
.lock-card {
  width: 100%;
  max-width: 320px;
  padding: 28px 22px;
  border-radius: 24px;
  background: rgba(12, 24, 20, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.35);
  text-align: center;
  color: #ecfdf5;
}
.lock-logo {
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.lock-title { margin: 12px 0 2px 0; font-size: 1.35rem; }
.lock-sub { margin: 0 0 18px 0; font-size: 0.82rem; color: rgba(209, 250, 229, 0.65); }
#lock-form { display: flex; flex-direction: column; gap: 10px; }
#lock-pin-input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(5, 12, 10, 0.8);
  color: #fff;
  font-size: 16px;
  text-align: center;
  outline: none;
}
#lock-submit-btn {
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: #10b981;
  color: #04130e;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.lock-error {
  margin: 10px 0 0 0;
  font-size: 0.8rem;
  color: #f87171;
  min-height: 1.1em;
}
