/* Recibo em Dia — tema «Processo»
   Papel cinzento, tinta quase preta, réguas em vez de cartões, números grandes em grotesca.
   Cada "envelope" tem uma cor e mantém-na em toda a app:
   teu = verde-escuro · IRS = azul-tinta · Segurança Social = laranja-escuro · IVA = violeta */

:root {
  --papel: #d6d6d0;
  --folha: #e4e4df;
  --tinta: #121212;
  --tinta-suave: #4f4f49;
  --linha: #12121233;
  --linha-forte: #70706a; /* 3,4:1 sobre papel, 3,9:1 sobre folha: contornos de controlos */

  --teu: #1f5c43;
  --irs: #2b47a8;
  --ss: #c8431e; /* 3,4:1: só marcas de cor */
  --ss-texto: #9e3517; /* o laranja em texto pequeno: 4,8:1 sobre papel */
  --iva: #5b4e8c;
  --carimbo: #a12a22;

  --grotesca: "Helvetica Neue", Helvetica, Arial, "Atkinson Hyperlegible Next", sans-serif;
  --letra: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --t-pequeno: 0.875rem;
  --t-base: 1.0625rem;
  --t-medio: 1.25rem;
  --t-titulo: 1.5rem;
  --t-numero: clamp(2.75rem, 13vw, 4rem);

  --raio-folha: 12px;
  --raio-campo: 6px;
  --raio-cartao: 4px;
  --largura: 34rem;
  --altura-nav: 4.25rem;
}

/* Letra alojada junto da app (licença SIL OFL em fontes/OFL.txt): nada é pedido ao Google */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fontes/AtkinsonHyperlegibleNext-VariableFont_wght.woff") format("woff");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fontes/AtkinsonHyperlegibleNext-Italic-VariableFont_wght.woff") format("woff");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--letra);
  font-size: var(--t-base);
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
  padding-bottom: calc(var(--altura-nav) + env(safe-area-inset-bottom) + 1rem);
}

body.sem-nav { padding-bottom: 2rem; }

h1, h2, h3, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--irs);
  outline-offset: 2px;
  border-radius: 4px;
}

.saltar {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--tinta);
  color: var(--folha);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  z-index: 50;
}
.saltar:focus { top: 1rem; }

.faixa-demo {
  background: var(--tinta);
  color: var(--folha);
  font-size: var(--t-pequeno);
  text-align: center;
  padding: 0.45rem 1rem;
}

/* ─── Cabeçalho e navegação ─────────────────────────────── */

.cabecalho {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 1rem 1.25rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.marca-nome { display: block; height: 1.4rem; width: auto; color: var(--tinta); }
.marca-simbolo { display: none; width: 2.5rem; height: 2.5rem; color: var(--tinta); }

.ligacao-perfil {
  font-size: var(--t-pequeno);
  color: var(--tinta-suave);
  text-underline-offset: 3px;
  /* área de toque de pelo menos 24 px, sem mudar o aspeto */
  display: inline-block;
  padding: 0.4rem 0.3rem;
  margin: -0.4rem -0.3rem;
}

.navegacao {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10;
  background: var(--folha);
  border-top: 1px solid var(--linha);
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.navegacao a {
  height: var(--altura-nav);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-decoration: none;
  font-size: 0.8rem;
  color: var(--tinta-suave);
}
.navegacao svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.navegacao a[aria-current] { color: var(--tinta); font-weight: 700; }
.navegacao a[aria-current] svg { stroke-width: 2.2; }

@media (min-width: 900px) {
  .navegacao {
    inset: 0 auto 0 0;
    width: 7rem;
    grid-template-columns: 1fr;
    align-content: center;
    border-top: 0;
    border-right: 1px solid var(--linha);
  }
  body { padding-bottom: 3rem; padding-left: 7rem; }
  body.sem-nav { padding-left: 0; }
}

/* ─── Vista ─────────────────────────────────────────────── */

.vista {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 0.75rem 1.25rem 2rem;
}
.vista:focus { outline: none; }
.a-carregar { color: var(--tinta-suave); padding: 3rem 0; }

.titulo-pagina {
  font-size: var(--t-titulo);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 800;
  margin: 0.75rem 0 0.25rem;
}
.titulo-pagina:focus { outline: none; }

.intro { color: var(--tinta-suave); max-width: 32em; }

.seccao { margin-top: 2.25rem; }
.seccao > h2 {
  font-size: var(--t-medio);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}
.nota { font-size: var(--t-pequeno); color: var(--tinta-suave); }
.nota a { text-underline-offset: 3px; }

/* ─── Início: o número do mês ───────────────────────────── */

.saudacao {
  margin-top: 1rem;
  color: var(--tinta-suave);
}

.gastar {
  margin-top: 0.15rem;
  font-weight: 400;
  font-size: var(--t-medio);
  line-height: 1.15;
}
.gastar strong {
  display: block;
  font-size: var(--t-numero);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-top: 0.3rem;
  color: var(--teu);
}
.gastar:first-child { margin-top: 1rem; }
.gastar:focus { outline: none; }
.de-quanto { color: var(--tinta-suave); margin-top: 0.5rem; }

/* Barra dividida em envelopes */
.barra {
  display: flex;
  height: 0.875rem;
  margin: 1.25rem 0 1rem;
  border-radius: 3px;
  overflow: hidden;
  background: var(--linha);
  gap: 2px;
}
.barra span { transition: flex-grow 0.35s ease; min-width: 0; }
.barra .p-teu { background: var(--teu); }
.barra .p-irs { background: var(--irs); }
.barra .p-ss { background: var(--ss); }
.barra .p-iva { background: var(--iva); }

.envelopes { display: grid; gap: 0.55rem; }
.envelope {
  display: grid;
  grid-template-columns: 0.75rem 1fr auto;
  align-items: baseline;
  gap: 0.6rem;
}
.envelope::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  background: var(--cor);
  transform: translateY(0.05rem);
}
.envelope dd { font-weight: 700; }
.envelope .detalhe { display: block; margin-top: 0.1rem; font-size: var(--t-pequeno); color: var(--tinta-suave); }
.e-teu { --cor: var(--teu); }
.e-irs { --cor: var(--irs); }
.e-ss { --cor: var(--ss); }
.e-iva { --cor: var(--iva); }

/* ─── Botões e ligações-ação ────────────────────────────── */

.botao {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
}
.botao[disabled] { opacity: 0.6; cursor: progress; }
.botao-principal { background: var(--tinta); color: var(--folha); }
.botao-principal:hover { background: #2c2c2c; }
.botao-secundario { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--linha-forte); }
.botao-perigo { background: transparent; color: var(--carimbo); box-shadow: inset 0 0 0 1.5px currentColor; }
.botao-perigo.confirmar { background: var(--carimbo); color: var(--folha); }
.botao-largo { width: 100%; }
.acao-principal { margin-top: 1.5rem; }

.botao-texto {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.25rem 0;
  color: var(--tinta);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ─── Listas de registos (recebimentos, despesas) ───────── */

.grupo-mes { margin-top: 1.75rem; }
.grupo-mes h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--t-base);
  font-weight: 700;
  padding-bottom: 0.4rem;
  border-bottom: 1.5px solid var(--tinta);
}
.grupo-mes h2 span { font-weight: 400; color: var(--tinta-suave); font-size: var(--t-pequeno); }
.grupo-mes h2::first-letter { text-transform: uppercase; }

