:root {
    --gs-magenta: #d9007f;
    --gs-magenta-soft: #fde6f2;
    --gs-blue: #0077b6;        /* #009bdd oscurecido: contraste 4.9:1 con blanco */
    --gs-blue-hover: #005f91;
    --gs-blue-soft: #e5f3fb;
    --gs-brown: #b5874b;
    --gs-ink: #1d1d1f;
    --gs-muted: #5c5f66;
    --gs-line: #e3e5e8;
    --gs-bg: #f6f7f9;
    --gs-radius: 14px;

    /* Vidrio: opacidad alta porque el texto es oscuro; con menos de ~.6 el gris secundario baja de 4.5:1 */
    --glass-bg: rgba(255, 255, 255, .62);
    --glass-bg-strong: rgba(255, 255, 255, .8);
    --glass-border: rgba(255, 255, 255, .75);
    --glass-blur: 16px;
    --glass-shadow: 0 8px 28px rgba(29, 29, 31, .07), inset 0 1px 0 rgba(255, 255, 255, .9);

    --bs-body-font-size: 1rem;
    --bs-body-line-height: 1.5;
    --bs-body-color: var(--gs-ink);
    --bs-body-bg: var(--gs-bg);
    --bs-focus-ring-color: rgba(0, 119, 182, .35);
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    isolation: isolate;
}
/* Fondo CMYK de marca detrás del vidrio. Gradientes fijos en lugar de filter: blur para no costar en teléfonos */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(36vmax 36vmax at -4% 4%, rgba(217, 0, 127, .34), transparent 70%),
        radial-gradient(40vmax 40vmax at 104% 64%, rgba(0, 155, 221, .4), transparent 70%),
        radial-gradient(38vmax 38vmax at -2% 100%, rgba(255, 212, 0, .45), transparent 70%),
        var(--gs-bg);
}
main { flex: 1; display: flex; flex-direction: column; }

.glass, .site-header, .how, .action-card, .step-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}
/* Formularios con más cuerpo: ahí se lee y se escribe */
.step-card { background: var(--glass-bg-strong); }

/* Inicio: marca centrada en el espacio libre, acciones abajo al alcance del pulgar */
.view-inicio { flex: 1; display: flex; flex-direction: column; }
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-block: 1rem 1.5rem;
}
.hero-mark { width: 72px; height: 72px; margin-bottom: 1rem; }
.hero .lead-text { max-width: 30ch; }
.how {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    list-style: none;
    padding: 1rem .5rem .875rem;
    margin: 0 0 1rem;
    border-radius: var(--gs-radius);
}
.how-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
}
/* Conector punteado entre íconos */
.how-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 24px;
    left: calc(50% + 32px);
    right: calc(-50% + 32px);
    border-top: 2px dashed #f2b8d7;
    transform-origin: left center;
}
.how-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(217, 0, 127, .1);
    color: var(--gs-magenta);
    font-size: 1.625rem;
}
.how-num {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--gs-magenta);
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1;
}
.how-label {
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--gs-ink);
}

h1, h2, h3, .page-title, .step-title, .action-title {
    font-family: "Poppins", system-ui, sans-serif;
}

.container-narrow {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
    padding-inline: 1rem;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    border-width: 0 0 1px;
    box-shadow: 0 1px 0 rgba(217, 0, 127, .35), 0 6px 20px rgba(29, 29, 31, .05);
    padding-block: .5rem;
}
.site-logo { height: 32px; width: auto; }
.site-header-label {
    color: var(--gs-muted);
    font-weight: 600;
    font-size: .9375rem;
}

/* Titles */
.page-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--gs-ink);
    margin-bottom: .25rem;
}
.page-title:focus, .step-title:focus { outline: none; }
.lead-text { color: var(--gs-muted); font-size: 1.0625rem; }
.footnote { color: var(--gs-muted); font-size: .875rem; text-align: center; }
.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--gs-blue);
    text-decoration: none;
    font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

