/* Telão: charcoal and amber. The home page is one scene: the guide on a TV, the cat in front of it.
   No JavaScript, no remote assets, no inline styles (CSP style-src 'self'). */
@font-face {
    font-family: "Outfit";
    src: url("../brand/Outfit-Latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --bg: #0d0d0d;
    --surface: #171717;
    --surface-2: #202020;
    --cell: #161616;
    --cell-on: #212121;
    --line: #2e2e2e;
    --line-soft: #242424;
    --text: #f2f2f2;
    --muted: #a3a3a3;
    --faint: #8a8a8a;
    --accent: #f5a524;
    --accent-ink: #1a1203;
    --danger: #f87171;
    --ok: #4ade80;
    --radius: 14px;
    --control: 8px;
    --gutter: 48px;
    --wide: 1248px;
    --display: "Outfit", system-ui, sans-serif;
    --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    color-scheme: dark;
    accent-color: var(--accent);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; scrollbar-color: var(--line) var(--bg); }
::selection { background: var(--accent); color: var(--accent-ink); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 var(--body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sandbox-banner { padding: 12px 20px; background: var(--accent); color: var(--accent-ink); text-align: center; }
.sandbox-banner strong { margin-right: 12px; }
@media (max-width: 600px) {
    .sandbox-banner strong, .sandbox-banner span { display: block; }
    .sandbox-banner strong { margin-right: 0; margin-bottom: 4px; }
}

a { color: var(--accent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.icon-arrow { width: 18px; height: 18px; vertical-align: -.15em; margin-left: 8px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.top {
    display: flex;
    align-items: center;
    gap: 16px 40px;
    width: calc(100% - 2 * var(--gutter));
    max-width: var(--wide);
    margin: 0 auto;
    min-height: 88px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 650; font-size: 2rem; line-height: 1; text-decoration: none; letter-spacing: -.04em; }
.brand img { display: block; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.top .brand { margin-right: auto; }
.top-nav { display: flex; align-items: center; gap: 4px 28px; }
.top-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.top-nav a:hover { color: var(--text); }
.top-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.top-action { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--control); background: var(--surface-2); color: var(--text); font-weight: 600; text-decoration: none; transition: border-color 160ms ease-out, background-color 160ms ease-out; }
.top-action:hover { border-color: var(--accent); text-decoration: none; }
.top-action .icon { color: var(--accent); }

.sub-nav { display: flex; gap: 4px 28px; width: calc(100% - 2 * var(--gutter)); max-width: var(--wide); margin: 0 auto; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.sub-nav a { flex-shrink: 0; padding: 14px 0; color: var(--muted); text-decoration: none; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-nav a:hover { color: var(--text); }
.sub-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Main and footer ---------- */
main { flex: 1; width: 100%; max-width: 944px; margin: 0 auto; padding: 56px 24px 96px; }
main > .muted { max-width: 70ch; margin-bottom: 28px; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 56px 0 64px; }
.foot-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 48px 80px; width: calc(100% - 2 * var(--gutter)); max-width: var(--wide); margin: 0 auto; }
.foot-id p { max-width: 46ch; margin: 0 0 12px; }
.foot-disclaimer { color: var(--text); }
.footer-brand { font-size: 1.6rem; gap: 8px; margin-bottom: 20px; }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-cols h2 { font-family: var(--body); font-size: .85rem; font-weight: 600; color: var(--text); letter-spacing: 0; margin: 0 0 14px; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li + li { margin-top: 10px; }
.foot a:not(.brand) { color: var(--muted); text-decoration: none; }
.foot a:not(.brand):hover { color: var(--text); text-decoration: underline; }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--display); letter-spacing: -.025em; text-wrap: balance; }
h1 { font-size: 2.6rem; font-weight: 600; line-height: 1.12; margin: 0 0 20px; }
h2 { font-size: 1.45rem; font-weight: 550; line-height: 1.25; margin: 0 0 16px; }
h3 { font-weight: 550; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }
.mono { font-family: var(--mono); letter-spacing: .04em; }
.big { font-size: 1.5rem; font-weight: 700; }
.lede { color: var(--muted); font-size: 1.08rem; line-height: 1.6; max-width: 60ch; margin-bottom: 32px; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; }
.card > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.notice { border: 1px solid var(--accent); background: var(--surface); border-radius: var(--control); padding: 12px 16px; margin-bottom: 24px; font-size: .92rem; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin: 22px 0 8px; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: .9rem; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--control);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    caret-color: var(--accent);
    transition: border-color 160ms ease-out;
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
input[type=checkbox] { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    min-height: 48px;
    padding: 12px 22px;
    border: 0;
    border-radius: var(--control);
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
    transition: transform 160ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out;
}
button .icon, .button .icon { width: 18px; height: 18px; }
button:hover, .button:hover { transform: translateY(-2px); text-decoration: none; }
button:active, .button:active { transform: translateY(0); }
button:disabled { opacity: .5; cursor: default; transform: none; }
button.secondary, .button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
button.secondary:hover, .button.secondary:hover { border-color: var(--muted); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.link { display: inline; min-height: 0; background: none; border: 0; padding: 0; margin: 0; color: var(--muted); font-weight: 400; }
button.link:hover { color: var(--text); transform: none; }
button.wide, .button.wide { width: 100%; margin-top: 28px; }

form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.actions .button, .actions button { margin-top: 0; }
.actions:not(.hero-actions) { margin-top: 20px; }

.errors { border: 1px solid var(--danger); color: var(--danger); border-radius: var(--control); padding: 10px 14px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 18px; }
.flash { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--ok); color: var(--ok); border-radius: var(--control); padding: 12px 16px; margin-bottom: 28px; }
.flash .icon { margin-top: 2px; }
.flash span { color: var(--text); }

/* ---------- Data ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .88rem; }
td { font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: var(--line-soft); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; border: 1px solid var(--line); white-space: nowrap; }
.badge.trial { color: var(--accent); border-color: var(--accent); }
.badge.active { color: var(--ok); border-color: var(--ok); }
.badge.expired { color: var(--danger); border-color: var(--danger); }

.secret { background: var(--surface-2); border: 1px dashed var(--accent); border-radius: var(--control); padding: 10px 14px; font-size: 1.3rem; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }

.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); transform: translateY(-160%); border-radius: var(--control); }
.skip-link:focus { transform: translateY(0); }

/* ---------- Task pages ---------- */
main.narrow { max-width: 640px; }
main.prose { max-width: 800px; }
main.prose .card ul { padding-left: 20px; }
main.prose .card li + li { margin-top: 10px; }
.back, .back-link { margin: 0 0 16px; font-size: .9rem; }
.back a, .back-link a { color: var(--muted); text-decoration: none; }
.back a:hover, .back-link a:hover { color: var(--text); }
.lookup-result { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.lookup-result .muted { margin-bottom: 8px; }
.form-switch { margin-bottom: 4px; }
.form-note { margin: 24px 0 0; }
.help-inline { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.help-inline summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.help-inline summary::-webkit-details-marker { display: none; }
.help-inline summary .icon { transition: transform 200ms var(--ease-out); }
.help-inline[open] summary .icon { transform: rotate(90deg); }
.help-inline > div { padding-top: 12px; color: var(--muted); font-size: .95rem; }
.help-inline ul { margin: 0; padding-left: 20px; }
.help-inline li + li { margin-top: 6px; }

/* ---------- TV panel ---------- */
main.panel { max-width: 860px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px 32px; margin-bottom: 36px; }
.panel-head > div { flex: 1 1 420px; min-width: 0; }
.panel-head h1 { margin-bottom: 18px; overflow-wrap: anywhere; }
.panel-head form button { margin-top: 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 0; }
.facts dt { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.facts .badge + .muted { font-size: .85rem; }
.fact-action { font-size: .9rem; font-weight: 600; }
.lists h2 { margin-bottom: 8px; }
.empty { color: var(--muted); max-width: 60ch; }
.empty-steps { list-style: none; counter-reset: es; margin: 20px 0 4px; padding: 0; display: grid; gap: 10px; }
.empty-steps li { counter-increment: es; display: flex; gap: 12px; align-items: baseline; color: var(--muted); }
.empty-steps li::before { content: counter(es); flex-shrink: 0; width: 24px; height: 24px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--text); font-family: var(--display); font-size: .8rem; }
.empty-steps strong { color: var(--text); font-weight: 600; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rows li > div { min-width: 0; }
.rows strong { display: block; font-size: 1.05rem; }
.rows .muted { display: block; overflow-wrap: anywhere; }
.rows a { flex-shrink: 0; font-weight: 600; }
.group-title { margin: 56px 0 16px; font-size: 1.6rem; }
.settings { padding: 0; }
.settings > section { padding: 28px; border-top: 1px solid var(--line); }
.settings > section:first-child { border-top: 0; }
.settings h3 { margin: 0 0 8px; font-size: 1.2rem; letter-spacing: -.02em; }
.settings h3 + form label:first-child { margin-top: 14px; }
.settings p.small { max-width: 62ch; }
.panel-help { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; color: var(--muted); font-size: .92rem; }
.panel-help a { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px 32px; margin: 0; }
.stats > div { border-top: 1px solid var(--line); padding-top: 14px; }
.stats dt { color: var(--muted); font-size: .88rem; }
.stats dd { margin: 4px 0 0; font-family: var(--display); font-size: 1.9rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.stats dd .muted { display: block; font-family: var(--body); font-size: .85rem; font-weight: 400; }
.admin-search { display: flex; gap: 12px; align-items: flex-end; }
.admin-search > div { flex: 1; }
.admin-search label { margin-top: 0; }
.admin-search button { margin-top: 0; }
.admin-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--line); }
.admin-links li { border-bottom: 1px solid var(--line); }
.admin-links a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 4px; color: var(--text); text-decoration: none; }
.admin-links a:hover { color: var(--accent); }
.diag-card h3 { margin: 28px 0 12px; font-size: 1.15rem; }
.diag-filter { justify-content: flex-start; gap: 6px 18px; margin-bottom: 12px; }
.diag-table td { min-width: 7em; }
.diag-table .mono { letter-spacing: 0; overflow-wrap: anywhere; }
.diag-table summary { cursor: pointer; color: var(--accent); margin-top: 6px; }
.diag-table ol { margin: 4px 0 8px; padding-left: 20px; }

/* =====================================================================
   Home: one scene. The guide is the TV's screen; the cat watches with you.
   Focal motion: the TV turns on and its light reaches the room and the cat.
   ===================================================================== */
main.landing { max-width: var(--wide); width: calc(100% - 2 * var(--gutter)); padding: 0; }

.stage { padding: 44px 0 0; }
.stage-copy { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; gap: 20px 64px; }
.stage-copy h1 { font-size: clamp(3rem, 5.6vw, 5rem); font-weight: 550; line-height: 1.02; letter-spacing: -.04em; margin: 0; }
.stage-copy h1 span { color: var(--accent); }
.stage-copy p { color: var(--muted); font-size: 1.12rem; line-height: 1.6; max-width: 40ch; margin: 0 0 8px; }

.stage-set { --cat: clamp(250px, 25vw, 350px); position: relative; margin-top: 36px; padding: 0 calc(var(--cat) * .86) 34px 0; isolation: isolate; }
/* The TV's backlight on the wall, the same amber as the room in the photo below. */
.stage-set::before { content: ""; position: absolute; z-index: -1; inset: -24% 4% -6% -8%; border-radius: 50%; background: radial-gradient(closest-side, rgba(245, 165, 36, .5), rgba(245, 165, 36, .16) 60%, rgba(245, 165, 36, 0)); filter: blur(40px); animation: backlight 900ms var(--ease-out) 600ms both; }
/* Floor: the soft contact shadow the TV stand and the cat sit on. */
.stage-set::after { content: ""; position: absolute; z-index: -1; left: 4%; right: 0; bottom: -6px; height: 44px; border-radius: 50%; background: radial-gradient(closest-side, rgba(245, 165, 36, .16), rgba(245, 165, 36, 0)); animation: backlight 900ms var(--ease-out) 600ms both; }

.tv-set { position: relative; padding: 10px; border: 1px solid #262626; border-radius: 18px; background: #050505; }
.tv-set::after { content: ""; position: absolute; left: 50%; bottom: -24px; width: 22%; height: 24px; transform: translateX(-50%); border-radius: 0 0 10px 10px; background: linear-gradient(#181818, #101010); }
.tv-glass { position: relative; border-radius: 8px; overflow: hidden; background: #070707; }
/* Power-on: a line of light opens into the picture. */
.tv-glass::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: #fff3dc; box-shadow: 0 0 22px 4px rgba(255, 215, 150, .65); pointer-events: none; opacity: 0; animation: tv-line 620ms var(--ease-out) 120ms both; }

.guide { --ch: 196px; position: relative; background: var(--cell); animation: tv-on 560ms var(--ease-out) 380ms both; }
.g-times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-left: var(--ch); background: var(--surface); color: var(--faint); font-size: .8rem; font-variant-numeric: tabular-nums; }
.g-times span { padding: 9px 16px; border-left: 1px solid var(--line); }
.g-times span:nth-child(2) { color: var(--accent); font-weight: 600; }
.g-row { display: grid; grid-template-columns: var(--ch) minmax(0, 1fr); border-top: 1px solid var(--line); min-height: 62px; animation: row-in 420ms var(--ease-out) both; }
.g-row:nth-of-type(2) { animation-delay: 700ms; } .g-row:nth-of-type(3) { animation-delay: 760ms; }
.g-row:nth-of-type(4) { animation-delay: 820ms; } .g-row:nth-of-type(5) { animation-delay: 880ms; }
.g-ch { display: flex; flex-direction: column; justify-content: center; margin: 0; padding: 10px 20px; background: var(--surface); }
.g-ch strong { font-family: var(--display); font-size: 1.12rem; font-weight: 550; letter-spacing: -.02em; line-height: 1.2; }
.g-ch span { color: var(--faint); font-size: .8rem; }
.g-cells { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.g-cell { grid-row: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 10px 18px; border-left: 1px solid var(--line); background: var(--cell); color: var(--text); text-decoration: none; transition: background-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.g-cell strong { font-weight: 600; font-size: .96rem; line-height: 1.3; }
.g-cell span { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.g-cell.on { background: var(--cell-on); }
.g-cell.done strong { color: var(--muted); }
a.g-cell:hover { background: #262626; text-decoration: none; }
/* TV focus: the remote's highlight, drawn inside the cell so the grid never shifts. */
a.g-cell:focus-visible { outline: 0; border-radius: 0; background: #2a2a2a; box-shadow: inset 0 0 0 2px var(--accent); }
.c1-4 { grid-column: 1 / 4; } .c1-13 { grid-column: 1 / 13; } .c4-9 { grid-column: 4 / 9; } .c4-10 { grid-column: 4 / 10; }
.c4-13 { grid-column: 4 / 13; } .c9-13 { grid-column: 9 / 13; } .c10-13 { grid-column: 10 / 13; }

.g-row-now { min-height: 124px; }
.g-cell.now { background: var(--accent); color: var(--accent-ink); padding: 14px 20px 12px 22px; gap: 8px; }
.g-cell.now label { margin: 0; font-family: var(--display); font-size: 1.12rem; font-weight: 600; letter-spacing: -.02em; }
.now-field { display: flex; gap: 8px; }
.now-field input { flex: 1; min-width: 0; min-height: 46px; border: 0; background: var(--accent-ink); color: var(--text); font-size: 1.15rem; letter-spacing: .14em; text-transform: uppercase; }
.now-field input::placeholder { color: #a8916a; letter-spacing: .14em; }
.now-field input:hover { border: 0; }
.now-field input:focus { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.now-field button { margin: 0; min-height: 46px; padding: 10px 16px; background: var(--accent-ink); color: var(--accent); white-space: nowrap; }
.now-field button:focus-visible { outline-color: var(--accent-ink); }
.g-cell.now a { color: var(--accent-ink); font-size: .84rem; font-weight: 600; align-self: flex-start; }
.g-cell.now a:focus-visible { outline-color: var(--accent-ink); }

.g-now-line { position: absolute; z-index: 1; top: 0; bottom: 0; left: calc(var(--ch) + (100% - var(--ch)) * 3 / 12); width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; transform-origin: top; animation: now-line 700ms var(--ease-out) 900ms both; }

.stage-cat { --rim: -5px 0 14px rgba(245, 165, 36, .22); position: absolute; z-index: 2; right: 0; bottom: 6px; width: var(--cat); height: auto; transform-origin: 50% 100%; filter: drop-shadow(var(--rim)); animation: cat-lit 900ms var(--ease-out) 950ms both; transition: rotate 320ms var(--ease-out); }
.stage-cat:hover { rotate: -3deg; }
.stage-note { margin: 22px 0 0; color: var(--muted); font-size: .88rem; }

@keyframes tv-line { 0% { opacity: 0; transform: scaleX(0); } 35% { opacity: 1; transform: scaleX(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: scaleX(1) scaleY(30); } }
@keyframes tv-on { from { clip-path: inset(50% 0 50% 0); filter: brightness(2.4) saturate(.4); } to { clip-path: inset(0); filter: none; } }
@keyframes row-in { from { opacity: 0; transform: translateX(-10px); } }
@keyframes now-line { from { transform: scaleY(0); box-shadow: 0 0 18px 3px rgba(245, 165, 36, .6); } 70% { transform: none; } to { box-shadow: 0 0 0 0 rgba(245, 165, 36, 0); } }
@keyframes backlight { from { opacity: 0; } }
/* The cat sits in the dark until the screen's light reaches it. */
@keyframes cat-lit { from { filter: brightness(.12) saturate(.4) drop-shadow(0 0 0 rgba(245, 165, 36, 0)); translate: 0 10px; } 55% { filter: brightness(1.06) saturate(1) drop-shadow(-8px 0 22px rgba(245, 165, 36, .5)); } to { filter: brightness(1) saturate(1) drop-shadow(var(--rim)); translate: 0 0; } }

/* The room: one photograph carries the features. */
.cinema { position: relative; margin-top: 144px; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cinema > img { display: block; width: 100%; height: auto; }
.cinema::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 9, 8, .92) 0%, rgba(10, 9, 8, .7) 34%, rgba(10, 9, 8, 0) 58%); pointer-events: none; }
.cinema-copy { position: absolute; top: 0; bottom: 0; left: 0; width: 42%; display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; }
.cinema h2 { font-size: clamp(2rem, 3.2vw, 2.8rem); letter-spacing: -.035em; line-height: 1.08; margin: 0 0 24px; }
.cinema ul { list-style: none; margin: 0 0 24px; padding: 0; }
.cinema li { padding: 11px 0; border-top: 1px solid rgba(242, 242, 242, .12); color: #c9c4bd; font-size: .95rem; line-height: 1.5; }
.cinema li:first-child { border-top: 0; padding-top: 0; }
.cinema li strong { display: block; color: var(--text); font-weight: 600; }
.text-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.text-cta .icon { width: 18px; height: 18px; transition: transform 200ms var(--ease-out); }
.text-cta:hover .icon { transform: translateX(3px); }

/* Price: one sentence. */
.price-line { padding: 128px 0 0; text-align: center; }
.price-line h2 { font-size: clamp(1.9rem, 3.6vw, 3.2rem); line-height: 1.12; letter-spacing: -.035em; max-width: 22ch; margin: 0 auto 16px; }
.price-line h2 span { white-space: nowrap; }
.price-line p { color: var(--muted); max-width: 52ch; margin: 0 auto 28px; }
.price-line .button { margin: 0; }

/* Help: the cat peeks over the footer line. */
.peek { display: grid; grid-template-columns: minmax(0, 1fr) var(--peek, 220px); gap: 48px; align-items: end; margin-top: 128px; padding-top: 48px; border-top: 1px solid var(--line); }
.peek-copy { padding-bottom: 56px; max-width: 640px; }
.peek h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); letter-spacing: -.035em; margin: 0 0 20px; }
.peek .question-links { margin: 0; }
.peek-cat { display: block; width: 100%; height: auto; transform-origin: 50% 100%; transition: rotate 320ms var(--ease-out); }
.peek:hover .peek-cat { rotate: -3deg; }
.peek + * { margin-top: 0; }

@media (max-width: 1100px) {
    .guide { --ch: 150px; }
    .cinema-copy { width: 52%; padding: 36px 40px; }
}
@media (max-width: 900px) {
    .stage { padding-top: 32px; }
    .stage-copy { grid-template-columns: minmax(0, 1fr); }
    /* On the phone the cat sits on top of the TV. */
    .stage-set { --cat: 190px; margin-top: 8px; padding: calc(var(--cat) * 1.262 - 22px) 0 30px; }
    .stage-cat { --rim: 0 6px 14px rgba(245, 165, 36, .22); right: auto; left: 50%; top: 0; bottom: auto; margin-left: calc(var(--cat) / -2); }
    .stage-set::before { inset: 20% 0 10% 0; }
    .stage-set::after { left: 18%; right: 18%; }
    .tv-set { padding: 8px; border-radius: 16px; }
    /* The guide becomes the TV's channel list: rows stack, programmes scroll sideways. */
    .g-times, .g-now-line { display: none; }
    .g-row { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .g-ch { flex-direction: row; justify-content: flex-start; align-items: baseline; gap: 10px; padding: 10px 14px; }
    .g-cells { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .g-cells::-webkit-scrollbar { display: none; }
    .g-cell { flex: 0 0 58%; scroll-snap-align: start; border-left: 0; border-right: 1px solid var(--line); padding: 12px 14px; min-height: 56px; }
    .g-cell:last-child { border-right: 0; }
    .g-row-now .g-ch strong { color: var(--accent); }
    .g-row-now .g-cells, .g-row-stack .g-cells { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; }
    .g-row-now .g-cell, .g-row-stack .g-cell { grid-row: auto; grid-column: auto; border-right: 0; border-top: 1px solid var(--line); }
    .g-row-stack .g-cell:first-child { border-top: 0; }
    .g-row-now .g-cell.now { order: -1; border-top: 0; }
    .price-line { padding-top: 88px; }
    .cinema { margin-top: 88px; background: transparent; border-radius: 0; overflow: visible; }
    .cinema > img { border-radius: var(--radius); }
    .cinema::before { display: none; }
    .cinema-copy { position: static; width: auto; padding: 28px 0 0; }
    .peek { --peek: 150px; gap: 16px; margin-top: 88px; padding-top: 36px; }
    .peek-copy { padding-bottom: 40px; }
}
@media (max-width: 600px) {
    .stage-copy h1 { font-size: 2.75rem; }
    .stage-copy p { font-size: 1rem; }
    .now-field { flex-direction: column; }
    .now-field button { width: 100%; }
    .g-cell { flex-basis: 66%; }
    .peek { grid-template-columns: minmax(0, 1fr); }
    .peek-cat { width: 140px; margin: -24px 0 0 auto; }
}
@media (max-width: 380px) {
    .stage-copy h1 { font-size: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) {
    /* No travel, no flash: the picture and the cat simply fade up together. */
    .guide, .stage-cat, .stage-set::before { animation: fade-up 400ms ease-out both !important; }
    .stage-cat:hover { rotate: none; }
    .peek:hover .peek-cat { rotate: none; }
}
@keyframes fade-up { from { opacity: 0; } }

.facts-list { list-style: none; margin: 0; padding: 0; }
.facts-list li { padding: 14px 0 14px 24px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.55; position: relative; }
.facts-list li:first-child { border-top: 0; padding-top: 0; }
.facts-list li::before { content: ""; position: absolute; left: 2px; top: 1.45em; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.facts-list li:first-child::before { top: .55em; }
.facts-list strong { color: var(--text); font-weight: 600; }

/* The TV, drawn as geometry: one bezel, a 16:9 screen, the app's own UI scaled with the frame. */
.tv-frame { margin: 0; container-type: inline-size; display: flex; flex-direction: column; }
.tv-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 10px solid #1d1d1d; border-bottom-width: 14px; border-radius: 12px; background: #060606; color: var(--text); }
.tv-frame::after { content: ""; order: 1; align-self: center; width: 26%; height: 10px; border-radius: 0 0 8px 8px; background: #1d1d1d; }
.tv-frame figcaption { order: 2; margin-top: 14px; color: var(--faint); font-size: .82rem; text-align: center; }
.tv-screen p { margin: 0; }

.pairing-screen { padding: 4.5cqw 5cqw; display: flex; flex-direction: column; }
.ts-title { font-family: var(--display); font-size: 4.8cqw; font-weight: 600; letter-spacing: -.02em; }
.ts-sub { color: var(--muted); font-size: 2.3cqw; margin-top: .6cqw !important; }
.ts-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4cqw; margin-top: 3cqw; flex: 1; }
.ts-col { border-top: .25cqw solid #2a2a2a; padding-top: 2cqw; }
.ts-label { font-size: 2.2cqw; color: var(--accent); font-weight: 600; margin-bottom: 1.8cqw !important; }
.ts-qr-row { display: flex; gap: 2.6cqw; align-items: center; }
.ts-qr-row img { width: 16cqw; height: 16cqw; border-radius: .8cqw; }
.ts-small { color: var(--muted); font-size: 2cqw; }
.ts-code { font-family: var(--mono); font-size: 5.4cqw; letter-spacing: .12em; margin: .6cqw 0 !important; }
.ts-ids { margin: 0; display: grid; gap: 1.8cqw; }
.ts-ids dt { color: var(--muted); font-size: 2cqw; }
.ts-ids dd { margin: 0; font-family: var(--mono); font-size: 3.1cqw; letter-spacing: .06em; }
.ts-keys { margin-top: 2cqw !important; display: flex; align-items: center; flex-wrap: wrap; gap: 1cqw; color: var(--muted); font-size: 1.9cqw; }
.ts-keys span { width: 1.6cqw; height: 1.6cqw; border-radius: 50%; margin-left: 1.4cqw; }
.ts-keys span:first-child { margin-left: 0; }
.k-red { background: #e5484d; } .k-green { background: #30a46c; } .k-yellow { background: #f5d90a; }

.question-links { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); }
.question-links li { border-bottom: 1px solid var(--line); }
.question-links a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 2px; color: var(--text); text-decoration: none; font-size: 1.05rem; transition: color 160ms ease-out; }
.question-links a:hover { color: var(--accent); }
.question-links .icon { color: var(--faint); transition: transform 200ms var(--ease-out), color 160ms ease-out; }
.question-links a:hover .icon { color: var(--accent); transform: translateX(3px); }

/* =====================================================================
   Read pages: O app, Compatibilidade, Ajuda
   ===================================================================== */
main.read { max-width: var(--wide); width: calc(100% - 2 * var(--gutter)); padding: 0 0 40px; }
.read-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.read-head h1 { font-size: clamp(2.6rem, 4.6vw, 4.2rem); font-weight: 550; line-height: 1.04; letter-spacing: -.04em; margin: 0; }
.read-head p { color: var(--muted); font-size: 1.08rem; line-height: 1.65; margin: 0; max-width: 50ch; }
.read-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 40px; padding-top: 48px; }
.toc { position: sticky; top: 24px; align-self: start; }
.toc p { color: var(--faint); font-size: .82rem; margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .93rem; }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.read-section { padding-bottom: 64px; }
.read-section + .read-section { padding-top: 48px; border-top: 1px solid var(--line); }
.read-section > h2 { display: flex; align-items: center; gap: 14px; font-size: clamp(1.7rem, 2.6vw, 2.2rem); letter-spacing: -.03em; margin-bottom: 12px; }
.read-section > h2 .icon { width: 26px; height: 26px; color: var(--muted); }
.read-section > .lede { margin-bottom: 28px; }
.feature-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.feature-table > div { padding: 18px 0; border-top: 1px solid var(--line); }
.feature-table h3 { margin: 0 0 6px; font-size: 1.1rem; }
.feature-table p { color: var(--muted); line-height: 1.6; margin: 0; }
.only-tag { display: inline-block; margin-left: 8px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--faint); font-family: var(--body); font-size: .75rem; font-weight: 500; letter-spacing: 0; vertical-align: .15em; }

.compat-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.compat-table table { font-size: .97rem; }
.compat-table th, .compat-table td { padding: 16px 20px; }
.compat-table thead th { background: var(--surface); }
.compat-table tbody th { color: var(--text); font-family: var(--display); font-size: 1.1rem; font-weight: 550; }
.compat-table tr:last-child th, .compat-table tr:last-child td { border-bottom: 0; }
.compat-table td .muted { display: block; font-size: .88rem; }

.keys { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.keys li { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .92rem; }
.keys kbd { font: 600 .85rem var(--mono); color: var(--text); }
.key-dot { width: 12px; height: 12px; border-radius: 50%; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 2px; cursor: pointer; list-style: none; font-family: var(--display); font-size: 1.18rem; font-weight: 550; letter-spacing: -.015em; transition: color 160ms ease-out; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary .icon { color: var(--faint); transition: transform 240ms var(--ease-out); }
.faq details[open] summary .icon { transform: rotate(90deg); color: var(--accent); }
.faq .answer { padding: 0 2px 24px; color: var(--muted); line-height: 1.65; max-width: 68ch; }
.faq .answer p { margin-bottom: 12px; }
.faq .answer ul, .faq .answer ol { margin: 0 0 12px; padding-left: 20px; }
.faq .answer li + li { margin-top: 6px; }
.faq .answer strong { color: var(--text); font-weight: 600; }
.faq details:has(.answer:target) summary { color: var(--accent); }
.contact-band { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 40px; padding: 32px 36px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.contact-band h2 { margin: 0 0 6px; font-size: 1.5rem; }
.contact-band p { color: var(--muted); margin: 0; max-width: 60ch; }
.contact-band .button { margin: 0; }

/* =====================================================================
   Device access (/tv, /parear, /ativar)
   ===================================================================== */
main.tv-access { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; max-width: 1140px; gap: 80px; padding-top: 64px; }
.tv-access-intro h1 { font-size: clamp(2.6rem, 4.4vw, 3.6rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 550; }
.tv-access-intro > p { color: var(--muted); line-height: 1.7; max-width: 44ch; }
.tv-access-intro strong { color: var(--text); font-weight: 600; }
.tv-access-intro .tv-frame { margin-top: 32px; max-width: 520px; }
.access-form { padding: 36px; }
.access-form h2 { font-size: 1.6rem; margin-bottom: 8px; }
.access-form .errors { margin-top: 20px; }
.access-form button { width: 100%; margin-top: 28px; }
.access-form input { font-size: 1.05rem; }
.access-form input.big { font-size: 1.6rem; letter-spacing: .18em; text-transform: uppercase; min-height: 60px; }
.access-alternative { font-size: .9rem; padding-top: 24px; margin-top: 28px; border-top: 1px solid var(--line); }
.access-form > .small:last-child { font-size: .85rem; }

.plan { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 28px; align-items: center; }
.plan-price { font-family: var(--display); font-size: 3.4rem; font-weight: 550; line-height: 1; letter-spacing: -.04em; }
.plan-price small { display: block; margin-top: 6px; color: var(--muted); font-family: var(--body); font-size: .9rem; font-weight: 400; letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { display: flex; gap: 10px; padding: 5px 0; color: var(--muted); }
.plan li .icon { color: var(--ok); width: 18px; height: 18px; margin-top: 3px; }
.how-steps { list-style: none; counter-reset: hs; margin: 8px 0 0; padding: 0; }
.how-steps li { counter-increment: hs; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); line-height: 1.55; color: var(--muted); }
.how-steps li:first-child { border-top: 0; }
.how-steps li::before { content: counter(hs); width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--text); font-family: var(--display); font-size: .85rem; }
.how-steps strong { color: var(--text); font-weight: 600; }

/* ---------- Payment ---------- */
.payment-facts { margin-bottom: 24px; }
.payment-state { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px; }
.payment-state h3 { margin: 0 0 12px; }
.payment-expiry { margin-top: 16px; }
.payment-reference { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.payment-detail { margin: 0; }
.payment-detail > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.payment-detail > div:last-child { border-bottom: 0; }
.payment-detail dt { color: var(--muted); }
.payment-detail dd { margin: 0; min-width: 0; }
.payment-filter { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 24px; }
.payment-filter > div { flex: 1; }
.payment-filter label { margin-top: 0; }
.payment-filter button { margin-top: 0; }
.payments-table caption { text-align: left; padding-bottom: 16px; }
.payment-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.payment-attention { display: block; }

/* ---------- Errors ---------- */
.error-page { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 40px; align-items: center; }
.error-page img { width: 100%; height: auto; }
.error-links { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--line); }
.error-links li { border-bottom: 1px solid var(--line); }
.error-links a { display: flex; justify-content: space-between; padding: 14px 2px; text-decoration: none; color: var(--text); }
.error-links a:hover { color: var(--accent); }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1100px) {
    :root { --gutter: 32px; }
    .top-nav { gap: 4px 20px; }
    .read-layout { grid-template-columns: minmax(0, 1fr); }
    .toc { position: static; }
    .toc ul { display: flex; flex-wrap: wrap; gap: 8px; border: 0; }
    .toc a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; margin: 0; }
    .toc a:hover { border-color: var(--accent); }
    main.tv-access { gap: 48px; }
}

@media (max-width: 900px) {
    .top { flex-wrap: wrap; }
    .top-nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; gap: 4px 22px; margin-bottom: -10px; }
    .top-nav a { flex-shrink: 0; }


    .feature-table { grid-template-columns: minmax(0, 1fr); }
    .feature-table > div:nth-child(2) { border-top: 1px solid var(--line); padding-top: 24px; }
    .read-head { grid-template-columns: minmax(0, 1fr); padding: 40px 0 28px; }
    .foot-inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    main.tv-access { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px 20px 64px; max-width: 600px; }
    .tv-access-intro .tv-frame { display: none; }
    .error-page { grid-template-columns: minmax(0, 1fr); }
    .error-page img { width: 140px; order: -1; }
}

@media (max-width: 600px) {
    :root { --gutter: 20px; }
    .nav-long { display: none; }
    .top { min-height: 0; padding: 14px 0 0; gap: 12px; }
    .brand { font-size: 1.7rem; gap: 8px; }
    .brand img { width: 32px; height: 32px; }
    .top-action { min-height: 40px; padding: 6px 12px; font-size: .92rem; }
    .top-nav { gap: 4px 18px; font-size: .9rem; }
    .top-nav a { padding: 10px 0; }
    main { padding: 36px 20px 64px; }
    .card { padding: 22px; }
    .settings > section { padding: 22px; }
    .panel-head { margin-bottom: 28px; }
    .group-title { margin-top: 44px; }
    h1 { font-size: 2.1rem; }
    .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contact-band { padding: 24px; }
    .access-form { padding: 24px; }
    .plan { grid-template-columns: minmax(0, 1fr); }
    .compat-table th, .compat-table td { padding: 12px 14px; }
    .admin-search { flex-direction: column; align-items: stretch; }
    .payment-detail > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .payment-filter { flex-wrap: wrap; }
    .payment-filter > div { min-width: 200px; }
    .payments-table table, .payments-table tbody { display: block; }
    .payments-table caption { display: block; }
    .payments-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .payments-table tr { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); }
    .payments-table td { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 6px 0; border: 0; }
    .payments-table td::before { content: attr(data-label); color: var(--muted); }
}

@media (max-width: 380px) {
    .top-action span, .top-action { font-size: .88rem; }
    .foot-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
main.admin { max-width: 1100px; }
.admin-links a > span { display: block; }
.admin-links a > span > span { display: block; color: var(--muted); font-size: .88rem; }
.compat-table + p { margin-top: 14px; }
.notice + .button.wide { margin-top: 0; }
