@font-face { font-family: 'Helvetica Now Display'; src: url('/fonts/HelveticaNowDisplay-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Helvetica Now Display'; src: url('/fonts/HelveticaNowDisplay-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Helvetica Now Display'; src: url('/fonts/HelveticaNowDisplay-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Helvetica Now Display'; src: url('/fonts/HelveticaNowDisplay-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }

/* tokens do kit app (grupowaffle/thenews-design-system) */
:root {
  color-scheme: light;
  --marca: linear-gradient(120deg, #FFD43B 0%, #F28C1E 100%);
  --marca-sobre: #0B0B0C;
  --surface: #FFFFFF;
  --surface-muted: #F7F7F8;
  --surface-sunken: #F1F1F3;
  --border: #E7E7EA;
  --border-strong: #D8D8DD;
  --text: #17171A;
  --text-secondary: #5B5B63;
  --text-muted: #8A8A93;
  --laranja: #F97A2B;
  --laranja-soft: #FFF1E0;
  --green: #16A34A;
  --green-soft: #DCFCE7;
  --amber-soft: #FEF3C7;
  --amber-text: #92400E;
  --curva: cubic-bezier(0.16, 1, 0.3, 1);
}
.dark {
  color-scheme: dark;
  --surface: #1C1B1F;
  --surface-muted: #151417;
  --surface-sunken: #26252B;
  --border: #2C2B32;
  --border-strong: #3B3A43;
  --text: #F5F4F6;
  --text-secondary: #B8B6BF;
  --text-muted: #8B8994;
  --laranja: #FFA14E;
  --laranja-soft: #33251A;
  --green-soft: #143323;
  --amber-soft: #362B14;
  --amber-text: #FFD48A;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: 'Helvetica Now Display', Inter, ui-sans-serif, system-ui, -apple-system, Arial, sans-serif;
  background: var(--surface-muted);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--laranja); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 500;
  transition: background .15s;
}
.btn:hover { background: var(--surface-sunken); }
.btn-marca { background: var(--marca); color: var(--marca-sobre); border-color: transparent; font-weight: 700; }
.btn-marca:hover { filter: brightness(1.05); background: var(--marca); }
.btn-icone { padding: 7px 9px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 3px 10px; }
.badge-vivo { background: var(--green-soft); color: var(--green); }
.badge-pausa { background: var(--amber-soft); color: var(--amber-text); }
.badge-erro { background: #FDE2E1; color: #9F1C17; }
.dark .badge-erro { background: #3A1A19; color: #FFB4AE; }
.ponto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-vivo .ponto { animation: pulsa 1.6s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: .3; } }

/* topo */
.topo {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.marca { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.marca b { font-size: 22px; font-weight: 900; letter-spacing: -0.03em; }
.marca span { font-size: 14px; color: var(--text-secondary); }
.marca i { font-style: normal; background: var(--marca); -webkit-background-clip: text; background-clip: text; color: transparent; }
.status { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.saldo strong { color: var(--text); font-weight: 700; }
.busca { width: 220px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 12px; background: var(--surface-muted); font-size: 13px; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; padding: 24px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }
.secao-titulo { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 12px; }
.secao-titulo h2 { margin: 0; font-size: 15px; font-weight: 700; }
.secao-titulo small { color: var(--text-muted); font-size: 12px; }

/* cards */
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  transition: border-color .15s, transform .2s var(--curva);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card.fav { border-color: var(--laranja); box-shadow: 0 0 0 1px var(--laranja); }
.card-img { display: block; width: 100%; aspect-ratio: 16/8; object-fit: cover; background: var(--surface-sunken); }
.card-corpo { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); padding-right: 36px; }
.card-meta .site { color: var(--text-secondary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.novo { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--marca); color: var(--marca-sobre); }
.estrela {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
}
.estrela { z-index: 1; }
.estrela:hover { color: var(--laranja); }
.estrela.on { background: var(--marca); color: var(--marca-sobre); border-color: transparent; }
.entra { animation: entra .6s var(--curva) both; }
@keyframes entra { from { opacity: 0; transform: translateY(-10px) scale(.98); } }

/* coluna GC */
.gc-coluna { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; max-height: calc(100vh - 108px); overflow: auto; }
.gc-vazio { color: var(--text-muted); font-size: 13px; line-height: 1.5; padding: 12px 0; }
.gc-item { border-top: 1px solid var(--border); padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.gc-item:first-of-type { border-top: 0; }
.gc-item.fora { opacity: .5; }
.gc-item textarea { width: 100%; resize: vertical; min-height: 54px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 14px; font-weight: 700; line-height: 1.3; background: var(--surface-muted); }
.gc-item .linha { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.gc-item .linha .site { margin-right: auto; }
.chave { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }

/* modal */
dialog {
  width: min(720px, 92vw); max-height: 88vh; border: 0; border-radius: 16px; padding: 0;
  background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgb(0 0 0 / .45); backdrop-filter: blur(4px); }
dialog[open] { animation: entra .3s var(--curva); }
.modal-img { display: block; width: 100%; aspect-ratio: 16/7; object-fit: cover; background: var(--surface-sunken); }
.modal-corpo { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.modal-corpo h2 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; }
.modal-corpo .texto { font-size: 15px; line-height: 1.6; color: var(--text-secondary); white-space: pre-line; }
.modal-corpo label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.modal-corpo textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; font-size: 15px; font-weight: 700; background: var(--surface-muted); resize: vertical; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acoes .fechar { margin-left: auto; }

.login { max-width: 360px; margin: 18vh auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login input { border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; background: var(--surface-muted); }
.login p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.erro-txt { color: #C2410C; font-size: 13px; }

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

/* abas */
.abas { display: flex; gap: 4px; background: var(--surface-sunken); border-radius: 10px; padding: 3px; }
.abas button { border: 0; background: transparent; border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.abas button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 700; }
.tag { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--surface-sunken); color: var(--text-secondary); }
.tag-dado { background: var(--laranja-soft); color: var(--text); }

/* análises — séries validadas (dataviz): azul + verde-água; sempre com nome e % escritos */
:root { --serie-1: #2a78d6; --serie-2: #1baf7a; }
.dark { --serie-1: #3987e5; --serie-2: #199e70; }
.aviso-mock { background: var(--amber-soft); color: var(--amber-text); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 20px; }
.an-bloco { margin-bottom: 36px; }
.an-bloco-titulo { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.an-bloco-titulo h2 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.an-sub { font-size: 14px; font-weight: 700; margin: 22px 0 10px; }
.legenda { display: flex; gap: 14px; font-size: 12px; color: var(--text-secondary); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.sw.s1 { background: var(--serie-1); }
.sw.s2 { background: var(--serie-2); }
.sw-marca { display: inline-block; width: 2px; height: 12px; background: var(--text); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tiles-2 { grid-template-columns: 1fr 1fr; margin: 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile small { font-size: 12px; color: var(--text-muted); }
.tile b { font-size: 26px; font-weight: 900; letter-spacing: -0.03em; }
.tile span { font-size: 12px; color: var(--text-secondary); }

.an-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.an-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.an-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.an-kicker { font-size: 11px; font-weight: 700; text-transform: lowercase; color: var(--text-muted); letter-spacing: .02em; }
.an-card h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; }
.an-ctx { margin: 0; font-size: 12px; color: var(--text-secondary); }
.an-frase { margin: 0; font-size: 13px; line-height: 1.4; background: var(--surface-muted); border-radius: 8px; padding: 8px 10px; }
.an-frase b { color: var(--text-muted); font-weight: 500; }
.an-fonte { font-size: 11px; color: var(--text-muted); }
.estrela-inline { position: static; width: 30px; height: 30px; flex: 0 0 30px; }

.an-tabela { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 14px; }
.an-linha { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 30px; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.an-linha:first-child { border-top: 0; }
.an-linha-nome { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.an-linha-nome b { font-size: 13px; }
.an-linha-nome small { font-size: 11px; color: var(--text-muted); }
.an-estados .an-linha { grid-template-columns: 110px 1fr 30px; }

.duo-wrap { display: flex; flex-direction: column; gap: 4px; }
.duo-rotulos { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--text); }
.duo-rotulos span { display: inline-flex; align-items: center; gap: 5px; }
.duo { position: relative; display: flex; gap: 2px; height: 12px; }
.duo-seg { height: 100%; position: relative; }
.duo-seg.s1 { background: var(--serie-1); border-radius: 4px 0 0 4px; }
.duo-seg.s2 { background: var(--serie-2); border-radius: 0 4px 4px 0; }
.duo-marca { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); border-radius: 1px; }

.faixas { display: flex; flex-direction: column; gap: 5px; }
.faixa-linha { display: grid; grid-template-columns: 44px 1fr 46px; gap: 8px; align-items: center; font-size: 12px; color: var(--text-secondary); }
.faixa-linha b { color: var(--text); font-weight: 500; text-align: right; }
.faixa-trilho { height: 10px; }
.faixa-barra { display: block; height: 100%; background: var(--serie-1); border-radius: 0 4px 4px 0; position: relative; }

.boca { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.boca input { border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; background: var(--surface-muted); font-size: 13px; min-width: 0; }
.boca input[name="grupo"], .boca input[name="instituto"], .boca button { grid-column: span 2; }
.boca input[name="instituto"] { grid-column: span 2; }

/* tooltip por marca */
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface); font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; pointer-events: none; z-index: 5;
}
.duo-seg, .faixa-barra { cursor: default; }
.duo-seg:hover, .faixa-barra:hover { filter: brightness(1.08); }
.an-atalhos { display: flex; gap: 8px; margin-bottom: 20px; }
.an-atalhos a { text-decoration: none; }
.an-bloco { scroll-margin-top: 80px; }
.an-estados { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.an-estados .an-linha:nth-child(2) { border-top: 0; }
@media (max-width: 1200px) { .an-estados { grid-template-columns: 1fr; } .an-estados .an-linha:nth-child(2) { border-top: 1px solid var(--border); } }
