/* app.css — tema do site do speedtest (v2). Sem fontes/imagens externas; sem style="" (CSP). As
   cores da MARCA chegam por CSSOM (site.js) pelas variáveis --brand*, com padrão CommandoISP aqui.
   PREGADO POR TESTE: os tokens #hex do :root/dark não mudam; o body mantém background-COLOR =
   var(--bg) (degradês só em background-image); nada de texto transparente em elemento medido;
   alvos ≥ 44 px; color-mix/backdrop-filter sempre com fallback plano (navegador antigo só perde o
   enfeite). */

:root {
  color-scheme: light dark;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #d3dae8;
  --line-strong: #8693ab;
  --track: #dde3f0;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok: #027a48;
  --ok-bg: #ecfdf3;
  --warn: #8a4b00;
  --warn-bg: #fff7e6;
  --brand: #1d4ed8;
  --on-brand: #ffffff;
  --accent: #b45309;
  --on-accent: #ffffff;
  --brand-ink-light: #1d4ed8;
  --brand-ink-dark: #6587e4;
  --accent-ink-light: #b45309;
  --accent-ink-dark: #c3753a;
  --brand-ink: var(--brand-ink-light);
  --accent-ink: var(--accent-ink-light);
  --radius: 18px;
  --radius-lg: 24px;
  --shadow-lg: 0 1px 2px rgb(15 23 42 / 5%), 0 14px 40px rgb(15 23 42 / 10%);
  --glow: transparent;
  --wash: transparent;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1422;
    --surface: #161e30;
    --text: #e8edf7;
    --muted: #a3b0c7;
    --line: #2a3550;
    --line-strong: #5d6d90;
    --track: #26314b;
    --shadow: none;
    --danger: #ff8b7e;
    --danger-bg: #3a1a1a;
    --ok: #4ade80;
    --ok-bg: #12301f;
    --warn: #fbbf24;
    --warn-bg: #33270a;
    --brand-ink: var(--brand-ink-dark);
    --accent-ink: var(--accent-ink-dark);
    --shadow-lg: none;
  }
}

/* color-mix disponível: tons derivados da marca (brilho atrás do mostrador, lavagens, bordas). */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --glow: color-mix(in srgb, var(--brand) 16%, transparent);
    --wash: color-mix(in srgb, var(--brand) 7%, transparent);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  /* o "vivo": dois fachos radiais com as cores da marca sobre o fundo (decorativo; o
     background-color de cima é o que o e2e confere e o que vale para contraste) */
  background-image: radial-gradient(56rem 36rem at 88% -12%, var(--glow), transparent 62%),
    radial-gradient(44rem 30rem at -12% 26%, var(--wash), transparent 58%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 1rem/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* texto da marca vem do provedor (/config.json) e pode ter uma palavra gigante sem espaço (URL, "WWWW…") nos limites do contrato
     (title 200, tagline 300, privacy_text 2000 caracteres): sem isto a página estourava para milhares de pixels de largura. `anywhere`
     (e não `break-word`) também reduz o tamanho mínimo dos itens flex/grid, que é o que prendia a largura. */
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.65rem, 5.5vw, 2.5rem); letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .note { color: var(--muted); }
.note { font-size: .875rem; margin: .5rem 0 0; }
::selection { background: var(--brand); color: var(--on-brand); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Foco SEMPRE visível (teclado) */
:focus-visible { outline: 3px solid var(--brand-ink); outline-offset: 3px; border-radius: 6px; }
.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 10; background: var(--surface); color: var(--text);
  padding: 12px 16px; border-radius: 10px; border: 2px solid var(--brand-ink); text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%; max-width: 760px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* Cabeçalho — fixo no topo, com véu translúcido quando o navegador sabe desfocar */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  @supports (color: color-mix(in srgb, red 50%, blue)) {
    .site-header {
      background: color-mix(in srgb, var(--surface) 82%, transparent);
      -webkit-backdrop-filter: blur(12px) saturate(1.4);
      backdrop-filter: blur(12px) saturate(1.4);
    }
  }
}
/* fio de marca na base do cabeçalho */
.site-header::after {
  content: ""; display: block; height: 3px; margin-bottom: -3px; position: relative; top: 1px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: .9;
}
.header-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-height: 64px; padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-height: 44px; min-width: 0; flex: 1 1 auto; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; flex: none; background: var(--bg); padding: 3px; border: 1px solid var(--line); }
.brand-name { font-weight: 700; font-size: 1.1rem; overflow-wrap: break-word; min-width: 0; }
.top-nav { display: flex; gap: 4px; flex: 0 0 auto; }
.top-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: .9375rem; white-space: nowrap; font-weight: 600;
}
.top-nav a:hover { background: var(--bg); text-decoration: underline; }
@media (max-width: 520px) {
  .top-nav { flex: 1 1 100%; margin: 0 -12px; }
}

