:root {
  --bg: #f2ebff;
  --bg-strong: #fcf9ff;
  --ink: #1f1630;
  --muted: #685b83;
  --line: rgba(74, 44, 130, 0.14);
  --card: rgba(252, 249, 255, 0.9);
  --brand: #7a3ff2;
  --brand-strong: #4e2a93;
  --brand-soft: #e8dcff;
  --gold: #c7a6ff;
  --shadow: 0 18px 40px rgba(68, 40, 118, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(168, 85, 247, 0.28), transparent 26%),
    radial-gradient(circle at right center, rgba(124, 58, 237, 0.2), transparent 22%),
    linear-gradient(180deg, #fdfaff 0%, #f4eeff 45%, #ece2ff 100%);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body.age-gate-open {
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  filter: blur(16px);
  pointer-events: none;
}

body::before {
  width: 240px;
  height: 240px;
  top: -60px;
  right: 6%;
  background: rgba(124, 58, 237, 0.16);
}

body::after {
  width: 180px;
  height: 180px;
  left: 3%;
  bottom: 8%;
  background: rgba(192, 132, 252, 0.2);
}

.reader-page::before,
.reader-page::after {
  display: none;
}

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

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar,
.hero,
.dashboard-grid,
.detail-grid,
.admin-grid {
  display: grid;
  gap: 20px;
}

.topbar {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  margin-bottom: 24px;
  border-radius: 28px;
  background: rgba(255, 249, 255, 0.68);
  border: 1px solid rgba(78, 42, 147, 0.1);
  box-shadow: 0 14px 36px rgba(68, 40, 118, 0.08);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 14px;
  z-index: 40;
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-brand {
  display: grid;
  gap: 4px;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 16px;
  border: 1px solid rgba(78, 42, 147, 0.12);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(68, 40, 118, 0.08);
  color: var(--brand-strong);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.topbar.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.topbar.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.topbar.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(78, 42, 147, 0.08);
}

.nav-links a,
.link-button {
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.nav-links a:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.brand-link {
  color: var(--ink);
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo-link img {
  display: block;
  width: auto;
  height: clamp(68px, 8vw, 110px);
  object-fit: contain;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 600;
}

.nav-link:hover {
  background: rgba(122, 63, 242, 0.08);
  border-color: rgba(122, 63, 242, 0.14);
}

.nav-link-strong {
  background: linear-gradient(135deg, rgba(122, 63, 242, 0.16), rgba(255, 213, 244, 0.44));
  border-color: rgba(122, 63, 242, 0.14);
}

.site-advisory {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 24px;
  border-radius: 22px;
  border: 1px solid rgba(128, 42, 78, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 208, 225, 0.28), transparent 34%),
    rgba(255, 249, 252, 0.84);
  box-shadow: 0 14px 30px rgba(86, 35, 73, 0.08);
}

.site-advisory-copy {
  display: grid;
  gap: 4px;
}

.site-advisory-copy strong,
.site-advisory-copy p {
  margin: 0;
}

.site-advisory-copy p {
  color: var(--muted);
  line-height: 1.45;
}

.site-advisory-badge,
.content-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 48px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(122, 63, 242, 0.18), rgba(226, 91, 146, 0.18));
  color: #8f1f52;
  border: 1px solid rgba(177, 60, 101, 0.18);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.content-warning-inline,
.content-warning-box,
.reader-warning {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(128, 42, 78, 0.12);
  background: rgba(255, 247, 250, 0.8);
}

.content-warning-inline {
  margin-bottom: 16px;
}

.content-warning-inline p,
.content-warning-box,
.reader-warning p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.content-warning-box {
  margin-top: 14px;
}

.reader-warning {
  margin-top: 16px;
  margin-bottom: 16px;
}

.age-gate-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1600;
  place-items: center;
  padding: 24px;
  background: rgba(26, 14, 41, 0.64);
  backdrop-filter: blur(8px);
}

.age-gate-modal.is-visible {
  display: grid;
}

.age-gate-dialog {
  width: min(560px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(128, 42, 78, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 210, 229, 0.24), transparent 36%),
    rgba(255, 252, 255, 0.96);
  box-shadow: 0 28px 60px rgba(28, 16, 46, 0.28);
}

.age-gate-badge {
  min-width: 60px;
}

.age-gate-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.age-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.eyebrow,
.panel-label,
.hero-kicker,
.stat-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0 0 8px;
}

