:root {
  color-scheme: dark;
  --hero-fixed-height: 568px;
  --bg: #090909;
  --bg-deep: #050505;
  --surface: #171717;
  --surface-strong: #1f1f1f;
  --surface-soft: #101010;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --line: #2d2d2d;
  --accent: #4daaf0;
  --green: #54c81d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --overlay-bg: #050505;
  --overlay-text: #f8f8f8;
  --overlay-hover-bg: #ffffff;
  --overlay-hover-text: #090909;
  --nav-light: rgba(255, 255, 255, 0.2);
  --reader-bg: #050505;
  --reader-text: #f5f5f5;
  --reader-surface: #191919;
  --reader-muted: #a0a0a0;
  --reader-inverse-bg: #f4f4f4;
  --reader-inverse-text: #111111;
  --reader-overlay: rgba(116, 116, 116, 0.56);
  --reader-panel: #0a0a0a;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f7f7;
  --bg-deep: #ffffff;
  --surface: #ffffff;
  --surface-strong: #eeeeee;
  --surface-soft: #f0f0f0;
  --text: #151515;
  --muted: #616161;
  --line: #d8d8d8;
  --shadow: 0 24px 70px rgba(70, 70, 70, 0.16);
  --overlay-bg: #ffffff;
  --overlay-text: #111111;
  --overlay-hover-bg: #090909;
  --overlay-hover-text: #ffffff;
  --nav-light: rgba(77, 170, 240, 0.2);
  --reader-bg: #f5f5f5;
  --reader-text: #111111;
  --reader-surface: #e8e8e8;
  --reader-muted: #646464;
  --reader-inverse-bg: #111111;
  --reader-inverse-text: #f5f5f5;
  --reader-overlay: rgba(220, 220, 220, 0.62);
  --reader-panel: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rubik', Arial, sans-serif;
}

body::selection {
  background: var(--accent);
  color: #050505;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.theme-logo {
  content: url('/brand/wolfmanga_transparente.png');
}

html[data-theme='light'] .theme-logo {
  content: url('/brand/wolfmanga_transparente_negro.png');
}

html[data-theme='light'] .site-footer .theme-logo {
  content: url('/brand/wolfmanga_transparente.png');
}

.side-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  width: 118px;
  padding-top: 96px;
  background: transparent;
  pointer-events: none;
}

.brand-mark {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  pointer-events: all;
  transition:
    transform 0.24s ease,
    filter 0.24s ease;
}

.brand-mark:hover {
  transform: translateY(-2px) rotate(-2deg);
  filter: drop-shadow(0 0 18px rgba(77, 170, 240, 0.28));
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.5));
}

.top-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 0 40px 0 40px;
  backdrop-filter: none;
  background: transparent;
  box-shadow: none;
}

body.is-searching .top-nav {
  z-index: 170;
}

.nav-links {
  display: flex;
  gap: 32px;
  padding-left: 0;
  margin-left: 0;
}

.nav-links a {
  position: relative;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  opacity: 0.94;
  text-shadow: 0 0 10px var(--nav-light);
  transition:
    color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0.35);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
  background: transparent;
  outline: none;
  opacity: 1;
  transform: translateY(-1px);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  opacity: 0.9;
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--bg);
  background: var(--text);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.search-modal[hidden] {
  display: none;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: start center;
  padding: 92px 24px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.search-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.26s ease;
}

.search-modal.is-open .search-backdrop {
  opacity: 1;
}

.search-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  display: grid;
  gap: 18px;
  padding: 30px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-18px) scale(0.975);
  transition:
    opacity 0.28s ease,
    transform 0.34s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.search-modal.is-open .search-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.search-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.search-panel h2 {
  max-width: calc(100% - 58px);
}

.search-field {
  position: relative;
  display: block;
  color: var(--muted);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.24s ease,
    transform 0.3s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.search-modal.is-open .search-field {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.08s;
}

.search-field svg {
  position: absolute;
  left: 22px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
}

.search-field input {
  min-height: 68px;
  padding: 0 24px 0 62px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 22px;
  font-weight: 700;
}

.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: min(46vh, 390px);
  overflow: auto;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.24s ease,
    transform 0.3s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.search-modal.is-open .search-results {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.13s;
}

.search-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.search-result {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--surface-strong);
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  transform: translateY(-1px);
}

.search-result img {
  width: 58px;
  height: 76px;
  object-fit: cover;
  border-radius: 6px;
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result strong {
  font-size: 16px;
  line-height: 1.15;
}

.search-result small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.3;
}

.app-shell {
  overflow: hidden;
}

.hero {
  --hero-copy-y: 16px;
  position: relative;
  height: var(--hero-fixed-height);
  min-height: var(--hero-fixed-height);
  max-height: var(--hero-fixed-height);
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: center;
  gap: 20px;
  padding: 104px 24px 88px;
  overflow: hidden;
  contain: layout paint;
  background: var(--surface);
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 78% 28%, color-mix(in srgb, var(--accent) 34%, transparent) 0, transparent 26%),
    linear-gradient(90deg, var(--surface) 0 43%, color-mix(in srgb, var(--surface) 72%, transparent) 58%, transparent 100%);
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  height: 160px;
  background: linear-gradient(0deg, var(--bg) 0%, transparent 100%);
}

.hero-copy {
  --hero-actions-top: 332px;
  position: relative;
  z-index: 3;
  grid-column: 5 / 14;
  max-width: 690px;
  height: 392px;
  transform: translateY(var(--hero-copy-y));
  will-change: opacity, transform, filter;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 25px);
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: 'Outfit', Arial, sans-serif;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(44px, 5vw, 72px);
  line-height: 0.98;
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 14px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--text);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.hero-description {
  margin: 0;
  max-width: 700px;
  min-height: 60px;
  color: var(--text);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.54;
  font-weight: 500;
}

.hero-actions {
  position: absolute;
  left: 0;
  top: var(--hero-actions-top);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 0;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px;
  padding: 10px 24px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.primary-button {
  background: var(--text);
  color: var(--bg);
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 26%, transparent);
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.ghost-button {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  color: var(--bg);
  background: var(--text);
}

.primary-button svg,
.ghost-button svg {
  width: 18px;
  height: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}

.status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.hero-art {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: min(57vw, 920px);
  height: 100%;
  max-height: var(--hero-fixed-height);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.hero-art::after {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: 2;
  background:
    linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 84%, transparent) 13%, transparent 34%),
    linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 80%, transparent) 18%, transparent 42%);
  pointer-events: none;
}

.hero-art img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 22px 38px rgba(0, 0, 0, 0.38));
  opacity: 1;
  transform: translate(var(--hero-bg-shift-x, 0), var(--hero-bg-shift-y, 0)) scale(var(--hero-bg-zoom, 1));
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 16%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 16%, #000 100%);
  will-change: opacity, transform, filter;
}

.hero.is-sliding .hero-copy {
  animation: heroCopySwap 0.54s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.hero.is-sliding .hero-art img {
  animation: heroImageSwap 0.72s cubic-bezier(0.18, 0.82, 0.2, 1) both;
}

.hero.is-sliding::before {
  animation: heroLightSweep 0.82s ease both;
}

@keyframes heroCopySwap {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(calc(var(--hero-copy-y) + 22px));
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(var(--hero-copy-y));
  }
}

