/* ═══════════ ROMO Planos · tema KUBYKA con la marca Romero Contract ═══════════
   Se carga DESPUÉS de los estilos del artefacto de Mauro y solo redefine: los cambios de Mauro
   siguen entrando con el importador sin tocar este fichero.
   Marca (roco.es, sep-2026): azul tinta #172430 · beige #F2F0EC · grises #5F6B73 / #A9B4BC ·
   rojo Contract #D21F28 (la línea del logo) · Manrope.
   Firma visual: la línea roja del logo marca «dónde estás» (modo, pestaña y paso actuales).
   Todo lo demás es tinta sobre papel: sin colores de adorno. */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── tokens: claro (papel) ── */
:root {
  --bg: #f2f0ec; --surface: #ffffff; --raised: #ffffff; --subtle: #f8f7f4; --sunken: #e9e6e0;
  --ink: #172430; --ink-2: #3c4a56; --ink-3: #5f6b73;
  --line: #e4e0d9; --line-strong: #cdc8bf;
  --accent: #172430; --accent-hover: #1d2c3a; --accent-ink: #f2f0ec; --accent-soft: #e8ebee; --accent-line: #a9b4bc;
  --rc: #d21f28;                     /* rojo Contract: solo para la marca de posición */
  --slate: #3d5a73;                  /* azul pizarra de Romero: zonas y selección en el plano */
  --halo: #9c845a;                   /* halo de las opciones que esperan: el bronce de ROMO, un punto más hondo para que se vea sobre blanco */
  --cota: #c4202a; --danger: #b3261e; --danger-soft: #fbeceb; --ok: #2f6b4f; --ok-soft: #e5f0ea;
  --warn: #8a5a12; --warn-soft: #f8f0e1; --warn-line: #e6d2ab;
  --d-compacta: #b5523b; --d-comoda: #b8862b; --d-amplia: #4f7a94; --d-premium: #74597f;
  --f-display: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(23, 36, 48, .05);
  --sh-2: 0 6px 18px rgba(23, 36, 48, .08), 0 1px 2px rgba(23, 36, 48, .05);
  --sh-3: 0 24px 60px rgba(23, 36, 48, .22);
  --ring: 0 0 0 3px rgba(23, 36, 48, .18);
  --pared-mezcla: multiply; --pared-filtro: none; --pared-opacidad: .85;   /* textura de ROMO: el blanco toma el beige */
  --romo: #ad9e82; --romo-fondo: #172430;   /* bronce y tinta del icono de ROMO (igual en los dos temas) */
  --h: 40px; --h-sm: 32px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-fuerte: cubic-bezier(.23, 1, .32, 1);   /* salida marcada: entradas de la bienvenida */
  --ease-rebote: cubic-bezier(.34, 1.3, .64, 1);  /* se pasa un poco y se asienta: tarjetas al entrar */
  /* resultado final: la tarjeta toma el fondo de la zona de trabajo (beige en claro, azul petróleo hondo en oscuro)
     y se separa así de la barra lateral. La carga de cada zona va en tonos madera, como las mesas del plano: de
     arena (poca) a nogal (llena); en oscuro, de bronce a beige */
  --res-bg: var(--bg); --res-ink: var(--ink); --res-warn: var(--warn); --res-bajo: #cbb892; --res-lleno: #5a4630;
}
/* ── tokens: oscuro (azul tinta de la marca, no negro) ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e151c; --surface: #15202a; --raised: #1a2632; --subtle: #111a22; --sunken: #1d2a36;
    --ink: #eef0f1; --ink-2: #bcc5cc; --ink-3: #94a0a9;
    --line: #233240; --line-strong: #35495b;
    --accent: #f2f0ec; --accent-hover: #ffffff; --accent-ink: #172430; --accent-soft: #22313f; --accent-line: #4a5f72;
    --rc: #e5484d; --slate: #8fb0c8; --halo: #c9b48a;
    --cota: #ff7b83; --danger: #ff8a80; --danger-soft: #3a1f1f; --ok: #7cc39c; --ok-soft: #16281f;
    --warn: #e8b35c; --warn-soft: #2c2416; --warn-line: #5a4622;
    --d-compacta: #e0866f; --d-comoda: #d9ab55; --d-amplia: #85adc6; --d-premium: #ad92c4;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --sh-2: 0 6px 18px rgba(0, 0, 0, .35); --sh-3: 0 24px 60px rgba(0, 0, 0, .6);
    --ring: 0 0 0 3px rgba(242, 240, 236, .22);
    --pared-mezcla: screen; --pared-filtro: invert(1); --pared-opacidad: .55;   /* en oscuro, relieve claro sobre tinta */
    --res-bajo: #8a7a5c; --res-lleno: #f2f0ec;
  }
}
:root[data-theme="dark"] {
  --bg: #0e151c; --surface: #15202a; --raised: #1a2632; --subtle: #111a22; --sunken: #1d2a36;
  --ink: #eef0f1; --ink-2: #bcc5cc; --ink-3: #94a0a9;
  --line: #233240; --line-strong: #35495b;
  --accent: #f2f0ec; --accent-hover: #ffffff; --accent-ink: #172430; --accent-soft: #22313f; --accent-line: #4a5f72;
  --rc: #e5484d; --slate: #8fb0c8; --halo: #c9b48a;
  --cota: #ff7b83; --danger: #ff8a80; --danger-soft: #3a1f1f; --ok: #7cc39c; --ok-soft: #16281f;
  --warn: #e8b35c; --warn-soft: #2c2416; --warn-line: #5a4622;
  --d-compacta: #e0866f; --d-comoda: #d9ab55; --d-amplia: #85adc6; --d-premium: #ad92c4;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --sh-2: 0 6px 18px rgba(0, 0, 0, .35); --sh-3: 0 24px 60px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(242, 240, 236, .22);
  --pared-mezcla: screen; --pared-filtro: invert(1); --pared-opacidad: .55;
  --res-bajo: #8a7a5c; --res-lleno: #f2f0ec;
  color-scheme: dark;
}

