/* A Secretária — folha de estilo
   Identidade: papel e tinta — a mesa de trabalho de quem escreve à mão.
   Fundo de papel quente, tinta escura para o texto corrido, vermelho de
   selo para acentos e correções, grafite para elementos secundários.
   Tipografia inteiramente de sistema (serifa para leitura, mono para
   rótulos e dados, sem serifa para botões e navegação). Sem nenhuma
   dependência externa, sem CDN, sem Google Fonts. */

:root {
  /* --- claro: papel, tinta, selo vermelho --- */
  --bg: #f4efe3;
  --bg-alt: #ebe2cd;
  --superficie: #fffcf5;
  --superficie-2: #f0e8d5;
  --texto: #241f18;
  --texto-suave: #6b6152;
  --linha: #ddd0b2;
  --tinta: #241f18;
  --tinta-forte: #100d09;
  --tinta-clara: #4a4235;
  --vermelho: #8c3033;
  --vermelho-forte: #6a1f22;
  --vermelho-clara: #b0605e;
  --grafite: #4f5c66;
  --grafite-forte: #33404a;
  --grafite-clara: #7c8b95;
  --ok-bg: #e4ebe0;
  --ok-texto: #33532f;
  --erro-bg: #f2e1da;
  --erro-texto: #883a1f;
  --sombra: 0 8px 26px -14px rgba(30, 22, 10, .38);
  --raio: 8px;
  --display: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Liberation Serif", serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Liberation Serif", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Consolas", "Liberation Mono", Menlo, monospace;
  --realce: var(--vermelho);
  --realce-forte: var(--vermelho-forte);
  --realce-suave: color-mix(in srgb, var(--vermelho) 20%, transparent);
  --tinta-sobre-realce: #fdf6ec;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f;
    --bg-alt: #1d1911;
    --superficie: #201b13;
    --superficie-2: #282218;
    --texto: #eadfc7;
    --texto-suave: #b3a688;
    --linha: #3b3322;
    --tinta: #eadfc7;
    --tinta-forte: #f7efdc;
    --tinta-clara: #cabc9c;
    --vermelho: #dd9a94;
    --vermelho-forte: #ecb5ae;
    --vermelho-clara: #b0605e;
    --grafite: #9dadb6;
    --grafite-forte: #c2cfd6;
    --grafite-clara: #6f818b;
    --ok-bg: #223022;
    --ok-texto: #a8d3a2;
    --erro-bg: #34241d;
    --erro-texto: #e7ab8f;
    --sombra: 0 10px 30px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #17140f;
  --bg-alt: #1d1911;
  --superficie: #201b13;
  --superficie-2: #282218;
  --texto: #eadfc7;
  --texto-suave: #b3a688;
  --linha: #3b3322;
  --tinta: #eadfc7;
  --tinta-forte: #f7efdc;
  --tinta-clara: #cabc9c;
  --vermelho: #dd9a94;
  --vermelho-forte: #ecb5ae;
  --vermelho-clara: #b0605e;
  --grafite: #9dadb6;
  --grafite-forte: #c2cfd6;
  --grafite-clara: #6f818b;
  --ok-bg: #223022;
  --ok-texto: #a8d3a2;
  --erro-bg: #34241d;
  --erro-texto: #e7ab8f;
  --sombra: 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--texto);
  line-height: 1.2;
  margin: 0 0 .7rem;
  font-weight: 600;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 600; }
.hero h1 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 1.08; letter-spacing: -.015em; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
h3 { font-size: 1.08rem; }
h4 { font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-suave); font-weight: 700; }

p { margin: 0 0 1rem; color: var(--texto); }
a { color: var(--vermelho-forte); }
a:hover { color: var(--grafite-forte); }
strong { color: var(--texto); }

.moldura { max-width: 1120px; margin: 0 auto; padding: 0 1.4rem; }

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

.saltar-conteudo {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--tinta-forte); color: var(--bg); padding: .7rem 1.2rem;
  border-radius: 0 0 8px 0; font-weight: 700; font-family: var(--sans);
}
.saltar-conteudo:focus { left: 0; }

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

/* fundo de papel — textura muito subtil de linhas de caderno */
.fundo-papel {
  background-image: repeating-linear-gradient(
    0deg,
    color-mix(in srgb, var(--linha) 55%, transparent) 0 1px,
    transparent 1px 42px
  );
  background-position: left top;
}

/* ---------- cabeçalho ---------- */
.cabecalho {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--linha);
}
.cabecalho .moldura {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: .65rem; padding-bottom: .65rem;
}
.marca {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-weight: 700; font-size: 1.22rem;
  font-style: italic; letter-spacing: .01em;
  color: var(--texto); text-decoration: none; white-space: nowrap;
}
.marca:hover { color: var(--vermelho-forte); }
.marca svg { width: 32px; height: 32px; flex: none; }