@keyframes heroImageSwap {
  0% {
    opacity: 0;
    filter: blur(10px) drop-shadow(0 22px 38px rgba(0, 0, 0, 0.2));
    transform: translate(calc(var(--hero-bg-shift-x, 0) + 42px), var(--hero-bg-shift-y, 0))
      scale(calc(var(--hero-bg-zoom, 1) * 1.035));
  }

  58% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 22px 38px rgba(0, 0, 0, 0.38));
    transform: translate(var(--hero-bg-shift-x, 0), var(--hero-bg-shift-y, 0)) scale(var(--hero-bg-zoom, 1));
  }
}

@keyframes heroLightSweep {
  0% {
    opacity: 0.72;
    filter: saturate(0.78);
  }

  100% {
    opacity: 1;
    filter: saturate(1);
  }
}

.hero-controls {
  position: absolute;
  z-index: 6;
  right: 28px;
  bottom: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.dots {
  position: relative;
  z-index: 7;
  display: flex;
  gap: 8px;
}

.hero-copy .dots {
  position: absolute;
  left: 0;
  top: calc(var(--hero-actions-top) + 82px);
  margin-top: 0;
}

.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  background: var(--text);
  border-radius: 999px;
  opacity: 0.2;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    width 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.dot.is-active {
  width: 24px;
  opacity: 1;
  transform: scaleY(1.2);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 38%, transparent);
}

.arrow-group {
  display: flex;
  gap: 8px;
  transform: translateY(20px);
}

.content-section {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 20px;
  padding: 64px 24px;
  background: var(--bg);
}

.content-section > h2,
.section-heading,
.manga-grid,
.popular-grid,
.series-strip,
.admin-intro,
.admin-grid,
.toast-line {
  grid-column: 5 / -1;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 4vw, 42px);
  line-height: 1;
}

.filter-bar {
  display: flex;
  gap: 8px;
  max-width: 52vw;
  overflow-x: auto;
  padding-bottom: 6px;
}

.filter-chip {
  min-height: 34px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  white-space: nowrap;
  cursor: pointer;
}

.filter-chip.is-active,
.filter-chip:hover {
  background: var(--text);
  color: var(--bg);
}

.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 373px);
  gap: 48px 20px;
  justify-content: start;
}

#discover .section-heading,
#discover .manga-grid {
  grid-column: 3 / -1;
  width: min(100%, 1484px);
  justify-self: end;
}

#discover .manga-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manga-card {
  position: relative;
  color: var(--text);
  cursor: default;
  outline: none;
}

.manga-grid .manga-card {
  width: min(373px, 100%);
}

.manga-grid .image-wrap {
  width: min(373px, 100%);
  height: 230px;
  aspect-ratio: auto;
}

#discover .manga-grid .manga-card,
#discover .manga-grid .image-wrap {
  width: 100%;
}

#discover .manga-grid .image-wrap {
  height: auto;
  aspect-ratio: 373 / 230;
}

.image-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
}

.image-wrap.tall {
  aspect-ratio: 2 / 3;
}

.glow-image,
.main-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
}

.glow-image {
  top: 12px;
  z-index: 0;
  filter: blur(20px);
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.28s ease;
}

.main-image {
  z-index: 1;
  transition:
    box-shadow 0.28s ease,
    transform 0.28s ease;
}

.read-overlay {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 16px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--overlay-text);
  background: var(--overlay-bg);
  font-size: 15px;
  font-weight: 700;
  opacity: 0;
  cursor: pointer;
  transition:
    opacity 0.22s ease,
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease;
}

.image-wrap:hover .glow-image,
.manga-card:focus-within .glow-image {
  opacity: 0.5;
}

.image-wrap:hover .main-image,
.manga-card:focus-within .main-image {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent) 24%, transparent);
}

.image-wrap:hover .read-overlay,
.manga-card:focus-within .read-overlay {
  opacity: 1;
}

.read-overlay:hover,
.read-overlay:focus-visible {
  opacity: 1;
  color: var(--overlay-hover-text);
  background: var(--overlay-hover-bg);
  transform: translateY(-1px);
}

.manga-grid .card-title {
  font-size: 19px;
}

.card-title {
  margin: 14px 0 6px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 700;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.split-section {
  padding-top: 50px;
}

.popular-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 46px;
}

.rank-card {
  position: relative;
  min-height: 96px;
  display: grid;
  grid-template-columns: 46px 1fr 28px;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  padding: 20px;
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  isolation: isolate;
}

.rank-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--rank-image) center / cover;
  opacity: 0.04;
  transform: scale(1.04);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.rank-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--rank-color, var(--surface));
  opacity: 0.88;
  transition: opacity 0.25s ease;
}

.rank-card.is-top {
  color: #0b0b0b;
  background: var(--rank-color);
}

.rank-card.is-top::before {
  opacity: 0.08;
}

.rank-card:hover::before {
  opacity: 0.5;
  transform: scale(1);
}

.rank-card:hover::after {
  opacity: 0.34;
}

.rank-number,
.rank-title {
  position: relative;
  z-index: 2;
  font-weight: 700;
}

.rank-number {
  font-size: 19px;
}

.rank-title {
  min-width: 0;
  font-size: 18px;
}

.rank-card svg {
  position: relative;
  z-index: 2;
  width: 21px;
  height: 21px;
  color: color-mix(in srgb, var(--text) 70%, var(--rank-color));
}

.rank-card.is-top svg {
  color: #fff1a2;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.45));
}

html[data-theme='light'] .rank-card:not(.is-top) {
  --rank-color: #e8e8e8 !important;
  color: #151515;
  background: #e8e8e8;
}

html[data-theme='light'] .rank-card:not(.is-top)::after {
  background: #e8e8e8;
  opacity: 0.88;
}

html[data-theme='light'] .rank-card:not(.is-top):hover::after {
  opacity: 0.42;
}

html[data-theme='light'] .rank-card:not(.is-top) svg {
  color: #444444;
}

html[data-theme='light'] .primary-button:hover,
html[data-theme='light'] .primary-button:focus-visible,
html[data-theme='light'] .ghost-button:hover,
html[data-theme='light'] .ghost-button:focus-visible {
  color: #ffffff;
  background: #090909;
}

.muted-band {
  background: var(--surface);
}

.series-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 20px;
}

.series-strip .card-title {
  font-size: 18px;
}

.explore-page[hidden] {
  display: none;
}

.explore-page {
  min-height: 100vh;
  padding: 154px 24px 96px 350px;
  background: var(--bg);
}

.explore-shell {
  width: min(1530px, 100%);
}

.explore-shell > h1 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: clamp(38px, 4vw, 44px);
  line-height: 1;
}

.explore-popular-strip {
  display: flex;
  gap: 20px;
  width: calc(100vw - 374px);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  cursor: grab;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  user-select: none;
  will-change: scroll-position;
}

.explore-popular-strip::-webkit-scrollbar {
  display: none;
}

