/* Polaris Comunica. Estetica calmada: pocos colores, sin parpadeos, objetivos tactiles grandes. */
:root {
  --azul: #27348b;          /* azul Polaris (logo) */
  --azul-suave: #e9edfb;
  --cian: #2ea3f2;
  --fondo: #f5f7fb;
  --tarjeta: #ffffff;
  --texto: #1d2340;
  --texto-suave: #5b6382;
  --borde: #d9deec;
  --ok: #2f9e6b;
  --ok-suave: #e3f5ec;
  --aviso: #e0a100;
  /* Codigo de colores Fitzgerald (estandar en SAAC) */
  --k-persona: #fff1a8;
  --k-accion: #d4f1cb;
  --k-descriptor: #d3e6ff;
  --k-cosa: #ffe0c2;
  --k-lugar: #ffe0c2;
  --k-social: #fbd6e5;
  --k-pregunta: #e6dbf8;
  --picto: 132px;
  --radio: 20px;
  --sombra: 0 2px 0 rgba(29, 35, 64, .08), 0 6px 18px rgba(29, 35, 64, .06);
  --fuente: "Atkinson Hyperlegible", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html[data-tam="s"] { --picto: 104px; }
html[data-tam="l"] { --picto: 172px; }
html[data-contraste="alto"] {
  --fondo: #ffffff; --tarjeta: #ffffff; --texto: #000; --texto-suave: #222; --borde: #000;
  --k-persona: #ffe600; --k-accion: #7fdc6a; --k-descriptor: #7fb8ff; --k-cosa: #ffb46b; --k-lugar: #ffb46b; --k-social: #ff9cc4; --k-pregunta: #c3a3f5;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fondo); color: var(--texto); font-family: var(--fuente);
  font-size: 20px; line-height: 1.35;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:focus-visible, [tabindex]:focus-visible { outline: 4px solid var(--cian); outline-offset: 3px; }
img { -webkit-user-drag: none; pointer-events: none; }
.oculto { display: none !important; }

#app { min-height: 100%; display: flex; flex-direction: column; }

/* Barra superior */
.barra {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--tarjeta); border-bottom: 2px solid var(--borde);
  position: sticky; top: 0; z-index: 10;
}
.barra h1 { font-size: 26px; margin: 0; flex: 1; color: var(--azul); }
.btn-icono {
  min-width: 64px; height: 64px; border-radius: 16px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--azul-suave); color: var(--azul); font-weight: 700; font-size: 18px;
}
.btn-icono svg { width: 30px; height: 30px; }
.btn-icono:active { transform: scale(.96); }

.contenido { flex: 1; padding: 16px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* Inicio */
.saludo { text-align: center; margin: 12px 0 20px; }
.saludo h2 { font-size: clamp(30px, 5vw, 44px); margin: 0; color: var(--azul); }
.saludo p { margin: 6px 0 0; color: var(--texto-suave); }
.menu {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.menu-btn {
  background: var(--tarjeta); border-radius: 28px; box-shadow: var(--sombra);
  border: 3px solid transparent; padding: 22px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 28px; font-weight: 800; color: var(--azul);
}
.menu-btn img { width: min(150px, 32vw); height: min(150px, 32vw); object-fit: contain; }
.menu-btn small { font-size: 17px; font-weight: 500; color: var(--texto-suave); }
.menu-btn:active { border-color: var(--cian); transform: scale(.98); }
.pie { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 28px 0 8px; color: var(--texto-suave); font-size: 14px; text-align: center; flex-wrap: wrap; }
.pie img { height: 44px; }

/* Pictogramas */
.picto {
  background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra);
  border: 3px solid var(--borde);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 6px 6px; min-height: var(--picto); width: 100%;
  font-weight: 700; font-size: 18px; text-align: center; line-height: 1.1;
  transition: transform .12s ease;
}
.picto img { width: 78%; aspect-ratio: 1; object-fit: contain; max-height: calc(var(--picto) - 34px); }
.picto span { margin-top: 4px; min-height: 1.1em; }
html[data-texto="no"] .picto span { display: none; }
.picto:active { transform: scale(.94); }
.k-persona { background: var(--k-persona); }
.k-accion { background: var(--k-accion); }
.k-descriptor { background: var(--k-descriptor); }
.k-cosa { background: var(--k-cosa); }
.k-lugar { background: var(--k-lugar); }
.k-social { background: var(--k-social); }
.k-pregunta { background: var(--k-pregunta); }
html[data-fitz="no"] .picto { background: var(--tarjeta); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(var(--picto), 1fr)); }

