
:root, [data-theme="dark"] {
  --bg: #06060a;
  --bg-elevated: #0e0e15;
  --bg-card: #13131c;
  --bg-card-hover: #1a1a27;
  --bg-glass: rgba(8, 8, 14, 0.76);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.17);
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --text: #f6f6fb;
  --text-muted: #9c9cb0;
  --text-subtle: #68687c;
  --accent: #ff3358;
  --accent-2: #ff7a45;
  --accent-hover: #ff4c6d;
  --accent-soft: rgba(255, 51, 88, 0.14);
  --accent-glow: rgba(255, 51, 88, 0.34);
  --indigo-glow: rgba(99, 102, 241, 0.16);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --reader-brightness: 1;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f5f5f8;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f1f7;
  --bg-glass: rgba(255, 255, 255, 0.84);
  --border: rgba(15, 15, 30, 0.09);
  --border-strong: rgba(15, 15, 30, 0.18);
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --text: #0f0f17;
  --text-muted: #525268;
  --text-subtle: #85859b;
  --accent: #e11d48;
  --accent-2: #f97316;
  --accent-hover: #be123c;
  --accent-soft: rgba(225, 29, 72, 0.1);
  --accent-glow: rgba(225, 29, 72, 0.24);
  --indigo-glow: rgba(99, 102, 241, 0.08);
  --shadow: 0 18px 44px rgba(15, 15, 35, 0.09);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient 2026 Dual-Orb Aurora Backdrop */
body::before {
  content: '';
  position: fixed;
  inset: -160px 0 auto 0;
  height: 540px;
  background:
    radial-gradient(45% 85% at 78% 8%, rgba(255, 51, 88, 0.14), transparent 72%),
    radial-gradient(45% 85% at 20% 15%, var(--indigo-glow), transparent 74%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; -webkit-user-drag: none; }
svg.ico { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.ico-sm { width: 14px; height: 14px; }

.container {
  position: relative;
  z-index: 1;
  width: min(1280px, 100% - 2rem);
  margin-inline: auto;
}

/* ---------- Glass Top Navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 70px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
.brand-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 51, 88, 0.25);
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
}
.nav-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.nav-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.54rem 1.05rem 0.54rem 2.55rem;
  font-size: 0.9rem;
  box-shadow: var(--rim);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.nav-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  display: inline-flex;
  pointer-events: none;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Buttons & Pills ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--rim);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--border-strong); transform: translateY(-1.5px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 28px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:hover { filter: brightness(1.07); border-color: transparent; color: #fff; box-shadow: 0 14px 34px var(--accent-glow); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--bg-card); border-color: var(--border); }
.btn-danger { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: transparent; }
.btn-sm { padding: 0.42rem 0.9rem; font-size: 0.82rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 999px; }
.btn-fav.is-fav { background: var(--accent-soft); border-color: rgba(255, 51, 88, 0.45); color: var(--accent); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  backdrop-filter: blur(10px);
}
[data-theme="light"] .pill { background: rgba(15, 15, 25, 0.04); }
.pill-ongoing { background: var(--emerald-soft); border-color: rgba(16, 185, 129, 0.35); color: #34d399; }
.pill-completed { background: var(--accent-soft); border-color: rgba(255, 51, 88, 0.35); color: #ff6b84; }
.pill-hiatus { background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.35); color: #fbbf24; }
.pill-accent { background: var(--accent-soft); border-color: rgba(255, 51, 88, 0.3); color: var(--accent); }
.pill-shield { background: var(--emerald-soft); border-color: rgba(16, 185, 129, 0.35); color: #34d399; }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Cinematic 2026 Hero Showcase ---------- */
.hero {
  position: relative;
  margin-top: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: var(--shadow), var(--rim);
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(48px) saturate(165%) brightness(0.8);
  transform: scale(1.22);
  opacity: 0.42;
  pointer-events: none;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 51, 88, 0.16), transparent 50%),
    linear-gradient(108deg, rgba(6, 6, 10, 0.94) 12%, rgba(8, 8, 14, 0.68) 56%, rgba(6, 6, 10, 0.92) 100%);
}
[data-theme="light"] .hero-scrim {
  background: linear-gradient(108deg, rgba(255, 255, 255, 0.96) 14%, rgba(255, 255, 255, 0.78) 55%, rgba(255, 255, 255, 0.93) 100%);
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 235px 1fr;
  gap: 2.25rem;
  padding: 2.25rem;
  align-items: center;
}
.hero-poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: var(--bg-card);
  transform: perspective(900px) rotateY(-4deg);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.hero-poster:hover {
  transform: perspective(900px) rotateY(0deg) translateY(-4px);
  box-shadow: 0 30px 65px rgba(0, 0, 0, 0.75), 0 0 32px var(--accent-glow);
}
.hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.hero-content h1 {
  margin: 0.7rem 0 0.35rem;
  font-size: clamp(1.75rem, 3.4vw, 2.65rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-alt { color: var(--text-muted); font-size: 0.96rem; margin: 0 0 0.85rem; }
.hero-desc {
  color: var(--text-muted);
  margin: 0 0 1.4rem;
  max-width: 62ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta, .hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.hero-meta { margin-bottom: 0.85rem; }

/* ---------- Continue Reading Strip ---------- */
.continue-banner {
  margin-top: 1.25rem;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 51, 88, 0.12), rgba(99, 102, 241, 0.09));
  border: 1px solid rgba(255, 51, 88, 0.28);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ---------- Section Headings & Filter Bar ---------- */
.section { margin-block: 2.6rem; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 1.15em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.filter-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.filter-btn {
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px var(--accent-glow);
}

/* ---------- Latest Releases Strip ---------- */
.updates-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 0.9rem;
}
.update-card {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.72rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--rim);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.update-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 51, 88, 0.45);
  background: var(--bg-card-hover);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}
