/* FPT Movie Manager - Taste v2 App-Screen Dark UI */
:root {
  --bg-main: #0b0d10;
  --bg-surface: #12161d;
  --bg-surface-elevated: #181d26;
  --bg-surface-hover: #202734;
  --border-color: #202632;
  --border-control: #2c3545;
  --text-primary: #f8fafc;
  --text-secondary: #b8c4d4;
  --text-muted: #94a3b8;
  --accent-emerald: #2fb380;
  --accent-emerald-bg: #142921;
  --accent-emerald-border: #23533f;
  --accent-sky: #3ca3dc;
  --accent-sky-bg: #132432;
  --accent-sky-border: #214966;
  --accent-amber: #d99b26;
  --accent-amber-bg: #292112;
  --accent-amber-border: #594318;
  --accent-rose: #e05263;
  --accent-rose-bg: #2b161b;
  --accent-rose-border: #5c2530;
  --radius-card: 8px;
  --radius-control: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
}

.num {
  font-variant-numeric: tabular-nums;
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ACCESSIBLE SCREEN-READER ONLY HELPER */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

code {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* TOP NAV */
.top-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  color: var(--accent-emerald);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
}

.brand-text .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* DIVIDED FLAT KPI STRIP IN TOP BAR (NO TINTED BOXES, NO EMOJIS) */
.nav-stats {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 4px 0;
}

.stat-cell {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 14px;
  border-right: 1px solid var(--border-color);
  white-space: nowrap;
}

.stat-cell:last-child {
  border-right: none;
}

.stat-cell .stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-cell .stat-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-cell.stat-active .stat-val {
  color: var(--accent-emerald);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-emerald);
  color: #042416;
  border-color: var(--accent-emerald);
}

.btn-primary:hover {
  background: #3bc48f;
  border-color: #3bc48f;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-control);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: #3b475c;
}

.btn-danger {
  background: var(--accent-rose-bg);
  color: #f8b4bd;
  border-color: var(--accent-rose-border);
}

.btn-danger:hover {
  background: #3a1d24;
}

.btn-sm {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.btn-icon {
  padding: 7px 12px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-sky);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-text:hover {
  color: #72c2ee;
}

.btn-close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-control);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.btn-close:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 2px;
}

/* MAIN CONTAINER */
.main-container {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 32px;
  flex: 1;
}

/* LOGIN GATE */
.auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-card-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.auth-error-box {
  background: var(--accent-rose-bg);
  border: 1px solid var(--accent-rose-border);
  color: #fecdd3;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  font-size: 13px;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input {
  padding-right: 46px;
}

.btn-password-toggle {
  position: absolute;
  right: 2px;
  width: 42px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-control);
}

.btn-password-toggle:hover {
  color: var(--text-primary);
}

.btn-password-toggle:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: -2px;
}

.auth-submit-btn {
  width: 100%;
  min-height: 40px;
  font-size: 14px;
}

/* TABS HEADER */
.tabs-header {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: -2px;
}

.tab-btn.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--accent-emerald);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* DASHBOARD TOOLBAR (FIXES M-P1-16 COLLAPSED TOOLBAR) */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-title h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toolbar-title p {
  font-size: 13px;
  color: var(--text-muted);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* FILTER PANEL */
.filter-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  min-height: 40px;
  padding: 9px 40px 9px 38px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.search-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-emerald);
}

.btn-clear {
  position: absolute;
  right: 4px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-control);
}

.btn-clear:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.filter-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ACCESSIBLE TOGGLE CONTROL */
.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: #2c3545;
  border-radius: 999px;
  position: relative;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: 3px;
  top: 3px;
  background: #f8fafc;
  transition: transform 0.2s ease;
}

.toggle-control input:checked + .toggle-slider {
  background: var(--accent-emerald);
}

.toggle-control input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

.toggle-control input:focus-visible + .toggle-slider {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 2px;
}

.toggle-control input:disabled + .toggle-slider {
  opacity: 0.5;
}

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.select-wrapper select {
  min-height: 36px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-control);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: var(--radius-control);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.select-wrapper select:focus {
  border-color: var(--accent-emerald);
}

/* RESULTS HEADER */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.results-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* MOVIES GRID */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
  gap: 16px;
  align-items: start;
}

.movie-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}

.movie-card:hover {
  border-color: #384559;
}

.card-poster-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #080a0d;
  position: relative;
  overflow: hidden;
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-badges-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-control);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.badge-movie {
  background: var(--accent-sky-bg);
  color: #8fd3f8;
  border: 1px solid var(--accent-sky-border);
}

.badge-series {
  background: var(--accent-amber-bg);
  color: #f6cc76;
  border: 1px solid var(--accent-amber-border);
}

.badge-cache-ready {
  background: var(--accent-emerald-bg);
  color: #6ee7b7;
  border: 1px solid var(--accent-emerald-border);
}

