/* Catalogo de peliculas y series - mobile first */
:root {
  --bg: #080b10;
  --panel: #0d1117;
  --panel-2: #111827;
  --surface: rgba(15, 23, 42, .78);
  --surface-2: rgba(17, 24, 39, .84);
  --field: #0b1220;
  --field-text: #eef2ff;
  --line: #273142;
  --text: #eef2ff;
  --muted: #9ca3af;
  --accent: #7c3aed;
  --accent-2: #0ea5e9;
  --glow-a: rgba(14, 165, 233, .18);
  --glow-b: rgba(124, 58, 237, .16);
  --shadow: 0 18px 55px rgba(0, 0, 0, .42);
  --radius: 16px;
  --glass-bg: rgba(11, 18, 32, .54);
  --glass-bg-2: rgba(255, 255, 255, .12);
  --glass-bg-soft: rgba(8, 11, 16, .34);
  --glass-border: rgba(226, 232, 240, .18);
  --glass-blur: 26px;
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -14px 30px -18px rgba(34, 211, 238, .42), inset 0 0 0 1px rgba(255, 255, 255, .045);
  --glass-shine: rgba(255, 255, 255, .16);
}

body.theme-jade {
  --bg: #07110f;
  --panel: #0b1714;
  --panel-2: #10231f;
  --line: #24443c;
  --accent: #10b981;
  --accent-2: #22d3ee;
  --glow-a: rgba(16, 185, 129, .17);
  --glow-b: rgba(34, 211, 238, .13);
}

body.theme-rose {
  --bg: #100811;
  --panel: #180d1b;
  --panel-2: #231225;
  --line: #462944;
  --accent: #d946ef;
  --accent-2: #fb7185;
  --glow-a: rgba(217, 70, 239, .16);
  --glow-b: rgba(251, 113, 133, .14);
}

body.theme-ember {
  --bg: #100c08;
  --panel: #171108;
  --panel-2: #231a0d;
  --line: #49351b;
  --accent: #f59e0b;
  --accent-2: #38bdf8;
  --glow-a: rgba(245, 158, 11, .16);
  --glow-b: rgba(56, 189, 248, .12);
}

body.theme-light {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #eef2ff;
  --surface: rgba(255, 255, 255, .86);
  --surface-2: rgba(241, 245, 249, .92);
  --field: #ffffff;
  --field-text: #0f172a;
  --line: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
  --accent: #2563eb;
  --accent-2: #14b8a6;
  --glow-a: rgba(37, 99, 235, .12);
  --glow-b: rgba(20, 184, 166, .10);
  --glass-bg: rgba(255, 255, 255, .58);
  --glass-bg-2: rgba(255, 255, 255, .78);
  --glass-bg-soft: rgba(241, 245, 249, .38);
  --glass-border: rgba(15, 23, 42, .12);
  --glass-shine: rgba(255, 255, 255, .52);
}

body.theme-graphite {
  --bg: #111827;
  --panel: #161f2e;
  --panel-2: #1f2937;
  --surface: rgba(22, 31, 46, .86);
  --surface-2: rgba(31, 41, 55, .92);
  --field: #111827;
  --field-text: #f8fafc;
  --line: #4b5563;
  --accent: #94a3b8;
  --accent-2: #f8fafc;
  --glow-a: rgba(148, 163, 184, .14);
  --glow-b: rgba(248, 250, 252, .08);
}

body.theme-contrast {
  --bg: #000;
  --panel: #050505;
  --panel-2: #111;
  --surface: #050505;
  --surface-2: #111;
  --field: #000;
  --field-text: #fff;
  --line: #facc15;
  --text: #fff;
  --muted: #fde68a;
  --accent: #facc15;
  --accent-2: #fff;
  --glow-a: rgba(250, 204, 21, .22);
  --glow-b: rgba(255, 255, 255, .10);
}

body.theme-ocean {
  --bg: #061826;
  --panel: #0a2233;
  --panel-2: #0f3147;
  --line: #155e75;
  --accent: #06b6d4;
  --accent-2: #3b82f6;
  --glow-a: rgba(6, 182, 212, .18);
  --glow-b: rgba(59, 130, 246, .15);
}

body.theme-sakura {
  --bg: #140914;
  --panel: #1f1020;
  --panel-2: #2b162b;
  --line: #6b315c;
  --accent: #f472b6;
  --accent-2: #fda4af;
  --glow-a: rgba(244, 114, 182, .18);
  --glow-b: rgba(253, 164, 175, .14);
}

body.theme-glass {
  --bg: #050816;
  --panel: #07111f;
  --panel-2: #0d1b2e;
  --surface: rgba(8, 15, 28, .58);
  --surface-2: rgba(11, 22, 38, .62);
  --field: rgba(255, 255, 255, .07);
  --field-text: #f8fafc;
  --line: rgba(226, 232, 240, .18);
  --text: #f8fafc;
  --muted: #b6c3d6;
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --glow-a: rgba(125, 211, 252, .20);
  --glow-b: rgba(167, 139, 250, .18);
  --glass-bg: rgba(11, 18, 32, .54);
  --glass-bg-2: rgba(255, 255, 255, .12);
  --glass-bg-soft: rgba(8, 11, 16, .34);
  --glass-border: rgba(226, 232, 240, .18);
  --glass-blur: 26px;
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -14px 30px -18px rgba(34, 211, 238, .42), inset 0 0 0 1px rgba(255, 255, 255, .045);
  --glass-shine: rgba(255, 255, 255, .16);
}

body.theme-uiv2 {
  --bg: #030303;
  --panel: #0b0b0b;
  --panel-2: #151515;
  --surface: #101010;
  --surface-2: #171717;
  --field: #151515;
  --field-text: #f7f7f7;
  --line: #2a2a2a;
  --text: #f8f8f8;
  --muted: #a8a8a8;
  --accent: #ff4d2e;
  --accent-2: #ff7a3d;
  --glow-a: rgba(255, 77, 46, .14);
  --glow-b: rgba(255, 122, 61, .10);
  --shadow: 0 18px 48px rgba(0, 0, 0, .54);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, var(--glow-a), transparent 28%),
    radial-gradient(circle at 90% 8%, var(--glow-b), transparent 24%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--ui-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif);
}

body {
  position: relative;
  min-height: 100svh;
  padding-bottom: 104px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
}

body.theme-glass::before {
  display: block;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .055), transparent 28%, rgba(34, 211, 238, .055) 52%, transparent 76%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 10px);
  opacity: .85;
}

body.font-google-sans { --ui-font: "Google Sans", "Product Sans", "Roboto", "Segoe UI", Arial, sans-serif; }
body.font-quicksand { --ui-font: "Quicksand", "Segoe UI", Arial, sans-serif; }
body.font-jetbrains-mono { --ui-font: "JetBrains Mono", Consolas, "SFMono-Regular", monospace; }
body.font-fjalla-one { --ui-font: "Fjalla One", "Arial Narrow", Arial, sans-serif; }
body.font-josefin-sans { --ui-font: "Josefin Sans", "Segoe UI", Arial, sans-serif; }
body.font-alumni-sans { --ui-font: "Alumni Sans", "Arial Narrow", Arial, sans-serif; }
body.font-ranchers { --ui-font: "Ranchers", "Cooper Black", Impact, fantasy; }
body.font-oswald { --ui-font: "Oswald", "Arial Narrow", Arial, sans-serif; }
body.text-size-small { font-size: 14px; }
body.text-size-normal { font-size: 16px; }
body.text-size-large { font-size: 18px; }

body.theme-glass {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 38%),
    linear-gradient(225deg, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 58%, var(--bg)), var(--bg) 58%, color-mix(in srgb, var(--accent) 8%, var(--bg))),
    var(--bg);
}

.auth-gate,
.app {
  position: relative;
  z-index: 1;
}

body.auth-locked {
  padding-bottom: 0;
  overflow-x: hidden;
}

body.auth-checking #authGateLogin,
body.auth-checking .auth-gate .auth-email-form {
  display: none;
}

.auth-gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(460px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .92), rgba(8, 11, 16, .92));
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(34px, 8vw, 54px);
  line-height: 1;
}

.auth-card p {
  max-width: 34ch;
  margin: 0;
  color: #cbd5e1;
  line-height: 1.45;
}

