/* ═══════════════════════════════════════════
   YT MONITOR — styles.css
   Minimalismo absoluto · Dark/Light · 16:9
   ═══════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────── */
:root {
  --ff-display: 'Syne', sans-serif;
  --ff-mono:    'DM Mono', monospace;
  --ff-linear:  'Plus Jakarta Sans', sans-serif;
  --ff-outfit:  'Plus Jakarta Sans', sans-serif;

  /* spacing */
  --r-box: 16px;
  --r-modal: 20px;
  --gap: 14px;

  /* animation */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── DARK THEME (default) ───────────────── */
[data-theme="dark"] {
  --bg:            #0e0e10;
  --surface:       #17171a;
  --surface-raised: #1f1f24;
  --border:        rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --text-primary:  #f0f0f0;
  --text-secondary:#888896;
  --text-muted:    #55555f;
  --accent:        #ff4040;
  --accent-dim:    rgba(255,64,64,0.15);
  --dot-active:    #f0f0f0;
  --dot-inactive:  rgba(255,255,255,0.2);
  --modal-overlay-bg: rgba(0,0,0,0.72);
  --shadow-box:    0 4px 24px rgba(0,0,0,0.5);
  --shadow-modal:  0 24px 80px rgba(0,0,0,0.7);
  --sub-big-color: #ffffff;
  --toggle-bg:     #2a2a30;
  --toggle-on:     #ff4040;
  --input-bg:      #111114;
  --scrollbar:     #2a2a30;
}

/* ── LIGHT THEME ────────────────────────── */
[data-theme="light"] {
  --bg:            #f6f6f7;
  --surface:       #ffffff;
  --surface-raised: #f0f0f3;
  --border:        rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --text-primary:  #111113;
  --text-secondary:#666672;
  --text-muted:    #aaaabc;
  --accent:        #e02020;
  --accent-dim:    rgba(224,32,32,0.1);
  --dot-active:    #111113;
  --dot-inactive:  rgba(0,0,0,0.18);
  --modal-overlay-bg: rgba(0,0,0,0.4);
  --shadow-box:    0 2px 16px rgba(0,0,0,0.10);
  --shadow-modal:  0 16px 60px rgba(0,0,0,0.18);
  --sub-big-color: #111113;
  --toggle-bg:     #e0e0e8;
  --toggle-on:     #e02020;
  --input-bg:      #f9f9fb;
  --scrollbar:     #dcdce8;
}

/* ── RESET ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--ff-display);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

/* ── SCROLLBAR ──────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 99px; }

/* ── GEAR BUTTON ────────────────────────── */
#gear-btn {
  position: fixed;
  top: 18px; left: 18px;
  z-index: 50;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease-spring), background 0.3s;
  box-shadow: var(--shadow-box);
}
#gear-btn svg { width: 18px; height: 18px; }
#gear-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
#gear-btn:hover svg { transform: rotate(60deg); transition: transform 0.4s var(--ease-spring); }

/* ── MAIN STAGE: scroll snap ────────────── */
#stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: row;
  overflow-x: scroll;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#stage::-webkit-scrollbar { display: none; }

/* ── EMPTY STATE ────────────────────────── */
.empty-state {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  z-index: 1;
}
.empty-icon {
  width: 56px; height: 56px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.empty-icon svg { width: 100%; height: 100%; }
.empty-title { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); }
.empty-sub { font-size: 0.78rem; color: var(--text-muted); text-align: center; max-width: 280px; line-height: 1.5; }

/* ── PAGE (scroll snap item) ─────────────── */
.page {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px 52px;
}

/* ── CHANNEL GRID ───────────────────────── */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: var(--gap);
  width: 100%;
  max-width: 1200px;
  max-height: calc(100vh - 120px);
}