.explore-popular-strip.is-dragging {
  cursor: grabbing;
}

.explore-rank-card {
  --rank-image: none;
  position: relative;
  flex: 0 0 326px;
  height: 160px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  padding: 24px 16px 18px;
  color: #f5f5f5;
  background: #1a1a1a;
  border-radius: 6px;
  cursor: pointer;
  isolation: isolate;
  transition:
    filter 0.22s ease,
    transform 0.22s ease;
}

.explore-rank-card::before,
.explore-rank-card::after {
  content: '';
  position: absolute;
  inset: 0;
}

.explore-rank-card::before {
  z-index: -2;
  background: var(--rank-image) center / cover;
  opacity: 0.18;
  filter: grayscale(0.2);
  transform: scale(1.08);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.explore-rank-card::after {
  z-index: -1;
  background: #151515;
  opacity: 0.82;
}

.explore-rank-card.is-top {
  color: #090909;
  background: var(--rank-color);
}

.explore-rank-card.is-top::after {
  background: linear-gradient(115deg, color-mix(in srgb, var(--rank-color) 92%, #ffffff) 0%, var(--rank-color) 100%);
  opacity: 0.9;
}

.explore-rank-card:hover,
.explore-rank-card:focus-visible {
  filter: brightness(1.06);
  outline: none;
  transform: translateY(-2px);
}

.explore-rank-card:hover::before,
.explore-rank-card:focus-visible::before {
  opacity: 0.74;
  transform: scale(1.02);
}

.explore-rank-card:hover::after,
.explore-rank-card:focus-visible::after {
  opacity: 0.46;
}

.explore-rank-card.is-top:hover::after,
.explore-rank-card.is-top:focus-visible::after {
  opacity: 0.48;
}

.explore-rank-card h2 {
  max-width: 256px;
  margin: 0;
  color: currentColor;
  font-size: 24px;
  line-height: 0.98;
}

.explore-rank-card span {
  color: currentColor;
  font-size: 14px;
  font-weight: 700;
  opacity: 0.55;
}

.explore-rank-card svg {
  position: absolute;
  right: 22px;
  top: 26px;
  width: 21px;
  height: 21px;
  color: #fff3a6;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.42));
}

.explore-toolbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 62px 0 31px;
}

.explore-filter {
  position: relative;
}

.explore-filter-button {
  min-width: 92px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 24px;
  color: var(--text);
  background: var(--surface);
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.explore-filter-button:hover,
.explore-filter-button:focus-visible,
.explore-filter-button.is-active {
  color: var(--bg);
  background: var(--text);
  outline: none;
  transform: translateY(-1px);
}

.explore-filter-button svg {
  width: 16px;
  height: 16px;
}

.explore-count {
  margin-left: auto;
  padding-top: 12px;
  color: color-mix(in srgb, var(--text) 64%, var(--accent));
  font-size: 14px;
  font-weight: 500;
}

.explore-filter-menu {
  position: absolute;
  top: 58px;
  left: 0;
  z-index: 40;
  width: 334px;
  max-height: 288px;
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 8px;
  color: #f5f5f5;
  background: #181818;
  border-radius: 6px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.36);
  animation: exploreMenuIn 0.2s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.explore-filter-menu.is-sort {
  width: 336px;
  max-height: none;
  gap: 0;
  overflow: visible;
}

.explore-filter-search {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  color: #f5f5f5;
  background: #0d0d0d;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
}

.explore-filter-search:focus {
  border-color: color-mix(in srgb, var(--accent) 48%, #0d0d0d);
}

.explore-filter-options {
  display: grid;
  gap: 4px;
}

.explore-filter-option {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  color: #f5f5f5;
  background: transparent;
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.explore-filter-option:hover,
.explore-filter-option:focus-visible,
.explore-filter-option.is-selected {
  color: #111111;
  background: #f4f4f4;
  outline: none;
}

.option-dot {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.explore-filter-option.is-selected .option-dot {
  background: currentColor;
  box-shadow: inset 0 0 0 3px #f4f4f4;
}

.explore-filter-option strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-filter-option em {
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 38px 20px;
  overflow: visible;
}

.explore-card {
  position: relative;
  min-width: 0;
  color: var(--text);
  cursor: pointer;
  z-index: 1;
}

.explore-card:hover,
.explore-card:focus-within {
  z-index: 80;
}

.explore-cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 7px;
  isolation: auto;
  overflow: visible;
}

.explore-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transition:
    filter 0.24s ease,
    transform 0.24s ease,
    box-shadow 0.24s ease;
}

.explore-card:hover .explore-cover-wrap img,
.explore-card:focus-within .explore-cover-wrap img {
  box-shadow: 0 0 38px color-mix(in srgb, var(--accent) 28%, transparent);
  filter: brightness(0.9);
  transform: translateY(-2px);
}

.explore-card h2 {
  display: -webkit-box;
  min-height: 42px;
  margin: 16px 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.explore-card-details {
  position: absolute;
  left: var(--tooltip-x, 70%);
  top: var(--tooltip-y, 42%);
  z-index: 95;
  width: 310px;
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 19px 18px;
  color: #f5f5f5;
  background: rgba(54, 50, 50, 0.96);
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(18px, -50%, 0) scale(0.98);
  transition:
    opacity 0.18s ease,
    transform 0.2s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.explore-card.tooltip-left .explore-card-details {
  transform: translate3d(calc(-100% - 18px), -50%, 0) scale(0.98);
}

.explore-card:hover .explore-card-details,
.explore-card:focus-within .explore-card-details {
  opacity: 1;
  transform: translate3d(18px, -50%, 0) scale(1);
}

.explore-card.tooltip-left:hover .explore-card-details,
.explore-card.tooltip-left:focus-within .explore-card-details {
  transform: translate3d(calc(-100% - 18px), -50%, 0) scale(1);
}

.explore-card-details strong {
  font-size: 18px;
  line-height: 1.2;
}

.explore-card-details span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 15px;
  line-height: 1.45;
}

.explore-more-button {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  min-height: 42px;
  color: var(--overlay-text);
  background: var(--overlay-bg);
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease,
    transform 0.2s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.explore-card:hover .explore-more-button,
.explore-card:focus-within .explore-more-button {
  opacity: 1;
  transform: translateY(0);
}

.explore-more-button:hover,
.explore-more-button:focus-visible {
  color: var(--overlay-hover-text);
  background: var(--overlay-hover-bg);
  outline: none;
}

html[data-theme='light'] .explore-filter-menu {
  color: #111111;
  background: #f1f1f1;
  box-shadow: 0 26px 70px rgba(80, 80, 80, 0.18);
}

html[data-theme='light'] .explore-filter-search {
  color: #111111;
  background: #ffffff;
}

html[data-theme='light'] .explore-filter-option {
  color: #111111;
}

html[data-theme='light'] .explore-filter-option:hover,
html[data-theme='light'] .explore-filter-option:focus-visible,
html[data-theme='light'] .explore-filter-option.is-selected {
  color: #f5f5f5;
  background: #111111;
}

html[data-theme='light'] .explore-filter-option.is-selected .option-dot {
  box-shadow: inset 0 0 0 3px #111111;
}

html[data-theme='light'] .explore-card-details {
  color: #111111;
  background: rgba(244, 244, 244, 0.96);
}

html[data-theme='light'] .explore-card-details span {
  color: rgba(17, 17, 17, 0.55);
}

@keyframes exploreMenuIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.admin-section {
  background:
    radial-gradient(circle at 85% 12%, rgba(77, 170, 240, 0.12), transparent 24%),
    var(--bg);
}

.admin-intro {
  margin-bottom: 8px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.upload-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-heading svg {
  color: var(--accent);
}

h3 {
  margin: 0;
  font-size: 22px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

input[type='color'] {
  min-height: 45px;
  padding: 4px;
}

input[type='file'] {
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.two-fields,
.file-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.toast-line {
  min-height: 22px;
  color: var(--muted);
  margin-top: 12px;
  font-weight: 600;
}

.series-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.series-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.close-dialog {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 3;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
}

.dialog-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 28px;
  padding: 34px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface) 82%, transparent), var(--surface)),
    var(--dialog-image) center / cover;
}

.dialog-cover {
  aspect-ratio: 2 / 3;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dialog-copy {
  align-self: end;
}

.dialog-copy h2 {
  color: var(--dialog-accent, var(--accent));
}

.dialog-copy p {
  max-width: 650px;
  line-height: 1.6;
}

.chapter-list {
  display: grid;
  gap: 10px;
  padding: 24px 34px 34px;
  max-height: 350px;
  overflow: auto;
}

.chapter-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: center;
  min-height: 62px;
  padding: 12px 16px;
  color: var(--text);
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
}

.chapter-row:hover {
  background: var(--surface-strong);
}

.series-page[hidden] {
  display: none;
}

.series-page {
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  animation: pageIn 0.42s ease both;
}

.series-hero {
  position: relative;
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 368px);
  gap: clamp(34px, 7vw, 110px);
  align-items: center;
  padding: 118px 40px 86px 180px;
  isolation: isolate;
}

.series-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, var(--bg) 0 42%, color-mix(in srgb, var(--bg) 78%, transparent) 62%, transparent 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 22%),
    var(--series-image) var(--series-bg-x, right) var(--series-bg-y, center) / auto calc(100% * var(--series-bg-zoom, 1)) no-repeat;
  opacity: 0.22;
  filter: saturate(1.1);
}

.series-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 76% 28%, color-mix(in srgb, var(--series-accent) 34%, transparent), transparent 30%),
    linear-gradient(90deg, var(--bg) 0 54%, transparent 100%);
}

