:root {
  color-scheme: dark;
  --bg: #020304;
  --panel: rgba(7, 12, 14, 0.92);
  --panel-2: rgba(10, 18, 20, 0.88);
  --grid: rgba(130, 255, 230, 0.12);
  --text: #e9fff8;
  --muted: #87bdb1;
  --accent: #6af7d6;
  --accent-2: #8df57d;
  --danger: #ff6f83;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background:
    radial-gradient(circle at 12% 15%, rgba(106, 247, 214, 0.15), transparent 25%),
    radial-gradient(circle at 82% 0%, rgba(141, 245, 125, 0.1), transparent 22%),
    linear-gradient(180deg, #010203 0%, #050809 100%);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 4px;
  opacity: 0.15;
  mix-blend-mode: screen;
  z-index: 0;
}

.scanlines, .noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.scanlines {
  background: linear-gradient(to bottom, rgba(255,255,255,0.06), rgba(255,255,255,0) 12%);
  background-size: 100% 6px;
  opacity: 0.12;
  animation: drift 11s linear infinite;
}

.noise {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.03) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 40%, rgba(255,255,255,0.03) 0 1px, transparent 1px),
    radial-gradient(circle at 30% 80%, rgba(255,255,255,0.03) 0 1px, transparent 1px);
  opacity: 0.26;
  animation: flicker 9s steps(2, end) infinite;
}

.route-transition {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(106, 247, 214, 0.16), transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(141, 245, 125, 0.1), transparent 44%),
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 18%, rgba(106, 247, 214, 0.16) 50%, rgba(255, 255, 255, 0.03) 82%, transparent 100%);
  mix-blend-mode: screen;
}

.route-transition::before,
.route-transition::after {
  content: "";
  position: absolute;
  inset: -8%;
  opacity: 0;
  pointer-events: none;
}

.route-transition::before {
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 10px),
    radial-gradient(circle at center, rgba(106, 247, 214, 0.08), transparent 58%);
  mix-blend-mode: screen;
}

.route-transition::after {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(106, 247, 214, 0.16) 24%, transparent 30% 54%, rgba(141, 245, 125, 0.16) 60%, transparent 66% 100%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.18), transparent 52%);
  mix-blend-mode: screen;
}

html.booted .shell {
  animation: shell-enter 620ms cubic-bezier(0.18, 0.84, 0.22, 1) both;
}

html.route-entering .route-transition {
  opacity: 1;
  animation: route-enter-burst 520ms ease-out both;
}

html.route-entering .route-transition::before {
  animation: route-scan 460ms steps(6, end) both;
}

html.route-entering .route-transition::after {
  animation: route-scan 380ms steps(4, end) both reverse;
}

html.route-entering .shell {
  animation: shell-enter-strong 720ms cubic-bezier(0.16, 0.78, 0.22, 1) both;
}

html.route-leaving .route-transition {
  opacity: 1;
  animation: route-exit-burst 220ms ease-out both;
}

html.route-leaving .route-transition::before {
  animation: route-scan 220ms steps(5, end) both;
}

html.route-leaving .route-transition::after {
  animation: route-scan 180ms steps(3, end) both reverse;
}

html.route-leaving .shell {
  animation: shell-exit 180ms ease-in both;
}

html.route-entering .scanlines,
html.route-leaving .scanlines {
  opacity: 0.28;
}

html.route-entering .noise,
html.route-leaving .noise {
  opacity: 0.42;
}

html.route-leaving .page-background,
html.route-entering .page-background {
  filter: saturate(0.86) contrast(1.04) brightness(0.82);
}

.page-background {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(106, 247, 214, 0.08), transparent 30%),
    radial-gradient(circle at 84% 14%, rgba(141, 245, 125, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(1, 2, 3, 0.22) 0%, rgba(1, 2, 3, 0.36) 40%, rgba(1, 2, 3, 0.82) 100%);
}

.page-background-video {
  position: absolute;
  inset: 0;
  transform: scale(1.14);
  filter: saturate(0.82) contrast(0.98) brightness(0.42) grayscale(0.04);
  opacity: 1;
}

.page-background-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
}

.page-background-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(106, 247, 214, 0.08), transparent 24%),
    radial-gradient(circle at 80% 12%, rgba(141, 245, 125, 0.06), transparent 22%),
    linear-gradient(180deg, rgba(1, 2, 3, 0.18) 0%, rgba(1, 2, 3, 0.5) 46%, rgba(1, 2, 3, 0.9) 100%);
}

.shell { position: relative; z-index: 2; width: min(1500px, 94vw); margin: 0 auto; padding: 1.25rem 0 3rem; }

