/* IASE / PublishOS — Dark Glassmorphism Design System
   Self-hosted fonts — GDPR compliant (no external requests). */

/* === Inter (Variable Font, weights 300-800) === */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/static/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/static/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === Space Grotesk (Variable Font, weights 400-700) === */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === JetBrains Mono (Variable Font, weights 400-500) === */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === Playfair Display (Variable Font, weights 400-800) === */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/playfair-display-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/playfair-display-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/playfair-display-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/playfair-display-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === OpenDyslexic (Regular + Bold) === */
@font-face {
  font-family: 'OpenDyslexic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/opendyslexic-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'OpenDyslexic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/opendyslexic-bold.woff2') format('woff2');
}

/* ═══════════════════════════════════════════════════════════════
   Design Tokens (CSS custom properties instead of Tailwind @theme)
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --color-bg-base: #0A0A0F;
  --color-bg-surface: #111118;
  --color-bg-elevated: #1A1A24;
  --color-bg-glass: rgba(255, 255, 255, 0.03);
  --color-bg-glass-hover: rgba(255, 255, 255, 0.05);
  /* Accent */
  --color-accent: #00D4AA;
  --color-accent-hover: #14B8A6;
  --color-accent-muted: rgba(0, 212, 170, 0.15);
  --color-accent-subtle: rgba(0, 212, 170, 0.08);
  /* Secondary */
  --color-secondary: #1E3A5F;
  --color-secondary-hover: #264A73;
  /* Text */
  --color-text-heading: #FFFFFF;
  --color-text-body: #94A3B8;
  --color-text-muted: #64748B;
  --color-text-dim: #475569;
  /* Borders */
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-hover: rgba(0, 212, 170, 0.15);
  /* Semantic */
  --color-success: #10B981;
  --color-warning: #FBBF24;
  --color-error: #EF4444;
  --color-info: #22D3EE;
  /* Fonts */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-serif: 'Playfair Display', 'Georgia', serif;
  --font-dyslexic: 'OpenDyslexic', sans-serif;
}

/* ═══════════════ RESET ═══════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════ BASE ═══════════════ */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text-body);
  background-color: var(--color-bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text-heading);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; transition: opacity 0.3s ease; }
::selection { background-color: var(--color-accent); color: var(--color-bg-base); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ═══════════════ LAYOUT UTILITIES ═══════════════ */
.container { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }
.gap-16 { gap: 4rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.relative { position: relative; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }

/* ═══════════════ SPACING ═══════════════ */
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-28 { padding-top: 7rem; padding-bottom: 7rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-16 { padding-top: 4rem; }
.pl-12 { padding-left: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-20 { margin-top: 5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }

/* ═══════════════ TYPOGRAPHY ═══════════════ */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-7xl { font-size: 4.5rem; line-height: 1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }
.font-serif { font-family: var(--font-serif); }
.tracking-tight { letter-spacing: -0.025em; }
.leading-relaxed { line-height: 1.625; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Colors */
.text-heading { color: var(--color-text-heading); }
.text-body { color: var(--color-text-body); }
.text-muted { color: var(--color-text-muted); }
.text-dim { color: var(--color-text-dim); }
.text-accent { color: var(--color-accent); }
.text-info { color: var(--color-info); }
.text-warning { color: var(--color-warning); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }

/* ═══════════════ SIZING ═══════════════ */
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-24 { height: 6rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-6xl { max-width: 72rem; }
.min-h-screen { min-height: 100vh; }
.aspect-book { aspect-ratio: 2/3; }

/* ═══════════════ BORDERS & ROUNDING ═══════════════ */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--color-border); }
.border-t { border-top: 1px solid var(--color-border); }
.border-b { border-bottom: 1px solid var(--color-border); }
.border-accent { border-color: var(--color-accent-muted); }
.border-dashed { border-style: dashed; }

/* ═══════════════ BACKGROUNDS ═══════════════ */
.bg-base { background-color: var(--color-bg-base); }
.bg-surface { background-color: var(--color-bg-surface); }
.bg-elevated { background-color: var(--color-bg-elevated); }
.bg-accent { background-color: var(--color-accent); }
.bg-accent-10 { background-color: rgba(0, 212, 170, 0.1); }
.bg-info-10 { background-color: rgba(34, 211, 238, 0.1); }
.bg-warning-10 { background-color: rgba(251, 191, 36, 0.1); }
.bg-success-10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-error-10 { background-color: rgba(239, 68, 68, 0.1); }

/* ═══════════════ GRID ═══════════════ */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.col-span-full { grid-column: 1 / -1; }

/* ═══════════════ GRID PATTERN BACKGROUND ═══════════════ */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 212, 170, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 212, 170, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 30%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .grid-bg {
  background-image:
    linear-gradient(to right, rgba(0, 155, 125, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 155, 125, 0.06) 1px, transparent 1px);
}
[data-theme="sepia"] .grid-bg {
  background-image:
    linear-gradient(to right, rgba(139, 105, 20, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(139, 105, 20, 0.04) 1px, transparent 1px);
}

/* ═══════════════ NOISE OVERLAY ═══════════════ */
.noise-overlay::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

[data-theme="light"] .noise-overlay::after,
[data-theme="sepia"] .noise-overlay::after { opacity: 0; }

/* Light/sepia: tone down glow orbs */
[data-theme="light"] .glow-orb { opacity: 0.3; }
[data-theme="sepia"] .glow-orb { opacity: 0.2; }

/* Light/sepia: specular border uses CSS vars so it adapts automatically */

/* ═══════════════ GLOW ORBS ═══════════════ */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.glow-orb-cyan { background: radial-gradient(circle, rgba(0, 212, 170, 0.12) 0%, transparent 70%); }
.glow-orb-blue { background: radial-gradient(circle, rgba(30, 58, 95, 0.2) 0%, transparent 70%); }

/* ═══════════════ GLASSMORPHISM ═══════════════ */
.glass-card {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  transition: border-color 0.2s, background 0.2s;
}
.glass-card:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-glass-hover);
}
.glass-card-static {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

/* ═══════════════ NAV GLASSMORPHISM ═══════════════ */
.nav-glass {
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  will-change: transform;
}
.nav-glass.scrolled {
  background: rgba(10, 10, 15, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .nav-glass {
  background: rgba(250, 250, 250, 0.8);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .nav-glass.scrolled {
  background: rgba(250, 250, 250, 0.95);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
[data-theme="sepia"] .nav-glass {
  background: rgba(244, 237, 223, 0.8);
  border-bottom-color: rgba(100, 80, 50, 0.08);
}
[data-theme="sepia"] .nav-glass.scrolled {
  background: rgba(244, 237, 223, 0.95);
  border-bottom-color: rgba(100, 80, 50, 0.12);
}

/* ═══════════════ SPECULAR BORDER ═══════════════ */
@property --spec-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.specular-border {
  position: relative;
  border-radius: 1rem;
  padding: 1px;
  background: linear-gradient(var(--color-bg-base), var(--color-bg-base)) padding-box,
    conic-gradient(from var(--spec-angle), transparent 60%, rgba(0, 212, 170, 0.2) 80%, transparent 100%) border-box;
  border: 1px solid transparent;
  animation: specular-spin 6s linear infinite;
}
@keyframes specular-spin { to { --spec-angle: 360deg; } }

/* ═══════════════ BUTTONS ═══════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-bg-base);
  background-color: var(--color-accent);
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover { background-color: var(--color-accent-hover); box-shadow: 0 0 30px rgba(0, 212, 170, 0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-accent);
  background: transparent;
  border: 1px solid var(--color-accent-muted);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background-color: var(--color-accent-subtle); border-color: var(--color-accent); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text-body);
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { color: var(--color-accent); background: var(--color-accent-subtle); }

/* ═══════════════ SECTION HELPERS ═══════════════ */
.section-label {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.section-divider {
  height: 1px;
  max-width: 200px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--color-accent-muted), transparent);
}
.gradient-text {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-info) 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════ SCROLL PROGRESS ═══════════════ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  z-index: 100;
  transform-origin: left;
  transform: scaleX(0);
  will-change: transform;
}

/* ═══════════════ BENTO GRID ═══════════════ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 1px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 1rem;
  overflow: hidden;
}
.bento-grid > * { background: var(--color-bg-base); padding: 2rem; }
.bento-featured { grid-column: span 2; grid-row: span 2; }

/* ═══════════════ BOOK GRID ═══════════════ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

/* ═══════════════ FORM INPUT ═══════════════ */
.input {
  width: 100%;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--color-text-heading);
  transition: border-color 0.2s;
}
.input::placeholder { color: var(--color-text-dim); }
.input:focus { border-color: var(--color-accent); outline: none; }

.select {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--color-text-body);
  font-size: 0.875rem;
}
.select:focus { border-color: var(--color-accent); outline: none; }

.label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--color-text-body); margin-bottom: 0.375rem; }

/* ═══════════════ BADGE ═══════════════ */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.badge-active { background-color: var(--color-accent); color: var(--color-bg-base); border-color: var(--color-accent); }
.badge-warning { background-color: rgba(251,191,36,0.15); color: var(--color-warning); border-color: rgba(251,191,36,0.3); }
.badge-info { background-color: rgba(34,211,238,0.15); color: var(--color-info); border-color: rgba(34,211,238,0.3); }
.badge-success { background-color: rgba(16,185,129,0.15); color: var(--color-success); border-color: rgba(16,185,129,0.3); }
.badge-error { background-color: rgba(239,68,68,0.15); color: var(--color-error); border-color: rgba(239,68,68,0.3); }
.badge-muted { background-color: var(--color-bg-surface); color: var(--color-text-muted); border-color: var(--color-border); }

/* ═══════════════ SKELETON ═══════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-surface) 25%, var(--color-bg-elevated) 50%, var(--color-bg-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════════════ ANIMATIONS ═══════════════ */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 3s ease-in-out infinite; }

[data-reveal] { opacity: 0; transform: translateY(30px); }
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm\:flex-row { flex-direction: row; }
  .sm\:text-5xl { font-size: 3rem; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-detail { grid-template-columns: 300px 1fr; }
  .md\:text-4xl { font-size: 2.25rem; }
  .md\:text-5xl { font-size: 3rem; }
  .md\:text-6xl { font-size: 3.75rem; }
  .md\:text-xl { font-size: 1.25rem; }
  .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
  .md\:py-32 { padding-top: 8rem; padding-bottom: 8rem; }
  .md\:py-40 { padding-top: 10rem; padding-bottom: 10rem; }
  .md\:p-10 { padding: 2.5rem; }
}
@media (max-width: 768px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-featured { grid-column: span 1; grid-row: span 1; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:col-span-1 { grid-column: span 1; }
  .lg\:text-7xl { font-size: 4.5rem; }
}

/* ═══════════════ TRANSITIONS ═══════════════ */
.transition-colors { transition: color 0.2s, background-color 0.2s, border-color 0.2s; }
.transition-all { transition: all 0.2s; }
.hover\:text-accent:hover { color: var(--color-accent); }
.hover\:bg-surface:hover { background-color: var(--color-bg-glass-hover); }
.group:hover .group-hover\:text-accent { color: var(--color-accent); }
.group:hover .group-hover\:border-hover { border-color: var(--color-border-hover); }

/* ═══════════════ ACCESSIBILITY ═══════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scroll-progress, .specular-border { animation: none; }
  .grid-bg, .noise-overlay::after { display: none; }
  [data-reveal] { opacity: 1; transform: none; }
}

section:not(:first-of-type) { content-visibility: auto; contain-intrinsic-size: auto 500px; }

/* ═══════════════ NAV HEIGHT ═══════════════ */
/* ═══════════════ EXTRA UTILITIES ═══════════════ */
.h-16 { height: 4rem; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.opacity-60 { opacity: 0.6; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.text-red-400 { color: #f87171; }

/* ═══════════════ SLASH-OPACITY BACKGROUNDS ═══════════════ */
.bg-accent\/10 { background-color: rgba(0, 212, 170, 0.1); }
.bg-accent\/90 { background-color: rgba(0, 212, 170, 0.9); }
.bg-white\/5 { background-color: var(--color-bg-glass); }
.border-accent\/20 { border-color: rgba(0, 212, 170, 0.2); }
.border-accent\/30 { border-color: rgba(0, 212, 170, 0.3); }
.border-white\/10 { border-color: var(--color-border); }
.border-red-400\/20 { border-color: rgba(248, 113, 113, 0.2); }
.hover\:bg-accent\/20:hover { background-color: rgba(0, 212, 170, 0.2); }
.hover\:bg-white\/10:hover { background-color: var(--color-bg-glass-hover); }
.hover\:bg-red-400\/10:hover { background-color: rgba(248, 113, 113, 0.1); }

/* ═══════════════ SPIN ANIMATION ═══════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* ═══════════════ HTMX INDICATOR ═══════════════ */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

/* ═══════════════ LIGHT THEME ═══════════════ */
[data-theme="light"] {
  --color-bg-base: #FAFAFA;
  --color-bg-surface: #EEEEEE;
  --color-bg-elevated: #E0E0E0;
  --color-bg-glass: rgba(0, 0, 0, 0.03);
  --color-bg-glass-hover: rgba(0, 0, 0, 0.06);
  --color-accent: #009B7D;
  --color-accent-hover: #007D64;
  --color-accent-muted: rgba(0, 155, 125, 0.15);
  --color-accent-subtle: rgba(0, 155, 125, 0.08);
  --color-secondary: #CADFF0;
  --color-secondary-hover: #B0CDE6;
  --color-text-heading: #1A1A2E;
  --color-text-body: #4A5568;
  --color-text-muted: #718096;
  --color-text-dim: #A0AEC0;
  --color-border: rgba(0, 0, 0, 0.1);
  --color-border-hover: rgba(0, 155, 125, 0.25);
  --color-success: #059669;
  --color-warning: #D97706;
  --color-error: #DC2626;
  --color-info: #0891B2;
}

/* ═══════════════ SEPIA THEME ═══════════════ */
[data-theme="sepia"] {
  --color-bg-base: #F4EDDF;
  --color-bg-surface: #E8DFD0;
  --color-bg-elevated: #DDD3C1;
  --color-bg-glass: rgba(139, 119, 82, 0.05);
  --color-bg-glass-hover: rgba(139, 119, 82, 0.1);
  --color-accent: #8B6914;
  --color-accent-hover: #725511;
  --color-accent-muted: rgba(139, 105, 20, 0.15);
  --color-accent-subtle: rgba(139, 105, 20, 0.08);
  --color-secondary: #C4B08A;
  --color-secondary-hover: #B09A70;
  --color-text-heading: #3E2C14;
  --color-text-body: #5C4A32;
  --color-text-muted: #7A6850;
  --color-text-dim: #9A8B75;
  --color-border: rgba(100, 80, 50, 0.12);
  --color-border-hover: rgba(139, 105, 20, 0.25);
  --color-success: #5D7A3A;
  --color-warning: #B8860B;
  --color-error: #A0522D;
  --color-info: #4682B4;
}

/* ═══════════════ HIGH CONTRAST MODE ═══════════════ */
[data-text-mode="high-contrast"] #reader-content {
  color: #FFFFFF;
  font-weight: 500;
  line-height: 2;
  letter-spacing: 0.01em;
}
[data-theme="light"][data-text-mode="high-contrast"] #reader-content,
[data-theme="sepia"][data-text-mode="high-contrast"] #reader-content {
  color: #000000;
}

/* ═══════════════ DYSLEXIC TEXT MODE ═══════════════ */
[data-text-mode="dyslexic"] #reader-content {
  font-family: var(--font-dyslexic) !important;
  letter-spacing: 0.05em;
  word-spacing: 0.15em;
  line-height: 2;
}

/* ═══════════════ BIONIC READING ═══════════════ */
[data-bionic] {
  font-weight: 700;
}

/* ═══════════════ READER SETTINGS PANEL ═══════════════ */
#reader-settings-panel {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  z-index: 49;
  background: color-mix(in srgb, var(--color-bg-base) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  transform: translateY(calc(100% + 60px));
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
  pointer-events: none;
}
#reader-settings-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.settings-inner {
  max-width: 42rem;
  margin: 0 auto;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}
.settings-row + .settings-row {
  border-top: 1px solid var(--color-border);
}
.settings-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  min-width: 4.5rem;
}
.settings-options {
  display: flex;
  gap: 0.375rem;
}
.settings-pick {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-body);
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.15s;
}
.settings-pick:hover {
  border-color: var(--color-accent-muted);
  color: var(--color-accent);
}
.settings-pick.active {
  background: var(--color-accent);
  color: var(--color-bg-base);
  border-color: var(--color-accent);
}

