/* =========================================================
   IBAGUÉRECICLA — ESTILOS · "Ocobo y tierra"
   Paleta tomada del logo: verde de hoja, rosa de ocobo y
   tierra cálida sobre fondo crema. Las canecas conservan
   el código nacional de colores (Res. 2184 de 2019).
   Móvil primero. Radios 6/10/14, escala de 8, una sola sombra.
   ========================================================= */

/* ---------- 1. Tokens: claro ---------- */
:root {
  color-scheme: light;

  /* Superficies y texto */
  --bg: #F9F5E9;
  --surface: #FFFDF8;
  --surface-2: #F1EADB;
  --text: #2B1D16;
  --muted: #6B5849;
  --border: #E2D8C3;          /* decorativo */
  --border-strong: #8F7D6D;   /* bordes de inputs y controles (>= 3:1) */

  /* Marca (del logo) */
  --primary: #4A6A22;
  --primary-hover: #3B561A;
  --on-primary: #FFFFFF;
  --primary-soft: #E6EDD3;
  --accent: #A3305C;
  --accent-hover: #8A2850;
  --on-accent: #FFFFFF;
  --accent-soft: #F7DCE5;
  --brown: #7A3E22;
  --ring-green: #7A9E47;      /* SOLO decoración, nunca texto */
  --ring-pink: #F07CA3;       /* SOLO decoración, nunca texto */
  --ring-leaf: #ACCB56;       /* SOLO decoración, nunca texto */

  /* Estados */
  --ok: #3F5F1C;      --ok-soft: #E4ECD2;
  --warn: #8A5300;    --warn-soft: #F6E7C8;    --on-warn: #FFFFFF;
  --danger: #B42318;  --danger-soft: #F8E0DC;  --on-danger: #FFFFFF;
  --info: #7A3E22;    --info-soft: #F1E2D6;

  /* Una sola sombra: toast, Yuji (botón, burbuja, panel) y popups */
  --shadow-float: 0 6px 20px rgba(43, 29, 22, .12);
  --shadow: none;

  /* Canecas: SIN CAMBIOS (Res. 2184/2019) */
  --bin-white-bg: #ffffff;
  --bin-white-fg: #0f172a;
  --bin-green-bg: #15803d;
  --bin-green-fg: #ffffff;
  --bin-black-bg: #111827;
  --bin-black-fg: #f3f4f6;
  --bin-special-bg: #fef3c7;
  --bin-special-fg: #78350f;
  --bin-black-line: #374151;  /* borde de la caneca negra (en oscuro pasa a --border-strong) */

  /* Fotos */
  --photo-filter: none;

  /* Forma y tipografía */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar-h: 64px;
  --bottom-h: 64px;

  /* Alias heredados: el JS los usa en estilos en línea
     (app.js barras(), panel.js, admin.js). NO borrar. */
  --green: var(--primary);
  --green-d: var(--primary);
  --blue: var(--accent);
  --blue-d: var(--primary);
  --amber: var(--warn);
}

/* ---------- 1b. Tokens: oscuro (botón de tema) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17120F;
  --surface: #221B17;
  --surface-2: #2C231E;
  --text: #F3ECE0;
  --muted: #B9A898;
  --border: #3B2F28;
  --border-strong: #7D6B5E;
  --primary: #A9C95A;
  --primary-hover: #BCD872;
  --on-primary: #17120F;
  --primary-soft: #2A3319;
  --accent: #F49AB9;
  --accent-hover: #F7B3CB;
  --on-accent: #17120F;
  --accent-soft: #3A2129;
  --brown: #D9A07A;
  --ok: #A9C95A;      --ok-soft: #263018;
  --warn: #F2B84B;    --warn-soft: #3A2C12;    --on-warn: #17120F;
  --danger: #F58A7E;  --danger-soft: #3D1F1B;  --on-danger: #17120F;
  --info: #D9A07A;    --info-soft: #33251D;
  --shadow-float: 0 6px 20px rgba(0, 0, 0, .45);
  --bin-white-bg: #f8fafc;
  --bin-special-bg: #3b2a0a;
  --bin-special-fg: #fde68a;
  --bin-black-line: var(--border-strong);
  --photo-filter: brightness(.92);
}

/* ---------- 1c. Tokens: oscuro (preferencia del sistema) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17120F;
    --surface: #221B17;
    --surface-2: #2C231E;
    --text: #F3ECE0;
    --muted: #B9A898;
    --border: #3B2F28;
    --border-strong: #7D6B5E;
    --primary: #A9C95A;
    --primary-hover: #BCD872;
    --on-primary: #17120F;
    --primary-soft: #2A3319;
    --accent: #F49AB9;
    --accent-hover: #F7B3CB;
    --on-accent: #17120F;
    --accent-soft: #3A2129;
    --brown: #D9A07A;
    --ok: #A9C95A;      --ok-soft: #263018;
    --warn: #F2B84B;    --warn-soft: #3A2C12;    --on-warn: #17120F;
    --danger: #F58A7E;  --danger-soft: #3D1F1B;  --on-danger: #17120F;
    --info: #D9A07A;    --info-soft: #33251D;
    --shadow-float: 0 6px 20px rgba(0, 0, 0, .45);
    --bin-white-bg: #f8fafc;
    --bin-special-bg: #3b2a0a;
    --bin-special-fg: #fde68a;
    --bin-black-line: var(--border-strong);
    --photo-filter: brightness(.92);
  }
}

/* ---------- 2. Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom));
}

img, svg { max-width: 100%; display: block; }
/* Sin el borde «groove» del navegador (.step y fieldset.field de Admin) */
fieldset { border: 0; min-width: 0; }
a { color: var(--primary); text-underline-offset: .15em; }
a:hover { color: var(--primary-hover); }
b, strong { font-weight: 700; }
small { font-size: .875rem; }
h1, h2, h3, h4, p { overflow-wrap: break-word; }
::selection { background: var(--accent-soft); color: var(--text); }

