/*
THESIS: The page is someone doing the electricity math for you on a yellow sheet: the answer circled in red pen, a note scribbled beside it. Refuses the calculator-site default of cards, gradients and a "Calcular" button.
OWN-WORLD: Safety yellow ground, black ink, Barlow at 800 for answers and headings, hairline rules between rows, red marker (Gochi Hand + hand-drawn SVG strokes) used once or twice per page.
STORY: The visitor reads the circled monthly cost, sees the scribbled difference if the flag turns red, and trusts it because the source line names the official resolution.
FIRST VIEWPORT: Wordmark and month/flag line, H1 question, ruled field rows with a working default, circled result with the marker note.
FORM: Conta riscada à mão (user-chosen A3, photo removed). Country-agnostic: colors of scenarios and all copy come from the country pack.
*/

:root {
  --papel: #ffd400;
  --tinta: #111111;
  --caneta: #b30e29;
  --linha: rgba(17, 17, 17, .28);
  --realce: rgba(255, 255, 255, .55);
  --fonte: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mao: "Gochi Hand", "Comic Sans MS", cursive;
  --medida: 40rem;
  --larga: 60rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--papel); }
body { margin: 0; background: var(--papel); color: var(--tinta); font: 400 1.0625rem/1.5 var(--fonte); }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--caneta); }
:focus-visible { outline: 3px solid var(--tinta); outline-offset: 2px; }
.wrap { max-width: var(--larga); margin: 0 auto; padding: 0 16px; }
.texto { max-width: var(--medida); }