.auth-card .primary {
  min-height: 48px;
  padding-inline: 18px;
}

.auth-email-form,
.profile-login-panel {
  width: 100%;
  display: grid;
  gap: 10px;
}

.auth-email-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-login-panel {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.profile-login-panel[hidden] {
  display: none;
}

.auth-mark {
  width: 58px;
  height: 58px;
  font-size: 28px;
}

button,
input,
select,
textarea { font: inherit; }

button {
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

button,
.btn,
select,
.select-btn,
.card,
.source-box,
.info,
.tag {
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease, color .2s ease, opacity .2s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.bi {
  line-height: 1;
}

.no-animations *,
.no-animations *::before,
.no-animations *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

.app {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 12px;
}

.hero {
  position: relative;
  z-index: 30;
  margin: 0;
  padding: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, transparent), color-mix(in srgb, var(--panel) 88%, transparent));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

input,
select,
textarea,
.form-control,
.control {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--field-text);
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder,
.control::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.control:focus {
  border-color: color-mix(in srgb, var(--accent-2) 72%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent);
}

.form-check-input,
.switch-input,
.switch-track {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative;
  flex: 0 0 auto;
  width: 48px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  aspect-ratio: auto !important;
  border: 1px solid var(--border-strong, var(--line)) !important;
  border-radius: 999px !important;
  background-color: var(--input-bg, var(--surface-2)) !important;
  background-image: none !important;
  cursor: pointer;
  box-shadow: none !important;
  display: inline-block !important;
  min-width: 48px !important;
  max-width: 48px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  transform: none !important;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.form-check-input::before,
.switch-input::before,
.switch-thumb {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-soft, var(--text));
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  transition: transform .18s ease, background-color .18s ease;
}

.form-check-input:checked,
.switch-input:checked,
.switch.is-on .switch-track {
  background-color: var(--accent) !important;
  border-color: color-mix(in srgb, var(--accent) 72%, var(--accent-2)) !important;
}

.form-check-input:checked::before,
.switch-input:checked::before,
.switch.is-on .switch-thumb {
  transform: translateX(20px);
  background: #fff;
}

.form-check-input:disabled,
.switch-input:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.form-check-input:focus,
.switch-input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent) !important;
}

.form-check.form-switch {
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.switch {
  display: inline-flex;
  align-items: center;
}

.profile-socials-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.profile-socials-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  list-style: none;
}

.profile-socials-panel summary::-webkit-details-marker {
  display: none;
}

.profile-socials-panel summary::after {
  content: "\F282";
  margin-left: auto;
  font-family: "bootstrap-icons";
  color: var(--muted);
  transition: transform .18s ease;
}

.profile-socials-panel[open] summary::after {
  transform: rotate(180deg);
}

.topbar,
.search-filter-panel,
.searchbox,
.filters {
  width: min(100%, 1240px);
  margin-inline: auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-home {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand-home:hover .brand-mark {
  transform: translateY(-1px) scale(1.04);
  border-color: rgba(147, 197, 253, .44);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, .24), rgba(124, 58, 237, .32));
  border: 1px solid rgba(147, 197, 253, .22);
  color: #dbeafe;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .24);
  font-size: 21px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: min(520px, 62vw);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}

.user-status,
.save-status {
  color: #cbd5e1;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.save-status.ok { color: #86efac; }
.save-status.error { color: #fca5a5; }

.profile-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}

.profile-icon {
  flex: 0 0 auto;
  font-size: 38px;
  color: #93c5fd;
}

.profile-card strong,
.profile-card span {
  display: block;
  overflow-wrap: anywhere;
}

.profile-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-data {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0;
}

.profile-data .info {
  margin: 0;
}

.profile-shell {
  width: min(760px, 100%);
  margin: 0 auto;
}

.profile-panel {
  text-align: center;
}

.profile-panel .settings-actions {
  max-width: 520px;
  margin-inline: auto;
}

.profile-card {
  justify-content: center;
  text-align: left;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-metric,
.profile-data-card {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  padding: 11px;
}

.profile-metric {
  display: grid;
  place-items: center;
  gap: 4px;
}

.profile-metric .bi {
  color: #93c5fd;
  font-size: 18px;
}

.profile-metric strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.profile-metric span,
.profile-data-card span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.profile-data-card {
  text-align: left;
}

.profile-data-card b {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 12px;
}

.profile-hero-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  text-align: left;
}

.profile-banner {
  min-height: 96px;
  background:
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--accent-2) 34%, transparent), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 32%, var(--panel)), var(--panel-2));
}

.profile-hero-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 0 16px 16px;
  margin-top: -32px;
}

.profile-avatar {
  width: 86px;
  height: 86px;
  border: 4px solid var(--panel);
  border-radius: 24px;
  object-fit: cover;
  background: var(--surface-2);
}

.profile-hero-content h3 {
  margin: 34px 0 2px;
  font-size: clamp(1.25rem, 4vw, 2rem);
}

.profile-hero-content p {
  margin: 8px 0 0;
  color: var(--muted);
}

.profile-form-grid .wide {
  grid-column: 1 / -1;
}

.public-profile-editor h4 {
  margin: 4px 0 0;
  font-size: 1rem;
}

.profile-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.api-chip-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.api-chip {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px 7px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: #d1d5db;
  font-size: 12px;
}

.api-chip.ok {
  border-color: rgba(34, 197, 94, .34);
  background: rgba(34, 197, 94, .10);
  color: #dcfce7;
}

.api-chip small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

.profile-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.profile-panel {
  padding: clamp(14px, 2.2vw, 22px);
  text-align: left;
}

.profile-panel > h2 {
  text-align: center;
  margin-bottom: 14px;
}

.profile-data {
  gap: 14px;
  margin: 14px 0 0;
}

.profile-overview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: stretch;
  overflow: hidden;
  border-radius: 18px;
}

.profile-overview.has-profile-background::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--panel) 82%, transparent), color-mix(in srgb, var(--panel) 42%, transparent)),
    var(--profile-bg) center / cover no-repeat;
  opacity: .42;
  pointer-events: none;
}

.profile-overview > * {
  position: relative;
  z-index: 1;
}

.profile-hero-card,
.public-profile-editor,
.profile-side-panel {
  border: 1px solid color-mix(in srgb, var(--accent-2) 22%, rgba(255,255,255,.10));
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)),
    color-mix(in srgb, var(--panel) 88%, #111827);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
}

.profile-banner {
  min-height: 150px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, .40), rgba(124, 58, 237, .34) 52%, rgba(16, 185, 129, .18)),
    radial-gradient(circle at 16% 16%, rgba(255,255,255,.22), transparent 28%);
}

.profile-banner.has-profile-banner {
  min-height: 190px;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, .06), rgba(2, 6, 23, .56)),
    var(--profile-banner) center / cover no-repeat;
}

.profile-hero-content {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 0 clamp(16px, 2.4vw, 24px) clamp(16px, 2.4vw, 24px);
  margin-top: -46px;
}

.profile-avatar {
  width: clamp(92px, 11vw, 118px);
  height: clamp(92px, 11vw, 118px);
  border-radius: 26px;
  border: 5px solid color-mix(in srgb, var(--panel) 88%, #020617);
  box-shadow: 0 16px 38px rgba(0,0,0,.32);
}

.profile-identity {
  min-width: 0;
  padding-top: 46px;
}

.profile-identity h3 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
}