/* Títulos: Fraunces (h1, h2) y Atkinson 700 (h3, h4) */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
  font-variation-settings: "SOFT" 100;
}
h1 { font-weight: 700; font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1.1; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); line-height: 1.2; }
h3, h4 { font-family: var(--font-body); font-weight: 700; line-height: 1.3; }

code {
  background: var(--surface-2); padding: 1px 6px; border-radius: var(--radius-sm);
  font-size: .9em;
}

/* Íconos del sprite propio (<svg class="i"><use href="#i-…">).
   display:inline-block anula la regla global svg{display:block}. */
.i {
  display: inline-block;
  vertical-align: -.2em;
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -10000px; top: 8px; z-index: 2000;
  background: var(--primary); color: var(--on-primary); font-weight: 700;
  padding: 8px 16px; border-radius: var(--radius-md); text-decoration: none;
}
.skip-link:focus { left: 8px; color: var(--on-primary); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Etiqueta sobre títulos (reemplaza las pastillas .tag) */
.eyebrow, .tag {
  display: flex; align-items: center; gap: 6px;
  font-size: .9375rem; font-weight: 700; color: var(--brown);
  margin-bottom: 8px;
  background: none; border: 0; padding: 0;
  text-transform: none; letter-spacing: 0;
}
.eyebrow .i { color: var(--accent); }

.lead { font-size: 1.125rem; color: var(--muted); max-width: 60ch; }

/* ---------- 3. Encabezado ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 max(16px, 5vw);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  text-decoration: none; color: var(--text);
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  font-variation-settings: "SOFT" 100; letter-spacing: 0;
}
.brand:hover { color: var(--text); }
.brand img { width: 44px; height: 44px; flex: none; }
.brand span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand b { color: var(--primary); font-weight: 700; }

.nav-desktop { display: none; gap: 4px; }
.nav-desktop a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: .9375rem;
  padding: 8px 12px; border-radius: 0; transition: color .15s, box-shadow .15s;
}
.nav-desktop a:hover { color: var(--text); background: none; }
.nav-desktop a.active { color: var(--text); background: none; box-shadow: inset 0 -2px 0 var(--accent); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border-radius: var(--radius-md); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
  font: inherit; transition: background-color .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .i { width: 22px; height: 22px; }

/* Celulares angostos: deja espacio a «Instalar app» sin cortar el nombre de la marca */
@media (max-width: 400px) {
  .topbar { padding: 0 16px; }
  .brand { gap: 8px; font-size: 1.05rem; }
  .brand img { width: 38px; height: 38px; }
  #btn-install { padding: 6px 10px; }
}

/* ---------- 4. Navegación inferior (móvil) ---------- */
.nav-bottom {
  position: fixed; inset: auto 0 0 0; z-index: 1000;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border-top: 1px solid var(--border);
}
.nav-bottom a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .8125rem; font-weight: 700;
  min-width: 0;
}
.nav-bottom a .i { width: 24px; height: 24px; }
.nav-bottom a:hover { color: var(--text); }
.nav-bottom a.active { color: var(--primary); box-shadow: inset 0 2px 0 var(--primary); }