/* ── CHANNEL BOX ────────────────────────── */
.channel-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-box);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-box);
  transition: border-color 0.2s, transform 0.2s var(--ease-spring), box-shadow 0.2s;
  animation: box-in 0.4s var(--ease-out) both;
  cursor: default;
  aspect-ratio: 1 / 1;
}
.channel-box:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}
@keyframes box-in {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Box header: avatar + name */
.box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.box-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  background: var(--surface-raised);
}
.box-avatar-placeholder {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.box-name-wrap {
  container-type: inline-size;
  flex: 1;
  overflow: hidden;
  margin-right: 8px; /* space for monetize btn */
}
.box-name {
  font-size: min(1rem, 12cqw);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.box-lifetime {
  font-family: var(--ff-linear);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* Inscritos big */
.box-subs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.subs-value {
  font-family: var(--ff-outfit);
  font-size: clamp(2.2rem, 6.5vw, 4rem);
  font-weight: 800;
  color: var(--sub-big-color);
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
}
.subs-label {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-top: 2px;
}
.subs-milestone {
  color: #4caf50 !important;
}

/* ── DIVIDER ── */
.box-divider {
  height: 1px;
  background: var(--border-strong);
  width: 100%;
  margin: 0;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Visualizações e Videos Wrap */
.box-metrics-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.box-views {
  display: flex;
  align-items: center;
  gap: 8px;
}
.box-views svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.box-videos {
  display: flex;
  align-items: center;
  gap: 8px;
}
.box-videos svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.metrics-text {
  display: flex;
  align-items: baseline;
  gap: 4px; /* Exatamente um espaço suave */
}
.box-metrics-val {
  font-family: var(--ff-linear);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.box-metrics-lbl {
  font-family: var(--ff-linear);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Optional: last video thumb */
.box-last-video {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.last-thumb {
  width: 54px; height: 30px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.last-thumb-placeholder {
  width: 54px; height: 30px;
  border-radius: 6px;
  background: var(--surface-raised);
  flex-shrink: 0;
}
.last-video-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.last-video-title {
  font-size: 0.6rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}
.last-video-views {
  font-family: var(--ff-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* Optional: weekly indicator */
.box-weekly {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}
.week-label {
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.week-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.3s;
}
.week-dot.active { background: #4caf50; }

/* Box loading skeleton */
.box-skeleton {
  background: var(--surface-raised);
  border-radius: 6px;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { opacity: 0.5; }
  50%  { opacity: 1;   }
  100% { opacity: 0.5; }
}

/* Error state badge */
.box-error-badge {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* Update pulse */
@keyframes pulse-border {
  0%   { border-color: var(--accent); }
  100% { border-color: var(--border); }
}
.channel-box.just-updated {
  animation: pulse-border 1.2s var(--ease-out) forwards;
}

/* ── PAGE DOTS ──────────────────────────── */
#dots-nav {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 40;
  min-height: 16px;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dot-inactive);
  transition: background 0.25s, transform 0.25s var(--ease-spring), width 0.25s var(--ease-spring);
  cursor: pointer;
}
.dot.active {
  background: var(--dot-active);
  width: 18px;
  border-radius: 99px;
}

/* ── MODAL OVERLAY ──────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--modal-overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s var(--ease-out);
}
.modal-overlay.hidden { display: none; }
.modal-overlay.fade-in  { animation: overlay-in  0.22s var(--ease-out) both; }
.modal-overlay.fade-out { animation: overlay-out 0.18s var(--ease-out) both; }
@keyframes overlay-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out { from { opacity: 1; } to { opacity: 0; } }

/* ── MODAL ──────────────────────────────── */
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-modal);
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: modal-in 0.28s var(--ease-spring) both;
  position: relative;
  z-index: 2;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.93) translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
#modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
#modal-close:hover { background: var(--surface-raised); color: var(--text-primary); }
#modal-close svg { width: 15px; height: 15px; }

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

.modal-section { padding: 12px 0; }
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 0 -20px;
}

/* Fields */
.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.field-label .hint { font-weight: 400; color: var(--text-muted); }
.field-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: var(--ff-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field-input::placeholder { color: var(--text-muted); }

/* date input */
input[type="date"].field-input {
  color-scheme: dark;
}
[data-theme="light"] input[type="date"].field-input {
  color-scheme: light;
}

.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .field-input { flex: 1; }

.field-hint {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 5px;
  min-height: 14px;
  font-family: var(--ff-mono);
}
.field-hint.success { color: #4caf50; }
.field-hint.error   { color: var(--accent); }

.mt-8  { margin-top: 8px !important; }
.mt-4  { margin-top: 4px !important; }

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--ff-display);
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s var(--ease-spring);
}
.btn-primary svg { width: 15px; height: 15px; }
.btn-primary:hover  { opacity: 0.88; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }
.btn-icon svg { width: 15px; height: 15px; }

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle-switch input { display: none; }
.toggle-track {
  width: 40px; height: 22px;
  border-radius: 99px;
  background: var(--toggle-bg);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease-spring), background 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.toggle-switch input:checked ~ .toggle-track { background: var(--toggle-on); }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle-switch.sm .toggle-track { width: 34px; height: 19px; }
.toggle-switch.sm .toggle-thumb { width: 13px; height: 13px; }
.toggle-switch.sm input:checked ~ .toggle-track .toggle-thumb { transform: translateX(15px); }
.toggle-label-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Channel list */
.channel-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.no-channels {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
}
.channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  cursor: grab;
  transition: border-color 0.15s, background 0.15s;
}
.channel-item:hover { border-color: var(--border-strong); background: var(--surface-raised); }
.channel-item:active { cursor: grabbing; }
.ci-drag {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}
.ci-drag svg { width: 14px; height: 14px; }
.ci-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.ci-avatar-placeholder {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-raised);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ci-name {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ci-id {
  font-family: var(--ff-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
}
.ci-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ci-btn {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ci-btn:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--surface-raised); }
.ci-btn.danger:hover { color: var(--accent); border-color: var(--accent); }
.ci-btn svg { width: 13px; height: 13px; }

/* SortableJS ghost */
.sortable-ghost {
  opacity: 0.35;
  background: var(--accent-dim) !important;
  border-color: var(--accent) !important;
}

/* count badge */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--ff-mono);
  border-radius: 99px;
  padding: 1px 7px;
  text-transform: none;
  letter-spacing: 0;
}

/* ── CHANNEL OPTIONS PANEL ──────────────── */
.channel-options-panel {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-radius: var(--r-modal);
  z-index: 5;
  display: flex;
  flex-direction: column;
  animation: panel-in 0.22s var(--ease-out) both;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
}
.channel-options-panel.hidden { display: none; }
@keyframes panel-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}
.cop-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cop-back {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--ff-display);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.cop-back:hover { color: var(--text-primary); background: var(--surface-raised); }
.cop-back svg { width: 14px; height: 14px; }
.cop-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cop-body {
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cop-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.option-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.option-toggle-row:last-child { border-bottom: none; }
.option-toggle-row > span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── LOADING TOAST ──────────────────────── */
.loading-toast {
  position: fixed;
  bottom: 40px;
  right: 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--ff-mono);
  box-shadow: var(--shadow-modal);
  z-index: 200;
  animation: toast-in 0.3s var(--ease-spring) both;
}
.loading-toast.hidden { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ADJUSTMENTS ─────────────── */
@media (max-width: 900px) {
  .channel-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }
  .page { padding: 56px 20px 48px; }
}

@media (max-width: 480px) {
  .channel-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
  }
  .page { padding: 52px 16px 44px; }
  .subs-value { font-size: 1.4rem; }
}

/* ── TOP BAR & UPDATE INDICATOR ──────────── */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  pointer-events: none; /* so it doesn't block clicks */
}

.app-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  opacity: 0.9;
}

.update-indicator {
  position: absolute;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-linear);
  font-size: 0.65rem;
  color: var(--text-muted);
  pointer-events: auto; /* re-enable clicks here if needed */
}

.update-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}

.update-dot.active {
  background: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.update-dot.monitoring {
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 4px rgba(76, 175, 80, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* ── MONETIZE BUTTON ──────────── */
.monetize-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1.5px solid var(--text-muted);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: auto; /* push to the right if in flex container */
}

.monetize-btn svg {
  width: 12px;
  height: 12px;
}

.monetize-btn.active {
  border-color: #4caf50;
  color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
}