/* ═══════════════ FOCUS MODE ═══════════════ */
.focus-mode #reader-content > * {
  opacity: 0.15;
  transition: opacity 0.3s ease;
}
.focus-mode #reader-content > *.focused {
  opacity: 1;
}

/* ═══════════════ PAGINATED READING MODE ═══════════════ */
.paginated #reader-content {
  column-width: 100%;
  column-gap: 4rem;
  column-fill: auto;
  height: calc(100vh - 10rem);
  overflow: hidden;
  transition: none;
}
.paginated #reader-content > * {
  break-inside: avoid;
}
#page-indicator {
  position: fixed;
  bottom: 65px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 48;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--color-text-dim);
  background: color-mix(in srgb, var(--color-bg-base) 85%, transparent);
  padding: 0.25rem 0.625rem;
  border-radius: 0.25rem;
  display: none;
}
.paginated #page-indicator {
  display: block;
}

/* ═══════════════ SHARE QUOTE TOOLBAR ═══════════════ */
.quote-toolbar {
  position: absolute;
  z-index: 52;
  display: flex;
  gap: 0.25rem;
  padding: 0.375rem;
  background: color-mix(in srgb, var(--color-bg-base) 95%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
}
.quote-toolbar button {
  padding: 0.25rem 0.625rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-body);
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.15s;
}
.quote-toolbar button:hover {
  background: var(--color-accent);
  color: var(--color-bg-base);
  border-color: var(--color-accent);
}

/* ═══════════════ IN-CHAPTER SEARCH ═══════════════ */
#reader-search-bar {
  display: none;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
}
#reader-search-bar.open {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#reader-search-bar input {
  flex: 1;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-heading);
}
#reader-search-bar input:focus {
  border-color: var(--color-accent);
  outline: none;
}
#reader-search-bar .search-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}
[data-search-hl] {
  background: rgba(251, 191, 36, 0.3);
  border-radius: 2px;
  padding: 0 1px;
}
[data-search-hl].search-active {
  background: rgba(251, 146, 0, 0.6);
  color: var(--color-text-heading);
}

/* ═══════════════ TOC & BOOKMARK PANELS ═══════════════ */
#toc-panel, #bookmark-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 320px;
  z-index: 51;
  background: color-mix(in srgb, var(--color-bg-base) 96%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow-y: auto;
  padding: 1.25rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#toc-panel {
  left: 0;
  border-right: 1px solid var(--color-border);
  transform: translateX(-100%);
}
#bookmark-panel {
  right: 0;
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
}
#toc-panel.open { transform: translateX(0); }
#bookmark-panel.open { transform: translateX(0); }
.panel-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-heading);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0.25rem;
}
.panel-close:hover { color: var(--color-accent); }
.panel-entry {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
}
.panel-entry:hover {
  background: var(--color-bg-glass-hover);
}
.panel-entry.current {
  background: var(--color-accent-subtle);
  border-left: 3px solid var(--color-accent);
}
.panel-entry-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-heading);
  display: block;
}
.panel-entry-meta {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.125rem;
}
.panel-entry-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.375rem;
}
.panel-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-dim);
  font-size: 0.8125rem;
}
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 640px) {
  #toc-panel, #bookmark-panel { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════
   Comic Reader Mode
   ══════════════════════════════════════════════════════════════════ */
.comic-mode {
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-body);
}
.comic-page-wrapper {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}
.comic-page-image {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  object-fit: contain;
  transition: transform 0.2s ease;
}
.comic-page-image.zoomed {
  max-width: none;
  max-height: none;
  transform: scale(1.5);
  cursor: zoom-out;
}
.comic-page-counter {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}
/* Wider reader container for comics */
.reader-comic #reader-content.comic-mode {
  max-width: 100%;
}
.reader-comic #reader-toolbar .toolbar-inner {
  max-width: none;
}

/* ══════════════════════════════════════════════════════════════════
   Music Player Mode
   ══════════════════════════════════════════════════════════════════ */
.music-mode {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-body);
}
.music-player-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 1.5rem;
}
.music-album-art {
  width: 300px;
  height: 300px;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--color-bg-surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.music-album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.music-art-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  background: linear-gradient(135deg, var(--color-bg-surface), var(--color-bg-elevated));
}
.music-track-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-heading);
  text-align: center;
}
.music-info {
  width: 100%;
  color: var(--color-text-body);
  line-height: 1.6;
}
.music-info audio {
  width: 100%;
  margin: 1rem 0;
  border-radius: 0.5rem;
}
.music-info iframe {
  width: 100%;
  min-height: 120px;
  border: none;
  border-radius: 0.5rem;
}
.music-track-counter {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}
@media (max-width: 640px) {
  .music-album-art { width: 200px; height: 200px; }
}