@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .nav-desktop { display: flex; }
  .nav-bottom { display: none; }
}

.offline-banner {
  position: sticky; top: var(--topbar-h); z-index: 900;
  background: var(--warn); color: var(--on-warn); text-align: center;
  font-size: .875rem; font-weight: 700; padding: 6px 16px;
}

/* ---------- 5. Contenedor y tarjetas ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Solo en Guía, Mapa, Panel y Admin. Inicio usa .home-section */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: none;
  padding: clamp(16px, 4vw, 32px); margin-bottom: 24px;
}
.card h2 { margin-bottom: 8px; }
.card > p.muted { max-width: 65ch; }

.notice {
  background: var(--warn-soft); color: var(--text);
  border: 0; border-left: 4px solid var(--warn);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 10px 14px; font-size: .9375rem; margin: 12px 0 16px;
}
.notice .i { color: var(--warn); }

/* ---------- 6. Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid transparent; border-radius: var(--radius-md); cursor: pointer;
  padding: 11px 20px; min-height: 44px;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.25;
  text-decoration: none; text-align: center;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn .i { width: 1.2em; height: 1.2em; }
.btn-sm { padding: 7px 14px; min-height: 38px; font-size: .9375rem; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn[disabled]:active { transform: none; }
.btn-primary[disabled]:hover { background: var(--primary); }
.btn-ghost[disabled]:hover { background: transparent; }

.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .9375rem; }
.input, select.input {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md); padding: 10px 14px; min-height: 46px;
}
.input::placeholder { color: var(--muted); opacity: 1; }
/* Borde y halo verdes como refuerzo; el contorno rosa de :focus-visible se conserva */
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.input-lg { font-size: 1.125rem; padding: 14px 16px; margin-top: 8px; }
.form-error { color: var(--danger); font-weight: 700; font-size: .9375rem; min-height: 1.2em; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

.tabs {
  display: flex; background: var(--surface-2); border-radius: var(--radius-md);
  padding: 4px; margin-bottom: 16px;
}
.tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; padding: 9px; min-height: 40px;
  /* Decisión de diseño (se aparta de la spec §3.11, que pide --radius-md):
     radio concéntrico = 10px del contenedor − 4px de padding = 6px. */
  border-radius: var(--radius-sm); cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] {
  background: var(--surface); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* ---------- 7. Inicio ---------- */

/* 7.1 Hero con foto */
.hero {
  display: grid; gap: 32px; align-items: center;
  grid-template-columns: minmax(0, 1fr);
  padding: 8px 0 0;
}
.hero h1 { margin-bottom: 16px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero > :only-child { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.1fr 1fr; gap: 40px; padding-top: 16px; }
}

/* 7.2 Fotos de Ibagué (color natural, sin texto encima) */
.photo { margin: 0; min-width: 0; }
.photo img {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius-md); background: var(--surface-2);
  filter: var(--photo-filter);
}
.photo figcaption { margin-top: 8px; font-size: .875rem; line-height: 1.45; color: var(--muted); }
.photo figcaption a { color: inherit; }
.photo figcaption a:hover { color: var(--text); }
@media (min-width: 760px) {
  .hero-photo img { aspect-ratio: 4 / 3; }
}

/* 7.3 Franja de cifras (sin cajas) */
.stats-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
@media (min-width: 760px) { .stats-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: none; min-width: 0;
}
.stat .v {
  display: block;
  font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 100;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.15; color: var(--primary);
  overflow-wrap: anywhere;
}
.stat .l { display: block; font-size: .875rem; color: var(--muted); margin-top: 4px; }

.home-stats { gap: 0; border-block: 1px solid var(--border); margin: 32px 0; }
.home-stats .stat { background: none; border: 0; border-radius: 0; padding: 16px 20px; }
.home-stats .stat .v { font-size: clamp(1.75rem, 5vw, 2.4rem); }
/* Filetes en móvil (2 × 2) */
.home-stats .stat:nth-child(odd) { padding-left: 0; }
.home-stats .stat:nth-child(even) { border-left: 1px solid var(--border); }
.home-stats .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
@media (min-width: 760px) {
  .home-stats .stat:nth-child(n) { border-left: 1px solid var(--border); border-top: 0; padding-left: 20px; }
  .home-stats .stat:first-child { border-left: 0; padding-left: 0; }
}
.home-stats-empty { grid-column: 1 / -1; padding: 16px 0; color: var(--muted); max-width: 65ch; }