h1,
h2,
h3,
h4 {
  font-family: Georgia, "Palatino Linotype", serif;
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h2 {
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1;
  max-width: 12ch;
}

.hero h2 {
  font-size: clamp(1.3rem, 2vw, 2.1rem);
  line-height: 1.12;
  max-width: 18ch;
  font-family: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.01em;
}

h3 {
  font-size: 1.8rem;
}

h4 {
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.hero {
  grid-template-columns: 1.5fr 0.9fr;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-copy {
  border-radius: 36px;
  padding: 34px;
}

.hero-text,
.info-box,
.catalog-description,
.chapter-line,
.mini-card p,
.form-note {
  color: var(--muted);
  line-height: 1.55;
}

.hero-actions,
.catalog-tools,
.detail-actions,
.card-footer,
.chapter-actions,
.stack-links,
.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-note,
.info-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(78, 42, 147, 0.1);
}

.hero-card {
  border-radius: 32px;
  padding: 24px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.hero-visual {
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(122, 63, 242, 0.14), rgba(234, 217, 255, 0.9));
  border: 1px solid rgba(78, 42, 147, 0.08);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-visual-inline {
  margin: 22px 0 8px;
  /*max-width: 540px;*/
}

.hero-visual-inline img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  max-height: 320px;
}

.stat-card {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  padding: 20px;
  border: 1px solid rgba(78, 42, 147, 0.1);
}

.stat-card strong {
  display: block;
  font-size: 2.4rem;
  margin: 8px 0;
  color: var(--brand-strong);
}

.stat-card.accent {
  background: linear-gradient(145deg, rgba(122, 63, 242, 0.14), rgba(199, 166, 255, 0.28));
}

.dashboard-grid {
  grid-template-columns: 320px 1fr;
  margin-bottom: 24px;
}

.detail-grid {
  grid-template-columns: 1.15fr 0.85fr;
  margin-bottom: 24px;
}

.full-width-grid {
  grid-template-columns: 1fr;
}

.single-column {
  grid-template-columns: 1fr;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel-heading {
  margin-bottom: 18px;
}

.extra-top {
  margin-top: 24px;
}

.split-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form p {
  display: grid;
  gap: 7px;
  margin: 0;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(78, 42, 147, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(122, 63, 242, 0.24);
  border-color: var(--brand);
}

button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.ghost-button,
.chip-button,
.chapter-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 11px 16px;
  border-radius: 999px;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand) 0%, #9f67ff 100%);
  color: white;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.76);
  color: var(--brand-strong);
  border: 1px solid rgba(78, 42, 147, 0.14);
}

.ghost-button,
.chip-button,
.chapter-button {
  background: transparent;
  border: 1px solid rgba(78, 42, 147, 0.14);
  color: var(--brand-strong);
}

.wide {
  width: 100%;
}

.catalog-list,
.mini-list {
  display: grid;
  gap: 14px;
}

.catalog-sections {
  display: grid;
  gap: 26px;
}

.catalog-section {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(78, 42, 147, 0.12);
  box-shadow: 0 22px 48px rgba(68, 40, 118, 0.08);
  overflow: hidden;
}

.section-manhwa {
  background:
    radial-gradient(circle at top left, rgba(255, 177, 207, 0.3), transparent 28%),
    linear-gradient(180deg, rgba(255, 241, 247, 0.98) 0%, rgba(255, 247, 250, 0.92) 22%, rgba(255, 255, 255, 0.74) 100%);
}

.section-manga {
  background:
    radial-gradient(circle at top left, rgba(130, 171, 255, 0.26), transparent 28%),
    linear-gradient(180deg, rgba(241, 245, 255, 0.98) 0%, rgba(245, 248, 255, 0.92) 22%, rgba(255, 255, 255, 0.74) 100%);
}

.section-book {
  background:
    radial-gradient(circle at top left, rgba(177, 132, 255, 0.26), transparent 28%),
    linear-gradient(180deg, rgba(246, 241, 255, 0.98) 0%, rgba(248, 245, 255, 0.92) 22%, rgba(255, 255, 255, 0.76) 100%);
}

.section-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 6px 4px 4px;
}