/* Home action cards */
.action-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1rem;
    min-height: 88px;
    border-radius: var(--gs-radius);
    color: inherit;
    text-decoration: none;
    /* hover usa `translate` para no chocar con las animaciones que usan `transform` */
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, translate .15s ease;
}
.action-card:hover, .action-card:focus-visible {
    background: var(--glass-bg-strong);
    border-color: rgba(0, 119, 182, .45);
    box-shadow: 0 10px 28px rgba(0, 119, 182, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
    translate: 0 -1px;
}
.action-card:active { translate: 0; box-shadow: var(--glass-shadow); }
button.action-card { width: 100%; font: inherit; text-align: left; }
/* Dentro de un formulario de vidrio, la tarjeta no vuelve a desenfocar */
.step-card .action-card {
    min-height: 76px;
    background: rgba(255, 255, 255, .75);
    border-color: rgba(29, 29, 31, .08);
    box-shadow: 0 1px 2px rgba(29, 29, 31, .04);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.step-card .action-card:hover, .step-card .action-card:focus-visible {
    background: #fff;
    border-color: rgba(0, 119, 182, .45);
    box-shadow: 0 8px 22px rgba(0, 119, 182, .12);
}
.action-card:hover .ph-download-simple.action-chevron,
.action-card:focus-visible .ph-download-simple.action-chevron { transform: translateY(2px); }
.action-card:focus-visible { outline: 3px solid var(--bs-focus-ring-color); outline-offset: 2px; }
.action-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(0, 119, 182, .1);
    color: var(--gs-blue);
}
.action-icon i { font-size: 1.75rem; }
.action-icon-primary { background: rgba(217, 0, 127, .1); color: var(--gs-magenta); }
.action-body { display: flex; flex-direction: column; flex: 1; }
.action-title { font-weight: 600; font-size: 1.125rem; }
.action-text { color: var(--gs-muted); font-size: .9375rem; }
.action-chevron { font-size: 1.25rem; color: var(--gs-muted); transition: transform .2s ease, color .2s ease; }
.action-card:hover .action-chevron, .action-card:focus-visible .action-chevron { transform: translateX(3px); color: var(--gs-blue); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-icon i { font-size: 1.25rem; }
.back-link i { margin-right: .25rem; }

/* Encabezado del flujo: volver + título + contador en una sola línea */
.flow-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}
.icon-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    margin-left: -.625rem;
    border-radius: 50%;
    color: var(--gs-blue);
    font-size: 1.375rem;
    line-height: 1;
    text-decoration: none;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--gs-blue-soft); }
.flow-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}
.flow-count {
    flex: none;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--gs-magenta);
}

/* Stepper compacto */
.stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    list-style: none;
    padding: 0;
    margin: 0 0 .75rem;
}
.stepper li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .125rem;
    font-size: .75rem;
    color: var(--gs-muted);
}
.stepper li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 11px;
    left: calc(50% + 14px);
    right: calc(-50% + 14px);
    height: 2px;
    background: var(--gs-line);
}
.stepper-dot {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--gs-line);
    background: #fff;
    font-size: .75rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}
.stepper li.is-active { color: var(--gs-magenta); font-weight: 600; }
.stepper li.is-active .stepper-dot { border-color: var(--gs-magenta); color: var(--gs-magenta); }
.stepper li.is-done .stepper-dot { background: var(--gs-magenta); border-color: var(--gs-magenta); color: #fff; }
.stepper li.is-done:not(:last-child)::after { background: var(--gs-magenta); }
/* Cards */
.step-card {
    border-radius: var(--gs-radius);
    padding: 1rem;
}
.step-title { font-size: 1.125rem; font-weight: 600; margin-bottom: .25rem; }
.step-help { color: var(--gs-muted); }
.step-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    margin-bottom: .5rem;
}
.step-head .step-title { margin: 0; }
.help-btn {
    flex: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: 44px;
    padding: 0 .25rem;
    border: 0;
    background: none;
    color: var(--gs-blue);
    font-size: .875rem;
    font-weight: 600;
}
.help-btn i { font-size: 1.125rem; }
.section-title {
    font-size: .9375rem;
    font-weight: 600;
    margin: 1rem 0 .5rem;
    padding-top: .75rem;
    border-top: 1px solid var(--gs-line);
}