/* 7.4 Secciones editoriales (sin tarjeta) */
.home-section { padding-top: 32px; margin-top: 32px; border-top: 1px solid var(--border); }
.home-section > h2 { margin-bottom: 16px; }
.home-section > h2 + p { margin-bottom: 8px; max-width: 65ch; }
@media (min-width: 760px) {
  .home-section { padding-top: 48px; margin-top: 48px; }
}

/* 7.5 ¿Y para qué separar? */
.why-grid { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
.why-grid > :only-child { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .why-grid { grid-template-columns: 5fr 7fr; align-items: start; }
}
.why-list { list-style: none; counter-reset: why; display: grid; gap: 24px; }
.why-list li { counter-increment: why; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); }
.why-list li::before {
  content: counter(why) ".";
  font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 100;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 1.75rem; line-height: 1; color: var(--accent);
}
.why-list li > * { grid-column: 2; }
.why-list h3 { font-size: 1.125rem; margin-bottom: 4px; }
.why-list p { color: var(--muted); max-width: 60ch; }

/* 7.6 Galería «La ciudad que cuidamos» */
.city-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) {
  .city-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .city-grid .photo.wide { grid-column: span 2; }
  /* Misma altura para la foto ancha y la angosta de cada fila */
  .city-grid .photo img { aspect-ratio: auto; height: clamp(200px, 26vw, 280px); }
}

/* 7.7 Equipo */
.team-grid {
  display: grid; gap: 24px; margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
}
.team-card { display: flex; align-items: center; gap: 20px; background: none; padding: 0; min-width: 0; }
.team-card h4 { font-size: 1.0625rem; }
.team-card p { font-size: .9375rem; color: var(--muted); }
.avatar {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-display); font-weight: 700; font-variation-settings: "SOFT" 100;
}
/* Anillos verde y rosa, como el logo */
.team-card .avatar {
  width: 56px; height: 56px; margin: 8px; font-size: 1.125rem;
  box-shadow: 0 0 0 3px var(--ring-green), 0 0 0 6px var(--bg), 0 0 0 8px var(--ring-pink);
}

/* Frase del ocobo (logo) */
.logo-note { font-size: .9375rem; color: var(--muted); max-width: 65ch; margin-top: 24px; }
.logo-note .i { color: var(--accent); }