.profile-identity span {
  display: block;
  margin-top: 5px;
  color: color-mix(in srgb, var(--accent-2) 72%, #fff);
  font-weight: 800;
}

.profile-identity p {
  margin: 10px 0 0;
  color: #cbd5e1;
  line-height: 1.45;
}

.profile-public-link {
  align-self: end;
  white-space: nowrap;
}

.profile-metrics {
  grid-template-columns: 1fr;
  gap: 10px;
}

.profile-metric,
.profile-data-card,
.profile-empty-state {
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 16px;
  background: rgba(15, 23, 42, .62);
}

.profile-metric {
  min-height: 88px;
  grid-template-columns: auto 1fr;
  place-items: initial;
  align-items: center;
  padding: 14px;
  text-align: left;
}

.profile-metric .bi {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
  color: color-mix(in srgb, var(--accent-2) 78%, #fff);
}

.profile-metric strong {
  font-size: 24px;
  line-height: 1;
}

.profile-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: 14px;
}

.public-profile-editor,
.profile-side-panel {
  padding: clamp(14px, 2vw, 20px);
}

.public-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.public-profile-head b,
.public-profile-head span {
  display: block;
}

.public-profile-head b {
  font-size: 17px;
}

.public-profile-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-form-grid label {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-form-grid .control {
  margin-top: 7px;
  min-height: 44px;
}

.profile-socials-panel {
  margin-top: 16px;
  border-color: rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .56);
}

.profile-socials-panel[open] .socials-grid {
  margin-top: 12px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.profile-actions .btn {
  min-height: 44px;
}

.public-profile-editor > small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
}

.profile-account-grid {
  grid-template-columns: 1fr;
}

.profile-data-card {
  padding: 13px;
}

.profile-side-panel .api-chip-grid {
  justify-content: flex-start;
  margin-top: 14px;
}

.api-chip {
  border-radius: 14px;
}

.profile-empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 140px;
  padding: 20px;
  text-align: center;
}

.profile-empty-state .bi {
  font-size: 28px;
  color: var(--accent-2);
}

@media (max-width: 980px) {
  .profile-overview,
  .profile-grid-layout {
    grid-template-columns: 1fr;
  }

  .profile-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-account-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .profile-panel {
    padding: 12px;
  }

  .profile-hero-content {
    grid-template-columns: 1fr;
    align-items: start;
    text-align: center;
  }

  .profile-avatar {
    margin-inline: auto;
  }

  .profile-identity {
    padding-top: 0;
  }

  .profile-public-link {
    width: 100%;
    justify-content: center;
  }

  .profile-metrics,
  .profile-account-grid,
  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .profile-metric {
    min-height: 72px;
  }

  .profile-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .profile-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

h1 {
  font-size: clamp(24px, 5vw, 36px);
  margin: 0;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
}

.sub {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 4px;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 11px;
  font-size: 12px;
  white-space: nowrap;
}

.searchbox {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.search-filter-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.searchbox input {
  width: 100%;
  min-width: 0;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
  outline: none;
  font-size: 16px;
}

.primary {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff;
  border-radius: 14px;
  padding: 0 16px;
  font-weight: 700;
  min-height: 48px;
}

.filters {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 0 2px 2px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }

select {
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--text);
  color-scheme: dark;
  border-radius: 999px;
  padding: 9px 11px;
  font-size: 13px;
  outline: none;
  min-width: max-content;
}

select:hover {
  border-color: rgba(147, 197, 253, .48);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .08);
}

select:focus {
  border-color: rgba(14, 165, 233, .8);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .14);
}

select.has-value {
  border-color: rgba(14, 165, 233, .8);
  background: linear-gradient(135deg, rgba(14, 165, 233, .18), rgba(124, 58, 237, .14));
  color: #f8fafc;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .10);
}

select option {
  background: color-mix(in srgb, var(--panel) 92%, #000);
  color: #f8fafc;
}

select option:checked {
  background: #2563eb;
  color: #fff;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}

.toolbar .left,
.toolbar .right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar .right { justify-content: flex-start; }

.ghost {
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 13px;
  min-height: 38px;
}

.ghost:hover,
.smallbtn:hover,
.linkbtn:hover,
.primary:hover,
.select-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(147, 197, 253, .52);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

.ghost:active,
.smallbtn:active,
.linkbtn:active,
.primary:active,
.select-btn:active {
  transform: translateY(0) scale(.97);
}

.ghost.active {
  border-color: rgba(124, 58, 237, .85);
  background: rgba(124, 58, 237, .18);
}

.select-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  max-width: 100%;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 9px;
  font-size: 13px;
}

.select-btn.has-value {
  border-color: rgba(14, 165, 233, .82);
  background: linear-gradient(135deg, rgba(14, 165, 233, .18), rgba(124, 58, 237, .14));
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .10);
}

.select-btn select {
  min-width: 0;
  max-width: 132px;
  padding: 0 18px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  color-scheme: dark;
}

.select-btn select:focus {
  box-shadow: none;
}

.select-btn select option {
  background: #0f172a;
  color: #f8fafc;
}

.select-btn select option:checked {
  background: #2563eb;
  color: #fff;
}

.select-btn .bi {
  color: #cbd5e1;
}

.stats {
  font-size: 12px;
  color: var(--muted);
}

.query-hints {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin: -2px 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.infinite-status {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 4px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: #cbd5e1;
  font-size: 13px;
}

.infinite-status[hidden] {
  display: none;
}

.infinite-status .bi {
  color: #93c5fd;
}

.infinite-status .bi-arrow-repeat,
.loading-icon .bi {
  animation: spin 1s linear infinite;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  gap: 12px;
}

.grid.list {
  display: flex;
  flex-direction: column;
}

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .20);
  min-width: 0;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(147, 197, 253, .28);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
}

.adult-blur .poster,
.adult-blur .cover-fallback,
.poster--blurred-adult {
  filter: blur(14px) saturate(.75);
  transform: scale(1.04);
}

.episode-thumb--blurred {
  filter: blur(18px);
  transform: scale(1.12);
}

.adult-blur-badge {
  position: absolute;
  inset: auto 10px 10px 10px;
  z-index: 4;
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-weight: 800;
}

.catalog-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.catalog-pagination-shell {
  margin: 18px auto 8px;
  color: var(--muted);
}

.catalog-pagination-shell[hidden] {
  display: none;
}

.catalog-page-select {
  width: auto;
  min-height: 38px;
  padding-block: 7px;
}

.card:active {
  transform: translateY(-1px) scale(.99);
}

.card:hover .poster {
  transform: scale(1.035);
}

