:root {
  --fundo: #f3f5f4; --cartao: #fff; --texto: #16211f; --suave: #5d6b68; --linha: #dfe5e3;
  --marca: #14524a; --sobre-marca: #fff; --claro: #e2efec; --bom: #1c7a50; --ruim: #b3362c; --alerta: #8f5a00;
  --fundo-alerta: #fdf1d8; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0f1514; --cartao: #18211f; --texto: #e8efed; --suave: #9badA8; --linha: #2b3735;
    --marca: #58b8a6; --sobre-marca: #08211d; --claro: #1f3531; --bom: #62cf9b; --ruim: #ff8d82; --alerta: #f0bd62;
    --fundo-alerta: #33290f;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.45 system-ui, sans-serif; }
main { max-width: 680px; margin: 0 auto; padding: 12px 16px calc(84px + env(safe-area-inset-bottom)); }
header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center; align-items: center; gap: 12px;
  padding: 6px; background: var(--fundo); border-bottom: 1px solid var(--linha); }
#mes { min-width: 10em; text-align: center; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 1px solid var(--linha); border-radius: 10px; padding: 10px 14px; background: var(--cartao); cursor: pointer; min-height: 44px; }
button.forte { background: var(--marca); color: var(--sobre-marca); border-color: var(--marca); font-weight: 600; }
button.perigo { color: var(--ruim); }
button:disabled { opacity: .55; }
.seta { border: 0; background: none; font-size: 26px; line-height: 1; padding: 4px 16px; }
:focus-visible { outline: 3px solid var(--marca); outline-offset: 2px; }
nav { position: fixed; inset: auto 0 0; z-index: 3; display: flex; justify-content: space-around; background: var(--cartao);
  border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom); }
nav a { flex: 1; text-align: center; padding: 16px 2px; color: var(--suave); text-decoration: none; font-size: 14px; }
nav a.atual { color: var(--marca); font-weight: 700; box-shadow: inset 0 3px var(--marca); }
#selo { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 5px; border-radius: 10px; background: var(--ruim);
  color: var(--cartao); font-size: 12px; font-weight: 700; }
h1 { font-size: 20px; margin: 8px 0 12px; }
h2 { font-size: 15px; margin: 22px 0 8px; color: var(--suave); font-weight: 600; }
.cartao { background: var(--cartao); border: 1px solid var(--linha); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.alerta { background: var(--fundo-alerta); border-color: transparent; color: var(--texto); }
a.cartao { display: block; text-decoration: none; color: inherit; }
.linha { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.linha > :first-child { min-width: 0; overflow-wrap: anywhere; }
.linha > :last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.item { padding: 11px 0; border-bottom: 1px solid var(--linha); width: 100%; text-align: left; }
.item:last-child { border-bottom: 0; }
button.item { display: block; border-width: 0 0 1px; border-radius: 0; background: none; padding-inline: 0; }
.grande { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.suave { color: var(--suave); font-size: 14px; }
.bom { color: var(--bom); } .ruim { color: var(--ruim); } .atencao { color: var(--alerta); }
.botoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.barra { height: 8px; border-radius: 4px; background: var(--linha); overflow: hidden; margin: 6px 0 2px; }
.barra i { display: block; height: 100%; background: var(--marca); }
.barra i.estourou { background: var(--ruim); }
.vazio { text-align: center; color: var(--suave); padding: 24px 8px; }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--suave); }
label.marcar { display: flex; gap: 10px; align-items: center; color: var(--texto); min-height: 44px; }
label.marcar input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--linha);
  border-radius: 10px; background: var(--fundo); color: var(--texto); min-height: 44px; }
dialog { width: min(100%, 620px); max-width: 100%; max-height: 92dvh; margin: auto auto 0; border: 0; border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: var(--cartao); color: var(--texto); }
dialog::backdrop { background: rgb(0 0 0 / .5); }
.parte { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.codigo { word-break: break-all; font-family: ui-monospace, monospace; font-size: 13px; }
#aviso { position: fixed; inset: 16px 16px auto; width: auto; max-width: 560px;
  margin: 0 auto; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--texto); color: var(--fundo); }
.entrar { max-width: 360px; margin: 12vh auto 0; }