/* ---------- 8. Canecas ---------- */
.bins { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
@media (min-width: 700px) { .bins { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bin {
  border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden;
  border: 1.5px solid var(--border);
}
.bin h3 { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.bin .sub { font-weight: 700; font-size: .875rem; margin-bottom: 6px; }
.bin p { font-size: .9375rem; }
.bin .tip { margin-top: 12px; font-size: .875rem; }
.bin-blanca { background: var(--bin-white-bg); color: var(--bin-white-fg); border-color: #cbd5e1; }
.bin-verde { background: var(--bin-green-bg); color: var(--bin-green-fg); border-color: #166534; }
.bin-negra { background: var(--bin-black-bg); color: var(--bin-black-fg); border-color: var(--bin-black-line); }
.bin-especial { background: var(--bin-special-bg); color: var(--bin-special-fg); border-color: #f59e0b; }

.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; border: 2px solid rgba(0,0,0,.25); }
.dot-blanca { background: #fff; }
.dot-verde { background: #16a34a; }
.dot-negra { background: #111827; border-color: #6b7280; }
.dot-especial { background: #f59e0b; }

.result-list { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.result-list li {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface-2); border-radius: var(--radius-md); padding: 12px 14px;
}
.result-list .name { font-weight: 700; }
.result-list .tipline { font-size: .875rem; color: var(--muted); }
.pill {
  margin-left: auto; flex: none; font-size: .8125rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-sm);
}
.pill-blanca { background: #fff; color: #0f172a; border: 1px solid #cbd5e1; }
.pill-verde { background: #15803d; color: #fff; }
.pill-negra { background: #111827; color: #fff; }
.pill-especial { background: #f59e0b; color: #1f1300; }

/* ---------- 9. Quiz ---------- */
.quiz-q { font-size: 1.25rem; font-weight: 700; margin: 12px 0 16px; text-align: center; }
.quiz-progress {
  height: 8px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--border);
}
.quiz-progress div { height: 100%; background: var(--primary); transition: width .3s; }
.quiz-opts { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .quiz-opts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quiz-opt {
  border-radius: var(--radius-md); padding: 14px 10px; min-height: 52px;
  font: inherit; font-weight: 700; cursor: pointer;
  border-width: 2px; border-style: solid; /* el color lo pone .bin-* */
}
.quiz-opt.correct { outline: 4px solid var(--ok); outline-offset: 2px; }
.quiz-opt.wrong { outline: 4px solid var(--danger); outline-offset: 2px; }
.quiz-feedback { text-align: center; margin-top: 16px; min-height: 3em; font-weight: 700; }
.quiz-end { text-align: center; }
.quiz-end .big {
  font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 100;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 3rem; line-height: 1.1; color: var(--primary);
}

/* ---------- 10. Mapa ---------- */
.map-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 6px 12px; min-height: 36px;
  font: inherit; font-size: .875rem; font-weight: 700; text-align: left;
}
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--text); }
/* Apagado: sin opacidad; borde punteado y muestra de color hueca */
.chip[aria-pressed="false"] {
  opacity: 1; background: transparent; color: var(--muted);
  border: 1.5px dashed var(--border-strong);
}
.chip[aria-pressed="false"]:hover { color: var(--text); border-color: var(--primary); }
.chip i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.chip[aria-pressed="false"] i { background: transparent !important; box-shadow: inset 0 0 0 2px currentColor; }
.chip input { width: 18px; height: 18px; }

.map {
  height: min(60vh, 460px); border-radius: var(--radius-md);
  border: 1px solid var(--border); z-index: 0; overflow: hidden;
}
.map-fallback { display: grid; place-items: center; text-align: center; padding: 20px; background: var(--surface-2); }
.points-list { list-style: none; display: grid; gap: 8px; margin-top: 16px; }
.points-list li {
  display: flex; gap: 12px; align-items: center; background: var(--surface-2);
  border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; border: 1.5px solid transparent;
}
.points-list li:hover, .points-list li.near { border-color: var(--primary); }
.points-list .meta { font-size: .875rem; color: var(--muted); }
.points-list .dist { margin-left: auto; font-weight: 700; font-size: .875rem; white-space: nowrap; }

/* Leaflet con el tema de la app (también en oscuro) */
.leaflet-container { font-family: var(--font-body); font-size: .8125rem; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-float);
}
.leaflet-popup-content-wrapper { border-radius: var(--radius-md); border: 1px solid var(--border); }
.leaflet-popup-content { font-family: inherit; font-size: .9375rem; line-height: 1.45; }
.leaflet-popup-content b { display: block; margin-bottom: 4px; }
.leaflet-container .leaflet-popup-content a { color: var(--primary); }
.leaflet-container .leaflet-popup-content a:hover { color: var(--primary-hover); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-container a.leaflet-popup-close-button:hover,
.leaflet-container a.leaflet-popup-close-button:focus { color: var(--text); }
.leaflet-container .leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted);
  font-size: .8125rem; /* Leaflet la deja en .75rem; mínimo de la app: .8125rem */
}
.leaflet-container .leaflet-control-attribution a { color: var(--primary); }
.leaflet-touch .leaflet-bar, .leaflet-bar {
  border: 1px solid var(--border-strong); box-shadow: none; border-radius: var(--radius-sm); overflow: hidden;
}
.leaflet-bar a, .leaflet-touch .leaflet-bar a {
  background: var(--surface); color: var(--text); border-bottom-color: var(--border);
}
.leaflet-bar a:hover, .leaflet-bar a:focus { background: var(--surface-2); color: var(--text); }
.leaflet-bar a.leaflet-disabled { background: var(--surface-2); color: var(--muted); }
.popup-actions { display: grid; gap: 2px; margin-top: 8px; }
.popup-actions a {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; text-decoration: none; padding: 4px 0;
}
.popup-actions a:hover { text-decoration: underline; }

/* Mi ubicación: punto azul (convención) */
.me-dot {
  width: 22px; height: 22px; border-radius: 50%; background: #2563eb; border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(37, 99, 235, .6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .55); }
  70% { box-shadow: 0 0 0 16px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
#lbl-seguir input { accent-color: var(--primary); }

/* ---------- 11. Perfil, nivel e insignias ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.profile-head h2 { margin: 0; }
.level-bar {
  height: 10px; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; margin-top: 8px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.level-bar div { height: 100%; background: var(--primary); }

.badges { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: 12px; }
.badge {
  text-align: center; background: var(--surface-2); border-radius: var(--radius);
  padding: 16px 10px; border: 1.5px solid transparent;
}
/* Medallón con anillos verde y rosa, como el logo */
.badge .ico {
  width: 56px; height: 56px; margin: 8px auto 12px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); color: var(--primary);
  box-shadow: 0 0 0 2px var(--ring-green), 0 0 0 4px var(--surface-2), 0 0 0 6px var(--ring-pink);
}
.badge .ico .i { width: 28px; height: 28px; }
.badge h4 { font-size: .9375rem; margin-top: 4px; }
.badge p { font-size: .8125rem; color: var(--muted); }
.badge .badge-state { margin-top: 8px; font-weight: 700; color: var(--ok); }
.badge.unlocked { border-color: var(--primary); }
/* Bloqueada: sin opacidad ni escala de grises */
.badge.locked { border: 1.5px dashed var(--border-strong); }
.badge.locked .ico {
  color: var(--muted);
  box-shadow: 0 0 0 2px var(--border-strong), 0 0 0 4px var(--surface-2), 0 0 0 6px var(--border);
}
.badge.locked .badge-state { color: var(--muted); }

/* ---------- 12. Tablas y barras ---------- */
/* position:relative contiene los .sr-only (absolutos) de las celdas; sin esto se
   salen del scroll y estiran la página a lo ancho */
.table-wrap { overflow-x: auto; margin-top: 12px; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: .875rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; color: var(--danger); cursor: pointer;
  font: inherit; font-size: .9375rem; font-weight: 700; padding: 4px 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.neutral { color: var(--primary); }
.link-btn[disabled] { color: var(--muted); cursor: not-allowed; text-decoration: none; }

.bars { display: grid; gap: 10px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: .9375rem; }
.bar-row .track { height: 12px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--primary); border-radius: var(--radius-sm); }
.bar-row .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .bar-row { grid-template-columns: 96px minmax(0, 1fr) 56px; } }

/* Estado vacío */
.empty { text-align: center; padding: 32px 12px; color: var(--muted); }
.empty .ico { display: flex; justify-content: center; color: var(--muted); margin-bottom: 8px; }
.empty .ico .i { width: 40px; height: 40px; stroke-width: 1.75; }
.empty p { max-width: 48ch; margin-inline: auto; }

.two-col { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.two-col > * { min-width: 0; } /* evita que una tabla ancha estire la columna en celulares */
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; } .two-col > .card { margin-bottom: 0; } }

/* ---------- 13. Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); font-weight: 700; font-size: .9375rem;
  padding: 12px 18px; border-radius: var(--radius-md); box-shadow: var(--shadow-float);
  z-index: 1500; max-width: calc(100% - 32px);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 860px) { .toast { bottom: 24px; } }

/* ---------- 14. Contadores (únicos con forma de pastilla) ---------- */
.nav-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: var(--on-danger);
  font-size: .75rem; font-weight: 700; font-style: normal; line-height: 1;
}
.nav-bottom .dot-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; }
.badge-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: var(--danger); color: var(--on-danger);
  font-size: .75rem; font-weight: 700; line-height: 1;
}

/* ---------- 15. Subpestañas de los paneles (solo texto) ---------- */
.subtabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 16px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.subtabs a {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: .9375rem;
  padding: 9px 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border); white-space: nowrap;
}
.subtabs a:hover { color: var(--text); border-color: var(--border-strong); }
.subtabs a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- 16. Píldoras de estado ---------- */
.status {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  font-size: .8125rem; font-weight: 700; line-height: 1.5;
  padding: 2px 8px; border-radius: var(--radius-sm); white-space: nowrap;
}
.status .i { width: 1.1em; height: 1.1em; }
.st-pend { background: var(--warn-soft); color: var(--warn); }
.st-ok { background: var(--ok-soft); color: var(--ok); }
.st-bad { background: var(--danger-soft); color: var(--danger); }
.st-info { background: var(--info-soft); color: var(--info); }

/* ---------- 17. Utilidades de disposición ---------- */
.grow { flex: 1; min-width: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.toolbar .input-sm { max-width: 280px; }
.input-sm { min-height: 38px; padding: 7px 10px; font-size: .9375rem; border-radius: var(--radius-md); }
textarea.input { resize: vertical; min-height: 96px; }
td.wrap { white-space: normal; min-width: 160px; }
td.actions { white-space: nowrap; }
td.actions .btn { margin: 2px 2px 2px 0; }

/* ---------- 18. Panel de participante ---------- */
.panel-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; }
.panel-head h2 { margin: 0; font-size: 1.4rem; }
.panel-head .avatar { width: 56px; height: 56px; font-size: 1.25rem; }
.saldo {
  display: grid; text-align: right; padding: 8px 16px; border-radius: var(--radius-md);
  background: var(--accent); color: var(--on-accent);
}
.saldo .v {
  font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 100;
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 1.6rem; line-height: 1.1;
}
.saldo .l { font-size: .8125rem; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.kpis div { background: var(--surface-2); border-radius: var(--radius-md); padding: 12px; display: grid; }
.kpis b {
  font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 100;
  font-variant-numeric: lining-nums tabular-nums; font-size: 1.3rem;
}
.kpis span { font-size: .8125rem; color: var(--muted); font-weight: 700; }

.step { display: grid; gap: 8px; }
.step legend { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.step-n {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--primary); color: var(--on-primary); font-size: .8125rem; font-weight: 700;
}
.bin-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 500px) { .bin-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bin-opt {
  display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  border-radius: var(--radius-md); padding: 12px 8px; font-weight: 700;
  border-width: 2px; border-style: solid; /* el color lo pone .bin-* */
}
.bin-opt input { accent-color: var(--primary); width: 18px; height: 18px; }
.bin-opt:has(input:checked) { outline: 3px solid var(--accent); outline-offset: 2px; }
.check-box { border-radius: var(--radius-md); padding: 10px 14px; font-size: .9375rem; border: 1px solid transparent; }
.check-box.ok { background: var(--ok-soft); border-color: var(--ok); }
.check-box.ok .i { color: var(--ok); }
.check-box.warn { background: var(--warn-soft); border-color: var(--warn); }
.check-box.warn .i { color: var(--warn); }
.preview { font-size: .9375rem; min-height: 1.4em; }
.rules { padding-left: 20px; display: grid; gap: 6px; font-size: .9375rem; margin-bottom: 12px; }

.ledger { list-style: none; display: grid; gap: 6px; }
.ledger li {
  display: flex; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border-radius: var(--radius-md); padding: 10px 12px; font-size: .9375rem;
}
.ledger b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--ok); }
.minus { color: var(--danger); }

.rewards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); margin-top: 12px; }
.reward { background: var(--surface-2); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; align-content: start; }
.reward .ico {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.reward .ico .i { width: 24px; height: 24px; }
.reward h3 { font-size: 1.0625rem; }
.reward-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 6px; }