.section-header {
  display: grid;
  gap: 10px;
}

.section-header h4 {
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  margin-bottom: 0;
}

.section-description {
  max-width: 58ch;
  font-size: 1rem;
}

.section-count {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-strong);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(78, 42, 147, 0.1);
  box-shadow: 0 10px 24px rgba(68, 40, 118, 0.08);
}

.section-rule {
  height: 5px;
  width: 100%;
  border-radius: 999px;
  opacity: 0.95;
}

.section-rule-manhwa {
  background: linear-gradient(90deg, rgba(226, 91, 146, 0.92), rgba(255, 199, 220, 0.22));
}

.section-rule-manga {
  background: linear-gradient(90deg, rgba(82, 118, 228, 0.92), rgba(189, 211, 255, 0.22));
}

.section-rule-book {
  background: linear-gradient(90deg, rgba(121, 70, 210, 0.92), rgba(214, 196, 255, 0.22));
}

.catalog-card,
.mini-card,
.chapter-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(78, 42, 147, 0.08);
  border-radius: 22px;
}

.catalog-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  overflow: hidden;
  border-width: 1px;
  border-left-width: 5px;
  box-shadow: 0 14px 28px rgba(68, 40, 118, 0.06);
}

.catalog-card.card-manhwa {
  border-left-color: #e15b92;
}

.catalog-card.card-manga {
  border-left-color: #5276e4;
}

.catalog-card.card-book {
  border-left-color: #7946d2;
}

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

.cover-art,
.detail-cover {
  background: linear-gradient(160deg, rgba(122, 63, 242, 0.24), rgba(199, 166, 255, 0.34));
  min-height: 100%;
}

.cover-art img,
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-fallback,
.detail-cover-fallback {
  height: 100%;
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--brand-strong);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.45), transparent 35%),
    linear-gradient(145deg, rgba(122, 63, 242, 0.24), rgba(199, 166, 255, 0.38));
}

