@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #171512;
  --panel: #211d19;
  --panel-2: #2b2521;
  --marquee: #e8a33d;
  --marquee-dim: #a97a34;
  --teal: #2fa7a0;
  --text: #f2ede4;
  --text-dim: #b8b0a4;
  --danger: #d9634f;
  --accent-text: #171512;
  --backdrop-shade: rgba(23,21,18,.20);
  --soft-accent: rgba(232,163,61,.14);
  --shadow: rgba(0,0,0,.24);
}

[data-theme="netflix"] { --ink:#080808; --panel:#181818; --panel-2:#353535; --marquee:#e50914; --marquee-dim:#b20710; --teal:#f5f5f1; --text:#f5f5f1; --text-dim:#b3b3b3; --danger:#ff5a64; --accent-text:#fff; --backdrop-shade:rgba(8,8,8,.20); --soft-accent:rgba(229,9,20,.15); }
[data-theme="prime"] { --ink:#0f171e; --panel:#182431; --panel-2:#314153; --marquee:#00a8e1; --marquee-dim:#007eb9; --teal:#46d2ff; --text:#fff; --text-dim:#a7b5c5; --danger:#ff6b6b; --accent-text:#07131c; --backdrop-shade:rgba(15,23,30,.20); --soft-accent:rgba(0,168,225,.15); }
[data-theme="hotstar"] { --ink:#070b17; --panel:#101827; --panel-2:#26344d; --marquee:#1f80e0; --marquee-dim:#1768bb; --teal:#45c8ff; --text:#f5f7fb; --text-dim:#a5afc2; --danger:#ff6577; --accent-text:#fff; --backdrop-shade:rgba(7,11,23,.20); --soft-accent:rgba(31,128,224,.17); }

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
.advanced-source-ui.hidden { display: none !important; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Inter', sans-serif;
}
.logout-form { display: flex; width: 100%; margin: 0; }
.logout-form .filesearch-btn { width: 100%; appearance: none; background: transparent; cursor: pointer; }
.config-start-time { margin: 0 0 16px; color: var(--text-dim); }
.config-start-time strong { color: var(--text); font-weight: 600; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
}

.brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--marquee); }

.filesearch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  min-height: 38px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  border: 1px solid var(--panel-2);
  padding: 8px 16px;
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}
.filesearch-btn:hover { border-color: var(--marquee); color: var(--marquee); }

/* --- topbar: Android app button --- */
/* Sits at the end of .topbar-actions, opposite the MOVIEZONE wordmark. It uses
   the app's own launcher mark and the theme's marquee accent, and matches the
   38px control height of .filesearch-btn so the bar stays on one line. */
.android-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 128px;
  min-height: 38px;
  padding: 5px 16px 5px 6px;
  color: var(--text);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.25;
  border: 1px solid var(--panel-2);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.android-btn-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  /* The icon is dark-on-amber, so it needs its own dark plate in every theme
     instead of inheriting --panel. */
  background: #0A0C0F;
  box-shadow: 0 0 0 1px rgba(232, 163, 61, 0.35);
}
.android-btn-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.android-btn-label { font-weight: 600; white-space: nowrap; }
.android-btn-meta { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.android-btn:hover {
  border-color: var(--marquee);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.android-btn:hover .android-btn-label { color: var(--marquee); }
.android-btn:hover .android-btn-meta { color: var(--text-dim); }
.android-btn:active { transform: translateY(0); }
.android-btn:focus-visible {
  outline: 2px solid var(--marquee);
  outline-offset: 2px;
}
/* No build published yet: keep the slot, but do not advertise a dead link. */
.android-btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

@media (max-width: 640px) {
  .topbar { padding: 18px 16px; }
  .android-btn { min-width: 0; padding-right: 12px; }
  .android-btn-meta { display: none; }
}

/* signature motif: sprocket-hole rule, echoing film stock perforations */
.sprocket-rule {
  height: 14px;
  background:
    repeating-linear-gradient(90deg, var(--panel-2) 0 10px, transparent 10px 26px);
  background-size: 26px 14px;
  border-top: 1px solid var(--panel-2);
  border-bottom: 1px solid var(--panel-2);
  opacity: 0.6;
}

.hero {
  text-align: center;
  padding: 80px 24px 48px;
}

.welcome-message {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.welcome-message span { color: var(--marquee); }
.admin-link { color: var(--marquee); border-color: var(--marquee-dim); }

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 56px;
  line-height: 1.1;
  letter-spacing: 1px;
  margin: 0 0 40px;
  color: var(--text);
}

.searchbar {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  gap: 8px;
}

.searchbar input {
  flex: 1;
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid var(--panel-2);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}
.searchbar input:focus { outline: 2px solid var(--marquee); }

.searchbar button {
  padding: 16px 28px;
  border-radius: 8px;
  border: none;
  background: var(--marquee);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.searchbar button:hover { background: var(--marquee-dim); }

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  padding: 24px 40px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.content-shelves { max-width: 1200px; margin: 0 auto; padding: 0 40px 18px; }
.shelf { margin: 0 0 30px; }
.shelf h2 { margin: 0 0 12px; font-family: 'Bebas Neue', sans-serif; font-size: 27px; letter-spacing: .6px; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(104px, 120px); gap: 12px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; touch-action: pan-x pan-y; padding: 2px 2px 12px; scrollbar-color: var(--marquee-dim) var(--panel); }
.shelf-card { position: relative; color: var(--text); text-decoration: none; min-width: 0; scroll-snap-align: start; }
.shelf-card:hover { transform: translateY(-3px); }
.shelf-poster { position: relative; aspect-ratio: 2 / 3; overflow: hidden; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--panel); }
.shelf-poster img { width: 100%; height: 100%; object-fit: cover; }
.shelf-card strong, .shelf-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-card strong { margin-top: 7px; font-size: 13px; }
.shelf-card span { margin-top: 3px; color: var(--text-dim); font-size: 11px; }
.title-backdrop { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); border-radius: 12px; }
.title-backdrop::before, .title-backdrop::after { content: ''; position: absolute; z-index: -2; inset: 0 0 auto; height: clamp(430px, 72vh, 720px); pointer-events: none; }
.title-backdrop::before { background-image: var(--title-poster); background-position: center top; background-size: cover; background-repeat: no-repeat; opacity: .8; }
.title-backdrop::after { z-index: -1; background: linear-gradient(to bottom, rgba(0,0,0,.38) 0%, rgba(0,0,0,.58) 55%, var(--ink) 100%); }
.title-backdrop .stream-title { text-shadow: 0 2px 12px rgba(0,0,0,.85); }
.title-backdrop .tabs { padding: 7px 10px 0; border-radius: 9px 9px 0 0; background: rgba(0,0,0,.48); backdrop-filter: blur(5px); }

.card {
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 0.15s;
}
.card:hover { transform: translateY(-4px); }
.card.loading-card { opacity: 0.5; pointer-events: none; }

.poster {
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--panel-2);
}
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.card-meta { padding-top: 8px; }
.card-title { font-size: 14px; font-weight: 600; }
.card-year { font-size: 12px; color: var(--text-dim); }

