:root {
  --acento: #e8590c;
  --acento-osc: #c2410c;
  --fondo: #f4f4f5;
  --panel: #ffffff;
  --texto: #18181b;
  --suave: #71717a;
  --borde: #d4d4d8;
  --ok: #15803d;
  --error: #b91c1c;
  --aviso: #a16207;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #18181b;
    --panel: #27272a;
    --texto: #f4f4f5;
    --suave: #a1a1aa;
    --borde: #3f3f46;
    --ok: #4ade80;
    --error: #f87171;
    --aviso: #facc15;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  padding-bottom: env(safe-area-inset-bottom);
}
header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--acento); color: #fff;
}
h1 { font-size: 1.2rem; margin: 0; }
h2 { font-size: 1rem; margin: 0 0 8px; }
main { max-width: 560px; margin: 0 auto; padding: 16px; }

form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
input, textarea, select {
  font: inherit; font-weight: 400;
  padding: 12px; border-radius: 10px;
  border: 1px solid var(--borde); background: var(--panel); color: var(--texto);
  width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--acento); border-color: transparent; }

.btn {
  display: block; width: 100%; text-align: center;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  padding: 16px; border: 0; border-radius: 12px;
  background: var(--acento); color: #fff; cursor: pointer;
}
.btn:active { background: var(--acento-osc); }
.btn:disabled { opacity: .45; }
.btn-secundario { background: var(--panel); color: var(--acento); border: 2px solid var(--acento); }
.btn-secundario:active { background: var(--fondo); }
.icon-btn { background: none; border: 0; color: #fff; font-size: 1.5rem; padding: 4px 8px; cursor: pointer; }
.link-btn { background: none; border: 0; color: var(--acento); font: inherit; font-weight: 600; padding: 4px; cursor: pointer; }
.link-carpeta { color: var(--acento); font-size: .85rem; font-weight: 600; margin-top: -8px; }
.cola li > div { flex: 1; min-width: 0; }
.cola li .descartar { color: var(--suave); font-size: .8rem; flex: none; }
.galeria { align-items: center; margin-top: -8px; font-size: .9rem; }

.gps {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: 10px; font-size: .9rem;
  background: var(--panel); border: 1px solid var(--borde);
}
.gps-ok { border-color: var(--ok); }
.gps-debil { border-color: var(--aviso); }
.gps-error { border-color: var(--error); }

.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fotos:empty { display: none; }
.foto { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--borde); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto button {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 1rem; cursor: pointer;
}

.cola { margin-top: 28px; padding: 16px; background: var(--panel); border-radius: 12px; border: 1px solid var(--borde); }
.cola ul { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cola li { display: flex; gap: 10px; align-items: center; font-size: .85rem; }
.cola li img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.cola li .err { color: var(--error); }
.ayuda { color: var(--suave); font-size: .85rem; font-weight: 400; margin: 0 0 12px; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 528px; margin: 0 auto; padding: 14px 16px; border-radius: 12px;
  background: #18181b; color: #fff; font-weight: 600; z-index: 20;
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
}

dialog {
  width: min(520px, calc(100% - 32px)); border: 0; border-radius: 14px; padding: 20px;
  background: var(--panel); color: var(--texto);
}
dialog::backdrop { background: rgba(0,0,0,.5); }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.check input { width: 22px; height: 22px; }
.fila { display: flex; gap: 10px; }