.poster-wrap {
  position: relative;
  width: 100%;
  padding: 0;
  text-align: inherit;
  color: inherit;
  background: var(--panel-2);
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.poster,
.cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster {
  transition: transform .32s ease, filter .32s ease;
}

.cover-fallback {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px;
  color: #fff;
  text-align: left;
  background:
    linear-gradient(160deg, rgba(8, 11, 16, .08), rgba(8, 11, 16, .76)),
    linear-gradient(135deg, #0f766e, #312e81 52%, #7c2d12);
}

.cover-fallback.korea { background: linear-gradient(145deg, #831843, #312e81 56%, #0f172a); }
.cover-fallback.asia { background: linear-gradient(145deg, #0f766e, #1e3a8a 56%, #111827); }
.cover-fallback.west { background: linear-gradient(145deg, #334155, #7c2d12 56%, #111827); }
.cover-fallback.other { background: linear-gradient(145deg, #374151, #4338ca 56%, #111827); }

.cover-fallback span {
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.cover-fallback strong {
  font-size: clamp(18px, 8vw, 28px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.badge {
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
  border-radius: 999px;
  padding: 5px 7px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge.green { background: rgba(34, 197, 94, .78); }
.badge.purple { background: rgba(124, 58, 237, .78); }
.badge.orange { background: rgba(245, 158, 11, .82); }

.content { padding: 10px; }

.title {
  background: transparent;
  color: var(--text);
  text-align: left;
  width: 100%;
  padding: 0;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}

.meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.source-box {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(14, 165, 233, .22);
  border-radius: 12px;
  background: rgba(14, 165, 233, .08);
  color: #dbeafe;
}

.source-box:hover {
  border-color: rgba(147, 197, 253, .42);
  background: rgba(14, 165, 233, .12);
  transform: translateY(-1px);
}

.source-box.compact {
  margin: 8px 0 0;
  padding: 8px;
}

.source-box-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.source-box-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-box-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 5px;
  color: #bfdbfe;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.source-box-row .bi {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #93c5fd;
}

.source-box.compact .source-box-row {
  overflow: hidden;
}

.source-box.compact .source-box-row span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.genres {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tag {
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  padding: 4px 7px;
  border-radius: 999px;
}

.tag:hover {
  color: #fff;
  border-color: rgba(147, 197, 253, .35);
  background: rgba(14, 165, 233, .14);
  transform: translateY(-1px);
}

.audio-tag.audio-latino {
  color: #bbf7d0;
  background: rgba(34, 197, 94, .16);
  border-color: rgba(34, 197, 94, .28);
}

.audio-tag.audio-sub {
  color: #e9d5ff;
  background: rgba(168, 85, 247, .16);
  border-color: rgba(168, 85, 247, .3);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.smallbtn {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 12px;
  min-width: 0;
}

.smallbtn.ok {
  background: rgba(34, 197, 94, .16);
  border-color: rgba(34, 197, 94, .38);
}

.smallbtn.save {
  background: rgba(124, 58, 237, .16);
  border-color: rgba(124, 58, 237, .38);
}

.smallbtn.danger {
  background: rgba(239, 68, 68, .14);
  border-color: rgba(248, 113, 113, .38);
  color: #fecaca;
}

.grid.list .card {
  display: grid;
  grid-template-columns: 86px 1fr;
}

.grid.list .poster-wrap {
  min-height: 129px;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, .03);
}

.loading-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
}

.loading-state strong {
  color: #f8fafc;
  font-size: 16px;
}

.loading-state span:not(.loading-icon) {
  color: var(--muted);
  font-size: 13px;
}

.loading-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, .35);
  background: rgba(14, 165, 233, .12);
  color: #93c5fd;
  font-size: 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  right: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: auto;
  min-width: 248px;
  transform: translateX(-50%);
  background: rgba(8, 11, 16, .9);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .46);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, 48px);
  grid-auto-flow: column;
  grid-auto-columns: 48px;
  gap: 6px;
  max-width: calc(100vw - 18px);
  overflow-x: auto;
  scrollbar-width: none;
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

.navbtn {
  position: relative;
  background: transparent;
  color: var(--muted);
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 16px;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}

.navbtn::before {
  display: none;
}

.navbtn:hover {
  color: #fff;
  transform: translateY(-2px);
}

.navbtn:active {
  transform: translateY(0) scale(.96);
}

.navbtn span {
  display: none;
}

.navbtn.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 72%, transparent), color-mix(in srgb, var(--accent-2) 64%, transparent));
  border-color: color-mix(in srgb, var(--accent-2) 42%, transparent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 28%, transparent);
}

.ico {
  font-size: 21px;
  line-height: 1;
  transition: transform .22s ease;
}

.navbtn.active .ico {
  transform: translateY(-1px) scale(1.08);
}

.navbtn:hover .ico {
  transform: translateY(-1px) rotate(-4deg);
}

.tab-animate {
  animation: tabFade .24s ease both;
}

@keyframes tabFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  max-width: none;
}

dialog::backdrop {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
}

.detail-modal {
  width: min(940px, calc(100vw - 18px));
  max-height: min(88svh, 860px);
  overflow: auto;
  background: linear-gradient(180deg, #0f172a, #080b10);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: var(--shadow);
  border-radius: 18px;
}

.detail-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, .92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.x {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: white;
  font-size: 19px;
  padding: 0;
}

.detail-modal-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
}

.modal-poster-shell {
  display: block;
  width: min(180px, 48vw);
}

.modal-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  object-fit: cover;
  background: #111827;
  overflow: hidden;
}

.modal-title {
  font-size: 24px;
  line-height: 1.08;
  margin: 0 0 7px;
  overflow-wrap: anywhere;
}

.synopsis {
  color: #d1d5db;
  font-size: 14px;
  line-height: 1.55;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0;
}

.info {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 9px;
}

.info:hover {
  border-color: rgba(147, 197, 253, .28);
  background: rgba(255, 255, 255, .065);
  transform: translateY(-2px);
}

.info b {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.info b .bi {
  color: #93c5fd;
}

.info span { font-size: 13px; }

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.linkbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.media-detail-page,
.episode-page {
  display: grid;
  gap: 14px;
}

#routeTab.has-route-backdrop {
  position: relative;
  isolation: isolate;
}

#routeTab.has-route-backdrop::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--route-backdrop) center center / cover no-repeat;
}

#routeTab.has-route-backdrop::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 10, 18, .96) 0%, rgba(5, 10, 18, .66) 48%, rgba(5, 10, 18, .9) 100%),
    linear-gradient(180deg, rgba(5, 10, 18, .1) 0%, rgba(5, 10, 18, .7) 55%, var(--bg) 100%);
}

.media-detail-page.has-backdrop {
  position: relative;
  overflow: hidden;
  margin-inline: calc(var(--bs-gutter-x, .75rem) * -1);
  padding: 14px max(14px, var(--bs-gutter-x, .75rem)) 24px;
  border-radius: 0 0 18px 18px;
}

.media-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.media-poster-shell {
  width: min(220px, 62vw);
}

.media-page-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  object-fit: cover;
  background: #111827;
  overflow: hidden;
}

.has-backdrop .media-page-poster {
  box-shadow: 0 22px 70px rgba(0, 0, 0, .45);
}

.media-page-title,
.episode-head h2 {
  margin: 6px 0 0;
  font-size: clamp(26px, 6vw, 44px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.media-trailer-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: rgba(15, 23, 42, .72);
}

.media-trailer-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-trailer-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
}

.media-trailer-panel iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  background: #050a12;
}

.episode-number-line {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  font-weight: 800;
  color: #bfdbfe;
}

.episode-title-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.episodes-section {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 14px;
}

.episodes-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 18px;
}

.episodes-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 12px;
}

.episode-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 12px;
  background: rgba(15, 23, 42, .78);
}

.episode-view-toggle .btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
}

.episode-view-toggle .btn.active {
  color: #fff;
  background: rgba(59, 130, 246, .24);
  border-color: rgba(147, 197, 253, .36);
}

.episodes-grid,
.server-buttons {
  display: grid;
  gap: 10px;
}

.episodes-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.server-buttons {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.server-group {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.server-group:first-child { border-top: 0; }

.server-group h4 {
  margin: 0;
  font-size: .9rem;
  color: var(--muted);
}

.third-party-notice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 78%, transparent);
  color: var(--muted);
  font-size: .88rem;
}

.terms-dialog {
  width: min(560px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
}

.terms-dialog::backdrop { background: rgba(0, 0, 0, .68); }

.terms-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 20px;
}

.terms-card [data-close-terms] {
  position: absolute;
  right: 10px;
  top: 10px;
}

.episodes-grid.episodes-list {
  grid-template-columns: 1fr;
}

.episodes-more {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 0 6px;
}

.episodes-more .btn {
  min-width: min(260px, 100%);
}

.episodes-more small,
.episodes-more.done {
  color: var(--muted);
  font-size: 13px;
}

.episodes-more.done {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .04);
}

.episode-pagination-shell {
  margin: 18px auto 4px;
  color: var(--muted);
}

.episode-pagination-shell.is-loading {
  opacity: .72;
  pointer-events: none;
}

.episode-pagination .btn.active {
  color: #fff;
  background: rgba(59, 130, 246, .24);
  border-color: rgba(147, 197, 253, .38);
}

.player-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 4px 0 10px;
}

.player-toolbar .btn.active {
  border-color: rgba(250, 204, 21, .7);
  color: #fef3c7;
  background: rgba(250, 204, 21, .16);
}

.episode-page.player-size-stage .player-container {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.episode-page.player-size-small .player-container {
  width: min(720px, 100%);
  margin-inline: auto;
}

body.lights-off #playerContainer iframe {
  box-shadow: 0 24px 80px rgba(0, 0, 0, .65);
}

body.dev-mode::after {
  content: "DEV";
  position: fixed;
  z-index: 200;
  right: 12px;
  bottom: 76px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font: 800 12px/1 system-ui, sans-serif;
  letter-spacing: 0;
}

.loading-icon.compact {
  width: 18px;
  height: 18px;
  font-size: 14px;
}

.server-buttons .active {
  border-color: rgba(34, 197, 94, .7);
  background: linear-gradient(135deg, rgba(34, 197, 94, .28), rgba(14, 165, 233, .16));
  color: #dcfce7;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
}

.server-buttons .active .bi {
  color: #86efac;
}

.episode-card {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 8px;
  border: 1px solid rgba(147, 197, 253, .24);
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  text-align: left;
  overflow: hidden;
}

.episodes-tile-grid .episode-card {
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  min-height: 178px;
  padding: 10px;
}

.episodes-tile-grid .episode-card .episode-thumb,
.episodes-tile-grid .episode-card .episode-thumb-fallback {
  grid-column: 1 / -1;
  width: 100%;
  border-radius: 10px;
}

.episodes-tile-grid .episode-card .episode-card-info {
  padding-top: 2px;
}