/* ══════════════════════════════════════════════════════════════════
   3D Model Viewer Mode
   ══════════════════════════════════════════════════════════════════ */
.model3d-mode {
  max-width: none;
  padding: 1rem;
  font-family: var(--font-body);
}
.model3d-viewer-wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
}
.model3d-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-heading);
  text-align: center;
  margin-bottom: 1rem;
}
.model3d-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-surface);
  border-radius: 1rem;
  overflow: hidden;
}
.model3d-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.reader-model3d #reader-content.model3d-mode {
  max-width: 100%;
}
.reader-model3d #reader-toolbar .toolbar-inner {
  max-width: none;
}

/* ══════════════════════════════════════════════════════════════════
   Software / Game Info Page Mode
   ══════════════════════════════════════════════════════════════════ */
.info-mode {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-family: var(--font-body);
}
.info-page-wrap {
  width: 100%;
}
.info-content {
  color: var(--color-text-body);
  line-height: 1.8;
}
.info-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-heading);
  margin-bottom: 0.75rem;
}
.info-content p {
  margin-bottom: 1rem;
}
.info-content dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.info-content dt {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.info-content dd {
  font-size: 0.9375rem;
  color: var(--color-text-heading);
}
.info-content code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.125rem 0.5rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
}
.info-content a {
  color: var(--color-accent);
  transition: color 0.2s;
}
.info-content a:hover {
  color: var(--color-accent-hover);
}
.info-content .app-description {
  margin: 1rem 0;
}

/* === Screenplay Mode === */
.screenplay-mode { max-width: 640px; margin: 0 auto; font-family: "Courier New", Courier, monospace; }
.screenplay-content { line-height: 1.0; }
.sp-scene-heading {
  font-weight: 700; text-transform: uppercase; margin: 2em 0 1em;
  border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5em;
  letter-spacing: 0.02em; color: var(--color-text-heading);
}
.sp-character {
  text-align: center; text-transform: uppercase; font-weight: 600;
  margin: 1.5em 0 0; padding: 0; color: var(--color-text-heading);
}
.sp-parenthetical {
  text-align: center; margin: 0.25em auto; max-width: 280px;
  font-style: italic; color: var(--color-text-muted);
}
.sp-dialogue {
  text-align: center; margin: 0.25em auto 1em; max-width: 380px;
  color: var(--color-text-body);
}
.sp-action {
  margin: 1em 0; color: var(--color-text-body);
}
.sp-transition {
  text-align: right; text-transform: uppercase; font-weight: 600;
  margin: 1.5em 0; color: var(--color-text-muted);
}

/* === Newspaper Mode === */
.newspaper-mode { max-width: 800px; margin: 0 auto; }
.newspaper-content { }
.np-headline {
  font-size: 2rem; font-weight: 900; line-height: 1.15;
  margin-bottom: 0.5rem; color: var(--color-text-heading);
  font-family: var(--font-serif);
}
.np-byline {
  font-size: 0.85rem; font-weight: 600; color: var(--color-accent);
  margin-bottom: 0.25rem;
}
.np-dateline {
  font-size: 0.75rem; color: var(--color-text-dim);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 1.5rem; padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-accent);
}
.np-body {
  column-count: 2; column-gap: 2rem; column-rule: 1px solid rgba(255,255,255,0.06);
  line-height: 1.7; font-size: 0.95rem;
}
.np-body p { margin: 0 0 0.8em; text-indent: 1.5em; }
.np-body p:first-child { text-indent: 0; }
.np-body p:first-child::first-letter {
  float: left; font-size: 3.2em; line-height: 0.85; padding-right: 0.08em;
  font-weight: 700; color: var(--color-accent); font-family: var(--font-serif);
}
.np-body h2, .np-body h3 {
  column-span: all; font-family: var(--font-serif);
  margin: 1.5rem 0 0.75rem; font-weight: 800;
}
.np-body blockquote {
  column-span: all; margin: 1.5rem 0; padding: 1rem 1.5rem;
  border-left: 3px solid var(--color-accent);
  font-style: italic; font-size: 1.1rem; color: var(--color-text-muted);
}
@media (max-width: 640px) {
  .np-body { column-count: 1; }
  .np-headline { font-size: 1.5rem; }
}

/* === Poetry Mode === */
.poetry-mode { max-width: 600px; margin: 0 auto; text-align: center; }
.poetry-content {
  font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.8;
  color: var(--color-text-body);
}
.poetry-content p {
  margin: 0; white-space: pre-wrap; text-align: center;
}
.po-stanza { margin: 0 0 0.5em; }
.po-stanza-break { height: 1.5em; }
.poetry-content em { font-style: italic; color: var(--color-text-muted); }
.poetry-content strong { font-weight: 700; color: var(--color-text-heading); }

/* === Podcast Mode === */
.podcast-mode { max-width: 600px; margin: 0 auto; }
.podcast-player-wrap { text-align: center; }
.podcast-art {
  width: 240px; height: 240px; margin: 0 auto 1.5rem; border-radius: 16px;
  overflow: hidden; background: rgba(255,255,255,0.04);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.podcast-art-img { width: 100%; height: 100%; object-fit: cover; }
.podcast-art-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; color: rgba(255,255,255,0.2);
}
.podcast-episode-title {
  font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem;
  color: var(--color-text-heading);
}
.podcast-audio-player { margin: 0.5rem 0; }
.podcast-audio-player audio { width: 100%; }
.podcast-speed-bar {
  display: flex; justify-content: center; gap: 6px; margin: 0.75rem 0 1.5rem;
}
.podcast-speed-btn {
  padding: 4px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.15s;
}
.podcast-speed-btn:hover { border-color: rgba(255,255,255,0.2); }
.podcast-speed-btn.active {
  background: var(--color-accent); color: #000; border-color: var(--color-accent);
}
.podcast-show-notes {
  text-align: left; margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.podcast-show-notes h3 {
  font-size: 0.9rem; font-weight: 700; color: var(--color-text-heading);
  margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.podcast-show-notes p { font-size: 0.9rem; line-height: 1.7; color: var(--color-text-body); }
.podcast-show-notes a { color: var(--color-accent); }
.podcast-episode-counter {
  font-size: 0.75rem; color: var(--color-text-dim); margin-top: 1rem;
}

/* === Textbook Mode === */
.textbook-mode { max-width: 760px; margin: 0 auto; }
.textbook-content { line-height: 1.8; }
.tb-section-header {
  margin-bottom: 2rem; padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-accent);
}
.tb-section-num {
  display: block; font-size: 0.8rem; font-weight: 700;
  color: var(--color-accent); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 0.25rem;
}
.tb-section-title {
  font-size: 1.75rem; font-weight: 800; color: var(--color-text-heading);
  line-height: 1.2;
}
.tb-sub-num {
  color: var(--color-accent); font-weight: 700; margin-right: 0.25em;
}
.tb-callout {
  margin: 1.5rem 0; padding: 1.25rem 1.5rem; border-radius: 10px;
  background: rgba(0,212,170,0.06); border: 1px solid rgba(0,212,170,0.15);
  border-left: 4px solid var(--color-accent);
}
.tb-callout-label {
  font-size: 0.75rem; font-weight: 700; color: var(--color-accent);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem;
}
.tb-definition {
  margin: 0.75rem 0; padding: 0.75rem 1rem; border-radius: 8px;
  background: rgba(255,255,255,0.02); border-left: 3px solid rgba(255,255,255,0.15);
}
.tb-definition strong { color: var(--color-text-heading); }
.textbook-content h2, .textbook-content h3 {
  margin-top: 2rem; margin-bottom: 0.75rem;
  color: var(--color-text-heading);
}
.textbook-content table {
  width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem;
}
.textbook-content th {
  background: rgba(255,255,255,0.04); padding: 0.5rem 0.75rem;
  text-align: left; font-weight: 600; border-bottom: 2px solid rgba(255,255,255,0.1);
}
.textbook-content td {
  padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* === Dataset Mode === */
.dataset-mode { max-width: 960px; margin: 0 auto; }
.dataset-viewer-wrap { }
.dataset-title {
  font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem;
  color: var(--color-text-heading);
}
.dataset-filter-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 1rem;
}
.dataset-filter-input {
  flex: 1; padding: 8px 14px; border-radius: 8px; font-size: 0.85rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; outline: none; font-family: inherit;
  transition: border-color 0.15s;
}
.dataset-filter-input:focus { border-color: var(--color-accent); }
.dataset-row-count {
  font-size: 0.75rem; color: var(--color-text-dim); white-space: nowrap;
}
.dataset-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.06); border-radius: 8px;
  overflow: hidden;
}
.dataset-table th {
  background: rgba(255,255,255,0.05); padding: 10px 12px;
  text-align: left; font-weight: 600; font-size: 0.8rem;
  color: var(--color-text-heading);
  border-bottom: 2px solid rgba(255,255,255,0.08);
  user-select: none; white-space: nowrap;
}
.dataset-table th:hover { color: var(--color-accent); }
.dataset-table td {
  padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--color-text-body);
}
.dataset-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.dataset-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.01); }
.dataset-body { line-height: 1.7; }

/* === Engine Status Indicators === */
.engine-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.engine-dot-connected {
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent);
}
.engine-dot-disconnected {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239,68,68,0.4);
}
.engine-dot-reconnecting {
  background: #f59e0b;
  animation: engine-pulse 1.5s ease-in-out infinite;
}
.engine-dot-unknown {
  background: rgba(139,143,163,0.4);
}
@keyframes engine-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === Engine Build Log === */
.engine-log {
  max-height: 240px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 0.75rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════
   MEDIA PLAYER
   ═══════════════════════════════════════════════════════════════════ */

.media-player {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.media-player__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.media-player__controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  opacity: 0;
  transition: opacity 0.3s;
}

.media-player:hover .media-player__controls,
.media-player:focus-within .media-player__controls {
  opacity: 1;
}

.mp-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  min-width: 2rem;
  text-align: center;
}

.mp-btn:hover {
  color: var(--color-accent, #00D4AA);
}

.mp-progress {
  flex: 1;
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  cursor: pointer;
}

.mp-progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  pointer-events: none;
}

.mp-progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-accent, #00D4AA);
  border-radius: 3px;
  pointer-events: none;
}

.mp-seek {
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 14px;
  opacity: 0;
  cursor: pointer;
  margin: 0;
}

