/* Aspeto da app Ideias, vindo da maqueta aprovada (maqueta/index.html).
   Ideia de layout: o nº é a identidade de cada ideia («a 42»), por isso é o maior elemento de cada cartão
   e transforma-se no título da ficha quando esta abre. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fontes/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fontes/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
:root {
  --tinta: #17141a;
  --tinta-suave: #6a6369;
  --papel: #f5f2f3;
  --cartao: #ffffff;
  --linha: #e6e0e3;
  --rosa: #d6205e;
  --rosa-texto: #ffffff;
  --rosa-claro: #fde6ee;
  --fonte-numero: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --fonte-texto: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nova-f: #e3ecfc; --nova-t: #1a55bd;
  --dev-f: #fcefcd; --dev-t: #7d5200;
  --pub-f: #dbf3e4; --pub-t: #0f6a3b;
  --arq-f: #ebe7e9; --arq-t: #5d5660;
  --erro-f: #fde3e3; --erro-t: #a01c1c;
  --sombra: 0 1px 2px rgba(23, 20, 26, .05), 0 6px 18px rgba(23, 20, 26, .06);
  --topo-seguro: env(safe-area-inset-top, 0px);
  --base-segura: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --tinta: #f6f0f3; --tinta-suave: #a79fa6; --papel: #131014; --cartao: #1e1a1f; --linha: #322c33;
    --rosa: #ff5c91; --rosa-texto: #22060f; --rosa-claro: #3c1825;
    --nova-f: #17294a; --nova-t: #9dc1ff; --dev-f: #3a2c0c; --dev-t: #f4c964;
    --pub-f: #123222; --pub-t: #84dfaa; --arq-f: #2c272d; --arq-t: #b6adb5;
    --erro-f: #3f1a1a; --erro-t: #ffb0b0;
    --sombra: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font: 400 16px/1.45 var(--fonte-texto); -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { display: block; flex-shrink: 0; }
:focus-visible { outline: 2.5px solid var(--rosa); outline-offset: 2px; }
.icone { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Cabeçalho e pesquisa ---------- */
.topo {
  position: sticky; top: 0; z-index: 20; background: var(--papel);
  padding: calc(10px + var(--topo-seguro)) 16px 10px; display: grid; gap: 10px;
}
.topo-linha { display: flex; align-items: center; gap: 10px; }
.marca { font: 800 30px/1 var(--fonte-numero); letter-spacing: -.02em; }
.marca span { color: var(--rosa); }
.empurra { margin-left: auto; }
.avatar {
  --c: #6a6369; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.avatar.grande { width: 42px; height: 42px; font-size: 15px; }
.avatar.topo-av { width: 44px; height: 44px; font-size: 15px; }
.pesquisa { position: relative; }
.pesquisa .icone { position: absolute; left: 14px; top: 13px; color: var(--tinta-suave); pointer-events: none; }
.pesquisa input {
  width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--linha);
  background: var(--cartao); padding: 0 14px 0 46px; font-size: 16px; outline-offset: 0;
}
.pesquisa input::placeholder { color: var(--tinta-suave); }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 1px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 13px;
  border-radius: 99px; background: var(--cartao); border: 1px solid var(--linha);
  font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s;
}
.chip small { font-size: 12px; font-weight: 600; opacity: .65; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }
.chip .icone { width: 17px; height: 17px; }
.chip.conta { background: var(--rosa-claro); color: var(--rosa); border-color: transparent; }