/* Palco: em telas largas vira grade de 3 colunas com trilhos de publicidade nas laterais; nas
   estreitas os trilhos descem para DEPOIS do conteúdo (lado a lado se couber) — antes sumiam abaixo
   de 1200 px e celular/janela menor nunca via anúncio. */
.layout { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 0 16px; flex: 1 0 auto; width: 100%; }
.layout > main { order: -1; flex: 0 0 100%; }
.rail { max-width: 100%; padding: 0 10px 28px; }

main { flex: 1 0 auto; padding-top: 28px; padding-bottom: 44px; min-width: 0; }
main:focus { outline: none; }

/* Herói */
.hero { text-align: center; margin-bottom: 22px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: .8125rem; font-weight: 700; color: var(--muted); letter-spacing: .02em;
  box-shadow: var(--shadow);
}
.hero-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.tagline { color: var(--muted); font-size: clamp(1.0625rem, 2.6vw, 1.1875rem); margin: 0; }
.hero-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.hero-points li {
  font-size: .8125rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: var(--surface);
}

/* Cartões */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.card-title { font-size: 1rem; margin-bottom: .75rem; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Mostrador — cartão principal com borda em degradê da marca e brilho suave no topo */
.stage { text-align: center; padding-top: 28px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .stage {
    border-color: transparent;
    background:
      linear-gradient(var(--surface), var(--surface)) padding-box,
      linear-gradient(140deg, color-mix(in srgb, var(--brand) 55%, var(--line)), var(--line) 38%, var(--line) 62%, color-mix(in srgb, var(--accent) 50%, var(--line))) border-box;
  }
  .stage::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 180px; pointer-events: none;
    background: radial-gradient(60% 140px at 50% 0, var(--glow), transparent 75%);
  }
}
.stage > * { position: relative; }

