:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --line: #2a2f3a;
  --text: #eceef3;
  --muted: #9aa3b2;
  --accent: #f5a524;
  --accent-ink: #1a1203;
  --live: #ff4d5e;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ede6; --line: #e2ded4;
    --text: #1c1d22; --muted: #62666f; --accent: #d98400; --accent-ink: #fff;
    --live: #d62839; --shadow: 0 1px 2px rgba(20,20,30,.06), 0 6px 18px rgba(20,20,30,.06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ede6; --line: #e2ded4;
  --text: #1c1d22; --muted: #62666f; --accent: #d98400; --accent-ink: #fff;
  --live: #d62839; --shadow: 0 1px 2px rgba(20,20,30,.06), 0 6px 18px rgba(20,20,30,.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; padding-bottom: 48px; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: 1.25rem; }
p { margin: 0 0 .75rem; }
ol, ul { margin: 0; padding: 0; list-style: none; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* Topo */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.logo-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); position: relative; }
.logo-mark::after { content: ""; position: absolute; inset: 7px 5px; background: var(--bg); border-radius: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current] { color: var(--text); background: var(--surface-2); }
.search { margin-left: auto; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; min-width: 0; flex: 0 1 300px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: inherit; padding: 8px 14px; font: inherit; font-size: .95rem; }
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--accent); }
.search button, .theme { background: none; border: 0; color: var(--muted); padding: 0 12px; cursor: pointer; display: grid; place-items: center; }
.search button:hover, .theme:hover { color: var(--accent); }
.theme { border: 1px solid var(--line); border-radius: 999px; width: 36px; height: 36px; padding: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-block: 8px 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { white-space: nowrap; font-size: .85rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.cats a::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--h) 80% 60%); margin-right: 7px; }
.cats a:hover, .cats a[aria-current] { color: var(--text); border-color: hsl(var(--h) 70% 55%); background: color-mix(in srgb, hsl(var(--h) 80% 55%) 14%, transparent); }

