/* ============================================================
   LEFT NEWS — polish pass
   Accessibility, responsive, micro-interactions, fixes
   ============================================================ */

/* -------- Tokens additions --------------------------------- */
:root {
  --focus-ring: 0 0 0 2px var(--bg-deep), 0 0 0 4px var(--accent-blue);
  --ease-out: cubic-bezier(.2,.7,.3,1);
}

/* -------- Body / scroll behavior --------------------------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* -------- Universal focus ring ----------------------------- */
*:focus { outline: none; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* -------- Universal text-wrap rules ------------------------ */
.nav-link, .nav-cta, .nav-icon-btn,
.pillgroup .p,
.np-btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger,
.as-item, .ab-cta,
.qstatus, .pcb-btn,
.toggle,
.field label,
.eyebrow, .live-pill, .vcard-tag, .vcard-dur,
.upnext-head .auto,
.row-head .right,
.section-head .sub, .section-head a.more,
.lblbar { white-space: nowrap; }

.as-item > span:first-of-type {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-sponsor .ad-cta { white-space: nowrap; }

/* -------- Section heads behave ----------------------------- */
.section-head { flex-wrap: wrap; gap: 10px; row-gap: 4px; align-items: center; }
.section-head h2 { white-space: nowrap; }
.row-head { flex-wrap: wrap; gap: 10px; row-gap: 6px; }
.row-head h3 { 
  flex-shrink: 0;
  white-space: nowrap;
  max-width: 100%;
}
.row-head h3 > * { flex-shrink: 0; white-space: nowrap; }
.row-head h3 .badge { flex-shrink: 0; white-space: nowrap; }
.row-head .right { flex-shrink: 0; }
.row-head .right > span { white-space: nowrap; }

/* Hero title: constrain so it doesn't underlay byline */
.player-meta .pm-left { flex: 1; min-width: 0; max-width: 100%; }
.player-meta h1 { max-width: 100%; }

/* Visualize the "continuous feed" position in the hero corner */
.player .hero-feed-chip {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  pointer-events: none;
  white-space: nowrap;
}
.player .hero-feed-chip .bars {
  display: inline-flex; align-items: flex-end; gap: 2px; height: 12px;
}
.player .hero-feed-chip .bars span {
  display: block; width: 2px; background: var(--accent-red);
  animation: barWave 1s ease-in-out infinite;
  border-radius: 1px;
}
.player .hero-feed-chip .bars span:nth-child(1) { height: 60%; animation-delay: -.3s; }
.player .hero-feed-chip .bars span:nth-child(2) { height: 100%; animation-delay: -.1s; }
.player .hero-feed-chip .bars span:nth-child(3) { height: 40%; animation-delay: -.5s; }
.player .hero-feed-chip .bars span:nth-child(4) { height: 80%; animation-delay: 0s; }
@keyframes barWave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}
.player .hero-feed-chip.paused .bars span { animation-play-state: paused; }

/* Thumb channel name should never wrap */
.thumb-poster .tp-ch .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* Live feed bug nowrap */
.live-bug > * { white-space: nowrap; }

/* -------- Smooth transitions ------------------------------- */
.nav-link, .nav-icon-btn, .nav-cta,
.np-btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger,
.pillgroup .p, .pcb-btn,
.vcard, .vcard-thumb, .upnext-item,
.creator-row-poster, .feed-card, .stat,
.as-item, .qrow, .toggle,
.channel-tabs .t {
  transition:
    transform .18s var(--ease-out),
    background-color .18s,
    border-color .15s,
    box-shadow .2s,
    color .12s,
    opacity .15s;
}

/* -------- Card hover w/ play overlay ----------------------- */
.vcard { user-select: none; }
.vcard-thumb { transition: transform .2s var(--ease-out), border-color .15s, box-shadow .2s; }
.vcard:hover .vcard-thumb {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -14px rgba(0,0,0,0.6);
  border-color: var(--border);
}
.vcard:hover .vcard-title { color: var(--accent-red); }

[data-theme="light"] .vcard:hover .vcard-title { color: var(--accent-red); }

.vcard-thumb .vc-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 2;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity .18s, transform .18s var(--ease-out);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.35));
}
.vcard-thumb .vc-play span {
  width: 52px; height: 52px;
  background: var(--accent-red);
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  box-shadow: 0 10px 30px rgba(239,68,68,0.45), 0 0 0 6px rgba(239,68,68,0.16);
}
.vcard:hover .vcard-thumb .vc-play { opacity: 1; transform: scale(1); }