.loading, .empty {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 0;
  grid-column: 1 / -1;
}

/* A shared, low-key film-reel loader for searches, file lists, and waits. */
.loading, .file-list-loading, .stream-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.loading::before, .file-list-loading::before, .stream-progress::before {
  content: '';
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(232, 163, 61, 0.24);
  border-top-color: var(--marquee);
  border-right-color: var(--marquee);
  border-radius: 50%;
  animation: reel-spin 0.75s linear infinite;
}
.card.loading-card .poster { position: relative; }
.card.loading-card .poster::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 24px;
  height: 24px;
  margin: -12px;
  border: 3px solid rgba(232, 163, 61, 0.25);
  border-top-color: var(--marquee);
  border-radius: 50%;
  animation: reel-spin 0.75s linear infinite;
}
@keyframes reel-spin { to { transform: rotate(360deg); } }

/* streams page */
.streams-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.stream-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  letter-spacing: 1px;
  margin: 0;
}

.stream-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.telegram-title-post { display: inline-flex; align-items: center; gap: 7px; border-color: #2aabee; color: #56c8ff; font-weight: 700; }
.telegram-title-post svg { width: 18px; height: 18px; fill: currentColor; }
.telegram-title-post:disabled { opacity: .55; cursor: wait; }
.telegram-title-status { flex-basis: 100%; min-height: 18px; color: var(--text-dim); font-size: 13px; overflow-wrap: anywhere; }
.title-details { margin: -18px 0 24px; padding: 14px 16px; border: 1px solid var(--panel-2); border-radius: 9px; background: color-mix(in srgb, var(--panel) 88%, transparent); }
.title-details.hidden { display: none; }
.title-details p { margin: 8px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.55; }
.title-facts { color: var(--marquee); font-size: 13px; font-weight: 700; }

.stream-list { display: flex; flex-direction: column; gap: 12px; }
.load-more-wrap { display: grid; justify-items: center; gap: 8px; padding: 22px 0 8px; }
.load-more-wrap .btn { width: min(100%, 420px); }

.stream-row {
  background: var(--panel);
  border: 1px solid var(--panel-2);
  border-radius: 10px;
  padding: 16px 20px;
}

.stream-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cache-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.cache-badge.cached { background: rgba(47,167,160,0.15); color: var(--teal); }
.cache-badge.notcached { background: rgba(217,99,79,0.12); color: var(--danger); }

.stream-name { font-size: 14px; font-weight: 500; flex: 1; min-width: 200px; }
.stream-size, .stream-seeders, .stream-release-meta { font-size: 13px; color: var(--text-dim); }
.discovery-candidates { display: grid; gap: 8px; margin-top: 12px; max-height: 420px; overflow-y: auto; }
.discovery-choice-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--panel-2); border-radius: 10px; background: var(--panel); }
.monitor-unavailable { opacity: .48; filter: grayscale(1); cursor: not-allowed; }
.release-pending { border-color: var(--marquee); color: var(--text); }
.stream-release-meta { flex-basis: 100%; margin-left: auto; font-weight: 700; }

.stream-actions { display: flex; align-items: center; gap: 8px; }
.stream-actions .outer-expand-btn { flex: 1 1 auto; min-width: 0; }
.stream-actions .torrent-overflow { flex: 0 0 auto; margin-left: 0; }

.overflow-menu { position: relative; margin-left: auto; }
.overflow-menu > summary {
  list-style: none; display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--panel-2); border-radius: 8px; color: var(--text);
  font-size: 24px; line-height: 1; cursor: pointer; user-select: none;
}
.overflow-menu > summary::-webkit-details-marker { display: none; }
.overflow-menu[open] > summary { border-color: var(--marquee); color: var(--marquee); }
.overflow-menu-panel {
  position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: min(290px, 78vw);
  display: grid; gap: 7px; padding: 9px; border: 1px solid var(--panel-2);
  border-radius: 9px; background: var(--panel); box-shadow: 0 12px 32px rgba(0,0,0,.38);
}
.overflow-menu-panel .btn { width: 100%; white-space: normal; }

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--panel-2);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn:hover { border-color: var(--marquee); }
.play-btn { background: var(--teal); border-color: var(--teal); color: var(--ink); font-weight: 700; }
.telegram-save-btn { border-color: #2aabee; color: #56c8ff; }
.telegram-save-btn:hover { border-color: #56c8ff; background: rgba(42,171,238,0.12); }

.stream-progress {
  margin-top: 10px;
  font-size: 13px;
  color: var(--marquee);
}
.stream-progress.hidden {
  display: none !important;
}
.stream-progress.done::before { display: none; }
.file-list-loading.done::before { display: none; }

.dl-link { color: var(--teal); font-weight: 600; }

/* player overlay */
.player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.player-overlay.hidden { display: none; }

.player-box {
  position: relative;
  width: min(94vw, 1200px, calc((100vh - 90px) * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}
.player-box video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
}
.player-seek-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background-color: #000;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font-weight: 700;
  pointer-events: none;
  z-index: 2;
}
.player-seek-cover.hidden { display: none; }
.player-seek-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: playerSeekSpin .8s linear infinite;
}
@keyframes playerSeekSpin { to { transform: rotate(360deg); } }
.player-status {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding-top: 10px;
  color: var(--text);
  text-align: center;
  line-height: 1.5;
}
.player-status.hidden { display: none; }
.player-retry-btn { margin-left: 8px; }

.close-player {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

/* --- new: topbar actions, footer, login, tabs, type badge, file rows --- */

.topbar-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(128px, 1fr); gap: 10px; }

.footer {
  text-align: center;
  padding: 32px 0 48px;
  color: var(--text-dim);
  font-size: 13px;
}
.footer-activity { text-align: center; color: var(--text-dim); font-size: 12px; padding: 18px 16px 0; }

.login-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 100%;
  max-width: 340px;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--panel-2);
  border-radius: 12px;
}

.login-box form { display: flex; flex-direction: column; gap: 12px; }