.catalog-copy {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.chip-row,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(122, 63, 242, 0.08);
  color: var(--brand-strong);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.section-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-pill.type-manhwa,
.section-pill.type-manhwa {
  background: linear-gradient(135deg, rgba(255, 232, 240, 1), rgba(255, 171, 205, 0.96));
  color: #8f1f52;
  border: 1px solid rgba(214, 67, 131, 0.34);
}

.meta-pill.type-manga,
.section-pill.type-manga {
  background: linear-gradient(135deg, rgba(229, 243, 255, 1), rgba(148, 196, 255, 0.96));
  color: #1e4b9e;
  border: 1px solid rgba(55, 113, 230, 0.34);
}

.meta-pill.type-book,
.section-pill.type-book {
  background: linear-gradient(135deg, rgba(255, 245, 223, 1), rgba(255, 217, 137, 0.97));
  color: #8c5a10;
  border: 1px solid rgba(217, 159, 37, 0.34);
}

.meta-pill.meta-neutral {
  background: rgba(122, 63, 242, 0.08);
  color: var(--brand-strong);
  border: 1px solid rgba(122, 63, 242, 0.08);
}

.status-pill {
  background: rgba(199, 166, 255, 0.22);
}

.status-pill.status-ongoing {
  background: linear-gradient(135deg, rgba(226, 247, 233, 1), rgba(165, 231, 183, 0.96));
  color: #216c3b;
  border-color: rgba(71, 171, 105, 0.34);
}

.status-pill.status-complete {
  background: linear-gradient(135deg, rgba(236, 244, 255, 1), rgba(170, 202, 255, 0.96));
  color: #23529b;
  border-color: rgba(84, 131, 223, 0.34);
}

.status-pill.status-paused {
  background: linear-gradient(135deg, rgba(255, 239, 227, 1), rgba(255, 196, 146, 0.96));
  color: #9b5220;
  border-color: rgba(223, 126, 68, 0.34);
}

.detail-content {
  min-height: 220px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}

.detail-cover {
  border-radius: 24px;
  overflow: hidden;
  min-height: 320px;
  height: 20%;
}

.detail-description {
  margin: 14px 0 18px;
  line-height: 1.65;
  color: var(--ink);
}

.chapter-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.chapter-card,
.mini-card {
  padding: 16px;
}

.library-panel {
  overflow: hidden;
}

.library-heading {
  display: grid;
  gap: 22px;
}

@media (min-width: 981px) {
  .library-heading {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    align-items: start;
  }
}

.library-subtitle {
  max-width: 64ch;
  margin-top: 10px;
}

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

.library-stat {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(78, 42, 147, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 28px rgba(68, 40, 118, 0.06);
}

.library-stat strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 2rem;
  color: var(--brand-strong);
}

.library-stat-favorites {
  background:
    radial-gradient(circle at top left, rgba(255, 191, 217, 0.28), transparent 38%),
    rgba(255, 252, 255, 0.82);
}

.library-stat-history {
  background:
    radial-gradient(circle at top left, rgba(171, 197, 255, 0.24), transparent 38%),
    rgba(250, 252, 255, 0.84);
}

.library-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 22px;
}

.library-section {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 30px;
  border: 1px solid rgba(78, 42, 147, 0.12);
  box-shadow: 0 20px 40px rgba(68, 40, 118, 0.08);
}

.library-section-favorites {
  background:
    radial-gradient(circle at top left, rgba(255, 190, 221, 0.3), transparent 34%),
    linear-gradient(180deg, rgba(255, 245, 250, 0.96), rgba(255, 255, 255, 0.8));
}

.library-section-history {
  background:
    radial-gradient(circle at top left, rgba(177, 199, 255, 0.26), transparent 34%),
    linear-gradient(180deg, rgba(245, 248, 255, 0.96), rgba(255, 255, 255, 0.82));
}

.library-section-header h4 {
  margin: 8px 0 0;
  font-size: 1.5rem;
}

.library-pill-favorites {
  background: linear-gradient(135deg, rgba(255, 228, 239, 1), rgba(255, 173, 206, 0.96));
  color: #922456;
  border: 1px solid rgba(214, 67, 131, 0.26);
}

.library-pill-history {
  background: linear-gradient(135deg, rgba(231, 241, 255, 1), rgba(161, 195, 255, 0.96));
  color: #27529a;
  border: 1px solid rgba(72, 121, 219, 0.26);
}

.library-list {
  display: grid;
  gap: 16px;
}

.library-favorite-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.favorite-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 26px;
  border: 1px solid rgba(78, 42, 147, 0.1);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 30px rgba(68, 40, 118, 0.06);
}

.favorite-card-manhwa {
  background:
    radial-gradient(circle at top left, rgba(255, 205, 226, 0.24), transparent 34%),
    rgba(255, 255, 255, 0.9);
}

.favorite-card-manga {
  background:
    radial-gradient(circle at top left, rgba(190, 212, 255, 0.24), transparent 34%),
    rgba(255, 255, 255, 0.9);
}

.favorite-card-book {
  background:
    radial-gradient(circle at top left, rgba(213, 196, 255, 0.24), transparent 34%),
    rgba(255, 255, 255, 0.9);
}