/* Cabeçalho */
.cab .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; padding-top: 16px; }
.marca { font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; text-decoration: none; }
.marca u { text-decoration: none; border-bottom: 3px solid var(--tinta); }
.cab-mes { font-size: .85rem; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.cab-mes i { display: inline-block; width: .7em; height: .7em; margin-right: .35em; border: 1.5px solid var(--tinta); vertical-align: -.02em; }
.nav { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; width: 100%; margin-top: .55rem; }
.nav a { font-weight: 600; font-size: .98rem; text-decoration: none; padding: 2px 0; border-bottom: 3px solid transparent; }
.nav a[aria-current] { border-bottom-color: var(--tinta); }
.nav a:hover { border-bottom-color: var(--caneta); }

/* Títulos e texto */
h1, h2, h3 { text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(2.2rem, 9vw, 3.4rem); line-height: 1.02; letter-spacing: -.03em; margin: 1.6rem 0 1.1rem; max-width: 17ch; }
h2 { font-weight: 800; font-size: 1.55rem; line-height: 1.1; letter-spacing: -.02em; margin: 3.2rem 0 .8rem; max-width: 26ch; }
h3 { font-weight: 700; font-size: 1.15rem; margin: 1.8rem 0 .4rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; line-height: 1.45; max-width: var(--medida); }
.fonte { font-size: .84rem; line-height: 1.4; margin: .6rem 0 0; max-width: var(--medida); }
.alerta { border: 2px solid var(--tinta); background: var(--realce); padding: .65rem .85rem; max-width: var(--medida); font-weight: 600; }
.mais { font-weight: 700; }

/* Campos */
.calc { margin-top: .4rem; }
.campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; border-top: 2px solid var(--tinta); border-bottom: 2px solid var(--tinta); }
.campo { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: .4rem; padding: 8px 0 7px; border-top: 1px solid var(--linha); min-width: 0; }
.campo > input, .campo > select { grid-column: 1 / -1; }
.campo:first-child { border-top: 0; }
.campo--largo { grid-column: 1 / -1; }
.campo[hidden] { display: none; }
.campo span { font-size: .8rem; font-weight: 600; line-height: 1.2; }
.campo input, .campo select {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 0; background: transparent;
  font: 700 1.2rem/1.3 var(--fonte); color: var(--tinta); padding: 3px 0 1px; width: 100%; min-height: 36px;
  font-variant-numeric: tabular-nums;
}
.campo select {
  padding-right: 1.2rem; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--tinta) 50%), linear-gradient(135deg, var(--tinta) 50%, transparent 50%);
  background-position: calc(100% - 8px) 55%, calc(100% - 3px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.campo input:focus, .campo select:focus { outline: none; }
.campo:focus-within { background: var(--realce); box-shadow: -6px 0 0 var(--realce), 6px 0 0 var(--realce); }

/* Resultado */
.res { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .4rem .6rem; padding-top: 1.6rem; }
.res-num { position: relative; display: inline-block; padding: 0 .1em; }
.res-num svg { position: absolute; left: -11px; top: -11px; width: calc(100% + 22px); height: calc(100% + 22px); overflow: visible; pointer-events: none; }
.res-num path { fill: none; stroke: var(--caneta); stroke-width: 3.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.res-v { font-weight: 800; font-size: clamp(2.5rem, 12.5vw, 4.3rem); line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-sub { display: block; font-size: .92rem; font-weight: 600; margin-top: 1rem; }
.anota { font-family: var(--mao); color: var(--caneta); font-size: clamp(1.15rem, 5.4vw, 1.45rem); line-height: 1.05; white-space: pre-line; text-align: right; transform: rotate(-5deg); margin: .2rem 0 0 auto; font-variant-numeric: tabular-nums; }
.anota:empty { display: none; }

/* Tabelas */
.rola { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .5rem .5rem; text-align: left; vertical-align: baseline; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-size: .8rem; font-weight: 700; border-bottom: 2px solid var(--tinta); white-space: nowrap; }
tbody th, tbody td { border-bottom: 1px solid var(--linha); font-weight: 400; }
tbody th { font-weight: 600; }
.n { text-align: right !important; white-space: nowrap; }
td.n { font-weight: 800; }
.uf { width: 3rem; }
.sw { display: inline-block; width: .8em; height: .8em; margin-right: .55em; border: 1.5px solid var(--tinta); vertical-align: -.04em; }
.tabela-cenarios { margin-top: 1.1rem; }
.tabela-cenarios tbody td.n { font-size: 1.08rem; }
tr.atual th, tr.atual td { font-weight: 800; }
tr.destaque th, tr.destaque td { background: var(--realce); }

/* Números grandes nas páginas de região */
.cifras { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem 2.5rem; margin: .4rem 0 .3rem; }
.cifra b { display: block; font-weight: 800; font-size: clamp(2.4rem, 11vw, 3.3rem); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.cifra span { display: block; font-size: .92rem; font-weight: 600; margin-top: .55rem; }

/* Página de cenários */
.cenario-grande { display: inline-block; padding: .7rem 1rem .8rem; margin: .2rem 0 1rem; border: 2px solid var(--tinta); }
.cenario-grande b { display: block; font-weight: 800; font-size: clamp(2.6rem, 12vw, 4rem); line-height: 1; letter-spacing: -.04em; }
.cenario-grande span { display: block; font-weight: 600; margin-top: .3rem; }
.meses { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; max-width: 40rem; margin-top: 1rem; }
.mes { position: relative; padding: .4rem .45rem; min-height: 3.9rem; display: flex; flex-direction: column; justify-content: space-between; border: 1.5px solid var(--tinta); }
.mes b { font-weight: 700; font-size: .9rem; }
.mes span { font-size: .78rem; }
.mes svg { position: absolute; left: -9px; top: -9px; width: calc(100% + 18px); height: calc(100% + 18px); overflow: visible; pointer-events: none; }
.mes path { fill: none; stroke: var(--caneta); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* Listas */
.lista { columns: 2 14rem; column-gap: 2rem; padding: 0; margin: 0; list-style: none; }
.lista li { break-inside: avoid; padding: .35rem 0; border-bottom: 1px solid var(--linha); }
.texto ul { padding-left: 1.2rem; }
.texto li { margin-bottom: .4rem; }

/* Rodapé */
.rodape { margin-top: 4.5rem; }
.rodape .wrap { border-top: 2px solid var(--tinta); padding-top: 1rem; padding-bottom: 2.6rem; }
.rodape p { font-size: .88rem; max-width: var(--medida); }
.rodape nav { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; font-size: .92rem; font-weight: 600; margin-top: 1rem; }

@media (min-width: 720px) {
  .campos { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .campo { grid-column: span 3; }
  .campo--largo { grid-column: span 6; border-top: 0; }
  .campo--k { grid-column: span 9; }
  .meses { grid-template-columns: repeat(12, minmax(0, 1fr)); max-width: none; }
  .res { justify-content: flex-start; gap: .4rem 3rem; }
  .anota { margin-left: 0; text-align: left; }
}
.anota-mini { display: inline-block; font-family: var(--mao); color: var(--caneta); font-size: 1.15rem; font-weight: 400; margin-left: .45rem; transform: rotate(-4deg); white-space: nowrap; }
tbody th a { text-decoration-thickness: 1px; }
.tabela-cenarios { max-width: 28rem; }
.campo .erro { font-size: .8rem; font-weight: 700; color: var(--caneta); line-height: 1.2; text-align: right; white-space: nowrap; }
.calc.invalido .res-num svg { display: none; }
.campo .erro:empty { display: none; }
.campo:has([aria-invalid="true"]) span { color: var(--caneta); }
.campo [aria-invalid="true"] { text-decoration: underline wavy var(--caneta) 1.5px; text-underline-offset: 4px; }

/* Sugestão de compra (afiliado): a barra preta é o único bloco invertido do site */
.sugestao { margin: 1.6rem 0 .4rem; max-width: 34rem; }
.sugestao[hidden] { display: none; }
.sugestao-nota { font-family: var(--mao); color: var(--caneta); font-size: 1.4rem; line-height: 1; margin: 0 0 .35rem .15rem; transform: rotate(-3deg); transform-origin: left; }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--tinta); color: var(--papel); font-weight: 800; font-size: 1.12rem; line-height: 1.25; padding: .95rem 1.1rem; text-decoration: none; }
.cta::after { content: "→"; font-size: 1.4rem; line-height: 1; }
.cta:hover { text-decoration: underline; text-decoration-color: var(--papel); }
.cta:focus-visible { outline-offset: 3px; }
.sugestao-apoio { font-size: .84rem; margin: .5rem 0 0; }