.series-copy {
  max-width: 960px;
  min-width: 0;
  animation: seriesTextIn 0.55s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 34px;
  color: var(--muted);
  font-weight: 700;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
  transform: translateX(-3px);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

.series-copy h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(58px, 8vw, 112px);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.series-description {
  max-width: 920px;
  margin: 28px 0 0;
  color: var(--text);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.58;
  font-weight: 500;
}

.series-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.series-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 42px 0 0;
  padding: 1px;
  background: var(--line);
  border-radius: 8px;
}

.series-facts div {
  min-height: 92px;
  padding: 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.series-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.series-facts dd {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.series-cover-card {
  position: relative;
  align-self: center;
  justify-self: end;
  width: min(100%, 368px);
  animation: seriesCoverIn 0.68s cubic-bezier(0.18, 0.82, 0.2, 1) both;
}

.series-cover-card::before {
  content: '';
  position: absolute;
  inset: 16px;
  z-index: -1;
  background: var(--series-accent);
  filter: blur(44px);
  opacity: 0.26;
}

.series-cover-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
}

.series-chapters {
  width: min(1530px, calc(100% - 220px));
  margin: 0 40px 0 auto;
  padding: 54px 0 104px;
  background: var(--bg);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 290px);
  justify-content: end;
  gap: 20px;
  margin-top: 38px;
}

.chapter-tile {
  position: relative;
  width: 290px;
  height: 94px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px 16px;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    color 0.22s ease;
}

.chapter-tile::before {
  content: none;
}

.chapter-tile:hover,
.chapter-tile:focus-visible {
  color: #111111;
  background: #f4f4f4;
  border-color: #f4f4f4;
  outline: none;
}

.chapter-tile span,
.chapter-tile strong {
  position: relative;
  z-index: 1;
}

.chapter-tile span {
  color: inherit;
  font-size: 18px;
  font-weight: 800;
}

.chapter-tile strong {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}

.chapter-tile:hover strong,
.chapter-tile:focus-visible strong {
  color: rgba(17, 17, 17, 0.72);
}

html[data-theme='light'] .chapter-tile {
  color: #111111;
  background: #f1f1f1;
  border-color: #e3e3e3;
}

html[data-theme='light'] .chapter-tile:hover,
html[data-theme='light'] .chapter-tile:focus-visible {
  color: #ffffff;
  background: #111111;
  border-color: #111111;
}

html[data-theme='light'] .chapter-tile:hover strong,
html[data-theme='light'] .chapter-tile:focus-visible strong {
  color: rgba(255, 255, 255, 0.72);
}

@keyframes pageIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes seriesTextIn {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes seriesCoverIn {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateX(40px) scale(0.96);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0) scale(1);
  }
}

.reader-page[hidden] {
  display: none;
}

body.is-reader {
  background: var(--reader-bg);
}

body.is-reader .top-nav {
  position: fixed;
  height: 96px;
  padding: 0 28px;
}

body.is-reader .side-rail {
  padding-top: 76px;
}

body.is-reader .brand-mark {
  width: 116px;
  height: 116px;
}

body.is-reader .nav-links a,
body.is-reader .icon-button {
  color: var(--reader-text);
  text-shadow: 0 0 10px color-mix(in srgb, var(--reader-text) 18%, transparent);
}

body.is-reader .icon-button {
  transition: transform 0.18s ease;
}

body.is-reader .icon-button:hover,
body.is-reader .icon-button:focus-visible {
  color: var(--reader-inverse-text);
  background: var(--reader-inverse-bg);
  text-shadow: none;
}

html[data-theme='dark'] body.is-reader .theme-logo {
  content: url('/brand/wolfmanga_transparente.png');
}

html[data-theme='light'] body.is-reader .theme-logo {
  content: url('/brand/wolfmanga_transparente_negro.png');
}

body.is-reader .site-footer {
  display: none;
}

.reader-page {
  --reader-sidebar-width: 394px;
  min-height: 100vh;
  color: var(--reader-text);
  background: var(--reader-bg);
}

.reader-page.is-sidebar-collapsed {
  --reader-sidebar-width: 118px;
}

.reader-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 55;
  width: var(--reader-sidebar-width);
  padding: 228px 28px 32px;
  overflow-y: auto;
  background: var(--reader-bg);
  transition:
    width 0.28s cubic-bezier(0.2, 0.85, 0.2, 1),
    padding 0.28s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.reader-sidebar::-webkit-scrollbar {
  width: 8px;
}

.reader-sidebar::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--reader-text) 18%, transparent);
  border-radius: 999px;
}