/* ---------- Lista de cartões ---------- */
.conteudo { padding: 4px 16px calc(112px + var(--base-segura)); max-width: 1200px; margin: 0 auto; }
.resumo { font-size: 13.5px; color: var(--tinta-suave); margin: 4px 2px 10px; }
.grelha { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr)); }
.cartao {
  display: flex; gap: 12px; background: var(--cartao); border-radius: 18px; padding: 13px 13px 12px 15px;
  box-shadow: var(--sombra); transition: transform .12s; min-width: 0;
}
.cartao:active { transform: scale(.985); }
.cartao.arquivada .cartao-corpo { opacity: .62; }
.cartao-corpo { flex: 1; min-width: 0; display: grid; gap: 6px; align-content: start; }
.cartao-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.numero { font: 800 34px/.95 var(--fonte-numero); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.numero i { font-style: normal; font-weight: 500; color: var(--rosa); margin-right: 1px; }
.cartao-texto { font-size: 15.5px; line-height: 1.36; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.onde { display: block; font-size: 12.5px; font-weight: 600; color: var(--tinta-suave); }
mark { background: var(--rosa-claro); color: inherit; border-radius: 3px; padding: 0 1px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 9px; font-size: 13px; color: var(--tinta-suave); font-weight: 500; }
.tags b { color: var(--rosa); font-weight: 600; margin-right: .5px; }
.rodape { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; font-size: 13px; color: var(--tinta-suave); }
.rodape .avatar { width: 21px; height: 21px; font-size: 9.5px; }
.rodape .ponto::before { content: "·"; margin-right: 7px; }
.resp { margin-left: auto; font-weight: 600; white-space: nowrap; }

.estado {
  display: inline-flex; align-items: center; gap: 6px; height: 25px; padding: 0 10px 0 8px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.estado svg { width: 12px; height: 12px; }
.e-nova { background: var(--nova-f); color: var(--nova-t); }
.e-dev { background: var(--dev-f); color: var(--dev-t); }
.e-pub { background: var(--pub-f); color: var(--pub-t); }
.e-arq { background: var(--arq-f); color: var(--arq-t); }

.miniatura {
  position: relative; width: 92px; height: 92px; border-radius: 13px; overflow: hidden; flex-shrink: 0;
  align-self: center; background: var(--rosa-claro); color: var(--rosa); display: grid; place-items: center;
}
.miniatura img { display: block; width: 100%; height: 100%; object-fit: cover; }
.miniatura .sobre {
  position: absolute; right: 5px; bottom: 5px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px;
  border-radius: 7px; background: rgba(15, 10, 15, .72); color: #fff; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.miniatura .sobre svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.miniatura .icone { width: 26px; height: 26px; }
.mini-onda { display: flex; align-items: center; gap: 2px; height: 46px; }
.mini-onda i { width: 3px; border-radius: 2px; background: currentColor; }
.cartao.arquivada .miniatura { opacity: .62; }
.ver-mais { display: block; width: 100%; max-width: 420px; margin: 16px auto 0; min-height: 50px; border-radius: 14px; border: 1px solid var(--linha); background: var(--cartao); font-weight: 600; }
.aviso-numero { background: var(--rosa-claro); border-radius: 12px; padding: 10px 13px; margin-bottom: 10px; font-size: 14.5px; font-weight: 600; }
.vazio { text-align: center; padding: 56px 16px; color: var(--tinta-suave); display: grid; gap: 14px; justify-items: center; }
.vazio strong { font: 800 26px/1.1 var(--fonte-numero); color: var(--tinta); }
.atalho-num {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 16px;
  background: var(--tinta); color: var(--papel); font-weight: 600;
}
.atalho-num .numero i { color: var(--rosa); }
.atalho-num .icone { margin-left: auto; }

/* ---------- Botão + e as suas três ações ---------- */
.fab {
  position: fixed; z-index: 45; right: max(18px, calc((100vw - 1200px) / 2 + 16px)); bottom: calc(20px + var(--base-segura));
  width: 66px; height: 66px; border-radius: 50%; background: var(--rosa); color: var(--rosa-texto);
  display: grid; place-items: center; box-shadow: 0 8px 22px rgba(214, 32, 94, .42); transition: transform .22s cubic-bezier(.3, 1.5, .5, 1);
}
.fab .icone { width: 30px; height: 30px; stroke-width: 2.4; }
.fab:active { transform: scale(.93); }
.fab[aria-expanded="true"] { transform: rotate(45deg); background: var(--tinta); color: var(--papel); box-shadow: none; }
.veu { position: fixed; inset: 0; z-index: 40; background: rgba(15, 10, 15, .5); opacity: 0; pointer-events: none; transition: opacity .18s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.veu.aberto { opacity: 1; pointer-events: auto; }
.leque {
  position: fixed; z-index: 44; right: max(18px, calc((100vw - 1200px) / 2 + 16px)); bottom: calc(100px + var(--base-segura));
  display: grid; gap: 11px; justify-items: end; pointer-events: none;
}
.leque button {
  display: inline-flex; align-items: center; gap: 12px; height: 60px; padding: 0 22px 0 18px; border-radius: 99px;
  background: var(--cartao); box-shadow: 0 6px 20px rgba(0, 0, 0, .22); font: 700 18px/1 var(--fonte-texto);
  opacity: 0; transform: translateY(16px) scale(.92); transition: opacity .16s, transform .24s cubic-bezier(.3, 1.4, .5, 1);
}
.leque button .icone { color: var(--rosa); width: 26px; height: 26px; }
.leque.aberto { pointer-events: auto; }
.leque.aberto button { opacity: 1; transform: none; }
.leque.aberto button:nth-child(1) { transition-delay: .07s; }
.leque.aberto button:nth-child(2) { transition-delay: .035s; }

/* ---------- Ficha ---------- */
.ficha { max-width: 720px; margin: 0 auto; padding: calc(10px + var(--topo-seguro)) 16px calc(100px + var(--base-segura)); }
.ficha-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.endereco { font-size: 13px; color: var(--tinta-suave); font-weight: 500; }
/* «Voltar» à direita e em pílula, como nas outras apps da Morepig (mais perto do polegar) */
.voltar {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 99px;
  background: var(--tinta); color: var(--papel); font-weight: 600; flex-shrink: 0;
}
.voltar .icone { width: 19px; height: 19px; stroke-width: 2.6; }
.ficha-num { font: 800 clamp(76px, 25vw, 112px)/.92 var(--fonte-numero); letter-spacing: -.045em; font-variant-numeric: tabular-nums; margin: 8px 0 12px -3px; }
.ficha-num i { font-style: normal; font-weight: 500; color: var(--rosa); margin-right: .05em; }
.ficha-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--tinta-suave); margin-bottom: 8px; }
.ficha-meta .estado { height: 34px; padding: 0 13px 0 10px; font-size: 14px; }
button.estado .seta { width: 14px; height: 14px; margin-left: 1px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ficha .tags { font-size: 14.5px; margin-bottom: 14px; }
.quem {
  display: flex; align-items: center; gap: 11px; background: var(--cartao); border-radius: 16px; padding: 11px 12px 11px 13px; box-shadow: var(--sombra); margin-bottom: 26px;
}
.quem small { display: block; font-size: 12.5px; color: var(--tinta-suave); font-weight: 500; }
.quem strong { font-weight: 600; }
.quem .sem { width: 42px; height: 42px; border-radius: 50%; border: 2px dashed var(--linha); flex-shrink: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px;
  font-weight: 700; background: var(--rosa-claro); color: var(--rosa); transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn.forte { background: var(--rosa); color: var(--rosa-texto); }
.btn.neutro { background: transparent; border: 1px solid var(--linha); color: var(--tinta); font-weight: 600; }
.btn.bloco { width: 100%; min-height: 54px; font-size: 17px; }
.btn.perigo { background: var(--erro-t); color: var(--cartao); }
.btn:disabled { opacity: .4; cursor: default; }
.quem .btn { margin-left: auto; min-height: 42px; padding: 0 14px; font-size: 14.5px; }

/* Cronologia: um fio vertical liga as linhas, de cima (ideia original) para baixo */
.cronologia { display: grid; }
.linha-c { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding-bottom: 22px; }
.linha-c::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--linha); }
.linha-c:last-child::before { display: none; }
.linha-c .avatar { width: 34px; height: 34px; font-size: 13px; }
.linha-cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 6px 0 6px; font-size: 13.5px; color: var(--tinta-suave); }
.linha-cab strong { color: var(--tinta); font-size: 15px; font-weight: 700; }
.linha-corpo { display: grid; gap: 9px; }
.linha-texto { font-size: 16.5px; line-height: 1.46; white-space: pre-line; }
.original .linha-texto { font-size: 19px; line-height: 1.38; font-weight: 500; }
.marca-orig { font-size: 11.5px; font-weight: 700; color: var(--rosa); background: var(--rosa-claro); border-radius: 6px; padding: 1px 7px; }
.linha-c.evento { padding-bottom: 18px; align-items: center; font-size: 13.5px; color: var(--tinta-suave); }
.linha-c.evento::before { top: 0; }
.linha-c.evento strong { font-weight: 600; color: var(--tinta); white-space: nowrap; }
.marca-ev { position: relative; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; justify-self: center; }
.marca-ev svg { width: 11px; height: 11px; }
.marca-ev.sem-resp { background: var(--papel); border: 2px dashed var(--linha); }
.linha-c.evento .avatar { position: relative; width: 22px; height: 22px; font-size: 10px; justify-self: center; }
.ev-data { white-space: nowrap; }
.ev-data::before { content: "·"; margin: 0 6px; }

.fotos { display: grid; gap: 4px; border-radius: 15px; overflow: hidden; grid-template-columns: repeat(2, 1fr); }
.fotos > * { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--linha); width: 100%; }
.fotos > *:only-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.fotos.tres > *:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.fotos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(15, 10, 15, .62); color: #fff; display: grid; place-items: center; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.play svg { width: 24px; height: 24px; fill: currentColor; margin-left: 3px; }
.play.pequeno { width: 40px; height: 40px; }
.play.pequeno svg { width: 18px; height: 18px; }
.etiqueta { position: absolute; left: 9px; bottom: 9px; padding: 2px 8px; border-radius: 8px; background: rgba(15, 10, 15, .72); color: #fff; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Um ficheiro a chegar, a preparar ou com erro */
.espera, .fotos > .espera { display: grid; align-content: center; gap: 7px; padding: 14px; background: var(--cartao); border-radius: 15px; box-shadow: var(--sombra); font-size: 14.5px; aspect-ratio: auto; min-height: 110px; }
.fotos > .espera { border-radius: 0; box-shadow: none; }
.espera small { color: var(--tinta-suave); font-size: 13px; }
.espera.erro strong { color: var(--erro-t); }
.espera-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.espera-acoes .btn { min-height: 42px; padding: 0 14px; font-size: 14px; }
.barra { height: 6px; border-radius: 3px; background: var(--linha); overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--rosa); border-radius: 3px; transition: width .35s; }
.barra.continua i { width: 40%; animation: vaivem 1.5s ease-in-out infinite alternate; }
@keyframes vaivem { from { margin-left: 0; } to { margin-left: 60%; } }

.audio { background: var(--cartao); border-radius: 15px; box-shadow: var(--sombra); padding: 10px 12px; display: grid; gap: 8px; }
.audio-linha { display: flex; align-items: center; gap: 11px; }
.tocar { width: 44px; height: 44px; border-radius: 50%; background: var(--rosa); color: var(--rosa-texto); display: grid; place-items: center; flex-shrink: 0; }
.tocar svg { width: 19px; height: 19px; fill: currentColor; }
.onda { display: flex; align-items: center; gap: 2.5px; height: 34px; flex: 1; min-width: 0; overflow: hidden; }
.onda i { flex: 1; max-width: 3px; min-width: 2px; border-radius: 2px; background: var(--linha); transition: background .15s; }
.onda i.on { background: var(--rosa); }
.tempo { font-size: 13px; color: var(--tinta-suave); font-variant-numeric: tabular-nums; flex-shrink: 0; font-weight: 500; }
.transcricao { font-size: 14.5px; line-height: 1.45; color: var(--tinta-suave); border-top: 1px solid var(--linha); padding-top: 8px; }
.transcricao b { display: block; font-size: 12px; font-weight: 700; color: var(--tinta-suave); margin-bottom: 2px; }
.transcricao p { color: var(--tinta); }
.transcricao p.nota { color: var(--tinta-suave); }
.transcrevendo { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tinta-suave); border-top: 1px solid var(--linha); padding-top: 8px; }
.girar { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--linha); border-top-color: var(--rosa); animation: girar .8s linear infinite; flex-shrink: 0; }
@keyframes girar { to { transform: rotate(360deg); } }

