/* Captei · LG: verde claro, neutros com leve tom de verde */
:root {
  --verde: #0b6b4a;
  --verde-claro: #e3f5ec;
  --destaque: #1fa874;
  --texto: #16241f;
  --suave: #5f6f69;
  --borda: #d5e2dc;
  --fundo: #f5f9f7;
  --card: #ffffff;
  --ok: #1d7a3e;
  --erro: #b3261e;
  --aviso: #8a5a00;
  --campo: #ffffff;
  --linha: #e6efeb;
  --chip-on: #e3f5ec;
  --privado: #f3faf6;
  --privado-borda: #bfe3d1;
  --alerta: #fff9e8;
  --alerta-borda: #e9c46a;
  --badge: #e2ebe7;
  --badge-ok: #d6efdd;
  --sobre-verde: #ffffff;
  --marca-fundo: #e3f5ec;
  --marca-linha: #bfe3d1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --verde: #5fd3a1; --verde-claro: #17372b; --destaque: #3cc58e; --texto: #e8f1ed; --suave: #9fb3ab; --borda: #2c3d36;
    --fundo: #0f1714; --card: #16211d; --ok: #6fd28f; --erro: #ff8a80; --aviso: #f2c063;
    --campo: #1b2823; --linha: #22312b; --chip-on: #17372b; --privado: #142a21; --privado-borda: #2f5a47;
    --alerta: #2b2516; --alerta-borda: #6b5520; --badge: #24332d; --badge-ok: #1f3b28; --sobre-verde: #0f1714;
    --marca-fundo: #17372b; --marca-linha: #2f5a47;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --verde: #5fd3a1; --verde-claro: #17372b; --destaque: #3cc58e; --texto: #e8f1ed; --suave: #9fb3ab; --borda: #2c3d36;
  --fundo: #0f1714; --card: #16211d; --ok: #6fd28f; --erro: #ff8a80; --aviso: #f2c063;
  --campo: #1b2823; --linha: #22312b; --chip-on: #17372b; --privado: #142a21; --privado-borda: #2f5a47;
  --alerta: #2b2516; --alerta-borda: #6b5520; --badge: #24332d; --badge-ok: #1f3b28; --sobre-verde: #0f1714;
  --marca-fundo: #17372b; --marca-linha: #2f5a47;
  color-scheme: dark;
}* { box-sizing: border-box; }
/* Elementos escondidos ficam escondidos mesmo quando a classe define display. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
body.no-scroll { overflow: hidden; }
a { color: var(--verde); }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; color: var(--verde); }
h2 small { color: var(--suave); font-weight: 400; font-size: .8rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; }

.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: .55rem 1rem; background: var(--card); color: var(--texto); border-bottom: 1px solid var(--linha);
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--texto); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .nome { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.035em; line-height: 1; }
.brand .nome .i { position: relative; display: inline-block; }
.brand .nome .i::after { content: ""; position: absolute; left: 50%; top: .02em; width: .2em; height: .2em; transform: translateX(-50%); background: var(--destaque); border-radius: 50%; }
.brand .sep { width: 1.5px; height: 18px; background: var(--marca-linha); }
.brand .lg { font-weight: 700; font-size: .85rem; color: var(--verde); letter-spacing: -0.01em; }
.net { font-size: .75rem; color: var(--suave); }
.net.off { color: var(--aviso); }

main { max-width: 640px; margin: 0 auto; padding: 1rem; }

section { scroll-margin-top: 120px; }
.card { background: var(--card); border: 1px solid var(--borda); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.card.private { border-color: var(--privado-borda); background: var(--privado); }
.card.warn { border-color: var(--alerta-borda); background: var(--alerta); }
.card.warn p { margin: .4rem 0; font-size: .9rem; }
.card.ready { border-color: var(--ok); }

.f { display: block; margin-bottom: .75rem; }
.f > span { display: block; font-size: .78rem; font-weight: 600; color: var(--suave); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .02em; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: .7rem .75rem; border: 1px solid var(--borda);
  border-radius: 10px; background: var(--campo); color: var(--texto); min-height: 46px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--verde); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }

.grid2, .grid3, .grid4, .grid-cidade { display: grid; gap: .5rem; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1fr 1fr 1fr; }
.grid4 { grid-template-columns: repeat(4, 1fr); }
.grid-cidade { grid-template-columns: 1fr 5rem; }
@media (max-width: 380px) { .grid4 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr; } }

.seg { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span {
  display: inline-block; padding: .55rem .9rem; border: 1px solid var(--verde); border-radius: 999px;
  color: var(--verde); font-weight: 600; font-size: .9rem; cursor: pointer; user-select: none; min-height: 40px; line-height: 1.6;
}
.seg input:checked + span { background: var(--verde); color: var(--sobre-verde); }
.seg input:focus-visible + span { outline: 2px solid var(--verde); outline-offset: 2px; }

.sn { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--linha); padding: .35rem 0; }
.sn > span { font-size: .95rem; }
.sn .seg { margin: 0; flex-wrap: nowrap; }
.sn .seg span { padding: .35rem .8rem; font-size: .85rem; min-height: 36px; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.chip { border: 1px solid var(--borda); background: var(--campo); border-radius: 999px; padding: .5rem .8rem; font: inherit; font-size: .88rem; color: var(--texto); }
.chip.on { background: var(--chip-on); border-color: var(--verde); color: var(--verde); font-weight: 600; }
.chip.on::before { content: "✓ "; }

.hint { font-size: .85rem; color: var(--suave); margin: .25rem 0 .75rem; }
.err { color: var(--erro); font-size: .9rem; }
.ok { color: var(--ok); font-size: .9rem; }
.total { background: var(--verde-claro); padding: .7rem; border-radius: 10px; margin: .5rem 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 44px; padding: .55rem 1rem;
  border-radius: 10px; border: 1px solid var(--verde); background: var(--card); color: var(--verde); font: inherit; font-weight: 600;
  font-size: .92rem; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--verde); color: var(--sobre-verde); }
.btn.danger-fill { background: var(--erro); border-color: var(--erro); color: var(--sobre-verde); }
.btn:focus-visible, .chip:focus-visible, .link:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
.btn.danger { border-color: var(--erro); color: var(--erro); }
.btn.ghost { border-color: transparent; color: var(--suave); }
.btn.small { min-height: 36px; padding: .3rem .6rem; font-size: .82rem; }
.btn.big { width: 100%; min-height: 52px; font-size: 1rem; margin-bottom: 1rem; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--verde); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }
.link.center { display: block; text-align: center; margin-top: 1rem; }
.row { display: flex; gap: .5rem; margin-top: .75rem; }
.row input { flex: 1; }

.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; margin: .5rem 0; }
.check input { width: 24px; height: 24px; min-height: 0; flex: none; margin-top: 2px; accent-color: var(--verde); }

.sticky {
  position: sticky; top: calc(48px + env(safe-area-inset-top)); z-index: 10; display: flex; align-items: center; gap: .5rem;
  background: var(--fundo); padding: .5rem 0; margin: -1rem 0 .75rem; font-size: .85rem; flex-wrap: wrap;
}
.back { text-decoration: none; font-weight: 600; }
.codigo { background: var(--verde); color: var(--sobre-verde); border-radius: 6px; padding: .1rem .45rem; font-weight: 700; font-size: .8rem; letter-spacing: .04em; }
.nota { flex: 1; min-width: 60px; height: 8px; background: var(--badge); border-radius: 99px; overflow: hidden; }
.nota > div { height: 100%; width: 0; background: linear-gradient(90deg, #8bc34a, #1d7a3e); transition: width .3s; }
.nota-n { font-weight: 700; }
.salvo { color: var(--ok); font-size: .75rem; width: 100%; text-align: right; margin-top: -.3rem; }

.amb { border: 1px solid var(--linha); border-radius: 12px; padding: .7rem; margin-bottom: .6rem; }
.amb-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.badge { background: var(--badge); border-radius: 99px; padding: 0 .55rem; font-size: .8rem; font-weight: 700; }
.badge.ok { background: var(--badge-ok); color: var(--ok); }
.thumbs { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: .5rem; padding-bottom: .2rem; }
.th { position: relative; padding: 0; border: 0; background: none; flex: none; }
.th img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; display: block; }
.th i { position: absolute; top: 2px; right: 4px; font-style: normal; font-size: .8rem; }
.amb-a { display: flex; gap: .4rem; flex-wrap: wrap; }

.faltam { margin: .25rem 0 0; padding-left: 1.2rem; color: var(--aviso); font-size: .92rem; }
.files { display: grid; gap: .5rem; margin-top: .25rem; }

.hello { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.empty { text-align: center; color: var(--suave); }
.item { display: flex; align-items: center; background: var(--card); border: 1px solid var(--borda); border-radius: 12px; margin-bottom: .6rem; }
.item a { flex: 1; display: grid; gap: .15rem; padding: .75rem; text-decoration: none; color: var(--texto); }
.item .codigo { justify-self: start; }
.item small { color: var(--suave); }
.status { justify-self: start; font-size: .75rem; font-weight: 700; color: var(--aviso); }
.status.pronta { color: var(--ok); }

.teste { list-style: none; padding: 0; margin: 0 0 1rem; }
.teste li { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--linha); }
.teste small { display: block; color: var(--suave); }

.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  background: #222; color: #fff; padding: .7rem 1rem; border-radius: 10px; font-size: .9rem; max-width: 90vw;
}

/* ---------- visualizador ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer-info { color: #ddd; font-size: .85rem; text-align: center; padding: .4rem; }
.viewer-bar { display: flex; gap: .5rem; justify-content: center; padding: .5rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
.viewer-bar .btn { background: #111; }

/* ---------- câmera ---------- */
.cam { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; overflow: hidden; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.on { animation: flash .25s; }
@keyframes flash { from { opacity: .8; } to { opacity: 0; } }
.cam-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: .5rem;
  padding: calc(.5rem + env(safe-area-inset-top)) .75rem .5rem; background: linear-gradient(#000a, #0000);
}
.cam-titulo { flex: 1; text-align: center; font-weight: 700; }
.cam-btn { background: #0008; color: #fff; border: 1px solid #fff6; border-radius: 99px; min-width: 44px; min-height: 40px; padding: 0 .8rem; font: inherit; font-weight: 600; }
.cam-aviso {
  position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); background: #000c; padding: .8rem 1.2rem;
  border-radius: 12px; font-size: 1.1rem; text-align: center; pointer-events: none;
}
.cam-dicas { position: absolute; top: calc(3.6rem + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; font-size: .78rem; color: #eee; text-shadow: 0 1px 2px #000; padding: 0 .5rem; }
.cam-zoom { position: absolute; left: 50%; transform: translateX(-50%); bottom: 9.5rem; display: flex; gap: .4rem; }
.cam-z { background: #0009; color: #fff; border: 1px solid #fff6; border-radius: 99px; min-width: 48px; min-height: 36px; font: inherit; font-size: .85rem; }
.cam-z.on { background: #ffd54a; color: #000; font-weight: 700; }
.cam-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); background: linear-gradient(#0000, #000a);
}
.cam-strip { flex: 1; display: flex; gap: .25rem; min-height: 48px; align-items: center; }
.cam-strip img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid #fff8; }
.cam-wait { font-size: 1.4rem; }
.cam-shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: #fff3; flex: none; }
.cam-shutter:active { background: #fff; }
.cam-done { flex: 1; max-width: 9rem; margin-left: auto; min-height: 46px; border-radius: 99px; border: 0; background: #ffd54a; color: #000; font: inherit; font-weight: 700; }
.cam-done:disabled { opacity: .4; }

@media (orientation: landscape) {
  .cam-bottom { top: 0; left: auto; flex-direction: column; justify-content: center; width: 8.5rem; padding: 1rem; background: linear-gradient(90deg, #0000, #000a); }
  .cam-strip { flex: none; flex-direction: column; }
  .cam-done { flex: none; margin: 0; width: 100%; }
  .cam-zoom { left: auto; right: 9.5rem; bottom: 50%; transform: translateY(50%); flex-direction: column; }
  .cam-top { right: 8.5rem; }
}

.cam-review { position: absolute; inset: 0; background: #111; display: flex; flex-direction: column; }
.cam-review-top { display: flex; justify-content: space-between; align-items: center; padding: calc(.8rem + env(safe-area-inset-top)) 1rem .6rem; }
.cam-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; padding: .5rem; align-content: start; }
.cam-pick { position: relative; padding: 0; border: 3px solid transparent; border-radius: 10px; background: none; overflow: hidden; }
.cam-pick img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cam-pick.on { border-color: #ffd54a; }
.cam-check {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  background: #0006; color: #000; font-weight: 800; display: grid; place-items: center;
}
.cam-pick.on .cam-check { background: #ffd54a; border-color: #ffd54a; }
.cam-warn { position: absolute; left: 0; right: 0; bottom: 0; background: #000b; color: #ffd54a; font-size: .72rem; padding: .2rem; }
.cam-review-bar { display: flex; gap: .5rem; padding: .6rem 1rem calc(.8rem + env(safe-area-inset-bottom)); }
.cam-review-bar .btn { flex: 1; background: #222; color: #fff; border-color: #555; }
.cam-review-bar .btn.primary { background: #ffd54a; color: #000; border-color: #ffd54a; }

/* ---------- confirmação ---------- */
.dlg { position: fixed; inset: 0; z-index: 80; background: #0008; display: grid; place-items: center; padding: 1rem; }
.dlg-box { background: var(--card); color: var(--texto); border-radius: 14px; padding: 1.2rem; max-width: 360px; width: 100%; }
.dlg-box p { margin: 0 0 1rem; }
.dlg-bar { display: flex; gap: .5rem; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* ---------- etapa 2: nuvem ---------- */
.lbl { display: block; font-size: .78rem; font-weight: 600; color: var(--suave); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .02em; }
.card.nuvem { display: grid; gap: .5rem; }
.nuvem-l small { display: block; color: var(--suave); }
.check.small { font-size: .85rem; margin: 0; }
.envio-status { font-size: .88rem; color: var(--suave); margin: .5rem 0 0; }
.item .envio-status { margin: 0; font-size: .78rem; }
.item.urgente { border-color: var(--erro); }
.item.urgente .status { color: var(--erro); }
.lista { margin: 0; padding-left: 1.2rem; display: grid; gap: .2rem; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .4rem; margin-bottom: .75rem; }
.galeria img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--badge); }

/* ---------- corretor único ---------- */
.links { font-size: .9rem; text-align: right; }
.item.hist { opacity: .8; }
.hist-in { display: grid; gap: .15rem; padding: .6rem .75rem; }
.hist-in small { color: var(--suave); }

/* ---------- equipe (aprovação) ---------- */
.pessoa { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-top: 1px solid var(--linha); padding-top: .5rem; flex-wrap: wrap; }
.pessoa small { display: block; color: var(--suave); }
.pessoa span { display: flex; gap: .3rem; }

/* ---------- câmera: falha ---------- */
.cam-falha { position: absolute; inset: 0; display: grid; place-content: center; gap: .75rem; padding: 2rem; text-align: center; background: #000c; color: #fff; z-index: 2; }
.cam-falha p { margin: 0 0 .5rem; font-size: 1.05rem; }
.cam-falha[hidden] { display: none; }

.cam-review-top { gap: .6rem; }
.cam-review-top b { flex: 1; }

.cam-top { z-index: 3; }

/* ---------- zoom ---------- */
.cam-zoom { flex-direction: column; align-items: center; gap: .5rem; bottom: 8.5rem; width: min(86vw, 420px); z-index: 3; }
.cam-zbtns { display: flex; gap: .4rem; }
.cam-zlinha { display: flex; align-items: center; gap: .6rem; width: 100%; background: #0007; padding: .35rem .7rem; border-radius: 99px; }
.cam-zslider { flex: 1; min-height: 0; padding: 0; border: 0; background: none; accent-color: #ffd54a; height: 28px; }
.cam-zval { color: #fff; font-weight: 700; font-size: .85rem; min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
@media (orientation: landscape) {
  .cam-zoom { right: 9.5rem; left: auto; bottom: 1rem; transform: none; width: min(50vw, 380px); }
}

/* ---------- menu lateral ---------- */
.menu-btn { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--texto); padding: .2rem .5rem .2rem 0; cursor: pointer; }
.topbar { gap: .4rem; }
.topbar .brand { margin-right: auto; }
.menu { position: fixed; inset: 0; z-index: 40; background: #0006; }
.menu-painel { position: absolute; top: 0; bottom: 0; left: 0; width: min(82vw, 320px); background: var(--card); padding: calc(1rem + env(safe-area-inset-top)) .75rem 1rem; display: flex; flex-direction: column; gap: .2rem; overflow-y: auto; box-shadow: 4px 0 24px #0003; }
.menu-topo { padding: .25rem .5rem 1rem; border-bottom: 1px solid var(--linha); margin-bottom: .5rem; }
.menu-topo small { display: block; color: var(--suave); }
.menu-item { display: flex; align-items: center; gap: .7rem; padding: .8rem .6rem; border-radius: 10px; color: var(--texto); text-decoration: none; font: inherit; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
.menu-item span:first-of-type { flex: 1; }
.menu-item:hover, .menu-item:focus-visible { background: var(--verde-claro); }
.menu-sep { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); padding: .8rem .6rem .2rem; }

/* ---------- abas da lista ---------- */
.abas { display: flex; gap: .4rem; margin-bottom: .9rem; overflow-x: auto; }
.aba { flex: 1; display: flex; align-items: center; justify-content: center; gap: .3rem; padding: .55rem .5rem; border: 1px solid var(--borda); border-radius: 10px; text-decoration: none; color: var(--texto); font-size: .85rem; white-space: nowrap; background: var(--card); }
.aba.on { border-color: var(--verde); background: var(--verde-claro); color: var(--verde); font-weight: 700; }
.sn.obrig > span { font-weight: 600; }

/* ---------- escolha da lente 0,6x ---------- */
.cam-escolha { position: absolute; left: 50%; transform: translateX(-50%); top: calc(5.5rem + env(safe-area-inset-top)); width: min(92vw, 440px); z-index: 4; background: #000d; color: #fff; border-radius: 14px; padding: .9rem; display: grid; gap: .35rem; text-align: center; }
.cam-escolha span { font-size: .88rem; color: #ddd; }
.cam-escolha small { color: #ffd54a; }
.cam-escolha-bts { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin-top: .3rem; }
.cam-escolha-bts .btn { background: #222; color: #fff; border-color: #555; }
.cam-escolha-bts .btn.primary { background: #ffd54a; color: #000; border-color: #ffd54a; }
