/* TBatts Man Cave Admin Panel - bright blue and black */

:root {
  --black: #101010;
  --sidebar: #16191e;
  --card: #20242b;
  --card-hi: #2b323c;
  --line: #2b323c;
  --line-strong: #3a4350;
  --blue: #008cff;
  --blue-hi: #1a9bff;
  --blue-soft: #8ccbff;
  --blue-chip: #0b3a66;
  --text: #ffffff;
  --text-2: #d5dae1;
  --muted: #a7b0bc;
  --danger: #ff6b6b;
  --danger-bg: #3a1618;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--black);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

[hidden] { display: none !important; }

a { color: var(--blue-soft); }

.muted { color: var(--muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- wordmark ---------- */
.wordmark { display: flex; flex-direction: column; line-height: 1; padding: 0 10px 22px; }
.wm-top { font-weight: 800; font-size: 26px; letter-spacing: 2px; color: var(--blue); }
.wm-bottom { font-weight: 700; font-size: 16px; letter-spacing: 4px; color: var(--text); margin-top: 4px; }
.wm-sub { font-size: 12px; color: var(--muted); margin-top: 8px; letter-spacing: 0.5px; }
.wordmark-lg { align-items: center; padding: 0 0 8px; }
.wordmark-lg .wm-top { font-size: 40px; letter-spacing: 3px; }
.wordmark-lg .wm-bottom { font-size: 20px; letter-spacing: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  border: 2px solid transparent; cursor: pointer;
  color: var(--text); background: transparent;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
.btn:focus-visible, input:focus-visible, .nav-item:focus-visible {
  outline: 3px solid var(--blue-soft); outline-offset: 2px;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--blue); }
.btn-primary:hover:not([disabled]) { background: var(--blue-hi); }
.btn-outline { border-color: var(--blue); color: var(--blue-soft); }
.btn-outline:hover { background: rgba(0, 140, 255, 0.12); }
.btn-ghost { border-color: var(--line-strong); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--blue); color: var(--text); }
.btn-danger { background: #c62828; }
.btn-danger:hover:not([disabled]) { background: #d84040; }
.btn-danger-outline { border-color: #7a2a2a; color: #ffb3b3; }
.btn-danger-outline:hover { background: var(--danger-bg); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input {
  height: 46px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--black); color: var(--text);
  font-family: inherit; font-size: 15px;
}
.field input:focus { border-color: var(--blue); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.req, .opt { font-weight: 600; font-size: 11px; margin-left: 6px; padding: 1px 6px; border-radius: 6px; }
.req { color: var(--blue-soft); background: var(--blue-chip); }
.opt { color: var(--muted); background: var(--card-hi); }
.field-error, .form-error { color: var(--danger); font-size: 13px; margin: 0; }
.form-error { background: var(--danger-bg); border: 1px solid #6b2a2c; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--card);
  border: 1px solid var(--line); border-top: 4px solid var(--blue);
  border-radius: 16px; padding: 36px 32px 28px;
}
.login-title { text-align: center; margin: 6px 0 4px; font-size: 20px; color: var(--text-2); font-weight: 600; }
.login-card > .muted { text-align: center; margin: 0 0 22px; }
.fineprint { color: var(--muted); font-size: 12px; text-align: center; margin: 16px 0 0; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  flex: 0 0 260px; width: 260px; background: var(--sidebar);
  border-right: 1px solid var(--line); padding: 28px 18px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app.nav-closed .sidebar { display: none; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.nav-backdrop { display: none; }

/* top bar with the menu (hamburger) button */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 40px 0;
}
.menu-button {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  border: 2px solid var(--line-strong); background: var(--sidebar); color: var(--text);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.menu-button:hover { border-color: var(--blue); color: var(--blue-soft); }
.menu-button:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
.topbar-brand { display: none; font-weight: 700; letter-spacing: 3px; font-size: 14px; color: var(--text); }
.topbar-brand b { color: var(--blue); }
.app.nav-closed .topbar-brand { display: inline; }
.family-badge {
  margin-left: auto; font-size: 13px; color: var(--blue-soft);
  background: var(--blue-chip); border-radius: 20px; padding: 6px 12px; font-weight: 600;
}
.family-badge:empty { display: none; }

/* owner-only parts are hidden for family administrators */
body:not(.is-owner) .owner-only { display: none !important; }
.nav-group { font-size: 11px; font-weight: 700; color: #8a94a3; letter-spacing: 1px; padding: 14px 10px 6px; }
.nav-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 10px; font-size: 14px;
  color: var(--text-2); text-decoration: none;
}
.nav-item.active { background: var(--blue); color: var(--text); font-weight: 600; }
.nav-item.disabled { color: #6f7885; cursor: default; }
.nav-item em { font-style: normal; font-size: 11px; color: #6f7885; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; }
.me { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--card); display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 18px; background: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.me-name { font-weight: 600; font-size: 14px; word-break: break-word; }
.me-role { font-size: 12px; color: var(--muted); }
.content { min-width: 0; padding: 22px 40px 40px; }

/* ---------- page ---------- */
.page-header { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.page-header h1 { margin: 0; font-size: 30px; }
.page-header p { margin: 6px 0 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.search input {
  height: 44px; width: 340px; max-width: 100%; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--sidebar); color: var(--text); font-family: inherit; font-size: 14px;
}
.search { flex: 0 1 340px; }
.toolbar-left { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.select-inline select, .field select {
  height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--sidebar); color: var(--text); font-family: inherit; font-size: 14px;
}
.field select { height: 46px; background: var(--black); font-size: 15px; }
.field select:focus { border-color: var(--blue); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 14px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--blue); flex: none; }
.pad { padding: 22px 24px; margin-bottom: 18px; }
.pad-top { padding-top: 16px; }
.card-title { margin: 0 0 10px; font-size: 18px; }
.small { font-size: 13px; margin: 0 0 6px; }
.key-status { margin: 0 0 16px; color: var(--text-2); }
.key-status .chip { margin-right: 8px; }
.key-form { max-width: 560px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.info ul { margin: 0; padding-left: 20px; color: var(--text-2); }
.info li { margin-bottom: 8px; }
.info li:last-child { margin-bottom: 0; }
#owner-keys { margin-top: 0; }
.notice { background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px 18px; color: var(--text-2); }

.card { background: var(--card); border-radius: var(--radius); }
.table-card { padding: 6px 16px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 12px 8px; }
.table td { padding: 12px 8px; border-top: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.table td.name { color: var(--text); font-weight: 600; }
.table .right { text-align: right; }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .btn { margin-left: 6px; }
.dim { color: #6f7885; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.chip-on { background: var(--blue-chip); color: var(--blue-soft); }
.chip-off { background: var(--card-hi); color: var(--muted); }
.empty { color: var(--muted); padding: 22px 8px; margin: 0; }

/* ---------- dialogs ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  background: var(--card); color: var(--text);
  border: 1px solid var(--line-strong); border-top: 4px solid var(--blue);
  border-radius: 16px; padding: 26px 26px 20px;
}
.dialog-sm { width: min(460px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
.dialog h2 { margin: 0 0 18px; font-size: 20px; }
.dialog p { color: var(--text-2); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.password-box { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px 14px; margin: 4px 0 16px; }
.password-box legend { font-size: 13px; font-weight: 700; color: var(--text-2); padding: 0 6px; }
.password-box .hint { margin-bottom: 10px; }
.password-row { display: flex; flex-wrap: wrap; gap: 12px; }
.password-row .grow { flex: 1 1 200px; margin-bottom: 8px; }
.password-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--card); color: var(--text); border: 1px solid var(--blue);
  padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 10;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); max-width: calc(100vw - 32px);
}
.toast.error { border-color: var(--danger); color: #ffd0d0; }

/* ---------- phone width ---------- */
/* narrow screens: the sidebar slides over the page and closes with the menu button */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 20; height: auto;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.6);
  }
  .app:not(.nav-closed) .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 15;
    background: rgba(0, 0, 0, 0.6); border: 0; padding: 0; cursor: pointer;
  }
  .topbar-brand { display: inline; }
}
@media (max-width: 720px) {
  .topbar { padding: 12px 16px 0; }
  .content { padding: 18px 16px 32px; }
  .login-card { padding: 28px 20px 22px; }
  .family-badge { display: none; }
}

/* =====================================================================
   Stage 4A: Movies & TV shows
   ===================================================================== */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  min-height: 42px; padding: 0 18px; border-radius: 21px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  font-family: inherit; font-size: 14px; font-weight: 600;
}
.tab[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--text); }
.tab:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
.tab-count { font-weight: 500; opacity: 0.8; margin-left: 4px; }

.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.poster-card {
  display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 0;
  background: transparent; border: 0; color: var(--text); cursor: pointer; font-family: inherit;
}
.poster-card .art {
  position: relative; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden;
  background: var(--card); border: 2px solid transparent; transition: border-color 0.12s, transform 0.12s;
}
.poster-card:hover .art, .poster-card:focus-visible .art { border-color: var(--blue); transform: translateY(-2px); }
.poster-card:focus-visible { outline: none; }
.poster-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-card .art-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px;
  text-align: center; font-weight: 700; color: var(--blue-soft);
  background: linear-gradient(160deg, var(--card-hi), var(--black));
}
.poster-card .status-flag { position: absolute; top: 8px; left: 8px; }
.poster-card .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.poster-card .y { font-size: 12px; color: var(--muted); }
.chip-draft { background: #2a2f37; color: #d5dae1; border: 1px solid var(--line-strong); }

.back-link { display: inline-block; font-size: 13px; margin-bottom: 6px; color: var(--blue-soft); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.editor { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.editor-main { flex: 999 1 520px; min-width: 0; }
.editor-side { flex: 1 1 300px; min-width: 0; max-width: 420px; }
.editor .card { margin-bottom: 18px; }
.field-row { display: flex; flex-wrap: wrap; gap: 14px; }
.field-row .field { flex: 1 1 150px; }
.field textarea {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--black); color: var(--text); font-family: inherit; font-size: 15px; line-height: 1.5; resize: vertical;
}
.field textarea:focus, .field input:focus { border-color: var(--blue); outline: none; }
.chips-field { border: 0; padding: 0; margin: 0 0 14px; }
.chips-field legend { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; padding: 0; }
.small-inline { font-weight: 500; font-size: 12px; }
.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-chip span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line-strong); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.check-chip input:checked + span { background: var(--blue-chip); border-color: var(--blue); color: var(--blue-soft); }
.check-chip input:focus-visible + span { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
.radio-group { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.radio { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; color: var(--text); font-size: 14px; }
.radio input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.check.rights { padding: 12px; border-radius: 10px; background: var(--black); border: 1px solid var(--line-strong); }
.side-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.top-gap { margin-top: 14px; }

.art-preview {
  border-radius: 10px; overflow: hidden; background: var(--black); border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; margin-bottom: 10px;
}
.poster-preview { aspect-ratio: 2 / 3; max-width: 200px; }
.backdrop-preview { aspect-ratio: 16 / 9; }
.art-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-btn { position: relative; overflow: hidden; margin-right: 6px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
.tmdb-card .btn[disabled] { opacity: 0.5; }

.two-col { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.two-col > .card { flex: 1 1 340px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-head .card-title { margin: 0; }
.manage-list { list-style: none; margin: 0; padding: 0; }
.manage-list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.manage-list li:first-child { border-top: 0; }
.manage-list .n { flex: 1; font-weight: 600; }
.manage-list .uses { color: var(--muted); font-size: 12px; margin-right: 6px; }
.icon-btn { min-width: 36px; padding: 0 10px; }

/* =====================================================================
   Stage 4B: Seasons & episodes
   ===================================================================== */
.seasons-list { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.season { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--black); }
.season-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; }
.season-toggle {
  display: flex; align-items: center; gap: 12px; flex: 1 1 240px; min-width: 0; text-align: left;
  background: transparent; border: 0; color: var(--text); cursor: pointer; font-family: inherit; padding: 4px 0;
}
.season-toggle:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; border-radius: 8px; }
.season-toggle .caret { color: var(--blue); font-size: 14px; width: 14px; flex: none; }
.season-thumb { width: 40px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--card); flex: none; }
.season-name { font-weight: 700; font-size: 15px; }
.season-meta { color: var(--muted); font-size: 12px; }
.season-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.season-body { border-top: 1px solid var(--line); padding: 8px 14px 14px; }
.episode-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.episode-table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 6px; }
.episode-table td { padding: 8px 6px; border-top: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.episode-table td.num { color: var(--blue-soft); font-weight: 700; width: 44px; }
.episode-table td.ttl { color: var(--text); font-weight: 600; }
.episode-table td.actions { text-align: right; white-space: nowrap; }
.episode-table td.actions .btn { margin-left: 4px; }
.ep-thumb { width: 72px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--card); display: block; }
.ep-thumb.empty { border: 1px dashed var(--line-strong); }
.season-body .row-actions { margin-top: 10px; }
.art-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.small-art { width: 110px; flex: none; margin-bottom: 0; }
.small-art-wide { width: 200px; flex: none; margin-bottom: 0; }
.hint.block { display: block; margin-top: 6px; }
.field-row .narrow { flex: 0 1 170px; }
.field-row .grow2 { flex: 2 1 260px; }

/* =====================================================================
   Stage 5A: Import from TMDB
   ===================================================================== */
.import-card { margin-bottom: 18px; }
.key-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.key-row .grow { flex: 1 1 320px; }
.key-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 26px; }
.import-options { max-width: 560px; }
.year-table { min-width: 560px; }
.year-table td.year { color: var(--text); font-weight: 700; }
.import-progress { margin-top: 16px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px; background: var(--black); }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.progress-bar { height: 10px; border-radius: 6px; background: var(--card); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s ease; }
.import-log { list-style: none; margin: 10px 0 0; padding: 0; max-height: 180px; overflow-y: auto; font-size: 13px; color: var(--text-2); }
.import-log li { padding: 3px 0; border-top: 1px solid var(--line); }
.import-log li.added::before { content: '✓ '; color: var(--blue-soft); }
.import-log li.skipped::before { content: '– '; color: var(--muted); }
.import-log li.failed::before { content: '! '; color: #ff6b6b; }
.review-actions { align-items: center; margin: 8px 0 12px; }
.inline-check { margin: 0; }
.review-grid .poster-card { position: relative; }
.review-grid .pick {
  position: absolute; top: 8px; left: 8px; z-index: 2; width: 22px; height: 22px; accent-color: var(--blue);
}
.review-grid .poster-card.selected .art { outline: 3px solid var(--blue); outline-offset: -3px; }
.review-grid .g { color: var(--muted); font-size: 12px; display: block; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }
.show-more { grid-column: 1 / -1; justify-self: center; }
.tmdb-credit { color: var(--muted); font-size: 12px; margin: 8px 0 24px; }
.review-grid .poster-card { cursor: default; }
.review-open {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 0; width: 100%;
  background: transparent; border: 0; color: var(--text); cursor: pointer; font-family: inherit;
}
.review-open:hover .art, .review-open:focus-visible .art { border-color: var(--blue); }
.review-open:focus-visible { outline: none; }
.review-open .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.review-open .y { font-size: 12px; color: var(--blue-soft); }
@media (max-width: 600px) {
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
.auto-chip { margin-left: 8px; font-size: 11px; }

/* =====================================================================
   Stage 6A: Networks
   ===================================================================== */
.network-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1300px) { .network-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .network-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.net-tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.net-tile.off { opacity: 0.62; }
.net-open { display: flex; flex-direction: column; gap: 8px; background: transparent; border: 0; padding: 0; color: var(--text); text-align: left; cursor: pointer; font-family: inherit; }
.net-open:hover .net-logo, .net-open:focus-visible .net-logo { outline: 3px solid var(--blue); outline-offset: 2px; }
.net-open:focus-visible { outline: none; }
.net-logo {
  aspect-ratio: 16 / 9; width: 100%; border-radius: 10px; background: #eef2f7; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 10%; box-sizing: border-box; border: 1px solid var(--line-strong);
}
.net-logo.dark { background: var(--black); }
.net-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.net-logo .net-name { font-weight: 800; font-size: 18px; color: var(--blue); text-align: center; line-height: 1.15; }
.net-logo.dark .net-name { color: var(--blue-soft); }
.net-logo.big { width: 180px; flex: none; }
.net-logo.small { width: 96px; flex: none; padding: 6%; }
.art-row .net-logo { width: 200px; flex: none; }
.net-meta { display: flex; flex-direction: column; gap: 2px; }
.net-title { font-weight: 700; font-size: 15px; }
.net-count { color: var(--muted); font-size: 12px; }
.net-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.net-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.network-head { align-items: center; }
.network-head-main { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.search-results { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.result-head { margin: 10px 0 2px; font-weight: 700; color: var(--blue-soft); }
.result-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--black); }
.result-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.result-overview { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.result-poster { width: 46px; height: 69px; border-radius: 6px; background: var(--card); overflow: hidden; flex: none; }
.result-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-btn { margin-top: 6px; width: 100%; }
.chip-warn { background: #4a1f1f; color: #ffb4b4; border: 1px solid #7a2e2e; }
.warn-text { color: #ffb4b4; }

/* ---------- Stage 7: IPTV ---------- */
.chip-lock { background: transparent; color: #ff8a8a; border: 1px solid #6b2a2a; }
.small.hint.block, td .hint.block { margin-top: 4px; max-width: 260px; }
.server-url { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; word-break: break-all; }
.test-ok { color: var(--blue-soft); }
.test-bad { color: #ff8a8a; }

/* ---------- Stage 7B: access dates ---------- */
.chip-soon { background: #3a2f0b; color: #ffd36b; border: 1px solid #6b5520; }
td .hint.warn, .hint.warn { color: #ffd36b; }
.access-row { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.access-row .field { margin-bottom: 8px; }
.access-row .check { margin-bottom: 18px; }
input[type=date] { color-scheme: dark; }
#f-extend { align-items: center; flex-wrap: wrap; }

/* Stage 8: free trials */
.trial-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 14px 0 16px; font-size: 14px; }
.trial-facts dt { color: var(--muted); }
.trial-facts dd { margin: 0; color: var(--text); }
.trial-block { border-top: 1px solid var(--line, #2a2f37); padding: 12px 0; }
.trial-block .password-actions { flex-wrap: wrap; align-items: center; margin-top: 6px; }
.trial-custom input { width: 90px; min-height: 36px; }
#f-mode-group { margin-bottom: 10px; }
.trial-block .btn[disabled] { opacity: 0.35; filter: grayscale(1); }
/* the accounts list has one more button now: let the buttons wrap instead of running off the edge */
#accounts-body td.actions { white-space: normal; min-width: 190px; }
#accounts-body td.actions .btn { margin: 3px 0 3px 6px; }
/* Stage 9: movies for each streaming service */
.import-log li.linked::before { content: '↔ '; color: var(--blue-soft); }
.netmov-table { margin: 4px 0 8px; font-size: 13px; }
.netmov-table th.right, .netmov-table td.right { text-align: right; }
.netmov-table tfoot th { border-top: 1px solid var(--line-strong); padding: 10px 8px; color: var(--text); }
/* Stage 10: catalog collections */
.coll-target { width: 96px; min-height: 34px; }
#coll-hint, #cls-hint { margin-bottom: 14px; }

/* Stage 14: curated additions */
.cur-result { margin: 8px 0 12px; }
.cur-result details { margin: 6px 0; }
.cur-result summary { cursor: pointer; font-weight: 600; }
.cur-result ul { columns: 2; margin: 6px 0 0 18px; font-size: 0.92em; }
.cur-warn { color: #f5b041; }

.cur-review { margin: 8px 0; }
.cur-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.cur-pick select { max-width: 100%; min-height: 34px; }
.cur-table { font-size: 0.9em; margin-top: 6px; }
.cur-table th, .cur-table td { padding: 4px 8px; }
#y10-hint { margin-bottom: 14px; }

/* Stage 16: suggestions */
.nav-badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--blue, #1e90ff); color: #fff; font-size: 0.78em; font-weight: 700; text-align: center; line-height: 18px; }
.sugg-filters { margin: 0 0 12px; }
.sugg-filters .btn.active { background: var(--blue-chip); color: var(--blue-soft); }
.sugg-answer textarea { width: 100%; min-width: 220px; resize: vertical; font: inherit; padding: 6px 8px; }
.sugg-answer .row-actions { margin-top: 6px; }
.sugg-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: var(--blue-chip); color: var(--blue-soft); border: 1px solid var(--blue, #1e90ff); font-weight: 600; }
.sugg-banner[hidden] { display: none; }

/* Stage 19: Bulk publisher */
.bp-headline { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.bp-facts { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; }
.bp-warn { background: #3a2a10; border: 1px solid #8a6420; color: #ffd591; border-radius: 10px; padding: 10px 12px; }
.bp-sample { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.bp-sample li { background: var(--card-hi); border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.bp-sample .vid { color: var(--blue-soft); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bp-jobs-head { padding: 18px 24px 4px; }

/* Stage P0: Premiumize connection test results */
.pm-result { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0; }
.pm-result dt { color: var(--blue-soft); font-weight: 600; }
.pm-result dd { margin: 0; }

/* Stage P4: Big Body Originals */
.mini-poster { width: 40px; height: 60px; object-fit: cover; border-radius: 4px; display: block; }
.mini-banner { width: 160px; height: 60px; object-fit: cover; border-radius: 6px; display: block; }
.ban-form { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.ban-form .check { align-self: end; margin-bottom: 18px; }

/* Master upgrade: Source Finder and Big Body Music */
.page-header.slim { padding: 14px 16px 6px; margin: 0; align-items: center; }
.chip-slow { background: #3d3415; color: #ffe08a; border: 1px solid #6b5a1e; }
.chip-dupe { background: #2a2f37; color: #c3cad4; border: 1px solid var(--line-strong); }
.row-hidden td { opacity: 0.55; }
.thumb-sq { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #0b1524; display: block; }