.topbar, .main-nav, .panel, .card, .stat, .terminal-card, .inline-meta {
  border: 1px solid var(--grid);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border-radius: 1.1rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.brand {
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(106, 247, 214, 0.3);
}

.tagline {
  margin-top: 0.35rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.status-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent-2);
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.header-audio {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(106,247,214,0.22);
  background: rgba(2, 8, 9, 0.9);
}

.header-audio-label {
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.header-audio .audio-player {
  width: min(26rem, 34vw);
  min-width: 220px;
}

.header-mute-toggle {
  border: 1px solid rgba(106,247,214,0.25);
  background: rgba(1, 5, 6, 0.98);
  color: var(--text);
  border-radius: 0.75rem;
  padding: 0.55rem 0.8rem;
  font: inherit;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pulse {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 18px currentColor;
  animation: pulse 1.5s ease-in-out infinite;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  margin: 0.9rem 0 1rem;
}

.main-nav a, .button, .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(106,247,214,0.35);
  background: linear-gradient(180deg, rgba(7, 18, 18, 0.95), rgba(2, 8, 9, 0.95));
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  cursor: pointer;
}

.button.active {
  border-color: rgba(141, 245, 125, 0.75);
  color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(141, 245, 125, 0.15) inset;
}

.button.secondary, .main-nav a.secondary { color: var(--muted); }
.button.small { padding: 0.58rem 0.82rem; font-size: 0.7rem; }
.link-button { padding: 0; background: transparent; border: none; color: var(--accent); }
.link-button.danger { color: var(--danger); }

.user-chip {
  display: inline-flex;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  color: var(--accent-2);
  border: 1px solid rgba(141,245,125,0.25);
}

.content { display: grid; gap: 1rem; }
.panel {
  border-radius: 1.2rem;
  padding: 1.35rem;
}

.subpanel {
  background: var(--panel-2);
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.hero-copy h1, .panel h1 { margin: 0.2rem 0 0.8rem; font-size: clamp(2rem, 4vw, 4rem); line-height: 0.96; }
.eyebrow { margin: 0; letter-spacing: 0.28em; color: var(--accent); font-size: 0.78rem; text-transform: uppercase; }
.lede { color: var(--muted); line-height: 1.8; max-width: 72ch; }

.hero-actions, .admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.terminal-card {
  border-radius: 1rem;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  background: linear-gradient(180deg, rgba(6, 13, 14, 0.98), rgba(2, 7, 8, 0.92));
}

.terminal-line {
  padding: 0.8rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--accent);
  animation: glow 3.5s ease-in-out infinite;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.section-head h2, .section-head h1 { margin: 0; font-size: 1.35rem; letter-spacing: 0.16em; text-transform: uppercase; }
.section-head p { margin: 0; color: var(--muted); }

.grid { display: grid; gap: 1rem; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cards.compact .card { min-height: 160px; }

.card, .stat {
  border-radius: 1rem;
  padding: 1rem;
}

.card h3 { margin: 0.4rem 0 0.5rem; }
.card p { color: var(--muted); line-height: 1.7; }
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.page-type { color: var(--accent); }
.slug { color: var(--muted); }

.dashboard .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}
.stat { display: grid; gap: 0.45rem; }
.stat span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; }
.stat strong { font-size: 2rem; color: var(--accent); }

.table-wrap { overflow: auto; border-radius: 1rem; border: 1px solid var(--grid); }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: rgba(0,0,0,0.12); }
th, td { padding: 0.85rem 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.06); text-align: left; }
th { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; color: var(--muted); }
tbody tr:hover { background: rgba(106,247,214,0.05); }

.form-grid { display: grid; gap: 0.9rem; }
.form-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { display: grid; gap: 0.45rem; color: var(--muted); }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%;
  background: rgba(1, 5, 6, 0.95);
  border: 1px solid rgba(106,247,214,0.25);
  color: var(--text);
  border-radius: 0.8rem;
  padding: 0.8rem 0.85rem;
  font: inherit;
}
.form-grid textarea { resize: vertical; min-height: 120px; }