.nav-principal { display: flex; align-items: center; gap: .2rem; }
.nav-principal ul { display: flex; list-style: none; margin: 0; padding: 0; gap: .05rem; flex-wrap: wrap; }
.nav-principal a {
  display: inline-block; padding: .5rem .55rem; border-radius: 5px;
  color: var(--texto-suave); text-decoration: none; font-weight: 600; font-size: .74rem;
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .04em;
  transition: background .15s ease, color .15s ease;
}
.nav-principal a:hover { background: var(--superficie-2); color: var(--texto); }
.nav-principal a[aria-current="page"] {
  color: var(--vermelho-forte); background: var(--superficie-2);
  box-shadow: inset 0 -2px 0 var(--vermelho);
}

.botao-tema {
  border: 1px solid var(--linha); background: var(--superficie);
  color: var(--texto); width: 38px; height: 38px; border-radius: 6px;
  display: grid; place-items: center; cursor: pointer; flex: none;
  transition: transform .15s ease, background .15s ease;
}
.botao-tema:hover { background: var(--superficie-2); }
.botao-tema:active { transform: scale(.92); }
.botao-tema svg { width: 18px; height: 18px; }

.botao-nav-movel {
  display: none; border: 1px solid var(--linha); background: var(--superficie);
  border-radius: 6px; width: 38px; height: 38px; cursor: pointer;
  align-items: center; justify-content: center; flex: none;
}
.botao-nav-movel svg { width: 20px; height: 20px; stroke: var(--texto); }

@media (max-width: 1180px) {
  .botao-nav-movel { display: inline-flex; }
  .nav-principal {
    position: absolute; inset: 100% 0 auto 0; background: var(--bg);
    border-bottom: 2px solid var(--linha); box-shadow: var(--sombra);
    display: none; padding: .5rem 1.4rem 1rem; max-height: 80vh; overflow-y: auto;
  }
  .nav-principal.aberta { display: block; }
  .nav-principal ul { flex-direction: column; gap: .1rem; }
  .nav-principal a { display: block; }
}

/* ---------- secções ---------- */
.seccao { padding: 4rem 0; }
.seccao-alt { background: var(--bg-alt); }
.seccao-fina { padding: 2.6rem 0; }

.etiqueta {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--vermelho-forte); background: var(--superficie-2);
  border: 1px solid var(--linha); padding: .3rem .7rem; border-radius: 4px;
  margin-bottom: 1rem;
}
.etiqueta::before { content: "—"; font-size: .8rem; }