.login-box input {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--panel-2);
  background: var(--ink);
  color: var(--text);
  font-size: 14px;
}
.login-box input:focus { outline: 2px solid var(--marquee); }

.login-box button {
  padding: 12px;
  border-radius: 6px;
  border: none;
  background: var(--marquee);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.login-box button:hover { background: var(--marquee-dim); }

.login-error {
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

.poster { position: relative; }
.type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(23,21,18,0.85);
  color: var(--marquee);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.episode-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 24px;
}
.episode-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--text-dim);
  gap: 4px;
}
.episode-form input {
  width: 70px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--panel-2);
  background: var(--panel);
  color: var(--text);
}
.episode-form button {
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  background: var(--marquee);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  height: fit-content;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--panel-2);
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--marquee); border-bottom-color: var(--marquee); }

.pack-badge {
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--panel-2);
  padding: 2px 8px;
  border-radius: 999px;
}

.file-row {
  display: flex;
  position: relative;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0;
  font-size: 13px;
}
.file-row + .file-row { margin-top: 6px; padding-top: 16px; }
.file-row + .file-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 3%;
  right: 3%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--panel-2) 14%, var(--panel-2) 86%, transparent);
}
.file-name { flex: 1; min-width: 160px; }
.file-size { color: var(--text-dim); }
.file-link:empty { display: none; }
.file-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.file-actions .file-primary-action { padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.file-overflow { margin-left: 0; }
.file-overflow > summary { width: 36px; height: 36px; font-size: 21px; }

/* --- season/episode toggle + clear, expand-files preview --- */

.toggle-link {
  display: block;
  background: none;
  border: none;
  color: var(--marquee);
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 16px;
  text-decoration: underline;
}
.toggle-link:hover { color: var(--marquee-dim); }

.episode-form.hidden { display: none; }

.episode-form .btn-secondary {
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--panel-2);
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
  height: fit-content;
}
.episode-form .btn-secondary:hover { border-color: var(--danger); color: var(--danger); }

.expand-btn { background: transparent; }
.outer-expand-btn { background: var(--marquee); border-color: var(--marquee); color: var(--ink); font-weight: 700; }
.expand-btn.outer-expand-btn { background: transparent; color: var(--marquee); text-align: left; }
.outer-expand-btn:hover { background: transparent; color: var(--marquee); }

.file-list {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.file-list.hidden { display: none; }
.file-list-loading { font-size: 13px; color: var(--text-dim); padding: 6px 0; }

/* admin panel */
.admin-page { max-width: 1120px; margin: 0 auto; padding: 48px 24px 80px; display: flex; flex-direction: column; }
.admin-page > .admin-section { order: 10; }
.admin-heading { order: 0; }
#configSection { order: 1; }
#relaySection { order: 2; }
#sharedSection { order: 3; }
#serverSection { order: 4; }
.admin-heading + .admin-section { order: 4; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.admin-heading .stream-title { margin: 4px 0 0; }
.admin-heading p, .muted { color: var(--text-dim); font-size: 13px; }
.eyebrow { color: var(--marquee); font-size: 11px; font-weight: 700; letter-spacing: 1.8px; }
.admin-section { background: var(--panel); border: 1px solid var(--panel-2); border-radius: 10px; padding: 22px; margin-bottom: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.admin-section-collapsed > .section-heading { margin-bottom: 0; }
.admin-section-collapsed > :not(.section-heading) { display: none; }
.admin-section-toggle { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; margin-inline-start: auto; padding: 0; border: 1px solid var(--panel-2); border-radius: 8px; color: var(--text); background: var(--ink); cursor: pointer; }
.admin-section-toggle span { display: block; font-size: 24px; line-height: 1; }
.admin-section-toggle:focus-visible { outline: 2px solid var(--marquee); outline-offset: 3px; }
.admin-section-bulk-controls { display: flex; justify-content: flex-end; gap: 10px; margin: -8px 0 22px; }
.section-actions { display: flex; align-items: center; gap: 10px; }
.count-badge { background: rgba(47,167,160,0.15); color: var(--teal); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 5px 10px; }
.admin-filters, .add-user-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-history-fields { display: contents; }
.admin-history-fields.hidden { display: none; }
.admin-filters label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--text-dim); }
.admin-filters select, .admin-filters input, .add-user-form input, .add-user-form select { min-height: 37px; padding: 8px 10px; border: 1px solid var(--panel-2); border-radius: 6px; color: var(--text); background: var(--ink); }
#monitorPauseDuration { min-height: 37px; padding: 8px 10px; border: 1px solid var(--panel-2); border-radius: 6px; color: var(--text); background: var(--ink); font: inherit; }
.admin-filter-btn { background: var(--marquee); border-color: var(--marquee); color: var(--ink); font-weight: 700; }
.update-output { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; }
.summary-grid { display: grid; grid-template-columns: 0.85fr 0.75fr 1.25fr 1.25fr 1.55fr; gap: 12px; margin-bottom: 12px; }
.ip-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-card { min-height: 112px; padding: 14px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--ink); }
.summary-card h3 { font-size: 12px; color: var(--text-dim); margin: 0 0 8px; font-weight: 600; }
.summary-card .resource-percent { display: block; margin-top: 5px; }