.editor-shell {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  grid-template-areas:
    "toolbar toolbar"
    "label label"
    "editor preview";
}
.background-video-card {
  margin-top: 0.25rem;
  border: 1px solid rgba(106,247,214,0.18);
  background:
    linear-gradient(180deg, rgba(5, 10, 11, 0.98), rgba(2, 6, 7, 0.94)),
    radial-gradient(circle at top left, rgba(106, 247, 214, 0.09), transparent 34%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}
.background-video-grid {
  gap: 0.85rem;
}
.background-video-grid label[data-background-video-specific] {
  transition: opacity 0.18s ease, max-height 0.18s ease, margin 0.18s ease;
}
.background-video-grid label[data-background-video-specific][hidden] {
  display: none;
}

.background-video-card .section-head {
  margin-bottom: 1rem;
}

.background-video-card .section-head h2 {
  letter-spacing: 0.22em;
}

.background-video-card .muted-note {
  padding-top: 0.15rem;
  line-height: 1.8;
}
.editor-toolbar { grid-area: toolbar; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.editor-toolbar button {
  border: 1px solid rgba(106,247,214,0.25);
  background: rgba(2, 8, 9, 0.95);
  color: var(--text);
  border-radius: 0.7rem;
  padding: 0.55rem 0.8rem;
  font: inherit;
}
.editor-label { grid-area: label; color: var(--muted); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; }
.rich-editor {
  grid-area: editor;
  min-height: 280px;
  border-radius: 1rem;
  border: 1px solid rgba(106,247,214,0.25);
  background: rgba(1, 5, 6, 0.95);
  padding: 0.95rem;
  line-height: 1.8;
  overflow: auto;
}
.rich-editor:focus { outline: 1px solid var(--accent); }
.rich-editor.is-empty::before {
  content: attr(data-placeholder);
  color: rgba(135, 189, 177, 0.75);
  pointer-events: none;
  display: block;
}
.editor-preview {
  grid-area: preview;
  display: grid;
  gap: 0.5rem;
}
.preview-pane {
  min-height: 280px;
  padding: 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(106,247,214,0.18);
  background: rgba(4, 9, 10, 0.9);
  overflow: auto;
}
.preview-pane p:first-child { margin-top: 0; }
.breadcrumbs, .tree-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  color: var(--muted);
}
.breadcrumbs a, .tree-list a {
  color: var(--accent);
  text-decoration: none;
}
.tree-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: block;
}
.tree-list ul {
  list-style: none;
  margin: 0.35rem 0 0.35rem 1rem;
  padding-left: 0.9rem;
  border-left: 1px dashed rgba(106,247,214,0.2);
}
.tree-node {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.35rem 0;
}
.tree-node span { color: var(--muted); font-size: 0.82rem; }

.switch { display: flex !important; align-items: center; gap: 0.7rem; }
.switch input { width: auto; }
.error {
  grid-column: 1 / -1;
  color: var(--danger);
  border: 1px solid rgba(255,111,131,0.35);
  background: rgba(255,111,131,0.08);
  padding: 0.8rem 0.9rem;
  border-radius: 0.75rem;
}

.inline-form { margin: 0; }
.inline-meta {
  padding: 1rem;
  border-radius: 1rem;
  display: grid;
  gap: 0.7rem;
  align-content: start;
}
.inline-meta strong { display: block; color: var(--accent); margin-top: 0.2rem; }

.page-header {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1rem;
}

.subpage-switcher {
  display: grid;
  gap: 0.85rem;
  border: 1px solid rgba(106, 247, 214, 0.18);
  background:
    linear-gradient(180deg, rgba(5, 10, 11, 0.96), rgba(2, 6, 7, 0.94)),
    radial-gradient(circle at top left, rgba(106, 247, 214, 0.08), transparent 30%);
}

.subpage-switcher .section-head {
  margin-bottom: 0;
}

.subpage-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.reel-panel {
  overflow: hidden;
}

.video-reel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(19rem, 28vw);
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.video-reel::-webkit-scrollbar {
  height: 0.7rem;
}

.video-reel::-webkit-scrollbar-thumb {
  background: rgba(106, 247, 214, 0.18);
  border-radius: 999px;
}

.video-reel-card {
  scroll-snap-align: start;
  display: grid;
  gap: 0.75rem;
  min-height: 16rem;
  padding: 1.05rem 1.05rem 1.15rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(106,247,214,0.18);
  background:
    linear-gradient(180deg, rgba(3, 5, 6, 0.1) 0%, rgba(3, 5, 6, 0.32) 28%, rgba(1, 4, 5, 0.92) 100%),
    radial-gradient(circle at top left, rgba(106, 247, 214, 0.12), transparent 36%),
    var(--reel-thumb, linear-gradient(180deg, rgba(6, 13, 14, 0.96), rgba(2, 6, 7, 0.98)));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.video-reel-card::before {
  content: "";
  position: absolute;
  inset: auto -2rem -1rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 247, 214, 0.22), transparent 68%);
  opacity: 0.75;
}

.video-reel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1, 3, 4, 0.1) 0%, rgba(1, 3, 4, 0.08) 28%, rgba(1, 3, 4, 0.68) 100%),
    radial-gradient(circle at 50% 20%, rgba(141, 245, 125, 0.08), transparent 46%);
  mix-blend-mode: multiply;
  opacity: 0.9;
  pointer-events: none;
}

.video-reel-card:hover {
  transform: translateY(-2px);
  border-color: rgba(141, 245, 125, 0.35);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.45);
}

.video-reel-card h3 {
  margin: 0;
  font-size: clamp(1.2rem, 1.75vw, 1.65rem);
  line-height: 1.05;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
}

