/* =========================================================
   Club de Cliente Frecuente · sistema visual común
   Vidrio de frasco de perfume: fondo con luz de color, superficies
   translúcidas y un solo elemento protagonista: el pase con sus sellos.
   Los colores de marca (--pri, --acc…) los escribe css_marca() en PHP.
   ========================================================= */
:root {
  --fondo: #f4f4f5;
  --tx: #18181b;
  --tx2: #52525b;
  --tx3: #71717a;
  --sup: rgba(255, 255, 255, .72);
  --sup-fuerte: rgba(255, 255, 255, .92);
  --sup-hundida: rgba(24, 24, 27, .055);
  --borde: rgba(24, 24, 27, .12);
  --borde-fuerte: rgba(24, 24, 27, .24);
  --campo: rgba(255, 255, 255, .85);
  --vidrio: rgba(250, 250, 250, .74);
  --sombra-1: 0 1px 2px rgba(24, 24, 27, .05), 0 6px 20px rgba(24, 24, 27, .06);
  --sombra-2: 0 2px 6px rgba(24, 24, 27, .08), 0 18px 50px rgba(24, 24, 27, .14);
  --ok-f: rgba(22, 150, 85, .12); --ok-t: #0d6b3b;
  --mal-f: rgba(214, 48, 40, .1); --mal-t: #a8241c;
  --inf-f: rgba(214, 150, 20, .14); --inf-t: #7a5300;
  --tinte-acc: var(--acc-a15);
  --tx-acc: var(--acc-texto);
  --tx-pri: var(--pri-texto);
  --fuente: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --titulo: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --rapido: .16s cubic-bezier(.2, .7, .3, 1);
  --suave: .28s cubic-bezier(.2, .8, .2, 1);
  --resorte: .5s cubic-bezier(.3, 1.5, .5, 1);
  color-scheme: light;
  interpolate-size: allow-keywords;
}
:root[data-tema=oscuro] {
  --fondo: #0f0f11;
  --tx: #f4f4f5;
  --tx2: #b4b4bb;
  --tx3: #8e8e96;
  --sup: rgba(255, 255, 255, .06);
  --sup-fuerte: #1c1c1f;
  --sup-hundida: rgba(255, 255, 255, .055);
  --borde: rgba(255, 255, 255, .1);
  --borde-fuerte: rgba(255, 255, 255, .22);
  --campo: rgba(255, 255, 255, .07);
  --vidrio: rgba(22, 22, 24, .74);
  --sombra-1: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .2);
  --sombra-2: 0 2px 8px rgba(0, 0, 0, .35), 0 24px 60px rgba(0, 0, 0, .45);
  --ok-f: rgba(50, 200, 120, .15); --ok-t: #7fe3ae;
  --mal-f: rgba(255, 90, 80, .15); --mal-t: #ffaaa3;
  --inf-f: rgba(245, 190, 70, .15); --inf-t: #f6d27f;
  --tx-acc: var(--acc-claro);
  --tx-pri: #f4f4f5;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--fondo); scroll-padding: 80px 0 110px; }
