/* ChromaTube. Dark YouTube-like palette, rainbow brand accent. */

:root {
  --bg: #0f0f0f;
  --card: #1c1c1c;
  --card-2: #272727;
  --line: #303030;
  --text: #f1f1f1;
  --muted: #aaaaaa;
  --accent: #ff0033;
  --accent-hover: #e0002c;
  --amber: #ffb300;
  --ok: #00c853;
  --radius: 12px;
  --rainbow: linear-gradient(90deg, #ff0033, #ff7a00, #ffcc00, #00c853, #00b0ff, #7c4dff, #ff0033);
  --rainbow-conic: conic-gradient(from 180deg, #ff0033, #ff7a00, #ffcc00, #00c853, #00b0ff, #7c4dff, #ff0033);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --font: Roboto, "Helvetica Neue", Arial, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: clamp(30px, 5.4vw, 52px); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 10px; }

a { color: inherit; }

::selection { background: rgba(255, 0, 51, 0.4); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font: 600 14px/1 var(--font);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 0 18px rgba(255, 0, 51, 0.45); }

.btn-ghost { background: var(--card-2); }
.btn-ghost:hover { background: #3a3a3a; }

.btn-outline { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.09); }

.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }

.logo {
  position: relative;
  width: 34px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.logo-mark {
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
  animation: logo-hue 7s linear infinite;
}

@keyframes logo-hue { to { filter: hue-rotate(360deg) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4)); } }

.wordmark { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.word-chroma {
  background: var(--rainbow);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: word-slide 7s linear infinite;
}
.word-tube { color: var(--text); }
.wordmark-sm { font-size: 16px; }

@keyframes word-slide { to { background-position: 300% 0; } }

.mast-nav { display: flex; gap: 20px; margin-left: 12px; }
.mast-nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.mast-nav a:hover { color: var(--text); }

.mast-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.side-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 6px;
  cursor: pointer;
}

.balance-chip {
  background: var(--card-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 13px;
}
.user-email { color: var(--muted); font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Landing: hero ---------- */

.hero { max-width: 900px; margin: 0 auto; padding: 72px 20px 40px; text-align: center; }
.hero h1 { max-width: 720px; margin: 0 auto 16px; }
.hero-sub { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero-demo { margin-top: 44px; }
.hero-odometer-demo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 28px;
  box-shadow: var(--shadow);
}
.hero-demo-cap { color: var(--muted); font-size: 13px; }

/* ---------- Landing: sections ---------- */

.section { max-width: 1040px; margin: 0 auto; padding: 56px 20px; }
.section-sub { color: var(--muted); margin-top: -4px; margin-bottom: 28px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid transparent;
}
.step:hover { border-color: var(--line); }
.step h3 { margin-top: 12px; }
.step p { color: var(--muted); margin: 0; }
.step-num {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  color: #111;
  background: var(--rainbow-conic);
}

/* ---------- Packs / pricing ---------- */

.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pack {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pack-name { font-weight: 700; font-size: 16px; }
.pack-credits { color: var(--muted); font-size: 14px; }
.pack-price { font-size: 28px; font-weight: 800; margin: 4px 0 10px; }
.pack .btn { margin-top: auto; }

.pricing-note { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* ---------- Learn section ---------- */

.section-learn {
  background: var(--card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: none;
}
.section-learn > h2, .section-learn > .section-sub { max-width: 1000px; margin-left: auto; margin-right: auto; }
.section-learn > .section-sub { padding: 0 20px; }
.section-learn > h2 { padding: 0 20px; }
.learn-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 20px;
}
.learn-card { background: var(--card-2); border-radius: var(--radius); padding: 20px; }
.learn-card p { color: var(--muted); margin: 0; }

/* ---------- FAQ ---------- */

.faq details {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; color: var(--muted); font-size: 18px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 16px; color: var(--muted); margin: 0; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 28px 20px 40px; }
.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}
.footer-muted { font-size: 12px; color: #777; }

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  padding: 16px;
}
.modal.modal-open { display: flex; animation: modal-fade 0.22s ease-out; }
body.modal-lock { overflow: hidden; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: card-in 0.24s ease-out;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-x {
  position: absolute;
  top: 10px; right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.modal-x:hover { color: var(--text); transform: rotate(90deg); }

/* Auth card: centered, calm, one column — the ChatGPT/Claude pattern. */
.auth-card { padding: 32px 28px 24px; }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.auth-head .logo { margin-bottom: 8px; animation: logo-in 0.4s ease-out; }
@keyframes logo-in {
  from { opacity: 0; transform: scale(0.8) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
.auth-title {
  font: 700 22px/1.3 var(--font);
  margin: 0;
  padding: 0;
  text-align: center;
}
.auth-sub {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 16px;
  text-align: center;
  max-width: 300px;
}
.auth-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 18px;
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  flex: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: 600 13.5px var(--font);
  padding: 8px 14px 10px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}
.auth-tab::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.auth-tab.active { color: var(--text); background: transparent; }
.auth-tab.active::after { transform: scaleX(1); }
.auth-pane { animation: pane-in 0.22s ease-out; }
@keyframes pane-in {
  from { opacity: 0; transform: translateX(6px); }
  to { opacity: 1; transform: translateX(0); }
}
.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  margin: 16px 0 0;
}
.auth-switch-link { font-size: 13.5px; padding: 2px 4px; border-radius: 6px; }
.auth-switch-link::after { display: none; }
.auth-switch-link:hover { color: var(--text); }
.auth-banner {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.auth-trust {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 12px 0 0;
}
.auth-trust svg { flex-shrink: 0; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) {
  .modal.modal-open, .modal-card, .auth-head .logo, .auth-pane { animation: none; }
  .modal-x, .auth-tab::after { transition: none; }
}

/* Auth submit: full-width brand button + spinner while the request runs. */
.auth-card .btn-primary { width: 100%; height: 44px; border-radius: 12px; font-size: 15px; transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease; }
.auth-card .btn-primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 6px 20px rgba(255, 0, 51, 0.25); }
.auth-card .btn-primary:active:not(:disabled) { transform: translateY(0); filter: brightness(0.97); box-shadow: none; }
.auth-card .btn-primary:disabled { opacity: 0.75; cursor: progress; }
.btn-primary.is-loading { position: relative; color: transparent !important; }
.btn-primary.is-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */

.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 500; }

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: 400 15px var(--font);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:hover { border-color: #3a3a3a; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.18); }
.input::placeholder { color: #666; }
.textarea { resize: vertical; min-height: 64px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }

.pwd-wrap { position: relative; display: flex; }
.pwd-toggle {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font: 600 12px var(--font);
  cursor: pointer;
  padding: 4px 6px;
}
.pwd-toggle:hover { color: var(--text); }
.pwd-wrap .input { padding-right: 56px; }

.form-error {
  color: #ff6b81;
  background: rgba(255, 0, 51, 0.08);
  border: 1px solid rgba(255, 0, 51, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  animation: error-shake 0.3s ease;
}
@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.form-error[hidden] { display: none; }
.list-error { margin-bottom: 12px; }

.fine-print { color: var(--muted); font-size: 12px; margin: 0; }

/* ---------- App layout ---------- */

.app-shell { display: flex; min-height: calc(100vh - 45px); }

.sidebar {
  width: 210px;
  flex: none;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 45px;
  align-self: flex-start;
  max-height: calc(100vh - 45px);
  overflow-y: auto;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.side-link:hover { background: var(--card-2); }
.side-link.active { background: var(--card-2); font-weight: 700; }
.side-link svg { color: #909090; flex: none; }
.side-link.active svg { color: var(--accent); }

.main {
  flex: 1;
  min-width: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1200px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title { font-size: 17px; margin-bottom: 14px; }
.card-sub { color: var(--muted); font-size: 13px; margin: -8px 0 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Earnings + odometer ---------- */

.earnings-card { position: relative; overflow: hidden; }
.earnings-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--rainbow);
  background-size: 300% 100%;
  animation: word-slide 7s linear infinite;
}
.earnings-skel { margin-bottom: 14px; }
.earnings-skel[hidden] { display: none; }
.earnings-sub { color: var(--muted); font-size: 13px; margin: 6px 0 18px; }

.od {
  display: inline-flex;
  align-items: flex-end;
  line-height: 1;
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.od-sm { font-size: 34px; }

/* Strip numbers must be EXACTLY 1em tall: translateY moves in 1em units, so
   any other height drifts the window between two digits (the video glitch). */
.od-dollar { height: 1em; line-height: 1em; margin-right: 2px; }
.od-digit { display: inline-block; height: 1em; overflow: hidden; width: 0.62em; position: relative; }
.od-strip { display: flex; flex-direction: column; will-change: transform; }
.od-num { display: block; height: 1em; line-height: 1em; text-align: center; }
.od-sep { display: inline-block; height: 1em; line-height: 1em; width: 0.32em; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .od-strip { transition: none !important; }
  .logo-mark, .word-chroma, .earnings-card::before { animation: none; }
}

/* ---------- Sparkline ---------- */

.spark-wrap { margin-top: 4px; }
.spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 84px;
  padding: 6px;
  background: var(--bg);
  border-radius: 10px;
}
.spark-bar {
  flex: 1;
  min-height: 4px;
  background: var(--card-2);
  border-radius: 3px 3px 0 0;
  transition: height 0.5s ease;
}
.spark-bar.spark-hot { background: linear-gradient(180deg, var(--accent) 0%, #b00026 100%); }
.spark-bar.spark-peak { background: var(--rainbow); background-size: 200% 100%; }
.spark-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }

/* ---------- Channel card ---------- */

.channel-pending { text-align: center; padding: 16px 8px; }
.pending-title { font-weight: 700; margin-top: 12px; }
.pending-sub { color: var(--muted); font-size: 13px; }

.spinner {
  width: 34px; height: 34px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid var(--card-2);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.channel-connected { display: flex; align-items: center; gap: 14px; }
.channel-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; color: #fff;
  background: var(--rainbow-conic);
}
.channel-title { font-weight: 700; margin-bottom: 6px; }

/* ---------- Schedule list ---------- */

.schedule-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.schedule-idea { font-weight: 600; font-size: 14px; }
.schedule-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.schedule-next { text-align: right; flex: none; }
.schedule-next-label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.schedule-next-time { font-size: 13px; font-weight: 600; }

/* ---------- Videos grid ---------- */

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.vcard { display: flex; flex-direction: column; }
.vthumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-2);
}
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vthumb-rainbow {
  background: var(--rainbow-conic);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vthumb-rainbow::before { content: ""; position: absolute; inset: 0; background: rgba(15, 15, 15, 0.35); }
.vthumb-play { position: relative; z-index: 1; opacity: 0.95; }

.vbody { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 6px; }
.vtitle {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.vmeta { color: var(--muted); font-size: 12px; }
.vrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vviews { color: var(--muted); font-size: 12px; }
.vearn { font-weight: 700; font-size: 14px; }
.vtags { display: flex; flex-wrap: wrap; gap: 4px; }
.vtag {
  font-size: 10px;
  color: var(--muted);
  background: var(--card-2);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ---------- Status pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--card-2);
  color: var(--muted);
  text-transform: uppercase;
}
.pill-queued { background: #333; color: #ccc; }
.pill-rendering { background: rgba(255, 179, 0, 0.15); color: var(--amber); }
.pill-rendering::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.pill-uploaded { background: var(--accent); color: #fff; }
.pill-failed { background: rgba(255, 0, 51, 0.12); color: #ff6b81; border: 1px solid rgba(255, 0, 51, 0.4); }
.pill-play { display: inline-flex; }

/* ---------- Learnings feed ---------- */

.learnings-list { display: flex; flex-direction: column; gap: 14px; }
.learning { display: flex; gap: 12px; }
.learning-avatar { flex: none; padding-top: 2px; }
.learning-body { min-width: 0; flex: 1; }
.learning-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.learning-src { font-weight: 700; font-size: 13px; }
.learning-time { color: var(--muted); font-size: 12px; }
.learning-text { font-size: 14px; }
.learning-detail { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- Empty states ---------- */

.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty-title { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty-sub { font-size: 13px; }

/* ---------- Skeletons ---------- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--card-2);
  border-radius: 8px;
  height: 14px;
  margin-bottom: 10px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-line.short { width: 55%; }
.skeleton-thumb { aspect-ratio: 16 / 9; height: auto; margin-bottom: 8px; }
.skel-card { height: 150px; border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

/* ---------- Toasts ---------- */

.toast-wrap {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-size: 14px;
}
.toast-in { opacity: 1; transform: translateY(0); }
.toast-success { border-left: 3px solid var(--ok); }
.toast-error { border-left: 3px solid var(--accent); }
.toast-info { border-left: 3px solid #00b0ff; }
.toast-msg { flex: 1; }
.toast-x {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
}
.toast-x:hover { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .steps, .learn-grid, .packs { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .mast-nav { display: none; }
  .side-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 45px;
    left: 0;
    bottom: 0;
    z-index: 60;
    background: var(--card);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    max-height: none;
  }
  .sidebar.sidebar-open { transform: translateX(0); box-shadow: var(--shadow); }
  .main { padding: 14px; }
}

@media (max-width: 600px) {
  .steps, .learn-grid, .packs { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding: 44px 16px 32px; }
  .user-email { display: none; }
  .schedule-row { flex-direction: column; align-items: flex-start; }
  .schedule-next { text-align: left; }
  .od { font-size: clamp(34px, 11vw, 48px); }
}

@media (max-width: 360px) {
  .masthead { padding: 8px 12px; gap: 8px; }
  .btn { padding: 8px 13px; font-size: 13px; }
  .btn-lg { padding: 11px 18px; font-size: 14px; }
  .balance-chip { font-size: 12px; padding: 5px 9px; }
  .wordmark { font-size: 17px; }
  .main { padding: 10px; }
  .card { padding: 14px; }
  .videos-grid { grid-template-columns: 1fr; }
}

/* --- Connect card: two modes (managed / cookie) ---------------------- */

.mode-card { display: flex; flex-direction: column; gap: 16px; }

.mode-tabs {
  display: flex;
  gap: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
}
.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.mode-tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.mode-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
}

.mode-pane { display: flex; flex-direction: column; gap: 14px; }
.mode-pane[hidden] { display: none; }
.pane-sub { margin: 0; color: var(--muted); }

.managed-upsell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-2);
}
.muted-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.muted-link:hover { color: var(--text); }

/* Cookie paste + live validation chips */

.cookie-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; resize: vertical; }
.cookie-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cookie-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.cookie-chip.chip-ok { color: #063; background: rgba(0, 200, 83, 0.15); border-color: rgba(0, 200, 83, 0.5); }
.cookie-chip.chip-miss { color: #ff8a80; background: rgba(255, 0, 51, 0.12); border-color: rgba(255, 0, 51, 0.45); }
.cookie-chip.chip-opt { opacity: 0.75; }
.chip-opt-note { color: var(--muted); font-style: italic; }
.cookie-note { margin-top: 6px; font-size: 12.5px; color: var(--amber); }

.cookie-help { margin-top: 10px; }
.cookie-help summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.cookie-help summary:hover { color: var(--text); }
.cookie-help[open] summary { color: var(--text); }
.cookie-help-note { margin: 10px 0 6px; color: var(--muted); font-size: 13px; }
.cookie-steps { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.cookie-steps li { font-size: 13px; color: var(--text); }

/* Managed credential hand-off */

.cred-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-2);
}
.cred-title { font-weight: 700; }
.cred-rows { display: flex; flex-direction: column; gap: 10px; }
.cred-row { display: flex; flex-direction: column; gap: 6px; }
.cred-controls { display: flex; gap: 8px; align-items: stretch; }
.cred-controls .input { flex: 1; }
.cred-studio-link { color: var(--text); font-weight: 600; }
.btn-small { padding: 7px 12px; font-size: 13px; }

.channel-failed { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