.episode-card:focus-visible,
.episode-card:focus,
.episode-view-toggle .btn:focus-visible,
.episode-nav .btn:focus-visible,
.servers-container .btn:focus-visible {
  outline: 3px solid rgba(96, 165, 250, .95);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(37, 99, 235, .24);
}

.episodes-grid.episodes-list .episode-card {
  grid-template-columns: 140px minmax(0, 1fr) auto;
  min-height: 96px;
}

.episodes-grid.episodes-list .episode-thumb,
.episodes-grid.episodes-list .episode-thumb-fallback {
  width: 140px;
}

.episode-thumb,
.episode-thumb-fallback {
  width: 82px;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  background: #111827;
  object-fit: cover;
  display: block;
}

.episode-thumb-fallback {
  display: grid;
  align-content: end;
  gap: 2px;
  padding: 7px;
  background:
    linear-gradient(160deg, rgba(8, 11, 16, .08), rgba(8, 11, 16, .78)),
    linear-gradient(135deg, #7c2d12, #312e81 58%, #0f766e);
}

.episode-thumb-fallback.generated-cover {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .22), transparent 30%),
    linear-gradient(160deg, rgba(8, 11, 16, .08), rgba(8, 11, 16, .82)),
    linear-gradient(135deg, var(--ep-a), var(--ep-b) 58%, var(--ep-c));
}

.episode-thumb-fallback strong {
  font-size: 20px;
  line-height: 1;
}

.episode-thumb-fallback small {
  color: rgba(255, 255, 255, .78);
  font-size: 9px;
  line-height: 1.1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.episode-card-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.episode-card-info span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-card-info small {
  color: var(--muted);
  font-size: 11px;
}

.episode-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.episode-check-btn {
  border-color: rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .12);
}

.episode-check-btn.is-watched,
.smallbtn.is-watched {
  border-color: rgba(34, 197, 94, .64);
  background: rgba(34, 197, 94, .22);
  color: #dcfce7;
}

.player-container {
  min-height: 220px;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: #020617;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.player-container:empty::before {
  content: "Selecciona un servidor";
  color: var(--muted);
  font-size: 13px;
}

.player-container iframe,
.player-container video {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  display: block;
}

.servers-container {
  display: grid;
  gap: 10px;
}

.episode-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.episode-nav .btn {
  min-height: 42px;
}

.episode-nav .btn:disabled {
  cursor: not-allowed;
  opacity: .45;
  transform: none;
  box-shadow: none;
}

.drawer {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: none;
}

.drawer.show { display: block; }

.drawer-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(440px, 92vw);
  background: #0b1220;
  border-left: 1px solid rgba(255, 255, 255, .1);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow: auto;
}

.drawer h2 { margin: 0 0 12px; }

.field { margin: 12px 0; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: #080b10;
  border: 1px solid var(--line);
  color: #fff;
  border-radius: 13px;
  padding: 12px;
  outline: none;
}

.notice {
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 10px;
  margin: 10px 0;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .04);
  border-radius: 12px;
  margin: 8px 0;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}

.history-poster {
  width: 76px;
  aspect-ratio: 2 / 3;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #111827;
}

.history-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
}

.history-row strong,
.history-row span,
.history-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-row span {
  color: #cbd5e1;
  font-size: 13px;
}

.history-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.history-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.library-tabs-hidden {
  display: none !important;
}

.list-picker-modal {
  width: min(520px, calc(100vw - 18px));
}

.list-picker-body {
  padding: 14px;
}

.list-picker-body p {
  margin: 0 0 10px;
  color: var(--muted);
}

#listPickerOptions {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.list-choice {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
}

.settings-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.settings-panel {
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
  padding: 14px;
}

.settings-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.panel-copy {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.setting-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.setting-row strong {
  display: block;
  font-size: 14px;
}

.setting-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.credential-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.credential-panel summary::-webkit-details-marker {
  display: none;
}

.credential-panel summary h2 {
  margin: 0;
}

.credential-panel[open] summary {
  margin-bottom: 12px;
}

.credential-panel[open] summary .bi-chevron-down {
  transform: rotate(180deg);
}

.mini-segment {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 12px;
  background: rgba(15, 23, 42, .78);
}

.mini-segment .btn {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--muted);
}

.mini-segment .btn.active {
  color: #fff;
  background: rgba(59, 130, 246, .24);
  border-color: rgba(147, 197, 253, .36);
}

.theme-row {
  align-items: start;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  width: min(520px, 100%);
}

.theme-panel summary,
.theme-panel summary::-webkit-details-marker {
  list-style: none;
}

.theme-panel summary::-webkit-details-marker {
  display: none;
}

.theme-panel summary,
.credential-panel summary {
  min-height: 42px;
}

.theme-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.theme-panel summary h2 {
  margin: 0;
}

.theme-panel[open] summary {
  margin-bottom: 10px;
}

.theme-panel[open] summary .bi-chevron-down {
  transform: rotate(180deg);
}

.theme-panel[open] .theme-options {
  max-height: 292px;
  overflow: auto;
  padding-right: 4px;
}

.settings-subtitle {
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 14px;
}

.font-options {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}

.theme-option {
  justify-content: flex-start;
  gap: 10px;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.theme-option.active {
  border-color: color-mix(in srgb, var(--accent-2) 58%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, var(--surface-2)), color-mix(in srgb, var(--accent-2) 16%, var(--surface-2)));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 14%, transparent);
}

.theme-swatches {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  width: 44px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
}

.theme-swatches i {
  display: block;
  flex: 1 1 0;
}

.hero,
.bottom-nav,
.settings-panel,
.drawer-panel,
.auth-card,
.detail-modal,
.card,
.list-row,
.managed-list-item,
.history-row {
  border-color: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, .10));
}

.primary,
.navbtn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.brand-mark {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 32%, transparent), color-mix(in srgb, var(--accent) 42%, transparent));
}

.theme-option strong,
.theme-option small,
.theme-option em {
  display: block;
}

.theme-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.theme-option em {
  margin-top: 5px;
  color: color-mix(in srgb, var(--accent-2) 70%, #fff);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.sources-panel {
  grid-column: 1 / -1;
}

.source-settings-tools {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
}

.source-settings-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

#sourceSettingsEnabled.source-settings-list,
#sourceSettingsDisabled.source-settings-list {
  display: grid;
}

.source-search {
  margin: 4px 0 12px;
  min-height: 42px;
  background: rgba(15, 23, 42, .84);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.source-search::placeholder {
  color: #64748b;
}

.source-search:focus {
  background: rgba(15, 23, 42, .96);
  color: #fff;
  border-color: rgba(96, 165, 250, .65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
}

.source-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  scrollbar-width: none;
}

.source-category-tabs::-webkit-scrollbar {
  display: none;
}

.source-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid rgba(148, 163, 184, .20);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.source-category-chip b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: var(--muted);
  font-size: 10px;
}

.source-category-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(147, 197, 253, .44);
}

.source-category-chip.active {
  border-color: rgba(34, 211, 238, .48);
  background: linear-gradient(135deg, rgba(14, 165, 233, .28), rgba(124, 58, 237, .20));
  color: #fff;
}

.source-category-chip.active b {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.source-group-block {
  margin-top: 12px;
}

.source-group-title {
  margin: 10px 0 8px;
  font-size: 14px;
  color: #dbeafe;
}

.source-group-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.source-disabled-details {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 10px;
}

.source-disabled-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.source-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 90%, transparent), color-mix(in srgb, var(--surface-1) 78%, transparent));
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}

.source-setting.is-disabled {
  opacity: .58;
  background: rgba(255, 255, 255, .025);
}

.source-setting-main {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.source-setting-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(14, 165, 233, .12);
  color: #93c5fd;
}