.badge-youtube {
  background: var(--accent-rose-bg);
  color: #fda4af;
  border: 1px solid var(--accent-rose-border);
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-orig-title {
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta-line {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-cache-info {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* DATA TABLES */
.posts-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.data-table th {
  background: var(--bg-surface-elevated);
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-primary);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-thumb {
  width: 48px;
  height: 66px;
  object-fit: cover;
  border-radius: var(--radius-control);
  background: #080a0d;
  display: block;
}

.post-title-primary {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.post-title-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-published {
  background: var(--accent-emerald-bg);
  color: #6ee7b7;
  border: 1px solid var(--accent-emerald-border);
}

.status-handling,
.status-waiting-link {
  background: var(--accent-amber-bg);
  color: #f6cc76;
  border: 1px solid var(--accent-amber-border);
}

.status-pending,
.status-processing {
  background: var(--accent-sky-bg);
  color: #8fd3f8;
  border: 1px solid var(--accent-sky-border);
}

.status-failed {
  background: var(--accent-rose-bg);
  color: #fda4af;
  border: 1px solid var(--accent-rose-border);
}

.episodes-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 300px;
}

.ep-tag {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* TASKS LIST */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card.active-task {
  border-color: var(--accent-emerald-border);
}

.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.task-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.task-movie-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.task-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-surface-elevated);
  border-radius: 999px;
  overflow: hidden;
}

.task-progress-bar {
  height: 100%;
  background: var(--accent-emerald);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.task-progress-bar.failed {
  background: var(--accent-rose);
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.task-message {
  color: var(--text-secondary);
  font-size: 13px;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-control);
  border-radius: var(--radius-card);
}

.empty-svg {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* YOUTUBE REUP CARD */
.yt-simple-card {
  max-width: 780px;
  margin: 4px auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 24px;
}

.yt-simple-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.yt-simple-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.yt-simple-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.yt-comment-notice {
  background: var(--accent-sky-bg);
  border: 1px solid var(--accent-sky-border);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yt-notice-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(60, 163, 220, 0.16);
  color: #8fd3f8;
  white-space: nowrap;
}

.yt-notice-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
}

.yt-notice-link {
  color: var(--accent-emerald);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  width: fit-content;
}

.yt-notice-link:hover {
  text-decoration: underline;
}

.yt-simple-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yt-optional-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
}

.yt-simple-actions {
  display: flex;
  justify-content: flex-end;
}

.yt-submit-btn {
  min-height: 40px;
  padding: 10px 20px;
  font-size: 14px;
}

/* REQUEST HUB */
.req-hub-header {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.req-target-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.req-target-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.req-target-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-emerald-bg);
  color: #6ee7b7;
  border: 1px solid var(--accent-emerald-border);
  white-space: nowrap;
}

.req-post-id-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.req-target-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.req-target-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

.req-target-link {
  margin-top: 2px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-sky);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.req-target-link:hover {
  text-decoration: underline;
}

.req-hub-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.autobot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.autobot-card.is-enabled {
  border-color: var(--accent-emerald-border);
}

.autobot-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.autobot-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.autobot-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  flex-shrink: 0;
}

.autobot-card.is-enabled .autobot-dot {
  background: var(--accent-emerald);
}

.autobot-info small {
  font-size: 12px;
  color: var(--text-muted);
}

.autobot-switch .toggle-slider {
  width: 42px;
  height: 24px;
}

.autobot-switch .toggle-slider::before {
  width: 18px;
  height: 18px;
}

.autobot-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.req-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.req-action-buttons #btn-scan-requests {
  flex: 1;
}

.req-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.req-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.req-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.req-chip:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.req-chip.active {
  background: var(--accent-emerald-bg);
  border-color: var(--accent-emerald);
  color: #6ee7b7;
}

.req-chip-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
}

.req-meta-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.req-member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.req-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-control);
  color: var(--accent-sky);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.req-member-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}

.req-member-id {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.req-time-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.req-message-text {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 360px;
}

.req-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.req-yt-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-control);
  background: var(--accent-rose-bg);
  border: 1px solid var(--accent-rose-border);
  color: #fda4af;
  font-size: 12px;
  text-decoration: none;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.req-yt-link-pill:hover {
  color: var(--text-primary);
}

.req-no-link {
  font-size: 12px;
  color: var(--text-muted);
}

.req-actions-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.req-inline-form,
.req-quick-reply-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  flex-wrap: wrap;
}

