:root {
  --bg: #f4f6f7; --card: #ffffff; --tx: #14201f; --mut: #5b6b69; --linha: #dde4e3;
  --pri: #0f766e; --pri-tx: #ffffff; --ok: #15803d; --aviso: #b45309; --ruim: #b91c1c; --bar: #0f766e; --sel: #e6f3f1;
  --sombra: 0 1px 2px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1514; --card: #172120; --tx: #e6efee; --mut: #93a5a3; --linha: #2a3a38;
    --pri: #2dd4bf; --pri-tx: #06201d; --ok: #4ade80; --aviso: #fbbf24; --ruim: #f87171; --bar: #2dd4bf; --sel: #1d3532;
    --sombra: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
h1 { font-size: 1.5rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
p { margin: .3rem 0; }
a { color: var(--pri); }
code { background: var(--sel); padding: .1rem .35rem; border-radius: 6px; word-break: break-all; font-size: .85rem; }
.mut { color: var(--mut); font-size: .9rem; }
.carregando { color: var(--mut); padding: 1rem; text-align: center; }

#app { max-width: 640px; margin: 0 auto; min-height: 100vh; }
main { padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
.card { background: var(--card); border: 1px solid var(--linha); border-radius: 14px; padding: .9rem 1rem; margin: 0 0 .8rem; box-shadow: var(--sombra); }
.linha { display: flex; gap: .6rem; align-items: center; }
.linha.entre { justify-content: space-between; }
.quebra { flex-wrap: wrap; }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.grade > *, .dois > * { min-width: 0; }
.grade .grande { font-size: clamp(1rem, 5.2vw, 1.5rem); white-space: nowrap; }
.grande { font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.pos { color: var(--ok); } .neg { color: var(--ruim); } .alerta { color: var(--aviso); }

nav.baixo { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--linha); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.baixo .in { display: flex; width: 100%; max-width: 640px; }
nav.baixo a { flex: 1; text-align: center; padding: .5rem 0 .45rem; font-size: .72rem; color: var(--mut); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; }
nav.baixo a[aria-current="page"] { color: var(--pri); font-weight: 600; }
svg.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.ic.p { width: 18px; height: 18px; }

label { display: block; font-size: .85rem; color: var(--mut); margin: .5rem 0 .2rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--tx); background: var(--bg); border: 1px solid var(--linha); border-radius: 10px; padding: .6rem .7rem; min-height: 44px; }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--pri); flex: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--pri); outline-offset: 1px; }
fieldset { border: 1px solid var(--linha); border-radius: 10px; margin: .6rem 0 0; padding: .3rem .6rem .6rem; }
legend { font-size: .85rem; color: var(--mut); padding: 0 .3rem; }
.dias { display: flex; gap: .3rem; justify-content: space-between; }
.dias label { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .8rem; }
.dois { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.servico { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .35rem 0; font-size: 1rem; color: var(--tx); }

.btn { font: inherit; font-weight: 600; background: var(--pri); color: var(--pri-tx); border: 0; border-radius: 10px; padding: .6rem 1rem; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn.sec { background: transparent; color: var(--pri); border: 1px solid var(--pri); }
.btn.perigo { background: transparent; color: var(--ruim); border: 1px solid var(--ruim); }
.btn.mini { min-height: 36px; padding: .3rem .7rem; font-size: .85rem; }
.btn.cheio { width: 100%; margin-top: .8rem; }
.btn[disabled] { opacity: .55; }
.icone { background: transparent; border: 0; color: var(--mut); min-width: 40px; min-height: 40px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icone:hover { background: var(--sel); }

ul.lista { list-style: none; margin: 0; padding: 0; }
ul.lista li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--linha); }
ul.lista li:first-child { border-top: 0; }
ul.lista .corpo { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feito .titulo { text-decoration: line-through; color: var(--mut); }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--pri); background: transparent; color: var(--pri-tx); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.check[aria-pressed="true"] { background: var(--pri); }

.abas { display: flex; gap: .4rem; margin-bottom: .8rem; }
.abas button { flex: 1; font: inherit; border: 1px solid var(--linha); background: var(--card); color: var(--tx); border-radius: 10px; min-height: 40px; cursor: pointer; }
.abas button[aria-pressed="true"] { background: var(--pri); color: var(--pri-tx); border-color: var(--pri); font-weight: 600; }
.menu a { display: flex; align-items: center; justify-content: space-between; padding: .85rem 0; color: var(--tx); text-decoration: none; border-top: 1px solid var(--linha); }
.menu a:first-child { border-top: 0; }

.graf { width: 100%; height: auto; display: block; }
.graf .eixo { stroke: var(--linha); stroke-width: 1; }
.graf .alvo { stroke: var(--aviso); stroke-width: 1; stroke-dasharray: 4 3; }
.graf .kg { fill: none; stroke: var(--mut); stroke-width: 1.2; opacity: .7; }
.graf .med { fill: none; stroke: var(--pri); stroke-width: 2.4; stroke-linejoin: round; }
.graf .pt { fill: var(--mut); }
.graf text { fill: var(--mut); font-size: 9px; }
.barra { width: 100%; height: 8px; display: block; margin-top: 3px; }
.barra .fundo { fill: var(--sel); }
.barra .cheio { fill: var(--bar); }
.sel { background: var(--sel); border-radius: 10px; padding: .6rem .8rem; }

.filmes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.filme { background: var(--card); border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.filme img, .filme .semposter { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--sel); display: block; }
.filme .info { padding: .5rem .6rem; flex: 1; font-size: .85rem; }
.filme .info b { display: block; line-height: 1.2; margin-bottom: .2rem; }
.filme .acoes { display: flex; gap: .3rem; padding: 0 .5rem .5rem; }
.filme .acoes button { flex: 1; }

.auth { padding: 2rem 1rem; }
.auth .logo { width: 64px; height: 64px; border-radius: 16px; display: block; margin: 0 auto 1rem; }
.auth h1 { text-align: center; }
.erro { color: var(--ruim); font-size: .9rem; min-height: 1.2rem; margin-top: .5rem; }
.tag { display: inline-block; background: var(--sel); color: var(--pri); border-radius: 999px; padding: .05rem .55rem; font-size: .75rem; margin: .1rem .15rem .1rem 0; }
.noticia { display: block; padding: .5rem 0; border-top: 1px solid var(--linha); color: var(--tx); text-decoration: none; }
.noticia:first-of-type { border-top: 0; }
.noticia small { color: var(--mut); display: block; }
.resposta { white-space: pre-wrap; margin-top: .6rem; }
.gravando { animation: pulsa 1s infinite; }
@keyframes pulsa { 50% { opacity: .45; } }

#aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(70px + env(safe-area-inset-bottom)); max-width: 90vw; z-index: 9; pointer-events: none; }
#aviso div { background: var(--tx); color: var(--bg); padding: .6rem .9rem; border-radius: 10px; margin-top: .4rem; font-size: .9rem; }
#aviso div.erro-t { background: var(--ruim); color: #fff; }
@media (prefers-reduced-motion: reduce) { .gravando { animation: none; } }
.topo { margin-top: .6rem; }
.item-cat { margin-bottom: .5rem; }
.centro { text-align: center; }
