@font-face{font-family:'Playfair Display';font-weight:500;font-style:normal;font-display:swap;src:url(fonts/playfair-500.woff2) format('woff2')}
@font-face{font-family:'Source Sans 3';font-weight:400;font-style:normal;font-display:swap;src:url(fonts/sourcesans-400.woff2) format('woff2')}
@font-face{font-family:'Source Sans 3';font-weight:500;font-style:normal;font-display:swap;src:url(fonts/sourcesans-500.woff2) format('woff2')}
@font-face{font-family:'Source Sans 3';font-weight:600;font-style:normal;font-display:swap;src:url(fonts/sourcesans-600.woff2) format('woff2')}
/* Conceito: caderno de papel frio, tinta azul-marinho, um fio de latão para o que importa.
   Uma coluna estreita, pensada para o celular. */
:root{
  --bg:#F3F5F9; --surface:#FFFFFF; --ink:#1B2A44; --muted:#58667E; --line:#D6DCE8;
  --accent:#8B6A2B; --brass:#C9A66B; --on-brass:#1B2A44; --focus:#3E5C8A;
  --danger:#A33A3A; --ok:#2F6B4F; --tint:#EAEEF5;
  --serif:'Playfair Display',Georgia,'Times New Roman',serif;
  --sans:'Source Sans 3',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0F1828; --surface:#172338; --ink:#E6EBF3; --muted:#9BA9C0; --line:#2A3A57;
    --accent:#D8B779; --brass:#C9A66B; --on-brass:#101A2C; --focus:#8FB0E0;
    --danger:#E58A8A; --ok:#7CC4A0; --tint:#1D2B45; color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0F1828; --surface:#172338; --ink:#E6EBF3; --muted:#9BA9C0; --line:#2A3A57;
  --accent:#D8B779; --brass:#C9A66B; --on-brass:#101A2C; --focus:#8FB0E0;
  --danger:#E58A8A; --ok:#7CC4A0; --tint:#1D2B45; color-scheme:dark;
}
[hidden]{display:none!important}
*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--ink); font-family:var(--sans); font-size:17px; line-height:1.55;
  padding-block:0;
  padding-left:max(16px, env(safe-area-inset-left, 0px));
  padding-right:max(16px, env(safe-area-inset-right, 0px));
}
.wrap{max-width:560px; margin:0 auto; padding:20px 0 56px}
h1,h2{font-family:var(--serif); font-weight:500; margin:0; text-wrap:balance; letter-spacing:.005em}
h1{font-size:34px; line-height:1.15}
h2{font-size:24px; line-height:1.25}
p{margin:0}
.lead{color:var(--muted); font-size:17px; max-width:34em}
.small{font-size:14.5px; color:var(--muted)}
.eyebrow{font-size:12.5px; letter-spacing:.14em; text-transform:uppercase; color:var(--accent); font-weight:600}
:focus-visible{outline:3px solid var(--focus); outline-offset:2px; border-radius:6px}

/* barra superior */
.top{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 0 18px}
.brand{font-family:var(--serif); font-size:24px; font-weight:500}
.top nav{display:flex; gap:6px}
.link{background:none; border:0; color:var(--accent); font:inherit; font-weight:600; padding:10px 8px; cursor:pointer; min-height:44px}
.link.danger{color:var(--danger)}

/* botões */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:52px; padding:12px 18px;
  border-radius:10px; border:1px solid var(--brass); background:var(--brass); color:var(--on-brass);
  font:inherit; font-weight:600; font-size:17px; cursor:pointer}
.btn:hover{filter:brightness(1.04)}
.btn.ghost{background:transparent; color:var(--ink); border-color:var(--line)}
.btn.ghost:hover{border-color:var(--accent)}
.btn.warn{background:transparent; color:var(--danger); border-color:var(--danger)}
.btn[disabled]{opacity:.45; cursor:not-allowed}
.row{display:flex; gap:10px; flex-wrap:wrap}
.row > *{flex:1 1 150px}
.stack{display:flex; flex-direction:column; gap:16px}
.stack-lg{display:flex; flex-direction:column; gap:28px}

/* campos */
label,.lbl{display:block; font-weight:600; font-size:15.5px; margin-bottom:6px}
.hint{font-weight:400; color:var(--muted); font-size:14.5px}
input[type=text],input[type=password],input[type=date],input[type=number],textarea{
  width:100%; font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line);
  border-radius:10px; padding:12px 14px; min-height:48px}
textarea{resize:vertical; line-height:1.55}
input::placeholder,textarea::placeholder{color:var(--muted); opacity:.85}
.pin{letter-spacing:.5em; font-size:22px; text-align:center}