/* Compact server status: two dense cards instead of five tall metric cards. */
#serverStats.summary-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 0; }
.server-compact-card { min-width: 0; padding: 12px 14px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--ink); }
.server-compact-card h3 { margin: 0 0 7px; color: var(--text-dim); font-size: 12px; font-weight: 700; }
.server-metric-row, .network-speed-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 31px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.server-metric-row:last-child, .network-speed-row:last-child { border-bottom: 0; }
.server-metric-row > span, .network-speed-row > span { color: var(--text-dim); font-size: 12px; }
.server-metric-row strong, .network-speed-row strong { min-width: 0; text-align: right; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.server-metric-row strong small { margin-left: 6px; color: var(--text-dim); font-size: 11px; font-weight: 500; white-space: nowrap; }
.network-speed-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.speed-protection-current { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 10px; margin-bottom: 14px; }
.speed-protection-current > div { display: flex; flex-direction: column; gap: 5px; padding: 12px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--ink); }
.speed-protection-current span { color: var(--text-dim); font-size: 12px; }
.speed-protection-current strong { font-size: 13px; overflow-wrap: anywhere; }
.speed-protection-rules { display: grid; grid-template-columns: repeat(5,minmax(150px,1fr)); gap: 10px; margin-bottom: 12px; }
.speed-protection-rules label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--panel-2); border-radius: 8px; }
.speed-protection-rules select { grid-column: 1 / -1; width: 100%; }
.speed-control-inactive { opacity: .42; filter: grayscale(1); }
.speed-control-inactive select { cursor: not-allowed; }
.summary-value { display: block; color: var(--marquee); font-family: 'Bebas Neue', sans-serif; font-size: 42px; line-height: 1; }
.summary-line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 12px; }
.summary-line span { color: var(--text-dim); }
.operations-wrap { overflow-x: auto; border: 1px solid var(--panel-2); border-radius: 8px; }
.telegram-library-search { display: flex; gap: 10px; margin: 0 0 10px; }
.telegram-library-search input { flex: 1; min-width: 0; padding: 11px 12px; color: var(--text); background: var(--panel); border: 1px solid var(--panel-2); border-radius: 8px; }
.telegram-library-source { margin-top: 14px; padding: 12px; border: 1px solid var(--panel-2); border-radius: 10px; }
.telegram-library-source h3 { margin: 0 0 10px; color: var(--accent); }
.telegram-library-source + .telegram-library-source { margin-top: 12px; }
.telegram-library-empty { padding: 8px 0; }
.telegram-library-results { display: grid; gap: 8px; margin: 0 0 16px; }
.telegram-library-item { min-width: 0; padding: 12px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--panel); }
.telegram-episode-list { margin-top: 8px; color: var(--text); line-height: 1.6; overflow-wrap: anywhere; }
.telegram-delivered-badge { display: inline-block; margin-top: 8px; padding: 3px 8px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: 12px; }
.error-wrap { max-height: 460px; overflow: auto; }
.operations-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.operations-table th { background: var(--ink); color: var(--text-dim); font-weight: 600; }
.operations-table th, .operations-table td { padding: 11px 12px; border-bottom: 1px solid var(--panel-2); vertical-align: top; }
.operations-table tbody tr:last-child td { border-bottom: none; }
.monitor-row-position { display: inline-block; margin-right: 6px; padding: 1px 6px; border: 1px solid var(--panel-2); border-radius: 6px; background: var(--panel-2); color: var(--text-dim); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.monitoring-analysis-actions { align-items: center; flex-wrap: wrap; }
.monitoring-analysis-table-wrap { overflow-x: auto; border: 1px solid var(--panel-2); border-radius: 8px; }
.monitoring-analysis-table { width: 100%; min-width: 760px; table-layout: fixed; border-collapse: collapse; font-size: 12px; text-align: left; }
.monitoring-analysis-table th, .monitoring-analysis-table td { padding: 7px 8px; border-bottom: 1px solid var(--panel-2); vertical-align: middle; }
.monitoring-analysis-table th { background: var(--ink); color: var(--text-dim); font-weight: 600; }
.monitoring-analysis-table tbody tr:last-child td { border-bottom: 0; }
.monitoring-analysis-table tbody tr.monitoring-analysis-selected { background: color-mix(in srgb, var(--marquee) 12%, transparent); }
.monitoring-analysis-table th:nth-child(1), .monitoring-analysis-table td:nth-child(1) { width: 34px; text-align: center; }
.monitoring-analysis-table th:nth-child(2) { width: 28%; }
.monitoring-analysis-table th:nth-child(3), .monitoring-analysis-table th:nth-child(4) { width: 14%; }
.monitoring-analysis-table th:nth-child(5), .monitoring-analysis-table th:nth-child(7) { width: 17%; }
.monitoring-analysis-table th:nth-child(6) { width: 10%; }
.monitoring-analysis-table input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; accent-color: var(--marquee, #e50914); }
.monitoring-analysis-cell { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.25; max-height: 2.5em; overflow-wrap: anywhere; }
.monitoring-analysis-summary-card h3 { margin-bottom: 8px; }
.monitoring-analysis-summary-line { line-height: 1.55; }
.monitoring-analysis-summary-line strong { font-size: 13px; }
.empty-cell { color: var(--text-dim); text-align: center; }
.add-user-form input { flex: 1; min-width: 180px; }
.admin-message { min-height: 20px; color: var(--marquee); font-size: 13px; margin: -8px 0 12px; }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--ink); }
.user-row strong { display: block; font-size: 14px; }
.comet-indexer-row { min-width: 0; }
.comet-indexer-main { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.comet-indexer-url { display: block; max-width: 100%; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comet-indexer-diagnostics { display: block; max-width: 100%; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-size: 11px; }
.comet-indexer-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.comet-indexer-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.downloaded-list { display: flex; flex-direction: column; gap: 8px; }
.downloaded-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--ink); }
.downloaded-row strong, .downloaded-row span { display: block; overflow-wrap: anywhere; }
.downloaded-row span { margin-top: 4px; color: var(--text-dim); font-size: 12px; }
.torbox-queue { display: flex; flex-direction: column; gap: 10px; }
.torbox-item { padding: 14px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--ink); }
.torbox-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.torbox-item-head strong { overflow-wrap: anywhere; }
.torbox-item-head span, .torbox-meta { color: var(--text-dim); font-size: 12px; }
.torbox-progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--panel-2); margin: 10px 0 8px; }
.torbox-progress i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.torbox-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.torbox-files span { max-width: 100%; overflow-wrap: anywhere; padding: 3px 7px; border: 1px solid var(--panel-2); border-radius: 4px; color: var(--text-dim); font-size: 11px; }
.user-row span { color: var(--text-dim); font-size: 12px; }
.remove-user-btn { color: var(--danger); }

@media (max-width: 700px) {
  .comet-indexer-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 10px; }
  .comet-indexer-url { display: none; }
  .comet-indexer-diagnostics { white-space: normal; overflow-wrap: anywhere; }
  .comet-indexer-actions { width: 100%; justify-content: flex-end; }
  .comet-indexer-actions .btn { min-width: 82px; }
  .speed-protection-current, .speed-protection-rules { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px; gap: 12px; align-items: flex-start; }
  .brand { font-size: 25px; }
  .topbar-actions { gap: 6px; }
  .filesearch-btn { padding: 7px 10px; font-size: 12px; }
  .hero { padding: 44px 16px 28px; }
  .hero-title { font-size: 42px; margin-bottom: 24px; }
  .searchbar { gap: 6px; }
  .searchbar input { min-width: 0; padding: 13px 12px; }
  .searchbar button { padding: 13px 15px; }
  .content-shelves, .results { padding-left: 16px; padding-right: 16px; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .shelf-row { grid-auto-columns: minmax(96px, 28vw); gap: 10px; }
  .streams-page, .admin-page { padding: 28px 16px 56px; }
  .stream-title { font-size: 34px; margin-bottom: 20px; }
  .stream-row { padding: 14px; }
  .stream-actions { flex-wrap: wrap; }
  .file-name { min-width: 100%; overflow-wrap: anywhere; }
  .title-backdrop { background-attachment: scroll; border-radius: 0; }
  .admin-heading { display: block; }
  .admin-heading p { margin-top: 8px; }
  .summary-grid { grid-template-columns: 1fr; }
  #serverStats.summary-grid { grid-template-columns: 1fr; gap: 8px; }
  .server-compact-card { padding: 10px 12px; }
  .server-metric-row, .network-speed-row { grid-template-columns: 66px minmax(0, 1fr); min-height: 29px; }
  .network-speed-row strong { font-size: 12px; }
  .ip-summary { grid-template-columns: 1fr; }
  .admin-section { padding: 16px; }
  .downloaded-row { align-items: flex-start; flex-direction: column; }
  .torbox-item-head { flex-direction: column; }
}