.lead { font-size: 1.08rem; color: var(--texto-suave); max-width: 62ch; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 4rem 0 3.2rem; overflow: hidden; border-bottom: 1px solid var(--linha); }
.hero .moldura { position: relative; z-index: 1; }
.hero-grelha { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
@media (max-width: 860px) { .hero-grelha { grid-template-columns: 1fr; } }

.acoes { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 700; font-size: .84rem;
  text-transform: uppercase; letter-spacing: .03em;
  padding: .7rem 1.2rem; border-radius: 6px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primario { background: var(--tinta-forte); color: var(--bg); box-shadow: var(--sombra); }
:root[data-theme="dark"] .btn-primario { background: var(--vermelho-forte); color: #221211; }
.btn-primario:hover { background: var(--vermelho-forte); color: #fdf6ec; }
:root[data-theme="dark"] .btn-primario:hover { background: var(--vermelho); }
.btn-secundario { background: var(--superficie); border-color: var(--linha); color: var(--texto); }
.btn-secundario:hover { border-color: var(--grafite); }
.btn-fantasma { background: transparent; border-color: var(--linha); color: var(--texto-suave); }
.btn-fantasma:hover { color: var(--texto); border-color: var(--vermelho); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- grelhas / cartões ---------- */
.grelha-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.grelha-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
@media (max-width: 860px) { .grelha-3, .grelha-2 { grid-template-columns: 1fr; } }

.cartao {
  background: var(--superficie); border: 1px solid var(--linha);
  border-radius: var(--raio); padding: 1.7rem; box-shadow: var(--sombra);
}
.cartao-destaque {
  background: linear-gradient(160deg, var(--superficie) 0%, var(--superficie-2) 100%);
  border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 2.1rem; box-shadow: var(--sombra);
  display: flex; flex-direction: column; gap: .9rem;
  border-top: 3px solid var(--vermelho);
}
.cartao-destaque h3 { font-size: 1.28rem; }
.icone-destaque {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--tinta-forte); color: var(--bg);
  display: grid; place-items: center; flex: none;
}
:root[data-theme="dark"] .icone-destaque { background: var(--vermelho-forte); color: #221211; }
.icone-destaque svg { width: 24px; height: 24px; }

/* ---------- texto corrido ---------- */
.artigo { max-width: 72ch; }
.artigo h2 { margin-top: 2.4rem; }
.artigo h2:first-child { margin-top: 0; }
.artigo h3 { margin-top: 1.6rem; font-family: var(--sans); font-weight: 700; font-size: 1.02rem; }
.artigo ul, .artigo ol { padding-left: 1.3rem; }
.artigo li { margin-bottom: .4rem; }
.artigo blockquote {
  position: relative; margin: 1.8rem 0; padding: .3rem .2rem .3rem 2.2rem;
  color: var(--texto-suave); font-style: italic; font-size: 1.05rem;
}
.artigo blockquote::before {
  content: "“"; position: absolute; left: 0; top: -.4rem;
  font-family: var(--display); font-size: 2.6rem; color: var(--vermelho-clara);
  line-height: 1; font-style: normal;
}
.artigo blockquote cite { display: block; margin-top: .5rem; font-style: normal; font-size: .82rem; color: var(--texto-suave); }
.nota-verificar {
  display: inline-block; font-family: var(--mono); font-size: .82em;
  color: var(--vermelho-forte); background: var(--superficie-2);
  border: 1px dashed var(--vermelho-clara); border-radius: 4px; padding: .05em .4em;
}

/* letra capitular no início de um artigo */
.capitular::first-letter {
  font-family: var(--display); font-size: 3.4rem; float: left; line-height: .82;
  padding: .1rem .12rem 0 0; color: var(--vermelho-forte); font-weight: 700;
}

table { border-collapse: collapse; width: 100%; }
caption { text-align: left; font-weight: 700; margin-bottom: .5rem; font-family: var(--sans); }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-suave); }
.tabela-scroll { overflow-x: auto; border: 1px solid var(--linha); border-radius: var(--raio); }
.tabela-scroll table { min-width: 480px; }

/* ---------- caixas de contexto editorial ---------- */
.caixa-nota {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--superficie-2); border: 1px dashed var(--grafite-clara);
  border-radius: var(--raio); padding: 1.1rem 1.3rem; margin: 1.8rem 0;
}
.caixa-nota svg { width: 26px; height: 26px; flex: none; color: var(--vermelho-forte); }
.caixa-nota p { margin: 0; font-size: .92rem; color: var(--texto-suave); }
.caixa-nota strong { color: var(--texto); }

.caixa-exemplo {
  background: var(--superficie); border: 1px solid var(--linha); border-left: 4px solid var(--grafite);
  border-radius: 0 var(--raio) var(--raio) 0; padding: 1.2rem 1.4rem; margin: 1.8rem 0;
}
.caixa-exemplo h4 { margin-bottom: .5rem; color: var(--grafite-forte); }
.caixa-exemplo p:last-child { margin-bottom: 0; }

.passos-processo { list-style: none; margin: 1.6rem 0; padding: 0; display: grid; gap: 1rem; counter-reset: passo; }
.passos-processo li { position: relative; padding-left: 3rem; counter-increment: passo; }
.passos-processo li::before {
  content: counter(passo); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem;
  border-radius: 50%; background: var(--tinta-forte); color: var(--bg); display: grid; place-items: center;
  font-family: var(--display); font-weight: 700;
}
:root[data-theme="dark"] .passos-processo li::before { background: var(--vermelho-forte); color: #221211; }
.passos-processo p { margin: 0; }
.passos-processo h3 { margin: 0 0 .3rem; font-size: 1.02rem; }

/* ---------- decompositor de diálogo ---------- */
.decompositor-shell {
  background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio);
  box-shadow: var(--sombra); padding: 1.8rem; margin-top: 1.6rem;
}
.decompositor-privacidade {
  display: flex; gap: .7rem; align-items: flex-start; font-family: var(--sans);
  font-size: .86rem; color: var(--texto-suave); background: var(--ok-bg); color: var(--ok-texto);
  border-radius: var(--raio); padding: .8rem 1rem; margin-bottom: 1.4rem;
}
.decompositor-privacidade svg { width: 20px; height: 20px; flex: none; margin-top: .1rem; }
.decompositor-entrada label {
  display: block; font-family: var(--mono); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--texto-suave); margin-bottom: .5rem;
}
.decompositor-entrada textarea {
  width: 100%; min-height: 220px; padding: 1rem 1.1rem; border-radius: 7px;
  border: 1px solid var(--linha); background: var(--bg); color: var(--texto);
  font-family: var(--mono); font-size: .92rem; line-height: 1.55; resize: vertical;
}
.decompositor-acoes { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.decompositor-acoes button { font-family: var(--sans); }
.decompositor-acoes .btn-fantasma { background: transparent; border: 1px solid var(--linha); }

.decompositor-erro {
  margin-top: 1rem; background: var(--erro-bg); color: var(--erro-texto);
  border-radius: var(--raio); padding: .8rem 1rem; font-family: var(--sans); font-size: .88rem;
}

.decompositor-resultado { margin-top: 2.2rem; }
.decompositor-resultado h3 { font-size: 1.05rem; }

.racio-shell { display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0 2rem; }
.racio-legenda {
  display: flex; flex-wrap: wrap; gap: 1rem; font-family: var(--sans); font-size: .84rem; color: var(--texto-suave);
}
.racio-legenda span { display: inline-flex; align-items: center; gap: .4rem; }
.racio-marca { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.racio-barra {
  display: flex; width: 100%; height: 22px; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--linha); background: var(--superficie-2);
}
.racio-barra-segmento {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .68rem; font-weight: 700; color: var(--superficie);
  transition: flex-basis .5s ease;
  min-width: 2px;
}

.turnos-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.turno-card {
  border-left: 4px solid var(--linha); background: var(--superficie-2);
  border-radius: 0 7px 7px 0; padding: .8rem 1rem;
}
.turno-cabecalho {
  display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
  margin-bottom: .3rem;
}
.turno-falante {
  font-family: var(--sans); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em;
}
.turno-numero { font-family: var(--mono); font-size: .72rem; color: var(--texto-suave); }
.turno-texto { margin: 0; }
.turno-selos { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.selo {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .05em;
  padding: .2rem .55rem; border-radius: 999px; border: 1px solid var(--linha);
  background: var(--superficie); color: var(--texto-suave);
}
.selo-interrompido { border-color: var(--vermelho-clara); color: var(--vermelho-forte); }
.selo-aberta { border-color: var(--grafite-clara); color: var(--grafite-forte); }
.selo-fechada { border-color: var(--linha); color: var(--texto-suave); }

.resumo-numeros {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin: 1.4rem 0 2rem;
}
.numero-cartao {
  background: var(--superficie-2); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: .9rem 1rem; text-align: center;
}
.numero-cartao .valor { display: block; font-family: var(--display); font-size: 1.7rem; font-weight: 700; color: var(--vermelho-forte); }
.numero-cartao .rotulo { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-suave); }

.heuristicas-lista { display: grid; gap: 1rem; margin: 1.4rem 0; }
.heuristica-item {
  background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 1.1rem 1.3rem;
}
.heuristica-item h4 { color: var(--texto); font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: .95rem; margin-bottom: .35rem; }
.heuristica-item p { margin: 0; font-size: .9rem; color: var(--texto-suave); }

/* ---------- formulário de contacto ---------- */
.aviso-ok {
  background: var(--ok-bg); color: var(--ok-texto); border: 1px solid color-mix(in srgb, var(--ok-texto) 40%, transparent);
  padding: 1rem 1.2rem; border-radius: 8px; margin-bottom: 1.6rem; font-weight: 700; font-family: var(--sans);
}
.forma-contacto { max-width: 560px; }
.campo { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.campo label { font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-suave); }
.campo input, .campo select, .campo textarea {
  padding: .7rem .8rem; border-radius: 6px; border: 1px solid var(--linha);
  background: var(--superficie); color: var(--texto); font-family: var(--serif); font-size: 1rem;
  width: 100%;
}
.campo textarea { resize: vertical; min-height: 110px; }
.campo .ajuda { font-size: .82rem; color: var(--texto-suave); font-family: var(--sans); }

/* ---------- rodapé ---------- */
.rodape { background: var(--tinta-forte); color: #efe7d6; margin-top: 3rem; }
:root[data-theme="dark"] .rodape { background: #0e0b07; }
.rodape .moldura { padding: 3rem 1.4rem 1.6rem; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
@media (max-width: 700px) { .rodape .moldura { grid-template-columns: 1fr; } }
.rodape h4 { color: #cbbfa0; font-family: var(--sans); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .8rem; }
.rodape .marca-rodape { font-family: var(--display); font-weight: 700; font-style: italic; font-size: 1.2rem; color: #f7f0e0; text-decoration: none; }
.rodape p { color: #b8ad91; max-width: 36ch; }
.rodape ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.rodape a { color: #cbbfa0; text-decoration: none; font-family: var(--sans); font-size: .9rem; }
.rodape a:hover { color: #f7f0e0; text-decoration: underline; }
.creditos { border-top: 1px solid rgba(255,255,255,.13); padding: 1.2rem 1.4rem; font-size: .82rem; color: #a3987e; text-align: center; font-family: var(--sans); }

/* utilidade */
.centro { text-align: center; }
.mt-2 { margin-top: 2rem; }

/* ============================================================
   CAMADA PREMIUM — código canónico partilhado pelos seis sites
   (fartapao, bracarapipe, mesteze, noniussoftware, talkdesk, tibagroup).

   Como usar: copiar este bloco para o FIM do style.css do site e
   (1) mapear os tokens abstratos no :root do site:
         --realce: var(--marca);            tinta do site
         --realce-forte: var(--marca-forte);
         --realce-suave: color-mix(in srgb, var(--marca) 22%, transparent);
         --tinta-sobre-realce: #fffaf0;     texto sobre --realce-forte
   (2) apagar as regras antigas que este bloco substitui:
         .revela / .em-vista, .botao-tema .icone-* (display:none),
         .nav-principal a:hover / [aria-current] com pastilha de fundo,
         .btn:hover / .btn:active simples, .cartao/.cartao-destaque hover.
   (3) ajustar a escala do h1 do hero à tipografia do site (ver «HERO»).
   Requer html.js (script inline no <head>) e o main.js canónico.
   Tudo o que esconde conteúdo vive sob html.js + no-preference.
   ============================================================ */

:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-mola: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001);
}

/* ---------- fio de leitura ---------- */
.leitura-progresso {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 300;
  background: linear-gradient(90deg, var(--realce), var(--realce-forte));
  transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
  view-transition-name: leitura;
}
html:not(.js) .leitura-progresso { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    html.js .leitura-progresso { animation: ler-progresso linear both; animation-timeline: scroll(root); }
  }
}
@keyframes ler-progresso { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- cabeçalho vivo ---------- */
.cabecalho {
  view-transition-name: cabecalho;
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  backdrop-filter: blur(10px) saturate(1.15);
  transition: box-shadow .35s ease, background-color .35s ease;
}
.cabecalho .moldura { max-width: 1320px; transition: padding .3s var(--ease-out); }
.cabecalho.rolou {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, .45);
}
.cabecalho.rolou .moldura { padding-top: .5rem; padding-bottom: .5rem; }

.nav-principal ul { gap: 0; }
.nav-principal a { position: relative; background: transparent; }
.nav-principal a::after {
  content: ""; position: absolute; left: .75rem; right: .75rem; bottom: .28rem; height: 2px;
  border-radius: 2px; background: var(--realce);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .32s var(--ease-out);
}
.nav-principal a:hover, .nav-principal a:focus-visible { background: transparent; color: var(--texto); }
.nav-principal a[aria-current="page"] { background: transparent; color: var(--realce-forte); box-shadow: none; }
.nav-principal a:hover::after, .nav-principal a:focus-visible::after,
.nav-principal a[aria-current="page"]::after { transform: scaleX(1); }

/* botão de tema: os ícones rodam e deslizam, em vez de display:none */
.botao-tema { position: relative; overflow: hidden; }
.botao-tema svg {
  position: absolute; inset: 0; margin: auto;
  transition: transform .5s var(--ease-out), opacity .3s ease;
}
.botao-tema .icone-sol { display: block; opacity: 1; transform: none; }
.botao-tema .icone-lua { display: block; opacity: 0; transform: translateY(130%) rotate(-50deg); }
:root[data-theme="dark"] .botao-tema .icone-sol { opacity: 0; transform: translateY(-130%) rotate(50deg); }
:root[data-theme="dark"] .botao-tema .icone-lua { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .botao-tema .icone-sol { display: block; opacity: 0; transform: translateY(-130%) rotate(50deg); }
  :root:not([data-theme="light"]) .botao-tema .icone-lua { display: block; opacity: 1; transform: none; }
}
.botao-tema:hover { transform: rotate(12deg); }
.botao-tema:active { transform: scale(.9); }

/* menu móvel: abre a deslizar */
@media (prefers-reduced-motion: no-preference) {
  html.js .nav-principal.aberta { animation: nav-abrir .32s var(--ease-out) both; }
}
@keyframes nav-abrir { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- navegação entre páginas como app ---------- */
@view-transition { navigation: auto; }
.rodape { view-transition-name: rodape; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-sair .28s ease both; }
  ::view-transition-new(root) { animation: vt-entrar .42s var(--ease-out) both; }
}
@keyframes vt-sair { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-entrar { from { opacity: 0; transform: translateY(10px); } }
/* círculo de luz a partir do botão de tema */
html.vt-circulo::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
html.vt-circulo::view-transition-new(root) { animation: tema-circulo .6s var(--ease-in-out) both; mix-blend-mode: normal; }
@keyframes tema-circulo {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0px)); }
  to { clip-path: circle(var(--vt-r, 141vmax) at var(--vt-x, 50%) var(--vt-y, 0px)); }
}
/* chegada por view transition: a página aterra composta, sem duplo reveal */
html.vt-instante .rv { transition: none !important; }
html.vt-instante .hero h1 .palavra { animation: none !important; opacity: 1 !important; transform: none !important; }

/* ---------- motor de revelação ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .rv { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
  html.js .rv.in-view { opacity: 1; transform: none; }
}

/* ---------- hero: tipografia cinética, palavra-chave, ambiente ---------- */
.hero { isolation: isolate; }
.hero h1 { text-wrap: balance; }
.hero .lead { text-wrap: pretty; }
/* escala display — ajustar por site: serifados clamp(2.3rem,5.2vw,4.1rem);
   caixa alta/display (mesteze) clamp(2rem,4.8vw,3.6rem); mono (nónio) clamp(1.9rem,4.2vw,3.1rem) */
.hero h1 .palavra { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  html.js .hero h1.tipo-viva .palavra {
    opacity: 0; transform: translateY(.6em) rotate(1.2deg);
    animation: palavra-sobe .95s var(--ease-out) both;
  }
  html.js .hero h1.tipo-viva ~ .lead,
  html.js .hero h1.tipo-viva ~ .acoes { animation: sobe-suave .9s var(--ease-out) both; }
  html.js .hero h1.tipo-viva ~ .lead { animation-delay: .45s; }
  html.js .hero h1.tipo-viva ~ .acoes { animation-delay: .6s; }
}
@keyframes palavra-sobe { to { opacity: 1; transform: none; } }
@keyframes sobe-suave { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.realce {
  background-image: linear-gradient(var(--realce-suave), var(--realce-suave));
  background-repeat: no-repeat; background-size: 100% .34em; background-position: 0 90%;
  padding: 0 .08em; margin: 0 -.08em; border-radius: .1em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .hero .realce { background-size: 0% .34em; animation: realce-pintar .9s var(--ease-out) 1s both; }
}
@keyframes realce-pintar { to { background-size: 100% .34em; } }

/* camadas de ambiente do hero: cada site define os seus filhos */
.hero-ambiente { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-ambiente > * { position: absolute; }
/* animações contínuas do ambiente só correm com o hero em cena */
.hero:not(.em-cena) .hero-ambiente > * { animation-play-state: paused; }
html:not(.js) .hero .hero-ambiente > * { animation-play-state: running; }

/* vinheta: o cartão do hero deixa de ter hover de cartão */
.hero .cartao, .hero .hero-vinheta { transition: none; }
.hero .cartao:hover, .hero .hero-vinheta:hover { transform: none; }

/* ---------- botões ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .22s var(--ease-out), box-shadow .3s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .08s; }
.btn-primario::after {
  content: ""; position: absolute; inset: -20% -40%; z-index: -1; pointer-events: none;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 255, 255, .26) 50%, transparent 62%);
  transform: translateX(-70%);
}
@media (prefers-reduced-motion: no-preference) {
  .btn-primario:hover::after { transform: translateX(70%); transition: transform .85s var(--ease-out); }
}
.btn-primario:hover { box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--realce-forte) 60%, transparent); }
.btn .seta { display: inline-block; transition: transform .3s var(--ease-out); }
.btn:hover .seta, .btn:focus-visible .seta { transform: translateX(4px); }
.btn-fantasma:hover { background: color-mix(in srgb, var(--realce) 8%, transparent); }

/* ---------- cartões ---------- */
.cartao, .cartao-destaque {
  position: relative;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .3s ease;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  main .cartao:hover, main .cartao-destaque:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--realce) 45%, var(--linha));
    box-shadow: 0 26px 44px -26px rgba(0, 0, 0, .4);
  }
}
.cartao-destaque { overflow: hidden; }
.cartao-destaque::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 40%), color-mix(in srgb, var(--realce) 18%, transparent), transparent 62%);
  opacity: 0; transition: opacity .45s ease;
}
.cartao-destaque:hover::before { opacity: 1; }
.cartao-destaque > * { position: relative; z-index: 1; }
.icone-destaque { transition: transform .45s var(--ease-out); }
.cartao-destaque:hover .icone-destaque { transform: translateY(-2px) rotate(-5deg); }

/* ---------- faixa de termos ---------- */
.faixa {
  position: relative; overflow: hidden;
  border-top: 1px solid var(--linha); border-bottom: 1px solid var(--linha);
  background: var(--superficie-2); padding: .95rem 0;
}
.faixa-mascara { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.faixa-pista {
  display: flex; width: max-content; margin: 0; padding: 0; list-style: none;
  font-family: var(--mono); font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--texto-suave); white-space: nowrap;
}
.faixa-pista > span { display: inline-flex; align-items: center; gap: 2.2rem; padding-right: 2.2rem; }
.faixa-pista i { font-style: normal; color: var(--realce); }
@media (prefers-reduced-motion: no-preference) {
  html.js .faixa-pista { animation: faixa-rolar 52s linear infinite; }
  .faixa:hover .faixa-pista, .faixa:focus-within .faixa-pista, .faixa.parada .faixa-pista { animation-play-state: paused; }
}
@keyframes faixa-rolar { to { transform: translateX(-50%); } }
.faixa-pausa {
  position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--linha);
  background: var(--superficie); color: var(--texto-suave); display: grid; place-items: center; cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.faixa-pausa:hover { color: var(--texto); border-color: var(--realce); }
.faixa-pausa svg { width: 12px; height: 12px; }
.faixa-pausa .icone-retomar { display: none; }
.faixa.parada .faixa-pausa .icone-pausar { display: none; }
.faixa.parada .faixa-pausa .icone-retomar { display: block; }
html:not(.js) .faixa-pausa { display: none; }
@media (prefers-reduced-motion: reduce) {
  .faixa-pista { animation: none; width: auto; flex-wrap: wrap; justify-content: center; white-space: normal; row-gap: .5rem; }
  .faixa-pista > span { flex-wrap: wrap; justify-content: center; row-gap: .5rem; }
  .faixa-pista > span:nth-child(2) { display: none; }
  .faixa-mascara { mask-image: none; -webkit-mask-image: none; }
  .faixa-pausa { display: none; }
}

/* ---------- banda de números ---------- */
.banda-numeros { padding: 2.6rem 0; }
.banda-numeros .moldura { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 720px) { .banda-numeros .moldura { grid-template-columns: 1fr; } }
.numero-facto { position: relative; padding: .4rem 0 .4rem 1.3rem; }
.numero-facto::before { content: ""; position: absolute; left: 0; top: .5rem; bottom: .5rem; width: 3px; border-radius: 3px; background: var(--realce); }
.numero-facto strong {
  display: block; font-family: var(--mono); font-weight: 700; font-size: clamp(2rem, 3.6vw, 2.8rem);
  line-height: 1; color: var(--realce-forte); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.numero-facto span { display: block; margin-top: .45rem; font-size: .92rem; color: var(--texto-suave); max-width: 26ch; }

/* ---------- formulário ---------- */
.campo input:focus-visible, .campo select:focus-visible, .campo textarea:focus-visible,
.decompositor-entrada textarea:focus-visible, .atlas-ferramentas input:focus-visible {
  outline: none; border-color: var(--realce);
  box-shadow: 0 0 0 4px var(--realce-suave);
}
.campo input, .campo select, .campo textarea { transition: border-color .2s ease, box-shadow .2s ease; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.btn[aria-busy="true"]::before {
  content: ""; width: 1em; height: 1em; border-radius: 50%; margin-right: .2em;
  border: 2px solid currentColor; border-right-color: transparent; animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  html.js .aviso-ok.a-entrar { animation: sobe-suave .6s var(--ease-out) both; }
}

/* ---------- rodapé ---------- */
.rodape { position: relative; }
.rodape::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--realce), transparent 60%); opacity: .9; }
.rodape a { position: relative; text-decoration: none; }
.rodape ul a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease-out); }
.rodape ul a:hover { text-decoration: none; }
.rodape ul a:hover::after { transform: scaleX(1); }