.registo {
  width: 100%;
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--linha);
  padding: 0.8rem 0;
  display: grid;
  grid-template-columns: 3.25rem 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  text-align: left;
  cursor: pointer;
}
.registo:hover .registo-quem { text-decoration: underline; text-underline-offset: 3px; }
.registo-dia { color: var(--tinta-suave); font-size: var(--t-pequeno); }
.registo-quem { font-weight: 700; display: block; }
.registo-sub { display: block; font-size: var(--t-pequeno); color: var(--tinta-suave); }
.registo-valor { text-align: right; font-weight: 700; }
.registo-valor small { display: block; font-weight: 400; font-size: var(--t-pequeno); color: var(--teu); }
.registo-valor small.fora { color: var(--tinta-suave); }

.vazio {
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-top: 1px dashed var(--linha-forte);
  border-bottom: 1px dashed var(--linha-forte);
}
.vazio p { color: var(--tinta-suave); margin-bottom: 1rem; }

/* Progresso dos 15% de despesas */
.progresso {
  height: 0.5rem;
  background: var(--linha);
  border-radius: 99px;
  overflow: hidden;
  margin: 0.6rem 0 0.5rem;
}
.progresso span { display: block; height: 100%; background: var(--teu); border-radius: 99px; }

/* ─── Prazos ────────────────────────────────────────────── */

.prazo {
  display: grid;
  grid-template-columns: 3.75rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--linha);
}
.prazo-data {
  text-align: center;
  line-height: 1.05;
  padding: 0.45rem 0 0.4rem;
  border: 1.5px solid var(--tinta);
  border-radius: 8px;
  align-self: start;
}
.prazo-data b { display: block; font-size: 1.55rem; font-weight: 800; }
.prazo-data span { font-size: 0.8rem; }
.prazo h2, .prazo h3 { font-size: var(--t-base); font-weight: 700; line-height: 1.3; }
.prazo p { font-size: var(--t-pequeno); color: var(--tinta-suave); margin-top: 0.2rem; }
.prazo .faltam { color: var(--tinta); font-weight: 700; }

/* Prazo a menos de uma semana: o carimbo */
.prazo.urgente .prazo-data {
  color: var(--carimbo);
  border-color: var(--carimbo);
  border-width: 2px;
  transform: rotate(-3deg);
}
.prazo.urgente .faltam { color: var(--carimbo); }

.proximo-prazo {
  display: block;
  text-decoration: none;
  border-top: 1.5px solid var(--tinta);
}
.proximo-prazo .prazo { border-bottom: 0; }
.proximo-prazo + .proximo-prazo { border-top-width: 1px; border-top-color: var(--linha); }