.user-row code { color: var(--text); font-family: monospace; font-size: 12px; }

/* Admin: per-user dashboard cards */
.user-dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.user-dashboard-card { padding: 14px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--ink); }
.user-dashboard-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.user-dashboard-head strong { font-size: 15px; }
.user-dashboard-head span { color: var(--text-dim); font-size: 12px; }
.user-dashboard-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.user-dashboard-table th { padding: 6px 4px; border-bottom: 1px solid var(--panel-2); color: var(--text-dim); font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; }
.user-dashboard-table td { padding: 6px 4px; border-bottom: 1px solid var(--panel-2); white-space: nowrap; }
.user-dashboard-table tr:last-child td { border-bottom: 0; }
.user-dashboard-table th:not(:first-child), .user-dashboard-table td:not(:first-child) { text-align: right; }

/* Configurable colour themes and responsive polish. */
.primary-btn { background: var(--marquee); border-color: var(--marquee); color: var(--accent-text); font-weight: 700; text-decoration: none; }
.primary-btn:hover { background: var(--marquee-dim); border-color: var(--marquee-dim); }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auto-post-toggle { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; cursor: pointer; }
.auto-post-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.ticket-toggle { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--panel-2); border-radius: 5px; color: transparent; background: var(--ink); font-size: 16px; font-weight: 700; }
.auto-post-toggle input:checked + .ticket-toggle { color: var(--accent-text); background: var(--marquee); border-color: var(--marquee); }
.auto-post-toggle input:focus-visible + .ticket-toggle { outline: 2px solid var(--marquee); outline-offset: 2px; }
.auto-post-channels-wrap { grid-column: 1 / -1; }
.auto-post-channels-wrap .section-heading { margin-bottom: 8px; }
.auto-post-channel-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(120px, .8fr) repeat(3, minmax(130px, 1fr)) minmax(220px, 1.5fr) auto; gap: 10px; align-items: end; padding: 10px; margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; }
.auto-post-channel-row label { min-width: 0; }
.auto-post-channel-name { padding-bottom: 10px; overflow-wrap: anywhere; }
.auto-post-channel-row textarea { min-height: 68px; }
.telegram-title-channel { max-width: 220px; }
@media (max-width: 900px) { .auto-post-channel-row { grid-template-columns: 1fr 1fr; } .auto-post-channel-row label:nth-of-type(3) { grid-column: 1 / -1; } }
.torrent-search-promo { max-width: 1120px; margin: 42px auto 12px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid var(--panel-2); border-radius: 12px; background: var(--panel); box-shadow: 0 12px 34px var(--shadow); }
.torrent-search-promo h2 { margin: 4px 0; font-size: 20px; }
.torrent-search-promo p { margin: 0; color: var(--text-dim); font-size: 13px; }
.settings-page { width: min(620px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 80px; }
.settings-page > .stream-title { margin: 5px 0 28px; }
.settings-page .admin-section h2 { margin: 0 0 6px; font-size: 19px; }
.settings-form { display: grid; gap: 13px; margin-top: 18px; }
.settings-form label { display: grid; gap: 6px; color: var(--text-dim); font-size: 12px; font-weight: 600; }
.settings-form input, .settings-form select { width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid var(--panel-2); border-radius: 8px; background: var(--ink); color: var(--text); font: inherit; }
.settings-form input:focus, .settings-form select:focus { outline: 2px solid var(--marquee); outline-offset: 1px; }
.settings-form .btn { justify-self: start; min-width: 150px; padding: 11px 18px; }
.telegram-row-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
select, input { max-width: 100%; }
.telegram-send-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; min-height: 35px; padding: 7px 12px; }
.telegram-button-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: currentColor; }