.favorite-card-cover {
  display: block;
  border-radius: 22px;
  overflow: hidden;
  min-height: 0;
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, rgba(122, 63, 242, 0.22), rgba(199, 166, 255, 0.34));
}

.favorite-card-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.favorite-card-copy {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.favorite-card-head {
  display: grid;
  gap: 6px;
}

.favorite-card-title {
  font-size: 1.05rem;
  line-height: 1.32;
  min-height: 2.8em;
}

.favorite-card-author {
  margin: 0;
  color: var(--muted);
}

.favorite-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

.library-entry {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(78, 42, 147, 0.08);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 28px rgba(68, 40, 118, 0.05);
}

.library-entry-favorite {
  border-left: 5px solid #e15b92;
}

.library-entry-history {
  border-left: 5px solid #5276e4;
}

.library-cover {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  min-height: 154px;
  background: linear-gradient(160deg, rgba(122, 63, 242, 0.22), rgba(199, 166, 255, 0.34));
}

.library-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.library-cover-fallback {
  height: 100%;
  min-height: 154px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px 12px;
  text-align: center;
  color: white;
}

.library-cover-fallback span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 1.4rem;
  font-weight: 700;
}

.library-cover-fallback small {
  max-width: 11ch;
  font-size: 0.82rem;
  line-height: 1.35;
  opacity: 0.94;
}