.report-list { list-style: none; display: grid; gap: 10px; margin-top: 10px; }
.report-list li { background: var(--surface-2); border-radius: var(--radius-md); padding: 14px; display: grid; gap: 6px; }
.reply { font-size: .9375rem; background: var(--surface); border-radius: var(--radius-sm); padding: 8px 10px; }

/* Avisos: el color de la franja sale de --aviso-c */
.aviso {
  --aviso-c: var(--info);
  border-left: 4px solid var(--aviso-c); background: var(--surface-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px 14px; margin-top: 12px;
}
.aviso-jornada { --aviso-c: var(--primary); }
.aviso-ruta { --aviso-c: var(--accent); }
.aviso-alerta { --aviso-c: var(--warn); }
.aviso b .i { color: var(--aviso-c); }
.aviso p { font-size: .9375rem; margin-top: 4px; max-width: 65ch; }
.home-avisos:empty { display: none; }
.home-avisos .aviso {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--aviso-c); box-shadow: none;
}
.home-avisos .aviso:first-child { margin-top: 0; }

/* ---------- 19. Panel de administración ---------- */
.admin-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 16px; }
.stats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .stats-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat.link { text-decoration: none; color: inherit; transition: border-color .15s; }
.stat.link:hover { border-color: var(--primary); }
.stat.alert { border-color: var(--warn); }
.stat.alert .v { color: var(--warn); }