.video-reel-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

.video-reel-kicker {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  position: relative;
  z-index: 1;
}

.video-reel-format {
  color: var(--accent-2);
}

.video-reel-action {
  align-self: end;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  position: relative;
  z-index: 1;
}

.richtext {
  line-height: 1.9;
  color: #d8fff5;
}
.richtext a { color: var(--accent); }
.richtext ul { padding-left: 1.4rem; }

.video-source-switcher {
  margin-bottom: 1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(106,247,214,0.18);
  border-radius: 0.95rem;
  background: rgba(2, 8, 9, 0.72);
  display: grid;
  gap: 0.7rem;
}

.video-source-switcher-head {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
}

.video-source-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.video-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.video-column {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.video-item, .video-admin-item {
  display: grid;
  gap: 0.85rem;
  border: 1px solid rgba(106,247,214,0.15);
  background: rgba(1, 5, 6, 0.9);
  border-radius: 1rem;
  padding: 1rem;
}

.video-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
}

.video-item-head .video-play-toggle {
  padding: 0.42rem 0.7rem;
  font-size: 0.68rem;
}

.video-item .embed-shell {
  aspect-ratio: 16 / 9;
}

.video-item.is-active {
  border-color: rgba(141, 245, 125, 0.45);
  box-shadow: 0 0 0 1px rgba(141, 245, 125, 0.12) inset, 0 20px 60px rgba(0,0,0,0.55);
}

.portrait-shell {
  aspect-ratio: 9 / 16;
}

.video-admin-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.video-admin-title {
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.video-admin-meta, .video-admin-url, .muted-note {
  color: var(--muted);
  word-break: break-word;
}

.video-admin-source {
  margin-top: 0.25rem;
  color: rgba(141, 245, 125, 0.72);
  word-break: break-word;
}

.video-add-form {
  margin-top: 0.75rem;
}

.embed-shell {
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--grid);
  background: #000;
  position: relative;
}
.embed-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  position: relative;
  z-index: 1;
}
.embed-shell.is-active iframe {
  pointer-events: auto;
}
.embed-shell:not(.is-active) iframe {
  pointer-events: none;
}
.video-shell-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  background:
    radial-gradient(circle at center, rgba(106, 247, 214, 0.16) 0, rgba(106, 247, 214, 0.08) 18%, rgba(0, 0, 0, 0.22) 42%, rgba(0, 0, 0, 0.58) 100%);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.embed-shell.is-active .video-shell-overlay {
  background:
    radial-gradient(circle at center, rgba(106, 247, 214, 0.08) 0, rgba(106, 247, 214, 0.04) 18%, rgba(0, 0, 0, 0.18) 42%, rgba(0, 0, 0, 0.32) 100%);
}
.video-shell-overlay-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.8rem;
  min-height: 5.8rem;
  padding: 1rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(106, 247, 214, 0.55);
  background: rgba(5, 6, 8, 0.62);
  color: var(--accent);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(106, 247, 214, 0.08), 0 0 30px rgba(106, 247, 214, 0.1);
}
.video-shell-overlay:hover .video-shell-overlay-mark {
  transform: scale(1.03);
  background: rgba(5, 6, 8, 0.72);
  box-shadow: 0 0 0 1px rgba(106, 247, 214, 0.14), 0 0 42px rgba(106, 247, 214, 0.14);
}
.embed-shell.is-active .video-shell-overlay-mark {
  border-color: rgba(141, 245, 125, 0.7);
  background: rgba(1, 5, 6, 0.7);
  color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(141, 245, 125, 0.1), 0 0 38px rgba(141, 245, 125, 0.12);
}

.page-background-video iframe {
  background: #000;
}
.app-shell { aspect-ratio: 16 / 10; }
.audio-player { width: 100%; }