.gauge { position: relative; width: min(100%, 400px); margin: 0 auto; }
.gauge svg { display: block; width: 100%; height: auto; }
.gauge-track, .gauge-arc { fill: none; stroke-width: 16; stroke-linecap: round; }
.gauge-track { stroke: var(--track); }
.gauge-arc { stroke: var(--brand-ink); }
.gauge[data-phase="upload"] .gauge-arc { stroke: var(--accent-ink); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .gauge-arc { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--brand-ink) 45%, transparent)); }
  .gauge[data-phase="upload"] .gauge-arc { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--accent-ink) 45%, transparent)); }
}
.gauge-knob { fill: var(--brand-ink); stroke: var(--surface); stroke-width: 3; }
.gauge[data-phase="upload"] .gauge-knob { fill: var(--accent-ink); }
.gauge-tick { stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.gauge-tick-label { fill: var(--muted); font: 600 11.5px var(--font); text-anchor: middle; dominant-baseline: central; }
.gauge-readout { position: absolute; left: 0; right: 0; top: 32%; padding: 0 22%; pointer-events: none; }
.gauge-number { font-weight: 800; font-size: clamp(2.4rem, 11vw, 3.4rem); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gauge-unit { font-size: .9375rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; line-height: 1.3; }
.gauge-label { font-size: .875rem; font-weight: 600; color: var(--muted); min-height: 1.4em; margin-top: 2px; }
.gauge-ping { font-size: .8125rem; color: var(--muted); min-height: 1.3em; font-variant-numeric: tabular-nums; }

.phases { display: flex; list-style: none; margin: 6px 0 14px; padding: 0; gap: 4px; }
.phases li {
  flex: 1 1 auto; min-width: 0; font-size: .75rem; color: var(--muted); padding-top: 16px; position: relative; font-weight: 600;
  white-space: nowrap; text-align: center;
}
.phases li::before, .phases li::after {
  content: ""; position: absolute; top: 0; left: 2%; right: 2%; height: 7px; border-radius: 4px;
}
.phases li::before { background: var(--track); }
.phases li::after { background: var(--brand-ink); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .25s linear; }
.phases li.is-done, .phases li.is-active { color: var(--text); }
.phases li.is-done { --p: 1; }
.phases li.is-indeterminate::after { transform: none; right: 52%; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.status { min-height: 1.6em; margin: 0 0 14px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; min-width: 52px;
  padding: 0 28px; border-radius: 999px; font: 700 1.0625rem var(--font); cursor: pointer;
  border: 2px solid var(--brand-ink); background: var(--brand); color: var(--on-brand); text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .btn {
    /* degradê MONOCROMÁTICO da marca (claro → cor → sombra): misturar marca com acento (azul
       com laranja…) dava cinza sujo; assim fica "vidrado" com qualquer cor de provedor.
       Só background-IMAGE: o background-color continua var(--brand) (o e2e de marca o confere). */
    background-image: linear-gradient(165deg, color-mix(in srgb, var(--brand) 80%, #fff), var(--brand) 52%, color-mix(in srgb, var(--brand) 76%, #000));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 30%, transparent);
  }
  .btn-secondary { background-image: none; }
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-go { min-width: min(100%, 280px); font-size: 1.25rem; min-height: 60px; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); box-shadow: none; }
.btn-secondary:hover { border-color: var(--brand-ink); filter: none; }
.btn-link { background: none; border: 0; color: var(--brand-ink); font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0; margin-left: auto; }

.lgpd { font-size: .8125rem; color: var(--muted); margin: 16px auto 0; max-width: 520px; }

.alert {
  margin: 16px auto 0; max-width: 520px; text-align: left; border-radius: 14px; padding: 14px 16px;
  background: var(--danger-bg); border: 1px solid var(--danger); color: var(--text);
}
.alert strong { display: block; color: var(--danger); margin-bottom: 2px; }
.alert p { margin: 0; }
.alert .note { margin-top: 6px; }
.alert.is-neutral { background: var(--bg); border-color: var(--line); }
.alert.is-neutral strong { color: var(--text); }

/* Resultado — no lugar do mostrador, como no Ookla: barra (selo + ID), números grandes e finos,
   linha de ping, círculo "De novo" e a conexão embaixo. O mesmo painel serve o /r/{id}. */
.badge {
  display: inline-block; font-size: .8125rem; font-weight: 700; border-radius: 999px; padding: 2px 12px; margin: 0;
  color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok);
}
.badge.is-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn); }
.rs { text-align: left; max-width: 660px; margin: 0 auto; }
.rs:focus { outline: none; }
.rs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rs-bar p, .rs-title { margin: 0; }
.rs-title { font-size: 1rem; }
.rs-id { font-size: .8125rem; color: var(--muted); }
.rs-id a { font-weight: 700; font-variant-numeric: tabular-nums; }
.rs-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 36px; align-items: center; padding: 26px 0 22px; }
.rs-go { order: -1; }
.rs-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; margin: 0; }
.rs-num dt { font-size: .875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rs-unit { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.rs-num dd { margin: 0; font-size: clamp(2.6rem, 10vw, 3.75rem); font-weight: 300; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rs-arrow { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--brand-ink); color: var(--brand-ink); font-size: .75rem; font-weight: 800; line-height: 1; }
.rs-up .rs-arrow, .rs-arrow-up { border-color: var(--accent-ink); color: var(--accent-ink); }
.rs-lat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 16px 0 0; font-variant-numeric: tabular-nums; }
.rs-lat div { display: flex; align-items: center; gap: 6px; }
.rs-lat dt { font-size: .875rem; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; }
.rs-lat dd { margin: 0; font-weight: 700; }
.rs-lat .rs-arrow { width: 18px; height: 18px; font-size: .625rem; }
.rs-lat-h dt { color: var(--text); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.rs-lat-h dd { font-weight: 500; color: var(--muted); font-size: .8125rem; }
.rs-lat-h { flex-basis: 100%; }
.rs-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--warn); position: relative; }
.rs-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--warn); }
.rs-go {
  width: 132px; height: 132px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; text-align: center;
  padding: 16px; border: 2px solid var(--brand-ink); background: var(--surface); color: var(--brand-ink); cursor: pointer;
  font: 800 1.0625rem/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  box-shadow: 0 0 0 6px var(--wash), 0 0 24px var(--glow); transition: transform .12s ease, box-shadow .12s ease;
}
.rs-go:hover { transform: scale(1.04); box-shadow: 0 0 0 8px var(--wash), 0 0 32px var(--glow); }
.rs-go:focus-visible { border-radius: 50%; }
.rs-info { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 20px; }
.rs-info li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rs-info li > span { display: flex; flex-direction: column; min-width: 0; }
.rs-info b { font-weight: 600; }
.rs-info li > span > span { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.rs-ico { width: 40px; height: 40px; flex: none; padding: 8px; border: 1px solid var(--line-strong); border-radius: 50%; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rs .note { margin-top: 12px; }
.rs .share { margin-top: 16px; }
@media (max-width: 560px) {
  .rs-main { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 20px 0 18px; }
  .rs-body { width: 100%; }
  .rs-go { order: 0; width: 112px; height: 112px; font-size: .9375rem; }
  .rs-nums { gap: 8px 16px; }
  .rs-num dt { font-size: .8125rem; letter-spacing: .03em; gap: 5px; }
  .rs-num .rs-arrow { width: 18px; height: 18px; font-size: .625rem; }
  .rs-lat { gap: 6px 14px; }
}
.share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.share-url {
  flex: 1 1 200px; min-width: 0; min-height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); padding: 0 12px; font: .9375rem var(--font);
}
.share .btn { padding: 0 20px; min-height: 48px; box-shadow: none; }

/* Informações e histórico */
.meta { display: grid; gap: 10px; margin: 0; }
.meta div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.meta div:last-child { border-bottom: 0; padding-bottom: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; text-align: right; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; font-size: .9375rem; }
.history li:last-child { border-bottom: 0; }
.history .h-when { color: var(--muted); font-size: .8125rem; grid-column: 1 / -1; }
.history b { font-weight: 700; }
.history .h-unv { color: var(--warn); font-size: .75rem; }

/* Trilhos de publicidade (só telas largas; o conteúdo central nunca encolhe por causa deles) */
.rail-in { display: flex; flex-direction: column; gap: 16px; }
.vt-slot {
  width: 300px; max-width: 100%; border: 1px dashed var(--line-strong); border-radius: 4px; background: var(--surface);
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.vt-tag { font-size: .6875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.vt-fill {
  display: flex; align-items: center; justify-content: center; border-radius: 2px; min-height: 180px;
  background: linear-gradient(140deg, var(--track), var(--bg));
  color: var(--muted); font-size: .8125rem; font-weight: 700; letter-spacing: .04em;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .vt-fill { background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 12%, var(--bg)), var(--bg) 55%, color-mix(in srgb, var(--accent) 10%, var(--bg))); }
}
.vt-tall .vt-fill { min-height: 460px; }
.vt-note { font-size: .8125rem; color: var(--muted); margin: 0; }
.vt-cta { margin: 0; }
.chip.chip-vt { width: 100%; justify-content: center; border-radius: 4px; }
/* Anúncio DE VERDADE (hub, agente ≥ 0.3.0): o espaço perde o tracejado e vira a imagem clicável. */
.vt-slot.is-filled { border-style: solid; }
.vt-link { display: block; border-radius: 2px; overflow: hidden; line-height: 0; }
/* tela estreita: a vitrine vazia de 300×600 só ocuparia rolagem; anúncio de verdade aparece sempre */
@media (max-width: 1199px) {
  .vt-tall:not(.is-filled) { display: none; }
}
.vt-link img { display: block; width: 100%; height: auto; transition: opacity .2s ease; }
.vt-swap .vt-link img { opacity: 0; }

/* Rodapé */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0 32px; font-size: .875rem; color: var(--muted); position: relative; }
.site-footer::before { content: ""; position: absolute; inset: -1px 0 auto; height: 2px; background: linear-gradient(90deg, var(--brand), var(--accent)); opacity: .5; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.footer-links a, .chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600;
}
.footer-links a:hover, .chip:hover { border-color: var(--brand-ink); text-decoration: underline; }
.footer-legal { margin: 8px 0 0; }