.reader-tools {
  display: flex;
  align-items: center;
  gap: 44px;
  margin-bottom: 40px;
}

.reader-icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--reader-text);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.reader-icon-button:hover,
.reader-icon-button:focus-visible {
  color: var(--reader-inverse-text);
  background: var(--reader-inverse-bg);
  outline: none;
  transform: translateY(-1px);
}

.reader-icon-button svg {
  width: 21px;
  height: 21px;
}

.reader-series-title {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 6px;
  align-items: start;
  max-width: 302px;
  margin-bottom: 20px;
  color: var(--reader-text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.14;
}

.reader-series-title:hover,
.reader-series-title:focus-visible {
  color: var(--reader-text);
  outline: none;
}

.reader-series-title svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  stroke-width: 4;
  transition: transform 0.2s ease;
}

.reader-series-title:hover svg,
.reader-series-title:focus-visible svg {
  transform: translateX(-5px);
}

.reader-series-title,
.reader-chapter-list {
  transition:
    opacity 0.2s ease,
    transform 0.25s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.reader-page.is-sidebar-collapsed .reader-series-title,
.reader-page.is-sidebar-collapsed .reader-chapter-list {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
}

.reader-page.is-sidebar-collapsed .reader-sidebar {
  padding-left: 16px;
  padding-right: 16px;
}

.reader-page.is-sidebar-collapsed .reader-tools {
  gap: 10px;
}

.reader-collapse-button svg {
  transition:
    opacity 0.2s ease,
    transform 0.22s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.reader-page.is-sidebar-collapsed .reader-collapse-button svg {
  transform: translateX(2px);
}

.reader-chapter-list {
  display: grid;
  gap: 21px;
  padding-bottom: 40px;
}

.reader-chapter {
  width: 301px;
  height: 93px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px 17px;
  color: var(--reader-text);
  background: var(--reader-surface);
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.reader-chapter strong {
  font-size: 20px;
  line-height: 1.05;
}

.reader-chapter span {
  overflow: hidden;
  color: var(--reader-muted);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-chapter:hover,
.reader-chapter:focus-visible,
.reader-chapter.is-active {
  color: var(--reader-inverse-text);
  background: var(--reader-inverse-bg);
  outline: none;
}

.reader-chapter:hover span,
.reader-chapter:focus-visible span,
.reader-chapter.is-active span {
  color: color-mix(in srgb, var(--reader-inverse-text) 72%, transparent);
}

.reader-stage {
  position: relative;
  min-height: 100vh;
  margin-left: var(--reader-sidebar-width);
  padding: 58px 0 96px;
  background: var(--reader-bg);
  transition: margin-left 0.28s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.reader-canvas {
  width: calc(100vw - var(--reader-sidebar-width));
  min-height: calc(100vh - 154px);
  display: grid;
  place-items: start center;
  align-content: start;
  transition: width 0.28s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.reader-canvas.is-fit-width .reader-image {
  width: min(884px, 100%);
  height: auto;
}

.reader-canvas.is-fit-screen {
  min-height: calc(100vh - 154px);
  place-items: center;
}

.reader-canvas.is-fit-screen .reader-image {
  width: auto;
  max-width: min(884px, 100%);
  max-height: calc(100vh - 104px);
  object-fit: contain;
}

.reader-canvas.is-vertical {
  gap: 0;
  padding-bottom: 80px;
}

.reader-canvas.is-vertical .reader-image {
  width: min(884px, 100%);
  height: auto;
}

.reader-image {
  display: block;
  margin: 0 auto;
  border-radius: 0;
  background: #ffffff;
  animation: readerImageIn 0.26s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.reader-empty {
  width: min(460px, calc(100% - 40px));
  display: grid;
  justify-items: center;
  gap: 16px;
  margin: 22vh auto 0;
  color: #a0a0a0;
  text-align: center;
}

.reader-empty img {
  width: 180px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
}

.reader-click-zone {
  position: fixed;
  top: 96px;
  bottom: 0;
  z-index: 25;
  width: calc((100vw - var(--reader-sidebar-width)) / 2);
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition:
    left 0.28s cubic-bezier(0.2, 0.85, 0.2, 1),
    width 0.28s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.reader-click-zone.is-left {
  left: var(--reader-sidebar-width);
}

.reader-click-zone.is-right {
  right: 0;
}

.reader-pager-zone {
  position: fixed;
  left: calc(var(--reader-sidebar-width) + ((100vw - var(--reader-sidebar-width)) / 2));
  bottom: 0;
  z-index: 80;
  width: 260px;
  height: 72px;
  display: grid;
  place-items: end center;
  padding-bottom: 8px;
  transform: translateX(-50%);
  transition: left 0.28s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.reader-pager {
  position: relative;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--reader-inverse-text);
  background: var(--reader-inverse-bg);
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.18s ease,
    transform 0.22s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.reader-page.show-pager .reader-pager,
.reader-pager-zone:hover .reader-pager,
.reader-pager-zone:focus-within .reader-pager {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.reader-pager button {
  width: 22px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--reader-inverse-text);
  background: transparent;
  cursor: pointer;
}

.reader-pager button:disabled {
  cursor: default;
  opacity: 0.3;
}

.reader-pager svg {
  width: 19px;
  height: 19px;
}

.reader-pager span {
  min-width: 48px;
  color: var(--reader-inverse-text);
  font-weight: 500;
  text-align: center;
}

.reader-settings-overlay[hidden] {
  display: none;
}

.reader-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--reader-overlay);
  backdrop-filter: blur(8px);
}

.reader-settings-panel {
  position: relative;
  width: min(756px, 100%);
  display: grid;
  gap: 22px;
  padding: 34px 32px 38px;
  color: var(--reader-text);
  background: var(--reader-panel);
  border-radius: 4px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.reader-settings-panel h2,
.reader-settings-panel h3 {
  margin: 0;
  color: var(--reader-text);
}

.reader-settings-panel h2 {
  font-size: 24px;
}

.reader-settings-panel h3 {
  margin-top: 6px;
  font-size: 18px;
}

.reader-settings-close {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--reader-text);
  background: transparent;
  cursor: pointer;
}

.reader-settings-close svg {
  width: 22px;
  height: 22px;
}

.reader-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reader-settings-grid.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reader-setting-option {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  color: var(--reader-text);
  background: var(--reader-surface);
  border-radius: 8px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.reader-setting-option span {
  width: 10px;
  height: 10px;
  display: inline-block;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.reader-setting-option:hover,
.reader-setting-option:focus-visible,
.reader-setting-option.is-active {
  color: var(--reader-inverse-text);
  background: var(--reader-inverse-bg);
  outline: none;
  transform: translateY(-1px);
}

.reader-setting-option:hover span,
.reader-setting-option:focus-visible span,
.reader-setting-option.is-active span {
  border-color: var(--reader-inverse-text);
  box-shadow: inset 0 0 0 3px var(--reader-inverse-bg);
  background: var(--reader-inverse-text);
}

@keyframes readerImageIn {
  from {
    opacity: 0.42;
    filter: blur(2px);
    transform: translateX(var(--reader-page-shift, 18px));
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }
}

.reader-pages {
  display: grid;
  gap: 10px;
  padding: 24px;
  max-height: 78vh;
  overflow: auto;
  background: var(--bg-deep);
}

.reader-pages img {
  width: min(100%, 980px);
  margin: 0 auto;
  border-radius: 4px;
}

.empty-reader {
  min-height: 380px;
  display: grid;
  place-items: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
}

.empty-reader img {
  width: min(320px, 70vw);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.site-footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  overflow: hidden;
  padding: 58px 40px 58px 140px;
  color: #f5f5f5;
  background:
    radial-gradient(circle at 18% 20%, rgba(77, 170, 240, 0.2), transparent 28%),
    linear-gradient(135deg, #050505 0%, #111111 58%, #050505 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand,
.footer-links {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.footer-brand {
  gap: 18px;
}

.footer-brand img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.42));
}

.footer-brand strong,
.footer-brand span {
  display: block;
}

.footer-brand strong {
  color: #ffffff;
  font-size: 21px;
}

.footer-brand span {
  max-width: 440px;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
}

.footer-links {
  gap: 26px;
  font-weight: 700;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.76);
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: #ffffff;
  transform: translateY(-1px);
}

.private-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 14%, rgba(77, 170, 240, 0.18), transparent 26%),
    radial-gradient(circle at 88% 86%, rgba(246, 183, 45, 0.12), transparent 24%),
    var(--bg);
}

.private-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  display: grid;
  align-items: center;
  margin: 0 auto;
  padding: 48px 0;
}

.login-panel {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(210px, 0.86fr) minmax(280px, 1fr);
  gap: 18px 36px;
  align-items: center;
  justify-self: center;
  padding: 38px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel > .eyebrow,
.login-panel > h1,
.private-logo {
  grid-column: 1;
}

.login-form,
#loginStatus {
  grid-column: 2;
}

.private-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin-bottom: 4px;
}

.login-panel h1,
.private-dashboard h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(36px, 5vw, 54px);
  line-height: 0.95;
}

.login-form {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.private-dashboard {
  display: grid;
  gap: 28px;
}

.private-dashboard[hidden],
.login-panel[hidden] {
  display: none;
}

.private-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.private-brand,
.private-actions {
  display: flex;
  align-items: center;
}

.private-brand {
  gap: 12px;
  font-family: 'Outfit', Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
}

.private-brand img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.private-actions {
  gap: 12px;
}

.admin-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 254px minmax(0, 1fr);
  color: var(--text);
  background:
    radial-gradient(circle at 80% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28%),
    var(--bg);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 34px;
  padding: 30px 20px;
  background: color-mix(in srgb, var(--bg-deep) 92%, transparent);
  border-right: 1px solid var(--line);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', Arial, sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.admin-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.admin-nav button {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.admin-nav button:hover,
.admin-nav button:focus-visible,
.admin-nav button.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 9%, transparent);
  outline: none;
  transform: translateX(3px);
}

.admin-nav svg {
  width: 19px;
  height: 19px;
}

.admin-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 26px;
  padding: 32px clamp(24px, 4vw, 58px) 64px;
}

.admin-topbar {
  align-items: flex-start;
}

.admin-topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(40px, 5vw, 62px);
}