.quran-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(14rem, 0.5fr);
  gap: 0.85rem 1.1rem;
  align-items: start;
  background:
    radial-gradient(circle at top left, rgba(214, 182, 92, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(106, 247, 214, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(6, 9, 12, 0.98), rgba(3, 5, 7, 0.96));
  border: 1px solid rgba(214, 182, 92, 0.18);
}

.quran-hero-copy {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.quran-hero h1 {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  max-width: 28ch;
  margin: 0;
}

.quran-hero .lede {
  margin: 0;
  max-width: 54ch;
  font-size: 0.95rem;
  line-height: 1.55;
  font-family: "Georgia", "Times New Roman", serif;
}

.quran-method p,
.quran-reading-note p,
.quran-translator-notes p,
.quran-method-card p {
  max-width: 72ch;
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.8;
}

.quran-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.quran-download-banner {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  margin-top: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(214, 182, 92, 0.18);
  background: rgba(2, 5, 6, 0.8);
}

.quran-download-banner span,
.quran-download-banner strong {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.quran-download-banner span {
  color: var(--accent-2);
}

.quran-download-banner strong {
  color: #f6f0dd;
}

.quran-download-banner p {
  margin: 0;
  color: var(--muted);
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.65;
}

.quran-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  align-content: start;
}

.quran-summary-card,
.quran-method-card,
.quran-reading-note,
.quran-translator-notes article {
  border-radius: 1rem;
  border: 1px solid rgba(214, 182, 92, 0.18);
  background: linear-gradient(180deg, rgba(10, 13, 16, 0.92), rgba(4, 6, 8, 0.96));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
}

.quran-summary-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.2rem 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
  box-shadow: none;
}

.quran-summary-card span,
.quran-method-card h3,
.quran-reading-note h3,
.quran-translator-notes h4 {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.quran-summary-card span {
  letter-spacing: 0.08em;
  font-size: 0.62rem;
  line-height: 1.2;
}

.quran-summary-card strong {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.1;
  color: #f6f0dd;
  justify-self: end;
}

.quran-method,
.quran-index-panel,
.quran-surah-panel {
  border: 1px solid rgba(214, 182, 92, 0.14);
  background:
    linear-gradient(180deg, rgba(6, 9, 12, 0.96), rgba(2, 4, 5, 0.97)),
    radial-gradient(circle at top right, rgba(214, 182, 92, 0.08), transparent 26%);
}

.quran-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.85rem;
}

.quran-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.quran-method-card {
  padding: 1rem;
}

.quran-library-card {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(214, 182, 92, 0.18);
  background:
    linear-gradient(180deg, rgba(10, 13, 16, 0.92), rgba(4, 6, 8, 0.96)),
    radial-gradient(circle at top right, rgba(141, 245, 125, 0.08), transparent 28%);
}

.quran-library-card span,
.quran-library-card strong {
  display: block;
}

.quran-library-card span {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.quran-library-card strong {
  margin-top: 0.35rem;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.35rem;
  color: #f6f0dd;
}

.quran-library-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.7;
}

.quran-method-card h3,
.quran-reading-note h3 {
  margin: 0 0 0.4rem;
}

.quran-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.quran-search {
  display: grid;
  gap: 0.45rem;
  flex: 1 1 28rem;
}

.quran-search span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.quran-search input {
  width: 100%;
  background: rgba(1, 5, 6, 0.95);
  border: 1px solid rgba(214, 182, 92, 0.28);
  color: var(--text);
  border-radius: 0.8rem;
  padding: 0.8rem 0.9rem;
  font: inherit;
}

.quran-tools-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.quran-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem;
}

.quran-chip {
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 0.85rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(214, 182, 92, 0.16);
  background: rgba(2, 5, 6, 0.72);
  color: var(--text);
  text-decoration: none;
}

.quran-chip:hover {
  border-color: rgba(214, 182, 92, 0.34);
  transform: translateY(-1px);
}

.quran-chip-order,
.quran-chip-meta,
.quran-chapter-meta,
.quran-verse-number {
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.quran-chip-name {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1rem;
}

.quran-chronicle {
  display: grid;
  gap: 0.9rem;
}

.quran-chapter {
  border-radius: 1rem;
  border: 1px solid rgba(214, 182, 92, 0.18);
  background: rgba(2, 4, 5, 0.9);
  overflow: hidden;
  scroll-margin-top: 5.5rem;
}

#hadiths {
  scroll-margin-top: 5.5rem;
}

.quran-chapter summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  cursor: pointer;
  padding: 0.95rem 1rem;
  list-style: none;
}

.quran-chapter summary::-webkit-details-marker {
  display: none;
}

