:root {
  --paper: #fff8ef;
  --ink: #2a2430;
  --muted: #5c5466;
  --purple: #7b2d8e;
  --purple-soft: #f3dff8;
  --blue: #387dd9;
  --blue-soft: #d6e8ff;
  --green: #3d8b4a;
  --green-soft: #dff3d4;
  --gray-soft: #dfe4ef;
  --orange: #e08a2b;
  --yellow: #e8c220;
  --pink: #e08a9a;
  --card: #fffdf8;
  --line: #eadfce;
  --shadow: 0 10px 30px rgba(60, 30, 20, 0.08);
  --shadow-lift: 0 18px 36px rgba(60, 30, 20, 0.16);
  --rainbow: linear-gradient(90deg, #f0a02a 0 20%, #c06fd4 20% 40%, #78b836 40% 60%, #e8c220 60% 80%, #6d9de0 80% 100%);
  --font-display: "Varela Round", Heebo, Rubik, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body {
  margin: 0;
  font-family: Heebo, Rubik, Arial, sans-serif;
  background:
    radial-gradient(circle at 10% 0%, #ffe7c7 0, transparent 40%),
    radial-gradient(circle at 90% 10%, #f3d5ff 0, transparent 36%),
    radial-gradient(circle at 70% 100%, #d6e8ff 0, transparent 42%),
    radial-gradient(rgba(123, 45, 142, 0.07) 1px, transparent 1.5px) 0 0 / 18px 18px,
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.65;
}
a { color: var(--blue); text-decoration: none; transition: color 140ms ease; }
a:hover { color: var(--purple); }
:focus-visible { outline: 3px solid rgba(56, 125, 217, 0.55); outline-offset: 2px; }
::selection { background: #f3d5ff; color: var(--ink); }
.wrap { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

h1, h2, h3, .menu-head, .btn, button:not(.nav-toggle) { font-family: var(--font-display); }
.page-main > h1,
.series-page > h1,
.people-dir-header h1,
.article-page > h1 {
  margin: 4px 0 16px;
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  line-height: 1.2;
  color: var(--purple);
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(123, 45, 142, 0.16);
}
.page-main > h1::after,
.series-page > h1::after,
.people-dir-header h1::after,
.article-page > h1::after {
  content: "";
  display: block;
  width: 110px;
  height: 6px;
  margin-top: 8px;
  border-radius: 6px;
  background: var(--rainbow);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

/* Icons */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -0.2em;
}
[dir="rtl"] .icon-flip { transform: scaleX(-1); }
.account-switch .icon, .nav-toggle .icon { width: 14px; height: 14px; margin-inline-end: 4px; }
/* Header */
.site-header {
  position: relative;
  isolation: isolate;
}
.header-sky {
  background: #ffffff;
  padding: 4px 0 0;
  overflow: hidden;
}
.header-sky::after {
  display: none;
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding-top: 2px;
  position: relative;
  z-index: 1;
}
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand-logo {
  height: auto;
  width: min(240px, 48vw);
  max-height: 48px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 40, 100, 0.2));
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-bottom: 0;
  color: #fff;
}
.brand-name {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #2d2a8f;
  text-shadow:
    2px 2px 0 #1a1650,
    0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-slogan {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 40, 90, 0.35);
}
.brand:hover .brand-name { filter: brightness(1.06); }
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: 0;
}
.lang-switch { display: flex; gap: 4px; }
.account-switch { display: flex; gap: 4px; flex-wrap: wrap; }
.lang-switch a, .account-switch a, .nav-toggle {
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.92);
  border-radius: 999px;
  padding: 3px 10px;
  color: #1d3f72;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,40,100,0.18);
  text-decoration: none;
}
.lang-switch a.is-active {
  background: #6b2d8e;
  color: #fff;
  border-color: #6b2d8e;
}
.nav-toggle { display: none; }

.toptabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  align-self: flex-end;
}
.toptab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px 9px;
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-bottom: none;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  color: #2a2430 !important;
  text-shadow: none;
  background-image:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.05) 45%,
      rgba(0, 0, 0, 0.05) 100%
    );
  background-blend-mode: soft-light;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 -2px 10px rgba(0, 0, 0, 0.08);
  position: relative;
  transform: none;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease;
}
.toptab-orange { background-color: #f0a02a; }
.toptab-purple { background-color: #c06fd4; }
.toptab-green { background-color: #78b836; }
.toptab-yellow { background-color: #e8c220; }
.toptab-blue { background-color: #6d9de0; }
.toptab-sky { background-color: #e08a9a; }
.toptab:hover {
  filter: brightness(1.04);
  transform: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 -3px 12px rgba(0, 0, 0, 0.1);
}
.toptab.is-active {
  z-index: 1;
  font-weight: 700;
  filter: brightness(1.05);
  transform: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 -3px 14px rgba(0, 0, 0, 0.12);
}

.header-ledge {
  height: 8px;
  background: linear-gradient(#ffd27a, #f0a030 55%, #d88818);
  border-top: 1px solid #ffe7b0;
  box-shadow: 0 2px 0 rgba(120, 60, 0, 0.12);
}


.toptab .icon { width: 15px; height: 15px; margin-inline-end: 5px; opacity: 0.85; }
@media (min-width: 821px) {
  .toptab { padding-inline: 15px; }
}

/* Page frame */
.page {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 24px;
  padding-block: 22px 40px;
  align-items: start;
}
.page-main { min-width: 0; }

.sidemenu {
  background: #fffdf8;
  border: 2px solid #e2cf9a;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 0 #e8d6a8, var(--shadow);
}
.sidemenu-date {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5a4630;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.55) 0 6px, transparent 6px 12px),
    #ffe9ad;
  border-bottom: 1px solid #e2cf9a;
}
.menu-block + .menu-block { border-top: 2px solid #f3e6c4; }
.menu-head {
  margin: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 52%),
    var(--head-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.menu-head .icon {
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
}
.menu-blue { --head-bg: linear-gradient(#4f93e6, #2f6db8); --tone: #387dd9; --tone-soft: #edf5ff; }
.menu-purple { --head-bg: linear-gradient(#c45ad4, #8a2aa0); --tone: #8a2aa0; --tone-soft: #f8ecfb; }
.menu-green { --head-bg: linear-gradient(#6cbc5a, #3d8b4a); --tone: #3d8b4a; --tone-soft: #eef8e8; }
.menu-orange { --head-bg: linear-gradient(#f0a44a, #d07a18); --tone: #d07a18; --tone-soft: #fff3e2; }
.menu-gray { --head-bg: linear-gradient(#8aa0b8, #5c738c); --tone: #5c738c; --tone-soft: #eef2f7; }
.menu-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: #ffffff;
}
.menu-list li + li { border-top: 1px dotted #e2d4b4; }
.menu-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: #2a3a58;
  font-size: 0.87rem;
  font-weight: 600;
  transition: background 140ms ease, padding 160ms ease, color 140ms ease;
}
.menu-list a::before {
  content: "";
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-inline-start-color: var(--tone, #387dd9);
  flex: 0 0 auto;
  transition: transform 160ms ease;
}
.menu-list a:hover,
.menu-list a.is-active {
  background: var(--tone-soft, #edf5ff);
  color: var(--tone, #1d4e8f);
  padding-inline-start: 16px;
}
.menu-list a:hover::before { transform: scale(1.25); }
.menu-list a.is-active {
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--tone);
}
[dir="rtl"] .menu-list a.is-active { box-shadow: inset -3px 0 0 var(--tone); }
.menu-pic { padding: 10px; text-align: center; background: #fffaf0; }
.menu-pic img {
  max-width: 100%;
  border: 4px solid #fff;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(60, 30, 20, 0.18);
  transform: rotate(-1.5deg);
}
.menu-pic p { margin: 8px 0 0; font-size: 0.78rem; color: var(--muted); }

/* Search */
.hero-search {
  position: relative;
  margin: 8px 0 24px;
  border: 3px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(#fffdf8, #fffdf8) padding-box,
    var(--rainbow) border-box;
  box-shadow: 0 4px 0 rgba(123, 45, 142, 0.12), var(--shadow);
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-search-icon {
  color: #b08ac0;
  margin-inline-start: 12px;
  width: 22px;
  height: 22px;
}
.hero-search input {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 4px;
  font-size: 1.02rem;
}
.hero-search input:focus { outline: none; box-shadow: none; }
.hero-search:focus-within { box-shadow: 0 0 0 4px rgba(192, 111, 212, 0.18), 0 4px 0 rgba(123, 45, 142, 0.12), var(--shadow); }
.hero-search button { padding-inline: 20px; }

/* Forms */
form input, form textarea, form select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  background: #fff;
  box-shadow: inset 0 2px 3px rgba(60, 30, 20, 0.06);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
form input[type="checkbox"], form input[type="radio"] { width: auto; box-shadow: none; }
form input[type="file"] { padding: 7px; }
form input:focus, form textarea:focus, form select:focus {
  outline: none;
  border-color: #8fb6ea;
  box-shadow: inset 0 2px 3px rgba(60, 30, 20, 0.06), 0 0 0 4px rgba(56, 125, 217, 0.15);
}

/* Gel buttons */
.btn,
button[type="submit"],
button.btn-sm,
button.btn-soft {
  --b-top: #6aa8f0;
  --b-bot: #2f6db8;
  --b-edge: #1f4f8f;
  --b-ink: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--b-edge);
  background: linear-gradient(180deg, var(--b-top), var(--b-bot));
  color: var(--b-ink);
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1),
    0 3px 0 var(--b-edge),
    0 6px 14px rgba(30, 60, 120, 0.2);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 140ms ease;
}
.btn::before,
button[type="submit"]::before,
button.btn-sm::before,
button.btn-soft::before {
  content: "";
  position: absolute;
  inset: 1px 10px auto;
  height: 46%;
  border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.06));
  pointer-events: none;
  z-index: -1;
}
.btn .icon,
button[type="submit"] .icon,
button.btn-sm .icon,
button.btn-soft .icon {
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn:hover,
button[type="submit"]:hover,
button.btn-sm:hover,
button.btn-soft:hover {
  color: var(--b-ink);
  filter: brightness(1.06) saturate(1.05);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1),
    0 4px 0 var(--b-edge),
    0 10px 18px rgba(30, 60, 120, 0.24);
}
.btn:hover .icon,
button[type="submit"]:hover .icon,
button.btn-sm:hover .icon,
button.btn-soft:hover .icon { transform: scale(1.15) rotate(-6deg); }
.btn:active,
button[type="submit"]:active,
button.btn-sm:active,
button.btn-soft:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.18),
    0 0 0 var(--b-edge),
    0 2px 6px rgba(30, 60, 120, 0.18);
}
.btn-soft,
button.btn-soft {
  --b-top: #ffffff;
  --b-bot: #e6f0ff;
  --b-edge: #9dbbe6;
  --b-ink: #1d4e8f;
  text-shadow: none;
}
.btn-soft .icon, button.btn-soft .icon { filter: none; }
.btn-danger,
button.btn-danger {
  --b-top: #f5a493;
  --b-bot: #d0503a;
  --b-edge: #9a3424;
  --b-ink: #fff;
}
.btn-sm,
button.btn-sm {
  padding: 4px 12px;
  font-size: 0.82rem;
  gap: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 0 var(--b-edge);
}
.section-purple button[type="submit"] { --b-top: #d488e4; --b-bot: #8a2aa0; --b-edge: #5e1a70; }
.section-green button[type="submit"] { --b-top: #94d27a; --b-bot: #3d8b4a; --b-edge: #2a6234; }
.card .btn { margin-top: 4px; }
td .btn + .btn { margin-inline-start: 6px; }

/* Home */
.grid { display: grid; gap: 20px; }
.home-grid { grid-template-columns: 1.2fr 0.8fr; }
.related-series { margin: 18px 0 8px; }
.related-cards { margin-top: 10px; }
.related-cards .series-card .card-body { display: none; }

.home-random { margin-top: 32px; }
.home-random-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}
.home-random-head h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--purple);
  text-shadow: 2px 2px 0 #fff;
}
.home-random-more {
  font-size: 0.9rem;
  padding: 6px 16px;
}
.card-kind {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 0 6px !important;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
}
.section {
  position: relative;
  border-radius: 24px;
  padding: 22px 24px;
  --sec-ink: var(--ink);
  border: 1px solid color-mix(in srgb, var(--sec-ink) 14%, transparent);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--sec-ink) 10%, transparent), var(--shadow);
}
.section h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  color: var(--sec-ink);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.9);
}
.section-gray {
  --sec-ink: #3c4a66;
  background: linear-gradient(160deg, #eef1f8, var(--gray-soft));
}
.section-blue {
  --sec-ink: #1d4e8f;
  background: linear-gradient(160deg, #e9f2ff, var(--blue-soft));
}
.section-green {
  --sec-ink: #2f6e3a;
  background: linear-gradient(160deg, #eef9e8, var(--green-soft));
}
.section-purple {
  --sec-ink: #6b2d8e;
  background: linear-gradient(160deg, #faeffc, var(--purple-soft));
}
.section ul { padding-inline-start: 1.2em; }
.section li::marker { color: var(--sec-ink); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 3px 0 #efe3cf, var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.cards > .card {
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 220ms ease;
}
.cards > .card:hover {
  transform: translateY(-5px) rotate(-0.6deg);
  box-shadow: 0 5px 0 #e6d6b8, var(--shadow-lift);
}
.cards > .card:nth-child(even):hover { transform: translateY(-5px) rotate(0.6deg); }
.extras-card {
  --card-tint: #eef3f9;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.12) 42%, transparent 70%),
    var(--card-tint);
}
.extras-card-tone-0 { --card-tint: #e4edf7; }
.extras-card-tone-1 { --card-tint: #dcecff; }
.extras-card-tone-2 { --card-tint: #f0e4f7; }
.extras-card-tone-3 { --card-tint: #e4f3d8; }
.extras-card-tone-4 { --card-tint: #ffe8cc; }
.extras-card-tone-5 { --card-tint: #fff6cc; }
.extras-card-tone-6 { --card-tint: #f7e4ea; }
.extras-card-tone-7 { --card-tint: #d9f3ef; }
.series-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.series-card .card-head {
  margin: 0;
  min-height: 38px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(40, 60, 90, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.18) 48%, transparent 52%),
    linear-gradient(180deg, var(--head-light) 0%, var(--head-mid) 45%, var(--head-dark) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(40, 60, 90, 0.18);
  --head-light: #c8d8ea;
  --head-mid: #a8bdd6;
  --head-dark: #8eabc8;
}
.series-card .card-head-tone-0 { --head-light: #c8d8ea; --head-mid: #a8bdd6; --head-dark: #8eabc8; }
.series-card .card-head-tone-1 { --head-light: #b9d8ff; --head-mid: #6fb0f0; --head-dark: #3d8bd6; }
.series-card .card-head-tone-2 { --head-light: #e6c8f2; --head-mid: #c48ad8; --head-dark: #9a56b8; }
.series-card .card-head-tone-3 { --head-light: #c8e8b0; --head-mid: #8fcc6a; --head-dark: #5fa83a; }
.series-card .card-head-tone-4 { --head-light: #ffd8a8; --head-mid: #f0a84a; --head-dark: #d88820; }
.series-card .card-head-tone-5 { --head-light: #fff0a8; --head-mid: #e8c840; --head-dark: #c8a018; }
.series-card .card-head-tone-6 { --head-light: #f2c8d4; --head-mid: #e08a9a; --head-dark: #c06078; }
.series-card .card-head-tone-7 { --head-light: #b8ebe4; --head-mid: #5ec4b8; --head-dark: #2f9e94; }
.series-card .card-head-dots {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  background-image: radial-gradient(circle, #2a3648 1.15px, transparent 1.25px);
  background-size: 3.6px 3.6px;
  background-position: center;
  opacity: 0.85;
}
.series-card .card-head a {
  color: #fff !important;
  text-shadow:
    0 1px 0 rgba(40, 60, 90, 0.55),
    1px 1px 0 rgba(40, 60, 90, 0.35);
  display: block;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
}
.series-card .card-head a:hover {
  color: #fff7d6 !important;
}
.series-card .card-cover-link {
  display: block;
  margin: 10px 12px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
.series-card .card-cover {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  margin: 0;
  border: 0;
  background: transparent;
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.series-card:hover .card-cover { transform: scale(1.05); }
.series-card .card-body {
  padding: 12px 14px 14px;
}
.series-card .card-head + .card-body {
  padding-top: 12px;
}
.series-card .card-body p { margin: 0 0 6px; }
.series-card .card-body .muted { margin: 0; }
.card-cover, .series-cover {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  display: block;
  margin-bottom: 8px;
  background: transparent;
  border: 0;
}
.series-card .card-cover {
  margin-bottom: 0;
}
.series-cover { max-height: 300px; }
.series-page .media-block img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 10px;
}
.page-body p {
  margin: 0 0 0.85em;
  max-width: 70ch;
  line-height: 1.7;
}
.page-body p:last-child { margin-bottom: 0; }
.source-links { margin: 0; padding-inline-start: 1.2em; }
.source-links li { margin: 0.35em 0; }
.series-sources { margin-top: 1.2em; }
.flash {
  background: var(--green-soft);
  border: 2px solid rgba(61, 139, 74, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-weight: 600;
  box-shadow: 0 3px 0 rgba(61, 139, 74, 0.12);
}

/* Chips & letter nav */
.letter-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 22px; }
.letter-nav a, .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 2.2em;
  background: linear-gradient(180deg, #fff, #fbf5ea);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 13px;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 2px 0 #e6d6b8;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.letter-nav a:hover, .chip:hover {
  color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #e0cba4;
}
.letter-nav a.is-active {
  background: linear-gradient(180deg, #6aa8f0, #2f6db8);
  color: #fff;
  border-color: #1f4f8f;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #1f4f8f;
}

.aka { font-size: 0.95rem; color: var(--muted); margin-top: 0; }
.media-block { margin-top: 22px; }
.media-block h3 { margin-bottom: 8px; color: var(--purple); }
.embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 4px solid #2a2430;
  box-shadow: 0 0 0 3px #e2cf9a, var(--shadow);
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
audio { width: 100%; }

/* Footer */
.site-footer {
  position: relative;
  margin-top: 56px;
  background:
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1.5px) 0 0 / 14px 14px,
    linear-gradient(180deg, #f6b862, var(--orange));
  color: #3b2208;
  padding: 26px 0 14px;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: -14px 0 auto;
  height: 15px;
  background: radial-gradient(circle at 14px 15px, #f6b862 13px, transparent 14px) 0 0 / 28px 15px repeat-x;
}
.site-footer::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: var(--rainbow);
  opacity: 0.85;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.footer-links a {
  color: #3b2208;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 140ms ease;
}
.footer-links a:hover { background: rgba(255, 255, 255, 0.55); color: #3b2208; }
.revival-notice {
  background: #fff4e0;
  border: 1px solid #e8d2a8;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 14px;
  max-width: 70ch;
  line-height: 1.55;
}
.footer-revival {
  margin: 14px auto 12px;
  text-align: center;
  max-width: 70ch;
  font-size: 0.92rem;
  box-shadow: 0 3px 0 rgba(120, 60, 0, 0.15);
}
.legal { font-size: 0.82rem; max-width: 80ch; margin: 16px auto; text-align: center; }
.copy { text-align: center; font-weight: 700; font-family: var(--font-display); }

/* Admin */
.admin-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}
.admin-nav { background: linear-gradient(180deg, #3a2f44, #2a2430); color: #fff; padding: 20px 16px; }
.admin-nav strong { display: block; margin-bottom: 8px; font-family: var(--font-display); color: #ffd27a; }
.admin-nav a {
  display: block;
  color: #f3e7ff;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 140ms ease;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.admin-main { padding: 24px; background: #f6f1ea; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: start; }
.table th { background: #fff4d6; font-family: var(--font-display); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.interview-media {
  display: grid;
  gap: 12px;
  margin: 0 0 1.25rem;
  padding: 14px 16px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.interview-person-link {
  margin: 0 0 1rem;
  padding: 10px 14px;
  background: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 700;
}
.interview-person-link a { color: var(--blue); }
.person-interviews { margin: 1.25rem 0; }
.person-interviews h2 { margin: 0 0 8px; color: var(--purple); font-size: 1.15rem; }
.person-interview-list { margin: 0; padding-inline-start: 1.2em; }
.person-interview-list li { margin: 0.35em 0; }
.interview-media-label { margin: 0 0 6px; font-weight: 600; }
.interview-audio audio { width: min(100%, 420px); display: block; }
.interview-body .interview-intro { margin: 0 0 0.85rem; }
.interview-body .interview-turn { margin: 0 0 0.75rem; }
.interview-body .interview-speaker { font-weight: 700; color: var(--purple); }
.interview-body .interview-turn-guest .interview-speaker { color: var(--blue); }
.interview-source { margin-top: 1.5rem; font-size: 0.9rem; }
.menu-greetings a { font-size: 0.9rem; line-height: 1.35; }

.series-comments { margin-top: 1.75rem; }
.series-comments h2 { margin: 0 0 12px; }
.series-comments-list { display: grid; gap: 10px; margin-bottom: 16px; }
.series-comment { margin: 0; }
.series-comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  margin-bottom: 6px;
}
.series-comment-form { margin-top: 8px; }
.series-comment-form textarea { width: 100%; }

@media (max-width: 820px) {
  .home-grid, .pair, .admin-shell, .page { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .sidemenu { display: none; }
  .sidemenu.is-open { display: block; }
  .header-inner {
    gap: 8px;
    justify-content: center;
  }
  .brand-logo { width: min(200px, 70vw); max-height: 44px; }
  .brand {
    order: 1;
    flex: 1 1 100%;
    justify-content: center;
  }
  .brand-text { align-items: center; text-align: center; }
  .header-tools {
    order: 2;
    flex: 1 1 100%;
    justify-content: center;
    margin-inline-start: 0;
  }
  .toptabs { justify-content: center; order: 3; flex: 1 1 100%; }
  .nav-label-prefix { display: none; }
  .toptab {
    min-width: 0;
    flex: 1 1 calc(33.33% - 5px);
    font-size: 0.8125rem;
    padding: 9px 10px 8px;
  }
  .hero-search-icon { display: none; }
  .hero-search { border-radius: 22px; }
  .hero-search button { padding-inline: 14px; }
}

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

/* Series encyclopedia */
.series-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  list-style: none;
  margin: 10px 0 14px;
  padding: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.series-facts li {
  display: inline-flex;
  gap: 0.35em;
  align-items: baseline;
}
.series-facts li:not(:last-child)::after {
  content: "|";
  margin-inline-start: 14px;
  opacity: 0.45;
}
.series-fact-label { font-weight: 600; color: var(--ink); }
.series-section-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--purple);
}
.series-people-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.series-people-head h2 { margin: 0; }
.series-people-view-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #9dbbe6;
  background: linear-gradient(180deg, #fff, #e6f0ff);
  color: #1d4e8f;
  border-radius: 999px;
  padding: 5px 14px;
  font: inherit;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #9dbbe6;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.series-people-view-toggle:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #9dbbe6;
}
.series-people-view-toggle:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.series-people[data-people-view="table"] .icon-view-cards,
.series-people:not([data-people-view="table"]) .icon-view-table { display: none; }
.series-people-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.series-people-grid[hidden],
.series-people-table-wrap[hidden] {
  display: none !important;
}
.series-person-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.series-person-photo,
.series-person-photo-empty {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--gray-soft);
  display: block;
  margin-bottom: 8px;
}
.series-person-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}
.series-person-thumb-empty {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--gray-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.1;
  padding: 2px;
}
.person-photo {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
  margin-bottom: 8px;
  border-radius: 12px;
}
.person-photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
}
.person-photo-extra {
  max-width: min(100%, 280px);
  max-height: 240px;
}
.person-photo-empty {
  max-width: 180px;
  max-height: 300px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-soft);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
}
.series-person-name {
  margin: 0 0 4px;
  font-size: 0.95rem;
  line-height: 1.3;
}
.series-person-character {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: var(--muted);
}
.series-person-desc {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
}
.series-people-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.series-people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.series-people-table th,
.series-people-table td {
  padding: 8px 12px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.series-people-table thead th {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--gray-soft);
  white-space: nowrap;
}
.series-people-table tbody tr:last-child td { border-bottom: 0; }
.series-people-table tbody tr:hover { background: rgba(0, 0, 0, 0.02); }
.series-people-col-photo {
  width: 52px;
  padding-inline: 8px !important;
}
.series-person-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--gray-soft);
}
.series-people-col-name {
  font-weight: 600;
  white-space: nowrap;
}
.series-people-col-desc {
  line-height: 1.45;
  color: var(--ink);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.series-info-list { margin: 0; }
.series-info-row {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) 1fr;
  gap: 8px 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.series-info-row dt {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}
.series-info-row dd { margin: 0; }
.series-theme-quote {
  margin: 0.5rem 0 0;
  padding: 10px 12px;
  border-inline-start: 3px solid var(--purple);
  background: var(--purple-soft);
  border-radius: 0 10px 10px 0;
  font-style: italic;
}
[dir="rtl"] .series-theme-quote {
  border-radius: 10px 0 0 10px;
}
.series-relation-badge {
  margin: 0;
  padding: 4px 10px 0;
  font-size: 0.8rem;
}
.series-trivia-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.series-trivia-list li {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.series-trivia-title {
  display: block;
  margin-bottom: 4px;
}
.series-page .media-block h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--purple);
}

/* People directory */
.people-directory { margin-bottom: 28px; }
.people-dir-header h1 { margin-bottom: 6px; }
.people-dir-lead {
  margin: 0 0 6px;
  color: var(--muted);
  max-width: 60ch;
  font-size: 1.02rem;
}
.people-dir-meta { margin: 0 0 14px; font-size: 0.9rem; }
.people-dir-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, #fff);
  backdrop-filter: blur(6px);
  padding: 10px 0 12px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.people-dir-search {
  display: block;
  width: 95%;
  max-width: 95%;
  margin: 0 auto 10px;
}
.people-dir-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  box-shadow: var(--shadow);
}
.people-dir-search input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-color: var(--blue);
}
.people-dir-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 2px 0 8px;
  margin-bottom: 4px;
}
.people-dir-filter,
.people-dir-filters .chip {
  flex: 0 0 auto;
  appearance: none;
  padding: 6px 15px;
  font: inherit;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.people-dir-filter:hover { border-color: var(--blue); color: var(--blue); }
.people-dir-filter:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.people-dir-filter.is-active {
  background: linear-gradient(180deg, #6aa8f0, #2f6db8);
  color: #fff;
  border-color: #1f4f8f;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #1f4f8f;
}
.people-dir-alphabet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0 16px 4px;
  overflow: visible;
}
.people-dir-alphabet a {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  padding: 5px 6px;
  font-weight: 700;
}
.people-dir-alphabet a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.people-dir-empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  text-align: center;
}
.people-dir-empty .btn { margin-top: 8px; }
.people-dir-featured {
  margin: 0 0 22px;
  padding: 14px;
  background: linear-gradient(180deg, var(--purple-soft), transparent 120%);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.people-dir-featured h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--purple);
}
.people-dir-section { margin: 0 0 22px; scroll-margin-top: 200px; }
.people-dir-letter-heading {
  position: sticky;
  top: 118px;
  z-index: 2;
  margin: 0 0 10px;
  padding: 6px 0 8px;
  font-size: 1.35rem;
  color: var(--purple);
  background: color-mix(in srgb, var(--paper) 88%, #fff);
  border-bottom: 1px solid var(--line);
}
.people-dir-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.people-dir-grid-featured {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.people-dir-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: none;
  color: inherit;
  text-decoration: none;
  min-height: 64px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.people-dir-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
  color: inherit;
}
.people-dir-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.people-dir-card-featured {
  background: #fff;
}
.people-dir-photo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--gray-soft);
  display: block;
}
.people-dir-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.15;
  padding: 4px;
}
.people-dir-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.people-dir-name {
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.25;
  color: var(--ink);
}
.people-dir-roles {
  font-size: 0.8rem;
  color: var(--blue);
  font-weight: 600;
  line-height: 1.3;
}
.people-dir-titles,
.people-dir-count {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.people-dir-titles {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.people-dir-more { white-space: nowrap; }
.people-dir-section[hidden],
.people-dir-card[hidden],
.people-dir-featured[hidden],
.people-dir-empty[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .series-people-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .people-dir-grid,
  .people-dir-grid-featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .series-people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-info-row { grid-template-columns: 1fr; gap: 2px; }
  .series-facts li:not(:last-child)::after { display: none; }
  .series-people-table th,
  .series-people-table td { padding: 8px 10px; font-size: 0.9rem; }
  .series-people-col-name { white-space: normal; }
  .people-dir-grid,
  .people-dir-grid-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-dir-letter-heading { top: 150px; }
  .people-dir-toolbar { padding-top: 6px; }
}
@media (max-width: 600px) {
  .people-dir-alphabet {
    justify-content: flex-start;
    gap: 4px;
    padding-inline: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .people-dir-alphabet::-webkit-scrollbar {
    display: none;
  }
  .people-dir-alphabet a {
    flex: 0 0 auto;
    min-width: 2rem;
    padding: 5px 10px;
  }
}
@media (max-width: 520px) {
  .people-dir-grid { grid-template-columns: 1fr; }
  .people-dir-grid-featured { grid-template-columns: 1fr; }
  .people-dir-card {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 8px;
  }
  .people-dir-photo { width: 44px; height: 44px; }
}