.admin-toast {
  position: fixed;
  top: 22px;
  left: calc(254px + (100vw - 254px) / 2);
  z-index: 260;
  min-height: 44px;
  max-width: min(520px, calc(100vw - 308px));
  margin: 0;
  padding: 12px 18px;
  display: grid;
  place-items: center;
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 48%),
    color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.26);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -18px) scale(0.96);
  transition:
    opacity 0.24s ease,
    transform 0.32s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.admin-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.admin-toast.is-leaving {
  opacity: 0;
  transform: translate(-50%, -10px) scale(0.985);
}

.admin-toast.is-error {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 96, 96, 0.22), transparent 48%),
    #301616;
  border-color: rgba(255, 107, 107, 0.36);
}

.admin-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.admin-confirm-overlay.is-open {
  opacity: 1;
}

.admin-confirm-overlay.is-leaving {
  opacity: 0;
}

.admin-confirm-dialog {
  width: min(520px, 100%);
  display: grid;
  gap: 20px;
  padding: 28px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, #d93636 16%, transparent), transparent 42%),
    var(--surface);
  border: 1px solid color-mix(in srgb, #d93636 28%, var(--line));
  border-radius: 14px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.24s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.admin-confirm-overlay.is-open .admin-confirm-dialog {
  transform: translateY(0) scale(1);
}

.confirm-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #d93636;
  border-radius: 999px;
}

.admin-confirm-dialog h2 {
  margin: 2px 0 8px;
  font-size: 30px;
}

.admin-confirm-dialog p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.danger-confirm,
.danger-confirm:hover,
.danger-confirm:focus-visible {
  color: #fff;
  background: #d93636;
}

.admin-section-panel {
  display: none;
  gap: 24px;
  animation: adminPanelIn 0.28s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.admin-section-panel.is-active {
  display: grid;
}

.admin-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
}

.admin-section-heading h2 {
  margin-top: 2px;
  font-size: clamp(34px, 4vw, 48px);
}

.admin-section-heading p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-stats article,
.admin-card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.admin-stats article {
  display: grid;
  gap: 9px;
  padding: 20px;
}

.admin-stats svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.admin-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-stats strong {
  font-size: 30px;
  line-height: 1;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
}

.admin-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
}

.admin-form.wide {
  width: min(1120px, 100%);
}

.three-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.four-fields {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 0.8fr 1.3fr;
  gap: 14px;
}

.check-row {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  padding: 0 4px 5px;
  color: var(--text);
}

.check-row input {
  width: 18px;
  height: 18px;
}

.drop-field {
  position: relative;
  min-height: 192px;
  align-content: start;
  overflow: hidden;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.drop-field:hover,
.drop-field.is-dragging {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
  border-color: var(--accent);
  transform: translateY(-1px);
}

.drop-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.drop-field span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.drop-field img {
  width: 100%;
  height: 124px;
  object-fit: cover;
  border-radius: 6px;
}

.background-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.background-preview {
  position: relative;
  height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--text) 7%, transparent) 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(135deg, transparent 75%, color-mix(in srgb, var(--text) 7%, transparent) 75%) 0 0 / 24px 24px,
    var(--bg-deep);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.background-preview.is-dragging {
  cursor: grabbing;
}

.background-editor[data-background-preview='series'] .background-preview {
  height: 260px;
  background:
    linear-gradient(90deg, var(--bg-deep) 0 42%, color-mix(in srgb, var(--bg-deep) 72%, transparent) 68%, transparent),
    linear-gradient(0deg, var(--bg-deep) 0%, transparent 28%),
    var(--preview-bg, none) var(--preview-bg-x, 50%) var(--preview-bg-y, 50%) /
      auto calc(100% * var(--preview-bg-zoom, 1)) no-repeat,
    var(--bg-deep);
}

.background-editor[data-background-preview='series'] .background-preview img {
  opacity: 0.28;
}

.background-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  pointer-events: none;
  will-change: transform;
}