.update-thumb {
  width: 58px;
  height: 82px;
  border-radius: 11px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.update-thumb img { width: 100%; height: 100%; object-fit: cover; }
.update-info { min-width: 0; flex: 1; }
.update-title {
  font-weight: 700;
  font-size: 0.96rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.update-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Collector Manga Poster Cards 2.0 ---------- */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 1.3rem;
}
.manga-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--rim);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.manga-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 51, 88, 0.5);
  box-shadow: var(--shadow), 0 0 28px rgba(255, 51, 88, 0.16);
}
.manga-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(145deg, #1b1b28, #0f0f17);
}
.manga-cover::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(6, 6, 10, 0.85));
  pointer-events: none;
}
.manga-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease);
}
.manga-card:hover .manga-cover img { transform: scale(1.07); }
.cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2.3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.24);
  background: radial-gradient(circle at 30% 25%, rgba(255, 51, 88, 0.24), transparent 65%), #13131d;
}
.cover-badges {
  position: absolute;
  inset: 0.65rem 0.65rem auto 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  pointer-events: none;
}
.cover-ch-badge {
  position: absolute;
  inset: auto 0.65rem 0.65rem auto;
  z-index: 2;
  background: rgba(8, 8, 14, 0.82);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-variant-numeric: tabular-nums;
}
.cover-fav-mark {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 51, 88, 0.9);
  color: #fff;
  display: none;
  place-items: center;
  font-size: 0.8rem;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.manga-card.is-fav .cover-fav-mark { display: grid; }
