/* =========================================================================
   AGCS APP — Estilos (mobile-first)
   -------------------------------------------------------------------------
   🎨 PALETA: fondo BLANCO + estructura en AZUL → LILA → ROSADO.
   El TEAL se conserva solo para el logo de marca AGCS.
   Cambia SOLO estas variables para reajustar toda la app.
   ========================================================================= */
:root {
  /* --- Acentos de estructura (azul → lila → rosado, más intensos) --- */
  --blue:       #2f66e0;   /* azul fuerte */
  --lilac:      #8a3fe0;   /* lila oscuro/saturado */
  --pink:       #e11d8f;   /* rosado intenso (magenta) */
  --brand:      #6d34d6;   /* principal (violeta profundo) */
  --brand-dark: #4c1fa8;   /* variante más profunda */
  --brand-light:#efe7fc;   /* tinte lila suave (fondos de resultado) */
  --accent:     #e11d8f;   /* rosado intenso */
  --grad:       linear-gradient(135deg, #2f66e0 0%, #8a3fe0 50%, #e11d8f 100%);

  /* --- Teal de marca (solo logo) --- */
  --teal:       #12869a;
  --teal-light: #3cbfc9;

  /* --- Neutros / superficie (fondo blanco) --- */
  --bg:        #ffffff;
  --surface:   #ffffff;
  --text:      #26272b;   /* gris carbón del logo */
  --text-soft: #6b6f7a;
  --border:    #ececf4;
  --danger:    #e2557a;   /* rosa-rojo (encaja con la paleta) */
  --ok:        #16a34a;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 14px rgba(90, 80, 160, 0.08);
  --shadow-lg: 0 10px 34px rgba(90, 80, 160, 0.16);
  --maxw: 520px;   /* ancho máximo tipo "celular" en desktop */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ---- Utilidades ---- */
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--text-soft); font-size: 0.85rem; }

/* =========================================================================
   PANTALLA: LOGIN (fondo blanco)
   ========================================================================= */
.login {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px 40px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}
/* Franja de acento superior (azul→lila→rosado) */
.login::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: var(--grad);
}
.login__logo {
  width: auto; height: auto;
  max-width: 190px; max-height: 210px;
  margin: 0 auto 8px;
  display: block;
}
.login h1 { font-size: 1.5rem; text-align: center; font-weight: 800; letter-spacing: 0.5px; }
.login .subtitle { text-align: center; color: var(--text-soft); margin-top: 4px; font-size: 0.95rem; }

.login__card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 26px;
  box-shadow: var(--shadow-lg);
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: var(--text-soft); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(122, 99, 232, 0.15);
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--grad);
  color: #fff;
  transition: transform .08s, filter .15s;
}
.btn:active { transform: scale(0.98); }
/* Cambio de color al pasar el cursor: gradiente invertido (rosado → violeta → azul) + realce */
.btn:hover {
  background: linear-gradient(135deg, #e11d8f 0%, #8a3fe0 50%, #2f66e0 100%);
  box-shadow: 0 6px 20px rgba(138, 63, 224, 0.35);
  transform: translateY(-1px);
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
/* Al pasar el cursor, el fondo se vuelve degradado (de .btn:hover): el texto debe ir BLANCO para no perderse. */
.btn--ghost:hover { color: #fff; border-color: transparent; }
.btn--sm { width: auto; padding: 9px 16px; font-size: 0.9rem; }

.login__hint { text-align: center; margin-top: 16px; font-size: 0.8rem; color: var(--text-soft); }

/* =========================================================================
   ESTRUCTURA APP (header + contenido + nav)
   ========================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--grad);
  color: #fff;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}
.topbar__back {
  background: rgba(255,255,255,0.22);
  border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 10px;
  font-size: 1.1rem; cursor: pointer;
  display: grid; place-items: center;
}
.topbar__title { font-size: 1.05rem; font-weight: 700; flex: 1; }
.topbar__profile {
  font-size: 0.75rem; background: rgba(255,255,255,0.22);
  padding: 5px 10px; border-radius: 20px; white-space: nowrap;
}

.content { flex: 1; padding: 18px 16px 90px; }

/* ---- Saludo dashboard ---- */
.greeting { margin-bottom: 18px; }
.greeting h2 { font-size: 1.3rem; }
.greeting p { color: var(--text-soft); font-size: 0.9rem; margin-top: 2px; }

/* ---- Frase motivacional del día ---- */
.frase {
  position: relative; overflow: hidden;
  background: var(--brand-light);
  border-radius: var(--radius);
  padding: 15px 16px 15px 20px;
  margin-bottom: 18px;
  display: flex; gap: 12px; align-items: center;
}
.frase::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--grad); }
.frase__icon { font-size: 1.4rem; flex: 0 0 auto; }
.frase__text { font-size: 0.92rem; font-style: italic; color: var(--brand-dark); font-weight: 600; line-height: 1.4; }

/* ---- Grid de herramientas ---- */
.section-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-soft); margin: 22px 4px 12px; font-weight: 700; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow);
  position: relative;
  min-height: 118px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