/* Início: o detalhe do ano dentro da Conta dos impostos */
.desde-janeiro { margin-top: 1.25rem; border-top: 1px solid var(--linha); padding-top: 0.75rem; }
.desde-janeiro summary { cursor: pointer; font-weight: 700; padding: 0.35rem 0; }
.desde-janeiro .envelopes { margin-top: 0.5rem; }
.mais-avisos { margin: 1rem 0 0; border: 1.5px solid var(--linha); border-radius: var(--raio-campo); background: var(--folha); }
.mais-avisos summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 1rem;
  min-height: 44px;
}
.mais-avisos summary::-webkit-details-marker { display: none; }
.mais-avisos summary::after {
  content: "";
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.15rem);
}
.mais-avisos[open] summary::after { transform: rotate(-135deg) translateY(-0.1rem); }
.mais-avisos-titulo { font-weight: 700; }
.mais-avisos-lista { grid-column: 1; font-size: var(--t-pequeno); color: var(--tinta-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mais-avisos[open] .mais-avisos-lista { display: none; }
.mais-avisos > .alerta { margin: 0 0.75rem 0.75rem; }
.migalha { margin: 0 0 0.25rem; font-size: var(--t-pequeno); }
.migalha a { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 44px; color: var(--tinta-suave); text-decoration: none; }
.migalha a:hover { color: var(--tinta); text-decoration: underline; }
.migalha + .titulo-pagina { margin-top: 0; }
.ligacao-cobrar { margin-top: 0.75rem; }
.desde-janeiro .nota { margin-top: 0.75rem; }
.subtitulo-ferramentas { margin-top: 1.75rem; font-size: var(--t-base); }
.subtitulo-ferramentas + .nota { margin-top: 0.25rem; }
.subtitulo-ferramentas ~ .ferramentas { margin-top: 0.75rem; }

/* Definições: grupos do formulário */
.grupo-form { margin: 2.25rem 0 0.75rem; padding-top: 1rem; border-top: 1.5px solid var(--tinta); font-size: var(--t-medio); }

/* ─── Alertas ───────────────────────────────────────────── */

.alerta {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--irs);
  background: var(--folha);
  border-radius: 0 10px 10px 0;
}
.alerta h2, .alerta h3 { font-size: var(--t-base); font-weight: 700; }
.alerta p { font-size: var(--t-pequeno); margin-top: 0.25rem; }
.alerta.atencao { border-left-color: var(--ss); }
.alerta.urgente { border-left-color: var(--carimbo); }

/* ─── Folha (diálogo que sobe de baixo) ─────────────────── */

.folha {
  border: 0;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: var(--largura);
  max-height: 92dvh;
  background: var(--folha);
  color: var(--tinta);
  border-radius: var(--raio-folha) var(--raio-folha) 0 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.folha::backdrop { background: rgb(18 18 18 / 0.5); }
.folha[open] { animation: subir 0.24s ease-out; }
@keyframes subir { from { transform: translateY(2rem); opacity: 0.4; } }

@media (min-width: 640px) {
  .folha { margin: auto; border-radius: var(--raio-folha); }
}

.folha-corpo { padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); }
.folha-corpo h2 { font-size: var(--t-titulo); font-weight: 800; letter-spacing: -0.015em; margin-bottom: 1.25rem; line-height: 1.2; }

/* ─── Formulários ───────────────────────────────────────── */

.campo { display: block; margin-bottom: 1.1rem; }
.campo > span:first-child { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.ajuda { display: block; font-size: var(--t-pequeno); color: var(--tinta-suave); margin: -0.2rem 0 0.4rem; }
.opcional { font-weight: 400; color: var(--tinta-suave); }

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--linha-forte);
  border-radius: var(--raio-campo);
  background: #fff;
}
.campo input:focus,
.campo select:focus,
.campo textarea:focus { outline: none; border-color: var(--irs); box-shadow: 0 0 0 3px rgb(43 71 168 / 0.25); }
.campo input[aria-invalid="true"] { border-color: var(--carimbo); }
.campo-valor input { font-size: 1.5rem; font-weight: 700; }
.campo textarea { font: inherit; line-height: 1.5; resize: vertical; }
.ligacao-salario { margin-top: 0.75rem; text-align: center; }
.saldo .por-mes { font-size: var(--t-base); font-weight: 400; color: var(--tinta-suave); }
.saldo.negativo, .tabela td.negativo { color: var(--carimbo); }

.erro-campo { display: block; color: var(--carimbo); font-size: var(--t-pequeno); margin-top: 0.35rem; }
.erro-form { color: var(--carimbo); margin-bottom: 1rem; font-weight: 700; }
.sucesso-form { background: #c4d4c8; padding: 0.9rem 1rem; border-radius: 4px; margin-bottom: 1rem; }

.duas-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.opcao {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.6rem;
  align-items: start;
  margin-bottom: 1rem;
  cursor: pointer;
}
.opcao input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--tinta); }
.opcao small { display: block; color: var(--tinta-suave); font-size: var(--t-pequeno); }

fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-weight: 700; margin-bottom: 0.6rem; padding: 0; }

