:root {
  --bg: #0b0d12;
  --bg2: #12151d;
  --card: #181c26;
  --text: #eef0f6;
  --muted: #9aa2b5;
  --accent: #7c5cff;
  --accent2: #5b8cff;
  --danger: #ff5c7c;
  --radius: 12px;
  --poster-radius: 2px;
  --glass-bg: rgba(20, 24, 35, .52);
  --glass-bg-strong: rgba(20, 24, 35, .72);
  --glass-border: rgba(255, 255, 255, .08);
  --glass-highlight: rgba(255, 255, 255, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100%;
}

body {
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
}

/* ambient glow behind the glass */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 78% -8%, rgba(124, 92, 255, .22), transparent 62%),
    radial-gradient(700px 500px at -10% 30%, rgba(91, 140, 255, .14), transparent 60%),
    radial-gradient(800px 600px at 55% 115%, rgba(124, 92, 255, .10), transparent 65%);
}

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

.hidden { display: none !important; }
.view { min-height: 100vh; }

/* ---------- liquid glass scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.10));
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 10px rgba(124, 92, 255, .18);
  transition: box-shadow .2s;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.2));
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 0 14px rgba(124, 92, 255, .45);
}
*::-webkit-scrollbar-corner { background: transparent; }
.row-strip::-webkit-scrollbar { height: 7px; }
.row-strip::-webkit-scrollbar-thumb { border-width: 2px; }
.row-strip::-webkit-scrollbar-thumb:hover { border-width: 1px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, transform .1s, border-color .15s;
  touch-action: manipulation;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 26px rgba(124, 92, 255, .35);
}
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }

/* ---------- login ---------- */
#view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 372px;
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
}
.login-logo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin-bottom: 14px;
  filter: drop-shadow(0 10px 30px rgba(124, 92, 255, .45));
}
.brand {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand.small { font-size: 20px; }
.brand-sub { color: var(--muted); margin: 6px 0 26px; font-size: 14px; }
#login-form { text-align: left; }
#login-form label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}
#login-form input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: rgba(10, 12, 18, .6);
  color: var(--text);
  font-size: 15px;
}
#login-form input:focus { outline: none; border-color: var(--accent); }
#login-form .btn { margin-top: 6px; }
.error {
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

/* ---------- topbar ---------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  padding-top: calc(12px + env(safe-area-inset-top));
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo { width: 30px; height: 30px; border-radius: 50%; }
.topbar-right { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
#search-input {
  width: 240px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(10, 12, 18, .55);
  color: var(--text);
  font-size: 14px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
#search-input:focus { outline: none; border-color: var(--accent); }
#search-input::placeholder { color: #5f6880; }

/* ---------- shell + rail ---------- */
#shell { display: flex; align-items: flex-start; gap: 8px; }

#rail {
  position: sticky;
  top: 76px;
  flex: 0 0 auto;
  width: 96px;
  margin: 14px 0 24px 16px;
  border-radius: 18px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  transition: background .15s, color .15s;
}
.rail-item:hover { background: var(--glass-highlight); color: var(--text); }
.rail-item.active {
  background: linear-gradient(135deg, rgba(124, 92, 255, .28), rgba(91, 140, 255, .20));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .35);
}
.rail-icon { width: 24px; height: 24px; display: block; }
.rail-icon svg { width: 24px; height: 24px; display: block; }
.rail-label { line-height: 1; }

#content { flex: 1; min-width: 0; padding-bottom: 60px; }

/* ---------- rows ---------- */
.row { margin: 24px 0 6px; }
.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 28px 12px;
}
.row-title { font-size: 19px; font-weight: 700; margin: 0; }
.see-all { color: var(--muted); font-size: 13px; text-decoration: none; }
.see-all:hover { color: var(--text); }
.row-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 28px 14px;
  scroll-behavior: smooth;
}
.card {
  flex: 0 0 auto;
  width: 150px;
  cursor: pointer;
  transition: transform .15s;
  outline: none;
}
.card:hover { transform: translateY(-3px); }

/* App-style focus glow (white ring + accent bloom), like the TV app */
.card:focus-visible,
.card.nav-focus {
  transform: translateY(-3px) scale(1.04);
}
.card:focus-visible .card-poster,
.card.nav-focus .card-poster {
  animation: cardGlowPulse 1.9s ease-in-out infinite;
}
.card:focus-visible .card-poster::after,
.card.nav-focus .card-poster::after { opacity: 1; }
@keyframes cardGlowPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .82), 0 0 26px rgba(124, 92, 255, .55), 0 16px 40px rgba(0, 0, 0, .5);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .95), 0 0 48px rgba(124, 92, 255, .95), 0 16px 40px rgba(0, 0, 0, .5);
  }
}
.card-poster {
  position: relative;
  width: 150px;
  height: 225px;
  border-radius: var(--poster-radius);
  overflow: hidden;
  background: #1a1f2c;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}
.card:hover .card-poster {
  box-shadow: 0 16px 38px rgba(0, 0, 0, .45), 0 0 24px rgba(124, 92, 255, .22);
}
.card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* glass sheen over posters (GlassTokens: hairline 14%, inset highlight 8%) */
.card-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(150deg,
      rgba(255, 255, 255, .34) 0%,
      rgba(255, 255, 255, .16) 18%,
      rgba(255, 255, 255, .05) 38%,
      rgba(255, 255, 255, 0) 58%),
    linear-gradient(0deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
    linear-gradient(330deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 30%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 0 0 1px rgba(255, 255, 255, .08);
  opacity: .9;
  transition: opacity .2s;
}
.card:hover .card-poster::after { opacity: 1; }
.card-poster .fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; text-align: center; padding: 10px;
}
.card-title {
  margin-top: 8px;
  font-size: 13px;
  color: #cdd3e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-sub { font-size: 12px; color: #6d7690; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, .5);
}
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0, 0, 0, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 7px;
}