@media (max-width: 700px) {
  body, main, section, header, footer { min-width: 0; }
  .topbar { padding: 14px 16px; gap: 12px; align-items: center; flex-wrap: wrap; }
  .topbar-actions { width: 100%; display: grid; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filesearch-btn { width: 100%; min-width: 0; min-height: 46px; padding: 9px 10px; border-radius: 8px; text-align: center; white-space: normal; overflow-wrap: anywhere; background: var(--panel); }
  .shelf-row { grid-auto-flow: column; grid-auto-columns: minmax(96px, 28vw); grid-template-columns: none; gap: 10px; overflow-x: auto; overflow-y: hidden; padding-bottom: 10px; }
  .shelf-card strong, .shelf-card span { white-space: normal; overflow-wrap: anywhere; }
  .shelf-card strong { line-height: 1.3; }
  .stream-title { max-width: 100%; line-height: 1.05; overflow-wrap: anywhere; }
  .stream-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: start; }
  .stream-info .cache-badge { grid-column: 1 / -1; justify-self: start; border-radius: 6px; }
  .stream-name { min-width: 0; overflow-wrap: anywhere; word-break: break-word; line-height: 1.35; }
  .stream-size { white-space: nowrap; }
  .stream-release-meta { grid-column: 1 / -1; margin: 0; line-height: 1.4; }
  .stream-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .stream-actions > * { min-width: 0; max-width: 100%; }
  .stream-actions .outer-expand-btn { grid-column: 1; width: 100%; }
  .stream-actions .torrent-overflow { grid-column: 2; margin: 0; }
  .stream-actions .cache-download-btn, .stream-actions .telegram-row-controls { grid-column: 1 / -1; }
  .stream-actions .btn, .stream-actions select { width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .telegram-row-controls { grid-column: 1 / -1; display: flex; width: 100%; }
  .telegram-row-controls .telegram-send-btn { width: auto; }
  .telegram-status { grid-column: 1 / -1; overflow-wrap: anywhere; }
  .file-list { min-width: 0; padding-left: 8px; }
  .file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 12px 0; }
  .file-row .file-name { grid-column: 1; min-width: 0; overflow-wrap: anywhere; word-break: break-word; line-height: 1.4; }
  .file-row .file-size { grid-column: 2; white-space: nowrap; font-weight: 700; }
  .file-row .file-actions { grid-column: 1 / -1; width: 100%; min-width: 0; display: flex; align-items: center; gap: 6px; }
  .file-row .file-actions .file-primary-action { min-width: 0; width: auto; flex: 1 1 auto; padding: 9px 6px; white-space: nowrap; font-size: 11px; }
  .file-row .file-actions .file-overflow { flex: 0 0 auto; }
  .file-row .file-link { grid-column: 1 / -1; min-width: 0; padding: 8px 10px; border-radius: 7px; background: var(--soft-accent); color: var(--text-dim); overflow-wrap: anywhere; line-height: 1.4; }
  .file-row:has(.telegram-file-check) { grid-template-columns: auto minmax(0, 1fr) auto; }
  .file-row:has(.telegram-file-check) .telegram-file-check { grid-column: 1; grid-row: 1; }
  .file-row:has(.telegram-file-check) .file-name { grid-column: 2; }
  .file-row:has(.telegram-file-check) .file-size { grid-column: 3; }
  .file-row:has(.telegram-file-check) .file-actions { grid-column: 2 / -1; }
  .admin-filters, .config-grid { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
  .admin-filters label, .admin-filters select, .admin-filters input, .admin-filters button { width: 100%; min-width: 0; }
  #autoPostSection .config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #autoPostSection .config-grid > label:nth-of-type(7), #autoPostSection .config-grid > button { grid-column: 1 / -1; }
  .monitor-row { align-items: stretch; flex-direction: column; }
  .monitor-row-content { min-width: 0; width: 100%; overflow-wrap: anywhere; }
  .monitor-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; width: 100%; gap: 8px; }
  .monitor-card-actions .btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-width: 0; margin: 0; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .section-actions { max-width: 100%; flex-wrap: wrap; }
  .operations-wrap { max-width: 100%; overflow: hidden; border: 0; background: transparent; }
  .telegram-library-search { flex-direction: column; }
  .telegram-library-search .btn { width: 100%; }
  .operations-table, .operations-table tbody { display: block; width: 100%; }
  .operations-table { table-layout: auto; font-size: 13px; }
  .operations-table thead { display: none; }
  .operations-table tbody { display: grid; gap: 10px; }
  .operations-table tbody tr { display: block; overflow: hidden; border: 1px solid var(--panel-2); border-radius: 9px; background: var(--ink); }
  .operations-table tbody td { display: grid; grid-template-columns: minmax(86px, 32%) minmax(0, 1fr); gap: 12px; min-width: 0; padding: 9px 11px; border-bottom: 1px solid var(--panel-2); overflow-wrap: anywhere; word-break: normal; line-height: 1.4; }
  .operations-table tbody td:last-child { border-bottom: 0; }
  .operations-table tbody td::before { content: attr(data-label); color: var(--text-dim); font-size: 11px; font-weight: 700; line-height: 1.5; }
  .operations-table tbody td > * { grid-column: 2; min-width: 0; }
  .operations-table tbody td[colspan] { display: block; padding: 16px; text-align: center; }
  .operations-table tbody td[colspan]::before { display: none; }
  .operations-table tbody td .btn { width: auto; max-width: 100%; justify-self: start; margin: 0 6px 6px 0; white-space: normal; word-break: normal; }
  .torrent-search-promo { margin: 36px 16px 14px; padding: 18px; align-items: stretch; flex-direction: column; gap: 16px; }
  .torrent-search-promo .btn { width: 100%; padding: 11px 14px; text-align: center; }
  .btn { border-radius: 8px; }
}