.acoes { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
/* Lado a lado quando os rótulos cabem numa linha; senão, um por baixo do outro, a toda a largura */
.acoes .botao { flex: 1 1 auto; white-space: nowrap; }

/* ─── O talão ───────────────────────────────────────────── */
/* O elemento mais característico da app: o recebimento visto como um talão destacável. */

.talao {
  position: relative;
  background: var(--papel);
  padding: 1.35rem 1.1rem 1.25rem;
  margin: 1.5rem 0 0.25rem;
  -webkit-mask:
    radial-gradient(circle 6px at 50% 0, #0000 98%, #000) top / 16px 51% repeat-x,
    radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) bottom / 16px 51% repeat-x;
  mask:
    radial-gradient(circle 6px at 50% 0, #0000 98%, #000) top / 16px 51% repeat-x,
    radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) bottom / 16px 51% repeat-x;
}
.talao-titulo { font-size: var(--t-pequeno); color: var(--tinta-suave); margin-bottom: 0.6rem; }
.talao dl { display: grid; gap: 0.35rem; }
.talao-linha {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.talao-linha dt { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 0.45rem; } /* em ecrãs muito estreitos, o rótulo passa a duas linhas em vez de empurrar o valor para fora */
.talao-linha dt i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  background: var(--cor, transparent);
  display: inline-block;
}
.talao-linha::after {
  content: "";
  order: 2;
  flex: 1;
  border-bottom: 1.5px dotted var(--linha-forte);
  transform: translateY(-0.3rem);
}
.talao-linha dd { order: 3; flex: none; }
.talao-linha.menos dd { color: var(--tinta-suave); }
.talao-total {
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1.5px solid var(--tinta);
  font-weight: 800;
  font-size: var(--t-medio);
}
.talao-total dd { color: var(--teu); margin-left: auto; } /* sem o pontilhado, o valor do total alinha à direita como os outros */
.talao-total::after { display: none; }
.talao-nota { font-size: 0.8rem; color: var(--tinta-suave); margin-top: 0.75rem; }
.talao-vazio { color: var(--tinta-suave); }

/* Quando o valor muda, as linhas do talão acendem por ordem: o único momento animado */
.talao.a-dividir .talao-linha { animation: aparecer 0.32s ease-out both; }
.talao.a-dividir .talao-linha:nth-child(2) { animation-delay: 0.05s; }
.talao.a-dividir .talao-linha:nth-child(3) { animation-delay: 0.1s; }
.talao.a-dividir .talao-linha:nth-child(4) { animation-delay: 0.15s; }
.talao.a-dividir .talao-linha:nth-child(5) { animation-delay: 0.2s; }
.talao.a-dividir .talao-linha:nth-child(6) { animation-delay: 0.25s; }
@keyframes aparecer { from { opacity: 0; transform: translateX(-0.35rem); } }

/* ─── Entrada ───────────────────────────────────────────── */

.entrada { max-width: 26rem; margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }
.entrada .marca { margin-bottom: 2.5rem; }
.entrada h1 {
  font-size: clamp(2rem, 9vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.entrada h1:focus { outline: none; }
.entrada .intro { margin: 0.9rem 0 2rem; }
.entrada .alternar { margin-top: 1.5rem; text-align: center; }

/* ─── Definições ────────────────────────────────────────── */

.como {
  margin-top: 2.5rem;
  border-top: 1.5px solid var(--tinta);
  padding-top: 1rem;
}
.como summary { font-weight: 700; cursor: pointer; padding: 0.25rem 0; }
.como div { margin-top: 0.75rem; display: grid; gap: 0.75rem; font-size: var(--t-pequeno); color: var(--tinta-suave); }
.como b { color: var(--tinta); }

.conta { margin-top: 2.5rem; display: grid; gap: 0.75rem; justify-items: start; }

/* ─── Aviso (toast) ─────────────────────────────────────── */

.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(var(--altura-nav) + env(safe-area-inset-bottom) + 0.75rem);
  transform: translate(-50%, 1rem);
  width: min(30rem, calc(100% - 2rem));
  background: var(--tinta);
  color: var(--folha);
  padding: 0.85rem 1.1rem;
  border-radius: var(--raio-cartao);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 40;
}
.aviso.visivel { opacity: 1; transform: translate(-50%, 0); }
body.sem-nav .aviso { bottom: 1.25rem; }

.rodape-app { margin-top: 3rem; font-size: 0.8rem; color: var(--tinta-suave); }
.rodape-ligacoes { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.rodape-ligacoes a { display: inline-block; padding: 0.25rem 0; }

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

/* ─── Ronda 1: valores da Segurança Social, correção e conta ─── */

.valor-ss {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ss);
  margin-bottom: 0.25rem;
}

.prazo .prazo-valor {
  margin-top: 0.5rem;
  color: var(--tinta);
  font-weight: 700;
  font-size: var(--t-base);
}
.prazo .prazo-valor span {
  display: block;
  font-weight: 400;
  font-size: var(--t-pequeno);
  color: var(--tinta-suave);
}

.apagar-registo { margin-top: 1rem; }
.apagar-registo .botao { width: 100%; }

.conta h2 { font-size: var(--t-medio); font-weight: 700; }
.zona-apagar {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--linha);
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

/* ─── Ronda 2: conta dos impostos e faturas por receber ─── */

.saldo {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.estado-conta { font-weight: 700; margin: 0.35rem 0 0.4rem; }
.estado-conta.em-dia { color: var(--teu); }
.estado-conta.em-falta { color: var(--carimbo); }
.acoes-conta { margin-top: 1rem; }
.acoes-conta .botao { flex: 1; }

.atraso { color: var(--carimbo); }
.registo-sub.atraso { font-weight: 700; }
.registo-valor.mov-entrada { color: var(--teu); }
.registo-valor.mov-saida { color: var(--tinta-suave); }

.pendentes h2 { border-bottom-color: var(--ss); }
.estado-fatura { margin-top: 0.5rem; font-weight: 700; color: var(--ss-texto); }

/* Escolha entre duas opções, lado a lado */
.segmentos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--linha-forte);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
}
.segmentos label { position: relative; cursor: pointer; }
.segmentos input { position: absolute; opacity: 0; pointer-events: none; }
.segmentos span {
  display: block;
  text-align: center;
  padding: 0.6rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
  color: var(--tinta-suave);
}
.segmentos input:checked + span { background: var(--tinta); color: var(--folha); }
.segmentos input:focus-visible + span { outline: 3px solid var(--irs); outline-offset: 1px; }
.duas-colunas > * { min-width: 0; }
.campo input[type="date"] { min-width: 0; }

/* ─── Ronda 3: ferramentas, resumo, simulador ─── */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ferramentas { border-top: 1.5px solid var(--tinta); }
.ferramentas li { border-bottom: 1px solid var(--linha); }
.ferramentas a { display: block; padding: 0.85rem 0; text-decoration: none; }
.ferramentas b { display: block; }
.ferramentas span { display: block; font-size: var(--t-pequeno); color: var(--tinta-suave); }
.ferramentas a:hover b { text-decoration: underline; text-underline-offset: 3px; }

.resumo { border-top: 1.5px solid var(--tinta); }
.linha-resumo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--linha);
}
.linha-resumo dt small { display: block; font-size: var(--t-pequeno); color: var(--tinta-suave); }
.linha-resumo dd { font-weight: 700; white-space: nowrap; }