/* -------- Nav: mobile / tablet polish ---------------------- */
.nav-inner { transition: padding .2s; }

.nav-mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
}
.nav-mobile-btn:hover { background: var(--bg-card); }

/* tablet: shrink */
@media (max-width: 1180px) {
  .nav-search { min-width: 200px; }
  .nav-cta span:not(.cta-short) { display: none; }
  .nav-cta::before { content: 'Donate'; }
}
@media (max-width: 1080px) {
  .nav-inner { gap: 18px; padding: 12px 22px; }
}

/* mobile: hamburger drawer */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-search { display: none; }
  .nav-cta { display: none; }
  .nav-icon-btn[data-mobile-hide="true"] { display: none; }
  .nav-mobile-btn { display: grid; }
  .nav-inner { padding: 12px 16px; gap: 10px; }
  .nav .ticker { font-size: 11.5px; }
}

/* mobile drawer */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 95;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }

.nav-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(340px, 86vw);
  background: var(--bg-elev);
  z-index: 96;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  animation: slideRight .25s var(--ease-out);
  overflow-y: auto;
}
@keyframes slideRight { from { transform: translateX(100%); } }

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.nav-drawer-section {
  padding: 14px 14px 4px;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-faint);
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 10px;
  border: none;
  background: transparent;
  text-align: left;
  width: calc(100% - 16px);
}
.drawer-link:hover { background: var(--bg-card); color: var(--text); }
.drawer-link.active { background: var(--bg-card); color: var(--text); }
.drawer-link .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live);
  margin-left: auto;
  animation: pulse 1.6s ease-out infinite;
}
.drawer-search {
  margin: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 9px 14px;
}
.drawer-search input {
  flex: 1; background: none; border: none; outline: none;
  font: inherit; color: var(--text); font-size: 14px;
}

/* -------- Page padding responsive -------------------------- */
@media (max-width: 720px) {
  .page { padding: 16px; }
  .live-wrap { padding: 16px; gap: 16px; }
}

/* -------- Home grid: better breakpoints -------------------- */
@media (max-width: 1080px) {
  .home-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* -------- Hero player tweaks ------------------------------- */
.player-meta {
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.92) 100%);
  padding-top: 70px;
  pointer-events: none;
}
.player-meta > * { pointer-events: auto; }

.player-meta h1 {
  text-shadow: 0 1px 12px rgba(0,0,0,0.4);
}

