/* Demo "Citas por WhatsApp" — maquetación y componentes sobre el sistema de bordes finos (base.css).
   La marca de cada giro entra por variables (--brand, --brand-soft, --accent…) que main.js aplica. */

/* ───────────── Barra de la aplicación ───────────── */
.appbar { position: sticky; top: var(--banner-h); z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.appbar__in { max-width: var(--page-max); margin: 0 auto; padding: 10px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand__logo { width: 32px; height: 32px; flex: none; }
.brand__name { font-weight: 600; font-size: .9375rem; line-height: 1.2; letter-spacing: -.01em; }
.brand__giro { display: block; font-size: var(--fs-xs); color: var(--fog); font-weight: 500; }
.nav { display: flex; gap: 2px; }
.nav a { padding: 6px 14px; border-radius: var(--r-pill); text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: var(--fs-sm); min-height: 34px; display: inline-flex; align-items: center; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--ink); }
.nav .short { display: none; }
.appbar__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.appbar__tools .field { display: flex; align-items: center; }
.appbar__tools select { min-height: 32px; width: auto; padding: 2px 30px 2px 12px; border-radius: var(--r-pill); border-color: var(--line-strong); font-weight: 500; font-size: var(--fs-sm); background-position: right 10px center; }

main { display: block; outline: none; }
.wrap { max-width: var(--page-max); margin: 0 auto; padding: 32px var(--gutter) 64px; }
.foot { max-width: var(--page-max); margin: 0 auto; padding: 18px var(--gutter) 36px; color: var(--muted); font-size: var(--fs-sm); display: grid; gap: 6px; border-top: 1px solid var(--line); }

/* ───────────── Portada ───────────── */
.hero { position: relative; text-align: center; padding: 28px 0 0; }
.hero::before { content: ""; position: absolute; inset: -32px calc(-1 * var(--gutter)) auto; height: 520px; z-index: -1; background-image: radial-gradient(#d4d4d4 1px, transparent 1.3px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent 92%); mask-image: linear-gradient(to bottom, #000 25%, transparent 92%); opacity: .7; }
h1[tabindex="-1"]:focus { outline: none; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); line-height: 1.06; letter-spacing: -.03em; font-weight: 500; max-width: 21ch; margin: 24px auto 0; }
.hero__sub { display: block; margin-top: .5em; font-size: .6em; line-height: 1.25; letter-spacing: -.015em; font-weight: 400; color: var(--muted); }
.giro-picker legend { font-size: var(--fs-sm); margin: 0 auto 10px; padding: 0; color: var(--ink-2); font-weight: 500; text-align: center; width: 100%; }
.giro-cards { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.giro-card { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px 5px 7px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer; transition: border-color .15s, box-shadow .15s; box-shadow: var(--sh-1); }
.giro-card:hover { border-color: var(--line-strong); }
.giro-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.giro-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.giro-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
.giro-card__logo { width: 26px; height: 26px; flex: none; }
.giro-card strong { font-size: var(--fs-sm); font-weight: 500; }
.cta-row { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 26px; }

/* Producto a la vista (decorativo): el teléfono con la conversación y, al lado, la agenda donde entra la cita */
.mock { position: relative; display: flex; align-items: stretch; justify-content: center; gap: .75rem; max-width: 46rem; margin: 44px auto 0; text-align: left; }
.mock__link { align-self: center; flex: none; position: relative; z-index: 2; margin-inline: -1.1rem; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); color: var(--brand); box-shadow: var(--sh-1); }
.mock__agenda { flex: 1 1 19rem; min-width: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-md); overflow: hidden; }
.mock__agenda-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mock__agenda-head svg { width: 30px; height: 30px; flex: none; }
.mock__agenda-head b { display: block; font-size: var(--fs-md); font-weight: 600; line-height: 1.2; }
.mock__agenda-head small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.mock__table { flex: 1; align-content: start; display: grid; min-height: 20rem; } /* alto reservado para cinco filas: al entrar la cita nueva nada se mueve */
.mock__agenda-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.mock__agenda-foot .ic { color: var(--brand); }
.mock__row { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.mock__row:last-child { border-bottom: 0; }
.mock__row .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.mock__row .who { min-width: 0; }
.mock__row .who b, .mock__row .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock__row .who b { font-weight: 600; }
.mock__row .who small { color: var(--muted); font-size: var(--fs-xs); }
/* Fila nueva: se abre con altura y un resaltado que se apaga solo */
.mock__row--new { max-height: 0; padding-block: 0; opacity: 0; overflow: hidden; border-bottom-width: 0; transition: max-height .5s var(--ease), padding .5s var(--ease), opacity .4s var(--ease) .1s; }
.mock__row--new.is-on { max-height: 5.5rem; padding-block: 11px; opacity: 1; border-bottom-width: 1px; animation: row-glow 2.6s ease-out; }
.mock__row--new.is-on .who small { color: var(--brand); font-weight: 600; }
@keyframes row-glow { 0%, 35% { background: var(--brand-soft); } 100% { background: transparent; } }
/* Teléfono de la portada: el mismo marco del simulador (.wa-device), a menor tamaño y todo en rem para que crezca con la letra */
.mock__phone { --dev-r: 2.7rem; --dev-metal: 4px; --dev-bezel: 5px; flex: none; align-self: center; width: 16.5rem; max-width: none; margin: 0; text-align: left; }
.mock__screen { position: relative; overflow: hidden; background: #ece7de; border: var(--dev-bezel) solid #050505; border-radius: calc(var(--dev-r) - var(--dev-metal)); }
.mock__screen .wa-island { --isl-w: 5.2rem; --isl-h: 1.45rem; --isl-top: .55rem; }
.mock__phone-head { display: flex; align-items: center; gap: 8px; padding: 2.55rem 11px 9px; background: #0b5f55; color: #fff; }
.mock__phone-head svg { width: 28px; height: 28px; border-radius: 50%; background: #fff; flex: none; }
.mock__phone-head b { display: block; font-size: .86rem; line-height: 1.15; }
.mock__phone-head small { font-size: .76rem; color: #d4efe9; }
.mock__chat { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; height: 17.5rem; overflow: hidden; padding: 10px 8px 14px; transition: opacity .4s var(--ease); background-image: radial-gradient(rgba(11, 95, 85, .06) 1.2px, transparent 1.4px); background-size: 18px 18px; }
.mock__chat.is-out { opacity: 0; }
.mock__b { display: none; max-width: 88%; padding: 7px 10px; border-radius: 10px; font-size: .86rem; line-height: 1.35; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); color: #111b21; }
.mock__b.is-on { display: block; flex: none; animation: mock-in .42s var(--ease); }
.mock__typing { display: none; flex: none; align-self: flex-start; gap: 4px; padding: 10px 12px; background: #fff; border-radius: 10px; border-top-left-radius: 3px; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); }
.mock__typing.is-on { display: inline-flex; animation: mock-in .25s var(--ease); }
.mock__typing i { width: 6px; height: 6px; border-radius: 50%; background: #7d8b93; animation: wa-dot 1s infinite ease-in-out; }
.mock__typing i:nth-child(2) { animation-delay: .15s; } .mock__typing i:nth-child(3) { animation-delay: .3s; }
.mock__b--out { align-self: flex-end; background: #d9f6cf; border-top-right-radius: 3px; } .mock__b--in { border-top-left-radius: 3px; }
@keyframes mock-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* Cómo funciona: tres pasos numerados, cada uno con un fragmento verdadero */
.how { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 72px; max-width: 1320px; margin-inline: auto; }
.how__step { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; transition: border-color .2s, box-shadow .2s; }
.how__step:hover { border-color: var(--line-strong); box-shadow: var(--sh-md); }
.how__top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.how__n { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.how__step h2 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.how__step p { color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.snip { margin-top: auto; padding: 14px 12px 12px; display: grid; gap: 6px; align-content: end; background: #ece7de; border-radius: var(--r-lg); }
.how__step > p + .snip { margin-top: 16px; }
.snip__b { max-width: 92%; padding: 7px 10px; border-radius: 10px; font-size: var(--fs-xs); line-height: 1.4; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); color: #111b21; white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 9; line-clamp: 9; }
.snip__b--out { justify-self: end; background: #d9f6cf; border-top-right-radius: 3px; } .snip__b--in { justify-self: start; border-top-left-radius: 3px; }
.snip__rows { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.snip__rows .mock__row { grid-template-columns: 4.6rem minmax(0, 1fr) auto; padding: 10px 12px; gap: 10px; }
.snip__rows .mock__row.is-new { background: var(--brand-soft); }
.snip__rows .badge { font-size: .75rem; padding: 1px 8px; }
.trust { max-width: 1320px; margin-inline: auto; margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; padding: 14px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink-2); font-size: var(--fs-sm); }
.trust > span { display: inline-flex; gap: 9px; align-items: flex-start; }
.trust .ic { color: var(--brand); margin-top: 2px; }
.trust strong { color: var(--ink); font-weight: 600; }

/* Cuadro de icono de color (un solo acento por cuadro) */
.chip-ic { width: 36px; height: 36px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center; background: #fff; border: 1px solid var(--line); }
.chip-ic--ok { color: var(--green); } .chip-ic--warn { color: var(--danger); } .chip-ic--brand { color: var(--brand); }
.chip-ic--amber { color: var(--orange); } .chip-ic--indigo { color: var(--violet); } .chip-ic--slate { color: var(--fog); }

/* ───────────── Pantalla de la demo ───────────── */
.demo-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 18px; margin-bottom: 20px; }
.demo-head > div { flex: 1 1 480px; min-width: 0; }
.demo-head h1 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); }
.demo-head p { color: var(--muted); font-size: var(--fs-sm); margin-top: 6px; max-width: 64ch; }
.demo-tabs { display: none; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: var(--r-sm); margin-bottom: 14px; }
.demo-tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 6px; background: transparent; font-weight: 500; font-size: var(--fs-sm); cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-2); }
.demo-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.demo-tabs .dot { position: absolute; top: 9px; right: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #fff; }
.demo-grid { display: grid; grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
.demo-phone { position: sticky; top: calc(var(--banner-h) + 84px); display: grid; gap: 16px; }
.demo-phone .wa-phone { --phone-h: min(700px, calc(100vh - var(--banner-h) - 180px)); min-height: 520px; }
.tools { padding: 16px; }
.tools h2 { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 12px; letter-spacing: -.005em; }
.tools__row { display: flex; flex-wrap: wrap; gap: 8px; }
.mode { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mode legend { padding: 0; margin-bottom: 8px; }
.seg-radio, .seg { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 3px; background: var(--surface-3); border-radius: var(--r-sm); gap: 2px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-radio label { position: relative; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-radio span { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 14px; border-radius: 6px; font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); transition: background .15s, color .15s; }
.seg-radio input:checked + span, .seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.seg button { flex: none; white-space: nowrap; min-height: 32px; padding: 4px 14px; border: 0; border-radius: 6px; background: transparent; font-weight: 500; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.mode__status { font-size: var(--fs-sm); color: var(--muted); margin-top: 10px; }

/* Panel en vivo */
.live { display: grid; gap: 16px; }
.live__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.live__head h2 { font-size: var(--fs-xl); display: flex; align-items: center; gap: 10px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pulse 1.9s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.stat b { display: block; font-size: 1.5rem; line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.feed li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; padding: 10px 6px; font-size: var(--fs-sm); }
.feed li + li { border-top: 1px solid var(--line); }
.feed .chip-ic { width: 32px; height: 32px; }
.feed li.is-new { animation: slide-in .4s var(--ease); background: var(--brand-soft); border-radius: var(--r-sm); }
.feed li.is-urgent { background: var(--danger-soft); border-radius: var(--r-sm); }
.feed time { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; font-weight: 500; padding-top: 3px; }
.feed__txt { padding-top: 5px; line-height: 1.4; }
@keyframes slide-in { from { transform: translateX(12px); } to { transform: none; } }

.panel-card { padding: 16px; }
.panel-card h3 { font-size: var(--fs-md); display: flex; align-items: center; gap: 8px; }
.panel-card h3 .ic { color: var(--brand); }
.panel-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.daynav { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.pro-cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.pro-col { background: var(--surface-2); border-radius: var(--r-lg); padding: 12px; display: grid; gap: 8px; align-content: start; }
.pro-col h4 { margin: 0; font-size: var(--fs-sm); display: flex; gap: 10px; align-items: center; font-weight: 600; }
.pro-col h4 small { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }
.initials { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .76rem; font-weight: 600; letter-spacing: .02em; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line); }
.empty { color: var(--muted); font-size: var(--fs-sm); padding: 6px 2px; }
.appt-chip { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; text-align: left; width: 100%; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.appt-chip:hover { border-color: var(--line-strong); border-left-width: 3px; background: var(--surface-2); }
.appt-chip__time { font-weight: 600; font-size: .86rem; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.appt-chip__who { font-weight: 500; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-chip__svc { grid-column: 1 / -1; font-size: .86rem; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-pendiente { border-left-color: #eab308; } .st-confirmada { border-left-color: #22c55e; } .st-reprogramada { border-left-color: #3b82f6; }
.st-cancelada { border-left-color: #ef4444; opacity: .8; } .st-no_asistio { border-left-color: #f97316; } .st-atendida { border-left-color: #a3a3a3; }
.st-cancelada .appt-chip__who { text-decoration: line-through; }
.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--brand-ring); background: var(--brand-soft); } 100% { box-shadow: none; } }

.week-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.week { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 580px; font-size: .86rem; }
.week th, .week td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px; vertical-align: top; background: #fff; }
.week tr > :last-child { border-right: 0; } .week tbody tr:last-child > * { border-bottom: 0; }
.week thead th { background: var(--surface-2); font-size: .81rem; color: var(--muted); font-weight: 500; }
.week th[scope="row"] { text-align: left; font-size: .86rem; background: var(--surface-2); min-width: 130px; color: var(--ink); font-weight: 600; }
.week th small { display: block; color: var(--muted); font-weight: 400; }
.week .is-today { background: var(--brand-soft); }
.mini { display: flex; align-items: center; gap: 4px; width: 100%; margin-bottom: 4px; padding: 3px 7px; font-size: .81rem; font-weight: 600; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 6px; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini:hover { border-color: var(--line-strong); background: var(--surface-2); }

.rem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rem-list li { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.rem-list li b { font-weight: 600; }
.rem-list li small { display: block; color: var(--muted); font-size: .86rem; }
.rem-more { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-top: 10px; }
.rem-list__act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Ventana de la cita */
.date-field { display: grid; gap: 4px; }
.date-text { min-height: 1.3em; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0 0 14px; font-size: var(--fs-sm); }
.dl dt { color: var(--muted); font-weight: 500; } .dl dd { margin: 0; }
.sec { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; display: grid; gap: 12px; }
.sec h3 { font-size: var(--fs-sm); letter-spacing: 0; color: var(--muted); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.row > .field { flex: 1 1 140px; }
.hist { margin: 0; padding-left: 18px; font-size: .91rem; color: var(--muted); display: grid; gap: 5px; }

/* ───────────── Panel de administración ───────────── */
.gate { max-width: 480px; margin: 56px auto; text-align: center; display: grid; gap: 14px; justify-items: center; padding: 36px 28px; }
.gate h1 { font-size: 1.75rem; }
.admin-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
.admin-side { position: sticky; top: calc(var(--banner-h) + 84px); display: grid; gap: 14px; }
.admin-layout > *, .cfg-layout > *, .cfg > *, .split > * { min-width: 0; }
.side-card { padding: 0; min-width: 0; }
.side-title { padding: 0 10px 6px; font-size: var(--fs-xs); font-weight: 500; color: var(--fog); }
.admin-nav { display: grid; gap: 2px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: var(--fs-sm); min-height: 38px; transition: background .15s, color .15s; }
.admin-nav a:hover { background: var(--surface-3); color: var(--ink); }
.admin-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--ink); }
.admin-nav a[aria-current="page"] .ic { color: var(--brand); }
.admin-nav .count { margin-left: auto; }
.side-actions { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-actions .btn { justify-content: flex-start; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(1.5rem, 2.8vw, 1.875rem); }
.page-head p { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.count { background: var(--danger); color: #fff; border-radius: var(--r-pill); font-size: .76rem; font-weight: 600; padding: 0 7px; min-width: 20px; text-align: center; line-height: 1.6; }

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "chip label" "value value" "sub sub"; gap: 6px 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.kpi .chip-ic { grid-area: chip; width: 32px; height: 32px; }
.kpi__label { grid-area: label; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); line-height: 1.25; }
.kpi__value { grid-area: value; margin-top: 6px; font-size: 1.875rem; font-weight: 600; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi__sub { grid-area: sub; font-size: var(--fs-xs); color: var(--muted); }
.kpi__sub--alert { color: var(--danger) !important; font-weight: 600; }
.kpi.is-bump .kpi__value, .stat b.is-bump { animation: bump .6s var(--ease); }
@keyframes bump { 40% { transform: scale(1.08); color: var(--brand); } }
.help { margin-bottom: 16px; font-size: var(--fs-sm); color: var(--muted); }
.help summary { cursor: pointer; font-weight: 500; padding: 4px 0; }
.help p { margin-top: 6px; max-width: 80ch; }

.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.cal-bar .grow { flex: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.cal-scroll { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; max-height: 74vh; }
.cal { --px: 1.5px; display: grid; grid-template-columns: 5rem repeat(var(--cols), minmax(138px, 1fr)); min-width: min(100%, calc(5rem + var(--cols) * 138px)); position: relative; }
.cal__head { position: sticky; top: 0; z-index: 4; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 10px; line-height: 1.2; }
.cal__head b { font-size: var(--fs-sm); font-weight: 600; }
.cal__head small { display: block; color: var(--muted); font-weight: 400; font-size: .81rem; }
.cal__dnum { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .9rem; background: var(--surface-3); flex: none; font-variant-numeric: tabular-nums; }
.cal__head.is-today .cal__dnum { background: var(--brand); color: #fff; }
.cal__corner { position: sticky; top: 0; left: 0; z-index: 6; background: #fff; border-bottom: 1px solid var(--line); }
.cal__times { position: sticky; left: 0; z-index: 3; background: #fff; border-right: 1px solid var(--line); }
.cal__times span { position: absolute; right: 8px; white-space: nowrap; transform: translateY(-50%); font-size: .76rem; color: var(--fog); background: #fff; padding: 0 2px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal__col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, #efefef 0 1px, transparent 1px calc(60 * var(--px))); }
.cal__col.is-over { background-color: var(--brand-soft); }
.cal__off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #fafafa 0 6px, #f3f3f3 6px 12px); display: flex; align-items: center; justify-content: center; font-size: .81rem; color: var(--muted); font-weight: 500; pointer-events: none; text-align: center; }
.cal__drop { position: absolute; left: 3px; right: 3px; height: 3px; background: var(--brand); border-radius: 3px; z-index: 2; pointer-events: none; }
.cal__drop::after { content: attr(data-t); position: absolute; right: 0; top: -20px; background: var(--brand); color: #fff; font-size: .76rem; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); }
.cal-appt { position: absolute; left: 4px; right: 4px; z-index: 1; overflow: hidden; padding: 4px 8px; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--r-sm); cursor: grab; font-size: .84rem; line-height: 1.28; display: block; transition: box-shadow .15s, background .15s; }
.cal-appt b { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* El servicio se lee completo: hasta dos líneas (una en las citas cortas) en vez de «Ses…» */
.cal-appt .cal-appt__svc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--muted); }
.cal-appt .cal-appt__when { display: block; margin-top: 1px; color: var(--ink-2); font-size: .78rem; font-weight: 500; line-height: 1.3; }
.cal-appt .cal-appt__t, .cal-appt .cal-appt__st { display: inline-block; white-space: nowrap; margin-right: .4em; }
.cal-appt .cal-appt__st { color: var(--ink-2); font-weight: 500; font-size: .78rem; }
.cal-appt:hover { z-index: 3; box-shadow: var(--sh-md); }
.cal-appt.is-dragging { opacity: .4; }
.cal-appt.st-pendiente { background: #fffdf2; } .cal-appt.st-confirmada { background: #f6fef8; } .cal-appt.st-reprogramada { background: #f5f9ff; }
.cal-appt.st-cancelada { background: #fef7f7; } .cal-appt.st-no_asistio { background: #fff9f3; } .cal-appt.st-atendida { background: #fafafa; }

/* Vista «Todos»: un color por profesional (borde y fondo suave); el estado sigue en el ícono y el texto */
.pro-c0 { --pc: #4f46e5; } .pro-c1 { --pc: #0d9488; } .pro-c2 { --pc: #d97706; } .pro-c3 { --pc: #e11d48; } .pro-c4 { --pc: #0284c7; } .pro-c5 { --pc: #65a30d; }
.cal-appt.is-narrow { padding: 4px 5px; }
.cal-appt .cal-appt__ic { display: block; color: var(--ink-2); }
.cal-appt.is-pro { border-left-color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, #fff); }
.cal-appt.is-pro.st-cancelada { opacity: .65; }
.legend--pros { gap: 6px 18px; }
.pro-key { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 500; }
.pro-key i { width: 12px; height: 12px; border-radius: 4px; background: var(--pc); flex: none; }
/* Hora actual en el día de hoy */
.cal__now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 2; pointer-events: none; }
.cal__now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal__now span { position: absolute; right: 4px; top: -11px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 600; padding: 0 6px; border-radius: var(--r-pill); font-variant-numeric: tabular-nums; }
/* En móvil el día es una lista de tarjetas */
.cal-scroll.is-list { max-height: none; border: 0; overflow: visible; background: transparent; }
.day-list { display: grid; gap: 8px; }
.day-card { display: grid; grid-template-columns: 4.8rem minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--r-lg); cursor: pointer; }
.day-card:hover { background: var(--surface-2); }
.day-card__time { font-weight: 600; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.day-card__body b { display: block; font-weight: 600; }
.day-card__body small { display: block; color: var(--muted); font-size: var(--fs-xs); }

.split { display: grid; grid-template-columns: minmax(320px, 30%) minmax(0, 1fr); gap: 20px; align-items: start; }
.inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.inbox button { width: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer; transition: border-color .15s, background .15s; }
.inbox button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.inbox button[aria-current="true"] { border-color: var(--brand); background: var(--brand-soft); }
.inbox .initials { grid-row: 1 / span 3; width: 38px; height: 38px; font-size: .84rem; }
.inbox .is-urgent { border-left: 4px solid var(--danger); background: #fffafa; }
.inbox button.is-urgent[aria-current="true"] { border-left-color: var(--danger); }
.inbox button.is-human[aria-current="true"] { border-left-color: #eab308; }
.inbox .is-human { border-left: 4px solid #eab308; }
.inbox .is-urgent .initials { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.inbox .initials--urgent { background: var(--danger); color: #fff; border-color: var(--danger); }
.inbox .is-human .initials { background: var(--warn-soft); color: #854d0e; border-color: #fde68a; }
.inbox__top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-weight: 600; font-size: var(--fs-sm); }
.inbox__top time { font-weight: 400; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.inbox__snip { color: var(--muted); font-size: .91rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.inbox__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.thread { display: grid; gap: 12px; }
.thread__msgs { display: grid; gap: 6px; padding: 14px; background: #ece7de; border-radius: var(--r-lg); max-height: 52vh; overflow-y: auto; align-content: start; }
.tmsg { max-width: 82%; padding: 7px 11px; border-radius: 10px; font-size: .9rem; background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); white-space: pre-wrap; overflow-wrap: anywhere; }
.tmsg time { display: block; text-align: right; font-size: .76rem; color: #4b5b64; }
.tmsg--user { justify-self: end; background: #d9f6cf; }
.tmsg--redacted { background: #e5e7eb; color: #4b5563; font-style: italic; box-shadow: none; border: 1px dashed #9ca3af; }
.tmsg--redacted .ic { vertical-align: -.2em; }
.tmsg--staff { background: #dbeafe; } .tmsg--sys { justify-self: center; background: #fef9c3; font-size: .84rem; font-weight: 500; }
.tmsg small { display: block; font-weight: 600; color: var(--brand-dark); }
.back-link { display: none; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.t th, table.t td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
table.t th[scope="row"] { font-size: var(--fs-sm); color: var(--ink); font-weight: 500; }
table.t tbody tr:hover { background: var(--surface-2); }
.cfg { display: grid; gap: 16px; }
.cfg-layout { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: clamp(20px, 2.5vw, 36px); align-items: start; }
.cfg-nav { position: sticky; top: calc(var(--banner-h) + 84px); display: grid; gap: 2px; }
.cfg-nav__a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); font-weight: 500; font-size: var(--fs-sm); text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.cfg-nav__a:hover { background: var(--surface-3); color: var(--ink); }
.cfg-nav__a[aria-current="true"] { background: var(--brand-soft); color: var(--ink); }
.cfg-nav__a[aria-current="true"] .ic { color: var(--brand); }
.cfg > section { scroll-margin-top: calc(var(--banner-h) + 84px); }
/* Vista previa de cada mensaje: la burbuja de WhatsApp con datos de ejemplo */
.wa-prev { display: grid; gap: 6px; padding: 12px; background: #ece7de; border-radius: var(--r-lg); }
.wa-prev small { color: #3c4750; font-size: var(--fs-xs); font-weight: 600; }
.wa-prev__b { justify-self: start; max-width: 36rem; padding: 8px 12px; background: #fff; color: #111b21; border-radius: 10px; border-top-left-radius: 3px; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); font-size: var(--fs-sm); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cfg h2 { font-size: var(--fs-md); font-weight: 600; margin-bottom: 4px; letter-spacing: -.01em; }
.cfg textarea { field-sizing: content; min-height: 6.5rem; max-height: 20rem; }
.autosave { display: flex; gap: 9px; align-items: center; font-size: var(--fs-sm); font-weight: 500; color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--r-sm); padding: 10px 14px; }
.cfg__grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card__head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.card__head h2 { margin: 0; }
.card__head p { color: var(--muted); font-size: var(--fs-sm); }
.hours-row { display: grid; grid-template-columns: 110px auto 1fr; gap: 8px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-row .times { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hours-row input[type="time"] { min-height: 36px; width: auto; padding: 4px 10px; }
.svc-row { display: grid; grid-template-columns: minmax(150px, 2fr) 90px 110px auto auto; gap: 8px 14px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pro-card { border-radius: var(--r-lg); padding: 14px; display: grid; gap: 12px; background: var(--surface-2); }
.pro-card legend { padding: 0 6px; font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.vars { font-size: var(--fs-sm); color: var(--muted); }
.vars code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ───────────── Modo presentación ───────────── */
.pres { position: fixed; z-index: 70; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(94vw, 720px); background: var(--black); color: #f5f5f5; border-radius: var(--r-xl); padding: 16px 18px; box-shadow: var(--sh-md), 0 0 0 1px #262626; }
.pres__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: var(--fs-xs); color: #a3a3a3; font-weight: 500; letter-spacing: 0; }
.pres__bar { height: 3px; background: #262626; border-radius: 3px; overflow: hidden; margin: 8px 0 12px; }
.pres__bar i { display: block; height: 100%; background: #fff; transition: width .35s var(--ease); }
.pres h2 { font-size: var(--fs-lg); color: #fff; margin-bottom: 4px; font-weight: 600; }
.pres p { color: #d4d4d4; font-size: var(--fs-sm); line-height: 1.55; }
.pres__act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 14px; }
.pres .btn { background: #171717; border-color: #404040; color: #fff; box-shadow: none; }
.pres .btn:hover { background: #262626; }
.pres .btn--primary { background: #fff; border-color: #fff; color: var(--black); }
.pres .btn--primary:hover { background: #e5e5e5; }
.pres :focus-visible { outline-color: #fff; }
.pres-hl { outline: 2px solid var(--black) !important; outline-offset: 3px; box-shadow: 0 0 0 7px var(--brand-ring) !important; border-radius: var(--r-lg); animation: hl 1.6s ease-in-out infinite; }
.wa-device.pres-hl { border-radius: var(--dev-r); }
@keyframes hl { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--brand) 14%, transparent) !important; } }
body.is-presenting main { padding-bottom: 190px; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1100px) {
  .pres { left: 50%; right: auto; }
}
/* Pantallas anchas: texto a la izquierda y la vista del producto a la derecha, para no dejar blanco a los lados */
@media (min-width: 1280px) {
  .hero { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 4vw, 80px); align-items: center; text-align: left; padding: 1.25rem 0 0; }
  .hero::before { inset: -32px -40px auto; height: 100%; min-height: 520px; }
  .hero h1 { font-size: clamp(2.3rem, 2.8vw, 3.4rem); max-width: none; margin: 22px 0 0; }
  .giro-picker legend { text-align: left; margin-left: 0; }
  .giro-cards { justify-content: flex-start; }
  .cta-row { justify-content: flex-start; }
  .mock { margin: 0; max-width: none; justify-content: flex-end; }
}
@media (min-width: 1500px) {
  .hero { grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); }
}
@media (max-width: 1279px) {
  /* Con la letra más grande, la barra superior pasa a dos filas: las herramientas quedan alineadas a la derecha. */
  .appbar__tools { margin-left: auto; }
}
@media (max-width: 760px) {
  /* En una columna: el teléfono arriba y la agenda debajo */
  .mock { flex-direction: column; align-items: center; }
  .mock__link { display: none; }
  .mock__agenda { flex: none; width: 100%; max-width: 28rem; }
}
@media (max-width: 1023px) {
  .demo-tabs { display: flex; }
  .demo-grid { grid-template-columns: minmax(0, 1fr); }
  .demo-grid[data-tab="chat"] .demo-panel, .demo-grid[data-tab="panel"] .demo-phone { display: none; }
  .demo-phone { position: static; }
  .demo-phone .wa-phone { --phone-h: min(640px, calc(100dvh - var(--banner-h) - 220px)); }
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .admin-side { position: static; }
  .admin-nav { display: flex; overflow-x: auto; gap: 4px; }
  .admin-nav a { flex: none; }
  .side-title { display: none; }
  .side-actions { display: flex; flex-wrap: wrap; border-top: 0; padding-top: 0; }
}
@media (min-width: 1024px) and (max-height: 840px) {
  /* Ventanas bajas (1366 × 768): el titular de la demo se compacta para que el teléfono y su chat tengan más alto */
  .demo-head p { display: none; }
  .demo-head { margin-bottom: 12px; }
  .demo-phone .wa-phone { --phone-h: min(700px, calc(100vh - var(--banner-h) - 150px)); }
}
@media (max-width: 1100px) {
  .cfg-layout { grid-template-columns: minmax(0, 1fr); }
  .cfg-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .cfg-nav__a { flex: none; border: 1px solid var(--line); border-radius: var(--r-pill); background: #fff; }
}
@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split[data-view="list"] .thread-pane, .split[data-view="thread"] .list-pane { display: none; }
  .back-link { display: inline-flex; }
  .svc-row { grid-template-columns: 1fr 1fr; }
  .svc-row .field:first-child { grid-column: 1 / -1; }
  .hours-row { grid-template-columns: 1fr; }
}
@media (max-width: 759px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "value" "sub"; gap: 2px; padding: 12px; }
  .kpi .chip-ic { display: none; }
  .kpi__label { font-size: var(--fs-xs); }
  .kpi__value { margin-top: 2px; font-size: 1.625rem; }
  .kpi__sub { font-size: .78rem; line-height: 1.3; }
  .help { margin-bottom: 12px; }
}
@media (max-width: 700px) {
  .appbar { position: static; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav a { flex: 1; justify-content: center; }
}
@media (max-width: 520px) {
  .wrap { padding: 16px 14px 44px; }
  .appbar__in { padding: 8px 12px; gap: 8px; }
  .nav .long { display: none; } .nav .short { display: inline; }
  .brand__giro { display: none; }
  .appbar__tools { flex: 1 1 100%; gap: 6px; flex-wrap: nowrap; }
  .appbar__tools .field { flex: 0 1 auto; min-width: 0; }
  .appbar__tools select { padding: 2px 24px 2px 10px; font-size: .84rem; max-width: 122px; min-width: 0; background-position: right 7px center; }
  .appbar__tools .btn { padding: 4px 9px; font-size: .84rem; white-space: nowrap; gap: 4px; flex: 0 0 auto; }
  .demo-head p { display: none; }
  .demo-head > .btn { display: none; }
  .hero { padding-top: 16px; }
  .hero::before { inset: -16px -14px auto; }
  .cta-row .btn--lg { flex: 1 1 100%; }
  .stats { gap: 8px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .kpi { padding: 14px; }
  .pres { bottom: 8px; padding: 14px; }
  .pres p { font-size: .9rem; }
}
@media (max-width: 420px) {
  /* En un teléfono angosto la barra de herramientas no cabe con texto: «Reiniciar demo» queda como ícono (sigue con nombre accesible) */
  .appbar__tools { flex-wrap: wrap; }
  #btn-reset .btn__lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 1100px) {
  /* En pantallas anchas la nota de la presentación va abajo a la derecha: el teléfono queda a la vista. */
  .pres { left: auto; right: 24px; transform: none; width: min(540px, 42vw); }
}
/* ───────────── Movimiento ─────────────
   Entrada de la pantalla (solo al llegar a ella), aparición al hacer scroll y micro-interacciones.
   Lo que depende de JS va detrás de html.js-motion: sin JS todo se ve igual, sin animación. */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }

/* Solo la portada anima su entrada; el resto de las pantallas cambia sin desvanecido ni desplazamiento. */

/* Portada: cada pieza entra con su retraso (giros → titular → botones → vista del producto) */
main[data-enter] .hero__copy > *, main[data-enter] .hero > .mock { animation: rise .8s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 95ms); }
main[data-enter] .hero__copy > :nth-child(2) { --i: 1; } main[data-enter] .hero__copy > :nth-child(3) { --i: 2; }
main[data-enter] .hero > .mock { --i: 3; animation-duration: 1.1s; }
main[data-enter] .hero::before { animation: fade 1.4s ease-out; }

/* Aparición al hacer scroll */
.js-motion [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease) var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms), border-color .2s, box-shadow .2s; }
.js-motion [data-reveal].is-visible { opacity: 1; transform: none; }
.js-motion [data-reveal].is-instant { transition: border-color .2s, box-shadow .2s; }

/* Micro-interacciones: botones, píldoras, giros, tarjetas, filas */
.btn { transition: background .15s var(--ease), border-color .15s var(--ease), color .15s, transform .15s var(--ease), box-shadow .2s var(--ease); }
.btn:not([disabled]):hover { transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn:not([disabled]):active { transform: translateY(0) scale(.97); box-shadow: var(--sh-1); }
.btn--ghost:not([disabled]):hover { box-shadow: none; }
.giro-card { transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
.giro-card:hover { transform: translateY(-1px); }
.giro-card:has(input:checked) { transform: translateY(-1px); }
.giro-card__logo { transition: transform .3s var(--ease); }
.giro-card:hover .giro-card__logo, .giro-card:has(input:checked) .giro-card__logo { transform: scale(1.12); }
.kpi { transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.kpi:hover { border-color: var(--line-strong); box-shadow: var(--sh-md); transform: translateY(-2px); }
.inbox button:hover { transform: translateX(2px); }
.cal-appt:hover { box-shadow: var(--sh-md); z-index: 3; }
.cal-appt.is-enter { animation: pop .45s var(--ease) calc(var(--e, 0) * 28ms) backwards; }
.cal-appt.is-enter.flash { animation: pop .45s var(--ease) calc(var(--e, 0) * 28ms) backwards, flash 2.2s ease-out; }
.brand__logo { transition: transform .35s var(--ease); }
.brand:hover .brand__logo { transform: rotate(-8deg) scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .pulse, .pres-hl, .mock__typing i { animation: none !important; }
  .js-motion [data-reveal] { opacity: 1; transform: none; }
  .btn:not([disabled]):hover, .kpi:hover, .giro-card:hover { transform: none; }
}