.fallback-manhwa {
  background: linear-gradient(160deg, #f08ab5, #ba5a92);
}

.fallback-manga {
  background: linear-gradient(160deg, #6b8ef0, #4665cb);
}

.fallback-book {
  background: linear-gradient(160deg, #9a71e2, #6d43b8);
}

.library-copy {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.library-copy-head {
  display: grid;
  gap: 6px;
}

.library-copy-head strong {
  font-size: 1.08rem;
  line-height: 1.3;
}

.library-copy-head p,
.library-snippet {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.library-snippet {
  font-size: 0.94rem;
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.library-progress {
  margin-top: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(82, 118, 228, 0.06);
  border: 1px solid rgba(82, 118, 228, 0.1);
}

.library-empty-state {
  gap: 10px;
}

.library-empty-state strong,
.library-empty-state p {
  margin: 0;
}

.home-activity-stack {
  display: grid;
  gap: 16px;
}

.home-activity-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(78, 42, 147, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.home-activity-favorites {
  background:
    radial-gradient(circle at top left, rgba(255, 205, 226, 0.24), transparent 38%),
    rgba(255, 251, 255, 0.82);
}

.home-activity-history {
  background:
    radial-gradient(circle at top left, rgba(187, 208, 255, 0.22), transparent 38%),
    rgba(250, 252, 255, 0.84);
}

.home-activity-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.home-activity-header h4 {
  margin: 6px 0 0;
  font-size: 1.08rem;
}

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

.home-activity-item {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(78, 42, 147, 0.08);
}

.home-activity-cover {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, rgba(122, 63, 242, 0.22), rgba(199, 166, 255, 0.34));
}

.home-activity-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.home-activity-fallback {
  width: 100%;
  height: 100%;
  min-height: 78px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
}

.home-activity-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.home-activity-copy strong {
  font-size: 0.98rem;
  line-height: 1.3;
}

.home-activity-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.home-activity-progress {
  margin-top: 0;
}

.reader-card {
  margin-top: 16px;
}

.mini-card strong {
  display: block;
  margin-bottom: 8px;
}

.mini-card .meta-row {
  margin-bottom: 10px;
}

.pdf-viewer {
  width: 100%;
  min-height: 70vh;
  border: 1px solid rgba(78, 42, 147, 0.12);
  border-radius: 18px;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.pdf-reader-shell {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(78, 42, 147, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.pdf-reader-status {
  margin-bottom: 14px;
  color: var(--brand-strong);
  font-weight: 700;
}

.reader-progress-card,
.reading-progress,
.resume-progress {
  display: grid;
  gap: 8px;
}

.reader-progress-card {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(122, 63, 242, 0.06);
  border: 1px solid rgba(78, 42, 147, 0.08);
}

.reading-progress,
.resume-progress {
  margin-top: 12px;
}

.reading-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.reader-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand-strong);
}

.reader-progress-meta span,
.reading-progress-meta span {
  color: var(--muted);
  font-weight: 600;
}

.reader-progress-track,
.reading-progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(122, 63, 242, 0.12);
}

.reader-progress-fill,
.reading-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #7a3ff2 0%, #e15b92 100%);
  box-shadow: 0 6px 16px rgba(122, 63, 242, 0.24);
  transition: width 220ms ease;
}

.reading-progress-caption {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.pdf-reader {
  display: grid;
  gap: 16px;
  line-height: 0;
}

.pdf-reader-continuous {
  gap: 0;
  overflow: hidden;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(78, 42, 147, 0.08);
}

.pdf-page-flow {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.pdf-page-flow + .pdf-page-flow {
  margin-top: -1px;
}

.pdf-page-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: inherit;
  padding: 24px;
  border-radius: 0;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(246, 241, 255, 0.9), rgba(255, 255, 255, 0.98), rgba(246, 241, 255, 0.9));
  background-size: 200% 100%;
  animation: readerPulse 1.4s ease-in-out infinite;
}

.pdf-page-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pdf-page-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  vertical-align: top;
}

.reader-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(122, 63, 242, 0.08);
  color: var(--brand-strong);
  border: 1px solid rgba(78, 42, 147, 0.1);
}

.reader-note-error {
  margin-top: 0;
  background: rgba(255, 236, 236, 0.92);
  color: #8a2947;
  border-color: rgba(177, 60, 101, 0.18);
}

@keyframes readerPulse {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(78, 42, 147, 0.18);
  border-radius: 20px;
  padding: 18px;
}

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

.automation-panel {
  margin-bottom: 24px;
}

.security-panel {
  margin-bottom: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 149, 211, 0.16), transparent 36%),
    rgba(252, 249, 255, 0.92);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(122, 63, 242, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(232, 220, 255, 0.42));
  box-shadow: 0 14px 28px rgba(68, 40, 118, 0.08);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--brand-strong);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.metric-card-alert {
  border-color: rgba(191, 73, 122, 0.18);
  background: linear-gradient(145deg, rgba(255, 250, 252, 0.92), rgba(255, 222, 234, 0.5));
}

.metric-card-alert strong {
  color: #a12f61;
}

.metric-card-soft {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(222, 239, 255, 0.48));
}

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

.monitoring-suspicious {
  margin-top: 18px;
}

.mini-list h4 {
  margin: 0 0 10px;
}

.compact-mini-card {
  min-height: auto;
  padding: 14px 16px;
}

.compact-mini-card strong {
  overflow-wrap: anywhere;
}

.suspicious-mini-card {
  border-color: rgba(191, 73, 122, 0.16);
  background: linear-gradient(145deg, rgba(255, 250, 252, 0.96), rgba(255, 237, 243, 0.74));
}

.visit-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.visit-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.visit-chip-alert {
  color: #a12f61;
  background: rgba(255, 214, 228, 0.92);
  border: 1px solid rgba(191, 73, 122, 0.18);
}