.req-inline-input {
  flex: 1;
  min-width: 175px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.req-inline-quality {
  width: auto;
  min-width: 92px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.req-link-picker {
  width: auto;
  max-width: 150px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.req-completed-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.req-reply-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.req-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-control);
  background: var(--accent-emerald-bg);
  border: 1px solid var(--accent-emerald-border);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.req-reply-link:hover {
  color: var(--text-primary);
}

.req-processing-note {
  font-size: 12px;
  color: #8fd3f8;
  font-weight: 600;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  max-height: 90svh;
}

.modal-card.modal-lg {
  max-width: 740px;
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-surface-elevated);
  border-bottom-left-radius: var(--radius-card);
  border-bottom-right-radius: var(--radius-card);
}

.movie-meta-summary {
  display: flex;
  gap: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-card);
}

.meta-thumb {
  width: 84px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-control);
  background: #080a0d;
  flex-shrink: 0;
}

.meta-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.meta-details h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.meta-orig {
  font-size: 13px;
  color: var(--text-muted);
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-info-line {
  font-size: 12px;
  color: var(--text-secondary);
}

.comment-target-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.sync-mode-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-card);
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-control);
}

.mode-option:hover {
  background: var(--bg-surface-hover);
}

.mode-option input {
  margin-top: 3px;
}

.mode-text strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
}

.mode-text small {
  color: var(--text-muted);
  font-size: 12px;
}

/* FORMS */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-control {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.15s ease;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-emerald);
}

textarea.form-control {
  resize: vertical;
  line-height: 1.55;
}

.form-help {
  font-size: 12px;
  color: var(--text-muted);
}

.config-readonly-info {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-control);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* PAGINATION BAR */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 0 8px;
  margin-top: 12px;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.page-input {
  width: 64px;
  min-height: 34px;
  padding: 5px 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}

.page-input:focus {
  outline: none;
  border-color: var(--accent-emerald);
}

/* TOASTS */
.toast-container {
  position: fixed;
  top: 68px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  max-width: calc(100vw - 32px);
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-control);
  border-left: 3px solid var(--accent-emerald);
  padding: 10px 14px;
  border-radius: var(--radius-control);
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 260px;
  max-width: 420px;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-error {
  border-left-color: var(--accent-rose);
}

.toast-warn {
  border-left-color: var(--accent-amber);
}

.toast-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
}

.toast-dismiss:hover {
  color: var(--text-primary);
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1100px) {
  .nav-stats {
    display: none !important;
  }
}

@media (max-width: 960px) {
  .req-hub-header {
    grid-template-columns: 1fr;
  }
}

/* COMPACT MOBILE HEADER <= 56px & ABOVE-THE-FOLD MOVIES GRID (M-P1-16) */
@media (max-width: 768px) {
  .top-nav {
    height: 52px;
    min-height: 52px;
    max-height: 56px;
    padding: 6px 16px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .brand-text h1 {
    font-size: 16px;
  }

  .brand-text .subtitle {
    display: none;
  }

  .nav-stats {
    display: none !important;
  }

  .nav-btn-label {
    display: none;
  }

  .nav-actions .btn-icon {
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
  }

  .main-container {
    padding: 12px 16px 24px;
  }

  .tabs-header {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 12px;
    gap: 2px;
  }

  .tabs-header::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 8px 11px;
    font-size: 13px;
  }

  .filter-panel {
    padding: 12px;
    margin-bottom: 12px;
    gap: 10px;
  }

  .filter-options {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .filter-actions-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .filter-actions-group .select-wrapper {
    flex: 1;
  }

  .filter-actions-group .select-wrapper select {
    width: 100%;
    min-height: 40px;
  }

  .filter-actions-group #btn-do-search {
    min-height: 40px;
  }

  .results-header {
    margin-bottom: 10px;
  }

  .movies-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }

  .card-body {
    padding: 10px;
  }

  .btn-select-movie {
    min-height: 38px;
    width: 100%;
  }

  .card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .yt-simple-card {
    padding: 18px;
  }

  .yt-optional-row {
    grid-template-columns: 1fr;
  }

  .yt-submit-btn {
    width: 100%;
  }

  .req-action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .req-action-buttons .btn {
    min-height: 42px;
  }
}

/* RESPONSIVE 2-LINE TABLE ROW CARDS BELOW 640px (app-screens.md §12) */
@media (max-width: 640px) {
  .posts-table-wrapper {
    background: transparent;
    border: none;
    overflow-x: visible;
  }

  .data-table,
  .data-table tbody {
    display: block;
    width: 100%;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .data-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 14px;
    margin-bottom: 12px;
  }

  .data-table td,
  .data-table td.num {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border-bottom: none;
    text-align: left;
  }

  .data-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  .data-table td[data-label=""]::before {
    display: none;
  }

  .req-message-text {
    max-width: none;
  }

  .req-actions-cell,
  .table-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .req-inline-form,
  .req-quick-reply-form {
    flex-direction: column;
    align-items: stretch;
  }

  .req-inline-quality,
  .req-link-picker {
    width: 100%;
    max-width: none;
  }

  .movie-meta-summary {
    flex-direction: column;
  }
}