/* ── base ── */
body { font-feature-settings: "tnum" 1, "ss01" 1; letter-spacing: -0.003em; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { letter-spacing: -0.015em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--rc) 22%, transparent); }
.btn, .chip, .seg button, .tabs button, .modes button, .dcard, .pcard, .stc { transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease); }
.btn { border-radius: var(--r); font-weight: 600; letter-spacing: 0; }
.btn.primary { box-shadow: 0 1px 0 rgba(23, 36, 48, .25); }
.linkbtn { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.linkbtn:hover { text-decoration-color: var(--rc); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* ── cabecera: marca a la izquierda, modos en el centro, proyecto a la derecha ── */
.top { padding: 10px 0 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); gap: 10px 22px; }
.brand { gap: 16px; }
.brand .rclogo { height: 48px; padding-right: 16px; border-right-color: var(--line-strong); color: var(--ink); }
.brand h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.brand h1 span:not(.romo-ico) { color: var(--ink-3); font-weight: 400; }
.romo-ico { width: 26px; height: 26px; margin: 0; color: var(--ink); vertical-align: middle; }
.brand p { font-size: 12.5px; color: var(--ink-3); }

/* Modos: pestañas de texto con la línea roja debajo del activo (no botones rellenos) */
.modes { background: transparent; padding: 0; gap: 4px; border-radius: 0; }
.modes button { border-radius: var(--r); padding: 6px 12px; min-height: 44px; color: var(--ink-3); position: relative; }
.modes button:hover { background: var(--sunken); color: var(--ink); }
.modes button[aria-pressed="true"] { background: transparent; color: var(--ink); box-shadow: none; }
.modes button[aria-pressed="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; background: var(--rc); border-radius: 2px; }
.modes button small { color: var(--ink-3); opacity: 1; }
.modes button.locked { opacity: .6; }

.project input { border-color: var(--line-strong); background: var(--surface); font-weight: 600; }
.histbtns .n:not(:empty) { background: var(--ink); color: var(--accent-ink); }
.histmsg { color: var(--ink-3); }

/* selector de tema (lo añade el importador) */
.btn.temabtn { width: var(--h-sm); padding: 0; }
.btn.temabtn svg.ic { width: 18px; height: 18px; stroke-width: 1.8; }
.temabtn .t-sol { display: none; }
:root[data-theme="dark"] .temabtn .t-sol { display: block; }
:root[data-theme="dark"] .temabtn .t-luna { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .temabtn .t-sol { display: block; }
  :root:not([data-theme="light"]) .temabtn .t-luna { display: none; }
}

/* ── tarjetas y paneles: papel blanco, borde fino, sin sombras pesadas ── */
.sec, .chat, .kpis, .notice { border-color: var(--line); box-shadow: var(--sh-1); border-radius: var(--r-lg); }
.sec > summary h2, .sec > .sh h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.sec > summary > svg.ic, .sec > .sh > svg.ic { color: var(--ink-3); }
.sec[open] > summary > svg.ic { color: var(--ink); }
.sec > summary small, .sec > .sh small { font-variant-numeric: tabular-nums; }
.sec .blk > h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }

/* ── asistente ── */
.chat-h { padding: 14px 14px 10px 16px; }
.chat-h b { font-size: 16px; font-weight: 700; }
.romo-av { background: var(--romo-fondo); color: var(--romo); width: 38px; height: 38px; box-shadow: 0 0 0 1px var(--line-strong); }
.romo-av svg { width: 22px; height: 22px; }
/* Pasos: el actual es un círculo con su número y el anillo rojo de la marca; los hechos, puntos en tinta
   unidos por la línea que se va llenando; los pendientes, puntos huecos. Los que se pueden revisitar crecen al pasar. */
.stepper { gap: 10px; padding-top: 4px; }
.stepper .bars { counter-reset: paso; gap: 0; }
.stepper .bars > * { counter-increment: paso; position: relative; height: 30px; display: grid; place-items: center; }
.stepper .bars > *::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 0;
  flex: none; background: var(--line-strong); }
.stepper .bars > :first-child::before { left: 50%; }
.stepper .bars > :last-child::before { right: 50%; }
.stepper .bars > .done::before { background: var(--ink); }
.stepper .bars > .now::before { background: linear-gradient(to right, var(--ink) 50%, var(--line-strong) 50%); height: 2px; }
.stepper .bars > :first-child.now::before { background: var(--line-strong); }
.stepper .bars > *::after { content: ""; position: relative; width: 9px; height: 9px; border-radius: 50%; box-sizing: border-box;
  background: var(--surface); border: 1.5px solid var(--line-strong); transition: transform .18s var(--ease); }
.stepper .bars > .seen::after { border-color: var(--ink-3); }
.stepper .bars > .done::after { background: var(--ink); border-color: var(--ink); }
/* paso actual: círculo de tinta con su número y un anillo rojo que se vuelve a trazar cada 5 s (dice «estás aquí»).
   El anillo es un conic-gradient que asoma por el borde; el círculo, el hueco y el borde, un radial-gradient encima */
@property --arco { syntax: '<angle>'; inherits: false; initial-value: 360deg; }
@property --anillo { syntax: '<color>'; inherits: false; initial-value: #d21f28; }
.stepper .bars > .now::after { content: counter(paso); width: 35px; height: 35px; display: grid; place-items: center;
  border: 0; color: var(--accent-ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  --pista: color-mix(in srgb, var(--rc) 22%, var(--surface)); --anillo: var(--rc);
  background:
    radial-gradient(closest-side, var(--ink) calc(100% - 5px), var(--surface) calc(100% - 4.5px) calc(100% - 2px), transparent calc(100% - 1.5px)),
    conic-gradient(var(--anillo) var(--arco), var(--pista) 0);
  animation: rp-anillo 5s infinite; }
/* traza la vuelta (1 s), se queda entera y al final se apaga hasta la pista, que es justo como empieza: no hay salto */
@keyframes rp-anillo {
  0% { --arco: 0deg; --anillo: var(--rc); animation-timing-function: cubic-bezier(.77, 0, .175, 1); }
  20% { --arco: 360deg; }
  86% { --anillo: var(--rc); animation-timing-function: ease; }
  100% { --arco: 360deg; --anillo: var(--pista); }
}
.stepper .bars > button:hover::before, .stepper .bars > button:focus-visible::before { height: 2px; }
.stepper .bars > button:hover::after, .stepper .bars > button:focus-visible::after { transform: scale(1.45); }
.stepper .cap { align-items: flex-end; font-size: 12px; }
.stepper .cap small { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.stepper .cap .ahora b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); line-height: 1.25; }
.stepper .cap .luego { text-align: right; font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
.chat-log { background: var(--subtle); }
.msg .bubble { box-shadow: none; border-color: var(--line); border-radius: 12px; }
.msg.romo .bubble { border-top-left-radius: 4px; }
.msg.user .bubble { background: var(--ink); color: var(--accent-ink); border-top-right-radius: 4px; }
.msg .bubble .hi { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; width: fit-content; }
/* El saludo se reescribe de vez en cuando mientras nadie ha empezado (romo-vida.js): un cursor rojo lo borra letra a
   letra y lo vuelve a escribir. Es un recorte visual: el texto no cambia, así que el lector de pantalla no lo repite */
.msg .bubble:has(> .hi) { position: relative; }
.rp-cursor { position: absolute; width: 2px; border-radius: 1px; background: var(--rc); pointer-events: none; }
.rp-cursor.rp-parpadea { animation: rp-parpadea .45s steps(1, end) 2 both; }
@keyframes rp-parpadea { 50% { opacity: 0; } }
/* ── vida del chat (romo-vida.js): cada mensaje de ROMO entra, se escribe y después salen sus opciones ── */
.msg.rp-espera { visibility: hidden; }
.msg.rp-aparece { animation: rp-msg .26s var(--ease) both; }
.msg.user.rp-aparece { animation-name: rp-msg-yo; }
@keyframes rp-msg { from { opacity: 0; transform: translateY(6px); } }
@keyframes rp-msg-yo { from { opacity: 0; transform: translateX(8px); } }
.rp-escribe .rp-l { animation: rp-letra .14s var(--ease) both; animation-delay: calc(var(--i) * var(--ms-letra)); }
@keyframes rp-letra { from { opacity: 0; } }
.rp-tarjetas:not(.rp-salen) :is(.chip, .vcard, .dropzone, .btn, .rp-privado) { visibility: hidden; }
/* el aviso de privacidad entra justo detrás de la zona de subir, no antes que ella */
.rp-salen .rp-privado { animation: rp-carta .3s var(--ease) .12s both; }
.rp-salen :is(.chip, .vcard, .dropzone, .btn) { animation: rp-carta .3s var(--ease) both; animation-delay: calc(var(--n, 0) * 40ms); }
@keyframes rp-carta { from { opacity: 0; transform: translateY(6px) scale(.97); } }

/* las etiquetas que propone ROMO llevan su bronce (se distinguen de lo que escribe el usuario); la elegida, en tinta */
.msg.romo .chip:not(.sel) { background: color-mix(in srgb, var(--halo) 8%, var(--surface)); border-color: color-mix(in srgb, var(--halo) 38%, var(--line)); }
.msg.romo .chip:not(.sel):hover:not(:disabled) { background: color-mix(in srgb, var(--halo) 16%, var(--surface)); border-color: var(--halo); }

/* lo que espera una decisión late con el halo de ROMO hasta que se usa (ratón encima: quieto):
   - dos caminos (tarjetas de dos): halo y respiración del 2 %, a contratiempo; el mismo bronce en los dos porque son igual
     de válidos (el rojo es «estás aquí» y suena a aviso)
   - subir el plano: halo, y la flecha sube y baja despacio
   - el botón principal del final (Descargar PDF): halo
   - la alternativa («No tengo plano: lo dibujo»): un brillo que la cruza cada 6 s, más discreto que el halo */
.msg.rp-vivo :is(.cards.two .vcard, .dropzone, .endbtns .btn.primary) { position: relative; }
.msg.rp-vivo .cards.two .vcard:not(:disabled, .rp-calma) { animation: rp-respira 3.2s ease-in-out infinite; }
.msg.rp-vivo :is(.cards.two .vcard, .dropzone, .endbtns .btn.primary):not(:disabled, .rp-calma)::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--halo) 60%, transparent), 0 0 16px color-mix(in srgb, var(--halo) 45%, transparent); opacity: .15;
  animation: rp-halo 3.2s ease-in-out infinite; }