/* ---------- cw drop ---------- */
.drop-btn {
  position: absolute;
  left: 6px;
  bottom: 10px;
  width: auto;
  height: auto;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, .8);
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s, background .15s, color .15s, border-color .15s;
  z-index: 3;
}
.card:hover .drop-btn { opacity: .85; }
.drop-btn:hover {
  background: rgba(255, 70, 100, .85);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
  opacity: 1;
}
.drop-btn[disabled] { opacity: .4; }

/* ---------- grids ---------- */
.page-title { font-size: 26px; font-weight: 800; margin: 18px 28px 6px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px 14px;
  padding: 16px 28px 8px;
}
.grid .card, .grid .card-poster { width: 100%; }
.grid .card-poster { height: auto; aspect-ratio: 2 / 3; }
.load-more { display: block; margin: 18px auto 50px; min-width: 180px; }
.muted-note { color: var(--muted); font-size: 14px; padding: 22px 28px; }

/* ---------- search landing ---------- */
.search-landing { padding: 60px 28px; max-width: 640px; }
.search-landing input {
  width: 100%;
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--text);
  font-size: 17px;
}
.search-landing input:focus { outline: none; border-color: var(--accent); }

/* ---------- details ---------- */
#view-details { position: relative; }
.details-hero {
  position: relative;
  min-height: 62vh;
  background-size: cover;
  background-position: center top;
}
.details-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,13,18,.25) 0%, rgba(11,13,18,.85) 78%, var(--bg) 100%);
}
.details-inner {
  position: relative;
  z-index: 2;
  padding: 110px 48px 30px;
  max-width: 900px;
}
.details-back { margin-bottom: 18px; }
.details-title { font-size: 42px; font-weight: 800; margin: 0 0 10px; }
.details-logo { max-width: 320px; max-height: 110px; margin-bottom: 10px; }
.details-meta { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.details-desc { color: #c8cede; font-size: 15px; line-height: 1.55; max-width: 720px; }
.details-actions { margin-top: 22px; display: flex; gap: 12px; }
.episodes { padding: 0 48px 60px; max-width: 1000px; }
.season-picker { display: flex; gap: 10px; align-items: center; margin: 20px 0 14px; color: var(--muted); }
.season-picker select {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
}
.episode {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.episode:hover { background: var(--glass-highlight); border-color: var(--glass-border); }
.episode-thumb {
  flex: 0 0 140px; height: 79px; border-radius: var(--poster-radius); overflow: hidden;
  background: #1a1f2c; border: 1px solid rgba(255, 255, 255, .14);
  position: relative;
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .04) 32%, rgba(255, 255, 255, 0) 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.episode-info { flex: 1; min-width: 0; }
.episode-name { font-size: 15px; font-weight: 600; }
.episode-sub { color: var(--muted); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-progress { height: 3px; background: rgba(255,255,255,.15); border-radius: 2px; margin-top: 8px; }
.episode-progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 2px; }
.episode .watched-mark { color: #59d18c; font-size: 13px; flex: 0 0 auto; }

/* ---------- player ---------- */
#view-player { position: fixed; inset: 0; z-index: 10; background: #000; }
#player-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 12;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  padding-top: calc(10px + env(safe-area-inset-top));
  color: #cfd6e6; font-size: 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .78), rgba(0, 0, 0, .3));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
#player-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: #000; object-fit: contain;
}
.tap-play {
  position: absolute; inset: 0; z-index: 11;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: rgba(0, 0, 0, .25);
}
.tap-play span {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: #fff; padding-left: 6px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}

#load-logo {
  position: absolute; inset: 0; z-index: 9;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(11, 13, 18, .55), rgba(11, 13, 18, .85));
}
#load-logo img {
  animation: logoPulse 1.2s ease-in-out infinite;
  filter: drop-shadow(0 18px 50px rgba(124, 92, 255, .45));
}
#load-logo img.title-logo {
  width: min(44vw, 360px);
  max-height: 24vh;
  object-fit: contain;
}
#load-logo img.brand-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); opacity: .92; }
  50% { transform: scale(1.06); opacity: 1; }
}
#player-status {
  position: fixed; left: 18px; bottom: calc(14px + env(safe-area-inset-bottom));
  color: #cfd6e6; font-size: 13px;
  background: rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 7px 14px; border-radius: 10px;
  z-index: 40;
}

