/* Checklist AVL — cores do logo: azul #5FB3E2, cinza #8A8484 (escurecidos nos botões para leitura com texto branco) */
:root {
  --azul: #1f78b4; --azul-claro: #5fb3e2; --cinza: #6f6a6a; --marinho: #23456a;
  --fundo: #f4f6f8; --cartao: #fff; --linha: #dde3e8; --txt: #1d2733; --mudo: #66727f;
  --ok: #1e9e5a; --fila: #e38b0a; --erro: #c62f2f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--txt); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body { min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

.topo { background: #fff; display: flex; align-items: center; gap: 14px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 3px solid var(--azul-claro); position: sticky; top: 0; z-index: 5; }
.topo .logo { height: 40px; width: auto; }
.topo h1 { margin: 0; font-size: 20px; letter-spacing: .5px; color: var(--cinza); font-weight: 800; }

.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 16px; flex: 1; }
.t2 { font-size: 20px; margin: 6px 0 10px; }
.rot { display: block; font-weight: 800; font-size: 14px; letter-spacing: 1px; color: var(--mudo); margin-bottom: 6px; }
.ajuda { color: var(--mudo); margin: 0 0 12px; }
.campo { width: 100%; font-size: 20px; padding: 12px 14px; border: 2px solid var(--linha); border-radius: 12px; background: #fff; color: var(--txt); }
.campo:focus { outline: none; border-color: var(--azul-claro); }
.campo.placa { font-size: 30px; font-weight: 800; letter-spacing: 4px; text-align: center; text-transform: uppercase; font-family: ui-monospace, "Roboto Mono", Consolas, monospace; }
.campo.placa.valida { border-color: var(--ok); }
.campo.fino { font-size: 16px; padding: 10px 12px; margin-top: 8px; }
.msg { min-height: 20px; margin: 8px 0 0; color: var(--erro); font-size: 15px; }
.msg.info { color: var(--mudo); }

.btn { display: block; width: 100%; font-size: 17px; font-weight: 800; letter-spacing: .3px; padding: 17px 12px; margin-top: 12px; border: 0; border-radius: 14px; color: #fff; cursor: pointer; }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn:disabled { opacity: .45; }
.btn.azul { background: var(--azul); }
.btn.cinza { background: var(--cinza); }
.btn.marinho { background: var(--marinho); }
.btn.sec { background: #fff; color: var(--txt); border: 2px solid var(--linha); font-weight: 700; padding: 13px 10px; }

.resumo { background: var(--cartao); border: 1px solid var(--linha); border-radius: 12px; padding: 10px 12px; margin-top: 10px; font-size: 15px; line-height: 1.5; }
.resumo b { font-size: 16px; }
.barra { height: 6px; background: #e9eef2; border-radius: 3px; overflow: hidden; margin: 2px 0 6px; }
.barra i { display: block; height: 100%; background: var(--ok); }

.cab { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--mudo); font-size: 14px; letter-spacing: .5px; }
.cab span:first-child { color: var(--txt); font-family: ui-monospace, Consolas, monospace; font-size: 17px; }

.slot { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 3/4; max-height: 58vh; padding: 0; border: 2px dashed #b9c3cc; border-radius: 14px; background: #eef2f5; color: var(--mudo); font-size: 17px; font-weight: 700; overflow: hidden; cursor: pointer; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #111; display: none; }
.slot.tem { border: 2px solid var(--ok); }
.slot.tem img { display: block; }
.slot.tem > span { display: none; }
.slot.pend { border-color: var(--fila); }
.slot em { position: absolute; left: 8px; top: 8px; font-style: normal; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 20px; color: #fff; display: none; }
.slot em.on { display: block; background: var(--fila); }
.slot em.on.av { background: var(--erro); }
.meta { color: var(--mudo); font-size: 14px; margin: 6px 0 0; min-height: 18px; }
.meta b { color: var(--erro); }

.extra { margin-top: 10px; background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 10px 12px; }
.extra summary { font-weight: 700; cursor: pointer; }
.extra summary small { color: var(--mudo); font-weight: 500; }
.chk { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 16px; }
.chk input { width: 22px; height: 22px; }

.nav { display: flex; gap: 10px; }
.nav .btn { flex: 1; }
.grade { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-top: 14px; }
.grade button { aspect-ratio: 1; border-radius: 50%; border: 2px solid #c5ced6; background: #fff; font-size: 12px; font-weight: 800; color: var(--mudo); padding: 0; cursor: pointer; }
.grade button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.grade button.fila { background: var(--fila); border-color: var(--fila); color: #fff; }
.grade button.av { box-shadow: 0 0 0 3px var(--erro); }
.grade button.atual { outline: 3px solid var(--marinho); outline-offset: 2px; }
.legenda { font-size: 12px; color: var(--mudo); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.legenda .d { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #c5ced6; vertical-align: -2px; margin-right: 4px; }
.legenda .d.ok { background: var(--ok); border-color: var(--ok); }
.legenda .d.fila { background: var(--fila); border-color: var(--fila); }
.legenda .d.av { box-shadow: 0 0 0 2px var(--erro); }

.par { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.lado h3 { font-size: 14px; margin: 0 0 6px; min-height: 36px; }
.slot.alto { aspect-ratio: 3/4; font-size: 14px; }

.rodape { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--linha); padding: 8px 16px; padding-bottom: max(8px, env(safe-area-inset-bottom)); font-size: 13px; }
.fila { position: relative; border-radius: 8px; padding: 6px 10px; overflow: hidden; }
.fila.ok { color: var(--ok); font-weight: 600; }
.fila.pendente { background: #fff4e3; color: #8a5200; cursor: pointer; }
.fila.enviando { background: #e8f3fb; color: var(--azul); }
.fila.enviando i { position: absolute; left: -40%; bottom: 0; width: 40%; height: 3px; background: var(--azul); animation: vai 1.2s linear infinite; }
@keyframes vai { to { left: 100%; } }
.fila.aviso { background: #fdecec; color: var(--erro); }
.quem { color: var(--mudo); margin-top: 4px; }
.quem a { color: var(--azul); }

.zoom { position: fixed; inset: 0; background: #000; z-index: 20; overflow: auto; touch-action: pinch-zoom pan-x pan-y; }
.zoom img { width: 100%; min-height: 100%; object-fit: contain; display: block; }
.zoom button { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 22px; font-weight: 800; }
.zoom p { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 14px; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: #1d2733; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); z-index: 30; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.erro { background: var(--erro); }
.toast.ok { background: var(--ok); }

@media (min-width: 700px) { .slot { max-height: 62vh; } }
