:root {
  --bg: #08121f;
  --bg-soft: #101c2d;
  --surface: rgba(18, 32, 50, 0.92);
  --surface-2: rgba(15, 25, 35, 0.9);
  --border: rgba(79, 195, 247, 0.16);
  --border-strong: rgba(79, 195, 247, 0.32);
  --text: #e0e6ed;
  --muted: #8da2b1;
  --accent: #4fc3f7;
  --accent-strong: #1976d2;
  --shadow: 0 20px 60px rgba(3, 10, 18, 0.38);
}

html {
  background:
    radial-gradient(circle at top left, rgba(79, 195, 247, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(25, 118, 210, 0.08), transparent 30%),
    var(--bg);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79, 195, 247, 0.05), transparent 24%),
    linear-gradient(180deg, #09131f 0%, #0b1524 100%);
}

header,
.app-header {
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 36px rgba(3, 10, 18, 0.22);
}

.glass-card,
.section-card,
.toc-inner {
  box-shadow: var(--shadow);
}

.mobile-only { display: none; }

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(30, 58, 95, 0.82);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.pill-btn:hover { transform: translateY(-1px); background: rgba(79, 195, 247, 0.18); color: #dff6ff; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 16, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 35;
}
.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(92vw, 360px);
}

@media (max-width: 980px) {
  .mobile-only { display: inline-flex; }
}

@media (max-width: 900px) {
  header, .app-header {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}

@media (max-width: 980px) {
  .mobile-sidebar {
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(88vw, 360px) !important;
    max-width: 360px;
    z-index: 40;
    transform: translateX(-102%);
    transition: transform 0.24s ease;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  }
  .mobile-sidebar.show {
    transform: translateX(0);
  }
  .main.mobile-layout {
    position: relative;
  }
}

@media (max-width: 760px) {
  .pill-btn { padding: 0.5rem 0.85rem; font-size: 0.76rem; }
}