body {
  margin: 0; font-family: var(--fuente); font-size: 15px; line-height: 1.5; color: var(--tx);
  -webkit-font-smoothing: antialiased; touch-action: manipulation; min-height: 100dvh; overscroll-behavior-y: none;
}
/* La luz de fondo: gradientes fijos, sin filtros, para que el teléfono no sufra al desplazar. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 44vmax at 4% -6%, var(--acc-a25), transparent 70%),
    radial-gradient(50vmax 40vmax at 100% 6%, rgba(242, 181, 68, .2), transparent 70%),
    radial-gradient(70vmax 50vmax at 80% 108%, var(--pri-a25), transparent 72%);
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--tx-acc); text-underline-offset: 2px; }
button, summary, .btn, .tab, .nav-item { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
:focus-visible { outline: 2.5px solid var(--tx-acc); outline-offset: 2px; }

h1, h2, .num { font-family: var(--titulo); font-optical-sizing: auto; }
h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 700; letter-spacing: -.022em; line-height: 1.12; margin: 2px 0 14px; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.012em; line-height: 1.25; margin: 0 0 12px; }
.suave { color: var(--tx2); }
.nowrap { white-space: nowrap; }
.en-linea { display: inline; margin: 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.grande { width: 26px; height: 26px; }

/* ---------- Botones ---------- */
.btn, .btn-pri, .btn-sec {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative; min-height: 44px;
  border: 1px solid var(--borde-fuerte); background: var(--sup-fuerte); color: var(--tx);
  font: inherit; font-weight: 600; font-size: 14.5px; line-height: 1.2; padding: 10px 16px; border-radius: 14px;
  cursor: pointer; text-decoration: none;
  transition: transform var(--rapido), background-color var(--rapido), border-color var(--rapido), box-shadow var(--rapido), opacity var(--rapido);
}
.btn:active, .btn-pri:active, .btn-sec:active { transform: scale(.965); }
@media (hover: hover) {
  .btn:hover, .btn-sec:hover { border-color: var(--tx3); }
  .btn.pri:hover, .btn-pri:hover { box-shadow: 0 8px 26px var(--acc-a40); transform: translateY(-1px); }
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.pri, .btn-pri {
  background: linear-gradient(135deg, var(--acc), var(--acc-osc)); border-color: transparent; color: var(--sobre-acc);
  box-shadow: 0 4px 16px var(--acc-a25), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.oscuro { background: var(--pri); border-color: transparent; color: var(--sobre-pri); }
:root[data-tema=oscuro] .btn.oscuro { background: rgba(255, 255, 255, .13); color: var(--tx); }
.btn.rojo { background: var(--mal-f); border-color: transparent; color: var(--mal-t); }
.btn.wa { background: #17a24f; border-color: transparent; color: #fff; }
.btn.wa.suave { background: var(--ok-f); color: var(--ok-t); }
.btn.grande, .btn-pri, .btn-sec { width: 100%; min-height: 52px; padding: 13px 18px; font-size: 16px; border-radius: 16px; }
.btn.enorme { width: 100%; min-height: 72px; padding: 18px; font-size: 18px; font-weight: 700; border-radius: 22px; }
.btn.chico { min-height: 36px; padding: 6px 11px; font-size: 13px; border-radius: 11px; }
.btn.chico .ico { width: 16px; height: 16px; }
.btn[aria-busy=true] { color: transparent; }
.btn[aria-busy=true]::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--sobre-acc); border-right-color: transparent; animation: girar .7s linear infinite;
}
.btn[aria-busy=true] .ico { opacity: 0; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Avisos ---------- */
.alerta, .aviso { border-radius: 16px; padding: 12px 15px; font-size: 14px; font-weight: 500; }
.alerta .btn { margin-top: 9px; display: inline-flex; }
.alerta.ok, .aviso.ok { background: var(--ok-f); color: var(--ok-t); }
.alerta.error, .aviso.error { background: var(--mal-f); color: var(--mal-t); }
.alerta.info, .aviso.info { background: var(--inf-f); color: var(--inf-t); }
.alerta.premio { background: var(--tinte-acc); color: var(--tx-acc); font-weight: 600; }

/* Notificaciones flotantes */
.toasts { position: fixed; z-index: 70; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toasts .alerta {
  pointer-events: auto; width: min(100%, 520px); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; background: var(--sup-fuerte);
  border: 1px solid var(--borde); box-shadow: var(--sombra-2); animation: caer var(--resorte) both; cursor: pointer;
}
.toasts .alerta.ok { color: var(--ok-t); } .toasts .alerta.error { color: var(--mal-t); }
.toasts .alerta.info { color: var(--inf-t); } .toasts .alerta.premio { color: var(--tx-acc); }
.toasts .alerta.fuera { opacity: 0; transform: translateY(-14px) scale(.97); transition: opacity var(--suave), transform var(--suave); }
.toasts .alerta::before { content: ''; flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: currentColor; }
.toasts .alerta > span { flex: 1; }
@keyframes caer { from { opacity: 0; transform: translateY(-24px) scale(.96); } }

/* ---------- Formularios ---------- */
input, select, textarea { font: inherit; color: inherit; }
.campo, .form input[type=text], .form input[type=tel], .form input[type=password], .form input[type=search], .form input[type=number], .form input[type=url], .form input[type=date],
.form select, .form textarea, .tarjeta-form input[type=text], .tarjeta-form input[type=tel], .tarjeta-form select, .filtros input, .filtros select, .selector-tienda select {
  display: block; width: 100%; min-height: 48px; margin-top: 6px; font-size: 16px; font-weight: 500; color: var(--tx); padding: 11px 14px;
  border: 1px solid var(--borde-fuerte); border-radius: 14px; background-color: var(--campo); outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color var(--rapido), box-shadow var(--rapido), background-color var(--rapido);
}
.form textarea { font-size: 14.5px; font-weight: 400; line-height: 1.5; min-height: 136px; resize: vertical; }
select, .form select, .tarjeta-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px;
}
:root[data-tema=oscuro] option { background: #1c1c1f; color: #f4f4f5; }
input:focus, select:focus, textarea:focus { border-color: var(--acc) !important; box-shadow: 0 0 0 4px var(--acc-a25); }
input::placeholder, textarea::placeholder { color: var(--tx3); opacity: .8; font-weight: 400; }
.form input:disabled { background: var(--sup-hundida); color: var(--tx3); }

/* Celular con su país: a la vista la bandera y el código; encima, invisible, la lista del teléfono. */
.campo-tel { margin-bottom: 14px; }
.tarjeta-form .campo-tel > label, .form .campo-tel > label { margin-bottom: 0; }
.tel-fila { display: flex; gap: 8px; margin-top: 6px; }
.tarjeta-form .tel-fila input[type=tel], .form .tel-fila input[type=tel] { margin-top: 0; flex: 1 1 auto; min-width: 0; }
.tel-pais {
  position: relative; flex: none; display: inline-flex; align-items: center; min-height: 48px; padding: 0 34px 0 13px;
  border: 1px solid var(--borde-fuerte); border-radius: 14px; background-color: var(--campo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2371717a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  font-size: 16px; font-weight: 600; color: var(--tx); white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: border-color var(--rapido), box-shadow var(--rapido);
}
.tel-pais:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-a25); }
.tel-pais-ver { display: inline-flex; align-items: center; gap: 6px; }
.tel-iso { font-size: 12px; font-weight: 700; letter-spacing: .03em; line-height: 1; padding: 4px 5px; border-radius: 6px; background: var(--sup-hundida); color: var(--tx2); }
.tarjeta-form .tel-pais select, .form .tel-pais select {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer;
}
input[type=file] { display: block; width: 100%; max-width: 100%; margin-top: 6px; font-size: 13.5px; color: var(--tx2); }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; color: var(--tx); background: var(--sup-hundida); border: 1px solid var(--borde-fuerte); border-radius: 11px; padding: 8px 12px; margin-right: 10px; cursor: pointer;
}

/* Interruptores: todas las casillas de sí o no. */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 48px; height: 29px; margin: 0; border-radius: 29px; cursor: pointer;
  background: var(--borde-fuerte); transition: background-color var(--suave);
}
input[type=checkbox]::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform var(--suave), width var(--rapido);
}
input[type=checkbox]:active::after { width: 28px; }
input[type=checkbox]:checked { background: var(--acc); }
input[type=checkbox]:checked::after { transform: translateX(19px); }
input[type=checkbox]:checked:active::after { transform: translateX(14px); }
.casilla { display: flex !important; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 14px; font-weight: 500 !important; font-size: 14.5px !important; padding: 10px 0; color: var(--tx) !important; cursor: pointer; }
.casilla small { font-weight: 400; display: block; margin-top: 2px; }

