:root {
  --bg: #0b0b0e;
  --bg-2: #111116;
  --surface: #17171d;
  --surface-2: #1f1f27;
  --line: #2a2a33;
  --text: #ececf1;
  --muted: #9a9aa6;
  --accent: #e5202b;
  --accent-2: #ff3b47;
  --accent-soft: rgba(229, 32, 43, 0.15);
  --sakura: #ff9fb8;
  --radius: 10px;
  --nav-h: 64px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Poppins, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
main { flex: 1; }

/* ---------------------------------------------------------------- nav */
#nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: linear-gradient(180deg, rgba(11, 11, 14, 0.98), rgba(11, 11, 14, 0.92));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1400px; margin: 0 auto; height: 100%;
  padding: 0 20px;
  display: flex; align-items: center; gap: 22px;
}
.logo img { height: 46px; width: auto; filter: drop-shadow(0 0 10px rgba(229, 32, 43, 0.35)); }
.nav-links { display: flex; gap: 18px; font-weight: 500; color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.search {
  flex: 1; max-width: 520px; margin-left: auto;
  display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; height: 40px;
}
.search input {
  flex: 1; background: none; border: 0; outline: 0; color: var(--text);
  font: inherit; font-size: 14px;
}
.search input::placeholder { color: var(--muted); }
.search svg { width: 18px; height: 18px; fill: var(--muted); }
.nav-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6b0d12);
  display: grid; place-items: center; font-weight: 700; text-transform: uppercase;
}
.nav-user .name { font-weight: 500; }
.nav-user .role { font-size: 11px; color: var(--sakura); text-transform: uppercase; letter-spacing: 0.06em; }
.icon-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 500;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.discord-nav-btn { display: inline-flex; align-items: center; gap: 6px; color: #c9ccff; border-color: rgba(88, 101, 242, 0.55); }
.discord-nav-btn:hover { color: #fff; border-color: #7b83ff; background: rgba(88, 101, 242, 0.18); }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- layout */
.container { max-width: 1400px; margin: 0 auto; padding: 24px 20px 60px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

.section { margin-bottom: 36px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  margin: 0; font-size: 20px; font-weight: 600;
  display: flex; align-items: center; gap: 12px;
}
.section-title::before {
  content: ""; width: 4px; height: 22px; background: var(--accent); border-radius: 2px;
  box-shadow: 0 0 12px var(--accent);
}
.section-head a { color: var(--muted); font-size: 13px; }
.section-head a:hover { color: var(--accent-2); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; height: 420px; border-radius: 14px; overflow: hidden;
  background: var(--surface); margin-bottom: 36px; box-shadow: var(--shadow);
}
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease;
  display: flex; align-items: flex-end;
}
.hero-slide.active { opacity: 1; }
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center 25%;
  transform: scale(1.03);
}
.hero-slide.blur .hero-bg { filter: blur(24px) brightness(0.6); transform: scale(1.2); }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 11, 14, 0.96) 0%, rgba(11, 11, 14, 0.75) 45%, rgba(11, 11, 14, 0.15) 100%),
    linear-gradient(0deg, rgba(11, 11, 14, 0.95) 0%, rgba(11, 11, 14, 0) 60%);
}
.hero-content {
  position: relative; padding: 32px 40px; max-width: 640px;
  display: flex; gap: 24px; align-items: flex-end;
}
.hero-poster {
  width: 150px; aspect-ratio: 2/3; border-radius: 8px; object-fit: cover;
  box-shadow: var(--shadow); flex-shrink: 0;
}
.hero-spot { font-size: 12px; color: var(--accent-2); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-title { margin: 6px 0 8px; font-size: 30px; line-height: 1.15; font-weight: 700; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.hero-desc { color: var(--muted); font-size: 13px; max-height: 60px; overflow: hidden; margin-bottom: 16px; }
.hero-dots { position: absolute; right: 24px; bottom: 20px; display: flex; gap: 6px; }
.hero-dots button {
  width: 22px; height: 4px; border: 0; border-radius: 2px; background: rgba(255, 255, 255, 0.3);
  padding: 0;
}
.hero-dots button.active { background: var(--accent); }
@media (max-width: 700px) {
  .hero { height: 360px; }
  .hero-poster { display: none; }
  .hero-content { padding: 22px; }
  .hero-title { font-size: 22px; }
}

/* ---------------------------------------------------------------- chips & buttons */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 5px; padding: 2px 8px; font-size: 11px; font-weight: 500;
}
.chip.accent { background: var(--accent-soft); border-color: rgba(229, 32, 43, 0.4); color: var(--accent-2); }
.chip.pink { background: rgba(255, 159, 184, 0.12); border-color: rgba(255, 159, 184, 0.35); color: var(--sakura); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font-weight: 600; font-size: 14px;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn.ghost { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--line); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.danger { background: #4a1216; color: #ff9aa2; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ---------------------------------------------------------------- cards */
.grid {
  display: grid; gap: 18px 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card { position: relative; }
.card .poster {
  position: relative; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover .poster { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5); }
.card .poster img { width: 100%; height: 100%; object-fit: cover; }
.card .poster .fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 40px; font-weight: 700; color: rgba(255, 255, 255, 0.25);
  background: linear-gradient(160deg, #2a1a1e, #16161d);
}
.card .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(11, 11, 14, 0.55); opacity: 0; transition: opacity 0.2s;
}
.card:hover .play { opacity: 1; }
.card .play span {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent);
  display: grid; place-items: center; box-shadow: 0 0 20px rgba(229, 32, 43, 0.6);
}
.card .play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.badges { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 4px; }
.badge {
  background: rgba(11, 11, 14, 0.85); color: #fff; font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.02em; display: inline-flex; gap: 4px; align-items: center;
}
.badge.ep { background: var(--accent); }
.badge.cc { background: #2f6fed; }
.badge.ph { background: rgba(255, 159, 184, 0.9); color: #2a0f16; }
.card .progress-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.2);
}
.card .progress-bar i { display: block; height: 100%; background: var(--accent); }
.card .title {
  margin-top: 8px; font-weight: 500; font-size: 13px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card:hover .title { color: var(--accent-2); }
.card .sub { color: var(--muted); font-size: 11px; margin-top: 2px; display: flex; gap: 6px; }
.card .sub i { font-style: normal; }
.card .sub i + i::before { content: "•"; margin-right: 6px; opacity: 0.5; }

/* ---------------------------------------------------------------- sidebar */
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 24px; }
.side-box h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.side-box h3::before { content: ""; width: 3px; height: 18px; background: var(--accent); border-radius: 2px; }
.top-list { display: flex; flex-direction: column; }
.top-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.top-item:last-child { border-bottom: 0; }
.top-item .rank {
  width: 30px; font-size: 18px; font-weight: 700; color: var(--muted); text-align: center;
  border-right: 2px solid transparent;
}
.top-item:nth-child(1) .rank { color: var(--accent-2); border-color: var(--accent); }
.top-item:nth-child(2) .rank { color: var(--sakura); border-color: var(--sakura); }
.top-item:nth-child(3) .rank { color: #f5c542; border-color: #f5c542; }
.top-item img, .top-item .thumb { width: 44px; height: 62px; border-radius: 5px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.top-item .info { min-width: 0; flex: 1; }
.top-item .t {
  font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-item:hover .t { color: var(--accent-2); }
.top-item .m { color: var(--muted); font-size: 11px; display: flex; gap: 6px; margin-top: 4px; }

/* ---------------------------------------------------------------- show page */
.show-banner {
  position: relative; height: 320px; background-size: cover; background-position: center 30%;
  background-color: var(--surface);
}
.show-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(11, 11, 14, 0.6) 50%, rgba(11, 11, 14, 0.3) 100%);
}
.show-banner.blur { background-size: cover; filter: none; }
.show-banner.blur::before {
  content: ""; position: absolute; inset: 0; background: inherit; filter: blur(30px) brightness(0.7); transform: scale(1.2);
}
.show-head {
  position: relative; margin-top: -150px; display: flex; gap: 28px; align-items: flex-end;
}
.show-poster {
  width: 200px; aspect-ratio: 2/3; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  box-shadow: var(--shadow); background: var(--surface-2);
}
.show-info { flex: 1; min-width: 0; padding-bottom: 8px; }
.show-title { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 700; }
.show-alt { color: var(--muted); margin: 4px 0 12px; }
.show-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.show-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.show-desc { color: var(--muted); margin: 22px 0; max-width: 900px; white-space: pre-line; }
.show-desc.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.more-btn { background: none; border: 0; color: var(--accent-2); padding: 0; font-weight: 500; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 20px; margin-bottom: 26px; }
.details div { font-size: 13px; color: var(--muted); }
.details b { color: var(--text); font-weight: 500; margin-right: 6px; }
@media (max-width: 700px) {
  .show-head { flex-direction: column; align-items: flex-start; margin-top: -120px; }
  .show-poster { width: 140px; }
  .show-title { font-size: 24px; }
}

/* ---------------------------------------------------------------- episode list */
.ep-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ep-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.ep-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.ep-head select, .ep-head input {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px;
  padding: 5px 8px; font: inherit; font-size: 12px; outline: 0;
}
.ep-list {
  display: flex; flex-direction: column; max-height: 620px; overflow: auto;
  scrollbar-gutter: stable; overscroll-behavior: contain;
}
.ep-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px;
  min-height: 50px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line); position: relative; overflow: hidden;
}
.ep-item:hover { background: var(--surface-2); }
.ep-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ep-item .num {
  min-width: 34px; height: 30px; border-radius: 6px; background: var(--bg-2);
  display: grid; place-items: center; font-weight: 600; font-size: 12px; flex-shrink: 0;
}
.ep-item.active .num { background: var(--accent); }
.ep-item .et {
  display: flex; flex: 1; min-width: 0; flex-direction: column; justify-content: center;
  font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ep-item .et small {
  display: block; max-width: 100%; margin-top: 2px; color: var(--muted); font-size: 11px;
  line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ep-item .tags { display: flex; flex-shrink: 0; align-items: center; gap: 4px; }
.ep-item .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.ep-item .prog i { display: block; height: 100%; background: var(--accent); }
.ep-item .done { color: var(--sakura); font-size: 12px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; padding: 12px; }
.ep-grid a {
  display: grid; place-items: center; height: 36px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 12px; position: relative; overflow: hidden;
}
.ep-grid a:hover { border-color: var(--accent); color: var(--accent-2); }
.ep-grid a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-grid a.seen { color: var(--muted); }
.ep-grid a .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.ep-grid a .prog i { display: block; height: 100%; background: var(--sakura); }

/* ---------------------------------------------------------------- watch page */
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.crumbs a:hover { color: var(--accent-2); }
.crumbs span { color: var(--text); }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
@media (max-width: 1100px) { .watch-layout { grid-template-columns: 1fr; } }
.player-wrap {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  aspect-ratio: 16/9; box-shadow: var(--shadow);
}
.player-wrap video { width: 100%; height: 100%; background: #000; }
.player-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: rgba(0, 0, 0, 0.82); text-align: center; padding: 24px;
}
.player-overlay h3 { margin: 0; }
.player-overlay p { margin: 0; color: var(--muted); max-width: 480px; }
.next-toast {
  position: absolute; right: 16px; bottom: 70px; background: rgba(17, 17, 22, 0.95);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow);
}
.next-toast small { color: var(--muted); display: block; }
.player-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-top: 12px;
}
.player-bar .grow { flex: 1; }
.toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; cursor: pointer; user-select: none; }
.audio-choice { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.audio-choice select {
  min-height: 34px; padding: 5px 28px 5px 9px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg-2); color: var(--text); font: inherit; font-size: 12px; outline: 0;
}
.audio-choice select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.toggle input { accent-color: var(--accent); }
.now-playing { margin: 18px 0 6px; }
.now-playing h1 { margin: 0; font-size: 22px; font-weight: 600; }
.now-playing h1 a:hover { color: var(--accent-2); }
.now-playing p { margin: 4px 0 0; color: var(--muted); }
.watch-info {
  display: flex; gap: 20px; margin-top: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px;
}
.watch-info img { width: 120px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.watch-info h2 { margin: 0 0 6px; font-size: 18px; }
.watch-info p { color: var(--muted); margin: 10px 0 0; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-2); font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- auth */
.auth-page {
  min-height: calc(100vh - 20px); display: grid; place-items: center; padding: 30px 16px;
  background:
    radial-gradient(800px 400px at 50% -10%, rgba(229, 32, 43, 0.25), transparent 60%),
    radial-gradient(600px 300px at 90% 100%, rgba(255, 159, 184, 0.12), transparent 60%);
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.auth-card .logo { display: flex; justify-content: center; margin-bottom: 8px; }
.auth-card .logo img { height: 110px; }
.auth-tabs { display: flex; background: var(--bg-2); border-radius: 8px; padding: 4px; margin: 14px 0 18px; }
.auth-tabs button {
  flex: 1; border: 0; background: none; color: var(--muted); padding: 8px; border-radius: 6px; font-weight: 500;
}
.auth-tabs button.active { background: var(--surface-2); color: var(--text); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 10px 12px; font: inherit; outline: 0;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.auth-msg { color: #ff9aa2; font-size: 13px; min-height: 18px; margin: 8px 0 0; }
.auth-note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 14px; }
.auth-note b { color: var(--sakura); font-weight: 500; }

/* ---------------------------------------------------------------- admin */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td code { font-family: Consolas, monospace; background: var(--bg-2); padding: 2px 6px; border-radius: 4px; letter-spacing: 0.05em; }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; }
.inline-form input { flex: 1; }
.discover-search { max-width: 720px; margin-bottom: 20px; }
.vip-submission-title > span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.retention-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.retention-head h3 { margin-bottom: 5px; }
.retention-head p { margin: 0; max-width: 720px; font-size: 13px; line-height: 1.5; }
.retention-head .btn { flex: 0 0 auto; }
.retention-source { max-width: 620px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.retention-note { margin-top: 4px; font-size: 11px; white-space: nowrap; }
.role-select { width: 104px; min-width: 104px; padding: 6px 28px 6px 9px; }
.numbering-status { margin-top: 3px; font-size: 11px; white-space: nowrap; }
.numbering-status.verified { color: #6fe3a0; }
.numbering-status.review { color: #ff9aa2; }
.numbering-status.incomplete { color: #ffd36b; }
.badge.expiry, .chip.expiry { background: rgba(184, 134, 11, 0.22); border-color: rgba(255, 211, 107, 0.5); color: #ffe19a; }
.card-expiry { margin-top: 7px; min-height: 20px; }
.card-expiry .badge { display: inline-flex; position: static; font-size: 10px; padding: 3px 7px; }
.vip-submit-panel { margin: 16px 0 18px; border-color: rgba(255, 159, 184, 0.35); }
.vip-submit-panel h3 { margin-bottom: 6px; }
.vip-submit-panel p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.live-transfer { width: min(520px, 100%); display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.live-transfer .progress-bar { flex: 1; margin: 0; }
.live-transfer span { white-space: nowrap; }
.vip-panel-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr); gap: 22px; align-items: start; }
.vip-help { margin: -4px 0 14px; font-size: 13px; }
.vip-anime-form { margin-bottom: 14px; }
.loading.compact { min-height: 130px; }
.empty.compact { padding: 28px 12px; }
.vip-anime-list { display: grid; gap: 8px; max-height: 440px; overflow-y: auto; padding-right: 4px; }
.vip-anime-result { width: 100%; display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; color: var(--text); text-align: left; }
.vip-anime-result:hover { border-color: var(--accent); background: var(--surface-2); }
.vip-anime-result img, .vip-anime-result .fallback { width: 50px; height: 70px; border-radius: 6px; object-fit: cover; }
.vip-anime-result-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vip-anime-result-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vip-anime-result-main > span { color: var(--muted); font-size: 12px; }
.vip-selected-head { display: flex; gap: 14px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.vip-selected-head > img { width: 76px; height: 106px; border-radius: 7px; object-fit: cover; }
.vip-selected-head h3 { margin: 0 0 3px; }
.vip-selected-head p { margin: 0 0 10px; }
.vip-submission-list { display: grid; gap: 10px; }
.vip-submission { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-2); }
.vip-submission > img, .vip-submission > .fallback { width: 52px; height: 73px; border-radius: 6px; object-fit: cover; }
.vip-submission-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.vip-submission-title a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vip-submission-state { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.vip-submission-state .chip { font-size: 10px; padding: 3px 7px; }
@media (max-width: 1000px) { .vip-panel-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .vip-anime-result { grid-template-columns: 44px minmax(0, 1fr); }
  .vip-anime-result img, .vip-anime-result .fallback { width: 44px; height: 62px; }
  .vip-anime-result > .btn { grid-column: 2; justify-self: start; }
}
.chip.danger { background: rgba(229, 32, 43, 0.18); border-color: rgba(229, 32, 43, 0.55); color: #ff9aa2; }
@media (max-width: 640px) {
  .retention-head { align-items: stretch; flex-direction: column; }
  .retention-head .btn { align-self: flex-start; }
}

/* ---------------------------------------------------------------- misc */
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); margin: 0 0 8px; }
.notice {
  background: var(--accent-soft); border: 1px solid rgba(229, 32, 43, 0.4); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 20px; font-size: 13px;
}
.loading { display: grid; place-items: center; min-height: 60vh; }
.spinner {
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
footer {
  border-top: 1px solid var(--line); padding: 26px 20px; text-align: center; color: var(--muted); font-size: 12px;
}
.foot-logo { height: 40px; margin: 0 auto 8px; opacity: 0.7; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }

/* ---------------------------------------------------------------- additions: availability, discover, admin */
.badge.dl { background: #b8860b; }
.badge.off { background: rgba(120, 120, 135, 0.9); }
.badge.ok { background: #1f8f4e; }
.chip.ok { background: rgba(31, 143, 78, 0.18); border-color: rgba(31, 143, 78, 0.5); color: #6fe3a0; }
.chip.warn { background: rgba(184, 134, 11, 0.18); border-color: rgba(184, 134, 11, 0.5); color: #ffd36b; }
.chip.off { background: rgba(120, 120, 135, 0.15); border-color: rgba(120, 120, 135, 0.4); color: var(--muted); }
.nav-user .who { line-height: 1.2; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--muted); }
.tabs a.active, .tabs a:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 24px 0; }
.inp { flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px 12px; font: inherit; outline: 0; min-width: 0; }
.inp:focus { border-color: var(--accent); }
.table-wrap { overflow-x: auto; }
td.rel { max-width: 460px; }
td.rel a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.rel a:hover { color: var(--accent-2); }
td.actions { white-space: nowrap; text-align: right; }
.err { color: #ff9aa2; }
.player-overlay .spinner { width: 34px; height: 34px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; font-size: 13px;
  transition: all 0.25s; max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { border-color: rgba(229, 32, 43, 0.6); color: #ff9aa2; }
.side-box .details { margin-bottom: 0; }

/* signed-in Discord popup */
.discord-popup {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 20px;
  background: rgba(4, 4, 8, 0.78); backdrop-filter: blur(8px);
}
.discord-popup-card {
  position: relative; width: min(100%, 390px); padding: 30px;
  background: var(--surface); border: 1px solid rgba(88, 101, 242, 0.55);
  border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  text-align: center;
}
.discord-popup-icon {
  width: 58px; height: 58px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 16px;
  background: rgba(88, 101, 242, 0.18); font-size: 28px;
}
.discord-popup-card h2 { margin: 0 0 8px; font-size: 22px; }
.discord-popup-card p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.discord-popup-close {
  position: absolute; top: 10px; right: 12px; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 24px; line-height: 1;
}
.discord-popup-close:hover { background: var(--surface-2); color: var(--text); }
.discord-popup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.discord-popup-actions .btn { justify-content: center; }
.discord-join { background: #5865f2; }
.discord-join:hover { background: #6d78f6; }
@media (max-width: 900px) { .discord-nav-label { display: none; } }
@media (max-width: 600px) {
  .discord-nav-btn { padding: 6px 8px; }
  .discord-popup-actions { grid-template-columns: 1fr; }
}

/* sub / dub */
.badge.sub { background: #2f6fed; }
.badge.dub { background: #7c3aed; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 14px; font-weight: 500; font-size: 12px; }
.seg button.active { background: var(--accent); color: #fff; }
.show-meta .chip.accent { cursor: pointer; }