.manga-body { padding: 0.9rem 0.95rem 1rem; }
.manga-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.manga-foot {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Detail Page & Chapter List ---------- */
.chapter-list { display: grid; gap: 0.6rem; }
.chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--rim);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.chapter-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateX(-4px);
}
.chapter-row.is-read { opacity: 0.68; }
.chapter-num {
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.chapter-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.chapter-row.is-read .chapter-dot { background: var(--text-subtle); box-shadow: none; }
.chapter-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Luxury Protected Canvas Reader ---------- */
body.reader-body {
  background: #040407;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
body.reader-body::before { display: none; }
.reader-progress {
  position: fixed;
  top: 0;
  right: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px var(--accent-glow);
  z-index: 60;
  transition: width 0.12s linear;
}
.reader-bar {
  position: fixed;
  inset: 0.75rem 1rem auto 1rem;
  max-width: 1140px;
  margin-inline: auto;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.62rem 1rem;
  border-radius: 20px;
  background: rgba(10, 10, 16, 0.88);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  color: #f4f4f8;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.reader-bottom {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  max-width: 600px;
  margin-inline: auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(10, 10, 16, 0.9);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  color: #f4f4f8;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
body.bars-hidden .reader-bar { transform: translateY(-135%); opacity: 0; pointer-events: none; }
body.bars-hidden .reader-bottom { transform: translateY(155%); opacity: 0; pointer-events: none; }

.reader-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.36rem 0.85rem;
  color: #fff;
  font-size: 0.86rem;
  max-width: 220px;
}
.reader-select option { background: #14141d; color: #fff; }
.brightness-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.brightness-ctrl input[type="range"] {
  width: 68px;
  accent-color: var(--accent);
  cursor: pointer;
}

.reader-stage {
  min-height: 100vh;
  padding: 5.5rem 0 6.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.reader-pages {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  filter: brightness(var(--reader-brightness));
  transition: filter 0.15s ease;
}
.reader-stage[data-fit="full"] .reader-pages { max-width: 100%; }
.reader-stage[data-fit="compact"] .reader-pages { max-width: 680px; }

.reader-page {
  width: 100%;
  position: relative;
  background: #0b0b11;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.reader-page.loaded { min-height: 0; background: transparent; }
.reader-page.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, #0c0c13 30%, #171724 50%, #0c0c13 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.reader-page canvas,
.reader-page img {
  display: block;
  width: 100%;
  height: auto;
  margin-inline: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.page-shield-glass {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: transparent;
}
.reader-stage[data-mode="paged"] .reader-page { display: none; }
.reader-stage[data-mode="paged"] .reader-page.active { display: flex; }
.reader-stage[data-mode="paged"] .reader-page canvas,
.reader-stage[data-mode="paged"] .reader-page img {
  max-height: calc(100vh - 9.5rem);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.reader-page-error {
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
}
.reader-end {
  width: min(640px, 100% - 2rem);
  margin: 2.5rem auto 1rem;
  padding: 2.2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), var(--rim);
  text-align: center;
}
.reader-end h2 { margin: 0 0 0.4rem; }
.reader-end p { color: var(--text-muted); margin: 0 0 1.35rem; }

/* Anti-Print Shield */
@media print {
  body.reader-body * { display: none !important; }
  body.reader-body::after {
    content: 'المحتوى محمي — القراءة متاحة داخل موقع Atlas فقط';
    display: block;
    padding: 4rem 2rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
  }
}

/* ---------- Team Studio UI ---------- */
.studio-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 0.95rem;
  margin-block: 1.5rem;
}
.stat-card {
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--rim);
}
.stat-label { font-size: 0.82rem; color: var(--text-muted); }
.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.38rem;
  border-radius: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.68rem 1rem;
  border-radius: 13px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 20px var(--accent-glow);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-card {
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--rim);
  margin-bottom: 1.25rem;
}
.panel-card h2 { margin: 0 0 0.35rem; font-size: 1.22rem; }
.panel-sub { margin: 0 0 1.25rem; color: var(--text-muted); font-size: 0.9rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-hint { font-size: 0.79rem; color: var(--text-muted); }
.drive-path-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.9rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  color: #34d399;
  direction: ltr;
  max-width: 100%;
  overflow-x: auto;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  cursor: pointer;
}
.check-row input { margin-top: 0.28rem; accent-color: var(--accent); }

/* ---------- Smart Dropzone & Page Queue Grid ---------- */
.dropzone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--bg-elevated);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone strong { display: block; font-size: 1rem; margin-bottom: 0.3rem; }
.dropzone span { font-size: 0.84rem; color: var(--text-muted); }
.dropzone-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}
.hidden-input { display: none; }

.cover-preview-wrap {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}
.cover-preview-box {
  width: 112px;
  height: 164px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  color: var(--text-subtle);
  font-size: 0.78rem;
  flex-shrink: 0;
}
.cover-preview-box img { width: 100%; height: 100%; object-fit: cover; }

.queue-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  max-height: 460px;
  overflow-y: auto;
  padding: 0.25rem;
}
.queue-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.queue-item.uploaded { border-color: var(--emerald); }
.queue-item.error { border-color: var(--danger); }
.queue-thumb { aspect-ratio: 3 / 4; background: #0d0d13; overflow: hidden; }
.queue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.queue-num {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(8, 8, 12, 0.86);
  color: #fff;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.queue-meta {
  padding: 0.45rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: center;
}
.queue-tools { display: flex; justify-content: center; gap: 0.2rem; padding: 0 0.35rem 0.45rem; }
.queue-tools button {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 6px;
  padding: 0.12rem 0.4rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.queue-tools button:hover { border-color: var(--accent); color: var(--accent); }

.progress-wrap {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: none;
}
.progress-wrap.visible { display: block; }
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-card);
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s var(--ease);
}