@media (max-width: 380px) {
  .stream-actions { grid-template-columns: 1fr auto; }
  .stream-actions > * { grid-column: auto; }
  .stream-actions .outer-expand-btn { grid-column: 1; }
  .stream-actions .torrent-overflow { grid-column: 2; }
  .stream-actions .cache-download-btn, .stream-actions .telegram-row-controls { grid-column: 1 / -1; }
}
.monitor-console {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, .28);
  font-size: .88rem;
}
.monitor-console-lines { margin-top: 7px; display: grid; gap: 4px; color: var(--muted); }
.monitor-console-line { white-space: normal; overflow-wrap: anywhere; }
.settings-toggle-row,.mode-switch{display:flex;align-items:center;gap:12px}.mode-switch input{width:22px;height:22px;accent-color:var(--marquee)}
.simple-title-experience{margin:22px 0}.simple-hero-actions{display:flex;flex-wrap:wrap;gap:12px;padding:18px;border:1px solid var(--panel-2);border-radius:16px;background:color-mix(in srgb,var(--panel) 92%,transparent)}.simple-hero-actions.hidden{display:none!important}
.simple-preferences{display:flex;align-items:end;flex-wrap:wrap;gap:10px;margin-bottom:16px}.simple-preferences label{display:grid;gap:6px;color:var(--text-dim);font-size:.86rem}.simple-preferences select{min-width:110px;padding:10px 12px;border:1px solid var(--panel-2);border-radius:9px;background:var(--panel);color:var(--text)}.simple-options{align-self:end}.simple-options>summary{display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--panel-2);border-radius:9px;font-size:1.4rem}.simple-options .overflow-menu-panel{min-width:220px}
.simple-hero-actions .btn{min-width:150px;font-weight:700}.simple-watch-btn{background:var(--marquee);color:var(--accent-text,#111)}.simple-source-status{flex-basis:100%;min-height:1.4em}
.season-tabs{display:flex;gap:7px;overflow-x:auto;padding:4px 0 12px;scrollbar-width:none}.season-tab{flex:0 0 auto;padding:8px 14px;border:1px solid var(--panel-2);border-radius:999px;background:var(--panel);color:var(--text);font-size:.87rem}.season-tab.active{background:var(--marquee);color:var(--accent-text,#111);border-color:var(--marquee)}
.simple-episode-list{display:grid;gap:8px}.simple-episode{display:grid;grid-template-columns:42px minmax(0,1fr) 42px;gap:11px;align-items:center;padding:11px 12px;border:1px solid var(--panel-2);border-radius:12px;background:color-mix(in srgb,var(--panel) 94%,transparent);font-size:.9rem}.simple-episode-number{font-size:calc(1em + 1px)!important;font-weight:800!important;color:var(--marquee)!important}.simple-episode-copy{display:grid;gap:3px;min-width:0;line-height:1.25}.simple-episode-copy span{color:var(--text-dim);margin:0;font-size:.8rem}.simple-episode-play,.simple-episode-download{width:42px;min-width:42px;height:42px;padding:0;display:grid;place-items:center;border-radius:50%}.simple-episode-download svg,.camera-source-actions svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.simple-episode .simple-source-status{grid-column:2/4;font-size:.8rem;margin:0}.simple-episode .simple-source-status:empty{display:none}.simple-episode.continue-episode{border-color:var(--marquee);box-shadow:inset 3px 0 0 var(--marquee)}
.camera-source-list{display:grid;gap:10px}.camera-source{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:12px;border:1px solid var(--panel-2);border-radius:12px;background:color-mix(in srgb,var(--panel) 94%,transparent)}.camera-source-copy{display:grid;gap:4px;min-width:0}.camera-source-copy strong{overflow-wrap:anywhere}.camera-source-copy span{color:var(--text-dim);font-size:.82rem}.camera-source-actions{display:flex;gap:8px}.camera-source-actions .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px}.camera-source .simple-source-status{grid-column:1/-1}
@media(max-width:600px){.simple-hero-actions .btn{flex:1;min-width:120px}.simple-episode{grid-template-columns:38px minmax(0,1fr) 38px;padding:10px;gap:9px}.simple-episode-play,.simple-episode-download{width:38px;min-width:38px;height:38px}.simple-episode .simple-source-status{grid-column:1/-1}.camera-source{grid-template-columns:1fr}.camera-source-actions{display:grid;grid-template-columns:1fr 1fr}.camera-source-actions .btn{width:100%}}
.admin-product-tabs{display:flex;gap:.65rem;position:sticky;top:0;z-index:20;padding:.75rem;margin:0 0 1.25rem;background:rgba(8,10,15,.88);backdrop-filter:blur(14px);border:1px solid rgba(255,255,255,.08);border-radius:16px}.admin-product-tab{flex:1;border:0;border-radius:11px;padding:.9rem 1.2rem;background:transparent;color:var(--muted,#9da3ae);font-weight:800;font-size:1rem;cursor:pointer}.admin-product-tab.active{background:linear-gradient(135deg,#e50914,#8e1017);color:#fff;box-shadow:0 8px 24px rgba(229,9,20,.24)}.admin-product-panel.hidden{display:none}.moviebot-heading{padding-top:.5rem}.moviebot-hero{background:radial-gradient(circle at 85% 0,rgba(229,9,20,.13),transparent 35%),var(--panel,#11141a)}.moviebot-grid-two{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:1rem}.moviebot-chart-card,.moviebot-grid-two>div{padding:1rem;border:1px solid rgba(255,255,255,.08);border-radius:14px;background:rgba(0,0,0,.18)}#moviebotActivityChart{display:block;width:100%;max-width:100%;max-height:280px}.moviebot-ranking{display:grid;gap:.55rem}.moviebot-rank-row{display:grid;grid-template-columns:2rem 1fr auto;gap:.6rem;padding:.55rem .7rem;border-radius:9px;background:rgba(255,255,255,.04)}.moviebot-storage{display:grid;gap:.7rem}.moviebot-storage-row{display:flex;justify-content:space-between;gap:1rem;padding:.65rem;border-bottom:1px solid rgba(255,255,255,.07)}.moviebot-status{display:inline-flex;padding:.22rem .55rem;border-radius:999px;font-size:.78rem;font-weight:800;text-transform:uppercase}.moviebot-status.pending{background:#594817;color:#ffd766}.moviebot-status.in_progress,.moviebot-status.running{background:#123e60;color:#70c8ff}.moviebot-status.completed{background:#174b34;color:#7ee2ae}.moviebot-status.rejected,.moviebot-status.failed{background:#5b2027;color:#ff9aa6}
.request-actions{display:flex;gap:.4rem;flex-wrap:wrap}.request-action-feedback{display:none;flex-basis:100%;font-size:.78rem;line-height:1.35;margin-top:.15rem}.request-action-feedback.error,.request-action-feedback.success{display:block}.request-action-feedback.error{color:#ff9aa6}.request-action-feedback.success{color:#7ee2ae}@media(max-width:800px){.moviebot-grid-two{grid-template-columns:1fr}.admin-product-tabs{position:static}.moviebot-period-filter label{width:100%}}
.moviebot-metric-group{margin:.8rem 0 1rem}.moviebot-metric-label{margin:0 0 .55rem;color:var(--text-dim);font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.moviebot-hero .summary-grid{grid-template-columns:repeat(5,minmax(0,1fr));margin-bottom:0}.moviebot-hero .moviebot-summary-fixed{grid-template-columns:repeat(5,minmax(0,1fr))}.moviebot-summary-card strong{display:block;font-size:1.7rem;line-height:1.15;margin:.2rem 0 .45rem}.moviebot-summary-card small{display:block;color:var(--text-dim);font-size:.75rem}.moviebot-retention-storage{margin:.85rem 0 1rem;padding:.2rem .8rem;border:1px solid rgba(255,255,255,.08);border-radius:12px;background:rgba(0,0,0,.16)}@media(max-width:1100px){.moviebot-hero .summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:800px){.moviebot-hero .summary-grid,.moviebot-hero .moviebot-summary-fixed{grid-template-columns:repeat(2,minmax(0,1fr))}.moviebot-chart-card{padding:.8rem}.moviebot-chart-card .section-heading{align-items:flex-start;gap:.5rem}.moviebot-chart-card #moviebotChartLegend{display:block;margin-top:.3rem}}
.moviebot-status.failed_to_fetch{background:#5b2027;color:#ff9aa6}
.request-check-col{width:36px;text-align:center}.request-check-col input[type="checkbox"]{cursor:pointer;width:16px;height:16px;accent-color:var(--marquee,#e50914)}.request-bulk-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid var(--panel-2)}.request-bulk-actions .btn{white-space:nowrap}.request-row-check input[type="checkbox"]{cursor:pointer;width:16px;height:16px;accent-color:var(--marquee,#e50914)}.request-row-selected{background:rgba(229,9,20,.08)!important}.moviebot-requests-table{display:table!important;width:100%!important;table-layout:fixed;font-size:12px;min-width:0}.moviebot-requests-table thead{display:table-header-group!important}.moviebot-requests-table tbody{display:table-row-group!important}.moviebot-requests-table tbody tr{display:table-row!important;border:0;border-radius:0;background:transparent!important}.moviebot-requests-table tbody td{display:table-cell!important;padding:5px 7px;border-bottom:1px solid var(--panel-2);vertical-align:middle;white-space:normal}.moviebot-requests-table tbody td::before{display:none!important}.moviebot-requests-table tbody td:last-child{border-bottom:1px solid var(--panel-2)}.moviebot-requests-table tbody td[colspan]{display:table-cell!important;padding:16px;text-align:center}.moviebot-requests-table .request-check-col,.moviebot-requests-table .request-row-check{width:34px;padding-inline:5px;text-align:center}.moviebot-requests-table .request-title-cell{min-width:0;max-width:0;overflow:hidden}.moviebot-request-line{display:flex;align-items:center;min-width:0;gap:8px;line-height:1.2}.moviebot-request-line-primary{min-height:20px}.moviebot-request-line-secondary{justify-content:space-between;margin-top:3px;color:var(--text-dim);font-size:11px}.moviebot-request-line-secondary>*{min-width:0;white-space:nowrap}.moviebot-requests-table .request-title-cell strong{display:block;min-width:0;overflow-wrap:anywhere;white-space:normal}.moviebot-requests-table .moviebot-request-title{display:block;flex:1;min-width:0;overflow-wrap:anywhere;padding:1px 4px;border-radius:4px;background:#ffe58a;color:#111!important;text-decoration:none;font-weight:800}.moviebot-requests-table .moviebot-request-episodes{flex:0 0 auto;font-weight:700;color:var(--text)}.moviebot-requests-table .moviebot-request-title:hover,.moviebot-requests-table .moviebot-request-title:focus-visible{background:#ffd24d;color:#000!important;text-decoration:underline}.moviebot-requests-table-wrap{width:100%;max-width:100%;overflow:hidden}@media(max-width:600px){.request-bulk-actions{flex-direction:column;align-items:stretch}.request-bulk-actions .btn{width:100%}.moviebot-requests-table{font-size:11px}.moviebot-requests-table tbody td{padding:6px 8px}}

/* Discovery jobs */
.discovery-tabs{display:flex;gap:8px;margin:18px 0;padding:6px;border:1px solid var(--panel-2);border-radius:12px;background:rgba(255,255,255,.025)}
.discovery-tab{flex:1;border:0;border-radius:9px;padding:11px 14px;background:transparent;color:var(--muted);font-weight:800;cursor:pointer}
.discovery-tab.active{background:var(--panel-2);color:var(--text)}
.discovery-tab-panel.hidden,#discoveryTimeWrap.hidden,#discoveryIntervalWrap.hidden,#discoveryWeekdaysWrap.hidden,#discoveryPastDaysWrap.hidden,#discoveryFutureDaysWrap.hidden,#discoveryUpcomingWrap.hidden,#cancelDiscoveryEdit.hidden,#runAndSaveDiscoveryJob.hidden{display:none!important}
.discovery-builder-group{margin-top:18px;padding:16px;border:1px solid var(--panel-2);border-radius:12px;background:rgba(255,255,255,.018)}
.discovery-builder-group h3{margin:0 0 12px;font-size:15px}
.discovery-control-disabled{opacity:.42;filter:saturate(.35)}
.discovery-control-disabled input,.discovery-control-disabled select,.discovery-control-disabled button{cursor:not-allowed}
.discovery-builder-actions{margin-top:16px;flex-wrap:wrap}
#stopDiscoveryCheck.hidden,#discoveryProgress.hidden{display:none!important}
#discoveryMessage{min-height:0;margin:12px 0 8px;line-height:1.45;overflow-wrap:anywhere;word-break:break-word}
#discoveryProgress{margin-top:8px}
.discovery-jobs-list{display:grid;gap:12px}
.discovery-job-card{padding:15px;border:1px solid var(--panel-2);border-radius:12px;background:rgba(255,255,255,.025)}
.discovery-job-card.paused{opacity:.72}
.discovery-job-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:9px}
.discovery-job-meta{font-weight:700;margin-bottom:6px}
.discovery-job-runinfo{display:flex;gap:16px;flex-wrap:wrap;margin:11px 0;color:var(--muted);font-size:13px}
.discovery-job-runinfo strong{color:var(--text)}
@media(max-width:700px){.discovery-tabs{flex-direction:column}.discovery-job-head{flex-direction:column}.discovery-job-runinfo{display:grid;gap:6px}}

.monitor-auto-date-control{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0 4px}.monitor-auto-date-label{display:inline-flex;align-items:center;gap:7px;cursor:pointer}.monitor-auto-date-label input{width:18px;height:18px;margin:0;accent-color:currentColor}.monitor-auto-date-interval{display:inline-flex;align-items:center;gap:7px}.monitor-auto-date-interval input{width:76px;min-width:76px}

.monitor-auto-date-progress{margin:10px 0 8px;padding:12px 14px;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:rgba(255,255,255,.035)}
.monitor-auto-date-progress-head{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
.monitor-auto-date-progress-track{height:8px;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.08);margin-bottom:7px}
.monitor-auto-date-progress-track span{display:block;height:100%;border-radius:inherit;background:currentColor;transition:width .25s ease}
.moviebot-adsterra-heading{align-items:center}.moviebot-adsterra-range{display:flex;align-items:center;gap:.55rem;color:var(--text-dim);font-size:.82rem;font-weight:700}.moviebot-adsterra-range select{min-width:150px}.moviebot-adsterra-summary{grid-template-columns:repeat(4,minmax(0,1fr));margin:1rem 0 .65rem}.moviebot-adsterra-message{font-size:.78rem}@media(max-width:800px){.moviebot-adsterra-heading{align-items:flex-start}.moviebot-adsterra-range{width:100%;justify-content:space-between}.moviebot-adsterra-range select{flex:1}.moviebot-adsterra-summary{grid-template-columns:1fr}}
.moviebot-top-downloads-heading{align-items:center}.moviebot-top-downloads-range{display:flex;align-items:center;gap:.55rem;color:var(--text-dim);font-size:.82rem;font-weight:700}.moviebot-top-downloads-range select{min-width:200px}.moviebot-top-downloads-controls{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}.moviebot-top-downloads-actions{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-top:.6rem}.moviebot-top-downloads-actions .admin-message{margin:0}.moviebot-top-downloads-list{margin-top:1rem}.moviebot-top-downloads-list.hidden{display:none}@media(max-width:800px){.moviebot-top-downloads-heading{align-items:flex-start}.moviebot-top-downloads-controls{width:100%;flex-direction:column;align-items:stretch}.moviebot-top-downloads-range{width:100%;justify-content:space-between}.moviebot-top-downloads-range select{flex:1}}