.tabela { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.tabela th, .tabela td { padding: 0.6rem 0; border-bottom: 1px solid var(--linha); text-align: right; font-weight: 400; }
.tabela th:first-child { text-align: left; }
.tabela thead th { font-size: var(--t-pequeno); color: var(--tinta-suave); border-bottom: 1.5px solid var(--tinta); }
.tabela tbody th { font-weight: 700; }
.simulador tr.base td, .simulador tr.base th { font-weight: 800; color: var(--ss-texto); }

@media print {
  .faixa-demo, .cabecalho, .navegacao, .nao-imprimir, .aviso, .saltar { display: none !important; }
  body { background: #fff; padding: 0; }
  .vista { max-width: none; padding: 0; }
  .seccao { break-inside: avoid; }
}
/* Fora da folha, o talão destaca-se do fundo */
.vista .talao, .pagina .talao { background: var(--folha); }

/* ─── Importação e regimes ─── */
.passos-importar { list-style: decimal; padding-left: 1.4rem; margin-top: 1rem; display: grid; gap: 0.35rem; }
.mapa-colunas { display: grid; gap: 0; }
.mapa-colunas .campo { margin-bottom: 0.75rem; }
.lista-importar { list-style: none; padding: 0; margin: 0 0 1rem; border-top: 1px solid var(--linha); }
.lista-importar li { border-bottom: 1px solid var(--linha); }
.lista-importar .opcao { margin: 0; padding: 0.6rem 0; }
.lista-importar .opcao > span { flex: 1; }
.lista-importar .valor-linha { float: right; margin-left: 0.75rem; font-variant-numeric: tabular-nums; }
.resumo-escolhas { margin-top: 0.75rem; }
.lista-anexo { list-style: none; padding: 0; margin: 0.75rem 0 0; border-top: 1px solid var(--linha); }
.lista-anexo li { padding: 0.75rem 0; border-bottom: 1px solid var(--linha); }
.anexo-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.anexo-valor { font-variant-numeric: tabular-nums; text-align: right; }
.lista-anexo p { margin: 0.25rem 0 0; color: var(--tinta-suave); font-size: var(--t-pequeno); }
.estado-linha { display: block; font-weight: 400; font-size: var(--t-pequeno); color: var(--ss-texto); }
.tabela tr.base td, .tabela tr.base th { font-weight: 800; }
.resultado-regimes .tabela td, .resultado-regimes .tabela thead th { padding-left: 0.75rem; white-space: nowrap; }
.resultado-regimes .tabela td:last-child, .resultado-regimes .tabela thead th:last-child { padding-right: 1px; }
.resultado-regimes .tabela th[scope="row"] { width: 38%; }
@media (max-width: 400px) { .resultado-regimes .tabela td { font-size: var(--t-pequeno); padding-left: 0.6rem; } }

/* ─── Plano Completo ─── */
.selo {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--teu);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: 0.1em;
  white-space: nowrap;
}
.bloqueio p { margin-bottom: 0.5rem; }
.bloqueio .botao { margin-top: 0.75rem; }

.cartao-plano {
  display: block;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--linha-forte);
  border-radius: var(--raio-cartao);
  background: var(--folha);
  text-decoration: none;
}
.cartao-plano b { display: block; }
.cartao-plano span { display: block; font-size: var(--t-pequeno); color: var(--tinta-suave); }
.cartao-plano:hover b { text-decoration: underline; text-underline-offset: 3px; }
.cartao-ligacao { display: block; margin-top: 2rem; padding: 0.85rem 1rem; border: 1.5px solid var(--linha-forte); border-radius: 12px; background: var(--folha); text-decoration: none; color: inherit; }
.cartao-ligacao b { display: block; }
.cartao-ligacao span { display: block; font-size: var(--t-pequeno); color: var(--tinta-suave); }
.cartao-ligacao:hover b { text-decoration: underline; text-underline-offset: 3px; }

