/* =====================================================================
   Cabina de fotos — estilos (cabina + admin). Pensado para iPad Air 2 / Safari 15.
   ===================================================================== */
:root {
  --bg: #120f1a; --s1: #1c1727; --s2: #2a2338; --line: #3b3252;
  --tx: #f6f1ff; --mut: #a79fbd;
  --amber: #ffb84d; --pink: #ff4f8b; --ok: #3ddc97; --bad: #ff5d6c;
  --grad: linear-gradient(135deg, #ff4f8b, #ff9a4d);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--tx);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
input, textarea, select { font: inherit; color: var(--tx); -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ---------- botones ---------- */
.btn { border: 1px solid var(--line); background: var(--s2); border-radius: 14px; padding: 14px 20px; font-weight: 600; font-size: 17px; min-height: 52px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.danger { color: var(--bad); border-color: rgba(255,93,108,.4); background: rgba(255,93,108,.08); }
.btn.small { min-height: 44px; padding: 10px 14px; font-size: 15px; }
.btn.big { min-height: 60px; font-size: 19px; padding: 16px 28px; }
.btn.round { width: 52px; padding: 0; font-size: 26px; line-height: 1; }
.btn-start { border: 0; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 800; font-size: 38px; letter-spacing: .5px;
  padding: 26px 64px; box-shadow: 0 12px 40px rgba(255,79,139,.45); animation: pulse 2s ease-in-out infinite; }
.btn-start.small { font-size: 24px; padding: 20px 36px; animation: none; width: 100%; }
.btn-start:active { transform: scale(.97); }
.btn-start:disabled { opacity: .45; animation: none; box-shadow: none; }
.btn-ghost { background: transparent; border: 2px solid rgba(255,255,255,.25); color: var(--tx); border-radius: 999px; padding: 14px 28px; font-size: 18px; font-weight: 600; }
@keyframes pulse { 0%,100% { box-shadow: 0 12px 40px rgba(255,79,139,.45); transform: scale(1); } 50% { box-shadow: 0 16px 56px rgba(255,154,77,.6); transform: scale(1.035); } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: #fff; color: #1a1426; padding: 14px 22px; border-radius: 14px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 99; max-width: 86vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   CABINA
   ===================================================================== */
body.booth { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  background:
    radial-gradient(1100px 700px at 12% -5%, rgba(255,79,139,.25), transparent 60%),
    radial-gradient(900px 700px at 100% 105%, rgba(255,184,77,.18), transparent 60%),
    var(--bg); }
body.booth input { -webkit-user-select: text; user-select: text; }

#app { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center;
  padding: max(env(safe-area-inset-top), 18px) max(env(safe-area-inset-right), 22px) max(env(safe-area-inset-bottom), 18px) max(env(safe-area-inset-left), 22px); gap: 14px; }

.side { display: contents; }
.booth-title { order: 0; margin: 0; text-align: center; font-size: clamp(34px, 7vmin, 64px); line-height: 1.05; white-space: pre-line;
  text-shadow: 0 4px 24px rgba(255,79,139,.45); padding-top: 4px; }
.stage { order: 1; flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--gap, 18px); }
.action { order: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 130px; justify-content: center; }
.hint { margin: 0; color: var(--mut); font-size: 17px; }
.status { margin: 0; font-size: 34px; font-weight: 800; }

@media (orientation: landscape) {
  #app { flex-direction: row; align-items: stretch; gap: 26px; }
  .side { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 34px; width: 36%; flex: none; }
  .stage { order: 0; flex: 1; width: auto; }
  .action { order: 0; min-height: 0; }
  .booth-title { font-size: clamp(36px, 6.4vmin, 68px); }
  .btn-start { font-size: 32px; padding: 24px 48px; }
}

.viewfinder { position: relative; width: var(--vw, 400px); height: var(--vh, 400px); border-radius: 22px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 3px rgba(255,255,255,.14), 0 24px 70px rgba(0,0,0,.6); flex: none; }
.viewfinder video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.freeze { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .15s; pointer-events: none; }
.c { position: absolute; width: 34px; height: 34px; border: 0 solid rgba(255,255,255,.9); pointer-events: none; }
.c.tl { top: 14px; left: 14px; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 8px; }
.c.tr { top: 14px; right: 14px; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 8px; }
.c.bl { bottom: 14px; left: 14px; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 8px; }
.c.br { bottom: 14px; right: 14px; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 8px; }
.count { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-size: min(48vmin, 340px); font-weight: 900; color: #fff; text-shadow: 0 10px 50px rgba(0,0,0,.6); opacity: 0; }
.count.pop { animation: pop 1s ease-out forwards; }
@keyframes pop { 0% { transform: scale(1.8); opacity: 0; } 22% { transform: scale(1); opacity: 1; } 100% { transform: scale(.92); opacity: .12; } }
.flash { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-err { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(18,15,26,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 28px; text-align: center; }
.cam-err p { margin: 0; font-size: 20px; line-height: 1.4; white-space: pre-line; }

.slots { display: flex; gap: var(--gap, 18px); flex: none; }
.slot { position: relative; width: var(--sw, 100px); height: var(--sh, 100px); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.06); border: 2px dashed rgba(255,255,255,.22); }
.slot canvas { width: 100%; height: 100%; display: none; }
.slot b { position: absolute; left: 8px; top: 6px; font-size: 18px; color: rgba(255,255,255,.7); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.slot.on { border: 2px solid var(--amber); box-shadow: 0 0 24px rgba(255,184,77,.5); }
.slot.done { border: 2px solid rgba(255,255,255,.8); }
.slot.done canvas { display: block; }

/* estados */
.admin-link { position: absolute; right: 14px; bottom: 10px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; color: #fff; opacity: .16; text-decoration: none; font-size: 28px; }
.admin-frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; background: var(--bg); z-index: 60; }
#cancelBtn, #status { display: none; }
#app[data-state="counting"] #startBtn, #app[data-state="counting"] #hint, #app[data-state="counting"] .admin-link { display: none; }
#app[data-state="counting"] #cancelBtn { display: inline-block; font-size: 16px; padding: 10px 22px; opacity: .8; }
#app[data-state="counting"] #status { display: block; }

.overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #0c0912; display: none; z-index: 10; }
.overlay.center { align-items: center; justify-content: center; flex-direction: column; gap: 14px; }
#app[data-state="processing"] #processing { display: flex; }
#app[data-state="review"] #review { display: flex; align-items: center; justify-content: center; }
.big { margin: 0; font-size: 38px; font-weight: 800; }
.sub { margin: 0; font-size: 26px; color: var(--amber); font-weight: 700; }
.spinner { width: 70px; height: 70px; border-radius: 50%; border: 7px solid rgba(255,255,255,.15); border-top-color: var(--amber); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { width: 120px; height: 120px; border-radius: 50%; background: var(--ok); color: #0b2a1d; font-size: 76px; font-weight: 900; display: flex; align-items: center; justify-content: center; animation: pop2 .5s ease-out; }
@keyframes pop2 { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.review-wrap { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 5vw, 60px); width: 100%; padding: 0 28px; }
.strip-holder { flex: none; box-shadow: 0 24px 70px rgba(0,0,0,.7); background: #000; border-radius: 4px; overflow: hidden; }
.strip-canvas { width: 100%; height: 100%; display: block; }
/* Panel de la derecha: misma altura que la tira. Arriba (máx. la mitad) nombre y botones; abajo, el QR. */
.review-panel { width: min(380px, 46vw); height: var(--rh, 600px); flex: none; display: flex; flex-direction: column; }
.rp-top { height: 50%; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; padding-top: 4px; }
.rp-form, .rp-done { display: flex; flex-direction: column; gap: 10px; }
.rp-done { display: none; align-items: center; text-align: center; }
#review[data-saved="1"] .rp-form { display: none; }
#review[data-saved="1"] .rp-done { display: flex; }
.review-panel h2 { margin: 0 0 2px; font-size: clamp(22px, 3.4vmin, 30px); line-height: 1.1; }
.review-panel label { color: var(--mut); font-size: 16px; }
.review-panel input { background: #fff; color: #1a1426; border: 0; border-radius: 14px; padding: 12px 16px; font-size: 22px; font-weight: 700; width: 100%; outline: none; }
.review-panel input:focus { box-shadow: 0 0 0 4px var(--amber); }
.review-panel .btn-start.small { font-size: 20px; padding: 14px 20px; }
.review-panel .btn-ghost.small { align-self: center; font-size: 16px; padding: 10px 22px; border-width: 1.5px; }
.rp-done .check { width: 64px; height: 64px; font-size: 40px; }
.rp-done .sub { font-size: 20px; min-height: 1em; }
.rp-done .btn-start { width: 100%; }
.rp-qr { height: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.qr-canvas { display: none; background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
#review[data-qr="ready"] .qr-canvas { display: block; }
.qr-msg { margin: 0; color: var(--mut); font-size: 15px; line-height: 1.35; max-width: 100%; }
#review[data-qr="ready"] .qr-msg { color: #fff; font-weight: 600; font-size: 16px; }
.note { margin: 0; color: var(--mut); font-size: 15px; text-align: center; }

/* =====================================================================
   ADMIN
   ===================================================================== */
body.admin { overflow-y: auto; -webkit-overflow-scrolling: touch; height: auto; min-height: 100%; }
.gate { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.gate-box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: center; }
.gate-box h1 { margin: 0; font-size: 32px; }
.gate-box p { margin: 0; color: var(--mut); }
.gate-box input { text-align: center; letter-spacing: 8px; font-size: 32px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--s1); }
.gate-box .err { color: var(--bad); font-weight: 600; }
.link { color: var(--mut); text-decoration: none; padding: 10px; }

.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: max(env(safe-area-inset-top), 12px) 20px 12px; background: rgba(18,15,26,.92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.back { color: var(--amber); text-decoration: none; font-weight: 700; font-size: 18px; padding: 12px 6px; }
.tabs { display: flex; gap: 8px; margin-left: auto; }
.tab { border: 0; background: var(--s1); padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 17px; color: var(--mut); min-height: 48px; }
.tab.on { background: var(--grad); color: #fff; }
.tab b { background: rgba(255,255,255,.2); border-radius: 999px; padding: 2px 9px; margin-left: 6px; font-size: 14px; }
.content { padding: 20px; max-width: 1200px; margin: 0 auto; padding-bottom: 80px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.busy { color: var(--amber); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.card img { width: 100%; aspect-ratio: 1 / 3; object-fit: cover; border-radius: 8px; background: #000; display: block; }
.card .nm { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 6px; }
.card .tm { color: var(--mut); font-size: 13px; }
.empty { text-align: center; color: var(--mut); padding: 80px 20px; line-height: 1.6; font-size: 18px; }

.settings { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.form { display: flex; flex-direction: column; gap: 22px; }
.field > label, .field > .cap { display: block; font-weight: 700; margin-bottom: 8px; font-size: 17px; }
.field small { color: var(--mut); font-weight: 400; }
.field input[type="text"], .field input[type="date"], .field textarea, .field select { width: 100%; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 18px; outline: none; min-height: 52px; }
.field textarea { resize: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--amber); }
.row { display: flex; gap: 10px; }
.row .btn { flex: none; }
.motifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.motif { background: var(--s1); border: 2px solid var(--line); border-radius: 14px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; font-size: 15px; }
.motif i { font-style: normal; font-size: 28px; color: var(--amber); }
.motif.on { border-color: var(--amber); background: rgba(255,184,77,.12); }
.colors { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.color { display: flex; align-items: center; gap: 10px; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px 8px 8px; font-weight: 600; margin: 0 !important; }
.color input { width: 44px; height: 44px; border: 0; padding: 0; background: none; border-radius: 10px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper output { min-width: 64px; text-align: center; font-size: 44px; font-weight: 800; }
.unit { color: var(--mut); }
.seg { display: inline-flex; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 14px 26px; font-weight: 700; font-size: 17px; color: var(--mut); min-height: 52px; }
.seg button.on { background: var(--grad); color: #fff; }
.switches { display: flex; flex-direction: column; gap: 6px; }
.field > label.sw, .sw { display: flex; align-items: center; gap: 14px; font-size: 18px; padding: 10px 0; font-weight: 500; margin: 0; position: relative; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw span { width: 56px; height: 32px; border-radius: 999px; background: var(--s2); position: relative; flex: none; transition: background .2s; border: 1px solid var(--line); }
.sw span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw input:checked + span { background: var(--ok); }
.sw input:checked + span::after { transform: translateX(24px); }
.savebar { display: flex; flex-wrap: wrap; gap: 10px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.preview-col { position: sticky; top: 90px; }
.cap { color: var(--mut); font-size: 14px; margin: 0 0 8px; text-align: center; }
.preview { height: min(70vh, 640px); aspect-ratio: 1 / 3; margin: 0 auto; background: #000; box-shadow: 0 16px 50px rgba(0,0,0,.6); border-radius: 4px; overflow: hidden; }
.preview-canvas { width: 100%; height: 100%; display: block; }

/* Visor de la galería: misma pantalla que "¡Quedaron geniales!" (tira a la izquierda; arriba controles; abajo QR) */
.lb { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #08060c; z-index: 40; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lb .review-wrap { padding: 0 24px; }
.lb .strip-holder img { width: 100%; height: 100%; display: block; object-fit: contain; }
.lb .close { position: absolute; top: 8px; right: 8px; width: 42px; min-height: 42px; font-size: 18px; z-index: 3; }
.lb .rp-form { gap: 8px; }
.lb .rp-form h2 { padding-right: 46px; overflow-wrap: anywhere; }
.lb .meta { margin: 0; font-size: 14px; }
.lb .row { gap: 8px; }
.lb .row .btn, .lb .rp-form .btn { min-height: 44px; padding: 8px 14px; font-size: 16px; }
.lb .row2 { display: flex; gap: 8px; } .lb .row2 .btn { flex: 1; }
.lb-nav { display: flex; gap: 8px; } .lb-nav .btn { flex: 1; }
.lb[data-qr="ready"] .qr-canvas { display: block; }
.lb[data-qr="ready"] .qr-msg { color: #fff; font-weight: 600; font-size: 16px; }
.meta { color: var(--mut); font-size: 14px; margin: 0 0 6px; line-height: 1.45; }
.lb .rp-top { height: auto; flex: none; overflow: visible; }
.lb .rp-qr { height: auto; flex: 1 1 0; min-height: 0; }

/* Ventana de mensajes (admin) */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(8,6,12,.82); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { position: relative; background: var(--s1); border: 1px solid var(--line); border-radius: 20px; width: min(520px, 100%); max-height: 86vh; display: flex; flex-direction: column; padding: 22px 20px 20px; }
.modal-box h2 { margin: 0 0 14px; padding-right: 54px; font-size: 24px; }
.modal-box .close { position: absolute; top: 12px; right: 12px; width: 42px; min-height: 42px; font-size: 18px; }
.msg-list { overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 12px; }
.msg-item { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.msg-item p { margin: 0; font-size: 18px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-item small { display: block; margin-top: 8px; color: var(--mut); font-size: 13px; }
.msg-none { color: var(--mut); text-align: center; padding: 18px 6px; line-height: 1.5; margin: 0; }

/* Book: foto + nombre + mensajes */
.chk { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.chk input { width: 22px; height: 22px; }
.book { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.bk { display: flex; gap: 18px; background: var(--s1); border: 1px solid var(--line); border-radius: 18px; padding: 16px; break-inside: avoid; page-break-inside: avoid; }
.bk img { width: 130px; flex: none; align-self: flex-start; aspect-ratio: 1 / 3; object-fit: cover; border-radius: 6px; background: #000; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.bk-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.bk-body h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.bk-date { margin: -6px 0 0; color: var(--mut); font-size: 13px; }
.bk-msg { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--amber); }
.bk-msg p { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bk-msg footer { margin-top: 4px; color: var(--mut); font-size: 14px; }
.bk-none { margin: 0; color: var(--mut); font-style: italic; }
@media (max-width: 520px) { .book { grid-template-columns: 1fr; } .bk img { width: 100px; } }
@media print {
  body.admin { background: #fff; color: #000; }
  .bar, .toolbar, .toast { display: none !important; }
  .bk { background: #fff; border-color: #bbb; }
  .bk-date, .bk-msg footer, .bk-none { color: #555; }
  .book { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; }
  .preview-col { position: static; order: -1; }
  .preview { height: 360px; }
}

/* =====================================================================
   PÁGINA PÚBLICA DE UNA FOTO (foto.php, la que abre el QR)
   ===================================================================== */
body.pub { height: 100%; overflow: hidden; background: radial-gradient(900px 600px at 15% -5%, rgba(255,79,139,.22), transparent 60%), var(--bg); }
.pub-bgimg { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-size: cover; background-position: center; background-repeat: no-repeat; pointer-events: none; z-index: 0; }
.pub-page { z-index: 1; position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; }
.pub-page h1 { flex: none; margin: 0; padding: max(env(safe-area-inset-top), 10px) 16px 2px; text-align: center; font-size: clamp(20px, 5.5vw, 30px); line-height: 1.15; overflow-wrap: anywhere; }
.pub-stage { flex: 1 1 0; min-height: 0; position: relative; margin: 6px 16px; }
.pub-stage img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
/* barra de botones siempre fija abajo, sea cual sea el tamaño de pantalla */
.pub-bar { flex: none; display: flex; gap: 8px; padding: 8px 12px max(env(safe-area-inset-bottom), 8px); background: var(--bar, rgba(18,15,26,.97)); border-top: 1px solid var(--line); }
.pbtn { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; padding: 6px 4px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--s2); color: var(--tx); font-size: 12.5px; font-weight: 600; line-height: 1.15; text-align: center; text-decoration: none; }
.pbtn svg, .pub-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pbtn:active { transform: scale(.97); }
.pbtn:disabled { opacity: .5; }
.pbtn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.pbtn.wide { flex: none; width: 100%; flex-direction: row; gap: 8px; font-size: 16px; min-height: 48px; }
.pub-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(8,6,12,.86); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pub-modal-box { position: relative; width: min(460px, 100%); max-height: 100%; overflow-y: auto; background: var(--s1); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.pub-modal-box h2 { margin: 0; padding-right: 44px; font-size: 21px; }
.pub-modal-box input, .pub-modal-box textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 16px; outline: none; }
.pub-modal-box textarea { resize: none; }
.pub-modal-box input:focus, .pub-modal-box textarea:focus { border-color: var(--amber); }
.pub-x { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--s2); border-radius: 12px; color: var(--tx); }
.pub-toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: #fff; color: #1a1426; padding: 12px 20px; border-radius: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; max-width: 88vw; text-align: center; }
.pub-toast.show { opacity: 1; transform: translate(-50%, 0); }
.pub-status { margin: 0; min-height: 1.2em; color: var(--amber); font-size: 14px; }
.pub-miss-wrap { max-width: 520px; margin: 0 auto; padding: 60px 20px; text-align: center; }
.pub-miss { color: var(--mut); line-height: 1.5; }
.pub-spin { width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%; border: 5px solid rgba(255,255,255,.14); border-top-color: var(--pink); animation: pubspin 0.9s linear infinite; }
@keyframes pubspin { to { transform: rotate(360deg); } }
.note.off { margin: 0 0 10px; line-height: 1.4; word-break: break-word; }
.note.off.ok { color: var(--ok); }
.note.off.bad { color: var(--bad); }

.page-sample { margin: 0; padding: 22px 14px; border-radius: 12px; border: 1px solid var(--line); text-align: center; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }

/* Ajustes: secciones colapsables (encabezado distinto de las pestañas y botones) */
.sec > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; font-weight: 800; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); border-bottom: 2px solid var(--amber); cursor: pointer; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after { content: ''; width: 9px; height: 9px; border-right: 3px solid var(--amber); border-bottom: 3px solid var(--amber); transform: rotate(45deg); transition: transform .2s; margin: -4px 4px 0 0; }
.sec[open] > summary::after { transform: rotate(-135deg); margin: 4px 4px 0 0; }
.sec-body { display: flex; flex-direction: column; gap: 22px; padding-top: 22px; }
/* Fondo de la foto resultado */
.bgrow { align-items: center; flex-wrap: wrap; }
.bg-thumb { width: 44px; height: 132px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.rng { display: flex; align-items: center; gap: 14px; }
.rng input[type="range"] { flex: 1; min-width: 0; height: 32px; }
.rng output { min-width: 52px; text-align: right; font-weight: 700; font-size: 17px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.sep { display: flex; align-items: center; gap: 12px; margin: 6px 0 0; color: var(--amber); font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.sep::before, .sep::after { content: ''; flex: 1; height: 2px; background: var(--line); }
.sep small { color: var(--mut); font-weight: 400; text-transform: none; letter-spacing: 0; }
.page-sample { position: relative; overflow: hidden; }
.ps-img { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-size: cover; background-position: center; }
.ps-t { position: relative; }