/* ---------- Studio Series List ---------- */
.studio-series-list { display: grid; gap: 0.9rem; }
.studio-series-card {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.studio-series-thumb {
  width: 76px;
  height: 108px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.studio-series-thumb img { width: 100%; height: 100%; object-fit: cover; }
.studio-series-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: flex-end; }
.studio-chapters-inline { margin-top: 0.65rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ch-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.ch-chip .ch-del { border: none; background: transparent; color: var(--text-subtle); cursor: pointer; padding: 0 0.15rem; font-size: 0.8rem; }
.ch-chip .ch-del:hover { color: var(--danger); }

/* ---------- Banners, Empty State, Toast, Footer, Modal ---------- */
.banner {
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #6ee7b7;
  margin-bottom: 1.15rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.banner.warn { background: var(--amber-soft); border-color: rgba(245, 158, 11, 0.35); color: #fcd34d; }
.banner.error { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }
.empty-box {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
}
.empty-box h2 { margin: 0 0 0.5rem; }
.empty-box p { color: var(--text-muted); margin: 0 auto 1.4rem; max-width: 48ch; }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 80;
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--danger); color: #fca5a5; }
.toast.ok { border-color: var(--emerald); color: #6ee7b7; }

.footer {
  margin-top: 4rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 8, 0.78);
  backdrop-filter: blur(10px);
  z-index: 70;
  display: none;
  place-items: center;
  padding: 1rem;
}
.modal-backdrop.open { display: grid; }
.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

/* ---------- Utility Classes (Strict CSP: zero inline styles) ---------- */
.hidden { display: none !important; }
.flex-row { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.gap-xs { gap: 0.4rem; }
.gap-sm { gap: 0.65rem; }
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: 0.35rem; }
.mt-sm { margin-top: 0.75rem; }
.mt-md { margin-top: 1.15rem; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 1rem; }
.m-0 { margin: 0; }
.muted { color: var(--text-muted); }
.sm-placeholder { font-size: 1.15rem; }
.series-card-title { font-size: 1.05rem; }
.compact-dropzone { padding: 1.25rem 1rem; }
.compact-select {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.84rem;
}
.clamp-6 { -webkit-line-clamp: 6; }
.hero-empty-title { margin: 0.8rem 0 0.5rem; }
.chapter-subtitle { color: var(--text-muted); font-weight: 500; }
.reader-counter { font-size: 0.86rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.reader-disabled { opacity: 0.4; pointer-events: none; }
.legacy-pages { margin-inline: auto; gap: 0.75rem; }
.legacy-fig { margin: 0; width: 100%; }
.legacy-img { border-radius: 10px; width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .topbar-inner { flex-wrap: wrap; padding-block: 0.65rem; }
  .nav-search { order: 3; flex-basis: 100%; max-width: none; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; padding: 1.5rem; }
  .hero-poster { width: 175px; margin-inline: auto; transform: none; }
  .hero-meta, .hero-actions { justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .studio-series-card { grid-template-columns: 62px 1fr; }
  .studio-series-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .manga-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
  .brightness-ctrl { display: none; }
}