.visit-user-agent {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.automation-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.stack-form .helptext {
  color: var(--muted);
  font-size: 0.92rem;
}

.stack-form input[type="file"] {
  padding: 12px;
  background: rgba(122, 63, 242, 0.05);
}

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

.auth-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.auth-card {
  width: min(520px, 100%);
}

.form-note {
  margin: 14px 0 0;
}

.legal-panel {
  max-width: 920px;
  margin: 0 auto;
}

.legal-copy {
  display: grid;
  gap: 16px;
}

.legal-card {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(122, 63, 242, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

.legal-card h4 {
  margin: 0 0 8px;
  color: var(--brand-strong);
}

.legal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.legal-card a {
  color: var(--brand-strong);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(122, 63, 242, 0.3);
  text-underline-offset: 4px;
}

ul.errorlist {
  margin: 0;
  padding-left: 18px;
  color: #8a1f4d;
}

.toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1400;
  display: grid;
  gap: 12px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}

.message-toast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 22px;
  color: var(--ink);
  background: rgba(255, 252, 255, 0.92);
  border: 1px solid rgba(78, 42, 147, 0.12);
  box-shadow: 0 22px 40px rgba(68, 40, 118, 0.2);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 220ms ease, transform 220ms ease;
}

.message-toast::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, #a264ff 0%, #ff95d3 100%);
}

.message-toast {
  position: relative;
  overflow: hidden;
}

.message-toast.success::before {
  background: linear-gradient(180deg, #7a3ff2 0%, #d970c1 100%);
}

.message-toast.info::before {
  background: linear-gradient(180deg, #7a71ff 0%, #8dd3ff 100%);
}

.message-toast.warning::before {
  background: linear-gradient(180deg, #ffad48 0%, #ff7e6b 100%);
}

.message-toast.error::before {
  background: linear-gradient(180deg, #ea5a95 0%, #9e2b68 100%);
}

.toast-copy {
  display: grid;
  gap: 4px;
}

.toast-title {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

.toast-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(122, 63, 242, 0.08);
  color: var(--brand-strong);
  border: 1px solid rgba(78, 42, 147, 0.08);
  font-size: 1.05rem;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(122, 63, 242, 0.14);
}

.message-toast.is-closing {
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
}

@media (max-width: 980px) {
  .hero,
  .dashboard-grid,
  .detail-grid,
  .admin-grid,
  .automation-grid,
  .monitoring-grid,
  .detail-layout,
  .shelf-columns,
  .library-grid {
    grid-template-columns: 1fr;
  }

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

  .catalog-card {
    grid-template-columns: 1fr;
  }

  .section-banner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .catalog-section {
    padding: 18px;
  }

  .catalog-shelf-grid {
    grid-template-columns: 1fr;
  }

  .library-overview {
    grid-template-columns: 1fr;
  }

  .library-favorite-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover-art {
    min-height: 180px;
  }
}

@media (max-width: 720px) {
  body::before,
  body::after {
    display: none;
  }

  .toast-stack {
    top: 14px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .message-toast {
    padding: 14px 15px;
    border-radius: 18px;
  }

  .site-advisory,
  .content-warning-inline,
  .content-warning-box,
  .reader-warning {
    flex-direction: column;
  }

  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .pdf-reader-shell {
    padding: 10px;
    border-radius: 18px;
  }

  .pdf-reader-status {
    margin-bottom: 8px;
    font-size: 0.92rem;
  }

  .reader-progress-card {
    padding: 12px 13px;
  }

  .pdf-page-flow + .pdf-page-flow {
    margin-top: -2px;
  }

  .topbar,
  .split-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar {
    top: 10px;
    gap: 14px;
    padding: 14px;
    border-radius: 24px;
  }

  .topbar-main {
    width: 100%;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    justify-content: flex-start;
    padding: 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }

  .topbar.nav-open .nav-links {
    display: flex;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 15px;
    border-radius: 16px;
    background: rgba(122, 63, 242, 0.04);
    border-color: rgba(122, 63, 242, 0.08);
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 20px;
  }

  .library-section {
    padding: 18px;
  }

  .library-favorite-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .library-entry {
    grid-template-columns: 88px 1fr;
    gap: 14px;
    padding: 14px;
  }

  .library-cover,
  .library-cover-fallback {
    min-height: 128px;
  }

  .brand-logo-link img {
    height: 62px;
  }

  h2 {
    max-width: none;
    font-size: 1.8rem;
  }
}