/* ---------- detalhes / tabelas ---------- */
details summary::before, details summary::marker { transition: transform .3s var(--ease-out); }
details summary { transition: color .2s ease; }

/* ---------- movimento reduzido: tudo visível e quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-image-pair(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .leitura-progresso { display: none !important; }
  html.js .rv { opacity: 1; transform: none; transition: none; }
  html.js .hero h1.tipo-viva .palavra { animation: none; opacity: 1; transform: none; }
  html.js .hero .realce { animation: none; background-size: 100% .34em; }
  .hero-ambiente > * { animation: none !important; }
}

/* ============================================================
   A SECRETÁRIA — camada premium própria: «tinta que escreve»
   (por cima do núcleo partilhado acima)
   ============================================================ */

/* navegação: oito rótulos longos têm de caber numa linha a 1280 px */
.nav-principal a { font-size: .72rem; padding: .5rem .5rem; letter-spacing: .035em; }
.nav-principal a::after { left: .5rem; right: .5rem; }

/* ---- palavra-chave: risco vermelho desenhado à mão ---- */
.realce-tinta { position: relative; display: inline-block; background: none; padding: 0 .04em; margin: 0; animation: none; }
.realce-tinta .risco {
  position: absolute; left: -.06em; right: -.06em; bottom: -.1em; height: .36em; width: calc(100% + .12em);
  overflow: visible; pointer-events: none;
}
.realce-tinta .risco path {
  fill: none; stroke: var(--vermelho); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .hero .realce-tinta .risco path { stroke-dashoffset: 1; animation: risco-tracar 1s var(--ease-out) 1.05s both; }
}
@keyframes risco-tracar { to { stroke-dashoffset: 0; } }