.admin-list { list-style: none; display: grid; gap: 8px; margin-top: 10px; }
.admin-list.scroll { max-height: 520px; overflow-y: auto; }
.admin-list li {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border-radius: var(--radius-md); padding: 10px 12px;
  border: 1.5px solid transparent;
}
/* Inactivo: sin opacidad; borde punteado + píldora «Inactivo» que pinta el JS */
.admin-list li.off { background: transparent; border: 1.5px dashed var(--border-strong); }
.big-ico {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.big-ico .i { width: 24px; height: 24px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 6px; font-size: .9375rem; margin-top: 6px; }
.map-sm { height: 260px; }
.form-row-4 { grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-row-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .form-row-4 { grid-template-columns: repeat(4, 1fr); } }
.edit-table td { padding: 6px 4px; }
.edit-table .input-sm { min-width: 80px; }
.edit-table .num { text-align: right; max-width: 110px; }
.danger-zone { border-color: var(--danger); }

/* ---------- 20. Yuji: asistente virtual ---------- */
/* Banda rosa en Inicio (sirve con o sin la clase .card) */
.yuji-card, .card.yuji-card {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  background: var(--accent-soft); border: 0; border-radius: var(--radius);
  padding: 24px; margin: 32px 0 0;
}
.yuji-card img { border-radius: var(--radius-md); flex: none; }
.yuji-card > div { flex: 1; min-width: min(220px, 100%); }
.yuji-card h2 { margin-bottom: 8px; }
.yuji-card p { max-width: 60ch; }
@media (min-width: 760px) {
  .yuji-card, .card.yuji-card { margin-top: 48px; padding: 32px; }
}

.yuji-fab {
  position: fixed; right: 16px; bottom: calc(var(--bottom-h) + 14px + env(safe-area-inset-bottom)); z-index: 1100;
  width: 68px; height: 68px; padding: 0; border-radius: 50%; cursor: pointer; overflow: hidden;
  background: var(--surface); border: 3px solid var(--accent); box-shadow: var(--shadow-float);
  transition: border-color .15s;
}
.yuji-fab:hover { border-color: var(--accent-hover); }
.yuji-fab img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); }
@media (min-width: 860px) { .yuji-fab { bottom: 24px; right: 24px; } }