.ligacao { display: flex; align-items: center; gap: 12px; background: var(--cartao); border-radius: 15px; padding: 11px 12px; box-shadow: var(--sombra); min-width: 0; }
.ligacao > span:first-child { width: 44px; height: 44px; border-radius: 11px; background: var(--rosa-claro); color: var(--rosa); display: grid; place-items: center; flex-shrink: 0; }
.ligacao > span:last-child { min-width: 0; }
.ligacao strong { display: block; font-weight: 600; line-height: 1.25; }
.ligacao small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--tinta-suave); font-size: 13px; }

/* Discreto e longe das outras ações, no fim da ficha: apagar é de vez */
.apagar-ideia { display: block; margin: 6px auto 0; min-height: 44px; padding: 0 14px; color: var(--erro-t); font-size: 14.5px; font-weight: 600; }

/* Barra de acrescentar, parecida com a do WhatsApp que esta app substitui */
.acrescentar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: var(--papel); border-top: 1px solid var(--linha);
  padding: 8px max(10px, calc((100vw - 720px) / 2 + 10px)) calc(8px + var(--base-segura)); display: flex; align-items: flex-end; gap: 4px;
}
.acrescentar textarea { flex: 1; min-width: 0; min-height: 46px; max-height: 140px; height: 46px; border-radius: 23px; border: 1px solid var(--linha); background: var(--cartao); padding: 11px 16px; font-size: 16px; line-height: 1.35; resize: none; }
.icone-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--tinta-suave); }
.icone-btn.enviar { background: var(--rosa); color: var(--rosa-texto); margin-left: 4px; }
.so-leitura { text-align: center; color: var(--tinta-suave); font-size: 14px; padding: 10px; justify-content: center; }