.source-setting-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.source-setting strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.source-setting p {
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(147, 197, 253, .12);
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.source-pill.kind,
.source-pill.free,
.source-pill.key {
  display: none;
}

.source-pill.status,
.source-pill.stability,
.source-pill.kind,
.source-pill.key {
  border: 1px solid rgba(255, 255, 255, .08);
}

.source-pill.ok {
  background: rgba(34, 197, 94, .14);
  color: #bbf7d0;
}

.source-pill.stable {
  background: rgba(20, 184, 166, .14);
  color: #ccfbf1;
}

.source-pill.dev {
  background: rgba(59, 130, 246, .14);
  color: #bfdbfe;
}

.source-pill.unknown {
  background: rgba(148, 163, 184, .13);
  color: #e2e8f0;
}

.source-pill.free {
  background: rgba(34, 197, 94, .12);
  color: #bbf7d0;
}

.source-pill.adult {
  background: rgba(244, 63, 94, .14);
  color: #fecdd3;
}

.source-pill.info {
  background: rgba(168, 85, 247, .14);
  color: #e9d5ff;
}

.source-pill.warn {
  background: rgba(245, 158, 11, .14);
  color: #fde68a;
}

.source-pill.danger {
  background: rgba(239, 68, 68, .14);
  color: #fecaca;
}

.source-toggle {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.secret-field {
  position: relative;
}

.secret-field input {
  padding-right: 46px;
}

.secret-toggle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
}

.icon-actions {
  grid-template-columns: repeat(3, 42px);
  justify-content: start;
}

.icon-only {
  width: 40px;
  min-width: 40px;
  height: 38px;
  padding: 0;
}

.library-list-grid,
.managed-list,
.history-list {
  display: grid;
  gap: 10px;
}

.library-list-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 12px;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 12px;
  background: rgba(15, 23, 42, .46);
}

.list-row.active {
  border-color: rgba(124, 58, 237, .62);
  background: linear-gradient(135deg, rgba(124, 58, 237, .18), rgba(14, 165, 233, .08));
}

.list-row-main {
  justify-content: flex-start;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 4px 6px;
  color: var(--text);
  text-align: left;
}

.list-row-main strong,
.list-row-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row-main span {
  color: var(--muted);
  font-size: 12px;
}

.list-detail-head,
.managed-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}

.managed-list-item {
  grid-template-columns: 74px minmax(0, 1fr) auto;
}

.managed-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.managed-grid .managed-list-item,
.managed-big .managed-list-item {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.managed-grid .history-poster,
.managed-big .history-poster {
  width: 100%;
  aspect-ratio: 16 / 10;
}

.managed-big {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.managed-big .history-poster {
  aspect-ratio: 3 / 4;
}

.library-view-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
}

.library-view-toggle[hidden] {
  display: none;
}

.library-view-toggle .active {
  border-color: rgba(147, 197, 253, .48);
  background: rgba(59, 130, 246, .2);
  color: #fff;
}

.community-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed rgba(148, 163, 184, .28);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.community-empty .bi {
  font-size: 28px;
  color: var(--accent-2);
}

.list-detail-head {
  margin: 2px 0 10px;
  padding: 0 2px 8px;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  border-radius: 0;
  background: transparent;
}

.list-detail-head strong {
  display: block;
  font-size: 15px;
}

.list-detail-head span {
  color: var(--muted);
  font-size: 12px;
}

.managed-list-item strong,
.managed-list-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.managed-list-item span {
  color: var(--muted);
  font-size: 12px;
}

.adult-enabled .hero {
  border-bottom-color: rgba(244, 63, 94, .28);
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  transition: .2s;
  max-width: calc(100vw - 24px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.install-toast {
  position: fixed;
  z-index: 110;
  left: 50%;
  bottom: 150px;
  width: min(420px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(15, 23, 42, .94);
  color: #f8fafc;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(16px);
  transition: .22s;
}

.install-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.install-toast .bi {
  color: #93c5fd;
  font-size: 18px;
}

@media (min-width: 520px) {
  .searchbox { grid-template-columns: 1fr auto; }
  .primary { min-width: 116px; }
  .toolbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .toolbar .right { justify-content: flex-end; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info.wide { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .top-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .user-box {
    flex: 1 1 100%;
    max-width: none;
  }
  .user-status {
    flex: 1 1 auto;
  }
  .profile-metrics {
    grid-template-columns: 1fr;
  }
  .source-settings-list {
    grid-template-columns: 1fr;
  }
  .source-setting {
    grid-template-columns: 1fr;
  }
  .source-toggle {
    justify-items: start;
  }
  .history-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .list-detail-head,
  .managed-list-item {
    grid-template-columns: 1fr;
  }
  .managed-list-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .managed-list-item .history-poster {
    width: 64px;
    min-height: 78px;
  }
  .managed-list-item .history-actions {
    grid-column: 1 / -1;
  }
  .managed-grid .managed-list-item,
  .managed-big .managed-list-item {
    grid-template-columns: 1fr;
  }
  .managed-grid .history-poster,
  .managed-big .history-poster {
    width: 100%;
    min-height: 0;
  }
  .history-poster {
    width: 58px;
  }
  .history-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .history-actions .smallbtn {
    flex: 1 1 120px;
  }
  .episode-nav {
    grid-template-columns: 1fr;
  }
  .episodes-toolbar {
    justify-content: stretch;
  }
  .episode-view-toggle {
    width: 100%;
  }
  .episode-view-toggle .btn {
    flex: 1 1 0;
  }
  .episodes-grid.episodes-list .episode-card,
  .episode-card {
    grid-template-columns: 96px minmax(0, 1fr) auto;
  }
  .episodes-grid.episodes-list .episode-thumb,
  .episodes-grid.episodes-list .episode-thumb-fallback,
  .episode-thumb,
  .episode-thumb-fallback {
    width: 96px;
  }
}

@media (min-width: 700px) {
  .app,
  .hero { padding-inline: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
  .episodes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .media-detail-page.has-backdrop {
    padding-top: 18px;
  }
  .media-detail-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
  }
  .media-poster-shell { width: 240px; }
  .detail-modal-body {
    grid-template-columns: 190px 1fr;
    padding: 18px;
    gap: 18px;
  }
  .modal-poster-shell { width: 190px; }
  .modal-title { font-size: 30px; }
  .settings-shell { grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); }
  .settings-actions { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 980px) {
  body { padding-bottom: 112px; }
  .hero { padding-block: 16px; }
  .bottom-nav {
    bottom: 18px;
    width: auto;
    min-width: 248px;
    max-width: calc(100vw - 36px);
    grid-template-columns: repeat(auto-fit, 48px);
    grid-auto-flow: column;
    grid-auto-columns: 48px;
    justify-content: center;
  }
  .navbtn {
    padding: 0;
  }
  .toast { bottom: 112px; }
  .install-toast { bottom: 132px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .episodes-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #routeTab.has-route-backdrop::before {
    background-position: center 24%;
  }
  .grid.list .card { grid-template-columns: 110px 1fr; }
  .grid.list .poster-wrap { min-height: 165px; }
}

@media (min-width: 1280px) and (pointer: coarse), (min-width: 1280px) and (hover: none) {
  .episode-card,
  .episode-view-toggle .btn,
  .episode-nav .btn,
  .servers-container .btn {
    min-height: 58px;
  }
  .episodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }
}

.public-profile-editor,
.community-panel,
.public-profile-page,
.public-list-page {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow);
}

.public-profile-head,
.community-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.public-list-head {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.public-profile-head span,
.community-toolbar span,
.community-card p,
.public-list-head p,
.community-owner,
.public-list-head a {
  color: var(--muted);
}

.profile-form-grid,
.community-publish {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.profile-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .88rem;
}

.public-profile-editor {
  display: grid;
  gap: 16px;
}

.profile-form-grid .control,
.community-publish .control,
.community-search .control {
  width: 100%;
  background: var(--field);
  color: var(--field-text);
}

.community-search {
  min-width: min(320px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.community-search .control {
  border: 0;
  background: transparent;
  padding-inline: 0;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.community-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-height: 310px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.community-cover,
.public-list-hero {
  overflow: hidden;
  min-width: 0;
  min-height: 138px;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 6px;
  padding: 18px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .42);
}

.community-cover strong,
.public-list-hero strong {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1;
}

.community-card-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.community-title {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.community-owner,
.public-list-head a,
.community-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.community-card-meta,
.community-actions,
.profile-actions,
.public-list-actions,
.public-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.community-card-meta span {
  font-size: .88rem;
}

.public-profile-hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.public-profile-hero img,
.avatar-fallback {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 2rem;
}

.public-profile-hero h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.public-verified-check {
  display: inline-grid;
  place-items: center;
  color: #38bdf8;
  font-size: .72em;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, .34));
}

.public-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(56, 189, 248, .32);
  border-radius: 999px;
  background: rgba(8, 47, 73, .62);
  color: #bae6fd;
  font-weight: 800;
  font-size: 13px;
}

.public-profile-hero p {
  color: var(--muted);
  margin: 8px 0 12px;
}

@media (max-width: 720px) {
  .public-profile-head,
  .community-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .public-list-head {
    grid-template-columns: 1fr;
  }

  .public-profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-hero-content {
    grid-template-columns: 1fr;
  }
}

.grid.big-image .card .poster-wrap {
  min-height: min(72vh, 520px);
}

.community-editor-modal {
  width: min(720px, calc(100vw - 24px));
}

.community-editor-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.community-edit-items {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.community-edit-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.public-profile-page,
.community-page {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin-inline: auto;
}

.public-profile-page {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.public-profile-page.has-public-background::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 10, 18, .46), var(--bg) 82%), var(--public-profile-bg) center center / cover no-repeat;
}

.public-profile-back {
  justify-self: start;
}

.public-profile-hero,
.community-hero,
.community-section,
.public-profile-section {
  border: 1px solid color-mix(in srgb, var(--line) 86%, var(--accent) 14%);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .82), rgba(8, 12, 20, .94)),
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 20%, transparent), transparent 34%);
  box-shadow: var(--shadow);
}

