/* ==========================================================================
   «Pruébalo en línea» (/demo/). Va después de kontrolcon.css y usa sus variables.
   La oficina copia el aire del ERP (barra oscura, página clara, cifras en mono); el móvil, el
   de la app del conductor (tarjetas grandes, botones a todo lo ancho).
   ========================================================================== */

.demo-cabeza {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem);
}

.demo-cabeza .portada-motivo { height: 160%; bottom: -30%; }
.demo-cabeza h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; letter-spacing: -0.025em; margin: 0.6rem 0 1rem; }

.demo { padding: clamp(1.5rem, 4vw, 2.5rem) 0 0; }

/* --- La guía ------------------------------------------------------------------ */

.guia {
  position: sticky;
  top: calc(var(--alto-cabecera) + 0.5rem);
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1.25rem;
  background: var(--tinta);
  color: #FFFFFF;
  border-radius: var(--radio);
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 14px 30px -18px rgba(22, 22, 22, 0.7);
}

.guia-pasos {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: g;
}

.guia-pasos li {
  counter-increment: g;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid #4A4C55;
  color: transparent;
  font-size: 0;
  position: relative;
}

.guia-pasos li::before {
  content: counter(g);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #9A9EAD;
}

.guia-pasos li.hecho { background: var(--azul); border-color: var(--azul); }
.guia-pasos li.hecho::before { content: "✓"; color: #FFFFFF; }
.guia-pasos li.ahora { border-color: #7C9BFF; box-shadow: 0 0 0 3px rgba(124, 155, 255, 0.3); }
.guia-pasos li.ahora::before { color: #FFFFFF; }

.guia-texto { font-size: 0.98rem; line-height: 1.45; }
.guia-texto b { color: #7C9BFF; }

.guia .mando { color: #FFFFFF; border-color: #4A4C55; }
.guia .mando:hover { background: #FFFFFF; color: var(--tinta); }

@media (max-width: 760px) {
  .guia { grid-template-columns: 1fr auto; }
  .guia-pasos { grid-column: 1 / -1; }
  .guia-pasos li { width: 22px; height: 22px; }
}

/* --- Oficina / móvil: pestañas solo en pantallas estrechas ------------------------ */

.vistas { display: none; }

.escenario {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .vistas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    background: var(--fondo-2);
    border: 1px solid var(--borde);
    border-radius: 100px;
    padding: 0.3rem;
    margin-bottom: 1rem;
  }

  .vistas [role="tab"] {
    all: unset;
    cursor: pointer;
    text-align: center;
    padding: 0.55rem 0.5rem;
    border-radius: 100px;
    font-family: var(--f-titulo);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--texto-2);
  }

  .vistas [role="tab"][aria-selected="true"] { background: var(--tinta); color: #FFFFFF; }
  .vistas [role="tab"]:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

  .escenario { grid-template-columns: minmax(0, 1fr); }
  .escenario > [hidden] { display: none; }
}

.vistas-aviso {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.45rem;
  border-radius: 100px;
  background: var(--urgente);
  color: #FFFFFF;
  font-size: 0.7rem;
  animation: latido-aviso 1.2s ease-in-out infinite;
}

.vistas-aviso[hidden] { display: none; }

@keyframes latido-aviso { 50% { transform: scale(1.12); } }

/* --- La oficina ----------------------------------------------------------------- */

.oficina {
  background: var(--fondo);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: 0 20px 40px -30px rgba(22, 22, 22, 0.5);
  min-width: 0;
}

.of-barra {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--tinta);
  color: #FFFFFF;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}

.of-barra .marca { width: 110px; height: auto; }
.of-pantalla { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: #9A9EAD; }
.of-hora { margin-left: auto; font-family: var(--f-mono); font-size: 0.78rem; color: #7C9BFF; }

.of-cifras {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--borde-fino);
}

.of-cifras div {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.85rem;
  border-right: 1px solid var(--borde-fino);
}

.of-cifras div:last-child { border-right: 0; }
.of-cifras b { font-family: var(--f-titulo); font-size: 1.4rem; line-height: 1.1; font-variant-numeric: tabular-nums; transition: color 0.4s ease; }
.of-cifras b.cambia { color: var(--azul); }
.of-cifras span { font-size: 0.72rem; color: var(--texto-3); white-space: nowrap; }

@media (max-width: 600px) {
  .of-cifras { grid-template-columns: repeat(3, 1fr); }
  .of-cifras div:nth-child(3) { border-right: 0; }
  .of-cifras div:nth-child(-n+3) { border-bottom: 1px solid var(--borde-fino); }
}

.of-cuerpo {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

@media (max-width: 1180px) {
  .of-cuerpo { grid-template-columns: minmax(0, 1fr); }
}

.of-mapa-caja { position: relative; padding: 0.9rem; border-right: 1px solid var(--borde-fino); }

@media (max-width: 1180px) {
  .of-mapa-caja { border-right: 0; border-bottom: 1px solid var(--borde-fino); }
}

.of-mapa { display: block; width: 100%; height: auto; border-radius: 6px; }
.of-mapa .m-fondo { fill: #EEF0F4; }
.of-mapa .m-via { fill: none; stroke: #FFFFFF; stroke-width: 9; stroke-linecap: round; }
.of-mapa .m-calle { fill: none; stroke: #FFFFFF; stroke-width: 4.5; stroke-linecap: round; }
.of-mapa text { font-family: var(--f-mono); font-size: 8.5px; text-anchor: middle; fill: #626878; }
.of-mapa .m-planta rect { fill: #DDE0E7; stroke: #A9AFBC; }
.of-mapa .m-planta path { fill: none; stroke: #A9AFBC; stroke-width: 1.5; }
.of-mapa .m-planta text { font-weight: 600; letter-spacing: 0.12em; fill: #3F4350; }
.of-mapa .m-sitio circle { fill: #A9AFBC; }

.of-mapa .act { cursor: pointer; outline: none; }
.of-mapa .act rect, .of-mapa .act circle, .of-mapa .act path { stroke: #FFFFFF; stroke-width: 1.5; transition: fill 0.4s ease; }
.of-mapa .act.en-obra rect { fill: var(--azul); }
.of-mapa .act.en-camion rect { fill: #E09A1A; }
.of-mapa .act.en-planta rect { fill: #8A8E9C; }
.of-mapa .act-maquina path { fill: #147A48; }
.of-mapa .act-camion circle { fill: var(--tinta); }
.of-mapa .act-camion.otro circle { fill: #626878; }
.of-mapa .act-camion path { fill: #FFFFFF; stroke: #FFFFFF; stroke-width: 0.8; stroke-linejoin: round; }
.of-mapa .act-planta circle { fill: #8A8E9C; }
.of-mapa .act-planta text { fill: #FFFFFF; font-weight: 600; font-size: 9px; }
.of-mapa .act:hover rect, .of-mapa .act:hover circle, .of-mapa .act:hover path,
.of-mapa .act:focus-visible rect, .of-mapa .act:focus-visible circle, .of-mapa .act:focus-visible path { stroke: #161616; stroke-width: 2.2; }
.of-mapa .act.elegido rect, .of-mapa .act.elegido circle, .of-mapa .act.elegido path { stroke: #F5B544; stroke-width: 2.6; }

.of-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.74rem;
  color: var(--texto-3);
}

.of-leyenda li { display: inline-flex; align-items: center; gap: 0.35rem; }
.of-leyenda .l { width: 12px; height: 9px; border-radius: 2px; display: inline-block; }
.of-leyenda .l-obra { background: var(--azul); }
.of-leyenda .l-camion { background: #E09A1A; }
.of-leyenda .l-planta { background: #8A8E9C; }
.of-leyenda .l-maquina { background: #147A48; }
.of-leyenda .l-vehiculo { background: var(--tinta); border-radius: 50%; width: 10px; height: 10px; }

.of-fuera { margin-top: 1rem; }

.of-fuera-lista { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--borde-fino); }

.of-fuera-lista button {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: grid;
  grid-template-columns: 6.2rem 1fr auto;
  gap: 0.6rem;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--borde-fino);
  font-size: 0.82rem;
}

.of-fuera-lista button:hover { background: var(--fondo-2); }
.of-fuera-lista button:focus-visible { outline: 2px solid var(--azul); outline-offset: -2px; }
.of-fuera-lista code { font-family: var(--f-mono); font-weight: 600; font-size: 0.78rem; }
.of-fuera-lista .donde { color: var(--texto-2); min-width: 0; }
.of-fuera-lista li.sale { animation: sale-fila 0.6s ease both; }

@keyframes sale-fila { to { opacity: 0; transform: translateX(16px); } }

.of-ficha {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  width: min(260px, calc(100% - 2.8rem));
  background: var(--fondo);
  border: 1px solid var(--borde);
  border-top: 3px solid var(--azul);
  border-radius: 10px;
  padding: 0.85rem 0.95rem 0.95rem;
  box-shadow: 0 16px 34px -18px rgba(22, 22, 22, 0.55);
  font-size: 0.84rem;
  animation: entra-panel 0.25s ease both;
}

.of-ficha[hidden] { display: none; }
.of-ficha h3 { font-size: 1rem; margin: 0.15rem 0 0.5rem; }
.of-ficha dl { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.7rem; margin: 0; }
.of-ficha dt { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--texto-3); padding-top: 0.2rem; }
.of-ficha dd { margin: 0; color: var(--texto); }
.of-ficha .cerrar-ficha {
  all: unset;
  cursor: pointer;
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--texto-3);
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}
.of-ficha .cerrar-ficha:hover { color: var(--texto); background: var(--fondo-2); }
.of-ficha .cerrar-ficha:focus-visible { outline: 2px solid var(--azul); }

.of-lateral { padding: 0.9rem 1rem 1rem; min-width: 0; }

.of-titulo {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--texto-3);
  margin: 0 0 0.55rem;
}

.of-titulo + .of-servicios, .of-titulo + .of-registro { margin-bottom: 1.1rem; }

.of-servicios { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.servicio {
  border: 1px solid var(--borde);
  border-left: 4px solid var(--llevada);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.86rem;
  background: var(--fondo);
  transition: box-shadow 0.3s ease;
}

.servicio.s-retirada { border-left-color: var(--retirada); }
.servicio.s-cambio { border-left-color: var(--cambio); }
.servicio.destacado-ahora { box-shadow: 0 0 0 3px rgba(27, 84, 255, 0.25); }
.servicio .s-tipo { font-family: var(--f-mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.servicio.s-retirada .s-tipo { color: var(--retirada); }
.servicio.s-llevada .s-tipo { color: var(--llevada); }
.servicio.s-cambio .s-tipo { color: var(--cambio); }
.servicio b { font-family: var(--f-titulo); font-weight: 600; }
.servicio .s-detalle { color: var(--texto-3); font-size: 0.8rem; }

.s-estado {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--texto-2);
}

.s-luz { width: 8px; height: 8px; border-radius: 50%; background: #A9AFBC; flex: 0 0 auto; }
.s-luz.roja { background: var(--retirada); animation: latido-aviso 1s ease-in-out infinite; }
.s-luz.verde { background: var(--llevada); }
.s-luz.ambar { background: #E09A1A; }

.s-accion {
  all: unset;
  cursor: pointer;
  margin-top: 0.35rem;
  align-self: flex-start;
  background: var(--azul);
  color: #FFFFFF;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font-family: var(--f-titulo);
  font-size: 0.82rem;
  font-weight: 600;
}

.s-accion:hover { background: var(--azul-hover); }
.s-accion:focus-visible { outline: 2px solid var(--tinta); outline-offset: 2px; }
.s-accion.secundaria { background: transparent; color: var(--azul); border: 1.5px solid var(--azul); padding: 0.35rem 0.7rem; }
.s-accion.secundaria:hover { background: var(--azul-suave); }
.s-accion.llama { animation: llama 1.6s ease-in-out infinite; }

@keyframes llama {
  0%, 100% { box-shadow: 0 0 0 0 rgba(27, 84, 255, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(27, 84, 255, 0); }
}

.of-registro {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--borde-fino);
  font-size: 0.8rem;
  max-height: 15rem;
  overflow-y: auto;
}

.of-registro li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--borde-fino);
  color: var(--texto-2);
}

.of-registro li.nuevo { animation: entra-linea-claro 0.6s ease both; }

@keyframes entra-linea-claro {
  from { opacity: 0; background: var(--azul-suave); }
  to { opacity: 1; background: transparent; }
}

.of-registro time { font-family: var(--f-mono); font-size: 0.74rem; color: var(--azul); }
.of-registro b { color: var(--texto); font-weight: 600; }

/* --- El móvil ------------------------------------------------------------------- */

.movil { position: sticky; top: calc(var(--alto-cabecera) + 6.5rem); display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }

@media (max-width: 960px) {
  .movil { position: static; }
}

.tel {
  width: 100%;
  max-width: 320px;
  height: 600px;
  background: #161616;
  border: 9px solid #161616;
  border-radius: 32px;
  box-shadow: 0 26px 50px -24px rgba(22, 22, 22, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tel.vibra { animation: vibra 0.12s linear 6; }

@keyframes vibra {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px) rotate(-0.6deg); }
  75% { transform: translateX(3px) rotate(0.6deg); }
}

.tel-barra {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0.9rem 0.45rem;
  color: #9A9EAD;
  font-family: var(--f-mono);
  font-size: 0.62rem;
}

.tel-pantalla {
  flex: 1;
  position: relative;
  background: #F5F6F8;
  color: #16171B;
  overflow-y: auto;
  border-radius: 6px 6px 22px 22px;
  padding: 0.9rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tel-pantalla > * { animation: entra-panel 0.3s ease both; }

.t-titulo { font-family: var(--f-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: #626878; }
.t-saludo { font-family: var(--f-titulo); font-size: 1.15rem; font-weight: 700; line-height: 1.2; }

.t-ficha, .t-tarea {
  background: #FFFFFF;
  border: 1px solid #DADDE3;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.84rem;
}

.t-ficha b, .t-tarea b { font-size: 0.92rem; }
.t-ficha span, .t-tarea span { color: #626878; font-size: 0.78rem; }

.t-tarea { border-left: 6px solid var(--retirada); }
.t-tarea.hecha { border-left-color: var(--llevada); opacity: 0.6; }
.t-tarea .t-tipo { font-family: var(--f-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--retirada); }
.t-tarea.hecha .t-tipo { color: var(--llevada); }

.t-vacio { text-align: center; color: #626878; font-size: 0.84rem; padding: 1.2rem 0.5rem; border: 1.5px dashed #CDD1D9; border-radius: 10px; }

.t-boton {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: center;
  background: var(--azul);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 0.85rem;
  font-family: var(--f-titulo);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.t-boton:hover { background: var(--azul-hover); }
.t-boton:focus-visible { outline: 3px solid #161616; outline-offset: 2px; }
.t-boton[disabled], .t-boton[aria-disabled="true"] { background: #A9AFBC; cursor: not-allowed; }
.t-boton.secundario { background: transparent; color: #16171B; border: 1.5px solid #16171B; padding: 0.6rem; font-size: 0.86rem; }
.t-boton.llama { animation: llama 1.6s ease-in-out infinite; }

.t-relleno { flex: 1; }

/* Aviso de la oficina, encima de lo que haya. */
.t-aviso {
  background: #FFFFFF;
  border: 1px solid #CDD1D9;
  border-left: 6px solid var(--azul);
  border-radius: 12px;
  padding: 0.8rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 12px 26px -14px rgba(22, 22, 22, 0.5);
  animation: entrar-aviso 0.5s ease both;
}

.t-aviso .t-titulo { color: var(--azul); }
.t-aviso b { font-size: 0.98rem; }
.t-aviso span { font-size: 0.82rem; color: #3F4350; }

/* El camino */
.t-ruta { background: #FFFFFF; border: 1px solid #DADDE3; border-radius: 10px; padding: 0.6rem; }
.t-ruta svg { display: block; width: 100%; height: auto; }
.t-ruta .r-via { fill: none; stroke: #DADDE3; stroke-width: 6; stroke-linecap: round; }
.t-ruta .r-hecho { fill: none; stroke: var(--azul); stroke-width: 6; stroke-linecap: round; }
.t-ruta circle { fill: #161616; }
.t-ruta .r-fin { fill: var(--retirada); }

/* La cámara */
.t-visor {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #2A3440;
  aspect-ratio: 4 / 3;
}

.t-visor svg { display: block; width: 100%; height: 100%; }
.t-visor .v-marco { fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-dasharray: 10 6; opacity: 0.8; }
.t-visor .v-barrido { position: absolute; left: 0; right: 0; height: 2px; background: #7C9BFF; box-shadow: 0 0 10px #7C9BFF; animation: barrer 1.1s ease-in-out infinite; }
.t-visor.flash::after { content: ""; position: absolute; inset: 0; background: #FFFFFF; animation: flash 0.35s ease-out forwards; }

@keyframes flash { from { opacity: 0.95; } to { opacity: 0; } }

.t-disparo {
  all: unset;
  cursor: pointer;
  align-self: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 5px solid #161616;
  box-shadow: inset 0 0 0 3px #FFFFFF, inset 0 0 0 30px var(--azul);
}

.t-disparo:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; }
.t-disparo[disabled] { opacity: 0.4; cursor: wait; }

.t-leido { display: flex; align-items: center; gap: 0.6rem; font-family: var(--f-mono); font-weight: 600; font-size: 0.95rem; }
.t-leido .pintado { background: #3E6B92; color: #FFFFFF; padding: 0.25rem 0.5rem; border-radius: 3px; letter-spacing: 0.08em; }
.t-leido .placa { background: #E8C547; color: #3D2E00; padding: 0.25rem 0.5rem; border-radius: 3px; letter-spacing: 0.06em; }
.t-ok { color: var(--llevada); font-weight: 700; font-size: 0.86rem; }

/* El residuo */
.t-residuos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }

.t-residuo {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.35rem;
  background: #FFFFFF;
  border: 1.5px solid #DADDE3;
  border-radius: 10px;
  text-align: center;
  font-size: 0.76rem;
  line-height: 1.2;
}

.t-residuo svg { width: 26px; height: 26px; }
.t-residuo svg * { fill: none; stroke: #626878; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.t-residuo small { font-family: var(--f-mono); font-size: 0.62rem; color: #626878; }
.t-residuo[aria-pressed="true"] { border: 2.5px solid var(--azul); background: #EAF0FF; font-weight: 700; }
.t-residuo[aria-pressed="true"] svg * { stroke: var(--azul); }
.t-residuo:focus-visible { outline: 2px solid #161616; outline-offset: 1px; }

.t-habitual { font-size: 0.74rem; color: #626878; text-align: center; }

/* La firma */
.t-firma {
  position: relative;
  background: #FFFFFF;
  border: 1.5px solid #CDD1D9;
  border-radius: 10px;
  height: 170px;
  touch-action: none;
}

.t-firma canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; border-radius: 10px; }
.t-firma .t-raya { position: absolute; left: 12%; right: 12%; bottom: 34px; border-bottom: 1px solid #CDD1D9; pointer-events: none; }
.t-firma .t-indica { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 0.72rem; color: #A9AFBC; pointer-events: none; }
.t-firma.firmado .t-indica { display: none; }

.t-fila-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }

.t-nota {
  background: #FDF4E3;
  border: 1px solid #F0D9A8;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font-size: 0.76rem;
  color: #6B4500;
}

.t-nota[hidden] { display: none; }

/* El cierre */
.t-sello { display: flex; align-items: center; gap: 0.6rem; color: var(--llevada); font-family: var(--f-titulo); font-weight: 700; font-size: 1.15rem; }
.t-sello svg { width: 34px; height: 34px; }
.t-lista-ok { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.84rem; }
.t-lista-ok li { display: flex; gap: 0.45rem; }
.t-lista-ok li::before { content: "✓"; color: var(--llevada); font-weight: 700; }
.t-lista-ok li.pendiente::before { content: "…"; color: #E09A1A; }

.movil-pie { font-size: 0.8rem; color: var(--texto-3); text-align: center; }

/* --- El final y el albarán ------------------------------------------------------------ */

.demo-fin {
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--borde);
  border-top: 3px solid var(--azul);
  border-radius: var(--radio);
  background: var(--tarjeta);
  display: grid;
  gap: 1rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: center;
}

.albaran-capa {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(22, 22, 22, 0.66);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: clamp(1rem, 4vw, 3rem) 1rem;
  animation: entra-panel 0.25s ease both;
}

.albaran-capa[hidden] { display: none; }

.albaran-doc {
  position: relative;
  width: min(680px, 100%);
  background: #FFFFFF;
  color: #161616;
  border-radius: 6px;
  padding: clamp(1.2rem, 4vw, 2.2rem);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  font-size: 0.86rem;
  outline: none;
  overflow: hidden;
}

/* La marca de agua: es un documento de mentira y tiene que verse. */
.albaran-doc::before {
  content: "DEMOSTRACIÓN · SIN VALIDEZ";
  position: absolute;
  top: 46%;
  left: -10%;
  right: -10%;
  text-align: center;
  transform: rotate(-24deg);
  font-family: var(--f-titulo);
  font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 2.8rem);
  color: rgba(196, 38, 29, 0.09);
  pointer-events: none;
  white-space: nowrap;
}

.alb-cabeza { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid #161616; padding-bottom: 0.8rem; margin-bottom: 1rem; }
.alb-cabeza h2 { font-size: 1.05rem; line-height: 1.3; max-width: 26ch; }
.alb-cabeza .alb-num { text-align: right; font-family: var(--f-mono); font-size: 0.78rem; }
.alb-cabeza .alb-num b { display: block; font-family: var(--f-titulo); font-size: 1.5rem; }
.alb-empresa { font-size: 0.78rem; color: #626878; margin-top: 0.3rem; }

.alb-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1.2rem; margin: 0 0 1rem; }

@media (max-width: 520px) {
  .alb-datos { grid-template-columns: 1fr; }
}

.alb-datos div { border-bottom: 1px solid #E3E5EA; padding-bottom: 0.4rem; }
.alb-datos dt { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: #626878; }
.alb-datos dd { margin: 0.1rem 0 0; font-weight: 600; }

.alb-pie { display: grid; grid-template-columns: 1fr auto; gap: 1.2rem; align-items: end; }
.alb-firma img { display: block; width: 220px; max-width: 100%; height: auto; border-bottom: 1px solid #161616; }
.alb-firma span { display: block; font-size: 0.78rem; color: #3F4350; margin-top: 0.3rem; }
.alb-qr { text-align: center; font-size: 0.68rem; color: #626878; max-width: 120px; }
.alb-qr img { display: block; width: 104px; height: 104px; margin: 0 auto 0.3rem; }

.alb-sello { margin-top: 1rem; padding-top: 0.7rem; border-top: 1px dashed #CDD1D9; font-family: var(--f-mono); font-size: 0.68rem; color: #626878; word-break: break-all; }

.alb-cerrar { margin-top: 1.2rem; display: flex; justify-content: flex-end; gap: 0.6rem; }

/* --- En el móvil: la guía abajo, siempre a la vista ---------------------------------------
   Arriba y pegada tapaba media pantalla del móvil de la demo. Abajo, compacta, deja ver la
   pantalla entera. Cambia el orden visual, no el del documento (que sigue empezando por ella). */

@media (max-width: 760px) {
  .demo > .contenedor { display: flex; flex-direction: column; }
  .demo .vistas { order: 1; scroll-margin-top: calc(var(--alto-cabecera) + 0.5rem); }
  .demo .escenario { order: 2; }
  .demo .guia {
    order: 3;
    position: sticky;
    top: auto;
    bottom: 0.5rem;
    margin: 1rem 0 0;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.75rem;
    padding: 0.6rem 0.75rem;
  }
  .demo .demo-fin { order: 4; }
  .guia-texto { font-size: 0.86rem; grid-column: 1 / -1; }
  .guia .mando { grid-column: 2; grid-row: 1; padding: 0.3rem 0.55rem; font-size: 0.6rem; }
  .guia-pasos { grid-column: 1; grid-row: 1; }
  .tel { height: min(600px, calc(100vh - var(--alto-cabecera) - 13rem)); min-height: 470px; }
}