/* tela de PIN */
.gate{min-height:min(100vh, 760px); display:flex; flex-direction:column; justify-content:center; gap:26px; padding:28px 0}
.seal{width:44px; height:2px; background:var(--brass)}
.promise{border-left:2px solid var(--brass); padding:2px 0 2px 14px; color:var(--muted); font-size:15.5px}
.msg{min-height:1.4em; font-size:15.5px; font-weight:500}
.msg.err{color:var(--danger)} .msg.ok{color:var(--ok)}

/* resumo e filtros */
.summary{display:flex; flex-direction:column; gap:14px; padding:18px; background:var(--surface); border:1px solid var(--line); border-radius:12px}
.stats{display:flex; gap:22px; flex-wrap:wrap}
.stat b{font-family:var(--serif); font-size:30px; font-weight:500; display:block; line-height:1.1; font-variant-numeric:tabular-nums}
.stat span{font-size:14px; color:var(--muted)}
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{border:1px solid var(--line); background:transparent; color:var(--ink); font:inherit; font-size:15px; padding:8px 14px; min-height:40px; border-radius:999px; cursor:pointer}
.chip[aria-pressed="true"]{background:var(--ink); color:var(--bg); border-color:var(--ink)}

/* lista */
.list{display:flex; flex-direction:column; gap:12px; list-style:none; margin:0; padding:0}
.entry{background:var(--surface); border:1px solid var(--line); border-radius:12px; display:flex; align-items:stretch; overflow:hidden}
.entry.flag{border-color:var(--brass)}
.entry .open{flex:1; min-width:0; text-align:left; background:none; border:0; font:inherit; color:inherit; padding:14px 14px 14px 16px; cursor:pointer}
.meta{display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; margin-bottom:4px}
.tag{font-size:12.5px; letter-spacing:.12em; text-transform:uppercase; font-weight:600; color:var(--accent)}
.when{font-size:14px; color:var(--muted); font-variant-numeric:tabular-nums}
.ttl{font-family:var(--serif); font-size:19px; line-height:1.3; margin-bottom:2px; overflow-wrap:anywhere}
.snip{color:var(--muted); font-size:15.5px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere}
.taken{display:inline-block; margin-top:8px; font-size:13.5px; color:var(--ok); font-weight:600}
.flagbtn{flex:0 0 74px; border:0; border-left:1px solid var(--line); background:var(--tint); color:var(--muted); font:inherit; font-size:12.5px; line-height:1.25; padding:8px; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; font-weight:600}
.flagbtn svg{width:22px; height:22px}
.flagbtn[aria-pressed="true"]{background:var(--brass); color:var(--on-brass)}
.empty{padding:28px 18px; text-align:center; border:1px dashed var(--line); border-radius:12px; color:var(--muted)}
.empty b{font-family:var(--serif); font-weight:500; font-size:21px; color:var(--ink); display:block; margin-bottom:6px}

/* tipo (segmentado) */
.seg{display:grid; grid-template-columns:repeat(3,1fr); gap:8px}
.seg input{position:absolute; opacity:0; pointer-events:none}
.seg label{margin:0; text-align:center; padding:12px 6px; border:1px solid var(--line); border-radius:10px; font-weight:500; font-size:15.5px; cursor:pointer; background:var(--surface); line-height:1.25; display:flex; align-items:center; justify-content:center; min-height:52px}
.seg input:checked + label{background:var(--ink); color:var(--bg); border-color:var(--ink)}
.seg input:focus-visible + label{outline:3px solid var(--focus); outline-offset:2px}

.check{display:flex; gap:12px; align-items:flex-start; padding:14px; background:var(--tint); border-radius:10px; cursor:pointer}
.check input{width:22px; height:22px; margin:2px 0 0; accent-color:var(--accent); flex:none}
.check span{font-weight:500}
.panel{background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:18px}
.panel h2{font-size:21px; margin-bottom:8px}
.banner{background:var(--tint); border:1px solid var(--line); border-radius:10px; padding:10px 14px; font-size:14.5px; color:var(--muted); margin-bottom:16px}
.banner b{color:var(--ink)}
.rule{border:0; border-top:1px solid var(--line); margin:0}
.opt{display:flex; gap:12px; align-items:flex-start; padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--surface); cursor:pointer; margin-bottom:10px}
.opt input{margin-top:4px; width:20px; height:20px; accent-color:var(--accent); flex:none}
.opt:has(input:checked){border-color:var(--accent)}
.back{margin-left:-8px}
@media (prefers-reduced-motion:no-preference){ .btn,.chip,.entry{transition:border-color .15s, background-color .15s} }
@media (max-width:420px){ h1{font-size:30px} .seg label{font-size:14.5px} }