.public-profile-hero {
  grid-template-columns: 124px minmax(0, 1fr) minmax(170px, 240px);
  align-items: end;
  gap: 22px;
  padding: clamp(18px, 3vw, 28px);
  margin: 0;
  min-height: 252px;
  background:
    linear-gradient(180deg, rgba(4, 8, 14, .18), rgba(4, 8, 14, .86)),
    var(--public-banner, linear-gradient(135deg, rgba(15, 23, 42, .82), rgba(8, 12, 20, .94))) center center / cover no-repeat;
}

.public-profile-avatar img,
.public-profile-avatar .avatar-fallback {
  width: 124px;
  height: 124px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .34);
}

.public-profile-main {
  min-width: 0;
}

.public-profile-main h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: .98;
}

.public-profile-handle {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent-2);
  font-weight: 800;
}

.public-profile-main p {
  max-width: 680px;
  color: var(--muted);
  margin: 12px 0 14px;
}

.public-profile-stats {
  display: grid;
  gap: 10px;
}

.public-profile-stats div {
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 23, 42, .58);
}

.public-profile-stats strong {
  display: block;
  font-size: 1.45rem;
}

.public-profile-stats span,
.public-profile-section-head span,
.community-section-head span,
.community-hero p {
  color: var(--muted);
}

.public-profile-section,
.community-section {
  padding: clamp(14px, 2.2vw, 20px);
}

.public-profile-section-head,
.community-section-head,
.community-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.public-profile-section-head {
  margin-bottom: 14px;
}

.public-profile-section-head h3,
.community-section-head h3,
.community-hero h2 {
  margin: 0;
}

.public-featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.community-page {
  padding-bottom: 72px;
}

.community-hero {
  padding: clamp(18px, 3vw, 28px);
}

.community-hero h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

.community-section-head {
  margin-bottom: 14px;
}

.community-user-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 220px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.community-user-card,
.community-user-row {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, .58);
}

.community-user-card {
  position: relative;
  display: block;
  min-height: 188px;
  padding: 14px;
  border-radius: 18px;
  scroll-snap-align: start;
}

.community-user-main {
  color: var(--text);
  text-decoration: none;
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
  padding-right: 42px;
}

.community-user-like {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 40px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, .78);
  color: var(--muted);
  font-weight: 900;
}

.community-user-like.liked {
  color: #fb7185;
  border-color: rgba(251, 113, 133, .42);
  background: rgba(127, 29, 29, .34);
}

.community-user-card img,
.community-user-card .community-user-avatar,
.community-user-row img,
.community-user-row > span {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: cover;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.community-user-card strong,
.community-user-row strong {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.community-user-card small,
.community-user-row small {
  color: var(--muted);
}

.community-user-card em {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(8, 47, 73, .62);
  color: #bae6fd;
  font-style: normal;
  font-weight: 800;
  font-size: .78rem;
}

.community-user-results,
.community-user-grid {
  display: grid;
  gap: 10px;
}

.community-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
}

.public-like-btn.liked,
.community-card-meta .liked {
  color: #fb7185;
  border-color: rgba(251, 113, 133, .34);
}

.public-like-btn.liked {
  background: rgba(127, 29, 29, .32);
}

.inline-setting {
  margin: 0;
}

.list-order-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.community-user-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
}

.community-user-grid .community-user-card {
  min-width: 0;
  min-height: 164px;
  height: 100%;
}

.community-user-grid .community-user-main {
  height: 100%;
}

.community-user-grid .community-user-card strong,
.community-user-grid .community-user-card small {
  width: 100%;
}

.community-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-items: stretch;
}

.community-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.community-card {
  min-width: 0;
  overflow: hidden;
}

.community-cover {
  min-width: 0;
  background-size: cover;
  background-position: center;
}

.community-cover strong,
.community-title,
.community-owner span,
.community-user-card strong,
.community-user-card small,
.community-user-row strong,
.community-user-row small {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-cover strong,
.community-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.community-owner,
.community-card-meta,
.community-actions {
  min-width: 0;
}

.community-card p {
  display: -webkit-box;
  min-height: 2.6em;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.community-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.community-actions .icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}

.community-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  color: var(--muted);
}

.public-profile-like.liked,
.public-profile-like.liked i {
  color: #fb7185;
}

.public-profile-joined {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.public-list-link-wrap {
  display: flex;
  justify-content: flex-end;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.admin-user-grid .wide {
  grid-column: 1 / -1;
}

@media (max-width: 860px) {
  .public-profile-hero,
  .community-hero,
  .public-profile-section-head,
  .community-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .public-profile-hero {
    grid-template-columns: 1fr;
  }

  .public-profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .community-search {
    width: 100%;
  }

  .community-user-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .community-user-row .public-admin-badge {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .public-profile-stats {
    grid-template-columns: 1fr;
  }

  .public-profile-avatar img,
  .public-profile-avatar .avatar-fallback {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }

  .community-user-rail {
    grid-auto-columns: minmax(154px, 76vw);
  }

  .community-user-grid {
    grid-template-columns: 1fr;
  }

  .community-user-grid .community-user-card {
    min-height: 132px;
  }
}

.admin-page {
  display: grid;
  gap: 14px;
}

.admin-head,
.admin-toolbar,
.admin-record-head,
.admin-actions,
.admin-form-actions,
.admin-pager,
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-head {
  justify-content: space-between;
}

.admin-head h2 {
  margin: 0;
}

.admin-head span,
.admin-toolbar label span,
.admin-field small {
  color: var(--muted);
}

.admin-toolbar {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 88%, #000 12%);
}

.admin-toolbar .wide {
  flex: 2 1 320px;
}

.admin-d1-toolbar {
  align-items: end;
}

.admin-source-toolbar {
  position: sticky;
  top: 8px;
  z-index: 2;
}

.admin-tabs .active {
  border-color: var(--accent);
  color: var(--text);
}

.admin-unavailable {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.admin-unavailable ul {
  margin: 10px 0 0;
}

.admin-scroll-list {
  display: grid;
  gap: 10px;
  max-height: min(68vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.admin-source-summary {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: fit-content;
  color: var(--muted);
  font-size: .9rem;
}

.admin-source-summary strong {
  color: var(--text);
}

.admin-manage-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(110px, auto)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.admin-manage-row > div,
.admin-manage-row label {
  display: grid;
  gap: 5px;
}

.admin-manage-row span,
.admin-manage-row small {
  color: var(--muted);
}

.admin-manage-row .wide {
  grid-column: span 2;
}

.admin-user-details {
  margin-top: 0;
  display: grid;
  gap: 12px;
}

.admin-user-editor-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-3) 74%, #000 26%);
}

.admin-user-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
}

.admin-user-summary-meta {
  justify-self: end;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-3) 72%, transparent);
  font-size: .78rem;
}

.admin-source-setting {
  grid-template-columns: minmax(0, 1fr);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 92%, #000 8%);
}

.admin-source-controls,
.admin-inline-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 160px)) repeat(3, minmax(220px, 1fr));
  gap: 10px;
  align-items: end;
}