/* Mobile player */
@media (max-width: 720px) {
  .player-meta { padding: 60px 16px 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .player-meta .pm-eyebrow { font-size: 10px; flex-wrap: wrap; }
  .player-meta h1 { font-size: 22px; }
  .player-meta .pm-byline { font-size: 12px; flex-wrap: wrap; gap: 6px; }
  .player-meta .actions { align-self: flex-end; gap: 6px; }
  .iconbtn { width: 36px; height: 36px; }
  .iconbtn.lg { width: 48px; height: 48px; }
  .play-center .playbtn { width: 64px; height: 64px; }
  .play-center .playbtn svg { width: 24px; height: 24px; }
}

/* -------- Player control bar ------------------------------- */
.player-controlbar { flex-wrap: wrap; row-gap: 8px; }
.pcb-track { min-width: 120px; }
.pcb-track:hover .pcb-track-fill::after { transform: translateY(-50%) scale(1.4); }
.pcb-track-fill::after { transition: transform .12s; }
.pcb-track-fill, .pcb-track-buffer { pointer-events: none; }

@media (max-width: 720px) {
  .player-controlbar { padding: 8px 10px; gap: 6px; font-size: 12px; }
  .pcb-time { font-size: 11px; min-width: 0; }
  .pcb-btn[data-mobile-hide] { display: none; }
}

/* -------- Now playing strip mobile ------------------------- */
@media (max-width: 720px) {
  .now-playing { flex-direction: column; padding: 14px; gap: 12px; }
  .np-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .np-actions .np-btn.primary { flex: 1; justify-content: center; }
}

/* -------- Up next: better motion --------------------------- */
.upnext-item { transition: background-color .14s, transform .14s; }
.upnext-item:active { transform: scale(0.99); }

/* -------- Live feed responsive ----------------------------- */
@media (max-width: 1100px) {
  .live-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .live-lower { padding: 60px 16px 14px; }
  .live-lower h2 { font-size: 22px; max-width: none; }
  .live-lower-bar { padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  .live-lower-bar .countdown { font-size: 10.5px; margin-left: 0; flex-basis: 100%; text-align: left; padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.08); }
  .live-bug { top: 10px; left: 10px; }
}

body.has-mini { padding-bottom: 92px; }
@media (max-width: 720px) {
  body.has-mini { padding-bottom: 80px; }
}

/* -------- Mini player ------------------------------------- */
.mini {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  height: 64px;
  background: color-mix(in oklch, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 70;
  display: flex;
  align-items: stretch;
  padding: 8px 10px 8px 8px;
  gap: 12px;
  overflow: hidden;
  animation: miniIn .3s var(--ease-out);
}
@keyframes miniIn { from { transform: translate(-50%, 16px); opacity: 0; } }

.mini .mini-progress {
  position: absolute;
  left: 14px; right: 14px;
  bottom: 4px;
  height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
}
.mini .mini-progress > div { height: 100%; background: var(--accent-red); transition: width .25s linear; }

.mini .mini-thumb {
  width: 80px;
  height: 100%;
  aspect-ratio: auto;
  background: black;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.mini .mini-thumb-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.45);
  color: white;
  opacity: 0;
  transition: opacity .15s;
}
.mini .mini-thumb:hover .mini-thumb-overlay { opacity: 1; }

.mini .mini-body {
  flex: 1; min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  padding: 2px 0;
}
.mini .mini-body .mi-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
.mini .mini-body .mi-ch {
  font-size: 11.5px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini .mini-controls {
  display: flex; align-items: center; gap: 2px;
  flex-shrink: 0;
}
.mini .mini-controls button {
  background: transparent;
  border: none;
  color: var(--text-mute);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background-color .12s, color .12s, transform .12s;
}
.mini .mini-controls button:hover { background: var(--bg-card); color: var(--text); }
.mini .mini-controls button:active { transform: scale(0.92); }
.mini .mini-controls button.primary {
  width: 38px; height: 38px;
  background: var(--accent-red);
  color: white;
}
.mini .mini-controls button.primary:hover { background: var(--accent-red-deep); }

.mini .mini-dismiss {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-faint);
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  transition: background-color .12s, color .12s;
}
.mini .mini-dismiss:hover { background: var(--bg-card); color: var(--text); }

@media (max-width: 720px) {
  .mini { width: calc(100vw - 16px); bottom: 12px; padding: 6px; gap: 8px; height: 60px; }
  .mini .mini-thumb { width: 64px; border-radius: 6px; }
  .mini .mini-controls button { width: 30px; height: 30px; }
  .mini .mini-controls button.primary { width: 34px; height: 34px; }
  .mini .mini-dismiss { display: none; }
}
@media (max-width: 420px) {
  .mini .mini-controls button:first-child { display: none; }
}

/* -------- Channel hero mobile ------------------------------ */
@media (max-width: 800px) {
  .channel-hero { height: auto; padding: 22px 22px 24px; }
  .channel-hero .ch-body {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .channel-hero .ch-avatar { width: 72px; height: 72px; font-size: 28px; border-width: 3px; }
  .channel-hero h1 { font-size: 26px; }
  .channel-hero .ch-stats { font-size: 12.5px; flex-wrap: wrap; gap: 8px; }
  .channel-hero .ch-bio { font-size: 13px; }
  .channel-hero .ch-actions { width: 100%; flex-wrap: wrap; }
  .channel-hero .ch-actions .np-btn { flex: 1; justify-content: center; min-width: 0; }
}
.channel-tabs { overflow-x: auto; scrollbar-width: none; }
.channel-tabs::-webkit-scrollbar { display: none; }
.channel-tabs .t { flex-shrink: 0; }

/* -------- Admin shell responsive --------------------------- */
.admin-shell { position: relative; }

@media (max-width: 1080px) {
  .admin-shell { grid-template-columns: 64px 1fr; }
  .admin-side { padding: 16px 8px; }
  .admin-side .as-section { display: none; }
  .admin-side .as-item > span:not(.count) { display: none; }
  .admin-side .as-item .count { display: none; }
  .admin-side .as-item {
    justify-content: center;
    padding: 10px 0;
    width: 48px;
    margin: 2px auto;
  }
  .admin-side > div:last-child { padding: 6px 0 !important; border: none !important; margin-top: 12px; }
  .admin-side > div:last-child > div { flex-direction: column; gap: 8px; align-items: center !important; }
  .admin-side > div:last-child > div > div { display: none; }
  .admin-side > div:last-child > div > button { font-size: 10.5px; padding: 4px 6px !important; }
  .admin-main { padding: 24px 24px; }
}
@media (max-width: 720px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .admin-main { padding: 16px 14px; }
}

/* Admin header */
@media (max-width: 900px) {
  .admin-h { flex-direction: column; align-items: flex-start; gap: 14px; }
  .admin-h .actions { flex-wrap: wrap; gap: 8px; width: 100%; }
  .admin-h h1 { font-size: 22px; }
}

/* Stat grid responsive */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
}

/* Admin grid columns responsive */
@media (max-width: 1080px) {
  .admin-main [style*="grid-template-columns: 2fr 1fr"],
  .admin-main [style*="grid-template-columns: 1fr 380px"],
  .admin-main [style*="grid-template-columns: 1fr 320px"],
  .admin-main [style*="grid-template-columns: 1fr 1fr"],
  .admin-main [style*="grid-template-columns: repeat(2, 1fr)"],
  .admin-main [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* Queue table on mobile = card list */
@media (max-width: 900px) {
  .qrow {
    grid-template-columns: 32px 80px 1fr 40px;
    grid-template-rows: auto auto;
    gap: 6px 12px;
    padding: 12px;
  }
  .qrow.head { display: none; }
  .qrow .qhandle { grid-row: 1 / 3; align-self: center; }
  .qrow .qt { grid-row: 1 / 3; align-self: center; }
  .qrow .qtitle { grid-column: 3; grid-row: 1; }
  .qrow .qactions { grid-column: 4; grid-row: 1 / 3; align-self: center; flex-direction: column; }
  .qrow > :nth-child(4),
  .qrow > :nth-child(5),
  .qrow > :nth-child(6),
  .qrow > :nth-child(7) {
    grid-column: 3 / 5;
    grid-row: 2;
    font-size: 11.5px;
    display: inline-block;
    margin-right: 8px;
  }
  .qrow > :nth-child(5),
  .qrow > :nth-child(6),
  .qrow > :nth-child(7) {
    grid-column: auto;
    grid-row: 2;
  }
}

/* Creators table on mobile */
@media (max-width: 900px) {
  .qtable .qrow[style*="grid-template-columns"] {
    grid-template-columns: 48px 1fr 60px !important;
  }
  .qtable .qrow[style*="grid-template-columns"] > :nth-child(3),
  .qtable .qrow[style*="grid-template-columns"] > :nth-child(4),
  .qtable .qrow[style*="grid-template-columns"] > :nth-child(5),
  .qtable .qrow[style*="grid-template-columns"] > :nth-child(6) {
    display: none;
  }
}

/* -------- Vgrid responsive --------------------------------- */
@media (max-width: 540px) {
  .vgrid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .vgrid.cozy { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .vcard-title { font-size: 12.5px; }
  .vcard-meta { font-size: 11px; gap: 4px; flex-wrap: wrap; row-gap: 0; }
}

/* -------- Headlines responsive ----------------------------- */
@media (max-width: 600px) {
  .headline-row { grid-template-columns: 20px 80px 1fr; }
  .headline-row .h-views { display: none; }
  .headline-row .rank { font-size: 18px; }
  .headline-row .h-title { font-size: 13px; }
}

/* -------- Footer responsive -------------------------------- */
@media (max-width: 1000px) {
  .foot-inner { grid-template-columns: 1.4fr 1fr 1fr; }
  .foot-inner > div:nth-child(4) { display: none; }
  .foot-inner > div:nth-child(5) { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .foot-inner > div:first-child { grid-column: 1 / -1; }
  .foot-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .foot { padding: 28px 18px 22px; }
}

/* -------- Light theme polish ------------------------------- */
[data-theme="light"] {
  --shadow-card: 0 1px 0 rgba(0,0,0,0.02), 0 8px 28px -14px rgba(20,20,40,0.18);
  --shadow-pop: 0 24px 56px -22px rgba(20,20,40,0.22);
}
[data-theme="light"] .nav {
  background: color-mix(in oklch, #ffffff 90%, transparent);
  border-bottom: 1px solid #ebe7d8;
}
[data-theme="light"] .ticker { background: #ffffff; }
[data-theme="light"] .ticker-item b { color: #1a1a1a; }
[data-theme="light"] .ticker-item .up { color: #16a34a; }
[data-theme="light"] .player-controlbar { background: #ffffff; }
[data-theme="light"] .player-meta {
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.88) 100%);
}
[data-theme="light"] .pcb-track-fill::after { background: var(--text); }
[data-theme="light"] .upnext-item.now {
  background: color-mix(in oklch, var(--accent-red) 8%, var(--bg-elev));
}
[data-theme="light"] .nav-cta { background: #1a1a1a; color: white; }
[data-theme="light"] ::selection { background: var(--accent-red); color: white; }
[data-theme="light"] .ad { background: #fff; }
[data-theme="light"] .mini { background: #fff; }
[data-theme="light"] .nav-icon-btn .badge { border-color: #ffffff; }
[data-theme="light"] .live-bug span { color: white; }
[data-theme="light"] .feed-card { background: #ffffff; }
[data-theme="light"] .pillgroup { background: #fff; }
[data-theme="light"] .pillgroup .p.active { background: #f1ede3; }
[data-theme="light"] .admin-login { box-shadow: var(--shadow-pop); }
[data-theme="light"] .lchat-input { color: var(--text-mute); }

/* -------- Command Palette (⌘K) ----------------------------- */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: grid;
  place-items: start center;
  padding-top: clamp(40px, 12vh, 140px);
  animation: fade .15s;
}
.cmdk {
  width: min(640px, calc(100% - 32px));
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: cmdkPop .2s var(--ease-out);
}
@keyframes cmdkPop {
  from { transform: translateY(-12px) scale(0.98); opacity: 0; }
}
.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-mute);
}
.cmdk-input-row input {
  flex: 1; background: none; border: none; outline: none;
  font: inherit; font-size: 16px; color: var(--text);
}
.cmdk-input-row input::placeholder { color: var(--text-faint); }
.cmdk-input-row .esc {
  font-family: var(--font-mono); font-size: 10.5px;
  background: var(--bg-card-2); padding: 3px 7px;
  border-radius: 4px; color: var(--text-mute);
}
.cmdk-results { max-height: min(60vh, 540px); overflow-y: auto; padding: 6px 0 10px; }
.cmdk-results::-webkit-scrollbar { width: 6px; }
.cmdk-results::-webkit-scrollbar-thumb { background: var(--bg-card-2); border-radius: 4px; }
.cmdk-group-head {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-faint);
  padding: 12px 18px 4px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  margin: 0 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
}
.cmdk-item:hover, .cmdk-item.active { background: var(--bg-card); }
.cmdk-item .ci-thumb {
  width: 44px; height: 26px; border-radius: 4px;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.cmdk-item .ci-body { flex: 1; min-width: 0; }
.cmdk-item .ci-title {
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmdk-item .ci-sub { font-size: 11.5px; color: var(--text-mute); margin-top: 1px; }
.cmdk-item .ci-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--bg-card-2);
  border-radius: 6px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.cmdk-empty { padding: 36px 24px; text-align: center; color: var(--text-mute); font-size: 13.5px; }

/* -------- Toast ------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-pop);
  animation: toastIn .25s var(--ease-out);
}
@keyframes toastIn { from { transform: translate(-50%, 24px); opacity: 0; } }
.toast .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 0 4px rgba(239,68,68,0.2);
}

/* -------- "Topics" view styling --------------------------- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.topic-card {
  position: relative;
  height: 140px;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 16px;
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-soft);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.topic-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -14px rgba(0,0,0,0.45); }
.topic-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.16), transparent 50%), radial-gradient(circle at 20% 90%, rgba(0,0,0,0.35), transparent 60%);
  pointer-events: none;
}
.topic-card .tc-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.1;
  text-wrap: balance;
  z-index: 1;
}
.topic-card .tc-count {
  z-index: 1;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* -------- Search hover affordance ------------------------- */
.nav-search { cursor: pointer; }
.nav-search:hover { border-color: var(--border); }
.nav-search input { pointer-events: none; }

/* -------- Misc polish ------------------------------------- */
.nav-icon-btn .badge {
  border-color: var(--bg-deep);
}

/* Better thumbnails — subtle inner glow */
.thumb-poster .tp-grain {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(0,0,0,0.28), transparent 55%);
}

/* Up-next list — better scroll on mobile */
@media (max-width: 1080px) {
  .upnext-list { max-height: 420px; }
}

/* Better disabled / loading-ish state for live pill in dark */
.live-pill .ldot { box-shadow: 0 0 0 2px rgba(255,255,255,0.18); }

/* Subtle nav drop shadow when scrolled */
.nav.scrolled {
  box-shadow: 0 6px 24px -16px rgba(0,0,0,0.5), 0 1px 0 var(--border-soft);
}

/* Tweaks panel — make sure it doesn't collide with mini player */
@media (max-width: 720px) {
  [class*="tweaks-panel"] { left: 12px !important; right: 12px !important; bottom: 84px !important; width: auto !important; }
}

/* -------- Print suppress ---------------------------------- */
@media print {
  .nav, .ticker, .mini, .foot { display: none; }
}

/* -------- Hide scrollbars on horizontal rows -------------- */
.row-track { scroll-behavior: smooth; }

/* -------- Make subscribers count chip more readable ------- */
.creator-row-poster:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(0,0,0,0.55); }

/* -------- Body lock when modal/drawer open ---------------- */
body.no-scroll { overflow: hidden; }

/* -------- Sticky right rail offset for fixed nav ---------- */
@media (min-width: 1081px) {
  .home-rail, .feed-right { position: sticky; top: 110px; }
}
.home-grid > div:last-child[style*="position: sticky"] { top: 110px; }

/* -------- Skeleton placeholder backgrounds --------------- */
.skel {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card-2) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* -------- Better active highlight on row arrow buttons ---- */
.row-head .arrow-btns button:hover { background: var(--bg-card-2); border-color: var(--border); }
.row-head .arrow-btns button:active { transform: scale(0.96); }

/* -------- Eyebrow color in light theme ------------------- */
[data-theme="light"] .eyebrow { color: var(--accent-red); }

/* -------- Hide tweaks panel on mobile when not open ------- */
@media (max-width: 540px) {
  .nav .ticker-label { padding: 0 10px; font-size: 10.5px; }
  .ticker { height: 34px; font-size: 11.5px; }
}

/* -------- Channel-detail tabs always nowrap -------------- */
.channel-tabs .t { white-space: nowrap; }

/* -------- Hover ad CTA --------------------------------- */
.ab-cta:hover { background: var(--accent-red-deep); }

/* -------- Make ticker pause on hover -------------------- */
.ticker-track:hover .ticker-rail { animation-play-state: paused; }

/* -------- Improved channel poster handle visibility ----- */
.creator-row-poster .handle {
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(3px);
  padding: 3px 7px;
  border-radius: 3px;
  left: 14px;
  bottom: 64px;
}

/* -------- Better avatar gradient in channel hero -------- */
.channel-hero .ch-grain {
  background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,0.22), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(0,0,0,0.45), transparent 55%);
}

/* -------- Improve channel handle position --------------- */
.creator-row-poster .badge-subs {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}

/* -------- Better player iframe corners (when YT embed) -- */
.player-iframe { border-radius: 0; }

/* -------- Nav drawer header logo color polish ----------- */
.nav-drawer-head .nav-logo { font-size: 18px; }

/* -------- Hover for "more" links ------------------------ */
.section-head a.more svg, .row-head .right svg { transition: transform .15s; }
.section-head a.more:hover svg { transform: translateX(2px); }

/* -------- Accent transitions on link hover -------------- */
.np-btn.primary:hover { transform: translateY(-1px); }
.np-btn.primary:active { transform: translateY(0); }

/* -------- Make headline rank stand out ------------------ */
.headline-row:hover .rank { color: var(--accent-red); }
.headline-row .rank { transition: color .15s; }

/* -------- Smaller details ------------------------------ */
.field input, .field textarea, .field select { transition: border-color .15s, box-shadow .15s; }

/* -------- Sched item hover ----------------------------- */
.sched-item { transition: background-color .12s; padding-left: 6px; margin-left: -6px; padding-right: 6px; margin-right: -6px; border-radius: 6px; }
.sched-item:hover { background: var(--bg-card); }

/* -------- Up Next item: hide refresh row when no room -- */
@media (max-width: 480px) {
  .upnext > div:last-child { font-size: 10.5px; }
}

/* -------- Tweaks panel z order ------------------------ */
[class*="tweaks-panel"] { z-index: 75 !important; }

/* -------- Channels spotlight responsive ---------------- */
@media (max-width: 900px) {
  .row-track { padding: 0 16px 4px; }
  .row-head { margin: 0 16px 12px; }
  .channels-spotlight { margin-left: 16px !important; margin-right: 16px !important; }
}
@media (max-width: 720px) {
  .channels-spotlight { padding: 28px 20px !important; min-height: 0 !important; }
}
.channels-spotlight .btn-primary, .channels-spotlight .btn-secondary { white-space: nowrap; }
