body { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }
header { padding: 18px 16px 6px; max-width: 720px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
header .sub { margin: 0; }
.mark { width: 48px; height: 48px; flex: none; border-radius: 50%; background: #4a2e1c; color: var(--accent); display: grid; place-items: center; box-shadow: var(--shadow); }
.mark .svg { width: 26px; height: 26px; }
main { max-width: 720px; margin: 0 auto; padding: 8px 16px 16px; display: grid; gap: 14px; }
main > section { display: grid; gap: 14px; }

#login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
#login .card { max-width: 340px; width: 100%; display: grid; gap: 8px; justify-items: center; padding: 28px 20px; }
.logo { border-radius: 20px; box-shadow: var(--shadow); }
.center { text-align: center; }
.err { color: var(--err); min-height: 1.2em; margin: 0; font-weight: 600; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row input { flex: 1; }
.wrap { word-break: break-all; user-select: all; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--brown); font-weight: 600; }

/* Visor de la cámara con esquinas de enfoque */
.viewfinder { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; }
.aim { position: absolute; inset: 17%; box-shadow: 0 0 0 999px rgba(28, 20, 14, .45); border-radius: 18px; }
.aim i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--accent); }
.aim i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.aim i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.aim i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.aim i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }

/* Resultado del escaneo: tarjeta con el sello que "cae" */
.result { margin-top: 12px; padding: 14px; border-radius: 16px; border: 2px solid var(--line); display: flex; gap: 14px; align-items: center; }
.result .stamp { width: 64px; flex: none; border-color: var(--accent); color: var(--accent); background: rgba(227, 166, 33, .16); }
.result .txt strong { display: block; font-family: var(--serif); font-size: 1.1rem; }
.result.ok { border-color: var(--ok); }
.result.bad { border-color: var(--err); }
.result.bad .txt strong { color: var(--err); }
.result.reward { background: var(--accent); border-color: var(--accent); color: #2b1a0b; }
.result.reward .stamp { border-color: #2b1a0b; color: #2b1a0b; background: rgba(43, 26, 11, .1); }

.item { display: grid; gap: 4px; }
.item .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.item .name { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.item .stamps { grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 8px 0 4px; }
.item .stamp { border-width: 1.5px; }
.item .stamp, .item .stamp.on { color: var(--accent); border-color: var(--accent); }
.item .stamp:not(.on) { color: var(--dot); border-color: var(--dot); border-style: dashed; background: transparent; }
.item .stamp.on { background: rgba(227, 166, 33, .18); }
.item .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.item .actions button { flex: 1; min-width: 92px; }

ul { list-style: none; margin: 0; padding: 0; }
li { padding: 11px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; }
li:last-child { border-bottom: 0; }

.qrbox { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; line-height: 0; border: 1px solid var(--line); }

.picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.picker button { flex-direction: column; gap: 4px; padding: 10px 2px; background: transparent; color: var(--muted); border: 2px solid var(--line); box-shadow: none; font-size: .72rem; min-height: 72px; }
.picker button .svg { width: 30px; height: 30px; }
.picker button[aria-checked="true"] { border-color: var(--accent); background: rgba(227, 166, 33, .15); color: var(--brown); }

nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5;
  box-shadow: 0 -6px 18px rgba(91, 58, 36, .08);
}
nav button { background: transparent; color: var(--muted); border-radius: 0; flex-direction: column; font-size: .72rem; padding: 8px 0 6px; min-height: 62px; display: flex; gap: 3px; box-shadow: none; font-weight: 600; }
nav button .ic { width: 26px; height: 26px; display: block; }
nav button .ic .svg { width: 100%; height: 100%; }
nav button.on { color: var(--brown); }
nav button.on .ic { color: var(--accent); }
nav button.on::after { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--accent); }

.scanhint { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 12px; border: 2px dashed var(--line); border-radius: 16px; margin-bottom: 4px; }
.scanhint .big { width: 64px; height: 64px; color: var(--accent); }
.scanhint .big .svg { width: 100%; height: 100%; }
.scanhint strong { font-family: var(--serif); font-size: 1.1rem; }
#camBtn { flex: 1; }

#promoForm { display: grid; gap: 10px; }
#promoForm label, .hours label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
#promoForm .check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
#promoForm .check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brown); }
.hours { display: grid; gap: 8px; margin: 10px 0; }
.hours label { grid-template-columns: 44px 1fr; align-items: center; }
#pList li { display: grid; gap: 2px; }
#pList .t { font-family: var(--serif); font-weight: 700; }

button.small { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
#pList .actions { margin-top: 6px; }