.background-editor input[type='range'] {
  padding: 0;
  accent-color: var(--accent);
}

.background-editor small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.crop-open-button {
  justify-self: start;
}

.crop-dialog {
  width: min(1180px, calc(100vw - 34px));
  max-height: calc(100vh - 34px);
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
}

.crop-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
}

.crop-dialog-shell {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 2.5vw, 28px);
  background:
    radial-gradient(circle at 76% 8%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 34%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.55);
}

.crop-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.crop-dialog-header h2 {
  margin-top: 3px;
  font-size: clamp(30px, 4vw, 48px);
}

.crop-dialog .reader-settings-close {
  position: static;
  width: 42px;
  height: 42px;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 999px;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.crop-dialog .reader-settings-close:hover,
.crop-dialog .reader-settings-close:focus-visible {
  color: var(--bg);
  background: var(--text);
  outline: none;
  transform: rotate(8deg);
}

.crop-stage {
  position: relative;
  min-height: min(58vh, 560px);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--text) 7%, transparent) 25%, transparent 25%) 0 0 / 28px 28px,
    linear-gradient(135deg, transparent 75%, color-mix(in srgb, var(--text) 7%, transparent) 75%) 0 0 / 28px 28px,
    var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.crop-stage.is-dragging {
  cursor: grabbing;
}

.crop-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  will-change: transform;
}

.crop-dialog[data-crop-mode='slider'] .crop-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg-deep) 0 24%, color-mix(in srgb, var(--bg-deep) 70%, transparent) 42%, transparent 70%),
    linear-gradient(0deg, var(--bg-deep) 0, transparent 34%);
  pointer-events: none;
}

.crop-dialog[data-crop-mode='series'] .crop-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg-deep) 0 46%, color-mix(in srgb, var(--bg-deep) 76%, transparent) 70%, transparent),
    linear-gradient(0deg, var(--bg-deep) 0, transparent 28%);
  pointer-events: none;
}

.crop-stage-copy {
  position: absolute;
  left: clamp(22px, 4vw, 54px);
  bottom: clamp(22px, 4vw, 52px);
  z-index: 2;
  max-width: min(520px, 54%);
  display: grid;
  gap: 5px;
  color: #fff;
  text-shadow: 0 5px 22px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.crop-stage-copy small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  font-weight: 800;
}

.crop-stage-copy strong {
  font-family: 'Outfit', Arial, sans-serif;
  font-size: clamp(34px, 5vw, 78px);
  line-height: 0.95;
}

.crop-controls {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
}

.crop-controls input[type='range'] {
  padding: 0;
  accent-color: var(--accent);
}