/* Comunicar */
.frase {
  display: flex; gap: 10px; align-items: stretch;
  background: var(--tarjeta); border: 3px solid var(--azul); border-radius: 24px;
  padding: 10px; margin-bottom: 14px; min-height: 120px;
  position: sticky; top: 88px; z-index: 5;
}
.frase-tira { flex: 1; display: flex; gap: 8px; overflow-x: auto; align-items: center; scrollbar-width: thin; }
.frase-tira .picto { width: 96px; min-width: 96px; min-height: 96px; font-size: 14px; box-shadow: none; }
.frase-tira .picto img { max-height: 60px; }
.frase-vacia { color: var(--texto-suave); font-size: 18px; padding-left: 8px; }
.frase-acciones { display: flex; gap: 8px; align-items: center; }
.btn-decir { background: var(--azul); color: #fff; height: 96px; min-width: 96px; border-radius: 18px; font-weight: 800; flex-direction: column; font-size: 16px; }
.btn-decir svg { width: 40px; height: 40px; }
.btn-decir.hablando { background: var(--cian); }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 6px; scrollbar-width: thin; }
.tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--tarjeta);
  border: 3px solid var(--borde); font-weight: 700; font-size: 18px; min-height: 60px;
}
.tab img { width: 40px; height: 40px; }
.tab[aria-selected="true"] { border-color: var(--azul); background: var(--azul); color: #fff; }
.tab[aria-selected="true"] img { background: #fff; border-radius: 50%; }

/* Mi dia */
.dia-ahora { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 640px) { .dia-ahora { grid-template-columns: 1fr; } }
.panel { background: var(--tarjeta); border-radius: 28px; box-shadow: var(--sombra); padding: 16px; text-align: center; border: 3px solid var(--borde); }
.panel h3 { margin: 0 0 8px; font-size: 22px; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .06em; }
.panel.ahora { border-color: var(--azul); }
.panel.ahora h3 { color: var(--azul); }
.panel img { width: min(220px, 50vw); height: min(220px, 50vw); object-fit: contain; }
.panel .nombre { font-size: 30px; font-weight: 800; }
.panel.despues { opacity: .85; }
.panel.despues img { width: min(150px, 36vw); height: min(150px, 36vw); }
.fila-botones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.btn-grande {
  min-height: 72px; padding: 0 28px; border-radius: 20px; font-size: 22px; font-weight: 800;
  background: var(--azul); color: #fff; display: inline-flex; align-items: center; gap: 10px;
}
.btn-grande.sec { background: var(--azul-suave); color: var(--azul); }
.btn-grande.ok { background: var(--ok); }
.btn-grande svg { width: 30px; height: 30px; }
.btn-grande:active { transform: scale(.97); }
.linea-dia { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 12px; scrollbar-width: thin; }
.paso-dia { flex: 0 0 auto; width: 118px; text-align: center; background: var(--tarjeta); border: 3px solid var(--borde); border-radius: 18px; padding: 8px 4px; position: relative; font-size: 15px; font-weight: 700; }
.paso-dia img { width: 80px; height: 80px; object-fit: contain; }
.paso-dia .hora { display: block; color: var(--texto-suave); font-weight: 500; }
.paso-dia.hecho { opacity: .4; }
.paso-dia.hecho::after { content: "✓"; position: absolute; top: 4px; right: 8px; color: var(--ok); font-size: 28px; font-weight: 900; }
.paso-dia.actual { border-color: var(--azul); background: var(--azul-suave); }

/* Temporizador visual */
.timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.timer { width: min(320px, 70vw); aspect-ratio: 1; }
.timer-txt { font-size: 40px; font-weight: 800; color: var(--azul); font-variant-numeric: tabular-nums; }

/* Aprender */
.juego-cabecera { text-align: center; margin: 4px 0 16px; }
.juego-cabecera .consigna { font-size: clamp(26px, 4.5vw, 40px); font-weight: 800; color: var(--azul); margin: 0; }
.juego-cabecera .palabra { font-size: clamp(40px, 9vw, 72px); font-weight: 800; letter-spacing: .04em; margin: 4px 0; }
.juego-cabecera img.modelo { width: min(220px, 48vw); height: min(220px, 48vw); object-fit: contain; }
.estrellas { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.estrellas i { width: 34px; height: 34px; border-radius: 50%; background: var(--borde); display: inline-block; }
.estrellas i.llena { background: var(--aviso); -webkit-mask: var(--estrella) center/contain no-repeat; mask: var(--estrella) center/contain no-repeat; border-radius: 0; }
:root { --estrella: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.6 7.1.6-5.4 4.7 1.6 7L12 17.3 5.8 21l1.6-7L2 9.2l7.1-.6z'/%3E%3C/svg%3E"); }
.opciones { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(42vw, 200px), 1fr)); max-width: 900px; margin: 0 auto; }
.opciones .picto { min-height: 190px; font-size: 22px; }
.opciones .picto img { max-height: 150px; }
.opcion-texto { min-height: 90px !important; font-size: 28px !important; }
.picto.bien { border-color: var(--ok); background: var(--ok-suave); }
.picto.pista { border-color: var(--cian); box-shadow: 0 0 0 6px rgba(46, 163, 242, .3); }
.picto.mal { animation: sacudir .35s ease; }
.picto.apagado { opacity: .35; }
@keyframes sacudir { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.secuencia-huecos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 22px; }
.hueco { border: 3px dashed var(--borde); border-radius: var(--radio); aspect-ratio: .85; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; text-align: center; padding: 4px; background: var(--tarjeta); }
.hueco b { font-size: 30px; color: var(--borde); }
.hueco img { width: 80%; aspect-ratio: 1; object-fit: contain; }
.hueco.lleno { border-style: solid; border-color: var(--ok); background: var(--ok-suave); }
.hueco.siguiente { border-color: var(--azul); }
.secuencia-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(30vw, 150px), 1fr)); gap: 12px; }
.cestas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 800px; margin: 16px auto 0; }
.cesta { min-height: 150px; border-radius: 26px; border: 4px solid var(--borde); background: var(--tarjeta); font-size: 26px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; }
.cesta img { width: 90px; height: 90px; }
.cesta.mal { animation: sacudir .35s ease; }
.cesta.pista { border-color: var(--cian); box-shadow: 0 0 0 6px rgba(46, 163, 242, .3); }
.item-clasificar { width: min(240px, 60vw); margin: 0 auto; }