.quran-chapter-order {
  color: var(--accent-2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.quran-chapter-title {
  display: grid;
  gap: 0.22rem;
}

.quran-chapter-title strong {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.35rem;
  color: #f6f0dd;
}

.quran-chapter-title span {
  color: var(--muted);
}

.quran-chapter-body {
  display: grid;
  gap: 0.9rem;
  padding: 0 1rem 1rem;
}

.quran-reading-note,
.quran-translator-notes article {
  padding: 1rem;
}

.quran-translator-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.quran-translator-notes article h4 {
  margin: 0 0 0.4rem;
}

.quran-verse-table-wrap {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid rgba(214, 182, 92, 0.15);
}

.quran-verse-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
  background: rgba(2, 4, 5, 0.88);
}

.quran-verse-table th,
.quran-verse-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

.quran-verse-table th {
  background: rgba(214, 182, 92, 0.06);
  color: var(--muted);
}

.quran-verse-table tbody tr:hover {
  background: rgba(214, 182, 92, 0.04);
}

.quran-verse-number {
  width: 4rem;
  text-align: center;
}

.quran-verse-meta {
  display: grid;
  gap: 0.4rem;
  min-width: 10rem;
}

.quran-verse-meta-link {
  text-decoration: none;
  color: inherit;
}

.quran-verse-meta-link:hover .quran-verse-year,
.quran-verse-meta-link:hover .quran-verse-context-count {
  color: var(--accent);
}

.quran-verse-year,
.quran-verse-context-count,
.quran-verse-context-empty,
.quran-context-count,
.quran-context-ref,
.quran-context-chapter {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
}

.quran-verse-context-count {
  color: var(--accent-2);
}

.quran-verse-context-empty {
  opacity: 0.75;
}

.quran-mt-panel {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-inline-start: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.quran-mt-banner {
  margin: 0.35rem 0 0.55rem;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  line-height: 1.45;
}

.quran-mt-meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.8rem;
  line-height: 1.5;
}

.quran-scholar-disclaimer,
.quran-project-disclaimer {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0.01em;
}

.quran-project-disclaimer {
  opacity: 0.9;
}

.quran-arabic-cell {
  min-width: 12rem;
}

.quran-biblio-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.quran-ayah-audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
  align-items: center;
}

.quran-play-arabic {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.quran-audio-hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0.01em;
}

.quran-audio-player {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.quran-audio-label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quran-audio-player audio {
  width: 100%;
  max-width: 28rem;
  display: block;
}

.site-footer {
  margin: 1.5rem auto 2rem;
  padding: 0 1.25rem 1rem;
  max-width: 1100px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  border-top: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
}

.site-footer p {
  margin: 0.75rem 0 0;
}

.quran-verse-pdf-link {
  display: inline-block;
  margin-top: 0.45rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  text-decoration: none;
}

.quran-verse-record-link,
.quran-ayah-record-link a,
.quran-verse-audio-btn {
  display: inline-block;
  margin-top: 0.45rem;
  margin-inline-end: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
  text-decoration: none;
  font-weight: 600;
}

.quran-ayah-record .quran-ayah-arabic {
  font-size: 1.45rem;
  line-height: 2;
  margin: 0.4rem 0 0;
}

.quran-ayah-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  justify-content: flex-start;
}