.mp-time {
  color: #fff;
  font-size: 0.75rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mp-quality {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  font-size: 0.7rem;
  cursor: pointer;
}

.mp-volume-slider {
  width: 60px;
  accent-color: var(--color-accent, #00D4AA);
}

/* Fullscreen tweaks */
.media-player:fullscreen .media-player__controls {
  opacity: 1;
}
.media-player:fullscreen .media-player__video {
  height: 100vh;
}

/* Video mode in reader */
.reader-video .reader-content {
  max-width: 100%;
  padding: 0;
}

.video-mode {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.video-info h3 {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.video-description {
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ─── Music Player (music-player.js) ─── */

.music-player {
  width: 100%;
  margin: 1rem 0;
}
.mp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.mp-title {
  font-weight: 600;
  color: var(--color-text-heading);
  font-size: 0.95rem;
}
.mp-duration {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.mp-waveform {
  width: 100%;
  height: 64px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 0.5rem;
}
.mp-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mp-play {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  padding: 4px;
}
.mp-play:hover { opacity: 0.8; }
.mp-time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  min-width: 3em;
}
.mp-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.mp-progress-bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0;
  transition: width 0.1s linear;
}
.mp-volume {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.mp-vol-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px;
}
.mp-vol-slider {
  width: 60px;
  accent-color: var(--color-accent);
}
.mp-play-inline {
  padding: 0.5rem 1.5rem;
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Mini-player (persistent bottom bar) */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  z-index: 1000;
  display: none;
}
.mini-player.visible { display: block; }
.mini-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mini-play {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
}
.mini-title {
  font-size: 0.85rem;
  color: var(--color-text-heading);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.mini-progress {
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 0.25rem;
  cursor: pointer;
}
.mini-progress-bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0;
  transition: width 0.1s linear;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL PERSISTENT PLAYER
   ═══════════════════════════════════════════════════════════════ */
.gp {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: rgba(10,10,15,0.95); backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
  transform: translateY(100%); transition: transform 0.3s ease;
}
.gp.visible { transform: translateY(0); }
.gp-progress {
  position: absolute; top: -2px; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,0.06); cursor: pointer;
}
.gp-progress-bar {
  height: 100%; background: var(--color-accent); width: 0;
  transition: width 0.15s linear; border-radius: 0 2px 2px 0;
}
.gp-inner {
  max-width: 80rem; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}
.gp-track { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex: 1; }
.gp-art {
  width: 40px; height: 40px; border-radius: 6px; overflow: hidden; flex-shrink: 0;
  background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center;
}
.gp-art img { width: 100%; height: 100%; object-fit: cover; }
.gp-meta { min-width: 0; }
.gp-title {
  display: block; font-size: 0.8125rem; font-weight: 600;
  color: var(--color-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 240px;
}
.gp-artist {
  display: block; font-size: 0.6875rem; color: var(--color-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px;
}
.gp-controls { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.gp-btn {
  background: none; border: none; color: var(--color-muted); cursor: pointer;
  padding: 0.375rem; border-radius: 50%; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.gp-btn:hover { color: var(--color-heading); background: rgba(255,255,255,0.06); }
.gp-play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-accent); color: #0A0A0F;
}
.gp-play-btn:hover { background: #00e8bc; color: #0A0A0F; }
.gp-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.gp-time { font-size: 0.6875rem; color: var(--color-dim); font-variant-numeric: tabular-nums; min-width: 5.5em; text-align: right; }
.gp-volume { display: flex; align-items: center; gap: 0.375rem; }
.gp-vol {
  -webkit-appearance: none; width: 72px; height: 3px; background: rgba(255,255,255,0.12);
  border-radius: 2px; outline: none; cursor: pointer;
}
.gp-vol::-webkit-slider-thumb {
  -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-accent); cursor: pointer;
}
@media (max-width: 640px) {
  .gp-volume, .gp-time { display: none; }
  .gp-title { max-width: 140px; }
}

/* ═══════════════════════════════════════════════════════════════
   MUSIC PAGE: SHELF RAILS
   ═══════════════════════════════════════════════════════════════ */
.shelf-section { padding: 0 0 2rem; }
.shelf-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 1.5rem; margin-bottom: 0.75rem;
}
.shelf-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--color-heading); }
.shelf-header a { font-size: 0.75rem; color: var(--color-accent); text-decoration: none; }
.shelf-rail {
  display: flex; gap: 1rem; overflow-x: auto; padding: 0 1.5rem 0.5rem;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shelf-rail::-webkit-scrollbar { display: none; }
.shelf-rail > * { scroll-snap-align: start; flex-shrink: 0; }

/* Track card (shelf item) */
.track-card {
  width: 160px; cursor: pointer; transition: transform 0.15s;
}
.track-card:hover { transform: translateY(-4px); }
.track-card-art {
  position: relative; width: 160px; height: 160px; border-radius: 8px;
  overflow: hidden; background: rgba(255,255,255,0.04);
}
.track-card-art img { width: 100%; height: 100%; object-fit: cover; }
.track-card-art .play-hover {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.15s;
}
.track-card:hover .play-hover { opacity: 1; }
.play-hover svg { color: #fff; }
.track-card-key {
  position: absolute; bottom: 6px; right: 6px; font-size: 0.625rem;
  background: rgba(0,0,0,0.7); color: var(--color-accent); padding: 2px 6px;
  border-radius: 4px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.track-card-meta { padding: 0.5rem 0; }
.track-card-meta h3 {
  font-size: 0.8125rem; font-weight: 600; color: var(--color-heading);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-card-meta p {
  font-size: 0.6875rem; color: var(--color-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   RADIO STATION CARDS
   ═══════════════════════════════════════════════════════════════ */
.radio-card {
  min-width: 220px; padding: 1.25rem; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer; transition: all 0.2s;
}
.radio-card:hover { border-color: var(--color-accent); background: rgba(0,212,170,0.04); transform: translateY(-2px); }
.radio-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.radio-live-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.625rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #ef4444; animation: pulse-live 2s ease-in-out infinite;
}
.radio-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #ef4444;
}
@keyframes pulse-live { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.radio-card h3 { font-size: 0.875rem; font-weight: 600; color: var(--color-heading); }
.radio-card-genre { font-size: 0.75rem; color: var(--color-accent); margin-top: 2px; }
.radio-card-info {
  display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem;
  font-size: 0.6875rem; color: var(--color-dim);
}
.radio-listeners { display: flex; align-items: center; gap: 4px; }

/* ═══════════════════════════════════════════════════════════════
   EPG TIMELINE GRID
   ═══════════════════════════════════════════════════════════════ */
.epg-grid {
  overflow-x: auto; border-radius: 12px; padding: 1rem;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
}
.epg-table { width: max-content; min-width: 100%; }
.epg-row { display: flex; align-items: stretch; border-bottom: 1px solid rgba(255,255,255,0.04); }
.epg-row:last-child { border-bottom: none; }
.epg-station {
  width: 140px; flex-shrink: 0; padding: 0.75rem; display: flex; align-items: center;
  font-size: 0.75rem; font-weight: 600; color: var(--color-heading);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.epg-slots { display: flex; flex: 1; position: relative; min-height: 48px; }
.epg-slot {
  padding: 0.5rem 0.75rem; font-size: 0.6875rem; color: var(--color-muted);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex; flex-direction: column; justify-content: center; min-width: 80px;
}
.epg-slot.current { background: rgba(0,212,170,0.08); color: var(--color-accent); }
.epg-slot-title { font-weight: 600; color: var(--color-heading); }
.epg-slot-time { font-size: 0.625rem; opacity: 0.6; margin-top: 2px; }
.epg-time-header {
  display: flex; padding-left: 140px; border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
}
.epg-time-label {
  min-width: 80px; font-size: 0.625rem; font-weight: 600; color: var(--color-dim);
  padding: 0.375rem 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════
   MUSIC HERO + VISUALIZER
   ═══════════════════════════════════════════════════════════════ */
.music-hero {
  position: relative; overflow: hidden; padding: 4rem 1.5rem 2.5rem;
  text-align: center;
}
.music-hero-canvas {
  position: absolute; inset: 0; z-index: 0; opacity: 0.6;
}
.music-hero-content { position: relative; z-index: 1; }
.music-hero h1 {
  font-size: 2.5rem; font-weight: 800; color: var(--color-heading);
  letter-spacing: -0.02em;
}
@media (min-width: 768px) { .music-hero h1 { font-size: 3.5rem; } }
.music-hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-top: 0.75rem; font-size: 0.8125rem; color: var(--color-muted);
}
.music-hero-stat { display: flex; align-items: center; gap: 0.375rem; }
.music-hero-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--color-dim); }
.music-hero-actions { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; }
.music-daypart {
  display: inline-flex; align-items: center; gap: 0.375rem; margin-top: 1rem;
  font-size: 0.75rem; color: var(--color-accent); font-weight: 500;
}

/* Pill tabs */
.music-tabs {
  display: flex; gap: 0.25rem; padding: 0 1.5rem; margin: 1.5rem 0;
  overflow-x: auto; scrollbar-width: none;
}
.music-tabs::-webkit-scrollbar { display: none; }
.music-tab {
  padding: 0.5rem 1rem; border-radius: 9999px; font-size: 0.8125rem;
  font-weight: 500; white-space: nowrap; cursor: pointer; transition: all 0.15s;
  background: rgba(255,255,255,0.04); color: var(--color-muted); border: none;
}
.music-tab:hover { background: rgba(255,255,255,0.08); color: var(--color-heading); }
.music-tab.active { background: var(--color-accent); color: #0A0A0F; font-weight: 600; }

/* Mode panels */
.music-panel { display: none; }
.music-panel.active { display: block; }

/* Viz mode selector */
.viz-modes { display: flex; gap: 0.375rem; margin-top: 0.75rem; justify-content: center; }
.viz-mode-btn {
  padding: 0.25rem 0.625rem; border-radius: 6px; font-size: 0.625rem;
  background: rgba(255,255,255,0.06); color: var(--color-dim); border: none;
  cursor: pointer; transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.05em;
}
.viz-mode-btn:hover { color: var(--color-heading); }
.viz-mode-btn.active { background: rgba(0,212,170,0.15); color: var(--color-accent); }

/* ── Music Page Layout ── */
.music-page { max-width: 1400px; margin: 0 auto; }
.music-tab-panel { display: none; padding: 1.5rem 1rem; }
.music-tab-panel.active { display: block; }
.music-empty-state {
  text-align: center; padding: 4rem 2rem;
  color: rgba(255,255,255,0.5);
}
.music-empty-state h3 { font-size: 1.25rem; color: var(--color-heading); margin-bottom: 0.5rem; }
.music-empty-state p { margin-bottom: 1.5rem; }
.shelf-empty { color: rgba(255,255,255,0.4); font-size: 0.875rem; padding: 2rem 0; white-space: nowrap; }
.shelf-refresh {
  background: none; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 6px 8px; color: rgba(255,255,255,0.6);
  cursor: pointer; transition: all 0.2s;
}
.shelf-refresh:hover { color: var(--color-accent); border-color: var(--color-accent); }
.shelf-refresh.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-accent {
  display: inline-block; padding: 0.625rem 1.5rem;
  background: var(--color-accent); color: #0A0A0F;
  font-weight: 600; border-radius: 8px; text-decoration: none;
  transition: opacity 0.2s;
}
.btn-accent:hover { opacity: 0.85; }
.daypart-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  background: rgba(0,212,170,0.15); color: var(--color-accent);
  letter-spacing: 0.05em;
}
.music-hero-stats {
  display: flex; gap: 1.5rem; margin-top: 0.75rem;
  font-size: 0.8rem; color: rgba(255,255,255,0.5);
}
.music-hero-overlay {
  position: relative; z-index: 1; padding: 3rem 2rem 2rem;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.music-hero-title { font-size: 2rem; font-weight: 800; margin: 0.5rem 0 0.25rem; }
.music-hero-sub { color: rgba(255,255,255,0.6); font-size: 0.9rem; margin: 0; }
.radio-tune-btn {
  padding: 4px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  background: var(--color-accent); color: #0A0A0F; border: none; cursor: pointer;
  transition: opacity 0.2s;
}
.radio-tune-btn:hover { opacity: 0.85; }

/* ── Notification Bell + Dropdown ── */
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 6px; border-radius: 8px;
}
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; font-size: 0.6rem; font-weight: 700;
  background: #ef4444; color: #fff;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; max-height: 420px;
  background: rgba(18,18,24,0.98); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  overflow: hidden; z-index: 100;
}
.notif-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.notif-dropdown-title { font-size: 0.9rem; font-weight: 700; color: var(--color-heading); }
.notif-mark-all {
  font-size: 0.75rem; color: var(--color-accent); background: none; border: none;
  cursor: pointer; padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-list {
  max-height: 320px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.notif-item {
  display: flex; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s; cursor: pointer;
  text-decoration: none; color: inherit;
}
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item.unread { background: rgba(0,212,170,0.04); }
.notif-item.unread .notif-item-dot { display: block; }
.notif-item-dot {
  display: none; flex-shrink: 0; width: 8px; height: 8px;
  border-radius: 50%; background: var(--color-accent);
  margin-top: 6px;
}
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: 0.8rem; font-weight: 600; color: var(--color-heading);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-body {
  font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-item-time { font-size: 0.65rem; color: rgba(255,255,255,0.3); margin-top: 3px; }
.notif-empty {
  padding: 2rem; text-align: center; font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}
.notif-dropdown-footer {
  display: block; text-align: center; padding: 10px;
  font-size: 0.8rem; color: var(--color-accent); text-decoration: none;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.notif-dropdown-footer:hover { background: rgba(255,255,255,0.04); }
@media (max-width: 640px) {
  .notif-dropdown { width: calc(100vw - 2rem); right: -1rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   IMMERSIVE CONTENT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* --- Comic Immersive --- */
.ci-controls {
  display: flex; align-items: center; gap: 0.5rem; justify-content: center;
  padding: 0.75rem; margin-top: 0.75rem;
  background: rgba(18,18,24,0.85); backdrop-filter: blur(12px);
  border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.06);
}
.ci-ctrl-btn {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(255,255,255,0.06); color: var(--color-text-body);
  border: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: all 0.2s;
}
.ci-ctrl-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.ci-ctrl-btn.active { background: var(--color-accent); color: var(--color-bg-base); border-color: var(--color-accent); }
.ci-panel-indicator { font-size: 0.75rem; color: var(--color-text-muted); font-family: var(--font-mono); }

/* --- Music Immersive --- */
.mi-viz-canvas {
  width: 100%; height: 200px; border-radius: 0.75rem; display: block;
  margin-bottom: 1rem; background: #0a0a0f;
}
.mi-stem-mixer {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
  padding: 1rem; background: rgba(18,18,24,0.85); border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.06); margin-top: 1rem;
}
.mi-stem-channel {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 0.75rem; border-radius: 0.5rem; background: rgba(255,255,255,0.03);
}
.mi-stem-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.mi-stem-fader { writing-mode: vertical-lr; direction: rtl; width: 4px; height: 80px; accent-color: var(--color-accent); }
.mi-stem-pan { width: 60px; accent-color: var(--color-accent); }
.mi-stem-btns { display: flex; gap: 0.25rem; }
.mi-stem-btn {
  padding: 0.2rem 0.4rem; border-radius: 0.25rem; font-size: 0.6rem;
  font-weight: 700; border: 1px solid rgba(255,255,255,0.1); background: transparent;
  color: var(--color-text-muted); cursor: pointer; transition: all 0.15s;
}
.mi-stem-btn.active-solo { background: #00D4AA; color: #0a0a0f; border-color: #00D4AA; }
.mi-stem-btn.active-mute { background: #FF6B6B; color: #0a0a0f; border-color: #FF6B6B; }
.mi-karaoke { padding: 1.5rem; text-align: center; font-size: 1.5rem; line-height: 2; }
.mi-karaoke-word { transition: color 0.15s, text-shadow 0.15s; color: var(--color-text-muted); }
.mi-karaoke-word.active { color: var(--color-accent); text-shadow: 0 0 20px rgba(0,212,170,0.4); }
.mi-viz-mode-bar { display: flex; gap: 0.25rem; justify-content: center; margin-bottom: 0.5rem; }
.mi-viz-mode {
  padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.65rem;
  background: rgba(255,255,255,0.04); color: var(--color-text-muted);
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s;
}
.mi-viz-mode.active { color: var(--color-accent); border-color: var(--color-accent); background: rgba(0,212,170,0.08); }

/* --- Podcast Immersive --- */
.pi-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; margin-top: 1rem; }
.pi-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }
.pi-tab {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(255,255,255,0.04); color: var(--color-text-muted);
  border: none; cursor: pointer; transition: all 0.15s;
}
.pi-tab.active { background: rgba(0,212,170,0.12); color: var(--color-accent); }
.pi-tab-content { display: none; }
.pi-tab-content.active { display: block; }
.pi-transcript {
  max-height: 60vh; overflow-y: auto; padding: 1rem;
  background: rgba(18,18,24,0.6); border-radius: 0.75rem;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.pi-word { cursor: pointer; transition: color 0.1s, background 0.1s; border-radius: 2px; padding: 0 1px; }
.pi-word:hover { color: var(--color-accent); }
.pi-word.active { background: rgba(0,212,170,0.2); color: var(--color-accent); }
.pi-topic-canvas { width: 100%; height: 300px; border-radius: 0.75rem; background: rgba(18,18,24,0.6); }
.pi-chapter-list { list-style: none; padding: 0; }
.pi-chapter-item {
  padding: 0.5rem 0.75rem; cursor: pointer; border-radius: 0.5rem;
  transition: background 0.15s; display: flex; justify-content: space-between; align-items: center;
}
.pi-chapter-item:hover { background: rgba(255,255,255,0.04); }
.pi-chapter-time { font-size: 0.7rem; font-family: var(--font-mono); color: var(--color-text-dim); }
.pi-clip-bar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem;
  background: rgba(18,18,24,0.85); border-radius: 0.5rem; margin-top: 0.5rem;
}
.pi-clip-btn {
  padding: 0.3rem 0.6rem; border-radius: 0.375rem; font-size: 0.7rem;
  background: rgba(0,212,170,0.12); color: var(--color-accent);
  border: 1px solid rgba(0,212,170,0.2); cursor: pointer;
}
.pi-wave-canvas { width: 100%; height: 60px; display: block; border-radius: 0.5rem; margin-top: 0.5rem; }
@media (max-width: 768px) { .pi-layout { grid-template-columns: 1fr; } }

/* --- Book Immersive (Ambient Soundscapes) --- */
.bi-ambient-controls {
  position: fixed; bottom: 5rem; right: 1rem; z-index: 45;
  display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end;
}
.bi-ambient-btn {
  padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(18,18,24,0.9); backdrop-filter: blur(12px);
  color: var(--color-text-body); border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; transition: all 0.2s;
}
.bi-ambient-btn:hover { border-color: var(--color-accent); }
.bi-ambient-btn.active { background: rgba(0,212,170,0.15); border-color: var(--color-accent); color: var(--color-accent); }
.bi-ambient-panel {
  background: rgba(18,18,24,0.95); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 0.75rem;
  padding: 1rem; min-width: 200px;
}
.bi-mood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; margin-top: 0.5rem; }
.bi-mood-btn {
  padding: 0.375rem; border-radius: 0.375rem; font-size: 0.65rem; text-align: center;
  background: rgba(255,255,255,0.04); color: var(--color-text-muted);
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s;
}
.bi-mood-btn:hover { border-color: rgba(255,255,255,0.1); }
.bi-mood-btn.active { background: rgba(0,212,170,0.12); color: var(--color-accent); border-color: var(--color-accent); }
.bi-volume-slider { width: 100%; margin-top: 0.5rem; accent-color: var(--color-accent); }

/* --- Course Immersive (Code Sandbox + AI Tutor) --- */
.ci-sandbox {
  margin: 1rem 0; border-radius: 0.75rem; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(18,18,24,0.6);
}
.ci-sandbox-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ci-sandbox-lang { font-size: 0.7rem; font-weight: 600; color: var(--color-accent); text-transform: uppercase; }
.ci-sandbox-btns { display: flex; gap: 0.25rem; }
.ci-sandbox-btn {
  padding: 0.3rem 0.6rem; border-radius: 0.375rem; font-size: 0.7rem;
  font-weight: 600; border: 1px solid rgba(255,255,255,0.1);
  background: transparent; color: var(--color-text-body); cursor: pointer; transition: all 0.15s;
}
.ci-sandbox-btn.ci-run-btn { background: rgba(0,212,170,0.12); color: var(--color-accent); border-color: rgba(0,212,170,0.2); }
.ci-sandbox-btn:hover { border-color: var(--color-accent); }
.ci-sandbox-editor {
  width: 100%; min-height: 120px; padding: 0.75rem;
  background: transparent; color: var(--color-text-body);
  font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6;
  border: none; resize: vertical; tab-size: 2;
}
.ci-sandbox-output {
  padding: 0.75rem; background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5;
  color: var(--color-text-muted); max-height: 200px; overflow-y: auto;
  white-space: pre-wrap;
}
.ci-sandbox-output .ci-err { color: #FF6B6B; }
.ci-sandbox-output .ci-log { color: var(--color-accent); }
.ci-tutor-panel {
  position: fixed; bottom: 5rem; right: 1rem; width: 340px; max-height: 500px;
  background: rgba(18,18,24,0.95); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 0.75rem;
  z-index: 45; display: flex; flex-direction: column; overflow: hidden;
}
.ci-tutor-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ci-tutor-title { font-size: 0.85rem; font-weight: 700; color: var(--color-heading); }
.ci-tutor-close { background: none; border: none; color: var(--color-text-muted); cursor: pointer; font-size: 1.2rem; }
.ci-tutor-messages {
  flex: 1; overflow-y: auto; padding: 0.75rem;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.ci-tutor-msg { margin-bottom: 0.75rem; padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.8rem; line-height: 1.5; }
.ci-tutor-msg.user { background: rgba(0,212,170,0.1); color: var(--color-accent); margin-left: 2rem; }
.ci-tutor-msg.ai { background: rgba(255,255,255,0.04); color: var(--color-text-body); margin-right: 2rem; }
.ci-tutor-input-row { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid rgba(255,255,255,0.06); }
.ci-tutor-input {
  flex: 1; padding: 0.5rem; border-radius: 0.5rem; font-size: 0.8rem;
  background: rgba(255,255,255,0.04); color: var(--color-text-body);
  border: 1px solid rgba(255,255,255,0.08);
}
.ci-tutor-send {
  padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem; font-weight: 600;
  background: var(--color-accent); color: var(--color-bg-base); border: none; cursor: pointer;
}
.ci-memory-palace { perspective: 800px; margin: 2rem 0; }
.ci-room {
  padding: 1.5rem; margin-bottom: 1rem; border-radius: 0.75rem;
  background: rgba(18,18,24,0.6); border: 1px solid rgba(255,255,255,0.06);
  transform: rotateY(0deg); transition: transform 0.4s, box-shadow 0.4s;
}
.ci-room:hover { transform: rotateY(2deg) scale(1.01); box-shadow: 0 8px 32px rgba(0,212,170,0.08); }
.ci-room-title { font-size: 1rem; font-weight: 700; color: var(--color-heading); margin-bottom: 0.5rem; }
.ci-room-progress { height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.ci-room-bar { height: 100%; background: var(--color-accent); border-radius: 2px; transition: width 0.3s; }

/* --- News Immersive (Scrollytelling) --- */
.ni-scroll-card {
  position: relative; min-height: 50vh; padding: 3rem 2rem;
  margin-bottom: 1rem; border-radius: 0.75rem; overflow: hidden;
  opacity: 0; transform: translateY(2rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--reveal-delay, 0s);
}
.ni-scroll-card.ni-visible { opacity: 1; transform: translateY(0); }
.ni-has-image { color: #fff; }
.ni-parallax-bg {
  position: absolute; inset: -20px; z-index: -1;
  background-size: cover; background-position: center;
  filter: brightness(0.35);
  transition: transform 0.1s linear;
}
.ni-scroll-content { position: relative; z-index: 1; }
.ni-timeline {
  margin-top: 2rem; padding: 1.5rem;
  background: rgba(18,18,24,0.6); border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.06);
}
.ni-timeline-title { font-size: 1rem; font-weight: 700; color: var(--color-heading); margin-bottom: 1rem; }
.ni-timeline-track { position: relative; padding-left: 1.5rem; border-left: 2px solid rgba(255,255,255,0.08); }
.ni-timeline-item {
  display: block; position: relative; padding: 0.75rem 0 0.75rem 0.75rem;
  text-decoration: none; color: inherit; transition: background 0.15s;
}
.ni-timeline-item:hover { background: rgba(255,255,255,0.03); border-radius: 0.5rem; }
.ni-timeline-item.current { background: rgba(0,212,170,0.06); border-radius: 0.5rem; }
.ni-timeline-dot {
  position: absolute; left: -1.75rem; top: 1rem; width: 10px; height: 10px;
  border-radius: 50%; background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.1);
}
.ni-timeline-item.current .ni-timeline-dot { background: var(--color-accent); border-color: var(--color-accent); }
.ni-timeline-date { font-size: 0.65rem; color: var(--color-text-dim); font-family: var(--font-mono); }
.ni-timeline-label { font-size: 0.85rem; color: var(--color-text-body); margin-top: 0.125rem; }
.ni-briefing-btn {
  padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.8rem; font-weight: 600;
  background: rgba(0,212,170,0.1); color: var(--color-accent);
  border: 1px solid rgba(0,212,170,0.2); cursor: pointer; transition: all 0.2s;
  margin-bottom: 1rem;
}
.ni-briefing-btn:hover { background: rgba(0,212,170,0.2); }
.ni-pull-quote {
  position: relative; border-left: 3px solid var(--color-accent);
  padding-left: 1rem; font-style: italic;
}
.ni-share-quote {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; opacity: 0;
  transition: opacity 0.2s;
}
.ni-pull-quote:hover .ni-share-quote { opacity: 0.6; }

/* --- Screenplay Immersive --- */
.sp-immersive-controls {
  padding: 0.75rem; margin-bottom: 1rem;
  background: rgba(18,18,24,0.85); backdrop-filter: blur(12px);
  border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.06);
}
.sp-scene-nav { display: flex; align-items: center; gap: 0.75rem; justify-content: center; margin-bottom: 0.5rem; }
.sp-ctrl-btn {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(255,255,255,0.06); color: var(--color-text-body);
  border: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: all 0.2s;
}
.sp-ctrl-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.sp-scene-ind { font-size: 0.75rem; color: var(--color-text-muted); font-family: var(--font-mono); min-width: 8rem; text-align: center; }
.sp-char-map { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.5rem; justify-content: center; }
.sp-char-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.65rem;
  border: 1px solid; background: rgba(255,255,255,0.03);
}
.sp-char-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sp-table-read { display: flex; gap: 0.5rem; justify-content: center; }
.sp-scene-marker {
  display: inline-flex; gap: 0.5rem; align-items: center; margin-right: 0.5rem;
}
.sp-scene-num { font-size: 0.65rem; font-weight: 700; color: var(--color-accent); font-family: var(--font-mono); }
.sp-scene-type { font-size: 0.55rem; padding: 0.1rem 0.3rem; border-radius: 0.25rem; font-weight: 700; }
.sp-interior { background: rgba(0,212,170,0.12); color: #00D4AA; }
.sp-exterior { background: rgba(255,107,107,0.12); color: #FF6B6B; }
.sp-shot-badge {
  display: inline-block; margin-left: 0.5rem; padding: 0.1rem 0.4rem;
  border-radius: 0.25rem; font-size: 0.6rem; font-weight: 700;
  background: rgba(78,205,196,0.12); color: #4ECDC4;
}
.sp-highlight { background: rgba(0,212,170,0.08); border-radius: 0.25rem; transition: background 0.3s; }
.sp-beat-sheet {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}
.sp-beat-sheet-content {
  width: 90%; max-width: 500px; max-height: 70vh; overflow-y: auto;
  background: rgba(18,18,24,0.98); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem; padding: 1.5rem;
}
.sp-beat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.sp-beat-close { background: none; border: none; color: var(--color-text-muted); font-size: 1.5rem; cursor: pointer; }
.sp-beat-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem;
  border-radius: 0.5rem; cursor: pointer; transition: background 0.15s;
}
.sp-beat-item:hover { background: rgba(255,255,255,0.04); }
.sp-beat-num { font-size: 0.7rem; font-weight: 700; color: var(--color-accent); font-family: var(--font-mono); min-width: 1.5rem; }
.sp-beat-text { font-size: 0.8rem; color: var(--color-text-body); flex: 1; }
.sp-beat-type { font-size: 0.55rem; padding: 0.1rem 0.3rem; border-radius: 0.25rem; font-weight: 700; }

/* --- Poetry Immersive --- */
.po-immersive-controls {
  display: flex; justify-content: center; padding: 0.75rem; margin-bottom: 1rem;
  background: rgba(18,18,24,0.85); backdrop-filter: blur(12px);
  border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.06);
}
.po-ctrl-row { display: flex; gap: 0.375rem; }
.po-ctrl-btn {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(255,255,255,0.06); color: var(--color-text-body);
  border: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: all 0.2s;
}
.po-ctrl-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.po-ctrl-btn.active { background: rgba(0,212,170,0.15); border-color: var(--color-accent); color: var(--color-accent); }
.po-kinetic-word { opacity: 0; transition: opacity 0.3s ease; display: inline; }
.po-kinetic-word.po-word-visible { opacity: 1; }
.po-rhyme-marker {
  display: inline-block; margin-left: 0.5rem; padding: 0 0.3rem;
  border: 1px solid; border-radius: 0.25rem; font-size: 0.6rem; font-weight: 700;
  font-family: var(--font-mono);
}
.po-meter-line { margin-bottom: 0.125rem; letter-spacing: 0.25em; font-family: var(--font-mono); font-size: 0.7rem; }
.po-meter-mark { display: inline; }
.po-stressed { color: var(--color-accent); font-weight: 700; }
.po-unstressed { color: var(--color-text-dim); }

/* --- 3D Model Immersive --- */
.m3d-controls {
  padding: 0.75rem; margin-top: 0.75rem;
  background: rgba(18,18,24,0.85); backdrop-filter: blur(12px);
  border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.06);
}
.m3d-ctrl-row { display: flex; gap: 0.375rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.m3d-ctrl-btn {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(255,255,255,0.06); color: var(--color-text-body);
  border: 1px solid rgba(255,255,255,0.08); cursor: pointer; transition: all 0.2s;
}
.m3d-ctrl-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.m3d-ctrl-btn.active { background: rgba(0,212,170,0.15); border-color: var(--color-accent); color: var(--color-accent); }
.m3d-anim-label { font-size: 0.7rem; color: var(--color-text-muted); font-family: var(--font-mono); min-width: 6rem; text-align: center; }

/* --- Dataset Immersive --- */
.di-controls {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding: 0.75rem; margin-top: 1rem;
  background: rgba(18,18,24,0.85); backdrop-filter: blur(12px);
  border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.06);
}
.di-chart-canvas { width: 100%; height: 300px; border-radius: 0.75rem; background: rgba(18,18,24,0.4); margin-top: 1rem; }
.di-stats-panel {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem;
  margin-top: 1rem;
}
.di-stat-card {
  padding: 0.75rem; border-radius: 0.5rem;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
}
.di-stat-label { font-size: 0.7rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 0.25rem; }
.di-stat-values { font-size: 0.8rem; color: var(--color-text-body); }
.di-stat-values span { display: inline-block; margin-right: 0.75rem; }
.di-stat-values .di-val { font-weight: 700; color: var(--color-accent); }
.di-histogram-canvas { width: 100%; height: 40px; margin-top: 0.375rem; }
.di-query-input {
  flex: 1; min-width: 200px; padding: 0.4rem 0.75rem; border-radius: 0.5rem;
  font-size: 0.75rem; font-family: var(--font-mono);
  background: rgba(255,255,255,0.04); color: var(--color-text-body);
  border: 1px solid rgba(255,255,255,0.08);
}
.di-query-btn, .di-export-btn {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06); color: var(--color-text-body); cursor: pointer;
  transition: all 0.15s;
}
.di-query-btn:hover, .di-export-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.di-axis-select {
  padding: 0.3rem 0.5rem; border-radius: 0.375rem; font-size: 0.7rem;
  background: rgba(255,255,255,0.04); color: var(--color-text-body);
  border: 1px solid rgba(255,255,255,0.08);
}
.di-chart-types { display: flex; gap: 0.25rem; }
.di-chart-type-btn {
  padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.65rem;
  background: rgba(255,255,255,0.04); color: var(--color-text-muted);
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s;
}
.di-chart-type-btn.active { color: var(--color-accent); border-color: var(--color-accent); background: rgba(0,212,170,0.08); }

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — comic-immersive.js
   ═══════════════════════════════════════════════════════════════════════════ */
.comic-immersive-fallback {
  position: relative; overflow: hidden; border-radius: 0.75rem;
  cursor: pointer; max-height: 85vh; margin: 0 auto;
}
.comic-parallax-img {
  width: 100%; height: auto; display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.comic-immersive-controls {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem; margin-top: 0.75rem;
  background: rgba(18, 18, 24, 0.85); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0.75rem; border: 1px solid rgba(255, 255, 255, 0.06);
}
.comic-ctrl-row {
  display: flex; align-items: center; gap: 0.5rem;
}
.comic-ctrl-btn {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(255, 255, 255, 0.06); color: var(--color-text-body);
  border: 1px solid rgba(255, 255, 255, 0.08); cursor: pointer; transition: all 0.2s;
}
.comic-ctrl-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.comic-ctrl-btn.active { background: var(--color-accent); color: var(--color-bg-base); border-color: var(--color-accent); }
.comic-panel-ind {
  font-size: 0.75rem; color: var(--color-text-muted); font-family: var(--font-mono);
  min-width: 6rem; text-align: center;
}
.comic-guided-toggle {
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — music-immersive.js
   ═══════════════════════════════════════════════════════════════════════════ */
.stem-mixer {
  padding: 1rem; margin-top: 1rem;
  background: rgba(18, 18, 24, 0.85); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0.75rem; border: 1px solid rgba(255, 255, 255, 0.06);
}
.stem-title {
  font-size: 0.9rem; font-weight: 700; color: var(--color-text-heading);
  margin-bottom: 0.75rem;
}
.stem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
}
@media (max-width: 640px) {
  .stem-grid { grid-template-columns: repeat(2, 1fr); }
}
.stem-channel {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 0.75rem; border-radius: 0.5rem; background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.stem-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-text-muted);
}
.stem-fader {
  width: 100%; accent-color: var(--color-accent);
}
.stem-pan-row {
  display: flex; align-items: center; gap: 0.25rem; width: 100%;
}
.stem-pan-label {
  font-size: 0.6rem; color: var(--color-text-dim); font-weight: 600;
}
.stem-pan {
  flex: 1; accent-color: var(--color-accent);
}
.stem-solo-btn,
.stem-mute-btn {
  padding: 0.25rem 0.5rem; border-radius: 0.25rem; font-size: 0.65rem;
  font-weight: 700; border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent; color: var(--color-text-muted);
  cursor: pointer; transition: all 0.15s; width: 100%;
}
.stem-solo-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.stem-mute-btn:hover { border-color: #FF6B6B; color: #FF6B6B; }
.stem-solo-btn.active { background: var(--color-accent); color: var(--color-bg-base); border-color: var(--color-accent); }
.stem-mute-btn.active { background: #FF6B6B; color: var(--color-bg-base); border-color: #FF6B6B; }
.stem-status {
  font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.75rem;
  text-align: center;
}
.stem-separate-btn {
  margin-top: 0.75rem; display: block; width: 100%;
}
.karaoke-container {
  padding: 1.5rem; text-align: center; font-size: 1.5rem; line-height: 2;
  color: var(--color-text-muted);
}
.karaoke-word {
  transition: color 0.15s, text-shadow 0.15s;
  cursor: default;
}
.karaoke-active {
  color: var(--color-accent); text-shadow: 0 0 20px rgba(0, 212, 170, 0.4);
  font-weight: 600;
}
.karaoke-past {
  color: var(--color-text-dim);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — podcast-immersive.js
   ═══════════════════════════════════════════════════════════════════════════ */
.podcast-immersive-layout {
  width: 100%;
}
.pi-main {
  display: flex; flex-direction: column; gap: 1rem;
}
.pi-ambient {
  position: relative; overflow: hidden; border-radius: 0.75rem;
  background: rgba(18, 18, 24, 0.4);
}
.pi-ambient-canvas {
  width: 100%; height: 80px; display: block; border-radius: 0.75rem;
}
.pi-transcript-panel {
  background: rgba(18, 18, 24, 0.6); border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06); padding: 1rem;
}
.pi-tab-bar {
  display: flex; gap: 0.25rem; margin-bottom: 0.75rem;
}
.pi-topics {
  padding: 0.5rem;
}
.pi-chapters {
  padding: 0.5rem;
}
.pi-speaker {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  color: var(--color-accent); margin-top: 1rem; margin-bottom: 0.25rem;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.pi-word-active {
  background: rgba(0, 212, 170, 0.2); color: var(--color-accent);
  border-radius: 2px;
}
.pi-word-past {
  color: var(--color-text-dim);
}
.pi-chapter-active {
  background: rgba(0, 212, 170, 0.08);
}
.pi-chapter-title {
  font-size: 0.8rem; color: var(--color-text-body);
}
.pi-clip-range {
  font-size: 0.7rem; color: var(--color-text-muted); font-family: var(--font-mono);
  flex: 1; text-align: center;
}
.pi-clip-share {
  background: rgba(0, 212, 170, 0.15); border-color: rgba(0, 212, 170, 0.3);
}
.pi-clip-share:disabled {
  opacity: 0.4; cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — book-immersive.js
   ═══════════════════════════════════════════════════════════════════════════ */
.book-immersive-controls {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0.75rem; margin-bottom: 1rem;
  background: rgba(18, 18, 24, 0.85); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0.75rem; border: 1px solid rgba(255, 255, 255, 0.06);
}
.bi-ctrl-row {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.bi-ctrl-btn {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(255, 255, 255, 0.06); color: var(--color-text-body);
  border: 1px solid rgba(255, 255, 255, 0.08); cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.bi-ctrl-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.bi-ctrl-btn.active { background: rgba(0, 212, 170, 0.15); border-color: var(--color-accent); color: var(--color-accent); }
.bi-icon {
  font-size: 1rem;
}
.bi-mood-select {
  padding: 0.3rem 0.5rem; border-radius: 0.375rem; font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04); color: var(--color-text-body);
  border: 1px solid rgba(255, 255, 255, 0.08); cursor: pointer;
}
.bi-mood-select:focus { border-color: var(--color-accent); outline: none; }
.bi-vol-slider {
  width: 80px; accent-color: var(--color-accent);
}
.bi-mood-label {
  font-size: 0.7rem; color: var(--color-text-muted); text-align: center;
}
.spatial-focus-mode > p {
  opacity: 0.2; transition: opacity 0.4s ease;
}
.spatial-focus-mode > p:hover,
.spatial-focus-mode > p.focused {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — course-immersive.js
   ═══════════════════════════════════════════════════════════════════════════ */
.ci-editor {
  width: 100%; min-height: 120px; padding: 0.75rem;
  background: transparent; color: var(--color-text-body);
  font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6;
  border: none; resize: vertical; tab-size: 2;
  box-sizing: border-box;
}
.ci-editor:focus { outline: none; }
.ci-controls {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ci-run-btn {
  padding: 0.3rem 0.6rem; border-radius: 0.375rem; font-size: 0.7rem;
  font-weight: 600; background: rgba(0, 212, 170, 0.12); color: var(--color-accent);
  border: 1px solid rgba(0, 212, 170, 0.2); cursor: pointer; transition: all 0.15s;
}
.ci-run-btn:hover { background: rgba(0, 212, 170, 0.2); }
.ci-reset-btn {
  padding: 0.3rem 0.6rem; border-radius: 0.375rem; font-size: 0.7rem;
  font-weight: 600; background: transparent; color: var(--color-text-body);
  border: 1px solid rgba(255, 255, 255, 0.1); cursor: pointer; transition: all 0.15s;
}
.ci-reset-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.ci-output {
  padding: 0.75rem; background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.5;
  color: var(--color-text-muted); max-height: 200px; overflow-y: auto;
  white-space: pre-wrap;
}
.ci-output-placeholder {
  color: var(--color-text-dim); font-style: italic;
}
.ci-output-running {
  color: var(--color-accent);
}
.ci-output-text {
  color: var(--color-text-body); margin: 0;
  font-family: var(--font-mono); font-size: 0.8rem; white-space: pre-wrap;
}
.ci-output-error {
  color: #FF6B6B; margin: 0;
  font-family: var(--font-mono); font-size: 0.8rem; white-space: pre-wrap;
}
.ci-output-info {
  color: var(--color-text-muted); font-style: italic;
}
.ci-html-frame {
  width: 100%; min-height: 200px; border: none; border-radius: 0.25rem;
  background: #fff;
}
.ci-lang-badge {
  font-size: 0.65rem; font-weight: 700; color: var(--color-accent);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.ci-tutor-toggle {
  background: none; border: none; color: var(--color-text-muted);
  cursor: pointer; font-size: 1rem; padding: 0.25rem;
  transition: color 0.2s;
}
.ci-tutor-toggle:hover { color: var(--color-accent); }
.ci-tutor-body {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.ci-tutor-body.collapsed {
  display: none;
}
.ci-tutor-system {
  background: rgba(255, 255, 255, 0.03); color: var(--color-text-muted);
  font-style: italic;
}
.ci-tutor-user {
  background: rgba(0, 212, 170, 0.1); color: var(--color-accent);
  margin-left: 2rem;
}
.ci-tutor-ai {
  background: rgba(255, 255, 255, 0.04); color: var(--color-text-body);
  margin-right: 2rem;
}
.ci-tutor-ai.thinking {
  color: var(--color-text-dim); font-style: italic;
}
.ci-palace {
  margin: 2rem 0;
}
.ci-palace-title {
  font-size: 1.25rem; font-weight: 700; color: var(--color-text-heading);
  margin-bottom: 1rem;
}
.ci-palace-rooms {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; perspective: 800px;
}
.ci-palace-room {
  padding: 1.25rem; border-radius: 0.75rem;
  background: rgba(18, 18, 24, 0.6); border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.2s;
  cursor: pointer;
}
.ci-palace-room:hover {
  transform: rotateY(2deg) scale(1.02);
  box-shadow: 0 8px 32px rgba(0, 212, 170, 0.08);
  border-color: rgba(0, 212, 170, 0.15);
}
.ci-palace-room.complete {
  border-color: var(--color-accent);
}
.ci-room-ceiling {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg,
    hsla(var(--room-hue, 160), 60%, 50%, 0.3),
    hsla(var(--room-hue, 160), 60%, 50%, 0.1));
  margin-bottom: 0.75rem;
}
.ci-room-content {
  display: flex; flex-direction: column; gap: 0.25rem;
}
.ci-room-name {
  font-size: 0.65rem; font-weight: 700; color: var(--color-text-dim);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.ci-room-objects {
  display: flex; gap: 0.25rem; flex-wrap: wrap; margin-top: 0.5rem;
}
.ci-room-object {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s;
}
.ci-room-object.found {
  background: var(--color-accent); border-color: var(--color-accent);
  box-shadow: 0 0 6px rgba(0, 212, 170, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — news-immersive.js (supplements)
   ═══════════════════════════════════════════════════════════════════════════ */
.ni-scroll-content p { margin-bottom: 1rem; }
.ni-scroll-content h2, .ni-scroll-content h3 {
  margin-bottom: 0.75rem; color: var(--color-text-heading);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — screenplay-immersive.js (supplements)
   ═══════════════════════════════════════════════════════════════════════════ */
.sp-beat-list {
  display: flex; flex-direction: column; gap: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — dataset-immersive.js (supplements)
   ═══════════════════════════════════════════════════════════════════════════ */
.di-ctrl-row {
  display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center;
}
.di-ctrl-btn {
  padding: 0.4rem 0.75rem; border-radius: 0.5rem; font-size: 0.75rem;
  font-weight: 600; background: rgba(255, 255, 255, 0.06); color: var(--color-text-body);
  border: 1px solid rgba(255, 255, 255, 0.08); cursor: pointer; transition: all 0.2s;
}
.di-ctrl-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.di-ctrl-btn.active { background: rgba(0, 212, 170, 0.15); border-color: var(--color-accent); color: var(--color-accent); }
.di-chart-select {
  padding: 0.3rem 0.5rem; border-radius: 0.375rem; font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.04); color: var(--color-text-body);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.di-chart-select:focus { border-color: var(--color-accent); outline: none; }
.di-chart-panel {
  margin-top: 1rem; border-radius: 0.75rem; overflow: hidden;
  background: rgba(18, 18, 24, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.5rem;
}
.di-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.di-stat-header {
  font-size: 0.75rem; font-weight: 700; color: var(--color-text-heading);
  margin-bottom: 0.5rem; padding-bottom: 0.375rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.di-stat-row {
  font-size: 0.75rem; color: var(--color-text-body); padding: 0.125rem 0;
}
.di-stat-dist {
  display: flex; align-items: flex-end; gap: 2px; height: 40px; margin-top: 0.5rem;
}
.di-dist-bar {
  flex: 1; background: var(--color-accent); border-radius: 1px 1px 0 0;
  min-height: 2px; transition: height 0.2s;
}
.di-query-panel {
  padding: 0.75rem; margin-top: 0.5rem;
  background: rgba(18, 18, 24, 0.6); border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.di-query-result {
  margin-top: 0.5rem; max-height: 300px; overflow-y: auto;
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — a11y.js
   ═══════════════════════════════════════════════════════════════════════════ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100%; left: 16px; z-index: 100000;
  background: var(--color-accent); color: var(--color-bg-base);
  padding: 8px 16px; border-radius: 0 0 8px 8px;
  font-weight: 600; font-size: 14px; text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — i18n.js
   ═══════════════════════════════════════════════════════════════════════════ */
.cjk-locale {
  font-family: "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans",
    "Yu Gothic", "Malgun Gothic", system-ui, sans-serif;
}
.cjk-locale h1, .cjk-locale h2, .cjk-locale h3,
.cjk-locale h4, .cjk-locale h5, .cjk-locale h6 {
  font-family: "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans",
    "Yu Gothic", "Malgun Gothic", system-ui, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — ai-features.js
   ═══════════════════════════════════════════════════════════════════════════ */
.btn-sm {
  padding: 0.375rem 0.625rem; font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   JS-REFERENCED CLASSES — realtime.js
   ═══════════════════════════════════════════════════════════════════════════ */
.live-comment-indicator {
  position: absolute; right: -40px; top: 0; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(0, 212, 170, 0.15);
  border: 1px solid var(--color-accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 11px; color: var(--color-accent);
  font-weight: 600; transition: all 0.2s;
}
.live-comment-indicator:hover {
  background: rgba(0, 212, 170, 0.25);
}
.live-comment-panel {
  position: absolute; right: -340px; top: 0; width: 300px; z-index: 9999;
  background: var(--color-bg-elevated); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem; padding: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  max-height: 400px; overflow-y: auto;
}
.comment-input {
  flex: 1; background: var(--color-bg-base); color: var(--color-text-body);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0.375rem;
  padding: 0.375rem 0.625rem; font-size: 0.75rem;
}
.comment-input:focus { border-color: var(--color-accent); outline: none; }
.comment-send {
  padding: 0.375rem 0.75rem; border: none; background: var(--color-accent);
  color: var(--color-bg-base); border-radius: 0.375rem; cursor: pointer;
  font-weight: 600; font-size: 0.75rem; transition: opacity 0.2s;
}
.comment-send:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES FOR JS-REFERENCED CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */
[data-theme="light"] .comic-immersive-controls,
[data-theme="light"] .comic-immersive-fallback,
[data-theme="light"] .stem-mixer,
[data-theme="light"] .pi-transcript-panel,
[data-theme="light"] .pi-ambient,
[data-theme="light"] .book-immersive-controls,
[data-theme="light"] .ci-sandbox,
[data-theme="light"] .ci-controls,
[data-theme="light"] .ci-output,
[data-theme="light"] .ci-tutor-panel,
[data-theme="light"] .ci-palace-room,
[data-theme="light"] .ni-timeline,
[data-theme="light"] .sp-immersive-controls,
[data-theme="light"] .sp-beat-sheet-content,
[data-theme="light"] .po-immersive-controls,
[data-theme="light"] .m3d-controls,
[data-theme="light"] .di-controls,
[data-theme="light"] .di-chart-panel,
[data-theme="light"] .di-query-panel,
[data-theme="light"] .live-comment-panel {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .comic-ctrl-btn,
[data-theme="light"] .bi-ctrl-btn,
[data-theme="light"] .ci-run-btn,
[data-theme="light"] .ci-reset-btn,
[data-theme="light"] .di-ctrl-btn,
[data-theme="light"] .sp-ctrl-btn,
[data-theme="light"] .po-ctrl-btn,
[data-theme="light"] .m3d-ctrl-btn,
[data-theme="light"] .pi-clip-btn,
[data-theme="light"] .stem-solo-btn,
[data-theme="light"] .stem-mute-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--color-text-body);
}

[data-theme="light"] .stem-channel,
[data-theme="light"] .di-stat-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .karaoke-active {
  color: var(--color-accent);
  text-shadow: none;
}

[data-theme="light"] .ci-editor {
  color: var(--color-text-body);
}

[data-theme="light"] .ci-output {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .ci-html-frame {
  background: #fff;
}

[data-theme="light"] .live-comment-indicator {
  background: rgba(0, 155, 125, 0.1);
  border-color: var(--color-accent);
}

[data-theme="light"] .skip-link {
  background: var(--color-accent); color: #fff;
}

[data-theme="light"] .di-dist-bar {
  background: var(--color-accent);
}

[data-theme="light"] .sp-highlight {
  background: rgba(0, 155, 125, 0.1);
}

[data-theme="light"] .ni-parallax-bg {
  filter: brightness(0.5);
}

[data-theme="light"] .ni-has-image {
  color: #fff;
}

/* ── Chapters imported with their markup (catalog EPUBs) ──────────────── */
#reader-content img,
#reader-content svg { max-width: 100%; height: auto; }
#reader-content figure { margin: 2rem 0; text-align: center; }
#reader-content figure img { display: block; margin: 0 auto; border-radius: 0.375rem; }
#reader-content figure.spot img { max-width: 60%; }
#reader-content figcaption { margin-top: 0.5rem; font-size: 0.875rem; color: var(--color-text-muted, inherit); font-style: italic; }
#reader-content header.chapter-opening { text-align: center; margin: 1rem 0 2rem; }
#reader-content .chapter-number { font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; margin-bottom: 0.25rem; }
#reader-content h1, #reader-content h2, #reader-content h3, #reader-content h4 { font-family: var(--font-serif); color: var(--color-text-heading); line-height: 1.3; margin: 1.75em 0 0.75em; }
#reader-content h1 { font-size: 1.75rem; }
#reader-content h2 { font-size: 1.4rem; }
#reader-content h3 { font-size: 1.2rem; }
#reader-content .chapter-ornament svg,
#reader-content .section-divider svg { opacity: 0.55; color: var(--color-text-body); }
#reader-content .chapter-ornament svg *,
#reader-content .section-divider svg * { stroke: currentColor; fill: currentColor; }
#reader-content .section-divider { margin: 2rem auto; }
#reader-content ul, #reader-content ol { margin: 0 0 1.25em 1.5em; }
#reader-content ul { list-style: disc; }
#reader-content ol { list-style: decimal; }
#reader-content li { margin-bottom: 0.35em; }
#reader-content blockquote { margin: 1.5em 0; padding-left: 1.25em; border-left: 3px solid var(--color-border); font-style: italic; }
#reader-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; display: block; overflow-x: auto; }
#reader-content th, #reader-content td { border: 1px solid var(--color-border); padding: 0.4em 0.6em; text-align: left; }
#reader-content pre { white-space: pre-wrap; font-size: 0.875rem; background: var(--color-bg-surface); padding: 1em; border-radius: 0.375rem; overflow-x: auto; }
#reader-content audio { width: 100%; margin: 1rem 0; }
