/*
 * Volvi. Dirección "tarjeta de sellos": fondo claro y frío, superficies blancas con líneas
 * de 1px, tinta casi negra y un solo acento. En las páginas del cliente, --accent y --page
 * llegan con los colores del negocio.
 */
:root {
    --page: #f4f6f5;
    --surface: #ffffff;
    --sunken: #eef1ef;
    --line: #e1e5e3;
    --line-strong: #c9d0cc;
    --ink: #16201c;
    --ink-2: #4b5752;
    --accent: #1f5c4d;
    --on-accent: #ffffff;
    --danger: #b3261e;
    --danger-soft: #fdf0ef;
    --ok: #1d6b3c;
    --ok-soft: #eef7f1;
    --warn: #9a5a00;
    --warn-soft: #fff6e6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgb(22 32 28 / 4%), 0 4px 16px -8px rgb(22 32 28 / 12%);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    /* Se calcula aquí y no en :root para que siga al color del negocio cuando la página lo cambia */
    --accent-soft: color-mix(in srgb, var(--accent) 9%, white);
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 400 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    /* Un nombre o folio largo sin espacios (lo escribe el cliente) se parte en vez de desbordar la pantalla */
    overflow-wrap: anywhere;
}
::selection { background: color-mix(in srgb, var(--accent) 22%, white); color: var(--ink); }

/* ---------- Estructura ---------- */
main { max-width: 30rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.app main { max-width: 52rem; padding-top: 1.75rem; }

.app-bar {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.app-bar-inner {
    max-width: 52rem; margin: 0 auto; padding: 0 1rem;
    display: flex; align-items: center; gap: 1rem; min-height: 3.5rem;
}
.app-bar .brand { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; color: var(--ink); text-decoration: none; }
.app-nav {
    display: flex; gap: .125rem; overflow-x: auto; scrollbar-width: none; flex: 1;
    margin: 0 -.25rem; padding: .5rem .25rem;
}
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a, .app-nav button {
    display: inline-flex; align-items: center; gap: .4rem; flex: none;
    min-height: 2.5rem; padding: 0 .7rem; border-radius: var(--radius-sm);
    color: var(--ink-2); text-decoration: none; font: inherit; font-size: .9rem; font-weight: 500;
    background: none; border: 0; cursor: pointer;
}
.app-nav a:hover, .app-nav button:hover { background: var(--sunken); color: var(--ink); }
.app-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.app-nav form { margin: 0 0 0 auto; }
.menu-toggle {
    display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; min-height: 2.5rem; padding: 0 .8rem;
    font: inherit; font-size: .9rem; font-weight: 560; color: var(--ink); background: none;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer;
}
.menu-toggle[aria-expanded="true"] { background: var(--sunken); }
/* Hasta 80rem las secciones no caben en una fila: sin JS bajan de línea, con JS se agrupan en el menú */
@media (max-width: 79.99rem) {
    .app-bar-inner { flex-wrap: wrap; }
    .app-nav { flex-wrap: wrap; overflow: visible; flex-basis: 100%; padding-top: 0; }
    .app-bar.collapsible .app-nav { display: none; }
    .app-bar.collapsible.open .app-nav {
        display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .25rem;
        padding: .25rem .25rem 1rem; max-height: calc(100dvh - 3.5rem); overflow-y: auto;
    }
    .app-bar.collapsible.open .app-nav form { margin: 0; }
    .app-bar.collapsible.open .app-nav button { width: 100%; }
}
@media (min-width: 80rem) {
    .app-bar-inner { max-width: 80rem; gap: .75rem; }
    .app-nav .logout .nav-label { display: none; }
    /* 11 secciones no caben en una fila con ícono: en escritorio van solo con texto */
    .app-nav a > .icon { display: none; }
    .app-nav a, .app-nav button { padding: 0 .5rem; gap: .3rem; }
    .menu-toggle { display: none; }
}

/* ---------- Tipografía ---------- */
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1 { font-size: 1.75rem; line-height: 1.15; font-weight: 650; letter-spacing: -0.022em; margin: 0 0 .5rem; }
h2 { font-size: 1.32rem; line-height: 1.3; font-weight: 620; letter-spacing: -0.012em; margin: 2.25rem 0 .75rem; }
h3 { font-size: 1.1rem; line-height: 1.35; font-weight: 620; margin: 1.75rem 0 .5rem; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 620; }
.muted { color: var(--ink-2); font-size: .9rem; }
.lead { color: var(--ink-2); margin-bottom: 1.25rem; }
.num { font-variant-numeric: tabular-nums; }
.page-head { margin-bottom: 1.25rem; }
.page-head .muted { margin: 0; }

/* ---------- Íconos ---------- */
.icon {
    width: 1.25em; height: 1.25em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
    vertical-align: -0.25em;
}

/* ---------- Superficies ---------- */
.panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.25rem; margin-top: 1rem;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.list {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    margin-top: 1rem; overflow: hidden;
}
.row { padding: 1rem 1.25rem; }
.row + .row { border-top: 1px solid var(--line); }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.row-head strong { font-size: 1.02rem; }
.row-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--ink-2); font-size: .9rem; margin-top: .25rem; }
.row-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.row-actions form { margin: 0; }
.empty { padding: 2rem 1.25rem; text-align: center; color: var(--ink-2); }
.empty .icon { width: 1.75rem; height: 1.75rem; display: block; margin: 0 auto .5rem; color: var(--line-strong); }