/* Barra de acento lateral que aparece sutil */
.tool-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--grad);
  opacity: 0.9;
}
.tool-card:active { transform: scale(0.97); }
.tool-card:hover { border-color: var(--lilac); box-shadow: var(--shadow-lg); }
.tool-card__icon { font-size: 1.9rem; margin-bottom: 8px; }
.tool-card__name { font-weight: 700; font-size: 0.98rem; }
.tool-card__desc { color: var(--text-soft); font-size: 0.78rem; margin-top: 3px; }
.tool-card--soon { opacity: 0.6; cursor: default; }
.tool-card--soon::before { opacity: 0.35; }
.tool-card__badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 0.62rem; font-weight: 700;
  background: var(--accent); color: #fff;
  padding: 3px 7px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* =========================================================================
   HERRAMIENTAS (calculadoras)
   ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.card .muted { margin-bottom: 14px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.result {
  background: var(--brand-light);
  border: 1px solid var(--lilac);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
  text-align: center;
}
.result__value { font-size: 2rem; font-weight: 800; color: var(--brand-dark); }
.result__unit { font-size: 0.95rem; color: var(--text-soft); }
.result__label { font-size: 0.8rem; color: var(--text-soft); margin-bottom: 4px; }
.result__extra { margin-top: 10px; font-size: 0.85rem; color: var(--text); }
.result--danger { background: #fdeef3; border-color: var(--danger); }
.result--danger .result__value { color: var(--danger); }

/* ---- Calendario de turnos (desplegable) ---- */
.cal-turno.card { padding: 0; overflow: hidden; }
.cal-summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 16px 18px; display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.02rem; color: var(--brand-dark);
}
.cal-summary::-webkit-details-marker { display: none; }
.cal-summary .acc__title { flex: 1; }
#cal-turno[open] .cal-summary { border-bottom: 1px solid var(--border); background: #fbfaff; }
#cal-turno[open] .cal-summary .acc__chev { transform: rotate(180deg); }
.cal-body { padding: 12px 18px 18px; }
.cal-fase-sel { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.95rem; background: #fff; color: var(--text); }
.cal-fase-sel:focus { outline: none; border-color: var(--brand); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 10px; }
.cal-navbtn { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--brand); }
.cal-navbtn:active { transform: scale(0.95); }
.cal-month { font-weight: 800; text-transform: capitalize; color: var(--brand-dark); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.64rem; font-weight: 700; color: var(--text-soft); padding: 2px 0; }
.cal-days { margin-top: 4px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f1f2f6; gap: 1px;
}
.cal-cell--empty { background: transparent; }
.cal-day { font-weight: 700; font-size: 0.72rem; }
.cal-fase { font-size: 0.6rem; font-weight: 800; opacity: 0.85; }
.cal-cell .cal-today { position: absolute; inset: 0; border: 2.5px solid var(--brand-dark); border-radius: 8px; pointer-events: none; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cal-lg { font-size: 0.66rem; font-weight: 700; padding: 4px 9px; border-radius: 20px; }
/* Colores de fase (celda y leyenda) */
.t-dia { background: #fde68a; color: #5b4300; }
.t-noche { background: #4338ca; color: #fff; }
.t-sal { background: #64748b; color: #fff; }
.t-libre { background: #86efac; color: #14532d; }

/* ---- "Mi turno de hoy" (checklist) ---- */
.turno { border-left: 4px solid transparent; border-image: var(--grad) 1; }
.turno.card { padding: 0; overflow: hidden; }
#turno-card[open] .cal-summary { border-bottom: 1px solid var(--border); background: #fbfaff; }
#turno-card[open] .cal-summary .acc__chev { transform: rotate(180deg); }
.turno__body { padding: 12px 18px 18px; }
.turno__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.turno__head h3 { margin-bottom: 0; }
.turno__clear {
  background: none; border: 1.5px solid var(--border); color: var(--text-soft);
  font-size: 0.72rem; font-weight: 700; padding: 5px 11px; border-radius: 20px; cursor: pointer;
}
.turno__clear:active { transform: scale(0.96); }
.turno__list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.turno__item { display: flex; align-items: center; gap: 10px; }
.turno__check {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid var(--lilac); background: #fff; color: #fff;
  font-size: 0.9rem; font-weight: 900; cursor: pointer; display: grid; place-items: center;
  transition: background .12s, border-color .12s;
}
.turno__input {
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit; color: var(--text);
  background: #fff; transition: border-color .12s;
}
.turno__input:focus { outline: none; border-color: var(--brand); }
.turno__item.is-done .turno__check { background: var(--brand); border-color: var(--brand); }
.turno__item.is-done .turno__input { text-decoration: line-through; color: var(--text-soft); background: #faf9fe; }

/* ---- Listas de pasos / checklist de referencia (código azul) ---- */
.steps { margin: 0 0 4px 18px; padding: 0; }
.steps li { margin-bottom: 8px; font-size: 0.9rem; }
.checklist-ref { list-style: none; padding: 0; margin: 0; }
.checklist-ref li {
  font-size: 0.9rem; padding: 8px 0 8px 26px; position: relative; border-bottom: 1px solid var(--border);
}
.checklist-ref li::before { content: '☐'; position: absolute; left: 4px; top: 7px; color: var(--lilac); font-size: 1rem; }

/* ---- Selects de escalas ---- */
.scale-sel { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.95rem; background: #fff; color: var(--text); }
.scale-sel:focus { outline: none; border-color: var(--brand); }

/* ---- Enlaces de guías clínicas ---- */
.guia-link {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 9px; transition: border-color .12s, box-shadow .12s, transform .08s;
}
.guia-link:active { transform: scale(0.99); }
.guia-link:hover { border-color: var(--lilac); box-shadow: var(--shadow); }
.guia-link__body { flex: 1; }
.guia-link__name { font-weight: 700; font-size: 0.95rem; color: var(--brand-dark); }
.guia-link__desc { font-size: 0.78rem; color: var(--text-soft); margin-top: 2px; }
.guia-link__arrow { font-size: 1.1rem; color: var(--lilac); font-weight: 700; }

/* ---- Cursos AGCS ---- */
.cursos-hero { border-top: 4px solid transparent; border-image: var(--grad) 1; }
.cursos-hero .btn { margin-top: 14px; }
.curso-pack {
  display: block; text-decoration: none; color: inherit; position: relative;
  background: var(--brand-light); border: 1.5px solid var(--lilac);
  border-radius: var(--radius); padding: 16px; margin-bottom: 4px;
}
.curso-pack__badge {
  position: absolute; top: 12px; right: 12px; background: var(--grad); color: #fff;
  font-size: 0.62rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}
.curso-pack__name { font-weight: 800; font-size: 1.02rem; color: var(--brand-dark); padding-right: 54px; }
.curso-pack__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.curso-pack__price { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.curso-pack__cta { font-size: 0.82rem; font-weight: 700; color: var(--brand); }
.curso-link {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 9px; transition: border-color .12s, box-shadow .12s, transform .08s;
}
.curso-link:active { transform: scale(0.99); }
.curso-link:hover { border-color: var(--lilac); box-shadow: var(--shadow); }
.curso-link__body { flex: 1; }
.curso-link__name { font-weight: 700; font-size: 0.92rem; }
.curso-link__meta { font-size: 0.8rem; color: var(--text-soft); margin-top: 2px; }
.curso-link__meta strong { color: var(--brand-dark); }
.curso-link__arrow { font-size: 1.05rem; color: var(--lilac); font-weight: 700; }

/* ---- Tabla pediátrica (multi-columna con scroll horizontal) ---- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ped-table { font-size: 0.78rem; min-width: 420px; }
.ped-table th, .ped-table td { padding: 7px 5px; white-space: nowrap; }
.ped-table td { font-weight: 600; color: var(--text); }
.ped-table td:first-child { white-space: normal; font-weight: 700; color: var(--brand-dark); }

/* ---- Triage ESI ---- */
.esi-table td { vertical-align: top; padding: 10px 8px; }
.esi-table td:last-child { white-space: normal !important; font-weight: 400 !important; color: var(--text) !important; }
.esi-table td:last-child strong { color: var(--brand-dark); font-size: 0.95rem; }
.esi-table td:first-child { width: 44px; }
.esi-nivel {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  color: #fff; font-weight: 800; font-size: 1rem;
}
.esi-nivel--1 { background: #d64545; }
.esi-nivel--2 { background: #ea580c; }
.esi-nivel--3 { background: #f4a825; color: #3a2a00; }
.esi-nivel--4 { background: #16a34a; }
.esi-nivel--5 { background: #6b7280; }
.esi-desc { display: block; font-size: 0.8rem; color: var(--text-soft); font-weight: 400; margin-top: 2px; }

/* ---- Tabla Control de Niño Sano ---- */
.nino-table td { vertical-align: top; }
.nino-table td:first-child { font-weight: 700 !important; color: var(--brand-dark) !important; white-space: normal !important; }
.nino-table td:last-child { font-size: 0.82rem; color: var(--text) !important; font-weight: 400 !important; white-space: normal !important; }

/* ---- Medicamentos (bloque por fármaco) ---- */
.med-item { padding: 11px 0; border-bottom: 1px solid var(--border); }
.med-item:last-child { border-bottom: none; padding-bottom: 2px; }
.med-item__name { font-weight: 800; color: var(--brand-dark); margin-bottom: 6px; font-size: 0.98rem; }
.med-item__row { display: flex; gap: 8px; font-size: 0.85rem; margin-bottom: 3px; align-items: baseline; }
.med-lbl {
  flex: 0 0 88px; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-soft); font-weight: 700; padding-top: 1px;
}
.med-antag { font-weight: 700; color: var(--brand); }

/* ---- Minijuego "Escape del Turno" ---- */
.game { display: flex; flex-direction: column; align-items: center; }
.game-stage { position: relative; width: 100%; display: flex; justify-content: center; }
#game-canvas {
  display: block; border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); background: #eef2fb; max-width: 100%;
}
.game-hud { position: absolute; inset: 0; pointer-events: none; }
.game-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(38, 20, 70, 0.55); border-radius: var(--radius); padding: 14px;
}
/* El menú de los juegos puede ser más alto que su canvas: se ancla ARRIBA y crece
   hacia abajo (así el título nunca queda cortado bajo el header, en cel o PC). */
#g2-overlay, #game-overlay, #g3-overlay {
  top: 0; bottom: auto; min-height: 100%; height: auto;
  align-items: flex-start; padding: 12px 12px 18px;
}
.game-menu {
  background: #fff; border-radius: var(--radius); padding: 20px 18px; width: 100%; max-width: 320px;
  text-align: center; box-shadow: var(--shadow-lg);
}
.game-title { font-size: 1.25rem; font-weight: 800; color: var(--brand-dark); }
.game-sub { font-size: 0.86rem; color: var(--text-soft); margin-top: 4px; line-height: 1.4; }
.game-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-soft); font-weight: 700; margin: 16px 0 8px; }
.game-row { display: flex; gap: 8px; }
.game-pick {
  flex: 1; border: 1.5px solid var(--border); background: #fff; border-radius: var(--radius-sm);
  padding: 10px 6px; font-size: 0.82rem; font-weight: 700; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.game-pick span { font-size: 1.5rem; }
.game-pick.is-on { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.game-note { font-size: 0.76rem; color: var(--text-soft); margin-top: 8px; min-height: 30px; }
.game-start { margin-top: 16px; }
.game-tip { font-size: 0.74rem; color: var(--text-soft); text-align: center; margin-top: 10px; line-height: 1.4; }

/* ---- Control D-pad (✚) del juego ---- */
.dpad {
  display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px);
  gap: 6px; width: max-content; margin: 16px auto 0;
}
.dbtn {
  border: none; border-radius: 14px; background: var(--brand-light);
  color: var(--brand-dark); font-size: 1.35rem; cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow);
  -webkit-user-select: none; user-select: none; touch-action: none;
}
.dbtn:active { background: var(--brand); color: #fff; transform: scale(0.94); }
.dbtn-up { grid-area: 1 / 2; }
.dbtn-left { grid-area: 2 / 1; }
.dbtn-right { grid-area: 2 / 3; }
.dbtn-down { grid-area: 3 / 2; }

/* ---- Control del runner (▲ Saltar / ▼ Agacharse) ---- */
.g2-pad { display: flex; gap: 14px; justify-content: center; margin: 16px auto 0; }
.g2-btn {
  border: none; border-radius: 16px; background: var(--brand-light);
  color: var(--brand-dark); font-size: 1.5rem; font-weight: 800; cursor: pointer;
  width: 132px; height: 66px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; box-shadow: var(--shadow);
  -webkit-user-select: none; user-select: none; touch-action: none;
}
.g2-btn small { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.3px; }

/* ---- Control del shooter (◀ ▶ mover · ⤒ saltar · 💉 disparar) ---- */
.g3-pad { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin: 14px auto 0; max-width: 460px; }
.g3-group { display: flex; gap: 8px; }
.g3-btn {
  border: none; border-radius: 16px; background: var(--brand-light);
  color: var(--brand-dark); font-size: 1.3rem; font-weight: 800; cursor: pointer;
  width: 66px; height: 62px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; box-shadow: var(--shadow);
  -webkit-user-select: none; user-select: none; touch-action: none;
}
.g3-btn small { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.2px; }
.g3-btn:active { background: var(--brand); color: #fff; transform: scale(0.95); }
.g3-fire { background: #d6f0f7; color: #12869a; }              /* botón de disparo destacado (teal) */
.g3-fire:active { background: #12869a; color: #fff; }
.g2-av { width: 46px; height: 50px; display: block; margin: 0 auto 2px; }
.g2-mute {
  position: absolute; top: 8px; right: 8px; z-index: 2; border: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 10px; font-size: 1rem;
  background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow);
}
.g2-mute:active { transform: scale(0.92); }
.g2-stars { font-size: 1.4rem; letter-spacing: 3px; margin-top: 10px; }
.g2-btn:active { background: var(--brand); color: #fff; transform: scale(0.95); }

/* ---- Cupón de premio (fin del runner) ---- */
.g2-cupon {
  margin-top: 14px; border: 2px dashed var(--brand); border-radius: var(--radius);
  background: var(--brand-light); padding: 14px 12px; text-align: center;
}
.g2-cupon-top { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--brand-dark); }
.g2-cupon-code {
  font-size: 1.6rem; font-weight: 900; letter-spacing: 3px; color: var(--brand-dark);
  margin: 6px 0; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.g2-cupon-desc { font-size: 0.78rem; color: var(--text-soft); line-height: 1.4; }
.g2-cupon-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.g2-mini {
  border: 1.5px solid var(--brand); background: #fff; color: var(--brand-dark);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.g2-mini-link { background: var(--brand); color: #fff; }
.g2-mini:active { transform: scale(0.96); }

/* ---- Ejemplo de CV (muestra) ---- */
.cv-sample {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 16px 16px 6px;
  box-shadow: var(--shadow);
}
.cv-sample__head { border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 12px; }
.cv-sample__name { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.cv-sample__role { font-size: 0.9rem; font-weight: 700; color: var(--brand-dark); margin-top: 2px; }
.cv-sample__contact { font-size: 0.75rem; color: var(--text-soft); margin-top: 6px; }
.cv-sample__sec { margin-bottom: 12px; }
.cv-sample__t {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 800; color: var(--brand); margin-bottom: 4px;
}
.cv-sample__sec p { font-size: 0.82rem; line-height: 1.45; color: var(--text); margin: 0; }
.cv-sample__sec ul { margin: 0; padding-left: 18px; }
.cv-sample__sec li { font-size: 0.82rem; line-height: 1.5; }

/* ---- Cuadro "¿Qué es?" (explicación breve) ---- */
.info-box {
  background: var(--brand-light);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
  margin: 10px 0 16px;
}
.info-box strong { color: var(--brand-dark); }

/* ---- Cuadros desplegables (acordeón) ---- */
.acc {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}
.acc__sum {
  list-style: none;
  cursor: pointer;
  padding: 13px 14px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 0.92rem; color: var(--brand-dark);
  user-select: none;
}
.acc__sum::-webkit-details-marker { display: none; }
.acc__title { flex: 1; }
.acc__count {
  font-size: 0.68rem; font-weight: 700; color: var(--brand);
  background: var(--brand-light); padding: 2px 9px; border-radius: 20px;
}
.acc__chev { color: var(--lilac); font-weight: 900; font-size: 1.05rem; transition: transform .2s; }
.acc[open] .acc__chev { transform: rotate(180deg); }
.acc[open] .acc__sum { border-bottom: 1px solid var(--border); background: #fbfaff; }
.acc__body { padding: 4px 14px 12px; }
.acc__body .ref-table { margin-top: 4px; }
.acc__body .guia-link:last-child { margin-bottom: 4px; }

/* ---- Tablas de referencia ---- */
.ref-group { margin-bottom: 18px; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.ref-table th, .ref-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.ref-table th { color: var(--text-soft); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ref-table td:nth-child(2) { font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.ref-table td:nth-child(3) { color: var(--text-soft); white-space: nowrap; }

/* ---- Segmented (chips de opciones) ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip {
  padding: 9px 14px; border-radius: 20px;
  border: 1.5px solid var(--border); background: #fff;
  font-size: 0.85rem; cursor: pointer; font-weight: 600; color: var(--text-soft);
  transition: all .12s;
}
.chip--active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* =========================================================================
   DISCLAIMER CLÍNICO (obligatorio) — se mantiene en ámbar (señal de aviso)
   ========================================================================= */
.disclaimer {
  background: #fff8e6;
  border: 1px solid #f4d58a;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.75rem;
  color: #7a5a00;
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 14px;
}
.disclaimer strong { color: #6a4d00; }

/* =========================================================================
   NAV INFERIOR
   ========================================================================= */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 30;
}
.tabbar__item {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-soft); font-size: 0.66rem; font-weight: 600;
  padding: 4px 12px;
}
.tabbar__item span { font-size: 1.25rem; }
.tabbar__item--active { color: var(--brand); }

/* ---- Botón flotante de sugerencias (WhatsApp) ---- */
.fab-sugerencia {
  position: fixed; z-index: 40;
  right: max(14px, calc(50vw - 260px + 14px));
  bottom: calc(74px + env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--grad); color: #fff; font-size: 1.4rem; cursor: pointer;
  box-shadow: var(--shadow-lg); display: grid; place-items: center;
  transition: transform .1s;
}
.fab-sugerencia:active { transform: scale(0.92); }

/* ---- Placeholder de secciones futuras ---- */
.soon-block { text-align: center; padding: 50px 24px; color: var(--text-soft); }
.soon-block__icon { font-size: 3rem; margin-bottom: 12px; }
.soon-block h3 { color: var(--text); margin-bottom: 6px; }

/* ---- Guía "Instala la app" (iPhone / Android) ---- */
.install-banner {
  position: relative;
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--brand-light);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}
.install-banner::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--grad);
}
.install-banner__close {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.06); color: var(--text-soft);
  font-size: 0.95rem; cursor: pointer; line-height: 1;
}
.install-banner__close:active { transform: scale(0.9); }
.install-banner__title {
  font-size: 1.02rem; font-weight: 800; color: var(--brand-dark);
  margin: 2px 26px 8px 0;
}
.install-intro { font-size: 0.86rem; color: var(--text); margin-bottom: 12px; line-height: 1.5; }

.install-os {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px;
}
.install-os:last-child { margin-bottom: 0; }
.install-os--me { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(122, 99, 232, 0.14); }
.install-os__head {
  font-size: 0.92rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.install-os__app { font-weight: 500; color: var(--text-soft); font-size: 0.82rem; }
.install-os__badge {
  background: var(--grad); color: #fff; font-size: 0.66rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .3px;
}
.install-steps { margin: 0; padding-left: 20px; }
.install-steps li { font-size: 0.85rem; line-height: 1.55; margin-bottom: 5px; color: var(--text); }
.install-steps li:last-child { margin-bottom: 0; }
.install-ic { font-style: normal; }

@media (min-width: 560px) {
  .app { box-shadow: var(--shadow-lg); }
}