/* ---- ambiente do hero: margem de caderno e mancha de tinta ---- */
.hero-ambiente .margem-caderno {
  top: 0; bottom: 0; width: 1px;
  left: max(.8rem, calc(50% - 560px - 1.6rem));
  background: color-mix(in srgb, var(--vermelho) 45%, transparent);
}
.hero-ambiente .mancha-tinta {
  width: min(46vw, 620px); aspect-ratio: 1; right: -12vw; top: -34%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--vermelho) 10%, transparent), transparent 72%);
  animation: mancha-respira 11s var(--ease-in-out) infinite alternate;
}
@keyframes mancha-respira {
  from { transform: scale(1) translate(0, 0); opacity: .75; }
  to { transform: scale(1.14) translate(-3%, 5%); opacity: 1; }
}
@media (max-width: 860px) { .hero-ambiente .mancha-tinta { top: -10%; right: -30vw; } }

/* ---- vinheta: o caderno que se escreve ---- */
.hero .vinheta-caderno { padding: 1.3rem 1.3rem 1rem; }
.vinheta-caderno .folha { fill: var(--superficie); stroke: var(--linha); stroke-width: 1; }
.vinheta-caderno .folha-margem { stroke: var(--vermelho); stroke-width: .8; opacity: .55; }
.vinheta-caderno .folha-pautas line { stroke: var(--linha); stroke-width: .6; opacity: .7; }
.vinheta-caderno .traco { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.vinheta-caderno .tinta-vermelha { stroke: var(--vermelho); }
.vinheta-caderno .tinta-grafite { stroke: var(--grafite); }
.vinheta-caderno .ponto-interrogacao { font-family: var(--display); font-style: italic; font-size: 15px; fill: var(--vermelho); }
.vinheta-legenda {
  margin: .8rem 0 0 .6rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .06em;
  color: var(--texto-suave); display: flex; align-items: center; min-height: 1.4em;
}
.vinheta-cursor { display: inline-block; width: .55em; height: 1.05em; margin-left: .15em; background: var(--vermelho); opacity: 0; }
/* ciclo de 8 s: cada traço escreve-se na sua vez, pausa, desvanece, recomeça */
@media (prefers-reduced-motion: no-preference) {
  html.js .vinheta-caderno.escreve .traco { animation: traco-escreve 8s linear infinite; }
  html.js .vinheta-caderno.escreve .traco-1 { animation-name: traco-escreve-1; }
  html.js .vinheta-caderno.escreve .traco-2 { animation-name: traco-escreve-2; }
  html.js .vinheta-caderno.escreve .traco-3 { animation-name: traco-escreve-3; }
  html.js .vinheta-caderno.escreve .traco-4 { animation-name: traco-escreve-4; }
  html.js .vinheta-caderno.escreve .ponto-interrogacao { animation: interrogacao-surge 8s var(--ease-out) infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  html.js .vinheta-caderno.escreve .vinheta-cursor { animation: cursor-pisca 1s steps(2) infinite; opacity: 1; }
  .hero:not(.em-cena) .vinheta-caderno * { animation-play-state: paused; }
}
/* percentagens do ciclo de 8 s: 1 % = 80 ms */
@keyframes traco-escreve-1 { 0% { stroke-dashoffset: 1; opacity: 1; } 2% { stroke-dashoffset: 1; } 14% { stroke-dashoffset: 0; } 84% { opacity: 1; stroke-dashoffset: 0; } 92% { opacity: 0; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 1; } }
@keyframes traco-escreve-2 { 0%, 17% { stroke-dashoffset: 1; opacity: 1; } 27% { stroke-dashoffset: 0; } 84% { opacity: 1; stroke-dashoffset: 0; } 92% { opacity: 0; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 1; } }
@keyframes traco-escreve-3 { 0%, 34% { stroke-dashoffset: 1; opacity: 1; } 49% { stroke-dashoffset: 0; } 84% { opacity: 1; stroke-dashoffset: 0; } 92% { opacity: 0; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 1; } }
@keyframes traco-escreve-4 { 0%, 54% { stroke-dashoffset: 1; opacity: 1; } 65% { stroke-dashoffset: 0; } 84% { opacity: 1; stroke-dashoffset: 0; } 92% { opacity: 0; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 1; } }
@keyframes interrogacao-surge { 0%, 28% { opacity: 0; transform: scale(.4) rotate(-8deg); } 32% { opacity: 1; transform: scale(1.15) rotate(3deg); } 35% { transform: scale(1) rotate(0); } 84% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes cursor-pisca { to { opacity: 0; } }

/* ---- ensaios: as aspas do blockquote surgem ao revelar ---- */
@media (prefers-reduced-motion: no-preference) {
  html.js .artigo blockquote.rv::before { opacity: 0; transform: translateY(6px); transition: opacity .9s ease .25s, transform .9s var(--ease-out) .25s; }
  html.js .artigo blockquote.rv.in-view::before { opacity: 1; transform: none; }
}

/* ---- decompositor: o resultado ganha vida ---- */
.decompositor-acoes .btn-primario:active { box-shadow: inset 0 3px 10px rgba(0, 0, 0, .38); transform: scale(.97); }
.racio-barra-segmento { transition: flex-basis .9s var(--ease-out); }
@media (prefers-reduced-motion: no-preference) {
  html.js .decompositor-resultado.a-surgir { animation: sobe-suave .6s var(--ease-out) both; }
  html.js .turno-card.a-entrar { animation: turno-entra .55s var(--ease-out) both; }
  html.js .selo-interrompido.a-riscar { animation: selo-risco 1.6s ease-out .45s 1; }
  html.js .numero-cartao.a-entrar { animation: sobe-suave .5s var(--ease-out) both; }
}
@keyframes turno-entra { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes selo-risco {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--vermelho) 55%, transparent); background: color-mix(in srgb, var(--vermelho) 22%, var(--superficie)); }
  60% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; background: var(--superficie); }
}