.yuji-bubble {
  position: fixed; right: 92px; bottom: calc(var(--bottom-h) + 20px + env(safe-area-inset-bottom)); z-index: 1100;
  display: flex; align-items: center; gap: 10px; max-width: min(300px, calc(100vw - 110px));
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  padding: 10px 14px; font-size: .9375rem; box-shadow: var(--shadow-float); cursor: pointer;
  animation: fade .25s ease;
}
.yuji-bubble img { border-radius: var(--radius-md); flex: none; }
@media (min-width: 860px) { .yuji-bubble { bottom: 34px; right: 104px; } }

.yuji-panel {
  position: fixed; z-index: 1200; display: flex; flex-direction: column; overflow: hidden;
  inset: auto 0 0 0; height: min(80vh, 640px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-float); animation: fade .2s ease;
}
@media (min-width: 600px) {
  .yuji-panel { inset: auto 24px 104px auto; width: 390px; height: min(72vh, 620px); border-radius: var(--radius); }
}
@media (min-width: 860px) { .yuji-panel { bottom: 104px; } }
.yuji-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--surface-2); color: var(--text); border-bottom: 1px solid var(--border);
}
.yuji-head img { border-radius: var(--radius-md); background: var(--surface); flex: none; }
.yuji-head h2 { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.2; }
.yuji-head p { color: var(--muted); }
.yuji-head .icon-btn { width: 40px; height: 40px; }
.yuji-head .icon-btn .i { width: 20px; height: 20px; }

.yuji-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.yuji-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.yuji-msg p { padding: 10px 13px; border-radius: var(--radius); font-size: .9375rem; line-height: 1.45; }
.yuji-msg.bot img { border-radius: var(--radius-md); flex: none; }
.yuji-msg.bot p { background: var(--surface-2); border-bottom-left-radius: 4px; }
.yuji-msg.yo { align-self: flex-end; }
.yuji-msg.yo p { background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.yuji-msg.yo a { color: inherit; }
.yuji-msg.typing p { display: flex; gap: 4px; padding: 14px; }
.yuji-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.yuji-msg.typing span:nth-child(2) { animation-delay: .2s; }
.yuji-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.yuji-sugs { display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 8px; }
.yuji-sugs .chip { flex: none; font-size: .875rem; }
.yuji-form { display: flex; gap: 8px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.yuji-form .input { min-height: 44px; }
.yuji-form .btn { padding: 0 16px; flex: none; }

/* ---------- 21. Admin: preguntas de Yuji ---------- */
.faq-list li { align-items: flex-start; flex-wrap: wrap; }
.faq-list img { border-radius: var(--radius-md); flex: none; }
.faq-list .grow { min-width: min(200px, 100%); display: grid; gap: 3px; justify-items: start; }
.faq-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.animo-preview { align-content: end; }
.animo-preview img { border-radius: var(--radius-md); }

/* ---------- 22. Pie de página con logo ---------- */
.footer {
  display: flex; gap: 16px; align-items: flex-start; text-align: left;
  width: calc(100% - 32px); max-width: 1008px; margin: 0 auto;
  padding: 32px 0 104px; /* deja libre el botón flotante de Yuji en móvil */
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: .875rem;
}
.footer img { width: 48px; height: 48px; flex: none; }
.footer > div { display: grid; gap: 4px; min-width: 0; }
.footer p { max-width: 65ch; }
.footer b { color: var(--text); }
@media (min-width: 860px) { .footer { padding-bottom: 40px; } }