/* Hero */
.hero { padding: 40px 0 28px; }
.eyebrow { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.eyebrow a:hover { color: var(--accent); }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { color: var(--muted); max-width: 54ch; font-size: 1.1rem; margin-top: 12px; }
.clock { margin-top: 14px; font-size: .9rem; color: var(--muted); text-transform: capitalize; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 14px; gap: 12px; }
.sec-head a { color: var(--muted); font-size: .9rem; font-weight: 600; }
.sec-head a:hover { color: var(--accent); }
.page-head { padding: 28px 0 18px; display: block; }
.page-head.ch-page { display: flex; align-items: center; gap: 16px; }
.page-head.ch-page > div { flex: 1; min-width: 0; }
.page-head[style] h1::after { content: ""; display: block; width: 44px; height: 4px; border-radius: 4px; margin-top: 10px; background: hsl(var(--h) 80% 58%); }

/* Cartões */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.cats-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cat { display: flex; flex-direction: column; gap: 6px; border-top: 3px solid hsl(var(--h) 75% 58%); transition: transform .15s, border-color .15s; }
.cat:hover { transform: translateY(-2px); color: inherit; border-color: hsl(var(--h) 75% 58%); }
.cat header { display: flex; justify-content: space-between; align-items: baseline; }
.cat h3 { font-size: 1.15rem; }
.count { font-size: .75rem; color: var(--muted); }
.cat ul { margin: 6px 0; display: grid; gap: 6px; }
.cat li { display: flex; flex-direction: column; font-size: .85rem; border-left: 2px solid var(--line); padding-left: 10px; min-width: 0; }
.cat li b { font-size: .78rem; color: var(--muted); font-weight: 600; }
.cat li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go { margin-top: auto; font-size: .85rem; font-weight: 700; color: hsl(var(--h) 80% 62%); }

.ch-card { display: flex; flex-direction: column; gap: 10px; }
.ch-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ch-link { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; }
.ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-logo { --h: 40; flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; color: hsl(var(--h) 90% 88%); background: linear-gradient(135deg, hsl(var(--h) 55% 32%), hsl(var(--h) 60% 22%)); border: 1px solid hsl(var(--h) 50% 40%); }
.chip-logo.sm { width: 28px; height: 28px; font-size: .6rem; border-radius: 8px; }
.chip-logo.lg { width: 64px; height: 64px; font-size: 1.1rem; border-radius: 16px; }
:root[data-theme="light"] .chip-logo { color: hsl(var(--h) 70% 22%); background: hsl(var(--h) 70% 88%); border-color: hsl(var(--h) 50% 70%); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .chip-logo { color: hsl(var(--h) 70% 22%); background: hsl(var(--h) 70% 88%); border-color: hsl(var(--h) 50% 70%); } }
.hd { font-size: .62rem; font-weight: 800; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }

.now { display: grid; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 12px; }
.now strong { font-size: 1rem; line-height: 1.25; }
.now:hover { color: inherit; outline: 1px solid var(--accent); }
.meta { font-size: .8rem; color: var(--muted); }
.next { display: grid; gap: 4px; font-size: .88rem; }
.next li { display: flex; gap: 10px; min-width: 0; }
.next time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); flex: none; }
.next a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag { display: inline-block; justify-self: start; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.tag.on { background: var(--live); border-color: var(--live); color: #fff; }
.tag.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 5px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.bar { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

.fav { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.fav:hover { color: var(--accent); background: var(--surface-2); }
.fav[aria-pressed="true"] { color: var(--accent); }
.fav[aria-pressed="true"] svg { fill: var(--accent); }
.inline-star { vertical-align: -3px; }

.rail { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.poster { flex: 0 0 240px; scroll-snap-align: start; display: grid; gap: 6px; align-content: start; min-height: 130px; }
.poster:hover { color: inherit; border-color: var(--accent); }
.poster strong { line-height: 1.25; }

/* Pílulas / abas */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pills a, .pill { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .88rem; font-weight: 600; color: var(--muted); }
.pill { padding: 2px 10px; font-size: .78rem; background: var(--surface); }
.pills a:hover, .pills a[aria-current] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 20px; }

.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: thin; }
.days a { flex: none; display: grid; text-align: center; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 64px; }
.days small { font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.days a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.days a[aria-current] small { color: inherit; }

/* Grade */
.sched { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row time { flex: none; width: 52px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.row .info { flex: 1; min-width: 0; display: grid; }
.row .info > a { font-weight: 600; }
.row.live { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); scroll-margin-top: 140px; }
.row.live time { color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.btn { display: inline-block; padding: 9px 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; border: 1px solid var(--accent); }
.btn:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn.ghost { background: none; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.more { text-align: center; margin-top: 22px; }

.rate { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 6px; font-weight: 800; font-size: .8rem; color: #fff; background: #2e9e5b; flex: none; }
.rate.r10 { background: #1d86d6; } .rate.r12 { background: #e0a800; color: #1a1203; }
.rate.r14 { background: #e8710a; } .rate.r16 { background: #d62839; } .rate.r18 { background: #1a1a1a; border: 1px solid #555; }

/* Programa */
.prog h1 { max-width: 24ch; }
.orig { font-style: italic; margin-top: 4px; }
.prog-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); align-items: start; }
.prog h2 { margin-bottom: 10px; }
.syn { max-width: 65ch; font-size: 1.05rem; }
.facts { display: grid; gap: 10px; margin: 22px 0; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.facts dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
.facts dd { margin: 0; }
.airings ul { display: grid; }
.airings li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.airings li:last-child { border-bottom: 0; }
.airings li span { color: var(--muted); white-space: nowrap; }
.airings a { font-weight: 600; }

/* A–Z */
.az { margin-bottom: 20px; scroll-margin-top: 140px; }
.az h2 { color: var(--accent); margin-bottom: 8px; }
.az-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.az-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .92rem; }
.az-list a:hover { border-color: var(--accent); }
.az-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
section h2 + .az-list, section > h2 { margin-bottom: 10px; }

.empty { text-align: center; color: var(--muted); padding: 56px 16px; }
.empty h1 { color: var(--text); margin-bottom: 10px; }
.prose { max-width: 70ch; padding-top: 28px; }
.prose h1 { margin-bottom: 16px; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot-in { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-block: 18px; justify-content: space-between; }

@media (max-width: 760px) {
  .prog-grid { grid-template-columns: 1fr; }
  .top-in { gap: 10px; }
  .search { order: 5; flex: 1 1 100%; margin-left: 0; }
  .theme { margin-left: auto; }
  .nav a { padding: 6px 8px; }
  .hero { padding-top: 24px; }
  .row { padding: 10px 12px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* imagens de programas */
.poster-img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; background: var(--card, #0002); }
.prog-img { float: right; width: 160px; max-width: 40%; height: auto; margin: 0 0 12px 16px; border-radius: 10px; }
.no-img { display: none; }

/* /agora: imagem ao lado do programa no ar */
.now.has-img { overflow: hidden; grid-template-columns: 112px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.now.has-img > :not(.now-img) { grid-column: 2; }
.now-img { grid-column: 1; grid-row: 1 / span 4; align-self: start; width: 112px; height: auto; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--line); }
@media (max-width: 380px) { .now.has-img { grid-template-columns: 88px minmax(0, 1fr); } .now-img { width: 88px; } }
