/* Hojas y capas: índice (listón), "Firma el libro", visor de fotos, avisos. Papel crema con tinta índigo.
   Legibilidad: textos ≥ 16 px, contraste alto, áreas táctiles ≥ 44 px; sin barras de desplazamiento visibles. */

/* ---------- hoja (índice y firma): encabezado fijo · cuerpo con scroll · barra fija abajo ---------- */
.sheet { position: absolute; inset: 0; z-index: 40; display: flex; align-items: flex-end; background: rgba(12, 9, 34, 0); transition: background .35s ease; }
.sheet.is-on { background: rgba(12, 9, 34, .55); }
.spanel { position: relative; width: 100%; height: calc(100% - 26px); display: flex; flex-direction: column; border-radius: 26px 26px 0 0; overflow: hidden;
  background: linear-gradient(180deg, #FFFBF3, #F7EEDD); color: var(--ink); transform: translateY(100%); transition: transform .38s var(--ease-soft); box-shadow: 0 -12px 40px rgba(0, 0, 0, .4); }
.sheet.is-on .spanel { transform: none; }
.rm .spanel { transition-duration: .01s; }
.sheet.is-short .spanel { height: auto; max-height: calc(100% - 26px); }
.shead { flex: none; padding: 16px 60px 10px 18px; border-bottom: 1px dashed rgba(46, 42, 90, .18); background: linear-gradient(180deg, #FFFBF3, #FFF8EC); }
.skick { margin: 0; font: 700 12px/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--theme); }
.shead h2 { margin: 3px 0 2px; font: 600 25px/1.12 var(--font-head); color: var(--ink); }
.ssub { margin: 0; font-size: 16px; color: #4B3F84; }
.chips { display: flex; gap: 6px; margin: 10px -18px 0; padding: 0 18px 2px; overflow-x: auto; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border: 1.5px solid rgba(46, 42, 90, .14); border-radius: 999px; cursor: pointer; font: 600 15px/1 var(--font-head); color: var(--ink); background: #FFFFFF; }
.chip:focus-visible { outline: 3px solid var(--theme-gold); outline-offset: 2px; }
.sclose { position: absolute; z-index: 2; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; background: rgba(46, 42, 90, .08); color: var(--ink); }
.sclose:focus-visible { outline: 3px solid var(--theme-gold); outline-offset: 2px; }
.sbody { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 22px; display: flex; flex-direction: column; gap: 12px; scroll-padding-top: 8px; }
.sbody > * { flex: none; }
.scard { position: relative; padding: 14px 14px 14px 20px; border-radius: 16px; background: #FFFFFF; box-shadow: 0 2px 0 rgba(46, 42, 90, .06), 0 8px 20px rgba(46, 42, 90, .08); font-size: 16px; line-height: 1.4; overflow: hidden; }
.scard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--stripe, var(--theme)); }
.c-date { --stripe: var(--theme-gold); } .c-place { --stripe: var(--theme-2); } .c-plan { --stripe: var(--theme-accent); } .c-dress { --stripe: var(--theme-hi); }
.c-gifts { --stripe: #FF8FA3; } .c-photos { --stripe: var(--theme-2); } .c-faq { --stripe: #B9A2FF; } .c-contact { --stripe: #9BE5B4; } .c-live { --stripe: var(--theme); }
.scard h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 600 18px/1.2 var(--font-head); color: var(--ink); }
.sic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: color-mix(in srgb, var(--stripe) 22%, #FFFFFF); color: var(--ink); }
.scard p { margin: 0; }
.sbig { font: 600 20px/1.2 var(--font-head); }
.scard .addr, .scard .note-line { color: #4B3F84; font-size: 16px; }
.scard .stickers { margin-top: 10px; }
.itin { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.itin li { display: grid; grid-template-columns: 76px 1fr; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 10px; background: #FBF5EA; font-size: 16px; }
.itin .time { font: 600 16px/1.2 var(--font-head); color: var(--theme-lo); } .itin .what { color: var(--ink); }
.gifts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.gifts li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; background: #FBF5EA; }
.gifts li.is-top { background: linear-gradient(90deg, #FFF1C6, #FFF9E6); box-shadow: inset 0 0 0 1px #F2C94C; }
.gifts .gi { color: var(--theme); display: grid; } .gifts li.is-top .gi { color: #C98A1E; }
.gifts .gt { display: flex; flex-direction: column; } .gifts .gn { font: 600 16px/1.2 var(--font-head); color: var(--ink); } .gifts .gnote { font-size: 16px; color: #5A4E8C; }
.check { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.check li { display: flex; gap: 8px; align-items: flex-start; } .check li span:first-child { color: #3DB57A; flex: none; }
.faq details { padding: 10px 0; border-top: 1px solid #EFE6D6; } .faq details:first-child { border-top: 0; padding-top: 0; }
.faq summary { min-height: 32px; cursor: pointer; font: 600 16px/1.3 var(--font-head); list-style: none; } .faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-size: 22px; line-height: 1; color: var(--theme); } .faq details[open] summary::after { content: "−"; }
.faq p { margin-top: 4px; color: #4B3F84; }
.pgrid { display: grid; gap: 6px; margin-top: 4px; grid-template-columns: repeat(3, 1fr); }
.pgrid.n1 { grid-template-columns: 1fr; } .pgrid.n2, .pgrid.n4 { grid-template-columns: repeat(2, 1fr); }
.pthumb { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: #EFE6D6; }
.pgrid.n1 .pthumb { aspect-ratio: 4 / 3; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb:focus-visible { outline: 3px solid var(--theme-gold); outline-offset: 2px; }
.sbar { flex: none; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(247, 238, 221, 0), #F7EEDD 30%); display: grid; gap: 4px; justify-items: center; border-top: 1px dashed rgba(46, 42, 90, .14); }
.sbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border: 0; border-radius: 999px; cursor: pointer; font: 600 19px/1 var(--font-head); color: var(--ink); background: #FFFFFF; }
.sbtn.is-primary { color: var(--on-theme); background: linear-gradient(180deg, var(--theme-hi), var(--theme)); box-shadow: 0 4px 0 var(--theme-lo), 0 8px 18px color-mix(in srgb, var(--theme) 35%, transparent); }
.sbtn:disabled { opacity: .55; cursor: default; }
.sbtn:active { transform: translateY(2px); }
.sbtn:focus-visible { outline: 3px solid var(--theme-gold); outline-offset: 3px; }
.sdead { margin: 0; font-size: 16px; color: #5A4E8C; }

/* ---------- firma ---------- */
.sign-box { position: relative; border-radius: 16px; background: #FFFDF6; box-shadow: inset 0 0 0 2px rgba(46, 42, 90, .08); }
.sign-box::before { content: ""; position: absolute; inset: 8px; border: 2.5px dashed color-mix(in srgb, var(--theme) 55%, #FFFFFF); border-radius: 12px; pointer-events: none; }
.sign-box::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 34px; border-bottom: 2px dotted rgba(46, 42, 90, .3); pointer-events: none; }
.sign-canvas { display: block; width: 100%; height: 150px; border-radius: 16px; cursor: crosshair; }
.sign-ph { position: absolute; left: 0; right: 0; top: 50%; margin: -12px 0 0; text-align: center; font: 700 26px/1 var(--font-hand); color: rgba(46, 42, 90, .35); pointer-events: none; transition: opacity .2s; }
.sign-box.has-ink .sign-ph { opacity: 0; }
.sign-box.is-done { box-shadow: inset 0 0 0 2px #F2C94C; }
.sign-tools { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 8px; }
.inks { display: flex; gap: 6px; }
.ink { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; background: var(--c); }
.ink[aria-checked="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--c); }
.tool { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer; font: 600 16px/1 var(--font-head); color: var(--ink); background: #FFFFFF; box-shadow: 0 0 0 1.5px #E7DCC6, 0 2px 0 #D9C7A5; }
.tool.is-done { color: var(--ink); background: #F2C94C; box-shadow: 0 2px 0 #B8841E; }
.tool:disabled { opacity: .45; cursor: default; }
.field { display: grid; gap: 4px; position: relative; }
.field label, .flbl { font: 600 16px/1.2 var(--font-head); color: var(--ink); margin: 0; }
.sheet input[type="text"], .sheet textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 2px solid #E7DCC6; background: #FFFFFF; color: var(--ink); font: 16px/1.3 var(--font-text); }
.sheet textarea { resize: none; }
.sheet input:focus, .sheet textarea:focus { outline: none; border-color: var(--theme); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme) 25%, transparent); }
.sheet ::placeholder { color: #9A8FBF; }
.left { position: absolute; right: 10px; bottom: 8px; font-size: 13px; color: #8A7FB5; }
.ferr { margin: 0; font: 600 16px/1.3 var(--font-head); color: #C2334F; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stepper { display: grid; gap: 4px; padding: 8px; border-radius: 14px; background: #FBF5EA; }
.sctl { display: flex; align-items: center; justify-content: space-between; }
.step { width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; font: 600 24px/1 var(--font-head); color: var(--on-theme); background: var(--theme); box-shadow: 0 3px 0 var(--theme-lo); }
.step:disabled { cursor: default; color: rgba(255, 255, 255, .7); background: #BDB3D6; box-shadow: 0 3px 0 #9D93B8; }
.stepper output { font: 600 24px/1 var(--font-head); color: var(--ink); min-width: 28px; text-align: center; }
.linkbtn { justify-self: center; min-height: 44px; padding: 0 6px; border: 0; background: none; cursor: pointer; font: 600 16px/1 var(--font-head); color: var(--theme-lo); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- visor de fotos ---------- */
.viewer { position: absolute; inset: 0; z-index: 45; background: rgba(10, 8, 28, .96); opacity: 0; transition: opacity .3s ease; transform: translateY(var(--drag, 0)); }
.viewer.is-on { opacity: 1; }
.v-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.v-slide { flex: 0 0 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; scroll-snap-align: center; padding: 60px 16px 80px; }
.v-slide img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 12px; border: 8px solid #FFFDF8; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.v-slide figcaption { font: 700 24px/1.2 var(--font-hand); color: var(--cream); text-align: center; }
.v-count { position: absolute; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font: 600 16px/1 var(--font-head); color: rgba(255, 247, 236, .85); }
.v-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; background: rgba(255, 247, 236, .14); color: var(--cream); }
.v-nav { position: absolute; top: 50%; width: 48px; height: 48px; margin-top: -24px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; background: rgba(255, 247, 236, .14); color: var(--cream); }
.v-prev { left: 8px; } .v-next { right: 8px; } .v-next svg { transform: scaleX(-1); }
.v-nav:disabled { opacity: .25; cursor: default; }

/* ---------- avisos ---------- */
.toast { position: absolute; left: 50%; top: 22%; z-index: 50; max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 16px; background: var(--paper); color: var(--ink); font: 600 18px/1.3 var(--font-head); text-align: center; box-shadow: 0 10px 28px rgba(0, 0, 0, .4); transform: translate(-50%, 10px) rotate(-1deg); opacity: 0; transition: opacity .3s, transform .35s var(--ease-spring); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0) rotate(-1deg); }
.notice { position: absolute; inset: 0; z-index: 55; display: grid; place-items: center; padding: 20px; background: rgba(12, 9, 34, 0); transition: background .3s; }
.notice.is-on { background: rgba(12, 9, 34, .6); }
.notice-card { width: min(340px, 100%); padding: 22px 20px 18px; border-radius: 24px; background: #FFFBF3; color: var(--ink); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); transform: scale(.92); opacity: 0; transition: transform .3s var(--ease-spring), opacity .25s; }
.notice.is-on .notice-card { transform: none; opacity: 1; }
.notice-ic { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #25D366; color: #FFFFFF; }
.notice h2 { margin: 10px 0 6px; font: 600 22px/1.2 var(--font-head); }
.notice p { margin: 0 0 10px; font-size: 16px; color: #4B3F84; }
.notice-msg { margin: 0 0 14px; padding: 10px 12px; border-radius: 14px; background: #EEF9EF; text-align: left; white-space: pre-wrap; font: 16px/1.4 var(--font-text); color: #1F3B27; }

/* ---------- depuración (?debug=1) ---------- */
.debug { position: fixed; z-index: 90; right: 8px; top: 8px; width: 248px; max-height: calc(100vh - 16px); overflow: auto; padding: 10px; border-radius: 14px; background: rgba(18, 14, 48, .92); color: #FFF7EC; font: 13px/1.3 var(--font-text); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.debug.is-min > :not(.debug-toggle) { display: none; }
.debug p { margin: 8px 0 4px; font-weight: 700; }
.debug button { min-height: 30px; margin: 2px; padding: 0 8px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; background: rgba(255, 255, 255, .08); color: inherit; cursor: pointer; }
.debug button.is-on { background: #F2C94C; color: #1E1B4B; }
.debug-toggle { width: 100%; }
.debug .fps { font: 700 18px/1 var(--font-head); }
