/* Modo TV · Sellin e Sellout (Demo Retail Co.)
   Tela escura e cheia, sem rolagem: cabeçalho com relógio, painéis grandes que giram sozinhos e uma fita embaixo.
   Medidas em vw/vh/clamp para caber de 1366x768 a 1920x1080 (e maiores). */
:root {
  --c: #74b9ec;
  --bg: #090a0c;
  --in: #8fb3cf;
  --out: #ff7a4f;
  --pos: #5fd3a2;
  --neg: #ff8a78;
  --warn: #f2c14e;
  --tint: 5%;
  --dur: 15s;
  font-family: Geist, ui-sans-serif, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
p, h2, h3 { margin: 0; }
html.tv-html, body.tv { height: 100%; margin: 0; overflow: hidden; }
body.tv { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 1.2vh; padding: 1.2vw 1.3vw .6vw; background: var(--bg); color: #fff;
  -webkit-font-smoothing: antialiased; }
body.tv.no-cursor, body.tv.no-cursor * { cursor: none !important; }
.tv-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(50vw 45vh at 6% -8%, #74b9ec26, transparent 70%), radial-gradient(45vw 40vh at 96% 0%, #ff7a4f1f, transparent 70%);
  animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateY(-2vh) scale(1); } to { transform: translateY(3vh) scale(1.1); } }
.tv-head, .tv-stage, .tv-ticker, .tv-note { position: relative; z-index: 1; }

.tv-box { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding: clamp(12px, 1vw, 22px);
  border-radius: clamp(14px, 1.2vw, 24px); border: 1px solid color-mix(in srgb, var(--c) 16%, rgb(255 255 255 / .05));
  background: color-mix(in srgb, var(--c) var(--tint), rgb(255 255 255 / .03)); }
.tv-box.hero { border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, rgb(255 255 255 / .04));
  box-shadow: 0 0 44px -18px var(--c); }