/* Comparador de planos */
.comparador {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.plano-cartao {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1.5px solid var(--linha-forte);
  border-radius: var(--raio-cartao);
  background: var(--folha);
}
.plano-cartao.destaque { border: 2px solid var(--teu); }
.plano-cartao h3 { font-size: var(--t-medio); margin: 0; }
.plano-atual {
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--teu);
  border-radius: 999px;
  color: var(--teu);
  font-size: var(--t-pequeno);
}
.plano-preco { margin: 0.6rem 0 0.15rem; font-size: var(--t-titulo); font-weight: 700; font-variant-numeric: tabular-nums; }
.plano-preco span { font-size: var(--t-base); font-weight: 400; color: var(--tinta-suave); }
.plano-inclui { margin-top: 0.85rem; font-size: var(--t-pequeno); font-weight: 700; }
.plano-lista { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.plano-lista li { position: relative; padding: 0.3rem 0 0.3rem 1.5rem; border-top: 1px solid var(--linha); }
.plano-lista li::before { content: "✓" / ""; position: absolute; left: 0.1rem; color: var(--teu); font-weight: 700; }
.plano-cartao .botao { margin-top: auto; }
.plano-cartao .plano-lista + .botao { margin-top: 1rem; }
#comprar h2:focus { outline: none; }
#comprar h2:focus-visible { outline: 2px solid var(--teu); outline-offset: 4px; }

/* Selo do plano no cabeçalho */
.selo-plano {
  margin-left: auto;
  margin-right: 0.25rem;
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.1rem 0.65rem;
  border: 1px solid var(--linha-forte);
  border-radius: 999px;
  font-size: var(--t-pequeno);
  color: var(--tinta-suave);
  text-decoration: none;
  white-space: nowrap;
}
.selo-plano.completo { border-color: var(--teu); color: var(--teu); }
.selo-plano:hover, .selo-plano[aria-current='page'] { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 26.5rem) {
  /* Sem espaço para o nome inteiro: fica o símbolo, o «r» com a barra */
  .cabecalho:has(.selo-plano:not([hidden])) .marca-nome { display: none; }
  .cabecalho:has(.selo-plano:not([hidden])) .marca-simbolo { display: block; }
}

/* Início: fim do plano */
.aviso-plano {
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--ss);
  border-radius: var(--raio-cartao);
  background: var(--folha);
}
.aviso-plano p { margin-bottom: 0.75rem; }

.opcao-plano {
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--linha-forte);
  border-radius: var(--raio-cartao);
  background: var(--folha);
  margin-bottom: 0.75rem;
}
.opcao-plano:has(input:checked) { border-color: var(--tinta); box-shadow: inset 0 0 0 1px var(--tinta); }
.opcao-plano .preco { float: right; font-weight: 800; }
.aceitar { margin-top: 1.25rem; }
.aceitar a { text-underline-offset: 3px; }