/* ---------- modal ---------- */
#modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 6, 10, .6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  width: min(640px, 94vw);
  max-height: 80vh;
  border-radius: 18px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 700;
}
#modal-body { overflow-y: auto; padding: 8px; }
.source {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius); cursor: pointer;
}
.source:hover { background: var(--glass-highlight); }
.source-main { min-width: 0; }
.source-name { font-size: 14px; font-weight: 600; }
.source-file { color: var(--muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 460px; }
.source-size { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.source-warn { color: #ffd9a0; font-size: 12px; flex: 0 0 auto; margin-right: 8px; }

/* ---------- decades ---------- */
.decade-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 28px;
}
.decade-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  padding: 26px 22px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  transition: transform .15s, box-shadow .2s;
}
.decade-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(124, 92, 255, .28);
}

/* ---------- sync page ---------- */
.sync-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.sync-card { flex: 1 1 260px; margin: 14px 10px; }
.sync-line { color: #c8cede; font-size: 13px; margin-top: 6px; }
.sync-controls { display: flex; gap: 6px; margin-top: 12px; }
.sync-controls .active-mode {
  background: rgba(124, 92, 255, .25);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .4);
}
.ledger-rows { display: flex; flex-direction: column; gap: 2px; }
.ledger-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.ledger-row:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.ledger-when { color: var(--muted); flex: 0 0 78px; font-size: 12px; }
.ledger-what { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c8cede; }
.ledger-src { color: #6d7690; font-size: 12px; flex: 0 0 auto; }

/* ---------- settings / admin ---------- */
.settings-card {
  max-width: 560px;
  margin: 18px 28px;
  border-radius: 18px;
  padding: 22px 24px;
}
.settings-who { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.settings-sub { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.user-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.settings-title { font-size: 15px; font-weight: 700; margin: 14px 0 10px; }
.settings-form { display: flex; flex-direction: column; gap: 10px; }
.settings-form input,
.prompt-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: rgba(10, 12, 18, .6);
  color: var(--text);
  font-size: 15px;
}
.settings-form input:focus, .prompt-input:focus { outline: none; border-color: var(--accent); }
.settings-form .btn { align-self: flex-start; }
.user-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, .03);
}
.user-info { min-width: 0; flex: 1; }
.user-name { font-size: 14px; font-weight: 600; }
.user-key { font-size: 12px; color: var(--muted); margin-top: 2px; }
.user-actions { display: flex; gap: 6px; flex: 0 0 auto; margin-left: auto; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(255, 92, 124, .12); }

.confirm-msg { padding: 16px 18px; color: #c8cede; font-size: 15px; line-height: 1.5; }
.debug-log {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
  max-height: 220px;
  overflow: auto;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 12px;
  color: #b9c2d8;
}
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 4px 14px 16px; }
.prompt-label { display: block; padding: 14px 18px 4px; color: var(--muted); font-size: 13px; }
.prompt-input { margin-top: 8px; }

@media (max-width: 900px) {
  .settings-card { margin: 14px 18px; padding: 18px; }
}

/* ---------- touch ---------- */
@media (hover: none) {
  .drop-btn { opacity: .8; }
  .card:hover { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #rail { width: 72px; margin-left: 10px; padding: 10px 6px; }
  .rail-label { display: none; }
  .rail-item { padding: 12px 4px; }
  #topbar { flex-wrap: wrap; gap: 10px; padding-left: 16px; padding-right: 16px; }
  .topbar-right { width: 100%; order: 3; }
  #search-input { flex: 1; width: auto; min-width: 0; font-size: 16px; }
  #who { display: none; }
  .page-title { margin-left: 18px; margin-right: 18px; }
  .row-head { margin-left: 18px; margin-right: 18px; }
  .row-strip { padding-left: 18px; padding-right: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px 10px; padding: 12px 18px 8px; }
  .card, .card-poster { width: 126px; }
  .card-poster { height: 189px; }
  .grid .card-poster { height: auto; }
  .muted-note { padding-left: 18px; padding-right: 18px; }
  .search-landing { padding: 30px 18px; }
  .details-hero { min-height: 46vh; }
  .details-inner { padding: 80px 22px 20px; }
  .details-title { font-size: 30px; }
  .episodes { padding: 0 14px 50px; }
  .episode-thumb { flex-basis: 104px; height: 59px; }
  .modal-box { max-height: 86vh; }
  .source-file { max-width: 58vw; }
}

@media (max-width: 480px) {
  #rail {
    position: fixed;
    left: 8px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    top: auto;
    margin: 0;
    width: auto;
    flex-direction: row;
    padding: 8px;
    z-index: 25;
  }
  .rail-item { padding: 10px 12px; }
  #content { padding-bottom: 90px; }
}