.admin-source-controls label,
.admin-inline-actions label {
  display: grid;
  gap: 5px;
  min-width: 120px;
}

.admin-source-controls .wide {
  min-width: 0;
}

.admin-source-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.admin-public-list-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.admin-public-list-cover {
  min-height: 132px;
  border-radius: 12px;
  display: grid;
  place-items: end start;
  padding: 10px;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  background-size: cover;
  background-position: center;
}

.admin-public-list-cover span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-weight: 800;
}

.admin-public-list-body {
  display: grid;
  gap: 10px;
}

.admin-public-list-body label {
  display: grid;
  gap: 5px;
}

.admin-toolbar label,
.admin-field {
  display: grid;
  gap: 6px;
}

.admin-toolbar label {
  flex: 1 1 180px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-list,
.admin-detail {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-list {
  max-height: min(70vh, 760px);
  overflow: auto;
  padding-right: 4px;
}

.admin-row {
  width: 100%;
  justify-content: start;
  text-align: left;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 90%, #000 10%);
  color: var(--text);
  padding: 12px;
}

.admin-row.active,
.admin-field.manual {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}

.admin-row small,
.admin-row span {
  color: color-mix(in srgb, var(--text) 74%, transparent);
}

.admin-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-detail {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 92%, #000 8%);
}

.admin-record-head {
  justify-content: space-between;
}

.admin-meta-grid,
.admin-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-edit-form,
.admin-edit-section,
.admin-record-meta {
  display: grid;
  gap: 12px;
}

.admin-edit-section {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-3) 62%, #000 38%);
}

.admin-edit-section legend {
  float: none;
  width: auto;
  margin: 0 0 8px;
  padding: 0;
  color: var(--text);
  font-size: .92rem;
  font-weight: 800;
}

.admin-payload-summary {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-3) 76%, #000 24%);
}

.admin-payload-summary img,
.admin-payload-fallback {
  width: 86px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  object-fit: cover;
  background: color-mix(in srgb, var(--surface-2) 70%, #000 30%);
}

.admin-payload-fallback {
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--text) 70%, transparent);
}

.admin-payload-summary h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.admin-payload-summary span {
  color: color-mix(in srgb, var(--text) 76%, transparent);
  font-size: .9rem;
}

.admin-payload-summary p {
  margin: 8px 0 0;
  color: color-mix(in srgb, var(--text) 82%, transparent);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.adsense-slot {
  display: none;
  min-height: 96px;
  margin: 12px 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.adsense-slot.is-active {
  display: block;
}

.admin-detail .profile-data-card {
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-3) 72%, #000 28%);
}

.admin-detail .profile-data-card b,
.admin-field > span {
  color: var(--text);
}

.admin-detail .profile-data-card span,
.admin-json-panel summary,
.admin-field small {
  color: color-mix(in srgb, var(--text) 76%, transparent);
}

.admin-field.wide,
.admin-edit-form .admin-form-actions,
.admin-json-panel {
  grid-column: 1 / -1;
}

.admin-field textarea {
  resize: vertical;
}

.admin-json-panel pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-json-panel textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--text);
}

.admin-source-json {
  grid-column: 1 / -1;
  width: 100%;
}

@media (max-width: 820px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-manage-row {
    grid-template-columns: 1fr;
  }

  .admin-manage-row .wide {
    grid-column: auto;
  }

  .admin-public-list-card {
    grid-template-columns: 1fr;
  }

  .admin-source-controls,
  .admin-inline-actions {
    grid-template-columns: 1fr;
  }
}

/* Modern responsive surfaces */
.settings-shell,
.profile-shell,
.admin-page,
#libraryTab > .glass {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.settings-shell {
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  align-items: start;
}

.settings-panel {
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .16);
}

.sources-panel {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 90%, transparent), color-mix(in srgb, var(--surface-1) 86%, transparent));
}

.source-settings-tools {
  position: sticky;
  top: 8px;
  z-index: 3;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 94%, #000 6%);
}

.source-category-tabs {
  padding: 6px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-1) 74%, transparent);
}

.source-category-chip {
  min-height: 34px;
  padding: 7px 10px;
}

.source-category-chip span {
  white-space: nowrap;
}

.library-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.list-row {
  min-height: 74px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 88%, transparent), color-mix(in srgb, var(--surface-1) 82%, transparent));
}

.list-row-main strong {
  font-size: 16px;
}

.managed-list-item {
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, .45fr)) auto;
  align-items: end;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
}

.admin-toolbar label,
.admin-toolbar .wide {
  flex: unset;
  min-width: 0;
}

.admin-source-setting {
  padding: 16px;
  border-radius: 14px;
}

.admin-source-controls {
  grid-template-columns: repeat(3, minmax(96px, 140px)) minmax(220px, 1fr) minmax(180px, .8fr) minmax(180px, .8fr);
}

.admin-source-controls textarea {
  min-height: 48px;
  max-height: 92px;
}

.admin-scroll-list {
  max-height: min(70vh, 760px);
  padding: 2px 6px 2px 0;
}

.admin-manage-row {
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
}

.admin-manage-row summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 14px;
  cursor: pointer;
}

.admin-manage-row summary span:last-child {
  min-width: 0;
}

.admin-manage-row summary strong,
.admin-manage-row summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 34%, transparent), color-mix(in srgb, var(--accent-2) 30%, transparent));
  color: #fff;
  font-weight: 900;
}

.admin-user-details {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
  padding: 0 14px 14px 68px;
}

.admin-public-list-card {
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
}

@media (max-width: 980px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .admin-toolbar,
  .admin-source-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .settings-panel,
  .sources-panel,
  .admin-source-setting,
  .admin-toolbar,
  .list-row,
  .managed-list-item {
    border-radius: 12px;
  }

  .setting-row,
  .source-setting,
  .admin-toolbar,
  .admin-source-controls,
  .admin-public-list-card {
    grid-template-columns: 1fr;
  }

  .theme-options {
    grid-template-columns: 1fr;
  }

  .source-settings-tools {
    position: static;
  }

  .source-setting {
    align-items: stretch;
  }

  .source-toggle {
    justify-items: stretch;
  }

  .source-toggle.form-switch {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .admin-user-details {
    padding: 0 14px 14px;
  }

  .admin-public-list-card {
    grid-template-columns: 1fr;
  }

  .admin-public-list-cover {
    min-height: 160px;
  }
}

body.theme-glass :is(.glass, .auth-card, .hero, .search-filter-panel, .toolbar, .bottom-nav, .settings-panel, .theme-option, .source-setting, .source-category-tabs, .drawer-panel, .detail-modal, .detail-modal-head, .card, .list-row, .managed-list-item, .history-row, .profile-card, .profile-socials-panel, .profile-metric, .profile-data-card, .profile-hero-card, .community-panel, .community-card, .community-user-card, .community-user-row, .community-section, .community-hero, .public-profile-hero, .public-profile-section, .community-empty, .episode-page, .episode-card, .server-group, .servers-container, .notice, .toast, .mini-segment) {
  background:
    linear-gradient(145deg, var(--glass-shine), transparent 34%),
    linear-gradient(180deg, var(--glass-bg-2), var(--glass-bg) 55%, var(--glass-bg-soft));
  border-color: var(--glass-border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .30), var(--glass-inset);
  backdrop-filter: blur(var(--glass-blur)) saturate(130%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(130%);
}

body.theme-glass :is(input, select, textarea, .form-control, .control, .ghost, .smallbtn, .linkbtn, .select-btn, .source-category-chip, .api-chip, .community-user-like) {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .14), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035));
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 10px 24px rgba(0, 0, 0, .12);
  backdrop-filter: blur(calc(var(--glass-blur) * .72)) saturate(125%);
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) * .72)) saturate(125%);
}

body.theme-glass .search-filter-panel,
body.theme-glass .toolbar {
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
}

body.theme-glass .search-filter-panel .searchbox,
body.theme-glass .search-filter-panel .filters {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-glass .select-btn select,
body.theme-glass .select-btn select:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-glass .filters select,
body.theme-glass .searchbox input {
  min-height: 46px;
  border-color: rgba(226, 232, 240, .18);
}

body.theme-glass .hero {
  border-bottom-color: var(--glass-border);
}