.msg.rp-vivo .cards.two .vcard + .vcard, .msg.rp-vivo .cards.two .vcard + .vcard::after { animation-delay: -1.6s; }
.msg.rp-vivo .dropzone:not(:disabled, .rp-calma) svg.ico { animation: rp-sube 2.4s ease-in-out infinite; }
.msg.rp-vivo .express > .quick:not(.xtipos) .chip:not(:disabled, .rp-calma) { position: relative; overflow: hidden; }
.msg.rp-vivo .express > .quick:not(.xtipos) .chip:not(:disabled, .rp-calma)::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, color-mix(in srgb, var(--halo) 35%, transparent) 50%, transparent 70%);
  transform: translateX(-100%); animation: rp-brillo 6s var(--ease) 1.2s infinite; }
@media (hover: hover) and (pointer: fine) {
  .msg.rp-vivo :is(.vcard, .dropzone, .btn, .chip):hover, .msg.rp-vivo :is(.vcard, .dropzone, .btn, .chip):hover::after,
  .msg.rp-vivo .dropzone:hover svg.ico { animation-play-state: paused; }
}
@keyframes rp-respira { 50% { transform: scale(1.02); } }
@keyframes rp-halo { 0%, 100% { opacity: .15; } 50% { opacity: .8; } }
@keyframes rp-sube { 50% { transform: translateY(-3px); } }
@keyframes rp-brillo { 0% { transform: translateX(-100%); } 22%, 100% { transform: translateX(100%); } }

/* paso superado: su punto se rellena con un pequeño rebote mientras el anillo se traza en el paso nuevo.
   Solo al entrar (backwards): luego el punto vuelve a crecer al pasar el ratón como los demás */
.stepper .bars > .done:has(+ .now)::after { animation: rp-pop .45s cubic-bezier(.34, 1.56, .64, 1) backwards; }
@keyframes rp-pop { from { transform: scale(.4); } }
/* paso nuevo (romo-vida.js marca .rp-cambia solo si el paso cambia): su círculo hace un «pum» bien visible,
   y el rótulo entra desde abajo */
.stepper .bars > .now.rp-cambia::after { animation: rp-anillo 5s infinite, rp-zoom .8s; }
.stepper .cap.rp-cambia :is(.ahora, .luego) { animation: rp-sube-sutil .45s var(--ease-fuerte) .08s both; }
/* sale del punto, crece hasta 1,4 con su número y un halo rojo que se abre y se apaga, rebota un poco y se asienta */
@keyframes rp-zoom {
  0% { transform: scale(.5); box-shadow: 0 0 0 0 color-mix(in srgb, var(--rc) 45%, transparent); animation-timing-function: var(--ease-fuerte); }
  42% { transform: scale(1.4); animation-timing-function: cubic-bezier(.45, 0, .55, 1); }
  70% { transform: scale(.94); box-shadow: 0 0 0 12px color-mix(in srgb, var(--rc) 0%, transparent); animation-timing-function: var(--ease-fuerte); }
  100% { transform: scale(1); box-shadow: 0 0 0 12px transparent; }
}
/* último paso: el recorrido ha terminado. Una ✓ en lugar del número, el anillo rojo cerrado y quieto (ya no hay nada
   en curso) y «Plano terminado» en lugar de «Paso 9 de 9» (el lector de pantalla oye los dos) */