.compras { border-top: 1.5px solid var(--tinta); }
.compra { padding: 0.85rem 0; border-bottom: 1px solid var(--linha); }
.compra-linha { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.compra-linha small { display: block; font-size: var(--t-pequeno); color: var(--tinta-suave); }
.compra-valor { font-weight: 700; white-space: nowrap; }
.compra .nota { margin-top: 0.5rem; }
.compra .botao { margin-top: 0.5rem; }
fieldset:disabled .opcao, fieldset:disabled .campo { opacity: 0.55; cursor: not-allowed; }
#form-comprar fieldset + fieldset { margin-top: 1.25rem; }
#form-comprar .opcao-plano small { margin-top: 0.15rem; }

/* ─── Calendário (js/calendario.js) ─────────────────────── */

.campo-data {
  appearance: none;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--linha-forte);
  border-radius: var(--raio-campo);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  cursor: pointer;
}
.campo-data svg { flex: none; color: var(--tinta-suave); }
.campo-data > span { min-width: 0; }
.campo-data-valor { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campo-data.sem-valor .campo-data-valor { color: var(--tinta-suave); }
.campo-data[aria-expanded="true"] { border-color: var(--irs); box-shadow: 0 0 0 3px rgb(43 71 168 / 0.25); }
.duas-colunas > .campo-com-data.aberto { grid-column: 1 / -1; }

.calendario {
  margin-top: 0.5rem;
  max-width: 23.5rem;
  padding: 0.6rem 0.6rem 0.75rem;
  background: var(--folha);
  border: 1.5px solid var(--tinta);
  border-radius: var(--raio-cartao);
}
.cal-topo { display: grid; grid-template-columns: 2.75rem 1fr 2.75rem; align-items: center; }
.cal-seta {
  appearance: none;
  border: 0;
  background: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.cal-seta:hover { background: var(--papel); }
.cal-titulo { display: flex; justify-content: center; gap: 0.15rem; }
.calendario .cal-mes,
.calendario .cal-ano {
  width: auto;
  min-height: 2.75rem;
  padding: 0.3rem 0.4rem;
  border: 0;
  border-radius: 8px;
  background: none;
  font-weight: 700;
  cursor: pointer;
}
.calendario .cal-mes:hover,
.calendario .cal-ano:hover { background: var(--papel); }
.cal-grelha { width: 100%; border-collapse: separate; border-spacing: 0 2px; margin-top: 0.25rem; table-layout: fixed; }
.cal-grelha th { padding: 0.3rem 0; font-size: var(--t-pequeno); font-weight: 700; color: var(--tinta-suave); text-align: center; }
.cal-grelha td { padding: 0; text-align: center; }
.cal-dia {
  appearance: none;
  border: 0;
  background: none;
  width: 2.75rem;
  max-width: 100%;
  height: 2.75rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.cal-dia:hover { background: var(--papel); }
.cal-dia.hoje { box-shadow: inset 0 0 0 1.5px var(--linha-forte); font-weight: 700; }
.cal-dia.escolhido, .cal-dia.escolhido:hover { background: var(--tinta); color: var(--folha); box-shadow: none; font-weight: 700; }
.cal-atalhos { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; padding-top: 0.75rem; border-top: 1px solid var(--linha); }
.cal-atalho {
  appearance: none;
  border: 0;
  background: none;
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--linha-forte);
  font-size: var(--t-pequeno);
  font-weight: 700;
  cursor: pointer;
}
.cal-atalho:hover { background: var(--papel); }

/* ─── Orçamentos ────────────────────────────────────────── */

a.registo { color: inherit; text-decoration: none; }
.ligacao-orcamentos { margin-top: 0.35rem; }
.segmentos.tres { grid-template-columns: repeat(3, 1fr); }
.estado-orcamento { margin-top: 1.5rem; }
.bloco-liquido { margin: 0 0 1rem; padding: 0.9rem 1rem 0.1rem; background: var(--papel); border-radius: var(--raio-campo); }
.dados-emissor { margin: 0.25rem 0 1.25rem; padding: 0.75rem 0; border-top: 1px solid var(--linha); border-bottom: 1px solid var(--linha); }
.dados-emissor summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 0.35rem; }
.dados-emissor[open] summary { margin-bottom: 0.5rem; }
.dados-emissor .nota { margin-bottom: 0.75rem; }
.aviso-dados { margin-top: 0.75rem; padding: 0.75rem 0; border-top: 1.5px solid var(--ss); border-bottom: 1.5px solid var(--ss); }
.passar-recibo { margin-top: 1rem; }
.previa-titulo { margin-top: 2rem; font-size: var(--t-pequeno); font-weight: 700; color: var(--tinta-suave); }

.documento-orcamento {
  margin-top: 0.6rem;
  padding: 2rem 1.5rem;
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgb(18 18 18 / 0.1);
  color: #1b1b1b;
  font-size: 0.95rem;
  line-height: 1.5;
}
.doc-topo { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding-bottom: 1.25rem; border-bottom: 2px solid var(--tinta); }
.doc-topo p { margin: 0; }
.doc-nome { font-size: 1.15rem; font-weight: 800; }
.doc-emissor p:not(.doc-nome), .doc-titulo p:not(.doc-tipo) { color: #4a4a4a; }
.doc-titulo { text-align: right; }
.doc-tipo { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; color: var(--tinta); }
.doc-bloco { margin-top: 1.4rem; }
.doc-bloco h2 { font-size: 0.8rem; font-weight: 700; color: #5a5a5a; margin: 0 0 0.25rem; }
.doc-bloco p { margin: 0; }
.doc-cliente { font-weight: 700; }
.doc-texto { white-space: pre-line; }
.doc-valores { width: 100%; margin-top: 1.6rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.doc-valores th, .doc-valores td { padding: 0.5rem 0; border-bottom: 1px solid #e3e3e3; text-align: left; font-weight: 400; }
.doc-valores td { text-align: right; white-space: nowrap; padding-left: 1rem; }
.doc-valores .doc-subtotal th, .doc-valores .doc-subtotal td { font-weight: 700; }
.doc-valores .doc-total th, .doc-valores .doc-total td { font-weight: 800; font-size: 1.1rem; border-bottom: 2px solid var(--tinta); }
.doc-mencao { margin: 0.5rem 0 0; font-size: 0.85rem; color: #4a4a4a; }
.doc-validade { margin: 1.4rem 0 0; }
.doc-rodape { margin: 1.75rem 0 0; padding-top: 0.75rem; border-top: 1px solid #e3e3e3; font-size: 0.8rem; color: #5a5a5a; }

@media print {
  .migalha { display: none !important; }
  .documento-orcamento { margin: 0; padding: 0; border: 0; box-shadow: none; font-size: 11pt; }
  .doc-valores .doc-total th, .doc-valores .doc-total td { font-size: 12pt; }
}
@media screen and (max-width: 34rem) {
  .doc-topo { flex-direction: column; gap: 0.9rem; }
  .doc-titulo { order: -1; text-align: left; }
  .documento-orcamento { padding: 1.5rem 1.1rem; }
}
.campo-logo { margin-bottom: 1.1rem; }
.logo-previa { margin: 0.25rem 0 0.6rem; }
.previa-legenda { font-size: var(--t-pequeno); color: var(--tinta-suave); margin-bottom: 0.35rem; }
.previa-topo { display: inline-block; min-width: 12rem; padding: 0.9rem 1rem; background: #fff; border: 1px solid var(--linha); border-radius: 6px; color: #1b1b1b; }
.previa-topo .doc-nome { margin: 0; }
.avisos-logo { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; gap: 0.35rem; }
.avisos-logo:empty { display: none; }
.aviso-logo { padding: 0.45rem 0 0.45rem 0.75rem; border-left: 3px solid var(--ss); font-size: var(--t-pequeno); }
.acoes-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.botao-ficheiro { min-height: 2.75rem; padding: 0.5rem 1.1rem; }
.botao-ficheiro:focus-within { outline: 3px solid var(--irs); outline-offset: 2px; }
.doc-logo { display: block; max-height: 88px; max-width: 220px; margin-bottom: 0.6rem; }
.dados-emissor summary { list-style: none; }
.dados-emissor summary::-webkit-details-marker { display: none; }
.dados-emissor summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.15rem);
  transition: transform 0.15s;
}
.dados-emissor[open] summary::after { transform: rotate(-135deg) translateY(-0.1rem); }
@media (prefers-reduced-motion: reduce) { .dados-emissor summary::after { transition: none; } }

/* ─── Arrumação: Início, Recibos e Impostos ─────────────── */

.envelope.zero { --cor: var(--linha-forte); color: var(--tinta-suave); }
.envelope.zero dd { font-weight: 400; }

.conta-linha h2 { margin-bottom: 0.4rem; }
.linha-conta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.9rem; }
.saldo-curto { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.linha-conta .estado-conta { margin: 0; }
.linha-conta a { margin-left: auto; }

.seletor-recibos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0.5rem 0 1.25rem;
  padding: 3px;
  border: 1.5px solid var(--linha-forte);
  border-radius: 999px;
}
.seletor-recibos a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  border-radius: 999px;
  color: var(--tinta);
  font-weight: 700;
  text-decoration: none;
}
.seletor-recibos a:hover { background: var(--papel); }
.seletor-recibos a[aria-current="page"] { background: var(--tinta); color: var(--folha); }
.seletor-recibos .contagem { min-width: 1.4rem; padding: 0 0.35rem; border-radius: 999px; background: var(--ss-texto); color: #fff; font-size: var(--t-pequeno); line-height: 1.4rem; text-align: center; }
.seletor-recibos .selo { margin-left: 0.2rem; }

.ligacoes-recibos { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.5rem; margin: 0.9rem 0 0; font-size: var(--t-pequeno); }
.procurar-recibos { margin: 1.25rem 0 0; }
.procurar-recibos input { padding-left: 2.4rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2356617A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.8rem center; }
.sem-resultados { margin-top: 1rem; }

.mes-dobravel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 0;
  border-bottom: 1.5px solid var(--tinta);
  font-weight: 700;
}
.mes-dobravel > summary::-webkit-details-marker { display: none; }
.mes-dobravel > summary > span:last-child { font-weight: 400; color: var(--tinta-suave); font-size: var(--t-pequeno); display: inline-flex; align-items: center; gap: 0.6rem; }
.mes-dobravel > summary > span:last-child::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.15rem);
}
.mes-dobravel[open] > summary > span:last-child::after { transform: rotate(-135deg) translateY(-0.05rem); }
.mes-dobravel:not([open]) { margin-top: 0; }
.mes-dobravel:not([open]) > summary { border-bottom: 1px solid var(--linha); font-weight: 400; }

/* ─── Tema «Processo»: topo do Início, réguas e números ─────
   Papel cinzento, réguas pretas em vez de cartões, números grandes em grotesca.
   Cada destino mantém a sua cor, ajustada ao papel (contraste medido contra #d6d6d0):
   teu 5,4:1 · IRS 5,6:1 · Segurança Social 3,4:1 (gráfico) · IVA 4,9:1 */


.cabecalho { border-bottom: 1.5px solid var(--tinta); padding-bottom: 0.75rem; max-width: none; }
.navegacao { background: var(--papel); border-top: 1.5px solid var(--tinta); }

/* Topo com a grelha, de ponta a ponta da coluna */
.heroi {
  margin: -0.75rem -1.25rem 0;
  padding: 1.25rem 1.25rem 1.5rem;
  border-bottom: 1.5px solid var(--tinta);
  background-image:
    linear-gradient(#12121216 1px, transparent 1px),
    linear-gradient(90deg, #12121216 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}
.saudacao { margin-top: 0.25rem; color: var(--tinta); }
.gastar strong {
  font-family: var(--grotesca);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--tinta);
}
.barra { border-radius: 0; background: var(--papel); height: 1rem; outline: 1.5px solid var(--tinta); outline-offset: 0; }
.envelopes { gap: 0; }
.envelope { padding: 0.55rem 0; border-top: 1px solid var(--tinta); }
.envelope:first-child { border-top: 0; }
.envelope::before { border-radius: 0; }
.envelope dd { font-family: var(--grotesca); font-weight: 700; letter-spacing: -0.01em; }

/* Avisos, secções e prazos: réguas em vez de cartões */
.alerta,
.mais-avisos {
  background: transparent;
  border: 0;
  border-top: 1.5px solid var(--tinta);
  border-bottom: 1.5px solid var(--tinta);
  border-radius: 0;
  margin-top: 1.5rem;
}
.alerta { padding: 0.85rem 0; }
.alerta.urgente h2, .alerta.urgente h3 { color: var(--carimbo); }
.mais-avisos summary { padding: 0.7rem 0; }
.mais-avisos > .alerta { margin: 0; border-bottom: 0; border-top: 1px solid var(--tinta); }
.seccao > h2 { border-bottom-width: 1.5px; }
.saldo-curto { font-family: var(--grotesca); letter-spacing: -0.03em; }
.prazo-data { border-radius: 0; }

/* Quando o IRS (ou outro destino) é 0 €, o quadrado fica vazio: não aparece na barra */
.envelope.zero::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--linha-forte); }

/* Números grandes em grotesca, em toda a app */
.saldo, .plano-preco, .entrada h1 { font-family: var(--grotesca); letter-spacing: -0.04em; }
.plano-preco span { font-family: var(--letra); letter-spacing: 0; }