.crop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list.compact {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.admin-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 8px;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.admin-row:hover,
.admin-row:focus-visible {
  background: color-mix(in srgb, var(--text) 9%, var(--surface-soft));
  outline: none;
  transform: translateY(-1px);
}

.admin-row img {
  width: 52px;
  height: 68px;
  object-fit: cover;
  border-radius: 5px;
}

.admin-row strong,
.admin-row small {
  display: block;
}

.admin-row strong {
  line-height: 1.15;
}

.admin-row small,
.admin-empty {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.slide-admin-card,
.chapter-admin-card,
.library-item {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 8px;
}

.slide-admin-card {
  grid-template-columns: 84px minmax(0, 1fr) auto;
}

.slide-admin-card img,
.chapter-admin-card img,
.library-item img {
  object-fit: cover;
  border-radius: 6px;
}

.slide-admin-card img {
  width: 84px;
  height: 58px;
}

.slide-admin-card strong,
.slide-admin-card small,
.slide-admin-card em,
.chapter-admin-card strong,
.chapter-admin-card span,
.chapter-admin-card small,
.library-item strong,
.library-item span,
.library-item small {
  display: block;
}

.slide-admin-card small,
.chapter-admin-card span,
.chapter-admin-card small,
.library-item span,
.library-item small {
  color: var(--muted);
  line-height: 1.35;
}

.slide-admin-card em {
  margin-top: 5px;
  color: var(--accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.slide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.slide-actions button {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 11px;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.slide-actions button:hover,
.slide-actions button:focus-visible {
  color: var(--bg);
  background: var(--text);
  outline: none;
}

.slide-actions button:disabled {
  cursor: default;
  opacity: 0.35;
}

.slide-actions svg {
  width: 16px;
  height: 16px;
}

.chapter-admin-list {
  max-height: 580px;
  overflow: auto;
  padding-right: 4px;
}

.chapter-admin-card {
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
}

.chapter-admin-card img {
  width: 58px;
  height: 76px;
}

.danger-button:hover,
.danger-button:focus-visible {
  color: #fff;
  background: #d93636;
}

.page-uploader {
  min-height: 176px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.page-uploader:hover,
.page-uploader:focus-visible,
.page-uploader.is-dragging {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
  border-color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

.page-uploader svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.page-uploader strong {
  color: var(--text);
  font-size: 18px;
}

.page-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.page-preview {
  position: relative;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
}

.page-preview:active {
  cursor: grabbing;
}

.page-preview.is-existing {
  cursor: default;
  opacity: 0.72;
}

.page-preview img {
  width: 100%;
  height: 156px;
  object-fit: cover;
}

.page-preview strong {
  position: absolute;
  left: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  color: var(--bg);
  background: var(--text);
  border-radius: 999px;
}

.page-preview button {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--bg);
  background: var(--text);
  border-radius: 999px;
  cursor: pointer;
}

.page-preview button svg {
  width: 16px;
  height: 16px;
}

.admin-library {
  display: grid;
  gap: 12px;
}

.brand-settings-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.favicon-current {
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 18px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 800;
}

.favicon-current img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  padding: 10px;
  background: #fff;
  border-radius: 16px;
}

.library-item {
  grid-template-columns: 70px minmax(0, 1fr) auto auto auto;
}

.library-item img {
  width: 70px;
  height: 92px;
}

@keyframes adminPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1100px) {
  .content-section > h2,
  .section-heading,
  .manga-grid,
  .popular-grid,
  .series-strip,
  .admin-intro,
  .admin-grid,
  .toast-line {
    grid-column: 3 / -1;
  }

  .hero-copy {
    grid-column: 3 / 15;
  }

  .hero-art {
    right: 0;
    width: min(67vw, 760px);
  }

  #discover .section-heading,
  #discover .manga-grid {
    grid-column: 3 / -1;
    width: 100%;
    justify-self: stretch;
  }

  #discover .manga-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .explore-page {
    padding-left: 136px;
  }

  .explore-popular-strip {
    width: calc(100vw - 160px);
  }

  .series-hero {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 46px;
    padding: 112px 34px 76px 136px;
  }

  .series-copy h1 {
    font-size: clamp(54px, 8vw, 86px);
  }

  .series-chapters {
    width: min(930px, calc(100% - 180px));
    margin-right: 34px;
    padding: 36px 0 84px;
  }

  .chapter-grid {
    grid-template-columns: repeat(auto-fit, 290px);
  }
}

@media (max-width: 800px) {
  .side-rail {
    position: fixed;
    width: 92px;
    padding-top: 86px;
  }

  .brand-mark {
    width: 72px;
    height: 72px;
  }

  .top-nav {
    min-height: 92px;
    height: auto;
    grid-template-columns: 1fr;
    padding: 16px 18px 16px 92px;
  }

  .nav-links {
    gap: 17px;
    overflow-x: auto;
  }

  .nav-actions {
    justify-content: space-between;
  }

  .search-modal {
    padding: 72px 14px 14px;
  }

  .search-panel {
    padding: 22px;
  }

  .search-field input {
    min-height: 58px;
    font-size: 18px;
  }

  .search-results {
    grid-template-columns: 1fr;
  }

  .crop-dialog {
    width: calc(100vw - 18px);
  }

  .crop-dialog-shell {
    padding: 16px;
  }

  .crop-stage {
    min-height: 420px;
  }

  .crop-controls {
    grid-template-columns: 1fr;
  }

  .crop-actions {
    justify-content: stretch;
  }

  .crop-actions button {
    flex: 1 1 150px;
  }

  .hero {
    --hero-fixed-height: 780px;
    --hero-copy-y: 0px;
    height: var(--hero-fixed-height);
    min-height: var(--hero-fixed-height);
    max-height: var(--hero-fixed-height);
    display: block;
    padding: 44px 20px 88px;
  }

  .hero-copy {
    --hero-actions-top: 318px;
    height: 430px;
    max-width: none;
  }

  .hero-art {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 74px;
    width: 100%;
    height: 360px;
    max-height: 360px;
    margin-top: 0;
  }

  .hero-art img {
    object-position: center bottom;
  }

  .hero-controls {
    right: 20px;
    bottom: 28px;
  }

  .hero-copy .dots {
    top: calc(var(--hero-actions-top) + 76px);
  }

  .series-page {
    overflow: clip;
  }

  .series-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 118px 20px 58px 92px;
  }

  .series-backdrop {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--bg) 74%, transparent) 0%, var(--bg) 72%),
      var(--series-image) center top / min(88vw, 480px) no-repeat;
    opacity: 0.18;
  }

  .series-hero::before {
    background:
      radial-gradient(circle at 70% 12%, color-mix(in srgb, var(--series-accent) 28%, transparent), transparent 36%),
      linear-gradient(180deg, transparent 0 18%, var(--bg) 72%);
  }

  .series-copy {
    max-width: 100%;
  }

  .back-link {
    margin-bottom: 24px;
  }

  .series-copy h1 {
    font-size: clamp(44px, 14vw, 68px);
  }

  .series-description {
    font-size: 17px;
  }

  .series-facts {
    grid-template-columns: 1fr;
    margin-top: 30px;
  }

  .series-cover-card {
    justify-self: start;
    width: min(78vw, 300px);
  }

  .series-chapters {
    width: auto;
    margin: 0;
    padding: 44px 20px 72px 92px;
  }

  .chapter-grid {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 14px;
  }

  .chapter-tile {
    width: 100%;
  }

  .reader-sidebar {
    position: relative;
    width: auto;
    min-height: auto;
    padding: 126px 20px 28px 92px;
  }

  .reader-tools {
    margin-bottom: 28px;
  }

  .reader-chapter-list {
    grid-template-columns: 1fr;
    max-height: 310px;
    overflow: auto;
  }

  .reader-chapter {
    width: 100%;
  }

  .reader-stage {
    margin-left: 0;
    padding-top: 20px;
  }

  .reader-click-zone {
    top: 0;
    width: 50vw;
  }

  .reader-click-zone.is-left {
    left: 0;
  }

  .reader-click-zone.is-right {
    right: 0;
  }

  .reader-canvas {
    width: 100vw;
    min-height: calc(100vh - 118px);
  }

  .reader-canvas.is-fit-width .reader-image,
  .reader-canvas.is-vertical .reader-image {
    width: min(100vw, 884px);
  }

  .reader-pager {
    left: 50%;
  }

  .reader-settings-grid,
  .reader-settings-grid.is-two {
    grid-template-columns: 1fr;
  }

  .content-section {
    display: block;
    padding: 54px 20px;
  }

  .explore-page {
    padding: 138px 20px 80px 92px;
  }

  .explore-popular-strip {
    width: calc(100vw - 112px);
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .explore-rank-card {
    flex-basis: 260px;
  }

  .explore-toolbar {
    flex-wrap: wrap;
    margin-top: 42px;
  }

  .explore-count {
    flex: 1 0 100%;
    margin-left: 0;
    padding-top: 0;
  }

  .explore-filter-menu {
    width: min(320px, calc(100vw - 112px));
  }

  .explore-grid {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  }

  .explore-card-details {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-bar {
    max-width: 100%;
  }

  .manga-grid,
  .popular-grid,
  .series-strip,
  .admin-grid {
    margin-top: 24px;
  }

  #discover .manga-grid {
    grid-template-columns: 1fr;
  }

  .read-overlay {
    opacity: 1;
  }

  .popular-grid,
  .admin-grid,
  .two-fields,
  .file-row,
  .dialog-hero,
  .chapter-row {
    grid-template-columns: 1fr;
  }

  .dialog-hero {
    padding: 24px;
  }

  .dialog-cover {
    max-width: 220px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 44px 20px;
  }

  .footer-brand {
    align-items: flex-start;
  }

  .private-shell {
    width: min(100% - 28px, 1180px);
    padding: 24px 0;
  }

  .login-panel {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .login-panel > .eyebrow,
  .login-panel > h1,
  .private-logo,
  .login-form,
  #loginStatus {
    grid-column: 1;
  }

  .private-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .private-actions {
    flex-wrap: wrap;
  }
}

@media (hover: none) {
  .read-overlay {
    opacity: 1;
  }

  .explore-more-button {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 440px) {
  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .hero {
    --hero-fixed-height: 720px;
  }

  .hero-copy {
    --hero-actions-top: 326px;
    height: 418px;
  }

  .hero-art {
    height: 300px;
    max-height: 300px;
  }

  .hero-actions {
    gap: 14px;
  }

  .series-hero {
    padding-left: 78px;
  }

  .series-copy h1 {
    font-size: 42px;
  }

  .series-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .series-actions .primary-button,
  .series-actions .ghost-button {
    justify-content: center;
    width: 100%;
  }

  .series-chapters {
    padding-left: 78px;
  }
}

@media (max-width: 980px) {
  .admin-body {
    grid-template-columns: 1fr;
  }

  .admin-toast {
    left: 50%;
    max-width: calc(100vw - 28px);
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: auto;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    padding: 14px;
  }

  .admin-brand span {
    display: none;
  }

  .admin-brand img {
    width: 46px;
    height: 46px;
  }

  .admin-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .admin-nav button {
    flex: 0 0 auto;
  }

  .admin-main {
    padding: 24px 16px 48px;
  }

  .admin-section-heading,
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-stats,
  .admin-split,
  .three-fields,
  .four-fields,
  .brand-settings-grid {
    grid-template-columns: 1fr;
  }

  .slide-admin-card,
  .library-item {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .slide-actions,
  .library-item .ghost-button {
    grid-column: 1 / -1;
    justify-content: start;
  }
}