/* ecrãs muito estreitos (≤360 px): a marca em itálico, o menu e o botão de tema
   têm de caber lado a lado sem empurrar o botão para fora da moldura */
@media (max-width: 360px) {
  .cabecalho .moldura { gap: .5rem; padding-left: .9rem; padding-right: .9rem; }
  .marca { font-size: 1.05rem; gap: .4rem; }
  .marca svg { width: 28px; height: 28px; }
}


/* ---------- decompositor: coreografia (set 2026) ---------- */
.turno-interrompido { border-right: 2px dashed var(--vermelho-clara); }
.decompositor-acoes .btn-primario:active { box-shadow: inset 0 3px 8px rgba(0, 0, 0, .28); transform: translateY(1px) scale(.98); }
@media (prefers-reduced-motion: no-preference) {
  html.js .turno-card { animation: sobe-suave .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
  html.js .selo-interrompido { animation: selo-corta 1s ease-out both; animation-delay: calc(var(--i, 0) * 45ms + .3s); }
  html.js .numero-cartao { animation: sobe-suave .5s var(--ease-out) both; }
  html.js .numero-cartao:nth-child(2) { animation-delay: 60ms; }
  html.js .numero-cartao:nth-child(3) { animation-delay: 120ms; }
  html.js .numero-cartao:nth-child(4) { animation-delay: 180ms; }
  html.js .numero-cartao:nth-child(5) { animation-delay: 240ms; }
}
@keyframes selo-corta { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--vermelho) 55%, transparent); } to { box-shadow: 0 0 0 10px transparent; } }

/* nomes de ficheiros e exemplos em <code> quebram em vez de forçar scroll horizontal */
code { overflow-wrap: anywhere; }