.stepper .bars > .now:last-child::after { content: "✓"; font-size: 15px; animation: none; }
.stepper .bars > .now.rp-cambia:last-child::after { animation: rp-zoom .8s; }
.stepper:has(.bars > .now:last-child) .cap .ahora small { font-size: 0; }
.stepper:has(.bars > .now:last-child) .cap .ahora small::before { content: "Plano terminado"; font-size: 10.5px; letter-spacing: .08em; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .stepper .bars > :is(.now, .done)::after, .msg.rp-vivo :is(.vcard, .dropzone, .btn, .chip, svg.ico) { animation: none !important; }
  .msg.rp-vivo :is(.vcard, .dropzone, .btn):not(:disabled, .rp-calma)::after { animation: none !important; opacity: .45; }
  .msg.rp-vivo .chip::after { display: none; }
}
/* escribir: una cápsula a todo el ancho con el envío dentro, como icono */
.chat-in { padding: 12px; gap: 0; align-items: center; }
.chat-in input#chatText { min-height: 48px !important; padding: 0 56px 0 18px !important; background: var(--subtle) !important; border-color: var(--line-strong); }
.chat-in .sendbtn { flex: none; width: 40px; min-height: 40px; height: 40px; margin-left: -44px; padding: 0; border-radius: 50%; font-size: 0; }
.chat-in .sendbtn svg { width: 18px; height: 18px; margin: 0; }
/* con algo escrito, enviar es la acción: el botón se enciende en el rojo de la marca (vacío, se queda discreto) */
.chat-in:has(#chatText:not(:placeholder-shown)) .sendbtn { background: var(--rc); border-color: var(--rc); color: #fff; }
.chat-in:has(#chatText:not(:placeholder-shown)) .sendbtn:hover { background: color-mix(in srgb, var(--rc) 86%, #000); border-color: color-mix(in srgb, var(--rc) 86%, #000); }
/* «Atrás» junto a los pasos (lo coloca el importador): una flecha delante de «Paso N de 9»; si no hay adónde volver, no se ve */
.pasos { position: relative; }
.pasos .backbtn { position: absolute; left: var(--pasos-x, 14px); bottom: 11px; z-index: 1; width: 24px; min-height: 0; height: 24px; padding: 0;
  border-radius: 50%; border-color: var(--line-strong); background: var(--surface); color: var(--ink); transition: opacity .2s var(--ease); }
.pasos .backbtn::before { content: ""; position: absolute; inset: -10px; }   /* zona de toque de 44 px */
.pasos .backbtn span { display: none; }
.pasos .backbtn svg { width: 14px; height: 14px; }
.pasos .backbtn:hover:not(:disabled) { background: var(--sunken); border-color: var(--ink); }
.pasos .backbtn:disabled { opacity: 0; pointer-events: none; }
.pasos:has(.backbtn:not(:disabled)) .stepper .cap { padding-left: 32px; transition: padding .2s var(--ease); }
.chip { border-color: var(--line-strong); }
.chip:hover:not(:disabled) { border-color: var(--ink); }
.chip.sel { background: var(--ink); border-color: var(--ink); color: var(--accent-ink); }
.chip.sel .n { color: inherit; opacity: .75; }
.pbar i, .rprog i { background: var(--ink); }

/* ── pantalla de inicio: la lectura con IA es la protagonista ── */
/* papel cuadriculado con los colores del tema (Mauro lo tenía fijo en claro) */
.sheet:has(> .emptyplan) { background: var(--surface); }
.emptyplan { color: var(--ink-3); background-color: var(--subtle);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); }
.emptyplan > svg:not(.ico) { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
/* La pared de ROMO: su textura de bienvenida (cuadrados en relieve) a pantalla completa mientras se elige cómo
   empezar; la bienvenida flota sobre ella sin caja. Con un plano en pantalla se desvanece y queda el papel limpio. */
body { background: transparent; }   /* el papel lo pinta html; la pared va entre los dos */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  /* pared.svg es un mosaico vectorial que se repite sin costuras: cubre toda la zona de trabajo a cualquier tamaño de
     pantalla y se ve nítido en Retina (la foto de antes, de 1247 px, dejaba en un portátil una franja con bordes lisos).
     El velo blanco del centro calma el relieve tras el titular y las tarjetas; el blanco no altera la mezcla, así que
     la pared nace del papel */
  background:
    radial-gradient(ellipse 46% 40% at 50% 46%, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 100%),
    url("pared.svg") 50% 0 / 1216px 912px repeat;
  mix-blend-mode: var(--pared-mezcla); filter: var(--pared-filtro); opacity: 0; transition: opacity .7s var(--ease);
  -webkit-mask-image: linear-gradient(to bottom, transparent 90px, #000 200px); mask-image: linear-gradient(to bottom, transparent 90px, #000 200px); }   /* la cabecera queda limpia */
body:has(.emptyplan.start)::before { opacity: var(--pared-opacidad); }
.sheet:has(.emptyplan.start) { background: transparent; border-color: transparent; box-shadow: none; overflow: visible; }
.emptyplan.start { gap: 30px; background: transparent; }
.emptyplan.start .st-h b { display: block; font-size: 40px; font-weight: 300; letter-spacing: -0.04em; color: var(--ink); line-height: 1.05; }
.emptyplan.start .st-h p { color: var(--ink-3); font-size: 14.5px; margin-top: 8px; }
.emptyplan b { color: var(--ink); }
.emptyplan svg { color: var(--ink); }
.st-cards { gap: 12px; align-items: stretch; }
/* en la bienvenida todo va centrado: la nota del pie también, con el ancho de las tarjetas */
section:has(.emptyplan.start) .foot { display: block; width: min(860px, 100%); margin-inline: auto; text-align: center; text-wrap: balance; }
section:has(.emptyplan.start) .foot svg.ic { display: inline; vertical-align: -3px; margin: 0 6px 0 0; }
.stc { border-color: var(--line); border-radius: var(--r-lg); box-shadow: none; padding: 22px 20px 20px; }
button.stc:hover { border-color: var(--ink); box-shadow: var(--sh-3); transform: translateY(-3px); }
/* sobre la pared: papel esmerilado que deja intuir el relieve */
.emptyplan.start .stc { background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1);
  border-color: color-mix(in srgb, var(--line-strong) 70%, transparent); box-shadow: var(--sh-2); }
/* Entrada de la bienvenida, solo al abrir la página (tema.js marca data-entrada al terminar; si se vuelve al inicio,
   aparece quieta). Una secuencia de ~2 s: el titular sube y se enfoca → las tres tarjetas suben una tras otra y se
   asientan con un leve rebote → cada icono se dibuja a trazo, como un boceto sobre el plano → la línea roja de la
   acción principal se traza. Con movimiento reducido, todo aparece al momento (regla general de arriba) */
@keyframes rp-titulo { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } }
@keyframes rp-sube-sutil { from { opacity: 0; transform: translateY(8px); } }
@keyframes rp-tarjeta { from { opacity: 0; transform: translateY(40px) scale(.96); } }
@keyframes rp-traza { from { stroke-dashoffset: 200; } }
@keyframes rp-linea { from { transform: scaleX(0); } }
html:not([data-entrada]) .emptyplan.start .st-h b { animation: rp-titulo .9s var(--ease-fuerte) .05s both; }
html:not([data-entrada]) .emptyplan.start .st-h p { animation: rp-sube-sutil .7s var(--ease-fuerte) .25s both; }
html:not([data-entrada]) .emptyplan.start .stc { animation: rp-tarjeta .95s var(--ease-rebote) both; }
html:not([data-entrada]) .emptyplan.start .stc svg.ico :is(path, circle, rect, line, polyline) {
  stroke-dasharray: 200; animation: rp-traza 1.1s cubic-bezier(.65, 0, .35, 1) both; }   /* 200 > el trazo más largo de un icono de 48 */
html:not([data-entrada]) .emptyplan.start .stc[data-start="up"]::after { transform-origin: left; animation: rp-linea .8s var(--ease-fuerte) 1.2s both; }
html:not([data-entrada]) .emptyplan.start .stc:nth-child(1) { animation-delay: .35s; }
html:not([data-entrada]) .emptyplan.start .stc:nth-child(2) { animation-delay: .47s; }
html:not([data-entrada]) .emptyplan.start .stc:nth-child(3) { animation-delay: .59s; }
html:not([data-entrada]) .emptyplan.start .stc:nth-child(1) svg.ico * { animation-delay: .7s; }
html:not([data-entrada]) .emptyplan.start .stc:nth-child(2) svg.ico * { animation-delay: .82s; }
html:not([data-entrada]) .emptyplan.start .stc:nth-child(3) svg.ico * { animation-delay: .94s; }
.stc b { color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.stc small { color: var(--ink-3); }
.emptyplan .stc svg.ico { color: var(--ink); width: 34px; height: 34px; stroke-width: 1.6; }
/* en reposo, tras la entrada: cada ~5,5 s los tres iconos dan un saltito con un rebote al caer, uno tras otro (en ola),
   y entre medias están quietos. Invitan a tocar sin que la pantalla esté siempre en movimiento. Al pasar el ratón por
   una tarjeta, su icono salta */
html[data-entrada] .emptyplan.start .stc svg.ico { animation: rp-salto 5.5s 1.2s infinite; }
html[data-entrada] .emptyplan.start .stc:nth-child(2) svg.ico { animation-delay: 1.38s; }
html[data-entrada] .emptyplan.start .stc:nth-child(3) svg.ico { animation-delay: 1.56s; }
@media (hover: hover) and (pointer: fine) {
  html[data-entrada] .emptyplan.start button.stc:hover svg.ico { animation: rp-salto-uno .75s; }
}
@keyframes rp-salto {
  0% { transform: none; animation-timing-function: var(--ease-fuerte); }
  5% { transform: translateY(-6px); animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
  9% { transform: none; animation-timing-function: var(--ease-fuerte); }
  11% { transform: translateY(-1.5px); animation-timing-function: ease-in; }
  13%, 100% { transform: none; }
}
@keyframes rp-salto-uno {
  0% { transform: none; animation-timing-function: var(--ease-fuerte); }
  38% { transform: translateY(-6px); animation-timing-function: cubic-bezier(.55, 0, .9, .45); }
  69% { transform: none; animation-timing-function: var(--ease-fuerte); }
  85% { transform: translateY(-1.5px); animation-timing-function: ease-in; }
  100% { transform: none; }
}
/* «Subir un plano»: tarjeta en tinta, con la línea roja de la marca */
.stc[data-start="up"] { background: var(--ink); border-color: var(--ink); color: var(--accent-ink); position: relative; overflow: hidden; padding-bottom: 36px; }   /* aire para la línea roja (en móvil la tarjeta es baja) */
.stc[data-start="up"] b, .stc[data-start="up"] small, .emptyplan .stc[data-start="up"] svg.ico { color: var(--accent-ink); }
.stc[data-start="up"] small { opacity: .8; }
.stc[data-start="up"]::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 16px; height: 2px; background: var(--rc); }
.emptyplan.start .stc[data-start="up"] { background: var(--ink); border-color: var(--ink); }
button.stc[data-start="up"]:hover, .emptyplan.start button.stc[data-start="up"]:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ── resultados (cifras del plano) ── */
.kpi { padding: 9px 16px 10px; }
.kpi b { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.kpi span { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.kpi.dist-kpi b { font-size: 16px; letter-spacing: -0.01em; }
.notice .pill { background: var(--sunken); }
/* sin distribución todavía: fuera las cuatro casillas con «—» (queda «Distribución · la eliges más adelante») y el
   PDF deja de ser la acción principal */
#planStage[data-sin-cifras] .kpi:not(.dist-kpi) { display: none; }
#planStage[data-sin-cifras] .kpi.dist-kpi small::after { content: " · Mesas, sillas y comensales salen al elegirla."; }
#planStage[data-sin-cifras] #dlPdf { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
/* «Mobiliario del plano, tal cual» sale nada más leer el plano, antes de que el chat pregunte si se respeta y con
   las mesas aún sin dibujar: choca con «la eliges más adelante». Espera a que haya mesas en el plano */
#planStage[data-sin-cifras] #furnBanner { display: none; }
/* resultado: el nombre de cada zona se lee entero (en dos líneas si hace falta), no «Z1 Terraza princi…» */
.zbar .nm { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; overflow-wrap: anywhere; }
/* ── resultado final: la tarjeta que cierra el recorrido, en el color de la zona de trabajo y con la línea roja de la
   marca. Cifra grande y fina; cada zona con más o menos color según su carga (--carga, de romo-vida.js) ── */
.result { background: var(--res-bg); border-color: var(--line); color: var(--res-ink); padding: 18px 18px 32px; gap: 12px; border-radius: 16px; }
.result::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 15px; height: 2px; background: var(--rc); }
.result .big { gap: 4px 12px; }
.result .big > b { font-size: 60px; font-weight: 300; letter-spacing: -0.05em; color: var(--res-ink); }
.result .big span { font-size: 15px; color: color-mix(in srgb, var(--res-ink) 70%, transparent); }
.result .big span b { color: var(--res-ink); font-weight: 700; }
.result .hint { color: color-mix(in srgb, var(--res-ink) 66%, transparent); }
.result .perfil { color: var(--res-ink); font-weight: 600; }
.result .zbar .nm { color: color-mix(in srgb, var(--res-ink) 86%, transparent); }
.result .zbar .mono { color: var(--res-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.result .zbar .track { height: 6px; background: color-mix(in srgb, var(--res-ink) 13%, transparent); }
.result .zbar .fill { background: color-mix(in oklab, var(--res-lleno) calc(var(--carga, 1) * 100%), var(--res-bajo)); }
.result .zbar .fill.cap { background: var(--res-warn); }
.result .disclaimer { background: color-mix(in srgb, var(--res-ink) 7%, transparent); border-color: color-mix(in srgb, var(--res-ink) 16%, transparent);
  color: color-mix(in srgb, var(--res-ink) 82%, transparent); }
.result .disclaimer svg { color: var(--res-warn); }
/* al salir en el chat, las barras crecen una tras otra; al volver el resumen flotante, la tarjeta lo recibe con un halo */
.result.rp-barras .zbar .fill { transform-origin: left; animation: rp-linea .7s var(--ease-fuerte) both; animation-delay: calc(var(--n, 0) * 70ms + .2s); }
.result.rp-aterriza { animation: rp-aterriza .9s var(--ease-fuerte); }
@keyframes rp-aterriza { from { box-shadow: 0 0 0 6px color-mix(in srgb, var(--rc) 32%, transparent); } }
/* resumen flotante (romo-vida.js): la misma tarjeta, en grande sobre el plano, justo cuando terminan de colocarse
   las mesas. Copia visual (aria-hidden): lo que se lee y se anuncia es la tarjeta del chat */
.rp-flota { position: fixed; z-index: 60; box-sizing: border-box; padding: 18px 24px 32px; border-radius: 18px; cursor: pointer;
  background: var(--res-bg); color: var(--res-ink); box-shadow: var(--sh-3); transform-origin: 0 0;
  animation: rp-flota-entra .55s var(--ease-fuerte) both; }
.rp-flota::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 16px; height: 2px; background: var(--rc); }
.rp-flota .rp-ey { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: color-mix(in srgb, var(--res-ink) 62%, transparent); }
.rp-flota .big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.rp-flota .big > b { font-size: 80px; font-weight: 300; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.rp-flota .big span { font-size: 17px; color: color-mix(in srgb, var(--res-ink) 72%, transparent); }
.rp-flota .big span b { color: var(--res-ink); font-weight: 700; }
.rp-flota .hint { margin-top: 10px; font-size: 13.5px; line-height: 1.45; color: color-mix(in srgb, var(--res-ink) 66%, transparent); }
.rp-flota .rp-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: color-mix(in srgb, var(--res-ink) 70%, transparent); cursor: pointer; }
.rp-flota .rp-x svg { width: 16px; height: 16px; }
.rp-flota .rp-x:hover { background: color-mix(in srgb, var(--res-ink) 10%, transparent); color: var(--res-ink); }
@keyframes rp-flota-entra { from { opacity: 0; transform: translateY(24px) scale(.96); } }
/* tabla de zonas: el nombre largo baja a dos líneas para que «Comensales» (la cifra que importa) quepa en la
   tableta del stand sin desplazar la tabla en horizontal */
.zt td:nth-child(2) { white-space: normal; min-width: 150px; line-height: 1.3; }
/* «Más» formatos: el JSON es un dato técnico que en el stand nadie usa */
#dlJson { display: none; }

/* ── pestañas del plano: misma línea roja que los modos ── */
.tabs { background: transparent; padding: 0; gap: 2px; border-bottom: 1px solid var(--line); border-radius: 0; }
.tabs button { border-radius: var(--r) var(--r) 0 0; min-height: 38px; color: var(--ink-3); position: relative; font-weight: 600; }
.tabs button:hover { background: var(--sunken); color: var(--ink); }
.tabs button[aria-pressed="true"] { background: transparent; color: var(--ink); box-shadow: none; }
.tabs button[aria-pressed="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--rc); }

/* ── distribuciones: el color de cada tipo queda como muestra, el texto en tinta ── */
.dcard { border-radius: var(--r-lg); }
.dcard .dn { color: var(--ink); }
.dcard .dn::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--dc); flex: none; }
.dcard[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface); }
.dcard[aria-pressed="true"]::after { background-color: var(--dc); }
.dcard .cap b { font-weight: 700; letter-spacing: -0.03em; }
.kpi.dist-kpi b { color: var(--ink); }
.kpi.dist-kpi b::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--dc); margin-right: 7px; vertical-align: 1px; }