/* Domicilio guardado en una línea */
.domicilio-resumen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .75rem;
    padding: .625rem .75rem;
    border: 1px solid rgba(29, 29, 31, .08);
    border-radius: 10px;
    background: rgba(246, 247, 249, .7);
}
.domicilio-label { font-size: .75rem; font-weight: 600; color: var(--gs-muted); }
.domicilio-texto { font-size: .875rem; overflow-wrap: anywhere; }
.min-w-0 { min-width: 0; }

.toast-brand {
    background: #1e6b3a;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(29, 29, 31, .22);
}
/* `top` lo fija app.js con la altura real del encabezado */
.toast-container {
    top: 0;
    z-index: 1010;
    width: min(100%, 420px);
    padding: .5rem .75rem;
}
.toast-container .toast { width: 100%; }
@keyframes gs-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
.toast-container .toast.show { animation: gs-toast-in .3s cubic-bezier(.22, 1, .36, 1) both; }
.optional { color: var(--gs-muted); font-weight: 400; }

.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .25rem; }
.form-text { font-size: .8125rem; margin-top: .125rem; }
.form-control, .form-select {
    min-height: 48px;
    border-color: rgba(29, 29, 31, .18);
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(29, 29, 31, .04);
}
.form-control[readonly] { background-color: rgba(246, 247, 249, .9); }
.form-select:disabled { background-color: #eef0f3; color: var(--gs-muted); }
.form-control:focus, .form-select:focus { border-color: var(--gs-blue); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-text { color: var(--gs-muted); }

.step-actions { display: flex; gap: .75rem; }
.step-actions .btn { flex: 1; }
.step-actions .btn-brand { flex: 2; }

/* Móvil: Atrás / Continuar quedan al alcance del pulgar mientras se llena el paso.
   Sticky (no fixed) para que al final descansen dentro de la tarjeta sin tapar contenido.
   bottom: -1px permite detectar con IntersectionObserver cuando está flotando. */
@media (max-width: 767.98px) {
    html { scroll-padding-bottom: 6.5rem; }
    .step-card .step-actions {
        position: sticky;
        bottom: -1px;
        z-index: 5;
        margin: 1rem -1rem -1rem;
        padding: .75rem 1rem calc(.75rem + 1px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .9);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        border-top: 1px solid transparent;
        border-radius: 0 0 var(--gs-radius) var(--gs-radius);
        transition: box-shadow .2s ease, border-color .2s ease;
    }
    .step-card .step-actions.is-stuck {
        border-top-color: rgba(29, 29, 31, .08);
        box-shadow: 0 -8px 24px rgba(29, 29, 31, .1);
    }
}

/* Ticket del paso 2: el total manda, folio y fecha lo identifican, la forma de pago es apoyo */
.ticket {
    padding: .875rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(29, 29, 31, .07);
    border-radius: 12px;
    background: rgba(246, 247, 249, .75);
}
.ticket-head { display: flex; align-items: center; gap: .75rem; }
.ticket-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(217, 0, 127, .1);
    color: var(--gs-magenta);
    font-size: 1.5rem;
}
.ticket-id { flex: 1; min-width: 0; }
.ticket-title { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-fecha { color: var(--gs-muted); font-size: .875rem; }
.ticket-badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-left: auto;
    padding: .25rem .5rem;
    border-radius: 999px;
    background: #e7f6ec;
    color: #1e6b3a;
    font-size: .75rem;
    font-weight: 600;
}
.ticket-badge i { font-size: .9375rem; }
.ticket-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .875rem;
    padding-top: .75rem;
    border-top: 2px dashed rgba(29, 29, 31, .12);
}
.ticket-total-label { color: var(--gs-muted); font-weight: 500; }
.ticket-total-amount {
    font-family: "Poppins", system-ui, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--gs-ink);
}
.ticket-pago {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(29, 29, 31, .08);
    font-size: .9375rem;
}
.ticket-pago i { flex: none; color: var(--gs-blue); font-size: 1.25rem; }
.ticket-pago-label { flex: none; color: var(--gs-muted); }
.ticket-pago-valor { margin-left: auto; font-weight: 600; text-align: right; }
.field-title { font-size: 1rem; }