/* Plegables con apertura suave */
summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
summary::-webkit-details-marker { display: none; }
details:not(.canje-det, .anular) > summary::after {
  content: ''; flex: none; width: 9px; height: 9px; margin: 0 4px 3px 0; border-right: 2px solid var(--tx3); border-bottom: 2px solid var(--tx3);
  transform: rotate(45deg); transition: transform var(--suave);
}
details[open]:not(.canje-det, .anular) > summary::after { transform: translateY(3px) rotate(-135deg); }
details::details-content { block-size: 0; overflow: clip; transition: block-size var(--suave), content-visibility var(--suave) allow-discrete; }
details[open]::details-content { block-size: auto; }

/* ---------- Tema ---------- */
.tema-btn {
  display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; flex: none; padding: 0; border: 0; border-radius: 50%;
  color: var(--tx); background: var(--sup-hundida); cursor: pointer; transition: transform var(--rapido), background-color var(--rapido);
}
.tema-btn:active { transform: scale(.88) rotate(-20deg); }
.tema-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tema-btn .luna { display: none; }
:root[data-tema=oscuro] .tema-btn .luna { display: block; }
:root[data-tema=oscuro] .tema-btn .sol { display: none; }

/* Los logos llevan fondo propio: van siempre sobre una ficha clara. */
.logos { display: flex; align-items: center; gap: 10px; }
.logos img { display: block; height: 52px; width: auto; max-width: 100%; object-fit: contain; border-radius: 13px; background: #fff; box-shadow: var(--sombra-1); }

/* ---------- El pase: la tarjeta de sellos ---------- */
.pase {
  position: relative; overflow: hidden; isolation: isolate; color: var(--sobre-pri); border-radius: 28px; padding: 20px 18px 18px;
  background: linear-gradient(155deg, var(--pri-osc), var(--pri) 55%, var(--pri-osc));
  box-shadow: 0 2px 6px var(--pri-a25), 0 22px 50px -10px var(--pri-a50), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.pase::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(90% 75% at 100% 0%, var(--acc-a50), transparent 62%),
    radial-gradient(70% 60% at 0% 110%, rgba(242, 181, 68, .24), transparent 65%);
}
:root[data-tema=oscuro] .pase { outline: 1px solid rgba(255, 255, 255, .12); outline-offset: -1px; }
.pase-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.pase-club { font-size: 14px; font-weight: 600; opacity: .85; line-height: 1.25; min-width: 0; }
.pase-cuenta { font-family: var(--titulo); font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.pase-cuenta small { font-size: 16px; font-weight: 500; opacity: .75; letter-spacing: 0; }
.pase-barra { height: 5px; border-radius: 5px; background: rgba(127, 127, 127, .35); margin: 16px 0 0; overflow: hidden; }
.pase-barra i { display: block; height: 100%; width: var(--p, 0%); border-radius: 5px; background: linear-gradient(90deg, var(--acc), #f2b544); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.pase-pie { margin-top: 13px; font-size: 14px; }
.pase-pie p { margin: 0; }
.pase .plazo { margin: 3px 0 0; font-size: 13px; opacity: .85; }
.pase .plazo.urgente { opacity: 1; font-weight: 700; color: #ffd48a; }

.sellos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 14px 6px; }
.sello { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.sello-img {
  position: relative; width: min(100%, 58px); aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--titulo); font-weight: 650; font-size: 14px;
}
.sello.lleno .sello-img { background: var(--c, #fff); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px var(--c, #fff), 0 5px 14px rgba(0, 0, 0, .35); }
.sello.lleno .sello-img img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sello.vacio .sello-img { border: 1.5px dashed currentColor; opacity: .5; }
.sello.premio .sello-img { background: linear-gradient(135deg, #f2b544, var(--acc)); color: #18181b; font-weight: 800; box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .85), 0 0 22px rgba(242, 181, 68, .45); }
.sello-tienda { font-size: 11px; font-weight: 600; margin-top: 6px; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; }
/* Completó la tarjeta: el descuento lo espera en su próxima compra. */
.sello.premio.listo .sello-img { box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--acc), 0 0 26px rgba(242, 181, 68, .75); }
.sello.premio.listo .sello-tienda { font-weight: 800; }
@media (prefers-reduced-motion: no-preference) { .sello.premio.listo .sello-img { animation: premio-late 2.6s ease-in-out infinite; } }
@keyframes premio-late { 50% { transform: scale(1.07); } }
.sello-fecha { font-size: 10.5px; opacity: .72; line-height: 1.3; }
/* 5 sellos y el descuento en una fila (tarjetas de 5): en el teléfono, letras un poco más chicas. */
.sellos[style*="--cols:6"] { gap: 12px 4px; }
.sellos[style*="--cols:6"] .sello-tienda { font-size: 10px; }
.sellos[style*="--cols:6"] .sello-fecha { font-size: 9.5px; }

/* El sello ganado por recomendar lleva una estrellita: así el cliente sabe que lo ganó recomendando. */
.sello.por-referido .sello-img::before, .nota-estrella::before { content: ''; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6L14.47 9.2L21.51 9.51L15.99 13.9L17.88 20.69L12 16.8L6.12 20.69L8.01 13.9L2.49 9.51L9.53 9.2Z' fill='%23f6b93b' stroke='%23fff' stroke-width='1.8' stroke-linejoin='round' paint-order='stroke'/%3E%3C/svg%3E") center / contain no-repeat; }
.sello.por-referido .sello-img::before { position: absolute; z-index: 1; top: -8px; right: -9px; width: 27px; height: 27px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.nota-estrella::before { display: inline-block; width: 16px; height: 16px; margin: 0 5px -3px 0; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .35)); }
.pase .pase-nota { margin: 6px 0 0; font-size: 12.5px; opacity: .85; }

/* El sello cae sobre la tarjeta. */
.sello.recien .sello-img { animation: estampar .62s cubic-bezier(.2, .9, .3, 1.15) both; }
.sello.recien .sello-img::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px #fff; animation: onda .8s .24s ease-out both; pointer-events: none;
}
.pase.golpe { animation: golpe .34s .22s ease-out; }
@keyframes estampar {
  0% { opacity: 0; transform: scale(2.6) rotate(-16deg); }
  45% { opacity: 1; transform: scale(.86) rotate(2deg); }
  70% { transform: scale(1.06) rotate(0); }
  100% { transform: scale(1); }
}
@keyframes onda { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.1); } }
@keyframes golpe { 30% { transform: translateY(3px) scale(.992); } 70% { transform: translateY(-1px); } }

/* ---------- Transiciones entre pantallas ---------- */
@view-transition { navigation: auto; }
.contenido, .hoja { view-transition-name: contenido; }
::view-transition-group(*) { animation-duration: .3s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(contenido) { animation: vt-fuera .09s ease-in both; }
::view-transition-new(contenido) { animation: vt-dentro .24s cubic-bezier(.2, .8, .2, 1) .07s both; }
html:active-view-transition-type(adelante)::view-transition-old(contenido) { animation: vt-izq .1s ease-in both; }
html:active-view-transition-type(adelante)::view-transition-new(contenido) { animation: vt-der .26s cubic-bezier(.2, .8, .2, 1) .08s both; }
html:active-view-transition-type(atras)::view-transition-old(contenido) { animation: vt-der-sale .1s ease-in both; }
html:active-view-transition-type(atras)::view-transition-new(contenido) { animation: vt-izq-entra .26s cubic-bezier(.2, .8, .2, 1) .08s both; }
@keyframes vt-fuera { to { opacity: 0; } }
@keyframes vt-dentro { from { opacity: 0; transform: translateY(8px); } }
@keyframes vt-izq { to { opacity: 0; transform: translateX(-28px); } }
@keyframes vt-der { from { opacity: 0; transform: translateX(44px); } }
@keyframes vt-der-sale { to { opacity: 0; transform: translateX(44px); } }
@keyframes vt-izq-entra { from { opacity: 0; transform: translateX(-28px); } }

/* ---------- Hoja que sube desde abajo ---------- */
.hoja-dlg {
  position: fixed; inset: auto 0 0; width: 100%; max-width: 560px; max-height: 88dvh; margin: 0 auto; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain;
  border: 0; border-radius: 28px 28px 0 0; background: var(--sup-fuerte); color: var(--tx); box-shadow: var(--sombra-2);
}
.hoja-dlg[open] { animation: subir .36s cubic-bezier(.2, .9, .25, 1) both; }
.hoja-dlg.cerrando { animation: bajar .2s ease-in both; }
.hoja-dlg::backdrop { background: rgba(10, 10, 12, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: velo .25s ease both; }
.hoja-dlg.cerrando::backdrop { opacity: 0; transition: opacity .2s; }
.hoja-asa { display: block; width: 42px; height: 5px; border-radius: 5px; margin: 2px auto 14px; background: var(--borde-fuerte); }
.hoja-dlg h2 { margin: 2px 0 8px; font-size: 20px; }
.hoja-dlg p { margin: 0 0 18px; color: var(--tx2); }
.hoja-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@keyframes subir { from { transform: translateY(100%); } }
@keyframes bajar { to { transform: translateY(100%); } }
@keyframes velo { from { opacity: 0; } }
@media (min-width: 900px) {
  .hoja-dlg { inset: 0; margin: auto; height: fit-content; max-width: 440px; padding: 22px; border-radius: 26px; }
  .hoja-dlg[open] { animation: aparecer .24s cubic-bezier(.2, .9, .25, 1) both; }
  .hoja-dlg.cerrando { animation: desaparecer .14s ease-in both; }
  .hoja-asa { display: none; }
  @keyframes aparecer { from { opacity: 0; transform: scale(.94) translateY(10px); } }
  @keyframes desaparecer { to { opacity: 0; transform: scale(.97); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important;
  }
}
