/* Proteção Civil Caranguejeira — estilos da app */

@font-face { font-family: "Atkinson"; src: url(../fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(../fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url(../fonts/barlow-semi-condensed-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url(../fonts/barlow-semi-condensed-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url(../fonts/barlow-semi-condensed-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Cores do logótipo da Proteção Civil */
  --azul: #0B57A4;
  --azul-noite: #0A2F5C;
  --azul-luz: #9CC3EE;
  --laranja-pc: #F7941D;
  --verde: #2E8540;
  /* Cores fixas de emergência (escala de avisos do IPMA e 112) */
  --amarelo: #F2C200;
  --vermelho: #C62828;
  /* Neutros */
  --papel: #F5F6F8;
  --branco: #FFFFFF;
  --linha: #DADDE2;
  --tinta: #0F1E33;
  --tinta-2: #5F6062;

  --f-titulo: "Barlow SC", "Arial Narrow", sans-serif;
  --f-texto: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;

  --menu-w: 320px;
  --bar-h: 78px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  /* Ondas do brasão de Caranguejeira */
  --onda-forma: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 24'%3E%3Cpath d='M0 0H86V6Q64.5 12 43 6Q21.5 0 0 6Z'/%3E%3C/svg%3E");
  --onda-linhas: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 24' fill='none' stroke='%230B57A4' stroke-width='2.6'%3E%3Cpath d='M0 13Q21.5 7 43 13T86 13'/%3E%3Cpath d='M0 19.5Q21.5 13.5 43 19.5T86 19.5' opacity='.45'/%3E%3C/svg%3E");
  --onda-linhas-claras: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 86 24' fill='none' stroke='%237FB0E6' stroke-width='2.6'%3E%3Cpath d='M0 13Q21.5 7 43 13T86 13'/%3E%3Cpath d='M0 19.5Q21.5 13.5 43 19.5T86 19.5' opacity='.45'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--f-texto);
  font-size: 16px;
  line-height: 1.45;
  color: var(--tinta);
  background: var(--papel);
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, h3, ol, ul { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
/* Anel de foco em dois tons: tinta com um halo branco. Vê-se em qualquer fundo,
   incluindo o amarelo, o laranja e o vermelho dos avisos. */
:focus-visible { outline: 3px solid var(--tinta); outline-offset: 2px; box-shadow: 0 0 0 7px #fff; border-radius: 4px; }
main:focus { outline: none; }

/* Só para leitores de ecrã */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-left: calc(20px + var(--safe-l));
  padding-right: calc(20px + var(--safe-r));
}

/* ---------- Botões ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 16px; border-radius: 10px;
  font-family: var(--f-titulo); font-weight: 600; font-size: 20px; line-height: 1;
  text-decoration: none;
}
.btn-menu { flex: 1; border: 2px solid var(--azul); color: var(--azul); background: var(--branco); }
.btn-sos { flex: 1.25; background: var(--vermelho); color: #fff; }
.btn-ghost { flex: 1; border: 2px solid rgba(255, 255, 255, .7); color: #fff; }
.btn-primary { width: 100%; background: var(--azul); color: #fff; }

/* ---------- Barra de baixo (telemóvel) ---------- */
.bar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; gap: 10px;
  padding: 12px calc(14px + var(--safe-r)) calc(12px + var(--safe-b)) calc(14px + var(--safe-l));
  background: var(--branco);
  border-top: 1px solid var(--linha);
}
main { min-height: 100dvh; padding-bottom: calc(var(--bar-h) + var(--safe-b) + 24px); }

/* ---------- Ondas ---------- */
.edge { position: relative; height: 24px; color: var(--edge, var(--azul)); }
.edge::before, .edge::after { content: ""; position: absolute; inset: 0; }
.edge::before {
  background: currentColor;
  -webkit-mask: var(--onda-forma) 0 0 / 86px 24px repeat-x;
  mask: var(--onda-forma) 0 0 / 86px 24px repeat-x;
}
.edge::after { background: var(--onda-linhas) 0 0 / 86px 24px repeat-x; }

/* ---------- Menu lateral ---------- */
.drawer {
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
  width: min(var(--menu-w), 86vw);
  display: flex; flex-direction: column;
  padding-left: var(--safe-l);
  background: var(--azul-noite); color: #fff;
  transform: translateX(-100%); visibility: hidden;
  transition: transform .24s ease, visibility 0s linear .24s;
}
body.menu-open { overflow: hidden; }
body.menu-open .drawer { transform: none; visibility: visible; transition: transform .24s ease; }
.scrim {
  position: fixed; z-index: 30; inset: 0;
  background: rgba(8, 16, 30, .55);
  opacity: 0; visibility: hidden;
  transition: opacity .24s, visibility 0s linear .24s;
}
body.menu-open .scrim { opacity: 1; visibility: visible; transition: opacity .24s; }

.drawer > * { flex-shrink: 0; }
.dtop { padding: calc(28px + var(--safe-t)) 22px 10px; }
.wm-s { font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.wm { font-family: var(--f-titulo); font-weight: 600; font-size: 21px; line-height: 1.05; }
.drawer .wm-s { color: var(--laranja-pc); }
.drawer .wm { font-size: 30px; font-weight: 700; }
.drawer .edge { --edge: var(--azul-noite); margin-top: -2px; }
.drawer .edge::after { background-image: var(--onda-linhas-claras); }
/* No menu azul-noite, o laranja do logótipo tem contraste de sobra (cerca de 6:1). */
.drawer :focus-visible { outline-color: var(--laranja-pc); box-shadow: none; }

.nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0;
  /* sombra em cima/em baixo quando há mais itens para deslizar */
  background:
    linear-gradient(var(--azul-noite) 30%, rgba(10, 47, 92, 0)) center top / 100% 32px no-repeat local,
    linear-gradient(rgba(10, 47, 92, 0), var(--azul-noite) 70%) center bottom / 100% 32px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)) center top / 100% 12px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)) center bottom / 100% 12px no-repeat scroll;
}
.g { padding: 12px 22px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; color: var(--azul-luz); }
.n {
  position: relative; display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 22px;
  font-family: var(--f-titulo); font-weight: 500; font-size: 21px; text-align: left;
  color: #fff; text-decoration: none;
}
.n[aria-current="page"] { background: rgba(255, 255, 255, .09); font-weight: 700; }
.n[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 5px;
  background: var(--laranja-pc); border-radius: 0 3px 3px 0;
}
.n-install { color: var(--laranja-pc); }
.gap { height: 10px; }

.unit {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 22px; padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.unit-s { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--azul-luz); }
.unit-n { font-family: var(--f-titulo); font-weight: 600; font-size: 20px; line-height: 1.15; }
.unit img { width: 50px; height: 50px; flex: none; }
.dbar { display: flex; gap: 10px; padding: 4px 14px calc(14px + var(--safe-b)); }
.dbar .sos-txt { display: none; }

/* ---------- Início: estado atual ---------- */
.status { padding: calc(20px + var(--safe-t)) 0 14px; }
.s-pendente { background: var(--azul); color: #fff; --act-bg: #fff; --act-fg: var(--tinta); }
.s-verde { background: var(--verde); color: #fff; --act-bg: #fff; --act-fg: var(--tinta); }
.s-amarelo { background: var(--amarelo); color: #1A1600; --act-bg: #1A1600; --act-fg: #fff; }
.s-laranja { background: var(--laranja-pc); color: #1A1200; --act-bg: #1A1200; --act-fg: #fff; }
.s-vermelho { background: var(--vermelho); color: #fff; --act-bg: #fff; --act-fg: var(--tinta); }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.status .wm-s { font-size: 13px; opacity: .85; }
.net { display: none; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
html.offline .net { display: flex; }

.estado { margin-top: 26px; }
.demo {
  display: block; width: fit-content; margin-bottom: 16px; padding: 3px 8px;
  border: 1.5px solid currentColor; border-radius: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
}
.big { font-family: var(--f-titulo); font-weight: 700; font-size: 44px; line-height: 1; letter-spacing: -.01em; text-wrap: balance; }
/* Nível do aviso: faz parte do título, com ícone e texto, para não depender só da cor. */
.nivel {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 24px; line-height: 1.1; letter-spacing: 0;
}
.nivel svg.i { width: 26px; height: 26px; stroke-width: 2.4; }
.desc { margin-top: 10px; max-width: 32em; font-size: 16px; line-height: 1.4; text-wrap: pretty; }
.act {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; min-height: 50px; padding: 0 16px; border-radius: 10px;
  background: var(--act-bg); color: var(--act-fg);
  font-weight: 700; font-size: 16px; text-decoration: none;
}

/* ---------- Início: secções ---------- */
.sec { padding-top: 30px; }
.wrap > .sec:first-child { padding-top: 16px; }
.sh { font-family: var(--f-titulo); font-weight: 700; font-size: 22px; line-height: 1.15; color: var(--tinta); text-wrap: balance; }
.prep { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.pct { min-width: 2.4ch; font-family: var(--f-titulo); font-weight: 700; font-size: 46px; line-height: 1; color: var(--azul); }
.segs { flex: 1; }
.seg { display: flex; gap: 4px; }
.seg span { position: relative; flex: 1; height: 8px; border-radius: 2px; background: var(--linha); overflow: hidden; }
.seg i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--azul); }
.seglbl { display: flex; margin-top: 6px; font-size: 14px; line-height: 1.2; color: var(--tinta-2); }
.seglbl span { flex: 1; }
.next {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; min-height: 52px; padding: 12px 0;
  border-top: 1px solid var(--linha); border-bottom: 1px solid var(--linha);
  font-weight: 700; font-size: 16px; color: var(--azul); text-decoration: none;
}

.rows { list-style: none; margin: 4px 0 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 14px; min-height: 54px;
  border-bottom: 1px solid var(--linha);
  font-size: 17px; font-weight: 700; color: var(--tinta); text-decoration: none;
}
.row .chev { margin-left: auto; width: 20px; height: 20px; color: var(--tinta-2); }
.row.hl { color: var(--hl, #9A5200); }
.row.more { color: var(--azul); font-size: 16px; }

/* ---------- Instalar (linha no fim do início) ---------- */
.install {
  display: flex; align-items: center; gap: 8px;
  margin-top: 30px; padding: 12px 0;
  border-top: 1px solid var(--linha); border-bottom: 1px solid var(--linha);
}
.install-txt { flex: 1; min-width: 0; }
.install-t { font-weight: 700; font-size: 17px; }
.install-d { font-size: 15px; color: var(--tinta-2); line-height: 1.3; }
.btn-inst {
  min-height: 44px; padding: 0 16px; border-radius: 8px;
  background: var(--azul); color: #fff;
  font-weight: 700; font-size: 16px;
}
.x { width: 44px; height: 44px; margin-right: -10px; display: grid; place-items: center; flex: none; color: var(--tinta-2); }
.x svg { width: 20px; height: 20px; }

/* ---------- Páginas interiores ---------- */
.phead { padding: calc(12px + var(--safe-t)) 0 10px; background: var(--azul); color: #fff; }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: -8px; padding: 0 8px;
  font-weight: 700; font-size: 15px; color: #fff; text-decoration: none;
}
.back svg { width: 20px; height: 20px; }
.ptitle { margin-top: 2px; font-family: var(--f-titulo); font-weight: 700; font-size: 36px; line-height: 1.05; }
.pbody { padding-top: 14px; }

.soon { margin-top: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--linha); }
.soon-k { font-family: var(--f-titulo); font-weight: 700; font-size: 22px; line-height: 1.15; }
.soon-t { margin-top: 6px; font-size: 17px; }
.hint { margin-top: 18px; color: var(--tinta-2); }
.hint a { color: var(--vermelho); font-weight: 700; }
.intro { margin-top: 4px; font-size: 17px; text-wrap: pretty; }
.intro a { color: var(--vermelho); font-weight: 700; }

/* ---------- Guias "O que fazer se…" e contactos ---------- */
.guia-sec { padding-top: 26px; }
.pbody > .guia-sec:first-child, [data-guia-visual] > .guia-sec:first-child { padding-top: 6px; }
.passos { list-style: none; margin: 4px 0 0; padding: 0; }
.passos li { padding: 12px 0; border-bottom: 1px solid var(--linha); font-size: 17px; line-height: 1.45; text-wrap: pretty; }
.passos a, .nota a { color: var(--azul); font-weight: 700; text-underline-offset: 3px; }
.nota { margin-top: 6px; color: var(--tinta-2); }

.cts { list-style: none; margin: 4px 0 0; padding: 0; }
.cts > li { border-bottom: 1px solid var(--linha); }
.ct {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 0;
  color: var(--tinta); text-decoration: none;
}
.ct-fonte { margin-top: -6px; padding-bottom: 12px; font-size: 14px; color: var(--tinta-2); }
.ct-fonte a { display: inline-block; padding: 4px 0; color: var(--azul); font-weight: 700; text-underline-offset: 3px; }
.ct-txt { flex: 1; min-width: 0; }
.ct-t { display: block; font-size: 17px; font-weight: 700; line-height: 1.3; }
.ct-num { display: block; margin-top: 2px; font-family: var(--f-titulo); font-weight: 700; font-size: 26px; line-height: 1.1; color: var(--azul); }
.ct-sos .ct-num { color: var(--vermelho); font-size: 34px; }
.ct-falta { display: block; margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--tinta-2); }
.ct-d { display: block; margin-top: 4px; font-size: 15px; line-height: 1.35; color: var(--tinta-2); }
.ct-ic { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--azul); color: #fff; }
.ct-sos .ct-ic { background: var(--vermelho); }

/* ---------- Kit de emergência ---------- */
.kit-prog { margin-top: 18px; }
.kit-num { display: flex; align-items: baseline; gap: 8px; }
.kit-de { font-size: 17px; font-weight: 700; color: var(--tinta-2); }
.kit-prog .seg { margin-top: 10px; }
.kit-cat { padding-top: 26px; }
.kit-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.kit-n { flex: none; font-family: var(--f-texto); font-size: 15px; font-weight: 700; color: var(--tinta-2); }
.kit-dica { margin-top: 2px; font-size: 15px; color: var(--tinta-2); }

/* ---------- Guias visuais: passos curtos com figuras ---------- */
.vis-passos { list-style: none; margin: 6px 0 0; padding: 0; }
.vis-passo { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--linha); }
.fig-caixa { position: relative; flex: none; }
.fig {
  display: block; width: 92px; height: 92px; padding: 8px;
  border: 1px solid var(--linha); border-radius: 14px; background: var(--branco);
  transition: transform .12s ease-out;
}
.fig:active { transform: scale(.96); }
.fig-svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.fig-n {
  position: absolute; z-index: 1; top: -9px; left: -9px;
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 3px solid var(--papel); border-radius: 50%; background: var(--azul); color: #fff;
  font-family: var(--f-titulo); font-weight: 700; font-size: 17px; line-height: 1;
}
.vis-txt { flex: 1; min-width: 0; }
.vis-t { font-family: var(--f-titulo); font-weight: 700; font-size: 22px; line-height: 1.15; text-wrap: balance; }
.vis-q { color: var(--vermelho); }
.nw { white-space: nowrap; }
.vis-t a { color: inherit; text-underline-offset: 3px; }
.vis-d { margin-top: 4px; font-size: 16px; line-height: 1.4; color: var(--tinta-2); text-wrap: pretty; }

/* Recolhidos: o que não é urgente */
.mais-grupo { margin-top: 26px; border-top: 1px solid var(--linha); }
.mais { border-bottom: 1px solid var(--linha); }
.mais > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px;
  list-style: none; cursor: pointer;
  font-family: var(--f-titulo); font-weight: 700; font-size: 22px;
}
.mais > summary::-webkit-details-marker { display: none; }
.mais > summary .chev { width: 22px; height: 22px; color: var(--tinta-2); transition: transform .25s cubic-bezier(.16, 1, .3, 1); }
.mais[open] > summary .chev { transform: rotate(90deg); }
.mais .passos { margin: 0 0 6px; }
.mais .passos li:last-child { border-bottom: 0; }
@supports selector(::details-content) {
  .mais { interpolate-size: allow-keywords; }
  .mais::details-content { height: 0; overflow: clip; transition: height .3s cubic-bezier(.16, 1, .3, 1), content-visibility .3s allow-discrete; }
  .mais[open]::details-content { height: auto; }
}

/* Desenho das figuras */
.f-l { fill: none; stroke: var(--tinta); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.f-p { fill: none; stroke: var(--tinta); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.f-h { fill: var(--tinta); }
.f-branco { fill: #fff; stroke: var(--tinta); stroke-width: 2.5; stroke-linejoin: round; }
.f-folha { fill: var(--azul-luz); stroke: var(--tinta); stroke-width: 2.5; stroke-linejoin: round; }
.f-vidro { fill: #DCEAF8; }
.f-escuro { fill: #2B3A4F; }
.f-fogo { fill: var(--vermelho); }
.f-fogo2 { fill: var(--amarelo); }
.f-fumo { fill: #A9B1BB; }
.f-calor { fill: none; stroke: var(--vermelho); stroke-width: 2.5; stroke-linecap: round; }
.f-onda { fill: none; stroke: var(--azul); stroke-width: 2.5; stroke-linecap: round; }
.f-nao { stroke: var(--vermelho); stroke-width: 3.5; stroke-linecap: round; }
.f-num { font-family: var(--f-titulo); font-weight: 700; font-size: 12px; fill: var(--vermelho); text-anchor: middle; }
.f-tacho { fill: var(--tinta); }
.f-pega { fill: none; stroke: var(--tinta); stroke-width: 4; stroke-linecap: round; }
.f-braco { fill: none; stroke: var(--tinta); stroke-width: 6; stroke-linecap: round; }
.f-dedo { fill: none; stroke: var(--tinta); stroke-width: 3.4; stroke-linecap: round; }
.f-peitoril { fill: none; stroke: var(--tinta); stroke-width: 4; stroke-linecap: round; }
.f-mesa, .f-poste { fill: none; stroke: var(--tinta); stroke-width: 4.5; stroke-linecap: round; }
.f-tronco { fill: none; stroke: #5B4A3A; stroke-width: 4.5; stroke-linecap: round; }
.f-copa { fill: var(--verde); }
.f-ramo { fill: none; stroke: #5B4A3A; stroke-width: 3; stroke-linecap: round; }
.f-carro { fill: var(--azul-luz); stroke: var(--tinta); stroke-width: 2.5; stroke-linejoin: round; }
.f-vidro-carro { fill: #fff; }
.f-roda { fill: var(--tinta); }
.f-seta, .f-cadeira { fill: none; stroke: var(--tinta); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.f-seta-azul { fill: none; stroke: var(--azul); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.f-tracejado { fill: none; stroke: var(--azul); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 6; }
.f-janelas { fill: none; stroke: var(--tinta-2); stroke-width: 3; }
.f-tijolo { fill: var(--tinta-2); }
.f-rasto, .f-vento { fill: none; stroke: var(--tinta-2); stroke-width: 2.5; stroke-linecap: round; }
.f-tremor { fill: none; stroke: var(--tinta-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.f-garrafa { fill: var(--laranja-pc); stroke: var(--tinta); stroke-width: 2.5; stroke-linejoin: round; }
.f-pau { stroke: #8A6A3A; stroke-width: 3; stroke-linecap: round; }
.f-agua { fill: #7FB0E6; }
.f-gota { fill: var(--azul); }
.f-pano { fill: #fff; stroke: var(--tinta); stroke-width: 2; }
.f-olho { fill: #fff; }
.f-cabo { fill: none; stroke: var(--tinta); stroke-width: 2.5; stroke-linecap: round; }
.f-faisca { fill: none; stroke: var(--laranja-pc); stroke-width: 2.5; stroke-linecap: round; }
.f-ok { fill: var(--azul); }
.f-visto { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.f-sol { fill: var(--amarelo); }
.f-raios { fill: none; stroke: var(--laranja-pc); stroke-width: 2.5; stroke-linecap: round; }
.f-estore { fill: #E9EDF2; stroke: var(--tinta); stroke-width: 2; }
.f-ripas { fill: none; stroke: var(--tinta-2); stroke-width: 1.5; }
.f-pa { fill: var(--tinta-2); }
.f-coracao { fill: var(--vermelho); }
.f-nuvem { fill: #7A8594; }
.f-raio { fill: var(--amarelo); stroke: var(--tinta); stroke-width: 1.5; stroke-linejoin: round; }
.f-bengala { fill: none; stroke: #5B4A3A; stroke-width: 2.5; stroke-linecap: round; }
.f-gorro { fill: var(--azul); }
.f-cachecol { fill: var(--vermelho); }
.f-neve, .f-ar { fill: none; stroke: var(--azul); stroke-width: 2.5; stroke-linecap: round; }
.f-fumo-l { fill: none; stroke: #A9B1BB; stroke-width: 3; stroke-linecap: round; }
.f-cama { fill: none; stroke: var(--tinta); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.f-lua { fill: var(--amarelo); }
.f-desligar { fill: none; stroke: var(--vermelho); stroke-width: 3; stroke-linecap: round; }
.f-placa { fill: var(--laranja-pc); stroke: var(--tinta); stroke-width: 1.5; }
.f-bandeira { fill: var(--azul); }
.f-luz { fill: #FFE680; }
.f-l-claro { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.f-pulso { fill: none; stroke: var(--vermelho); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Movimento das figuras: cada uma mostra o gesto uma vez (classe .play) e acaba no desenho final. */
.fig-svg [class*="fx-"] { transform-box: fill-box; transform-origin: 50% 50%; }
.fig-svg .fx-tremer, .fig-svg .fx-apagar { transform-origin: 50% 100%; }
.fig-svg .fx-fechar { transform-origin: 0 50%; }
.fig-svg .fx-acenar { transform-box: view-box; transform-origin: 28px 34px; }
.fig-svg .fx-apagar { transform: scale(0); opacity: 0; }
.fig-svg .fx-riscar { stroke-dasharray: 1; }
.fig-svg .fx-abrir { transform-origin: 0 50%; }
.fig-svg .fx-dobrar, .fig-svg .fx-encher { transform-origin: 50% 100%; }
.fig-svg .fx-baixar { transform-origin: 50% 0; }
.fig-svg .fx-rasto { opacity: 0; }

.fig.play .fx-correr { animation: f-correr 1.3s ease-out var(--atraso, 0ms) both; }
.fig.play .fx-tremer { animation: f-tremer .35s ease-in-out var(--atraso, 0ms) 4 alternate; }
.fig.play .fx-fechar { animation: f-fechar 1.1s cubic-bezier(.65, 0, .35, 1) calc(var(--atraso, 0ms) + 150ms) both; }
.fig.play .fx-vibrar { animation: f-vibrar .5s ease-in-out var(--atraso, 0ms) 2; }
.fig.play .fx-ondas path { animation: f-onda .7s ease-out calc(var(--atraso, 0ms) + 200ms) 2 backwards; }
.fig.play .fx-ondas .f-onda2 { animation-delay: calc(var(--atraso, 0ms) + 350ms); }
.fig.play .fx-fumo { animation: f-fumo 1.6s ease-out var(--atraso, 0ms) both; }
.fig.play .fx-gatas { animation: f-gatas 1.6s ease-out var(--atraso, 0ms) both; }
.fig.play .fx-mao { animation: f-mao 1.6s ease-in-out var(--atraso, 0ms) both; }
.fig.play .fx-calor path { animation: f-calor 1s ease-out calc(var(--atraso, 0ms) + 550ms) both; }
.fig.play .fx-calor path + path { animation-delay: calc(var(--atraso, 0ms) + 700ms); }
.fig.play .fx-descer { animation: f-descer 1.4s ease-in-out var(--atraso, 0ms) both; }
.fig.play .fx-riscar { animation: f-riscar .5s ease-out calc(var(--atraso, 0ms) + var(--d, 600ms)) both; }
.fig.play .fx-acenar { animation: f-acenar .4s ease-in-out var(--atraso, 0ms) 4 alternate; }
.fig.play .fx-rolar { animation: f-rolar 1.5s ease-in-out var(--atraso, 0ms) both; }
.fig.play .fx-apagar { animation: f-apagar 1.6s ease-in var(--atraso, 0ms) both; }
.fig.play .fx-tampa { animation: f-tampa .9s cubic-bezier(.16, 1, .3, 1) var(--atraso, 0ms) both; }

/* Movimentos partilhados: --dx/--dy dizem de onde parte, --d atrasa, --dur muda a duração. */
.fig.play .fx-mover { animation: f-mover var(--dur, 1.3s) cubic-bezier(.16, 1, .3, 1) calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-surgir { animation: f-surgir .6s cubic-bezier(.16, 1, .3, 1) calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-cair { animation: f-cair .8s cubic-bezier(.5, 0, .75, 0) calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-abanar { animation: f-abanar .35s ease-in-out calc(var(--atraso, 0ms) + var(--d, 0ms)) 4; }
.fig.play .fx-pulsar { animation: f-pulsar .6s ease-in-out calc(var(--atraso, 0ms) + var(--d, 0ms)) 2; }
.fig.play .fx-chover { animation: f-chover .7s ease-in calc(var(--atraso, 0ms) + var(--d, 0ms)) 2 both; }
.fig.play .fx-encher { animation: f-encher 1.3s cubic-bezier(.16, 1, .3, 1) calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-subir { animation: f-subir 1.4s ease-out calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-baixar { animation: f-baixar 1.1s cubic-bezier(.65, 0, .35, 1) calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-girar { animation: f-girar 1.6s cubic-bezier(.16, 1, .3, 1) calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-dobrar { animation: f-dobrar 1.6s ease-in-out calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-vento { animation: f-vento .8s ease-out calc(var(--atraso, 0ms) + var(--d, 0ms)) 2 both; }
.fig.play .fx-flash { animation: f-flash 1s linear calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-rasto { animation: f-rasto 1.1s ease-out calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }
.fig.play .fx-abrir { animation: f-abrir 1s cubic-bezier(.65, 0, .35, 1) calc(var(--atraso, 0ms) + var(--d, 0ms)) both; }

@keyframes f-correr {
  0% { transform: translateX(-14px); }
  25% { transform: translate(-10px, -2px); }
  50% { transform: translate(-6px, 0); }
  75% { transform: translate(-2px, -1.5px); }
  100% { transform: none; }
}
@keyframes f-tremer { to { transform: scale(.86, 1.08); } }
@keyframes f-fechar { from { transform: scaleX(.12); } to { transform: none; } }
@keyframes f-vibrar {
  20% { transform: rotate(-6deg); }
  40% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(3deg); }
}
@keyframes f-onda { from { opacity: 0; transform: scale(.7); } }
@keyframes f-fumo { from { transform: translateY(-9px); opacity: .35; } }
@keyframes f-gatas {
  0% { transform: translateX(-16px); }
  25% { transform: translate(-12px, -1.5px); }
  50% { transform: translate(-8px, 0); }
  75% { transform: translate(-4px, -1.5px); }
  100% { transform: none; }
}
@keyframes f-mao {
  0% { transform: translateX(-10px); }
  40%, 60% { transform: translateX(4px); }
  100% { transform: none; }
}
@keyframes f-calor { from { opacity: 0; transform: translateY(6px); } }
@keyframes f-descer {
  0% { transform: translate(-20px, -12px); }
  45%, 55% { transform: translate(-10px, -6px); }
  100% { transform: none; }
}
@keyframes f-riscar { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes f-mover { from { transform: translate(var(--dx, 0px), var(--dy, 0px)); } }
@keyframes f-surgir { from { opacity: 0; transform: scale(.5); } }
@keyframes f-cair { from { opacity: 0; transform: translateY(var(--dy, -14px)); } 20% { opacity: 1; } }
@keyframes f-abanar {
  25% { transform: translateX(-2px) rotate(-1.5deg); }
  75% { transform: translateX(2px) rotate(1.5deg); }
}
@keyframes f-pulsar { 50% { transform: scale(1.18); } }
@keyframes f-chover { from { opacity: 0; transform: translateY(-8px); } 40% { opacity: 1; } }
@keyframes f-encher { from { transform: scaleY(0); } }
@keyframes f-subir { from { transform: translateY(10px); } }
@keyframes f-baixar { from { transform: scaleY(.05); } }
@keyframes f-girar { from { transform: rotate(-540deg); } }
@keyframes f-dobrar {
  20% { transform: rotate(10deg); }
  45% { transform: rotate(3deg); }
  70% { transform: rotate(8deg); }
}
@keyframes f-vento { from { opacity: 0; transform: translateX(-10px); } }
@keyframes f-flash {
  0% { opacity: 0; }
  15% { opacity: 1; }
  30% { opacity: .1; }
  45%, 100% { opacity: 1; }
}
@keyframes f-rasto { from { opacity: 1; } to { opacity: 0; } }
@keyframes f-abrir { from { transform: scaleX(2.4); } }
@keyframes f-acenar { to { transform: rotate(-22deg); } }
@keyframes f-rolar {
  0% { transform: translateX(-12px) rotate(0); }
  25% { transform: translateX(-8px) rotate(-7deg); }
  50% { transform: translateX(-4px) rotate(5deg); }
  75% { transform: translateX(-1px) rotate(-3deg); }
  100% { transform: none; }
}
@keyframes f-apagar {
  0%, 45% { transform: none; opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
@keyframes f-tampa {
  from { transform: translate(-12px, -20px) rotate(-25deg); opacity: 0; }
  60% { opacity: 1; }
}

.checks { list-style: none; margin: 4px 0 0; padding: 0; }
.check { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--linha); cursor: pointer; }
.check input {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 28px; height: 28px; margin: -2px 0 0;
  border: 2px solid var(--tinta-2); border-radius: 6px;
  background: var(--branco) center / 20px no-repeat;
  cursor: pointer;
}
.check input:checked {
  border-color: var(--azul); background-color: var(--azul);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.check-txt { flex: 1; min-width: 0; }
.check-t { display: block; font-size: 17px; font-weight: 700; line-height: 1.3; }
.check-d { display: block; margin-top: 3px; font-size: 15px; line-height: 1.35; color: var(--tinta-2); }

.prose p { margin-top: 10px; font-size: 17px; }
.prose p:first-child { margin-top: 4px; }
.prose h2 { margin-top: 24px; font-family: var(--f-titulo); font-weight: 700; font-size: 24px; }
.prose a { color: var(--azul); font-weight: 700; }
.prose .btn { margin-top: 14px; }
.meta { margin-top: 28px; font-size: 14px; color: var(--tinta-2); }

/* ---------- Guia de instalação ---------- */
.sheet {
  width: 100%; max-width: 520px; margin: auto auto 0; padding: 22px 20px calc(20px + var(--safe-b));
  border: 0; border-radius: 18px 18px 0 0;
  background: var(--branco); color: var(--tinta);
}
.sheet::backdrop { background: rgba(8, 16, 30, .55); }
.sheet-t { font-family: var(--f-titulo); font-weight: 700; font-size: 28px; }
.sheet-d { margin-top: 6px; color: var(--tinta-2); }
.steps { list-style: none; margin: 14px 0 20px; padding: 0; counter-reset: passo; }
.steps li {
  display: flex; align-items: flex-start; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--linha); font-size: 17px; counter-increment: passo;
}
.steps li::before {
  content: counter(passo); flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--azul); color: #fff; font-family: var(--f-titulo); font-weight: 700; font-size: 17px;
}
.k { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; vertical-align: bottom; }
.k svg.i { width: 20px; height: 20px; color: var(--azul); }

.noscript { padding: 40px 20px; font-size: 18px; }

/* ---------- Tablet e computador: menu sempre visível ---------- */
@media (min-width: 900px) {
  .drawer { width: 300px; transform: none; visibility: visible; transition: none; }
  .scrim, .bar, .dbar .btn-ghost { display: none; }
  .dbar .sos-txt { display: inline; }
  main { margin-left: 300px; padding-bottom: 48px; }
  .sheet { margin: auto; border-radius: 18px; }
  .status .top > div { display: none; } /* o nome já está no menu */
  .status .estado { margin-top: 6px; }
}

/* Computador com ecrã baixo: menu mais compacto (rato, não dedo) */
@media (min-width: 900px) and (max-height: 900px) {
  .dtop { padding-top: calc(20px + var(--safe-t)); }
  .n { min-height: 38px; font-size: 20px; }
  .g { padding-top: 8px; }
}

@media (hover: hover) {
  .n:hover { background: rgba(255, 255, 255, .06); }
  .row:hover, .next:hover, a.ct:hover, .check:hover, .mais > summary:hover { background: rgba(11, 87, 164, .04); }
  .fig { cursor: pointer; }
  .fig:hover { border-color: var(--azul-luz); }
}

/* Movimento reduzido: as figuras ficam paradas no desenho final, que já explica o gesto. */
@media (prefers-reduced-motion: reduce) {
  .drawer, .scrim { transition: none !important; }
  .fig, .fig.play * { animation: none !important; transition: none !important; }
  .mais::details-content, .mais > summary .chev { transition: none !important; }
}