/* Buttons: mismo radio que las tarjetas */
.btn { min-height: 44px; border-radius: 12px; font-weight: 600; }
.btn-lg { min-height: 52px; font-size: 1.0625rem; }
.btn-brand { box-shadow: 0 6px 18px rgba(0, 119, 182, .22); transition: background-color .15s ease, box-shadow .15s ease, translate .15s ease; }
.btn-brand:hover:not(:disabled) { box-shadow: 0 10px 24px rgba(0, 119, 182, .28); translate: 0 -1px; }
.btn-brand:active { translate: 0; }
.btn-arrow { transition: transform .2s ease; }
.btn:hover .btn-arrow, .btn:focus-visible .btn-arrow { transform: translateX(3px); }
/* Secundario de vidrio: Atrás, Editar, Facturar otra compra */
.btn-glass {
    --bs-btn-color: var(--gs-ink);
    --bs-btn-bg: rgba(255, 255, 255, .8);
    --bs-btn-border-color: rgba(29, 29, 31, .14);
    --bs-btn-hover-color: var(--gs-blue);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: rgba(0, 119, 182, .45);
    --bs-btn-active-color: var(--gs-blue);
    --bs-btn-active-bg: var(--gs-blue-soft);
    --bs-btn-active-border-color: var(--gs-blue);
    --bs-btn-focus-shadow-rgb: 0, 119, 182;
    box-shadow: 0 1px 2px rgba(29, 29, 31, .05);
}
.btn-glass i { color: var(--gs-blue); }
.btn-glass:hover .ph-arrows-clockwise { transform: rotate(180deg); }
.btn-glass .ph-arrows-clockwise { transition: transform .4s ease; }
.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--gs-blue);
    --bs-btn-border-color: var(--gs-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--gs-blue-hover);
    --bs-btn-hover-border-color: var(--gs-blue-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--gs-blue-hover);
    --bs-btn-active-border-color: var(--gs-blue-hover);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--gs-blue);
    --bs-btn-disabled-border-color: var(--gs-blue);
    --bs-btn-focus-shadow-rgb: 0, 119, 182;
}
.btn-outline-brand {
    --bs-btn-color: var(--gs-blue);
    --bs-btn-border-color: var(--gs-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--gs-blue);
    --bs-btn-hover-border-color: var(--gs-blue);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--gs-blue);
    --bs-btn-active-border-color: var(--gs-blue);
    --bs-btn-focus-shadow-rgb: 0, 119, 182;
}
.btn-link { color: var(--gs-blue); }

/* Tipo de persona: mismas tarjetas que el inicio, con estado seleccionado */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.choice-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 60px;
    padding: .5rem .625rem;
    border: 1px solid rgba(29, 29, 31, .1);
    border-radius: 12px;
    background: rgba(255, 255, 255, .75);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.choice-card:hover { border-color: rgba(0, 119, 182, .45); }