/* Páginas de texto */
.prose { max-width: 680px; margin: 0 auto; }
.prose h2 { margin-top: 1.8em; }
.prose li { margin-bottom: .45em; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { font-size: .875rem; color: var(--muted); margin-top: .5em; }
.prose svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.diagram-bar { fill: var(--track); }
.diagram-warm { fill: var(--muted); opacity: .35; }
.diagram-win { fill: var(--brand-ink); }
.diagram-text { fill: var(--text); font: 600 13px var(--font); }
.diagram-axis { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.provider-text { white-space: pre-line; background: var(--bg); border-radius: 12px; padding: 12px 14px; }

@media (min-width: 640px) {
  main { padding-top: 44px; }
  .card { padding: 28px; }
  .stage { padding-top: 32px; }
}

/* ≥ 1200px: entra a grade com os trilhos laterais */
@media (min-width: 1200px) {
  .layout {
    display: grid;
    align-items: stretch;
    grid-template-columns: 1fr minmax(0, 792px) 1fr;
    gap: 0 8px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 16px;
  }
  .layout > * { grid-row: 1; }
  .layout > main { grid-column: 2; }
  .rail { padding: 44px 0; }
  .rail-in { position: sticky; top: 88px; }
  .rail-a { grid-column: 1; justify-self: end; }
  .rail-b { grid-column: 3; justify-self: start; }
}

@media (max-width: 480px) {
  .share-url { flex-basis: 100%; }
  .share .btn { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .card { padding: 16px; }
  .phases li { font-size: .6875rem; }
  .gauge-label { font-size: .8125rem; }
  .gauge-unit { font-size: .875rem; }
  .hero-points { display: none; }
}
@media (max-width: 350px) {
  .phases li { font-size: .625rem; }
  .card { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .actions, .share, .rail { display: none; }
  body { background: #fff; color: #000; }
}
