/* MBV Gestión — sistema visual "obra": acero galvanizado, grafito, azul plano y naranja MBV solo para la acción principal */
:root {
  --acero: #E6EAED;        /* fondo: chapa galvanizada */
  --acero-2: #D3D9DE;      /* bordes y separadores */
  --panel: #FFFFFF;
  --grafito: #1C2630;      /* texto y menú */
  --grafito-2: #2B3743;
  --gris: #5A6773;         /* texto secundario */
  --plano: #1F4E79;        /* azul de plano: navegación y enlaces */
  --plano-f: #E3ECF5;
  --naranja: #E8641B;      /* acción principal (marca MBV) */
  --naranja-o: #C9520F;
  --ok: #1F8A4C; --ok-f: #E2F3E8;
  --ambar: #B7791F; --ambar-f: #FBF0DB;
  --rojo: #C62828; --rojo-f: #FBE4E4;
  --r-s: 6px; --r-m: 10px; --r-l: 16px;
  --titulo: "Roboto Condensed", "sans-serif-condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --texto: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--texto); color: var(--grafito); background: var(--acero);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
a { color: var(--plano); }
h1, h2, h3, .cifra { font-family: var(--titulo); font-stretch: condensed; letter-spacing: .005em; }
h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 1rem; font-weight: 700; }
h2 { font-size: 1.2rem; margin: 1.75rem 0 .6rem; font-weight: 700; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; font-weight: 700; }
.cargando { padding: 3rem; text-align: center; color: var(--gris); }
.suave { color: var(--gris); font-size: .9rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- estructura: menú lateral (escritorio) / barra inferior (móvil) ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.menu { background: var(--grafito); color: #C9D2DA; display: flex; flex-direction: column; padding: 1.1rem .75rem; position: sticky; top: 0; height: 100vh; }
.menu .marca { font-family: var(--titulo); font-size: 1.45rem; font-weight: 800; color: #fff; padding: 0 .6rem 1.2rem; display: flex; align-items: center; gap: .55rem; }
.menu .marca svg { width: 30px; height: 30px; flex: none; }
.menu a { display: flex; align-items: center; gap: .75rem; padding: .7rem .7rem; border-radius: var(--r-m); color: inherit; text-decoration: none; font-weight: 600; margin-bottom: 2px; }
.menu a svg { width: 22px; height: 22px; flex: none; stroke: currentColor; }
.menu a:hover { background: var(--grafito-2); color: #fff; }
.menu a.activo { background: var(--plano); color: #fff; }
.menu .pie { margin-top: auto; padding: .8rem .6rem 0; border-top: 1px solid #33414E; font-size: .88rem; }
.menu .pie b { display: block; color: #fff; }
.menu .pie button { margin-top: .6rem; background: transparent; color: #C9D2DA; border-color: #3C4B59; min-height: 36px; padding: .35rem .8rem; }
.principal { min-width: 0; }
.cabecera-movil { display: none; }
main.vista { max-width: 1160px; margin: 0 auto; padding: 1.75rem 1.75rem 6rem; }

@media (max-width: 760px) {
  .app { display: block; }
  .cabecera-movil { display: flex; align-items: center; gap: .6rem; position: sticky; top: 0; z-index: 20; background: var(--grafito); color: #fff; padding: .7rem 1rem; }
  .cabecera-movil .marca { font-family: var(--titulo); font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: .45rem; }
  .cabecera-movil .marca svg { width: 24px; height: 24px; }
  .cabecera-movil .quien { margin-left: auto; font-size: .82rem; opacity: .8; text-align: right; line-height: 1.2; }
  .cabecera-movil button { background: transparent; color: #fff; border-color: #3C4B59; min-height: 36px; padding: .3rem .7rem; font-size: .85rem; }
  .menu { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 20; flex-direction: row; padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; }
  .menu .marca, .menu .pie { display: none; }
  .menu a { flex: 1 0 64px; flex-direction: column; gap: .2rem; padding: .45rem .2rem; font-size: .72rem; margin: 0; text-align: center; }
  .menu a.activo { background: transparent; color: #fff; box-shadow: inset 0 3px 0 var(--naranja); border-radius: 0; }
  main.vista { padding: 1.1rem 1rem 7.5rem; }
  h1 { font-size: 1.55rem; }
}

/* ---------- bloques ---------- */
.tarjeta { background: var(--panel); border: 1px solid var(--acero-2); border-radius: var(--r-l); padding: 1.1rem 1.15rem; margin-bottom: 1rem; }
.tarjeta > h2:first-child, .tarjeta > h3:first-child { margin-top: 0; }
.rejilla { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.kpis { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); margin-bottom: 1.25rem; }
.kpi { background: var(--panel); border: 1px solid var(--acero-2); border-left: 5px solid var(--acero-2); border-radius: var(--r-m); padding: .75rem .85rem; }
.kpi small { color: var(--gris); font-size: .82rem; display: block; }
.kpi b { display: block; font-family: var(--titulo); font-stretch: condensed; font-size: 1.85rem; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.kpi.ok { border-left-color: var(--ok); } .kpi.rojo { border-left-color: var(--rojo); background: var(--rojo-f); } .kpi.ambar { border-left-color: var(--ambar); }
.fila { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.entre h1 { margin-bottom: 0; }
.cabeza-vista { margin-bottom: 1.25rem; }
.cabeza-vista p { margin: .25rem 0 0; color: var(--gris); }

/* ---------- controles: grandes, para usar con guantes ---------- */
button, .boton { font: inherit; font-weight: 600; border: 1px solid var(--acero-2); background: var(--panel); color: var(--grafito); padding: .6rem 1rem; border-radius: var(--r-m); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 46px; }
button:hover, .boton:hover { border-color: var(--gris); }
button svg, .boton svg { width: 20px; height: 20px; stroke: currentColor; flex: none; }
button.primario, .boton.primario { background: var(--naranja); color: #fff; border-color: var(--naranja); }
button.primario:hover, .boton.primario:hover { background: var(--naranja-o); border-color: var(--naranja-o); }
button.peligro { color: var(--rojo); border-color: #E7B4B4; background: #fff; }
button:disabled { opacity: .45; cursor: default; }
label { display: block; font-size: .86rem; color: var(--gris); font-weight: 600; margin-bottom: .7rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; font: inherit; font-size: 16px; padding: .65rem .75rem; border: 1px solid var(--acero-2); border-radius: var(--r-m); background: #fff; color: var(--grafito); min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plano); box-shadow: 0 0 0 3px var(--plano-f); }
textarea { min-height: 110px; }
input[type=checkbox] { display: inline-block; width: 22px; height: 22px; min-height: 0; margin: 0 .55rem 0 0; vertical-align: middle; accent-color: var(--plano); }
.form { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: end; }
.form .ancho { grid-column: 1 / -1; }
.check { display: flex; align-items: center; color: var(--grafito); font-weight: 500; }

/* ---------- tablas ---------- */
.tabla { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .6rem .55rem; border-bottom: 1px solid var(--acero); text-align: left; vertical-align: middle; }
th { color: var(--gris); font-weight: 600; font-size: .82rem; }
tr.rojo td { background: var(--rojo-f); }
tr.clic { cursor: pointer; } tr.clic:hover td { background: var(--plano-f); }

/* ---------- estados ---------- */
.chip { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--acero); color: var(--gris); white-space: nowrap; }
.chip.ok { background: var(--ok-f); color: var(--ok); } .chip.rojo { background: var(--rojo-f); color: var(--rojo); } .chip.ambar { background: var(--ambar-f); color: var(--ambar); }
.alerta { border-left: 4px solid var(--ambar); background: var(--ambar-f); padding: .65rem .85rem; border-radius: var(--r-s); margin-bottom: .5rem; font-size: .93rem; }
.alerta.rojo { border-color: var(--rojo); background: var(--rojo-f); color: #7A1717; }
.alerta a { font-weight: 700; color: inherit; }
.vacio { text-align: center; padding: 1.6rem 1rem; color: var(--gris); }
.vacio b { display: block; color: var(--grafito); font-size: 1.05rem; margin-bottom: .25rem; }
.barra-pct { height: 10px; background: var(--acero); border-radius: 99px; overflow: hidden; min-width: 90px; }
.barra-pct i { display: block; height: 100%; background: var(--ok); }
.barra-pct.ambar i { background: var(--ambar); } .barra-pct.rojo i { background: var(--rojo); }

/* ---------- elemento propio: el "panel" de 5 montantes, un tramo por fase ---------- */
.montantes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: .7rem 0 .35rem; }
.montantes span { position: relative; height: 34px; background: var(--acero); border-radius: 3px; overflow: hidden; }
.montantes span i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ok); }
.montantes span.ambar i { background: var(--ambar); } .montantes span.rojo i { background: var(--rojo); }
.montantes span.rojo { outline: 2px solid var(--rojo); outline-offset: -2px; }
.leyenda-fases { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; font-size: .68rem; color: var(--gris); line-height: 1.15; }
.obra-card { display: block; text-decoration: none; color: inherit; }
.obra-card:hover { border-color: var(--plano); }
.obra-card .datos { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; margin-top: .4rem; }
.obra-card .datos b { font-family: var(--titulo); font-size: 1.15rem; }

/* ---------- pestañas y columnas (comercial) ---------- */
.pestanas { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pestanas button.activo { background: var(--grafito); color: #fff; border-color: var(--grafito); }
.columnas { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.columna { background: #DCE2E7; border-radius: var(--r-l); padding: .65rem; min-height: 140px; }
.columna h3 { margin: .2rem .3rem .65rem; font-size: .95rem; color: var(--grafito); }
.mini { background: var(--panel); border-radius: var(--r-m); padding: .75rem; margin-bottom: .55rem; border: 1px solid var(--acero-2); font-size: .92rem; }
.miniatura { width: 100%; max-height: 220px; object-fit: contain; background: var(--acero); border-radius: var(--r-m); }

/* ---------- avisos ---------- */
#aviso { position: fixed; left: 50%; bottom: 6rem; transform: translateX(-50%); z-index: 60; max-width: 92vw; }
#aviso div { background: var(--grafito); color: #fff; padding: .85rem 1.15rem; border-radius: var(--r-m); margin-top: .4rem; font-weight: 600; box-shadow: 0 6px 20px rgba(28,38,48,.25); }
#aviso div.error { background: var(--rojo); }

/* ---------- acceso ---------- */
.login-fondo { min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: var(--grafito) linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 60px 100%; }
.login { width: min(400px, 100%); background: var(--panel); border-radius: var(--r-l); padding: 1.75rem; }
.login .marca { font-family: var(--titulo); font-size: 1.9rem; font-weight: 800; display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; }
.login .marca svg { width: 40px; height: 40px; }
.login .sub { color: var(--gris); margin: 0 0 1.4rem; }
.login button.primario { width: 100%; min-height: 54px; font-size: 1.05rem; }
.pin { font-size: 2rem !important; letter-spacing: .5em; text-align: center; font-family: var(--titulo); }

/* ---------- portal de fichaje (operario) ---------- */
.portal { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--grafito); color: #fff; padding: 1.25rem; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
.portal .arriba { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.portal .arriba .marca { font-family: var(--titulo); font-weight: 800; display: flex; gap: .4rem; align-items: center; }
.portal .arriba .marca svg { width: 24px; height: 24px; }
.portal .hola { font-size: 1rem; opacity: .7; } .portal .nombre { font-family: var(--titulo); font-size: 2.2rem; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.portal label { color: #AEB9C3; }
.portal select { font-size: 1.3rem; padding: .9rem; background: var(--grafito-2); color: #fff; border-color: #3C4B59; }
.portal .estado { margin: 1rem 0; padding: 1rem 1.1rem; border-radius: var(--r-l); background: var(--grafito-2); font-size: 1.1rem; display: flex; align-items: center; gap: .7rem; }
.portal .estado .punto { width: 14px; height: 14px; border-radius: 50%; background: #7C8A96; flex: none; }
.portal .estado.dentro .punto { background: #4ADE80; box-shadow: 0 0 0 5px rgba(74,222,128,.18); }
.portal .botones { display: grid; gap: 1rem; margin-top: auto; }
.portal .grande { width: 100%; min-height: 112px; font-family: var(--titulo); font-size: 1.85rem; font-weight: 800; border: 0; border-radius: 20px; color: #fff; }
.portal .grande svg { width: 34px; height: 34px; }
.portal .grande.entrada { background: #1F8A4C; } .portal .grande.salida { background: var(--rojo); }
.portal .grande:disabled { background: #2E3B47; opacity: 1; color: #7C8A96; }
.portal .hoy { font-size: .9rem; opacity: .85; margin-top: 1.1rem; } .portal .hoy ul { padding-left: 1.1rem; margin: .3rem 0 0; } .portal .hoy li { margin-bottom: .2rem; }
.portal button.salir { background: transparent; color: #AEB9C3; border-color: #3C4B59; min-height: 38px; padding: .3rem .8rem; font-size: .88rem; }
.capa { position: fixed; inset: 0; z-index: 50; background: rgba(15,21,27,.97); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; text-align: center; }
.capa video { width: min(92vw, 420px); aspect-ratio: 1; object-fit: cover; border-radius: 20px; border: 4px solid var(--naranja); }
.capa .grande-texto { font-family: var(--titulo); font-size: 1.8rem; font-weight: 800; margin: 1rem 0 .5rem; }
.capa.ok { background: #145A33; } .capa.rojo { background: #7A1717; }
.capa .icono { font-size: 5rem; line-height: 1; }
.capa ul { text-align: left; font-size: 1.05rem; max-width: 420px; }
.capa button { margin-top: 1.25rem; min-width: 220px; min-height: 58px; font-size: 1.15rem; }

/* ---------- herramientas en el móvil del operario ---------- */
.portal .herr-op { margin-top: 1.1rem; background: var(--grafito-2); border-radius: var(--r-l); padding: .9rem 1rem; }
.portal .herr-op button { background: transparent; color: #fff; border-color: #4A5967; min-height: 46px; }
.portal .herr-op ul { list-style: none; padding: 0; margin: .4rem 0 0; }
.portal .herr-op li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-top: 1px solid #3C4B59; }
.portal .herr-op li small { color: #AEB9C3; }
.portal .herr-op li button { min-height: 40px; font-size: .85rem; padding: .3rem .7rem; flex: none; }

/* pedidos */
.pedido.urg-urgente { border-left: 6px solid var(--rojo); } .pedido.urg-pronto { border-left: 6px solid var(--ambar); }
.lineas-ver { padding-left: 1.1rem; margin: .6rem 0; } .lineas-ver li { margin-bottom: .35rem; }
.hay-sobrante { font-size: .85rem; color: var(--ok); font-weight: 600; }
.linea-pedido { display: grid; grid-template-columns: 1fr 80px 80px; gap: .4rem; margin-bottom: .4rem; }
.linea-pedido input { margin: 0; }
.urgencias { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.urg { display: flex; flex-direction: column; gap: .1rem; border: 2px solid var(--acero-2); border-radius: var(--r-m); padding: .6rem .7rem; cursor: pointer; margin: 0; color: var(--grafito); background: #fff; }
.urg input { position: absolute; opacity: 0; pointer-events: none; }
.urg span { font-size: .78rem; color: var(--gris); font-weight: 500; }
.urg:has(input:checked) { border-color: var(--grafito); box-shadow: 0 0 0 2px var(--grafito); }
.urg.rojo:has(input:checked) { border-color: var(--rojo); box-shadow: 0 0 0 2px var(--rojo); background: var(--rojo-f); }
.urg.ambar:has(input:checked) { border-color: var(--ambar); box-shadow: 0 0 0 2px var(--ambar); background: var(--ambar-f); }
.badge { font-style: normal; background: var(--rojo); color: #fff; border-radius: 999px; padding: .05rem .45rem; font-size: .75rem; margin-left: .3rem; }
.capa.capa-scroll { justify-content: flex-start; overflow-y: auto; }
.form-capa .suave, .form-capa label { color: #AEB9C3; }
.form-capa .urg { color: var(--grafito); } .form-capa .urg span { color: var(--gris); }
@media (max-width: 560px) { .linea-pedido { grid-template-columns: 1fr 1fr; } .linea-pedido [name=material] { grid-column: 1 / -1; } .lineas .linea-pedido { padding-bottom: .4rem; border-bottom: 1px dashed var(--acero-2); } }
.portal .herr-op button.pedir { background: var(--naranja); border-color: var(--naranja); }

/* pedido por voz */
.voz { display: grid; gap: .45rem; margin: .2rem 0 1rem; }
.voz small { color: var(--gris); }
.form-capa .voz small { color: #AEB9C3; }
.boton-voz { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 64px; font-size: 1.1rem; font-weight: 700; background: var(--plano); border-color: var(--plano); color: #fff; border-radius: var(--r-m); }
.boton-voz svg { width: 28px; height: 28px; }
.boton-voz.grabando { background: var(--rojo); border-color: var(--rojo); animation: latido 1.2s ease-in-out infinite; }
@keyframes latido { 50% { box-shadow: 0 0 0 10px rgba(200, 40, 40, .18); } }
@media (prefers-reduced-motion: reduce) { .boton-voz.grabando { animation: none; } }
.voz textarea { margin: 0; font-size: 1rem; }
.dictado { display: flex; gap: .5rem; align-items: flex-start; background: var(--plano-f); border-radius: var(--r-s); padding: .55rem .7rem; margin: .4rem 0; font-size: .92rem; }
.dictado svg { width: 18px; height: 18px; flex: none; margin-top: .1rem; color: var(--plano); }

/* sobrantes */
.mini-wrap { position: relative; flex: none; }
.mini-n { position: absolute; right: -6px; bottom: -6px; background: var(--grafito); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .05rem .4rem; }
.sobrante .galeria { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.sobrante .fila button { min-height: 42px; padding: .4rem .8rem; }
.portal .herr-op + .herr-op { margin-top: .8rem; }

/* fotos de herramientas */
.herr-nombre { display: flex; gap: .65rem; align-items: center; }
.mini-foto { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; cursor: pointer; border: 1px solid var(--acero-2); background: var(--acero); }
button.mini-foto.vacia { min-height: 0; padding: 0; color: var(--gris); border-style: dashed; }
tr.fila-fotos td { background: #F6F8F9; padding: .3rem .8rem .9rem; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: .6rem; }
.galeria figure { margin: 0; background: var(--acero); border-radius: var(--r-m); overflow: hidden; }
.galeria img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; }
.galeria figcaption { padding: .45rem .55rem; font-size: .8rem; line-height: 1.3; text-align: left; }
.capa .campo-foto { background: transparent; color: #fff; border-color: #55636f; min-height: 52px; }

/* categorías de herramientas */
.categorias-herr { margin-bottom: 1rem; }
.categorias-herr button { min-height: 38px; padding: .3rem .8rem; font-size: .9rem; }
tr.cabeza-cat td { background: var(--grafito); color: #fff; font-family: var(--titulo); font-weight: 700; font-size: 1.05rem; padding: .5rem .7rem; }
tr.cabeza-cat td .suave { color: #AEB9C3; }
@media (max-width: 760px) {
  .pestanas, .categorias-herr, .fila-filtros { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem; }
  .pestanas button, .categorias-herr button, .categorias-herr span { flex: none; }
}
@media (max-width: 760px) { .apilada tr.cabeza-cat { display: block; padding: 0; border-radius: var(--r-s); margin-top: .8rem; } }

/* tablas que en el móvil se convierten en fichas */
@media (max-width: 760px) {
  .apilada table, .apilada tbody, .apilada tr, .apilada td { display: block; width: 100%; }
  .apilada tr:first-child { display: none; }
  .apilada tr { border-bottom: 1px solid var(--acero-2); padding: .6rem 0; }
  .apilada td { border: 0; padding: .2rem 0; }
  .apilada td .fila { justify-content: flex-start !important; }
}

/* ---------- etiquetas QR ---------- */
.etiquetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.etiqueta { display: flex; gap: .6rem; align-items: center; background: #fff; border: 2px solid var(--grafito); border-radius: var(--r-m); padding: .5rem; break-inside: avoid; }
.etiqueta img { width: 96px; height: 96px; image-rendering: pixelated; flex: none; }
.etiqueta b { display: block; font-family: var(--titulo); font-size: 1.4rem; }
.etiqueta span { display: block; font-size: .85rem; line-height: 1.2; }
.etiqueta small { display: block; font-size: .68rem; color: var(--gris); margin-top: .2rem; }
@media print { .etiquetas { grid-template-columns: repeat(3, 1fr); } }

/* ---------- asistente de ayuda ---------- */
.ayuda-btn { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 30; width: 58px; height: 58px; border-radius: 50%; padding: 0; background: var(--plano); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(31,78,121,.35); }
.ayuda-btn svg { width: 28px; height: 28px; }
.portal ~ .ayuda-btn, .portal .ayuda-btn { background: #fff; color: var(--grafito); }
@media (max-width: 760px) { .ayuda-btn { bottom: calc(5.2rem + env(safe-area-inset-bottom)); } .sin-menu .ayuda-btn { bottom: 1.1rem; } }
.ayuda { position: fixed; z-index: 45; right: 0; top: 0; bottom: 0; width: min(420px, 100%); background: var(--panel); box-shadow: -10px 0 30px rgba(28,38,48,.18); display: flex; flex-direction: column; color: var(--grafito); animation: entra .18s ease-out; }
@keyframes entra { from { transform: translateX(24px); opacity: 0; } }
.ayuda header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem; background: var(--plano); color: #fff; }
.ayuda header h2 { margin: 0; font-size: 1.3rem; }
.ayuda header button { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); min-height: 40px; }
.ayuda .cuerpo { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; }
.ayuda .consejos { background: var(--plano-f); border-radius: var(--r-m); padding: .8rem .9rem; margin-bottom: 1rem; }
.ayuda .consejos b { display: block; margin-bottom: .3rem; }
.ayuda .consejos ul { margin: 0; padding-left: 1.1rem; font-size: .93rem; } .ayuda .consejos li { margin-bottom: .25rem; }
.ayuda .faq { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.ayuda .faq button { min-height: 38px; padding: .35rem .75rem; font-size: .88rem; font-weight: 500; border-radius: 999px; background: #fff; text-align: left; }
.ayuda .msg { max-width: 88%; padding: .65rem .85rem; border-radius: 14px; margin-bottom: .55rem; font-size: .95rem; white-space: pre-wrap; }
.ayuda .msg.yo { margin-left: auto; background: var(--grafito); color: #fff; border-bottom-right-radius: 4px; }
.ayuda .msg.bot { background: var(--acero); border-bottom-left-radius: 4px; }
.ayuda form { display: flex; gap: .5rem; padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--acero-2); }
.ayuda form input { margin: 0; }
.ayuda form button { flex: none; }

/* ---------- QR imprimible ---------- */
.cartel { max-width: 560px; margin: 1rem auto; text-align: center; background: #fff; padding: 2rem; border: 4px solid var(--grafito); border-radius: var(--r-l); }
.cartel img.qr { width: 100%; max-width: 380px; image-rendering: pixelated; }
.cartel .titulo { font-family: var(--titulo); font-size: 2.2rem; font-weight: 800; }
@media print { .menu, .cabecera-movil, .no-imprimir, .ayuda-btn { display: none !important; } .app { display: block; } main.vista { padding: 0; } }
