/* Guardei — visual do app. As cores vêm do tema (data-tema no <body>). */

/* Fontes dentro do app (pasta fontes/), sem depender de site de fora */
@font-face { font-family: 'Literata'; src: url('../fontes/literata.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('../fontes/figtree.woff2') format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }

:root,
[data-tema="noite"]     { --bg:#14130f; --sf:#1d1b17; --ink:#efe9dc; --mu:#a79f8f; --ln:#322f27; --ac:#5fbf97; --aci:#0f1a15; --er:#f0907f; }
[data-tema="branco"]    { --bg:#ffffff; --sf:#f4f4f4; --ink:#1a1a1a; --mu:#5c5c5c; --ln:#e2e2e2; --ac:#1f6f54; --aci:#ffffff; --er:#b3261e; }
[data-tema="papel"]     { --bg:#f6f1e7; --sf:#fffdf8; --ink:#1d1b16; --mu:#5f594d; --ln:#e2d9c7; --ac:#1f6f54; --aci:#ffffff; --er:#b3261e; }
[data-tema="contraste"] { --bg:#000000; --sf:#111111; --ink:#ffffff; --mu:#d6d6d6; --ln:#555555; --ac:#ffd400; --aci:#000000; --er:#ff8a7a; }
[data-tema="sepia"]     { --bg:#f1e4c8; --sf:#f8eed8; --ink:#3b2f1e; --mu:#6e5c43; --ln:#dcc9a3; --ac:#9a5b2a; --aci:#ffffff; --er:#a3291f; }
[data-tema="preto"]     { --bg:#000000; --sf:#0e0e0e; --ink:#e8e8e8; --mu:#9a9a9a; --ln:#262626; --ac:#7cc4ff; --aci:#001526; --er:#f0907f; }
[data-tema="oceano"]    { --bg:#0f1b26; --sf:#16263a; --ink:#e3edf5; --mu:#93a9bd; --ln:#23384d; --ac:#4fb3d9; --aci:#04151f; --er:#f0907f; }
[data-tema="floresta"]  { --bg:#13201a; --sf:#1a2c23; --ink:#e4efe6; --mu:#98b3a0; --ln:#284034; --ac:#8fcf7a; --aci:#0e1f09; --er:#f0907f; }
[data-tema="lavanda"]   { --bg:#f3effa; --sf:#fbf9fe; --ink:#231d33; --mu:#5e5673; --ln:#ddd4ee; --ac:#6b4fbf; --aci:#ffffff; --er:#b3261e; }
[data-tema="cafe"]      { --bg:#1e1612; --sf:#2a1f19; --ink:#f0e4d7; --mu:#b39f8c; --ln:#3d2e25; --ac:#d99a5b; --aci:#1e1208; --er:#f0907f; }
[data-tema="rosa"]      { --bg:#fbf0f0; --sf:#fff8f8; --ink:#33201f; --mu:#6f5453; --ln:#f0d8d8; --ac:#b3445c; --aci:#ffffff; --er:#b3261e; }

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
}

.tela {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.tela.centro { justify-content: center; text-align: center; align-items: center; }

.marca {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ac);
}
h1 {
  margin: 2px 0 0;
  font-family: 'Literata', Georgia, serif;
  font-weight: 650;
  font-size: 30px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.suave { color: var(--mu); margin: 0; }
.rotulo {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mu);
}

/* ---------- Acesso ---------- */
.topo-acesso { margin-top: 8vh; display: flex; flex-direction: column; gap: 6px; }
.pilha { display: flex; flex-direction: column; gap: 14px; }

.campo { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.campo small { font-weight: 400; font-size: 13px; }
.campo input {
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--ln);
  border-radius: 12px;
  background: var(--sf);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  font-size: 16px;
  width: 100%;
}
.campo input::placeholder { color: var(--mu); opacity: 0.7; }
.campo input:focus-visible { outline: 2px solid var(--ac); outline-offset: 1px; border-color: transparent; }

.marcar { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--mu); min-height: 32px; }
.marcar input { width: 18px; height: 18px; accent-color: var(--ac); margin: 0; }

.botao {
  height: 50px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.botao.primario { background: var(--ac); color: var(--aci); }
.botao.contorno { background: transparent; color: var(--ink); border-color: var(--ln); }
.botao.pequeno { height: 40px; font-size: 14px; padding: 0 14px; }
.botao:disabled { opacity: 0.6; cursor: default; }
.botao:focus-visible, .link:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

.link { background: none; border: 0; padding: 6px 4px; font: inherit; font-weight: 700; color: var(--ac); cursor: pointer; }
.troca { margin: 0; text-align: center; color: var(--mu); }

.aviso { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--sf); border: 1px solid var(--ln); font-size: 14px; }
.aviso.erro { color: var(--er); }

/* ---------- Biblioteca ---------- */
.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.guardar { display: flex; flex-direction: column; gap: 10px; }

.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.item { padding: 14px 0; border-top: 1px solid var(--ln); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.item:last-child { border-bottom: 1px solid var(--ln); }
.item a {
  color: var(--ink);
  text-decoration: none;
  font-family: 'Literata', Georgia, serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.item a:hover { text-decoration: underline; }
.item .meta { font-size: 13px; color: var(--mu); }
.vazio { margin: 0; padding: 22px 16px; border: 1px dashed var(--ln); border-radius: 12px; color: var(--mu); text-align: center; }

.rodape { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--ln); display: flex; flex-direction: column; gap: 4px; font-size: 13px; overflow-wrap: anywhere; }

@media (min-width: 560px) {
  .guardar { flex-direction: row; align-items: flex-end; }
  .guardar .campo { flex: 1; }
}

/* ---------- Aviso de versão nova (APK de teste) ---------- */
.faixa {
  margin: 0;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: var(--ac);
  color: var(--aci);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.faixa a { color: inherit; font-weight: 700; text-decoration: underline; padding: 6px 4px; }