.quran-ar-word {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1.9;
  padding: 0.05rem 0.2rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.quran-ar-word:hover,
.quran-ar-word:focus-visible,
.quran-ar-word.is-active {
  background: rgba(111, 247, 214, 0.08);
  border-color: var(--accent, #6af7d6);
  color: var(--accent, #6af7d6);
  outline: none;
}

.quran-word-hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  opacity: 0.72;
  letter-spacing: 0.02em;
}

.quran-word-tooltip {
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.35);
  max-width: 42rem;
  scroll-margin-top: 5.5rem;
}

.quran-word-tooltip.is-jump-target {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.quran-tip-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
}

.quran-ar-word.is-return-flash {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.quran-word-tooltip[hidden] {
  display: none !important;
}

.quran-verse-table tr[id^="surah-"] {
  scroll-margin-top: 6rem;
}

.quran-search-match-link {
  margin-left: 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #6af7d6);
  text-decoration: none;
  white-space: nowrap;
}

.quran-search-match-link:hover {
  text-decoration: underline;
}

.quran-linked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.quran-linked-item {
  font-size: 0.92rem;
}

.quran-linked-item a {
  color: var(--accent, #6af7d6);
}

.quran-ref-link {
  color: var(--accent, #6af7d6);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.quran-context-card-head a,
.quran-context-entry-head a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.quran-ayah-record-link {
  margin: 0 0 0.75rem;
}


.quran-tip-tx-slot:empty {
  display: none;
}

.quran-tip-tx {
  width: 100%;
  margin: 0 0 0.55rem;
  border-collapse: collapse;
  font-size: 0.72rem;
  line-height: 1.25;
}

.quran-tip-tx th,
.quran-tip-tx td {
  padding: 0.18rem 0.4rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quran-tip-tx th {
  width: 8.5rem;
  max-width: 36%;
  font-weight: 600;
  text-align: start;
  opacity: 0.8;
  white-space: nowrap;
}

.quran-tip-tx-en {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-align: start;
}

.quran-tip-tx-en.is-machine {
  cursor: help;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.35);
}

.quran-word-tooltip .quran-tip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  opacity: 0.85;
}

.quran-word-tooltip .quran-tip-section {
  margin: 0.7rem 0 0;
}

.quran-word-tooltip .quran-tip-section h5 {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #6af7d6);
}

.quran-word-tooltip .quran-tip-schools {
  display: grid;
  gap: 0.45rem;
}

.quran-word-tooltip .quran-tip-school {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.4rem;
  font-size: 0.86rem;
}

.quran-word-tooltip .quran-tip-disclaimer {
  margin: 0.75rem 0 0;
  font-size: 0.72rem;
  opacity: 0.68;
}

.quran-download-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.25rem;
}

.quran-arabic {
  direction: rtl;
  unicode-bidi: plaintext;
  font-size: 1.2rem;
  line-height: 2;
  font-family: "DejaVu Sans", "Arial Unicode MS", "Noto Sans Arabic", serif;
  color: #f6f0dd;
}

.quran-verse-table td:nth-child(3),
.quran-verse-table td:nth-child(4),
.quran-verse-table td:nth-child(5),
.quran-verse-table td:nth-child(6) {
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.75;
}

.quran-context-section {
  display: grid;
  gap: 0.8rem;
}

.quran-context-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
}

.quran-context-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(214, 182, 92, 0.16);
  background:
    linear-gradient(180deg, rgba(10, 13, 16, 0.94), rgba(4, 6, 8, 0.98)),
    radial-gradient(circle at top right, rgba(214, 182, 92, 0.06), transparent 30%);
}

.quran-context-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.quran-context-card-link,
.quran-context-entry-head a,
.quran-context-count {
  color: inherit;
  text-decoration: none;
}

.quran-context-card-link:hover,
.quran-context-entry-head a:hover,
.quran-context-count:hover {
  color: var(--accent);
}

.quran-context-card-head span {
  display: block;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.quran-context-card-head strong {
  display: block;
  font-family: "Georgia", "Times New Roman", serif;
  color: #f6f0dd;
  font-size: 1.05rem;
}

.quran-context-entry {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(214, 182, 92, 0.12);
}

.quran-context-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quran-context-entry-head a,
.quran-context-entry-head strong {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
}

.quran-context-entry-head a {
  text-decoration: none;
}

.quran-context-hadith {
  border-left: 3px solid rgba(141, 245, 125, 0.4);
  padding-left: 0.7rem;
}

.quran-context-asbab {
  border-left: 3px solid rgba(106, 247, 214, 0.35);
  padding-left: 0.7rem;
}

.quran-context-excerpt,
.quran-context-entry p,
.quran-context-expand p {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.7;
}

.quran-context-arabic {
  margin: 0;
  direction: rtl;
  unicode-bidi: plaintext;
  font-family: "DejaVu Sans", "Arial Unicode MS", "Noto Sans Arabic", serif;
  color: #f6f0dd;
}

.quran-context-expand {
  display: grid;
  gap: 0.55rem;
}

.quran-context-expand summary {
  cursor: pointer;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
}

.quran-chapter[hidden],
.quran-chip[hidden] {
  display: none;
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  body::before,
  .scanlines,
  .noise,
  .route-transition,
  .main-nav,
  .topbar,
  .quran-actions,
  .quran-tools,
  .quran-chip-grid {
    display: none !important;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .panel,
  .quran-chapter,
  .quran-summary-card,
  .quran-method-card,
  .quran-reading-note,
  .quran-translator-notes article {
    box-shadow: none;
  }

  .quran-chronicle {
    gap: 0.75rem;
  }

  .quran-chapter {
    break-inside: avoid;
  }

  .quran-chapter summary,
  .quran-chapter-body {
    break-inside: avoid;
  }

  .quran-chapter {
    page-break-inside: avoid;
  }

  .quran-chapter {
    margin-bottom: 0.65rem;
  }

  .quran-verse-table {
    min-width: 0;
  }
}

.hidden { display: none; }

@keyframes pulse {
  0%, 100% { transform: scale(0.95); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}

@keyframes glow {
  0%, 100% { box-shadow: inset 0 0 0 rgba(0,0,0,0); }
  50% { box-shadow: inset 0 0 16px rgba(106,247,214,0.08); }
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(6px); }
}

@keyframes flicker {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.32; }
}

@keyframes shell-enter {
  0% {
    opacity: 0;
    transform: translateY(1rem) scale(0.994);
    filter: blur(14px) saturate(1.12) contrast(1.03);
  }
  45% {
    opacity: 0.88;
    transform: translateY(0.15rem) scale(0.998);
    filter: blur(4px) saturate(1.08) contrast(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) saturate(1) contrast(1);
  }
}

@keyframes shell-enter-strong {
  0% {
    opacity: 0;
    transform: translateY(1.35rem) scale(0.988);
    filter: blur(18px) saturate(1.18) contrast(1.05);
  }
  18% {
    opacity: 0.62;
    transform: translateY(0.25rem) scale(0.994);
    filter: blur(9px) saturate(1.12) contrast(1.02);
  }
  38% {
    opacity: 0.92;
    transform: translateY(0) scale(1.003);
    filter: blur(2px) saturate(1.06) contrast(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) saturate(1) contrast(1);
  }
}

@keyframes shell-exit {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) saturate(1) contrast(1);
  }
  100% {
    opacity: 0.35;
    transform: translateY(-0.45rem) scale(1.01);
    filter: blur(9px) saturate(1.12) contrast(1.04);
  }
}