/* ── catálogo y tarjetas de producto ── */
.pcard:hover:not(:disabled) { border-color: var(--ink); }
.pcard[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--surface); }
.pcard .psel { background: var(--ink); color: var(--accent-ink); }
.pcard b { font-weight: 700; letter-spacing: -0.01em; }

/* ── segmentados (seg) ── */
.seg { background: var(--sunken); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { color: var(--ink); }

/* ── zonas del plano: insignias en azul pizarra ── */
.zb { background: var(--slate); }
:root[data-theme="dark"] .zb { color: #0e151c; }

/* ── el dibujo del plano conserva su tipografía técnica (no hereda los ajustes de Manrope) ── */
.sheet svg { font-feature-settings: normal; letter-spacing: normal; }
/* la cascada de mesas del resultado (de Mauro: 28 ms entre una y otra) dura como mucho ~2,4 s: su app.js quita la
   clase a los 2,5 s y, en un local grande, las últimas mesas aparecían de golpe */
.sheet.reveal .rp-set { animation-delay: calc(min(var(--i), 70) * 28ms); }

/* ── cuenta del cliente (tema/romo-cuenta.js): «Acceder», su menú y el modal de acceso ── */
.histbtns { position: relative; }
.cuentabtn.dentro { border-color: var(--ink); color: var(--ink); }
.cuentabtn.dentro .ic { color: var(--rc); }
.cuentamenu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 336px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); overflow: hidden;
  transform-origin: top left; animation: cm-entra .18s cubic-bezier(.23, 1, .32, 1); }
