:root {
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --muted: #77756f;
  --grid: #e1e0d9; --border: rgba(11,11,11,.10);
  --conf: #d03b3b;      /* confirmado: sólido */
  --aberto: #c98a00;    /* em aberto: hachurado */
  --anulado: #898781;   /* anulado/arquivado: contorno tracejado */
  --accent: #0b0b0b; --on-accent: #fcfcfb;
  --good: #0a7d0a;
  --radius: 14px;
  /* bandeira */
  --verde: #009c3b; --amarelo: #ffdf00; --azul: #002776; --branco: #ffffff;
  /* etiquetas de situação (validadas: rótulo escrito sempre junto) */
  --st-inv: #d03b3b; --st-sus: #eda100; --st-del: #1baf7a; --st-arq: #6250d6; --st-anu: #898781;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a9890;
    --grid: #2c2c2a; --border: rgba(255,255,255,.10);
    --conf: #e5544f; --aberto: #fab219; --anulado: #9a9890;
    --accent: #f0efec; --on-accent: #0d0d0d; --good: #2bbf2b;
    --st-inv: #d03b3b; --st-sus: #fab219; --st-del: #199e70; --st-arq: #9085e9; --st-anu: #9a9890;
    --azul: #3d63c9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a9890;
  --grid: #2c2c2a; --border: rgba(255,255,255,.10);
  --conf: #e5544f; --aberto: #fab219; --anulado: #9a9890;
  --accent: #f0efec; --on-accent: #0d0d0d; --good: #2bbf2b;
    --st-inv: #d03b3b; --st-sus: #fab219; --st-del: #199e70; --st-arq: #9085e9; --st-anu: #9a9890;
    --azul: #3d63c9;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; overflow-x: hidden;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
a { color: inherit; }
h1 { font-size: 28px; line-height: 1.15; margin: 20px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 28px 0 8px; }
.sub { color: var(--ink-2); margin: 0 0 16px; }
.muted { color: var(--muted); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 0; }
.top a { text-decoration: none; color: var(--ink-2); font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }

/* placar fixo no topo, como no neal.fun */
.placar {
  position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: 12px 16px;
  background: var(--verde); color: var(--branco); text-align: center; border-bottom: 4px solid var(--amarelo);
  font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.placar small { display: block; font-size: 12px; font-weight: 500; opacity: .8; }

.btn {
  appearance: none; border: 0; border-radius: 999px; min-height: 44px; padding: 0 18px;
  font: 600 15px system-ui, sans-serif; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
}
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn:active { transform: scale(.97); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--border); padding: 14px; }

/* status: forma + símbolo + texto, nunca só cor */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; font: 600 13px system-ui, sans-serif; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 0; box-shadow: inset 0 0 0 1.5px var(--border);
}
.chip[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.sw { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.sw.conf { background: var(--conf); }
.sw.aberto { background: repeating-linear-gradient(45deg, var(--aberto) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1.5px var(--aberto); }
.sw.anulado { border: 2px dashed var(--anulado); background: color-mix(in srgb, var(--anulado) 25%, transparent); }

/* folha de detalhe (fonte) */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; display: none; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 75vh; overflow: auto;
  background: var(--surface); border-radius: 18px 18px 0 0; padding: 18px 16px 28px;
  transform: translateY(105%); transition: transform .25s ease;
}
.sheet.on { transform: none; }
.sheet h3 { margin: 0 0 6px; font-size: 18px; }
.sheet p { margin: 6px 0; color: var(--ink-2); }
.sheet .fonte { font-size: 13px; color: var(--muted); word-break: break-word; }
.sheet .fechar { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; color: var(--ink-2); font-size: 22px; cursor: pointer; }

.rodape { margin-top: 36px; font-size: 12px; color: var(--muted); text-align: center; }
.rodape a { color: var(--ink-2); }

/* faixa da bandeira no topo de toda página */
body::before { content: ""; display: block; height: 6px; background: linear-gradient(90deg, var(--verde) 0 40%, var(--amarelo) 40% 70%, var(--azul) 70%); }
.voltar {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--azul); color: #fff !important; font: 700 15px system-ui, sans-serif; text-decoration: none;
}
/* voltar do fim da página: discreto, no canto, pra não competir com a ação principal */
.voltar-fim { display: flex; justify-content: flex-start; margin-top: 28px; }
.voltar-fim .voltar { background: none; color: var(--ink-2) !important; font-weight: 600; font-size: 14px; padding: 0 4px; min-height: 44px; }

/* etiqueta de situação: cor + texto, nunca só cor */
.st { display: inline-flex; align-items: center; gap: 5px; font: 700 11.5px system-ui, sans-serif; padding: 3px 8px; border-radius: 999px; margin-top: 4px; color: var(--ink);
  background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--c); }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.st.investigado { --c: var(--st-inv); background: var(--st-inv); color: #fff; box-shadow: none; }
.st.investigado::before { background: #fff; animation: pulso 1.2s ease-in-out infinite; }
.st.suspeita { --c: var(--st-sus); }
.st.delacao { --c: var(--st-del); }
.st.arquivado { --c: var(--st-arq); }
.st.anulado { --c: var(--st-anu); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.st.anulado::before { background: none; border: 1.5px dashed var(--c); }
@keyframes pulso { 50% { opacity: .25; transform: scale(.6); } }
@media (prefers-reduced-motion: reduce) { .st.investigado::before { animation: none; } }