@keyframes route-enter-burst {
  0% { opacity: 0; transform: scale(0.98); }
  18% { opacity: 1; transform: scale(1.01); }
  100% { opacity: 0; transform: scale(1.03); }
}

@keyframes route-exit-burst {
  0% { opacity: 0; transform: scale(1); }
  25% { opacity: 1; transform: scale(1.006); }
  100% { opacity: 0; transform: scale(1.02); }
}

@keyframes route-scan {
  0% { opacity: 0; transform: translateY(-3%); }
  20% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0.9; transform: translateY(2%); }
  100% { opacity: 0; transform: translateY(4%); }
}

@media (max-width: 920px) {
  .hero, .page-header, .form-grid.wide { grid-template-columns: 1fr; }
  .editor-shell { grid-template-columns: 1fr; grid-template-areas: "toolbar" "label" "editor" "preview"; }
  .video-gallery { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shell { width: min(96vw, 100%); }
  .topbar { flex-direction: column; align-items: start; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .header-audio { width: 100%; flex-wrap: wrap; }
  .header-audio .audio-player { width: 100%; min-width: 0; }
  .section-head { flex-direction: column; align-items: start; }
  .main-nav { gap: 0.45rem; }
}

/* Scholarly Quran platform */
.quran-scholar-bar {
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(214, 182, 92, 0.22);
  background: rgba(3, 6, 8, 0.94);
  backdrop-filter: blur(8px);
}
.quran-scholar-bar-modes,
.quran-scholar-bar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.quran-scholar-label {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  margin-right: 0.35rem;
}
.quran-mode-chip {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(106, 247, 214, 0.28);
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
}
.quran-mode-chip.is-active,
.quran-mode-chip:hover {
  border-color: var(--accent);
  background: rgba(106, 247, 214, 0.12);
}
.quran-scholar-disclaimer {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  line-height: 1.55;
}
.quran-inline-speak {
  margin-top: 0.35rem;
}
.quran-cite-block {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(130, 255, 230, 0.12);
}
.quran-cite-islamic,
.quran-cite-apa {
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
html[data-citation-style="islamic"] .quran-cite-apa { display: none; }
html[data-citation-style="apa"] .quran-cite-islamic { display: none; }
.quran-grade-authentic { border-color: rgba(141, 245, 125, 0.35); }
.quran-grade-hasan { border-color: rgba(106, 247, 214, 0.35); }
.quran-grade-weak {
  border-color: rgba(214, 182, 92, 0.4);
  opacity: 0.95;
}
.quran-grade-fabricated {
  border-color: rgba(255, 111, 131, 0.35);
  opacity: 0.75;
}
.quran-grade-list p {
  margin: 0.2rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.quran-home-fold {
  padding: 0;
}

.quran-home-fold > summary,
.quran-area-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  user-select: none;
}

.quran-home-fold > summary::-webkit-details-marker,
.quran-area-fold > summary::-webkit-details-marker {
  display: none;
}

.quran-home-fold-summary {
  border-bottom: 1px solid rgba(214, 182, 92, 0.18);
}

.quran-home-fold-title,
.quran-area-fold-title {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.05rem;
  color: #f6f0dd;
}

.quran-home-fold-hint,
.quran-area-fold-hint {
  flex: 0 0 auto;
  min-width: 3.4rem;
  text-align: center;
  padding: 0.35rem 0.7rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(106, 247, 214, 0.35);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quran-home-fold-body {
  padding: 0.85rem 1rem 1.1rem;
}

.quran-area-folds {
  display: grid;
  gap: 0.55rem;
  margin: 0.65rem 0 1rem;
}

.quran-area-fold {
  border: 1px solid rgba(214, 182, 92, 0.22);
  border-radius: 0.75rem;
  background: rgba(4, 8, 10, 0.88);
}

.quran-area-fold[open] .quran-area-fold-hint,
.quran-home-fold[open] .quran-home-fold-hint {
  content: "Hide";
}

.quran-area-fold-body {
  padding: 0 1rem 0.95rem;
  color: var(--muted);
}

.quran-area-fold-body p {
  margin: 0 0 0.65rem;
}

@media (max-width: 920px) {
  .quran-scholar-bar { position: static; }

  .quran-hero {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .quran-hero h1 {
    max-width: none;
    font-size: clamp(1.2rem, 5.2vw, 1.65rem);
  }

  .quran-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .quran-summary-card {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.4rem 0.45rem;
  }

  .quran-summary-card strong {
    justify-self: start;
    font-size: 0.98rem;
  }
}

@media (max-width: 520px) {
  .quran-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