@keyframes cm-entra { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .cuentamenu { animation: rp-fundido .15s ease; } @keyframes rp-fundido { from { opacity: 0; } } }
.cuentamenu .cm-tx { display: flex; flex-direction: column; min-width: 0; }
.cuentamenu .cm-tx b { color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.3; }
.cuentamenu .cm-tx small { color: var(--ink-3); font-size: 12.5px; line-height: 1.35; }
.cuentamenu .cm-cab { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.cuentamenu .cm-cab::before { content: ""; position: absolute; left: 16px; top: 0; width: 28px; height: 3px; background: var(--rc); }   /* la línea roja de la marca */
.cuentamenu .cm-cab .cm-tx b { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.cuentamenu .cm-cab .cm-tx b, .cuentamenu .cm-cab .cm-tx small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cuentamenu .cm-cab-txt .cm-tx b, .cuentamenu .cm-cab-txt .cm-tx small { white-space: normal; }
.cuentamenu .cm-avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--surface);
  font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.cuentamenu .cm-grupo { display: flex; flex-direction: column; padding: 6px; }
.cuentamenu .cm-grupo + .cm-grupo { border-top: 1px solid var(--line); }
.cuentamenu .cm-op { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; border: 0; border-radius: var(--r);
  background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background-color .12s; }
.cuentamenu .cm-op:hover, .cuentamenu .cm-op:focus-visible { background: var(--sunken); outline: none; }
.cuentamenu .cm-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--subtle); color: var(--ink-2);
  transition: color .12s, background-color .12s; }
.cuentamenu .cm-ico svg { width: 18px; height: 18px; }
.cuentamenu .cm-op:hover .cm-ico, .cuentamenu .cm-op:focus-visible .cm-ico { background: var(--surface); color: var(--rc); }
.cuentamenu [data-cm="salir"] .cm-tx b, .cuentamenu [data-cm="salir"] .cm-ico { color: var(--danger); }
.cuentamenu .cm-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line);
  background: var(--subtle); font-size: 13px; color: var(--ink-3); }
.cuentamenu .cm-crear { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r); color: var(--rc);
  font-weight: 700; font-size: 13.5px; text-decoration: none; }