.tv-label { margin-bottom: 1vh; font-size: clamp(11px, .8vw, 16px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgb(255 255 255 / .5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-kicker { font-size: clamp(11px, .75vw, 15px); font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: rgb(255 255 255 / .45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-kicker .hl { color: var(--c); }
.tv-kicker em { font-style: normal; }

/* cabeçalho */
.tv-head { display: flex; align-items: center; gap: 16px; padding-bottom: 1vh; }
.tv-badge { flex: none; display: grid; place-items: center; width: clamp(40px, 3.2vw, 64px); height: clamp(40px, 3.2vw, 64px); border-radius: clamp(12px, .9vw, 18px);
  color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.tv-badge svg, .tv-btn svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tv-badge svg { width: 46%; height: 46%; }
.tv-head-txt { flex: 1; min-width: 0; }
.tv-title { font-size: clamp(20px, 1.9vw, 40px); font-weight: 700; line-height: 1.15; letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { display: inline-block; width: clamp(6px, .45vw, 9px); height: clamp(6px, .45vw, 9px); margin-right: .5em; border-radius: 50%; background: var(--pos);
  vertical-align: .1em; animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { box-shadow: 0 0 0 0 #5fd3a299; } to { box-shadow: 0 0 0 1vh #5fd3a200; } }
.tv-dots { display: flex; gap: 8px; }
.tv-dots button { height: clamp(26px, 2vw, 38px); padding: 0 clamp(10px, .8vw, 16px); border: 0; border-radius: 999px; background: rgb(255 255 255 / .06);
  color: rgb(255 255 255 / .45); font: 600 clamp(11px, .72vw, 14px) Geist, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.tv-dots button.on { background: color-mix(in srgb, var(--c) 22%, transparent); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent); }
.tv-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.tv-btn { display: inline-flex; padding: 6px; border: 0; border-radius: 8px; background: none; color: rgb(255 255 255 / .4); cursor: pointer; }
.tv-btn:hover { background: rgb(255 255 255 / .1); color: #fff; }
.tv-btn svg { width: 20px; height: 20px; }
.tv-clock { margin-left: 8px; font-size: clamp(24px, 2.6vw, 54px); font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tv-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .06); overflow: hidden; }
.tv-progress i { display: block; height: 100%; width: 0; background: var(--c); }
.tv-progress i.run { animation: progress var(--dur) linear forwards; }
body.paused .tv-progress i.run { animation-play-state: paused; }
@keyframes progress { to { width: 100%; } }

/* palco com os painéis */
.tv-stage { position: relative; min-height: 0; }
.tv-panel { position: absolute; inset: 0; display: grid; gap: 1.2vh; min-height: 0; opacity: 0; visibility: hidden; transform: translateY(1.5vh);
  transition: opacity .6s ease, transform .6s ease, visibility 0s .6s; }
.tv-panel.on { opacity: 1; visibility: visible; transform: none; transition: opacity .6s ease, transform .6s ease; }
.p-resumo { grid-template-rows: auto minmax(0, 1fr); }
.p-canais { grid-template-rows: auto minmax(0, 1fr); }
.p-vitrine { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.p-curva { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.row4 { display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr)); gap: clamp(8px, .7vw, 16px); }
.row4.even { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(8px, .7vw, 16px); min-height: 0; }
.split.half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.big { font-size: min(2.8vw, 5vh); font-weight: 800; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero .big { font-size: min(3.6vw, 6.2vh); }
.big small { margin-left: .2em; font-size: .42em; font-weight: 600; letter-spacing: 0; color: rgb(255 255 255 / .5); }
.sub { margin-top: .9vh; font-size: clamp(11px, .85vw, 17px); color: rgb(255 255 255 / .55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub b { color: rgb(255 255 255 / .88); font-weight: 600; font-variant-numeric: tabular-nums; }
.sub .up { color: var(--pos); } .sub .down { color: var(--neg); }
.bar { height: clamp(7px, .9vh, 14px); margin-top: 1.1vh; border-radius: 999px; background: rgb(255 255 255 / .09); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); border-radius: 999px; background: var(--c); animation: fill 1.6s cubic-bezier(.2,.7,.2,1); }
@keyframes fill { from { width: 0; } }
.swap { position: relative; height: 1.45em; }
.swap > span { position: absolute; inset: 0; opacity: 0; transform: translateY(.8vh); transition: opacity .6s, transform .6s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swap > span.on { opacity: 1; transform: none; }
.row4 .tv-box, .ch .tv-box { position: relative; }
.row4 .tv-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .07) 50%, transparent 65%); animation: shine 9s ease-in-out infinite; }
.row4 .tv-box:nth-child(2)::after { animation-delay: .3s; } .row4 .tv-box:nth-child(3)::after { animation-delay: .6s; } .row4 .tv-box:nth-child(4)::after { animation-delay: .9s; }
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

.chart-box { position: relative; flex: 1; min-height: 0; }
.chart-off { display: grid; place-items: center; height: 100%; color: rgb(255 255 255 / .45); font-size: clamp(12px, .9vw, 17px); }
.tv-legend { display: flex; flex-wrap: wrap; gap: .4vh 1.2vw; margin-bottom: 1vh; font-size: clamp(11px, .8vw, 16px); color: rgb(255 255 255 / .6); }
.tv-legend i { display: inline-block; width: .8em; height: .8em; margin-right: .45em; border-radius: 3px; vertical-align: -.05em; }
.tv-legend i.ln { height: .22em; vertical-align: .2em; }

/* listas com barras */
.rows { display: grid; align-content: space-evenly; flex: 1; min-height: 0; gap: .6vh; }
.rowx { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: .8vw; align-items: center; font-size: clamp(12px, .95vw, 19px); }
.rowx > span:first-child { display: flex; align-items: center; gap: .5em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgb(255 255 255 / .8); }
.rowx .dotc { flex: none; width: .65em; height: .65em; border-radius: 50%; background: var(--dc); }
.rowx .trk { height: clamp(8px, 1.1vh, 16px); border-radius: 999px; background: rgb(255 255 255 / .08); overflow: hidden; }
.rowx .trk i { display: block; height: 100%; width: var(--w); border-radius: 999px; background: var(--dc, var(--c)); animation: fill 1.4s .2s cubic-bezier(.2,.7,.2,1) backwards; }
.rowx b { min-width: 4.2em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank { display: inline-grid; place-items: center; flex: none; width: 1.7em; height: 1.7em; border-radius: 50%; background: rgb(255 255 255 / .1); font-size: .8em; font-weight: 700; }
.rank.m1 { background: #d9a520; } .rank.m2 { background: #9ea6af; } .rank.m3 { background: #b9773a; }
.rowx small { margin-left: .4em; font-size: .78em; color: rgb(255 255 255 / .4); }

/* canais */
.ch .big { color: #fff; }
.ch .name { display: flex; align-items: center; gap: .6em; margin-bottom: 1vh; font-size: clamp(13px, 1vw, 20px); font-weight: 700; }
.ch .name i { width: .7em; height: .7em; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }

/* vitrine */
.vt { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .9vh; min-height: 0; }
.vt-head { display: flex; align-items: center; gap: .6vw; min-width: 0; }
.vt-head i { flex: none; width: clamp(8px, .6vw, 12px); height: clamp(8px, .6vw, 12px); border-radius: 50%; background: var(--vc); box-shadow: 0 0 14px var(--vc); }
.vt-head h3 { font-size: clamp(12px, .95vw, 19px); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgb(255 255 255 / .82); white-space: nowrap; }
.vt-head span { font-size: clamp(11px, .8vw, 15px); color: rgb(255 255 255 / .45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vt-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(6px, .55vw, 12px); min-height: 0; }
.vt-card { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; overflow: hidden; border-radius: clamp(10px, .8vw, 16px);
  background: rgb(255 255 255 / .05); box-shadow: inset 0 0 0 1px transparent; transition: transform .6s, box-shadow .6s;
  animation: card .7s cubic-bezier(.2,.7,.2,1) backwards; animation-delay: calc(var(--i) * 90ms); }
@keyframes card { from { opacity: 0; transform: translateY(2vh) scale(.96); } }
.vt-card.focus { transform: translateY(-.5vh); box-shadow: inset 0 0 0 2px var(--vc), 0 1.2vh 3vh -1vh color-mix(in srgb, var(--vc) 55%, transparent); }
.vt-art { position: relative; min-height: 0; overflow: hidden; }
.vt-art svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 1s; }
.vt-card.focus .vt-art svg { transform: scale(1.08); }
.vt-pos { position: absolute; left: .4vw; top: .4vw; z-index: 1; display: grid; place-items: center; min-width: clamp(20px, 1.5vw, 30px); height: clamp(20px, 1.5vw, 30px);
  padding: 0 4px; border-radius: 999px; background: rgb(0 0 0 / .7); font-size: clamp(11px, .8vw, 16px); font-weight: 700; }
.vt-pos.m1 { background: #d9a520; } .vt-pos.m2 { background: #9ea6af; } .vt-pos.m3 { background: #b9773a; }
.vt-date { position: absolute; right: .4vw; top: .4vw; z-index: 1; padding: 2px 6px; border-radius: 6px; background: rgb(0 0 0 / .7); font-size: clamp(10px, .7vw, 14px);
  font-weight: 700; font-variant-numeric: tabular-nums; }
.vt-body { display: grid; gap: .3vh; min-width: 0; padding: .7vh .6vw .9vh; }
.vt-body > * { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vt-name { font-size: clamp(11px, .88vw, 18px); font-weight: 600; color: rgb(255 255 255 / .88); }
.vt-l2 { font-size: clamp(10px, .72vw, 14px); color: rgb(255 255 255 / .45); }
.vt-val { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .4vw; }
.vt-val strong { font-size: min(1.9vw, 3.3vh); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; color: var(--vc); font-variant-numeric: tabular-nums; }
.vt-val small { font-size: clamp(10px, .72vw, 14px); color: rgb(255 255 255 / .45); font-variant-numeric: tabular-nums; }
.vt-trk { height: clamp(5px, .6vh, 9px); border-radius: 999px; background: rgb(255 255 255 / .09); overflow: hidden; }
.vt-trk i { display: block; height: 100%; width: var(--w); border-radius: 999px; background: var(--vc); animation: fill 1.4s .4s cubic-bezier(.2,.7,.2,1) backwards; }

/* categorias (painel da curva) */
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: clamp(8px, .7vw, 16px); min-height: 0; }
.cats .tv-box { justify-content: center; }
.cats .big { font-size: min(2.2vw, 4.2vh); }
.cats .sub { white-space: normal; }

/* fita */
.tv-ticker { flex-direction: row; align-items: stretch; height: clamp(44px, 5.4vh, 84px); padding: 0; --c: #ffffff; --tint: 3%; }
.tv-ticker-label { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 clamp(12px, 1.2vw, 26px); background: rgb(255 255 255 / .06); }
.tv-ticker-label i { width: clamp(8px, .6vw, 12px); height: clamp(8px, .6vw, 12px); border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff; }
.tv-ticker-label span { font-size: clamp(12px, .95vw, 19px); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgb(255 255 255 / .8); white-space: nowrap; }
.tv-ticker-track { position: relative; flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent); }
.tv-ticker-run { display: flex; align-items: center; width: max-content; height: 100%; will-change: transform; animation: ticker var(--t, 60s) linear infinite; }
body.paused .tv-ticker-run { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.tk { display: flex; align-items: center; gap: .6em; padding: 0 1.6vw; border-right: 1px solid rgb(255 255 255 / .08); white-space: nowrap; font-size: clamp(12px, .95vw, 19px); }
.tk em { padding: 2px 7px; border-radius: 6px; background: rgb(255 255 255 / .08); font-size: .7em; font-style: normal; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgb(255 255 255 / .55); }
.tk b { font-weight: 600; color: rgb(255 255 255 / .88); }
.tk strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.tk .up { color: var(--pos); } .tk .down { color: var(--neg); }
.tk small { color: rgb(255 255 255 / .45); font-variant-numeric: tabular-nums; }

.tv-note { margin: 0; text-align: center; font-size: clamp(9px, .6vw, 12px); color: rgb(255 255 255 / .28); }

@media (max-aspect-ratio: 4/3) {
  .vt-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
  .tv-dots { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tv-glow, .row4 .tv-box::after, .live { animation: none; }
}