.choice-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(0, 119, 182, .1);
    color: var(--gs-blue);
    font-size: 1.25rem;
    transition: background-color .15s ease, color .15s ease;
}
.choice-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.choice-title { font-weight: 600; font-size: .875rem; white-space: nowrap; }
.choice-text { color: var(--gs-muted); font-size: .75rem; white-space: nowrap; }
.btn-check:checked + .choice-card {
    border-color: var(--gs-blue);
    background: rgba(229, 243, 251, .9);
    box-shadow: 0 0 0 1px var(--gs-blue), 0 6px 18px rgba(0, 119, 182, .14);
}
.btn-check:checked + .choice-card .choice-icon { background: var(--gs-blue); color: #fff; }
.btn-check:focus-visible + .choice-card { outline: 3px solid var(--bs-focus-ring-color); outline-offset: 2px; }
.fieldset-invalid .choice-card { border-color: var(--bs-form-invalid-border-color); }
/* Tipo fijado por el RFC: solo informa, no se elige */
.choice-card.is-static {
    cursor: default;
    border-color: rgba(0, 119, 182, .35);
    background: rgba(229, 243, 251, .75);
}
.choice-card.is-static:hover { border-color: rgba(0, 119, 182, .35); }
.choice-card.is-static .choice-icon { background: var(--gs-blue); color: #fff; }
.choice-card.is-static .choice-text { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

#sat-error details { color: inherit; opacity: .85; }
#sat-error summary { cursor: pointer; font-weight: 600; }
.btn.is-sending { pointer-events: none; opacity: .75; }
.fieldset-invalid .invalid-feedback { display: block; }

.success-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: .5rem auto 1rem;
    border-radius: 50%;
    background: #e7f6ec;
    color: #1e7a3c;
    font-size: 2.75rem;
}

/* Sin backdrop-filter el vidrio se vería lavado: se vuelve casi sólido */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root { --glass-bg: rgba(255, 255, 255, .92); --glass-bg-strong: rgba(255, 255, 255, .96); }
}
@media (prefers-reduced-transparency: reduce) {
    :root { --glass-bg: #fff; --glass-bg-strong: #fff; --glass-border: var(--gs-line); }
    body::before { background: var(--gs-bg); }
    .glass, .site-header, .how, .action-card, .step-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (min-width: 768px) {
    /* En pantallas anchas el color se acerca a la columna de 640px para que el vidrio tenga qué desenfocar */
    body::before {
        background:
            radial-gradient(340px 340px at calc(50% - 330px) 30%, rgba(217, 0, 127, .3), transparent 70%),
            radial-gradient(380px 380px at calc(50% + 340px) 62%, rgba(0, 155, 221, .36), transparent 70%),
            radial-gradient(360px 360px at calc(50% - 260px) 92%, rgba(255, 212, 0, .42), transparent 70%),
            var(--gs-bg);
    }
    .page-title { font-size: 2rem; }
    .view-inicio { justify-content: center; }
    .hero { flex: none; padding-block: 0 2rem; }
    .flow-title { font-size: 1.5rem; }
    .step-card { padding: 1.5rem; }
    .choice-card { padding: .625rem .75rem; gap: .625rem; }
    .choice-icon { width: 40px; height: 40px; font-size: 1.375rem; }
    .choice-title { font-size: .9375rem; }
    .stepper li { font-size: .8125rem; }
}

/* Guía folio GR: centrada; mini-ticket como el térmico del PDV */
.guia-folio-dialog {
    margin: 1rem auto;
    max-width: min(22.5rem, calc(100% - 1.5rem));
}
.guia-folio-dialog .modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(90dvh, 40rem);
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 18px 48px rgba(29, 29, 31, .22);
}
.guia-folio-modal .modal-header {
    flex-shrink: 0;
    padding: 1rem 1rem .35rem;
}
.guia-folio-modal .modal-title {
    font-family: "Poppins", system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.0625rem;
}
.guia-folio-modal .modal-body {
    flex: 0 1 auto;
    padding: .35rem 1rem .25rem;
    overflow: visible;
}
.guia-folio-modal .modal-footer {
    flex-shrink: 0;
    padding: .65rem 1rem calc(.9rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
}
.guia-folio-modal .modal-footer .btn-brand {
    min-height: 2.75rem;
    font-weight: 600;
}
.guia-folio-lead {
    margin: 0 0 .75rem;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--gs-muted);
}
.guia-folio-lead strong { color: var(--gs-ink); }
/* Recibo térmico (espejo de modules/pedidos/view.ticket.php) */
.guia-ticket {
    margin: 0 auto;
    max-width: 16.5rem;
}
.guia-ticket-paper {
    margin: 0;
    padding: .7rem .75rem .65rem;
    border-radius: 4px;
    background: #fff;
    border: 1px solid rgba(29, 29, 31, .12);
    box-shadow:
        0 1px 0 rgba(29, 29, 31, .04),
        0 8px 20px rgba(29, 29, 31, .08);
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
    font-size: .625rem;
    line-height: 1.35;
    color: #1d1d1f;
    font-variant-numeric: tabular-nums;
}
.guia-ticket-brand {
    margin: 0 0 .2rem;
    text-align: center;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .01em;
}
.guia-ticket-line { margin: 0; }
.guia-ticket-muted { color: #6e6e73; }
.guia-ticket-center { margin: .15rem 0; text-align: center; }
.guia-ticket-rule {
    margin: .45rem 0;
    border-bottom: 1px dashed #1d1d1f;
    opacity: .55;
}
.guia-ticket-row {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin: 0 0 .35rem;
}
.guia-ticket-fade {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin: 0 0 .2rem;
    color: #6e6e73;
}
.guia-ticket-fade-tight {
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: .15rem;
}
.guia-ticket-folio {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin: .45rem 0 .35rem;
    padding: .5rem .4rem;
    border-radius: 8px;
    background: var(--gs-blue-soft);
    box-shadow: inset 0 0 0 2px var(--gs-blue);
    font-weight: 700;
    font-size: .6875rem;
    color: #1d1d1f;
}
.guia-ticket-folio-txt {
    letter-spacing: .01em;
    word-break: break-all;
    text-align: center;
}
.guia-marca {
    flex: none;
    display: grid;
    place-items: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    background: var(--gs-blue);
    color: #fff;
    font-family: "Poppins", system-ui, sans-serif;
    font-size: .625rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px #fff;
}
@media (max-width: 575.98px) {
    .guia-folio-dialog {
        margin: .75rem auto;
        max-width: calc(100% - 1.25rem);
    }
    .guia-folio-dialog .modal-content {
        width: 100%;
        max-height: calc(100dvh - 1.5rem - env(safe-area-inset-bottom, 0px));
        border-radius: 18px;
    }
    .guia-folio-modal .modal-header { padding: .875rem .875rem .25rem; }
    .guia-folio-modal .modal-body { padding: .25rem .875rem .15rem; }
    .guia-folio-modal .modal-footer {
        padding: .55rem .875rem calc(.8rem + env(safe-area-inset-bottom, 0px));
    }
    .guia-folio-lead { font-size: .8125rem; margin-bottom: .625rem; }
    .guia-ticket { max-width: 100%; }
    .guia-ticket-paper { padding: .65rem .7rem .55rem; }
    .guia-ticket-folio { font-size: .75rem; padding: .55rem .45rem; }
}

/* Pantallas bajas: prioriza FOLIO + Entendido a la vista */
@media (max-height: 700px) {
    .guia-folio-lead { margin-bottom: .5rem; font-size: .8125rem; }
    .guia-ticket-paper { padding: .5rem .6rem .45rem; font-size: .5625rem; }
    .guia-ticket-brand { font-size: .75rem; }
    .guia-ticket-line.guia-ticket-muted:nth-of-type(3),
    .guia-ticket-fade:not(.guia-ticket-fade-tight) { display: none; }
}

/* Entradas en CSS: arrancan con el primer pintado de cada página, sin esperar JavaScript */
@keyframes gs-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
@keyframes gs-pop {
    from { opacity: 0; transform: scale(.7); }
    to   { opacity: 1; transform: none; }
}
.is-entering .hero-mark   { animation: gs-pop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.is-entering .page-title  { animation: gs-rise .4s cubic-bezier(.22, 1, .36, 1) .06s both; }
.is-entering .lead-text   { animation: gs-rise .4s cubic-bezier(.22, 1, .36, 1) .12s both; }
.is-entering .how         { animation: gs-rise .4s cubic-bezier(.22, 1, .36, 1) .1s both; }
.is-entering .how-icon    { animation: gs-pop .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.is-entering .how-step:nth-child(1) .how-icon { animation-delay: .2s; }
.is-entering .how-step:nth-child(2) .how-icon { animation-delay: .28s; }
.is-entering .how-step:nth-child(3) .how-icon { animation-delay: .36s; }
.is-entering .action-card { animation: gs-rise .4s cubic-bezier(.22, 1, .36, 1) both; }
.is-entering .action-card:nth-child(1) { animation-delay: .14s; }
.is-entering .action-card:nth-child(2) { animation-delay: .2s; }
/* Cada paso es una página: solo la tarjeta entra, el encabezado y el stepper quedan quietos */
.step-card { animation: gs-rise .35s cubic-bezier(.22, 1, .36, 1) both; }
.success-icon { animation: gs-pop .5s cubic-bezier(.34, 1.56, .64, 1) .12s both; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