.cuentamenu .cm-crear svg { width: 15px; height: 15px; transition: transform .15s cubic-bezier(.23, 1, .32, 1); }
.cuentamenu .cm-crear:hover, .cuentamenu .cm-crear:focus-visible { background: color-mix(in srgb, var(--rc) 10%, transparent); outline: none; }
@media (hover: hover) and (pointer: fine) { .cuentamenu .cm-crear:hover svg { transform: translateX(2px); } }
@media (max-width: 520px) { .cuentamenu { width: min(336px, calc(100vw - 32px)); } }   /* en el móvil el botón va a la izquierda */
/* invitación a guardar en la cuenta (sin sesión): al pie del historial, que sin cuenta vive en este dispositivo */
.rp-invita { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; padding: 12px 16px 14px;
  border-top: 1px solid var(--line); background: var(--subtle); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.rp-invita b { color: var(--ink); font-weight: 700; }
.rp-invita .btn { margin-left: auto; }
#histPick:has(.rp-invita) #histFoot { display: none; }   /* decía lo mismo («solo en este navegador»), sin la salida */

/* ── privacidad: qué pasa con el plano, junto a donde se sube y en el pie (romo-vida.js e importador) ── */
.rp-privado { display: flex; gap: 8px; align-items: flex-start; margin: 8px 2px 0; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.rp-privado svg.ic { width: 14px; height: 14px; margin-top: 2px; }
.rp-privado a, .foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ── modo stand (romo-stand.js): «Terminar visita» se pone en rojo al pedir confirmación; el aviso de inactividad
   sale abajo y centrado, sin tapar el plano ── */
.standbtn.confirma { background: var(--rc); border-color: var(--rc); color: #fff; }
.rp-stand-aviso { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); box-sizing: border-box;
  width: min(480px, calc(100vw - 32px)); padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
.rp-stand-aviso p { margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
.rp-stand-aviso [data-s] { font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-stand-acc { display: flex; flex-wrap: wrap; gap: 8px; }
.cuentadlg { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
.cuentadlg::backdrop { background: rgba(23, 36, 48, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cuentadlg[open] { animation: rp-msg .26s var(--ease); }
.cd-form { position: relative; display: flex; flex-direction: column; padding: 30px 28px 24px; }
.cd-form::before { content: ""; position: absolute; left: 28px; top: 0; width: 44px; height: 3px; background: var(--rc); }   /* la línea roja de la marca */
.cd-form h2 { margin: 0 32px 6px 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.cd-sub { margin: 0 0 18px; color: var(--ink-3); font-size: 14px; line-height: 1.45; }
.cd-form label { margin: 10px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cd-form input { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--subtle);
  color: var(--ink); font: inherit; font-size: 16px; }
.cd-form input:focus { outline: 2px solid var(--ink); outline-offset: 1px; background: var(--surface); }
.cd-pass { position: relative; }
.cd-pass input { padding-right: 84px; }
.cd-ver { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 10px; border: 0; border-radius: var(--r);
  background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cd-ver:hover { background: var(--sunken); color: var(--ink); }
.cd-err { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r); background: var(--danger-soft); color: var(--danger); font-size: 13.5px; line-height: 1.4; }
.cd-entrar { margin-top: 18px; min-height: 48px; justify-content: center; font-size: 15px; }
.cd-links { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 0; font-size: 13.5px; color: var(--ink-3); text-align: center; }
.cd-links a { white-space: nowrap; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.cd-links a:hover { text-decoration-color: var(--rc); }
.cd-sub b { color: var(--ink); font-weight: 600; }
.cd-nueva { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px -28px -24px; padding: 16px 28px 18px; border-top: 1px solid var(--line);
  background: var(--subtle); border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: 14px; color: var(--ink-2); }
.cd-nueva .btn { min-height: 40px; padding: 0 16px; font-weight: 600; text-decoration: none; }
.cd-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--ink-3);
  font-size: 24px; line-height: 1; cursor: pointer; }
.cd-x:hover { background: var(--sunken); color: var(--ink); }

/* ── pie y avisos ── */
.foot { color: var(--ink-3); }

/* ── escritorio: barra lateral a toda altura, pegada a la izquierda; marca y asistente (o los paneles del editor)
   son una sola pieza. La cabecera de la derecha queda para los modos y el proyecto, y la pared solo en la zona de trabajo.
   Solo en el asistente y el editor (los modos que usa esta edición). Por debajo de 961 px se apila como siempre. ── */
@media (min-width: 961px) {
  body:is([data-mode="conv"], [data-mode="config"]) {
    --lado: clamp(340px, 28vw, 410px);
    padding-left: 0;
    /* cabecera en rejilla: la marca en la columna de la barra; modos y proyecto siempre en la de la derecha */
    & .top { display: grid; grid-template-columns: var(--lado) auto minmax(0, 1fr); align-items: center; column-gap: 20px; row-gap: 8px;
      max-width: none; padding: 0 16px 0 0; margin: 0 0 12px; border-bottom: 0; }
    & .brand { grid-column: 1; grid-row: 1; align-self: start; margin: 0; padding: 2px 20px 14px; }
    & .modewrap { grid-column: 2; grid-row: 1; align-self: end; }
    & .toolsr { grid-column: 3; grid-row: 1; justify-self: end; }
    /* el nombre del proyecto encoge antes de que la fila salte (con «Acceder» ya no cabía a 1440 px) */
    & .toolsr .project { flex: 1 1 150px; min-width: 150px; }
    & .toolsr .project input { width: 100%; }
    /* franja de cabecera algo más clara que el papel; el modo activo es una pestaña del color del papel que se abre
       hacia el contenido, con la línea roja arriba */
    & .top { position: relative; }
    & .top::after { content: ""; position: absolute; z-index: -1; left: var(--lado); right: -16px; top: -12px; bottom: 0;
      background: var(--subtle); box-shadow: inset 0 -1px 0 var(--line); }
    & .modes { align-items: flex-end; gap: 4px; }
    & .modes button { min-height: 50px; padding: 6px 18px; border-radius: 10px 10px 0 0; }
    & .modes button:hover { background: color-mix(in srgb, var(--bg) 60%, transparent); }
    & .modes button[aria-pressed="true"] { background: var(--bg);
      box-shadow: inset 0 2px 0 var(--rc), inset 1px 0 0 var(--line), inset -1px 0 0 var(--line); }
    & .modes button[aria-pressed="true"]::after { display: none; }
    & .top::before { content: ""; position: fixed; left: 0; top: 0; bottom: 0; width: var(--lado); z-index: -1;
      background: var(--surface); }
    & .app { max-width: none; column-gap: 20px; grid-template-columns: var(--lado) minmax(0, 1fr); }
    /* una sola superficie, sin rayas: separa el espacio, no las líneas */
    & .chat { background: transparent; border: 0; border-radius: 0; box-shadow: none; margin: 0; }
    /* una sola identidad: la marca de arriba. Fuera el avatar y el segundo «ROMO»; «Empezar de nuevo» se queda
       como icono a la derecha de los pasos */
    & .chat { position: relative; }
    & .chat-h > :not(#chatRestart) { display: none; }
    & .chat-h { position: absolute; top: 14px; right: 14px; z-index: 2; padding: 0; }
    & #chatRestart { width: 32px; padding: 0; }
    & #chatRestart .lbl { display: none; }
    /* con un plano sin guardar, el primer toque pide confirmación: el icono crece hacia la izquierda como una cápsula
       opaca con la pregunta (antes el texto no cabía en el botón y se montaba sobre los pasos) */
    & #chatRestart.confirm { width: auto; padding: 0 12px 0 10px; gap: 6px; white-space: nowrap; background: var(--surface);
      border-color: var(--danger); box-shadow: var(--sh-2); }
    & .stepper { padding: 22px 58px 10px 20px; border-bottom: 0; }   /* aire arriba: el «pum» del paso nuevo (1,4× y su halo) no se recorta contra el borde del chat */
    & .stepper .cap { margin-right: -38px; }
    & .pasos { --pasos-x: 20px; }
    & .chat-log { background: transparent; padding: 16px 20px; }
    & .chat-in { background: transparent; padding: 12px 20px 18px; border-top: 0; }
    & .rail { padding: 18px 20px 24px; }
    /* solo se desplaza el contenido de la barra: fundido arriba y abajo en vez de cortes, y barra de desplazamiento fina */
    & .chat-log, & .rail { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
    & .chat-log { -webkit-mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 18px), transparent);
      mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 18px), transparent); }
    /* editor: arriba manda «Deshacer / Rehacer», que se queda fijo; el fundido solo abajo y la franja de encima tapada */
    & .rail { -webkit-mask-image: linear-gradient(#000 calc(100% - 18px), transparent); mask-image: linear-gradient(#000 calc(100% - 18px), transparent); }
    & .rail .undobar::before { content: ""; position: absolute; left: -21px; right: -21px; bottom: calc(100% + 1px); height: 24px; background: var(--surface); }
    &::before { left: var(--lado); }
    /* la pista al entrar en el editor sale abajo, centrada en la zona de trabajo, y no tapa las cifras */
    & .modehint { position: fixed; top: auto; bottom: 24px; left: calc(var(--lado) + (100vw - var(--lado)) / 2); }
  }
  /* sin sitio para todo en una línea: el proyecto sube a una primera fila y las pestañas quedan abajo,
     pegadas al contenido; todo dentro de la zona de la derecha */
  @media (max-width: 1240px) {
    body:is([data-mode="conv"], [data-mode="config"]) .brand { grid-row: 1 / span 2; }
    body:is([data-mode="conv"], [data-mode="config"]) .toolsr { grid-column: 2 / -1; grid-row: 1; justify-self: start; padding-top: 2px; }
    body:is([data-mode="conv"], [data-mode="config"]) .modewrap { grid-row: 2; }
  }
  /* editor sin plano: la barra no tiene nada que mostrar y no se pinta; la bienvenida y la pared ocupan todo el ancho */
  body[data-mode="config"]:has(.app.noplan) .top::before { display: none; }
  body[data-mode="config"]:has(.app.noplan) .top::after { left: 0; }  body[data-mode="config"]:has(.app.noplan) #planStage { grid-column: 1 / -1; padding-left: 20px; }
  body[data-mode="config"]:has(.app.noplan)::before { left: 0; }
}
/* con todo en una fila (más de 1240 px): el estado de guardado y el aviso del historial van en una línea fina bajo los
   botones, fuera de la fila. Cambian de texto a cada momento y, dentro, la hacían saltar a dos líneas («Guardado · 17:27»
   no cabía donde sí cabía «Sin guardar»). Mientras sale el aviso, el estado se aparta para no montarse */
@media (min-width: 1241px) {
  body:is([data-mode="conv"], [data-mode="config"]) :is(.savest, .histmsg) {
    position: absolute; right: 0; top: calc(100% + 3px); font-size: 12px; line-height: 1; }
  body:is([data-mode="conv"], [data-mode="config"]) .histmsg.err { white-space: nowrap; max-width: none; }
  body:is([data-mode="conv"], [data-mode="config"]) .histbtns:has(.histmsg:not(:empty)) .savest { visibility: hidden; }
}

/* ── tableta (761-1240 px, la del stand): el plano es lo que se viene a ver. Encima de él, una fila de cifras
   y una de vistas, en vez de cuatro: el aviso de aforo se queda en su estado y su botón (el «Plano orientativo»
   sigue en el resultado del chat y en el PDF), las pestañas sin icono y «Descargar PDF» como «PDF». ── */
@media (min-width: 761px) and (max-width: 1240px) {
  .statbar { flex-wrap: nowrap; }
  .kpis { flex: 1 1 0; }
  .kpi { padding: 6px 12px 7px; }
  .kpi b { font-size: 19px; }
  .kpi span { font-size: 10px; letter-spacing: .06em; }
  .kpi small { font-size: 11px; }
  .kpi.dist-kpi b { font-size: 15px; }
  .kpi.dist-kpi small { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .notice { flex: none; flex-direction: column; justify-content: center; align-items: stretch; gap: 6px; padding: 8px 10px; }
  .notice > svg, .notice p { display: none; }
  .notice .pill { text-align: center; }
  .toolbar { flex-wrap: nowrap; }
  .tabs { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; padding-inline: 10px; }
  .tabs button svg { display: none; }
  .tb-r { flex: none; flex-wrap: nowrap; }
  #dlPdf { font-size: 0; gap: 0; }   /* el nombre accesible sigue siendo «Descargar PDF» */
  #dlPdf svg { margin-right: 6px; }
  #dlPdf::after { content: "PDF"; font-size: 13px; }
  /* distribuciones en la barra lateral estrecha: cada cifra en su línea, sin partir «74 pax · 22 mesas» */
  .rail .dcard { padding: 9px 10px; }
  .rail .dcard .da { font-size: 11.5px; line-height: 1.3; }
  .rail .dcard .cap { font-size: 11px; white-space: nowrap; }
  .rail .dcard .cap b { font-size: 18px; }
}

/* ── tableta y móvil: nada se sale de la pantalla ── */
/* sin barra lateral, el subrayado del modo activo va dentro de su pestaña: el de -13px es para escritorio y en
   móvil la fila de pestañas se desplaza (overflow) y recortaría lo que sobresale */
@media (max-width: 960px) {
  .modes button[aria-pressed="true"]::after { bottom: 0; }
}
@media (max-width: 1180px) {
  .brand p { display: none; }
  .modes button small { display: none; }
}
@media (max-width: 760px) {
  .top { gap: 10px; }
  .brand .rclogo { height: 32px; }
  .modewrap { width: 100%; }
  .modes { overflow-x: auto; scrollbar-width: none; }
  .modes::-webkit-scrollbar { display: none; }
  .modes button { flex: 1 0 auto; }
  .kpis { flex-wrap: wrap; }
  .kpi { flex: 1 1 33%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; }
  .tb-r { margin-left: 0; width: 100%; }
  .emptyplan.start .st-h b { font-size: 28px; }
}