/* Cifras: una sola franja con divisiones finas, no tarjetas sueltas */
.figures {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    margin-top: 1rem;
}
.figures > div { background: var(--surface); padding: 1rem 1.1rem; color: var(--ink-2); font-size: .85rem; }
.figures strong {
    display: block; color: var(--ink); font-size: 1.45rem; font-weight: 620; letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums; margin-bottom: .1rem;
}
@media (min-width: 40rem) { .figures { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Firma: la fila de sellos ---------- */
.stamps { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1rem 0; padding: 0; }
.stamps li {
    width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
    border: 1.5px dashed var(--line-strong); border-radius: 50%; color: var(--line-strong);
}
/* Filas parejas: la página fija --cols (8 sellos = 4 + 4) */
.stamps[style*="--cols"] { display: grid; grid-template-columns: repeat(var(--cols), 2.75rem); }
.stamps li .icon { width: 1.35rem; height: 1.35rem; }
.stamps li.on { border: 0; background: var(--accent); color: var(--on-accent); }
.stamps.sm { gap: .3rem; margin: .6rem 0 0; align-items: center; }
.stamps.sm li { width: .8rem; height: .8rem; border-width: 1.5px; border-style: solid; border-color: var(--line-strong); }
.stamps.sm li.on { background: var(--accent); }
.stamps.sm .count { width: auto; height: auto; border: 0; margin-left: .35rem; color: var(--ink-2); font-size: .85rem; }

/* ---------- Formularios ---------- */
label { display: block; font-weight: 560; font-size: .92rem; margin: 1.1rem 0 .35rem; }
.panel > label:first-child, form > label:first-of-type:first-child { margin-top: 0; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
    width: 100%; min-height: 2.875rem; padding: .55rem .8rem; font: inherit; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #707b76; }
input:hover, select:hover, textarea:hover { border-color: #aeb7b2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=color] { width: 100%; height: 2.875rem; padding: .25rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
input[type=file] { width: 100%; font: inherit; font-size: .9rem; color: var(--ink-2); }
input[type=file]::file-selector-button {
    font: inherit; font-weight: 560; margin-right: .75rem; padding: .5rem .9rem; cursor: pointer;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
.hint { color: var(--ink-2); font-size: .85rem; margin: .4rem 0 0; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; font-size: .95rem; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin: .15rem 0 0; flex: none; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 1.25rem 0 0; }
legend { font-weight: 560; font-size: .92rem; margin-bottom: .5rem; }
fieldset .check + .check { margin-top: .6rem; }
.grid-2 { display: grid; gap: 0 1rem; }
@media (min-width: 40rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Selector de ícono del sello */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)); gap: .4rem; }
.icon-picker label { margin: 0; }
.icon-picker input { position: absolute; opacity: 0; pointer-events: none; }
.icon-picker span {
    display: grid; place-items: center; height: 3rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.icon-picker span:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-picker input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.icon-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Botones ---------- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 2.875rem; padding: .6rem 1.15rem; margin-top: 1.25rem;
    background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: .95rem; text-align: center; text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.button:hover { background: color-mix(in srgb, var(--accent) 88%, black); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--sunken); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.small { min-height: 2.375rem; padding: .4rem .85rem; font-size: .88rem; margin-top: 0; }
.button.wide, .public .button { width: 100%; }
@media (max-width: 40rem) { form.panel .button { width: 100%; } }
.whatsapp { background: #128c4a; border-color: #128c4a; }
.whatsapp:hover { background: #0e743d; }

/* ---------- Avisos ---------- */
.error, .success, .note {
    display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--radius-sm);
    font-size: .93rem; font-weight: 500; margin: 0 0 1rem;
}
.error { background: var(--danger-soft); color: var(--danger); }
.success { background: var(--ok-soft); color: var(--ok); }
.note { background: var(--warn-soft); color: #6e4100; }
.note.neutral { background: var(--sunken); color: var(--ink-2); }
.error .icon, .success .icon, .note .icon { margin-top: .05rem; }
.tag {
    display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: #6e4100; }

/* ---------- Varios ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details { margin-top: .75rem; }
details summary {
    display: inline-flex; align-items: center; gap: .35rem; min-height: 2.5rem; cursor: pointer;
    color: var(--ink-2); font-size: .9rem; font-weight: 560; list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary .icon { transition: transform .15s; }
details[open] summary .icon { transform: rotate(90deg); }
details .details-body { padding: .25rem 0 0; display: grid; gap: .25rem; }
details .details-body .button { margin-top: .5rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.legal { font-size: .95rem; line-height: 1.65; }
.legal h2 { font-size: 1.05rem; margin-top: 1.75rem; }
.legal h2:first-child { margin-top: 0; }
pre.notice { white-space: pre-wrap; font: inherit; margin: 0; }
.logo { display: block; width: 3.5rem; height: 3.5rem; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--surface); }

/* ---------- Páginas públicas (cliente y acceso) ---------- */
.public-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.5rem; }
.public-head h1 { font-size: 1.4rem; margin: 0; }
.public-head .muted { margin: 0; }
.loyalty-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
    padding: 1.4rem 1.25rem;
}
.loyalty-card .hello { color: var(--ink-2); margin-bottom: .25rem; }
.loyalty-card .goal { font-size: 1.15rem; font-weight: 620; letter-spacing: -0.01em; margin-bottom: .25rem; }
.loyalty-card .progress { color: var(--ink-2); font-size: .92rem; font-variant-numeric: tabular-nums; }
.loyalty-card .qr { max-width: 13rem; margin: 1.25rem auto .5rem; padding-top: 1.25rem; border-top: 1px dashed var(--line-strong); }
.qr svg { display: block; width: 100%; height: auto; }
.center { text-align: center; }
.auth { max-width: 24rem; padding-top: 12vh; }
.auth .brand-mark { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; font-size: 1.05rem; margin-bottom: 1.5rem; color: var(--ink); }
.auth .brand-mark img { border-radius: 8px; }

/* ---------- Pantalla del empleado ---------- */
.staff-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.staff-head h1 { margin: 0; }
#reader { max-width: 100%; margin-top: 1rem; overflow: hidden; border-radius: var(--radius); }
#reader:empty { display: none; }
.scan-button { width: 100%; min-height: 3.5rem; font-size: 1.05rem; margin-top: 0; }
.result-name { font-size: 1.2rem; font-weight: 620; margin-bottom: .1rem; }

/* ---------- Editor de tarjeta ---------- */
.preview {
    display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; margin-top: 1rem;
    border: 1px solid var(--line); border-radius: var(--radius);
}
.preview .logo { width: 2.75rem; height: 2.75rem; }
.preview strong { display: block; font-size: 1.05rem; }
.preview .chip { display: inline-block; margin-top: .3rem; padding: .2rem .6rem; border-radius: 6px; color: #fff; font-size: .8rem; font-weight: 600; }

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

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.search { display: flex; gap: .5rem; }
.search .button { margin-top: 0; flex: none; }
details .details-body { justify-items: start; }
.panel > .row-head:first-child, .panel > input[type=hidden]:first-child + .row-head { margin-bottom: .25rem; }
.panel > .row-head:first-child h2, .panel > input[type=hidden]:first-child + .row-head h2 { margin: 0; }
.page-head.row-head { align-items: center; }
.page-head.row-head h1 { margin: 0; }
main.read { max-width: 44rem; }
.panel > :first-child,
.panel > input[type=hidden]:first-child + * { margin-top: 0; }

textarea { resize: vertical; line-height: 1.5; }

/* ---------- Encuesta: escala 0-10 y estrellas ---------- */
.scale-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(2.4rem, 1fr)); gap: .3rem; }
.scale-options label { margin: 0; }
.scale-options input { position: absolute; opacity: 0; pointer-events: none; }
.scale-options span {
    display: grid; place-items: center; min-height: 2.75rem; border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); font-weight: 600; cursor: pointer;
}
.scale-options input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.scale-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; }
fieldset.scale + fieldset, fieldset + label { margin-top: 1.25rem; }
.nps { font-size: 1.45rem; font-weight: 620; font-variant-numeric: tabular-nums; }

/* ---------- Tabla comparativa ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 560; color: var(--ink-2); font-size: .82rem; }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.survey-qr { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); text-align: center; }
.figures.three { grid-template-columns: repeat(3, 1fr); }

/* ---------- Puntos: barra con la meta al final (pariente de la fila de sellos) ---------- */
.points-total { margin: 1rem 0 .25rem; color: var(--ink-2); }
.points-total strong { font-size: 2.6rem; font-weight: 680; letter-spacing: -0.03em; line-height: 1; color: var(--accent); margin-right: .15rem; }
.meter { display: flex; align-items: center; gap: .6rem; margin: .75rem 0; }
.meter-track { flex: 1; height: .875rem; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter-goal {
    flex: none; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 50%;
    border: 1.5px dashed var(--line-strong); color: var(--line-strong);
}
.meter-goal .icon { width: 1.35rem; height: 1.35rem; }
.meter-goal.on { border: 0; background: var(--accent); color: var(--on-accent); }
.meter.sm { margin: .6rem 0 0; gap: .4rem; }
.meter.sm .meter-track { height: .5rem; max-width: 12rem; }
.meter.sm .meter-goal { width: 1.4rem; height: 1.4rem; border-width: 1.5px; }
.meter.sm .meter-goal .icon { width: .8rem; height: .8rem; }
.meter-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.meter-row .meter { flex: 1 1 10rem; max-width: 15rem; }
.meter-row .count { color: var(--ink-2); font-size: .85rem; margin-top: .6rem; }

.splits { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; color: var(--ink-2); }
.splits li { display: inline-flex; align-items: center; gap: .3rem; }
.splits .num { color: var(--ink); }

/* ---------- Verificación en dos pasos ---------- */
.code-input { font-size: 1.4rem !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.steps { margin: 0 0 1rem; padding-left: 1.25rem; display: grid; gap: .4rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--sunken); padding: .1rem .35rem; border-radius: 4px; word-break: break-all; }

/* Panel > Funciones: días de la promoción en cuadrícula */
.day-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .5rem 1rem; }
.day-picker .check, fieldset .day-picker .check + .check { margin: 0; }
/* Nivel VIP y promoción del día en tarjeta y caja */
.perk { display: flex; align-items: center; gap: .4rem; margin: .4rem 0 0; font-size: .9rem; font-weight: 560; color: var(--accent); }
.perk .icon { width: 1.05rem; height: 1.05rem; flex: none; }
/* Día y mes del cumpleaños siempre lado a lado */
.date-pair { display: grid; grid-template-columns: 1fr 2fr; gap: 0 1rem; }
/* Aviso del panel de demostración */
.demo-bar { margin: 0; padding: .5rem 1rem; text-align: center; font-size: .85rem; background: var(--accent-soft); color: var(--accent); }

/* Botón oficial de Google Wallet: no se escala libre ni se recolorea; 8 px de aire alrededor */
.wallet-button { display: flex; justify-content: center; margin: .5rem 0; padding: 8px 0; }
.wallet-button img { display: block; height: auto; max-width: 100%; }

/* "Hecho por Ambit": discreto, al pie de las páginas públicas de la plataforma */
.credit { margin-top: 2rem; text-align: center; font-size: .8125rem; color: var(--ink-2); }
.credit a { color: inherit; }

/* Editor de tarjeta: campos a la izquierda, vista previa fija a la derecha; en teléfono la vista previa va arriba */
.app main.wide { max-width: 72rem; }
.editor { display: grid; gap: 1.25rem; }
.editor-fields { display: grid; gap: 1.25rem; min-width: 0; }
.editor-fields .panel { margin: 0; }
.editor-preview { order: -1; }
.chip-label { margin: 0 0 .5rem; color: var(--ink-2); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.card-preview { background: var(--page); border-radius: 18px; padding: 1.25rem 1rem; border: 1px solid var(--line); }
.card-preview .public-head { margin-bottom: 1rem; }
.card-preview .public-head h1 { font-size: 1.15rem; }
.card-preview .logo { width: 2.75rem; height: 2.75rem; border-radius: 10px; object-fit: cover; }
.card-preview .stamps li.on { background: var(--accent); }
@media (min-width: 64rem) {
    .editor { grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; }
    .editor-preview { order: 0; position: sticky; top: 1rem; }
}
/* Un solo botón de guardar por sección, siempre a la vista */
.save-bar {
    position: sticky; bottom: 0; z-index: 5; grid-column: 1 / -1;
    margin: 0 -1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
}
.save-bar .button { width: 100%; }
@media (min-width: 40rem) { .save-bar .button { width: auto; } }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