/* ---------- Gravador ---------- */
.escuro { position: fixed; inset: 0; z-index: 75; background: #0e0b0f; color: #fff; display: flex; flex-direction: column; padding: calc(12px + var(--topo-seguro)) 16px calc(18px + var(--base-segura)); }
.escuro-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; }
.escuro .icone-btn { color: #fff; background: rgba(255, 255, 255, .13); }
.gravando { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gravando::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: #ff3b4e; animation: pisca 1.1s infinite; }
@keyframes pisca { 50% { opacity: .25; } }
.gravador-centro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; min-height: 0; }
.relogio { font: 800 clamp(64px, 20vw, 92px)/1 var(--fonte-numero); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.onda-viva { display: flex; align-items: center; justify-content: center; gap: 4px; height: 120px; width: 100%; max-width: 440px; overflow: hidden; }
.onda-viva i { width: 5px; min-height: 5px; border-radius: 3px; background: #ff5c91; transition: height .12s; flex-shrink: 0; }
.gravador-dica { color: rgba(255, 255, 255, .72); text-align: center; font-size: 15px; max-width: 30ch; }
.parar { width: 88px; height: 88px; border-radius: 50%; background: #ff5c91; color: #22060f; display: grid; place-items: center; margin: 0 auto; }
.parar i { width: 30px; height: 30px; border-radius: 7px; background: currentColor; }

/* ---------- Ver em ecrã inteiro ---------- */
.caixa-luz { position: fixed; inset: 0; z-index: 90; background: #0b080c; color: #fff; display: flex; flex-direction: column; animation: aparecer .15s; padding: calc(10px + var(--topo-seguro)) 12px calc(14px + var(--base-segura)); }
.caixa-luz-corpo { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; }
.caixa-luz img, .caixa-luz video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
.caixa-luz .icone-btn { color: #fff; background: rgba(255, 255, 255, .13); align-self: flex-end; }

/* ---------- Compor ---------- */
.compor { max-width: 620px; margin: 0 auto; padding: calc(10px + var(--topo-seguro)) 16px calc(100px + var(--base-segura)); display: grid; gap: 16px; }
.compor-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.compor-cab h1 { font: 800 28px/1.05 var(--fonte-numero); letter-spacing: -.02em; }
.campo { display: grid; gap: 6px; }
.campo > label, .rotulo { font-size: 13.5px; font-weight: 700; color: var(--tinta-suave); }
textarea, .entrada { width: 100%; border-radius: 14px; border: 1px solid var(--linha); background: var(--cartao); padding: 12px 14px; font-size: 16px; }
.compor textarea { min-height: 150px; line-height: 1.45; resize: vertical; }
.entrada { height: 48px; }
.nota { font-size: 13.5px; color: var(--tinta-suave); }
.tira { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tira::-webkit-scrollbar { display: none; }
.tira > div { position: relative; width: 112px; height: 112px; border-radius: 13px; overflow: hidden; flex-shrink: 0; background: var(--linha); }
.tira img, .tira video { display: block; width: 100%; height: 100%; object-fit: cover; }
.tira-tirar { position: absolute; top: 5px; right: 5px; width: 30px; height: 30px; border-radius: 50%; background: rgba(15, 10, 15, .72); color: #fff; display: grid; place-items: center; }
.tira-tirar .icone { width: 15px; height: 15px; stroke-width: 3; }
.adicionar { display: flex; gap: 8px; }
.adicionar .btn { flex: 1; min-height: 52px; padding: 0 6px; font-size: 14.5px; font-weight: 600; }
/* Um botão que abre o escolher ficheiro do telemóvel */
.escolher { position: relative; overflow: hidden; cursor: pointer; }
.escolher input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.nova-tag { display: flex; gap: 8px; margin-top: 2px; }
.nova-tag .entrada { flex: 1; min-width: 0; }
.nova-tag .btn { flex-shrink: 0; }
.chips-livres { display: flex; flex-wrap: wrap; gap: 7px; }
.fixo-base { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: var(--papel); border-top: 1px solid var(--linha); padding: 10px 16px calc(10px + var(--base-segura)); }
.fixo-base > div { max-width: 588px; margin: 0 auto; }

/* ---------- Folhas, confirmação e avisos ---------- */
.folha {
  position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; max-height: 88%; overflow-y: auto; background: var(--cartao); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(18px + var(--base-segura)); display: grid; gap: 14px; animation: subir .24s cubic-bezier(.2, .9, .3, 1);
  max-width: 560px; margin: 0 auto;
}
@keyframes subir { from { transform: translateY(40px); opacity: 0; } }
.puxador { width: 40px; height: 4px; border-radius: 2px; background: var(--linha); justify-self: center; }
.folha h2 { font: 800 25px/1.1 var(--fonte-numero); letter-spacing: -.015em; }
.folha .texto { color: var(--tinta-suave); }
.folha-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.veu-folha { position: fixed; inset: 0; z-index: 65; background: rgba(15, 10, 15, .5); animation: aparecer .18s; }
@keyframes aparecer { from { opacity: 0; } }
.opcao { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--linha); text-align: left; font-weight: 600; }
.opcao[aria-pressed="true"] { border: 2px solid var(--rosa); background: var(--rosa-claro); }
.opcao small { display: block; font-size: 13px; font-weight: 400; color: var(--tinta-suave); }
.lista-opcoes { display: grid; gap: 8px; }
.resumo-conf { background: var(--papel); border-radius: 13px; padding: 11px 13px; font-size: 14.5px; display: grid; gap: 3px; white-space: pre-line; }
.aviso-toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(100px + var(--base-segura)); translate: -50% 0; max-width: calc(100vw - 32px); background: var(--tinta); color: var(--papel);
  padding: 11px 17px; border-radius: 13px; font-weight: 600; font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); animation: subir .22s; text-align: center;
}

/* ---------- Entrar ---------- */
.entrar { min-height: 100dvh; display: grid; align-content: center; gap: 22px; max-width: 400px; margin: 0 auto; padding: 24px 20px; }
.entrar .marca { font-size: 58px; }
.entrar p { color: var(--tinta-suave); }
.entrar-form { display: grid; gap: 18px; }
.aviso-entrar { background: var(--rosa-claro); padding: 11px 13px; border-radius: 12px; font-weight: 600; }
.entrar p.aviso-entrar { color: var(--tinta); }
.entrar p.aviso-entrar.erro { background: var(--erro-f); color: var(--erro-t); }
.manter { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.manter input { width: 24px; height: 24px; accent-color: var(--rosa); flex-shrink: 0; }

/* Transição do nº entre o cartão e a ficha */
::view-transition-group(*) { animation-duration: .28s; animation-timing-function: cubic-bezier(.25, .9, .3, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 720px) {
  .topo { padding-left: max(16px, calc((100vw - 1200px) / 2 + 16px)); padding-right: max(16px, calc((100vw - 1200px) / 2 + 16px)); }
  .chips { margin: 0; padding: 1px 0; }
}