.celebra { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(245, 247, 251, .85); z-index: 50; flex-direction: column; gap: 16px; }
.celebra .estrella-g { width: 180px; height: 180px; background: var(--aviso); -webkit-mask: var(--estrella) center/contain no-repeat; mask: var(--estrella) center/contain no-repeat; animation: crecer .6s ease both; }
.celebra p { font-size: 40px; font-weight: 800; color: var(--azul); margin: 0; }
@keyframes crecer { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Calma */
.calma-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.respira { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 10px; }
.burbuja { width: min(260px, 60vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #bfe3fb, var(--cian)); transform: scale(.55); transition: transform 4s ease-in-out; display: flex; align-items: center; justify-content: center; }
.burbuja.inspira { transform: scale(1); }
.respira-txt { font-size: 32px; font-weight: 800; color: var(--azul); min-height: 44px; }
.contar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.contar button { aspect-ratio: 1; border-radius: 50%; background: var(--azul-suave); font-size: 30px; font-weight: 800; color: var(--azul); border: 3px solid transparent; }
.contar button.hecho { background: var(--azul); color: #fff; }

/* Educador */
.ajustes { display: grid; gap: 16px; max-width: 980px; margin: 0 auto; }
.ajuste { background: var(--tarjeta); border-radius: 20px; padding: 16px 18px; box-shadow: var(--sombra); }
.ajuste h3 { margin: 0 0 10px; color: var(--azul); font-size: 22px; }
.ajuste label { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 19px; }
.ajuste input[type="text"], .ajuste select { font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--borde); min-height: 52px; flex: 1; min-width: 0; background: #fff; color: var(--texto); }
.ajuste input[type="range"] { flex: 1; accent-color: var(--azul); height: 40px; }
.ajuste input[type="checkbox"] { width: 30px; height: 30px; accent-color: var(--azul); }
.segmentado { display: inline-flex; border: 2px solid var(--azul); border-radius: 14px; overflow: hidden; }
.segmentado button { padding: 10px 18px; min-height: 52px; font-weight: 700; color: var(--azul); }
.segmentado button[aria-pressed="true"] { background: var(--azul); color: #fff; }
.agenda-edit { display: flex; flex-direction: column; gap: 8px; }
.agenda-fila { display: flex; align-items: center; gap: 10px; background: var(--fondo); border-radius: 14px; padding: 6px 8px; }
.agenda-fila img { width: 52px; height: 52px; }
.agenda-fila .n { flex: 1; font-weight: 700; }
.agenda-fila input[type="time"] { font: inherit; border: 2px solid var(--borde); border-radius: 10px; padding: 6px; background: #fff; color: var(--texto); }
.mini { min-width: 48px; height: 48px; border-radius: 12px; background: var(--azul-suave); color: var(--azul); font-weight: 800; font-size: 20px; }
.selector-picto { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.selector-picto button { background: var(--fondo); border-radius: 12px; padding: 4px; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; }
.selector-picto img { width: 60px; height: 60px; }
table.progreso { width: 100%; border-collapse: collapse; font-size: 17px; }
.progreso th, .progreso td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--borde); }
.progreso td.num { font-variant-numeric: tabular-nums; }
.barra-pct { height: 12px; border-radius: 6px; background: var(--azul-suave); overflow: hidden; min-width: 80px; }
.barra-pct > div { height: 100%; background: var(--ok); }
.nota { color: var(--texto-suave); font-size: 16px; margin: 6px 0 0; }
.fotos-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.fotos-lista .f { position: relative; background: var(--fondo); border-radius: 12px; padding: 6px; text-align: center; font-weight: 700; font-size: 15px; }
.fotos-lista img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.fotos-lista .borrar { position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: var(--sombra); font-weight: 900; }

/* Boton educador con pulsacion larga */
.btn-educador { position: relative; overflow: hidden; }
.btn-educador .carga { position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background: var(--azul); }
.btn-educador.cargando .carga { width: 100%; transition: width 1.5s linear; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--texto); color: #fff; padding: 14px 22px; border-radius: 14px; z-index: 60; font-size: 18px; max-width: calc(100% - 32px); text-align: center; }

@media (max-width: 640px) {
  body { font-size: 18px; }
  :root { --picto: 104px; }
  html[data-tam="s"] { --picto: 88px; }
  html[data-tam="l"] { --picto: 140px; }
  .barra h1 { font-size: 21px; }
  .btn-icono { min-width: 56px; height: 56px; padding: 0 10px; }
  .btn-icono .lbl { display: none; }
  .frase { top: 78px; min-height: 100px; flex-wrap: wrap; }
  .frase-tira { flex-basis: 100%; min-height: 84px; }
  .frase-acciones { width: 100%; }
  .frase-acciones .btn-decir { flex: 1; flex-direction: row; height: 64px; font-size: 20px; }
  .frase-acciones .btn-icono:not(.btn-decir) { height: 64px; }
  .frase-tira .picto { width: 76px; min-width: 76px; min-height: 80px; font-size: 12px; }
  .frase-tira .picto img { max-height: 46px; }
  .btn-decir { height: 80px; min-width: 72px; }
  .secuencia-huecos { gap: 6px; }
  .hueco { font-size: 11px; }
}

html[data-movimiento="reducido"] *, html[data-movimiento="reducido"] *::before { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; } }
html[data-movimiento="reducido"] .burbuja { transition: transform 4s ease-in-out !important; }
.logo-app { width: 52px; height: 52px; flex: 0 0 auto; }

/* ===== PolarisApp: pantallas nuevas ===== */
.ico { display: inline-flex; }
.ico svg { width: 28px; height: 28px; }
.subtitulo { font-size: 22px; color: var(--texto-suave); margin: 22px 0 10px; }
.fila-botones.izq { justify-content: flex-start; }
.error { color: #b42318; font-weight: 700; min-height: 1.2em; margin: 6px 0; }
.peligro { background: #b42318 !important; color: #fff !important; }
.chip-offline { background: #fff3cd; color: #7a5a00; border-radius: 999px; padding: 6px 12px; font-size: 15px; font-weight: 700; }
.logo-app { width: 52px; height: 52px; flex: 0 0 auto; }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.login-caja { background: var(--tarjeta); border-radius: 28px; box-shadow: var(--sombra); padding: 28px 24px; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 8px; }
.login-caja h1 { margin: 0; color: var(--azul); text-align: center; font-size: 30px; }
.login-caja > .nota { text-align: center; margin: 0 0 8px; }
.login-logo { width: 96px; height: 96px; margin: 0 auto 4px; }
.login-caja label { font-weight: 700; margin-top: 6px; }
.login-caja input, .form-modal input, .form-grid input, .form-grid select, .modal input[type="search"], textarea {
  font: inherit; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--borde); min-height: 56px; width: 100%; background: #fff; color: var(--texto);
  -webkit-user-select: text; user-select: text;
}
input, textarea { -webkit-user-select: text; user-select: text; }
.login-caja input:focus, textarea:focus, .modal input:focus { outline: none; border-color: var(--cian); }
.login-caja .btn-grande { justify-content: center; margin-top: 8px; }
.campo-clave { display: flex; gap: 8px; }
.campo-clave .ver-clave { min-width: 56px; height: 56px; }

/* Elegir persona */
.perfiles { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin: 10px 0 24px; }
.perfil-btn { background: var(--tarjeta); border-radius: 28px; box-shadow: var(--sombra); padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; color: var(--azul); border: 3px solid transparent; }
.perfil-btn img { width: 140px; height: 140px; object-fit: cover; border-radius: 24px; background: var(--fondo); }
.perfil-btn:active { border-color: var(--cian); }
.avatar-mini { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #fff; }
.avatar-grande { width: 120px; height: 120px; border-radius: 22px; object-fit: cover; background: var(--fondo); border: 3px solid var(--borde); }
.fila-avatar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

/* Modal */
.modal-fondo { position: fixed; inset: 0; background: rgba(20, 26, 50, .45); z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.modal { background: var(--fondo); border-radius: 24px; width: 100%; max-width: 760px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-cab { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 2px solid var(--borde); background: var(--tarjeta); border-radius: 24px 24px 0 0; }
.modal-cab h2 { flex: 1; margin: 0; font-size: 24px; color: var(--azul); }
.modal-cuerpo { padding: 16px 20px 22px; }
.form-modal { display: flex; flex-direction: column; gap: 14px; }
.form-modal label, .form-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.selector-barra { display: flex; gap: 10px; flex-wrap: wrap; }
.selector-barra input { flex: 1 1 260px; }
.selector-picto button img, .selector-picto .top-palabra img { width: 64px; height: 64px; object-fit: contain; }
.selector-picto button { min-height: 100px; justify-content: center; text-align: center; line-height: 1.1; }
.top-palabra { text-align: center; font-size: 14px; font-weight: 700; }

/* Editar pictograma */
.editar-picto { display: flex; gap: 20px; flex-wrap: wrap; }
.edit-preview { width: 170px; flex: 0 0 auto; }
.edit-preview .picto { min-height: 170px; }
.editar-campos { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; }
.editar-campos label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.editar-campos input[type="text"] { font: inherit; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--borde); min-height: 56px; }
.colores { display: flex; gap: 8px; flex-wrap: wrap; }
.color-chip { padding: 8px 12px; border-radius: 12px; border: 3px solid transparent; font-size: 15px; font-weight: 700; min-height: 48px; }
.color-chip[aria-pressed="true"] { border-color: var(--azul); }
.grabador { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grabando { color: #b42318; font-weight: 800; animation: latido 1.2s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .4; } }
.picto { position: relative; }
.marca-voz { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--azul); color: #fff; display: flex; align-items: center; justify-content: center; }
.marca-voz svg { width: 16px; height: 16px; }
.picto-agregar { border-style: dashed; color: var(--azul); background: var(--tarjeta) !important; gap: 6px; }
.picto-agregar .ico svg { width: 40px; height: 40px; }

/* Editor de tablero */
.tab.oculta { opacity: .5; text-decoration: line-through; }
.tab-nueva { border-style: dashed; color: var(--azul); padding-left: 14px; }
.cat-herr { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: var(--tarjeta); border-radius: 20px; padding: 14px; margin-bottom: 10px; box-shadow: var(--sombra); }
.cat-herr label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; flex: 1 1 200px; }
.cat-herr input { font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--borde); min-height: 56px; }
.cat-herr .btn-grande, .cat-herr .btn-icono { min-height: 60px; height: 60px; }
.ico-img { width: 36px; height: 36px; }

/* Historias */
.historia { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.puntos { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.puntos i { width: 16px; height: 16px; border-radius: 50%; background: var(--borde); }
.puntos i.visto { background: var(--cian); }
.puntos i.activo { background: var(--azul); transform: scale(1.3); }
.historia-pictos { display: grid; gap: 16px; width: 100%; max-width: 900px; justify-content: center; }
.historia-pictos.n1 { grid-template-columns: minmax(0, 340px); }
.historia-pictos.n2 { grid-template-columns: repeat(2, minmax(0, 300px)); }
.historia-pictos.n3 { grid-template-columns: repeat(3, minmax(0, 260px)); }
.historia-picto { background: var(--tarjeta); border-radius: 28px; box-shadow: var(--sombra); padding: 14px; border: 3px solid var(--borde); }
.historia-picto img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.historia-texto { font-size: clamp(26px, 4.2vw, 38px); font-weight: 700; text-align: center; max-width: 900px; margin: 0; line-height: 1.3; }
.pagina-cab { display: flex; gap: 8px; align-items: center; }
.pagina-cab h3 { flex: 1; margin: 0; }
.pagina-pictos { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.pagina-pictos .picto { width: 130px; min-height: 130px; font-size: 14px; }
textarea { resize: vertical; line-height: 1.4; }

/* Administración */
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
.cuenta { border-top: 1px solid var(--borde); padding: 14px 0; }
.cuenta.inactiva { opacity: .55; }
.cuenta-cab { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.cuenta select { font: inherit; padding: 10px; border-radius: 12px; border: 2px solid var(--borde); min-height: 56px; background: #fff; }
.cuenta .btn-grande { min-height: 56px; font-size: 18px; padding: 0 16px; }
.asignar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.chip-check { display: inline-flex !important; align-items: center; gap: 8px; background: var(--fondo); border-radius: 999px; padding: 6px 14px !important; font-size: 17px; }
.clave-temporal { background: var(--azul-suave); border-radius: 16px; padding: 16px; font-size: 22px; display: flex; flex-direction: column; gap: 6px; margin: 12px 0; -webkit-user-select: text; user-select: text; }
.mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: .06em; }
.tabla-scroll { overflow-x: auto; }
.pct { display: flex; align-items: center; gap: 8px; }
.cesta.bien { border-color: var(--ok); background: var(--ok-suave); }
.btn-grande:disabled { opacity: .4; }
