/* ============================================================
 * FuncionaGrios · estilos de la web pública (mapa)
 * Mobile-first. Mapa a pantalla completa y paneles flotantes.
 * ============================================================ */

:root {
  --bg: #070d14;
  --surface: rgba(9, 16, 25, .86);
  --surface-strong: #0c1621;
  --surface-2: #111e2b;
  --surface-3: #172636;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);

  --text: #edf2f7;
  --text-2: #a9b6c6;
  --text-3: #74859a;

  --brand: #c8ff1a;
  --brand-ink: #0b1200;
  --brand-soft: rgba(200, 255, 26, .14);
  --teal: #00a499;

  --leve: #ffe14d;
  --moderado: #ff7a1a;
  --grave: #c4002f;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
  --blur: saturate(140%) blur(14px);

  --gutter: 12px;
  --cabecera-h: 170px;        /* lo actualiza el JS: hero + logo + ámbito */
  --panel-h: 132px;           /* lo actualiza el JS con la altura real */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Archivo Black', 'Inter', system-ui, sans-serif;
}

@media (min-width: 768px) {
  :root { --gutter: 18px; }
}

*, *::before, *::after { box-sizing: border-box; }

[ng-cloak], .ng-cloak { display: none !important; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font-family: inherit; }

.app { position: fixed; inset: 0; }

#map { position: absolute; inset: 0; background: #0d1824; }

.glass,
.bottom-panel, .ambito, .legend, .map-controls .icon-btn {
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.95); }
.icon-btn.is-active { color: var(--brand-ink); background: var(--brand); border-color: var(--brand); }
.icon-btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}


/* ============================================================
 * CABECERA: hero arriba y, debajo, logo + menú
 * Dos estados: amplio al entrar y compacto (.is-compacta) en cuanto
 * el usuario mueve el mapa; el logo y el menú suben con el hero.
 * ============================================================ */
.cabecera {
  position: absolute;
  z-index: 30;
  top: 0; left: 0; right: 0;
  pointer-events: none;          /* el mapa sigue siendo usable entre logo y menú */
}
.cabecera > * { pointer-events: auto; }

.hero {
  padding: calc(8px + var(--safe-top)) 12px 7px;
  text-align: center;
  background: rgba(7, 13, 20, .93);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid rgba(200, 255, 26, .22);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  transition: padding .35s ease;
}

/* Partes que desaparecen al compactar (animadas en altura y opacidad) */
.hero h1, .hero p {
  overflow: hidden;
  transition: max-height .35s ease, opacity .25s ease, margin .35s ease, font-size .35s ease;
}

.hero h1 {
  max-height: 3.2em;
  margin: 0 0 5px;
  font-weight: 800;
  font-size: clamp(1rem, 2.8vw, 1.4rem);
  letter-spacing: -.015em;
  line-height: 1.2;
  text-wrap: balance;
}

.hero-keywords {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1000px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.hero-keywords div {
  padding: 4px 2px;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: clamp(.64rem, 2.4vw, .9rem);
  letter-spacing: .1em;
  white-space: nowrap;
  transition: padding .35s ease, font-size .35s ease;
}
.hero-keywords div + div { border-left: 1px solid rgba(255, 255, 255, .08); }

.hero p {
  max-height: 4em;
  margin: 5px auto 0;
  max-width: 640px;
  color: var(--text-2);
  font-size: clamp(.76rem, 2.6vw, .95rem);
  line-height: 1.35;
}
.hero p.hero-sub { margin-top: 1px; font-size: clamp(.7rem, 2.3vw, .85rem); color: var(--text-3); }
.green, .hero .green { color: var(--brand); font-weight: 700; }

/* --- Estado compacto: franja fina con el título y las cuatro palabras --- */
.is-compacta .hero {
  padding: calc(4px + var(--safe-top)) 10px 3px;
  cursor: pointer;
}
.is-compacta .hero p {
  max-height: 0;
  margin: 0;
  opacity: 0;
}
.is-compacta .hero h1 {
  max-height: 1.4em;
  margin: 0 0 1px;
  font-size: clamp(.78rem, 3.2vw, .95rem);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.is-compacta .hero-keywords { border: 0; }
.is-compacta .hero-keywords div { padding: 2px; font-size: clamp(.6rem, 2.2vw, .78rem); }

/* En escritorio, el título cabe en la franja compacta junto a las palabras */
@media (min-width: 1000px) {
  .is-compacta .hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
  }
  .is-compacta .hero h1 {
    flex: none;
    max-height: 2em;
    opacity: 1;
    font-size: .95rem;
    white-space: nowrap;
  }
  .is-compacta .hero-keywords { margin: 0; flex: 0 1 620px; min-width: 460px; }
}

/* Logo y menú, justo debajo del hero */
.marca {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--gutter) 0;
  pointer-events: none;
  transition: padding .35s ease;
}
.marca > * { pointer-events: auto; }
.is-compacta .marca { padding-top: 6px; }

.logo { display: block; }
.logo img {
  display: block;
  height: clamp(50px, 9vw, 80px);
  width: auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .65));
  transition: height .35s ease;
}
.is-compacta .logo img { height: clamp(40px, 6.5vw, 62px); }

.menu { position: relative; }
.burger {
  width: 48px; height: 48px;
  font-size: 1.4rem;
  border-radius: 50%;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  transition: width .35s ease, height .35s ease;
}
.is-compacta .burger { width: 42px; height: 42px; font-size: 1.25rem; }

.menu-desplegable {
  position: absolute;
  z-index: 2;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
}
.mobile-menu {
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.mobile-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
}
.mobile-menu a:hover { background: var(--surface-3); }
.mobile-menu i { color: var(--brand); }

/* Móviles de pantalla baja: la segunda frase del hero sobra */
@media (max-width: 600px) and (max-height: 700px) {
  .hero p.hero-sub { display: none; }
}

/* Móvil en horizontal o pantallas muy bajas: hero amplio más contenido */
@media (max-height: 560px) {
  .hero h1 { font-size: 1rem; margin-bottom: 4px; }
  .hero p.hero-sub { display: none; }
  .logo img { height: 46px; }
}


/* ============================================================
 * ÁMBITO (dónde estoy)
 * ============================================================ */
.ambito {
  display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100% - 2 * var(--gutter) - 56px);
  margin: 8px var(--gutter) 0;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
}
.ambito-nivel {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: .66rem; font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ambito-ruta {
  display: flex; align-items: center;
  margin: 0; padding: 0; list-style: none;
  min-width: 0; overflow: hidden;
  white-space: nowrap;
}
.ambito-ruta li { display: flex; align-items: center; min-width: 0; }
.ambito-ruta li + li::before { content: '›'; color: var(--text-3); margin: 0 6px; }
.ambito-ruta button {
  border: 0; padding: 0; background: none;
  color: var(--text-2);
  font-size: .82rem; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis;
}
.ambito-ruta button:not(:disabled):hover { color: var(--brand); text-decoration: underline; }
.ambito-ruta button:disabled { color: var(--text); font-weight: 700; opacity: 1; }
.ambito-icono { display: none; }
@media (max-width: 767px) {
  .ambito-ruta li:not(:last-child) { display: none; }
  .ambito-ruta li + li::before { display: none; }

  .ambito {
    gap: 6px;
    max-width: 52vw;
    margin-top: 6px;
    padding: 3px 10px 3px 3px;
  }
  .ambito-icono {
    display: grid; place-items: center; flex: none;
    width: 26px; height: 26px; padding: 0;
    border: 0; border-radius: 50%;
    background: var(--brand); color: var(--brand-ink);
    font-size: .8rem;
  }
  .ambito-nivel { display: none; font-size: .6rem; padding: 2px 8px; }
  .ambito.is-abierto .ambito-nivel { display: inline-block; }
  .ambito-ruta button { font-size: .76rem; }
}


/* ============================================================
 * CONTROLES Y LEYENDA
 * ============================================================ */
/* Abajo a la derecha, justo encima de la barra de búsqueda. La ficha de
   un GRIO (z-index 40) queda por encima de ellos cuando se abre. */
.map-controls {
  position: absolute;
  z-index: 10;
  right: var(--gutter);
  bottom: calc(var(--panel-h) + var(--gutter) + var(--safe-bottom) + 40px);
  display: flex; flex-direction: column; gap: 8px;
}
.map-controls .icon-btn { border-radius: 14px; }

.legend {
  position: absolute;
  z-index: 31;
  right: calc(var(--gutter) + 56px);
  bottom: calc(var(--panel-h) + var(--gutter) + var(--safe-bottom) + 40px);
  width: min(270px, calc(100% - 2 * var(--gutter) - 56px));
  max-height: calc(100dvh - var(--cabecera-h) - var(--panel-h) - 3 * var(--gutter) - var(--safe-bottom) - 10px);
  overflow-y: auto;
  padding: 12px 14px 14px;
  border-radius: var(--radius);
  opacity: 0; visibility: hidden;
  transform: translateX(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.legend.is-open { opacity: 1; visibility: visible; transform: none; }

.legend-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 800; font-size: .9rem;
}
.legend-close {
  width: 30px; height: 30px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--text-3);
}
.legend-close:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.legend-title { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.legend-title.mt { margin-top: 14px; }

.legend-grados { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.legend-grados li { display: flex; align-items: center; gap: 9px; font-size: .78rem; color: var(--text-2); }
.legend-grados span { width: 22px; height: 12px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .6); }

.legend-sizes { display: flex; align-items: flex-end; gap: 12px; margin-top: 10px; }
.legend-sizes span { display: block; border-radius: 50%; border: 2px solid var(--text-2); }
.legend-sizes .s1 { width: 12px; height: 12px; }
.legend-sizes .s2 { width: 20px; height: 20px; }
.legend-sizes .s3 { width: 30px; height: 30px; }

.legend-entidades {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px;
  margin: 9px 0 0; padding: 0; list-style: none;
  font-size: .72rem; color: var(--text-2);
}
.legend-entidades li { display: flex; align-items: center; gap: 6px; min-width: 0; line-height: 1.15; }
.legend-entidades i {
  flex: none;
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border: 1.5px solid; border-radius: 50%;
  background: #0b1620;
  font-size: .58rem;
}
.legend-note { margin: 12px 0 0; font-size: .72rem; line-height: 1.4; color: var(--text-3); }

/* Pantallas bajas (móvil en horizontal): controles en fila para no
   chocar con el logo y el menú; la leyenda se abre encima de ellos */
@media (max-height: 559px) {
  .map-controls { flex-direction: row; }
  .legend {
    right: var(--gutter);
    bottom: calc(var(--panel-h) + var(--gutter) + var(--safe-bottom) + 92px);
    max-height: calc(100dvh - var(--panel-h) - 2 * var(--gutter) - var(--safe-bottom) - 70px);
  }
}


/* ============================================================
 * BARRA INFERIOR: buscador + estadísticas de la vista
 * Escritorio: una sola fila baja. Móvil: dos filas compactas.
 * ============================================================ */
.bottom-panel {
  position: absolute;
  z-index: 25;
  left: 50%;
  bottom: calc(var(--gutter) + var(--safe-bottom));
  transform: translateX(-50%);
  width: calc(100% - 2 * var(--gutter));
  max-width: 1080px;
  padding: 8px;
  border-radius: 18px;
  display: flex; flex-direction: column; gap: 6px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 6px 0 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.search-box:focus-within { border-color: rgba(200, 255, 26, .55); background: rgba(255, 255, 255, .08); }
.search-box > .bi-search { color: var(--text-3); font-size: 1rem; }
.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin-left: 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;                  /* evita el zoom automático de iOS */
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear {
  width: 34px; height: 34px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2);
}

/* Los resultados se abren hacia arriba, sobre el mapa */
.search-results {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0; right: 0;
  margin: 0; padding: 6px;
  list-style: none;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  max-height: min(50vh, 360px);
  overflow-y: auto;
  z-index: 5;
}
.search-results li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.search-results li:hover, .search-results li.selected { background: var(--surface-3); }
.search-results li > i { color: var(--brand); margin-top: 2px; }
.result-main { font-size: .93rem; font-weight: 500; }
.search-results small { color: var(--text-3); font-size: .8rem; }
.search-results .result-text { flex: 1; min-width: 0; }
.result-dist {
  flex: none; margin-top: 2px;
  font-size: .75rem; font-weight: 600; color: var(--text-3);
  white-space: nowrap;
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  align-items: stretch;
}

/* "En esta vista · …": en móvil ya lo dice la ruta de arriba */
.stats-scope { display: none; }

.stat-card {
  display: flex; flex-direction: column; justify-content: center;
  height: 44px;
  padding: 0 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  min-width: 0;
}
.stat-label { font-size: .6rem; font-weight: 700; letter-spacing: .1em; color: var(--text-3); line-height: 1.2; }
.stat-value {
  font-size: 1.12rem; font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  transition: opacity .2s;
}
.stat-value.green { color: var(--brand); }
.stat-value.is-updating { opacity: .45; }

.stat-severity {
  display: flex; gap: 2px;
  height: 3px; margin-top: 2px;
  border-radius: 99px; overflow: hidden;
}
.stat-severity span { min-width: 0; transition: flex .4s; }
.stat-severity .leve { background: var(--leve); }
.stat-severity .moderado { background: var(--moderado); }
.stat-severity .grave { background: var(--grave); }

.btn-grio {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
  font-size: .93rem;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(200, 255, 26, .22);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn-grio:hover { filter: brightness(1.05); box-shadow: 0 8px 26px rgba(200, 255, 26, .32); }
.btn-grio:active { transform: scale(.97); }

@media (max-width: 360px) {
  .stat-card { padding: 0 8px; }
  .stat-value { font-size: 1rem; }
  .btn-grio { padding: 0 11px; font-size: .86rem; }
}

/* Desde 640 px (móvil en horizontal, tablet, escritorio): todo en una fila */
@media (min-width: 640px) {
  .bottom-panel {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .search-box { flex: 1 1 auto; height: 44px; }
  .stats-row {
    flex: none;
    grid-template-columns: 96px 96px auto;
    gap: 8px;
  }
}
@media (min-width: 900px) {
  .stats-row { grid-template-columns: auto 110px 110px auto; }
  .stats-scope {
    display: flex; flex-direction: column; justify-content: center;
    max-width: 150px;
    padding: 0 4px 0 8px;
    font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-3);
    white-space: nowrap;
  }
  .stats-scope strong {
    overflow: hidden; text-overflow: ellipsis;
    font-size: .82rem; letter-spacing: 0; text-transform: none;
    color: var(--text);
  }
}

/* Atribución de MapLibre: abajo a la derecha, justo debajo del botón de
   la leyenda (último de los controles) y encima de la barra inferior.
   Centrada bajo los botones de 44 px: (44 - 24) / 2 = 10 px. */
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left {
  bottom: calc(var(--panel-h) + var(--gutter) + var(--safe-bottom) + 8px);
}
.maplibregl-ctrl-bottom-right .maplibregl-ctrl {
  margin: 0 calc(var(--gutter) + 10px) 0 0;
}
.maplibregl-ctrl-attrib.maplibregl-compact {
  background: rgba(9, 16, 25, .75) !important;
  color: var(--text-3);
}
.maplibregl-ctrl-attrib a { color: var(--text-2) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }


/* ============================================================
 * TOOLTIP DEL MAPA
 * ============================================================ */
.fg-tooltip { z-index: 15; }
.fg-tooltip .maplibregl-popup-content {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  font-family: var(--font);
}
.fg-tooltip .maplibregl-popup-tip { display: none; }
.tt-nombre { font-weight: 700; font-size: .92rem; margin-bottom: 4px; }
.tt-datos { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--text-2); }
.tt-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.tt-hint { margin-top: 6px; font-size: .72rem; color: var(--text-3); }


/* ============================================================
 * FICHA DE DETALLE (panel lateral / bottom sheet)
 * ============================================================ */
.review-card {
  position: fixed;
  z-index: 40;
  left: 0; right: 0; bottom: 0;
  max-height: 78dvh;
  display: flex; flex-direction: column;
  padding: 6px 18px calc(16px + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .55);
  animation: sheet-up .3s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

.sheet-handle { width: 44px; height: 5px; margin: 4px auto 8px; border-radius: 9px; background: var(--border-strong); }

.review-header { display: flex; align-items: center; justify-content: space-between; }

.review-severity span, .sev-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: .72rem; font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(255, 138, 0, .14);
  color: var(--moderado);
}
.review-severity span::before, .sev-chip::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}
.sev-leve span, .sev-chip.sev-leve { background: rgba(245, 197, 24, .14); color: var(--leve); }
.sev-grave span, .sev-chip.sev-grave { background: rgba(255, 59, 48, .15); color: var(--grave); }

.close-btn {
  width: 38px; height: 38px;
  border: 0; border-radius: 12px;
  background: var(--surface-3);
  color: var(--text-2);
}
.close-btn:hover { color: var(--text); }

.review-body { overflow-y: auto; margin: 10px -4px 0; padding: 0 4px; overscroll-behavior: contain; }
.review-title { margin: 0 0 12px; font-size: 1.45rem; font-weight: 800; line-height: 1.22; letter-spacing: -.015em; }
.review-header { gap: 12px; }
.review-pin { width: 34px; height: 34px; object-fit: contain; flex: none; }
.review-ref { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.review-num { font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: var(--text-2); font-variant-numeric: tabular-nums; }
.review-lugar { font-size: .9rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-lugar i { margin-right: 6px; font-size: .8rem; color: var(--brand); }
.review-servicio {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 14px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  font-size: .9rem; font-weight: 600; color: var(--text);
}
.review-servicio i { color: var(--brand); font-size: 1.05rem; flex: none; }
.action-share i { color: var(--brand); }
.action-report i { color: var(--grave); }
.review-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; font-size: .82rem; color: var(--text-3); }
.review-meta i { margin-right: 6px; }
.review-text { white-space: pre-line; color: var(--text-2); font-size: 1.04rem; line-height: 1.65; }

.review-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.actions-spacer { flex: 1; }
.action-box {
  display: inline-flex; align-items: center; gap: 7px;
  height: 42px; padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: .9rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s, border-color .15s;
}
button.action-box:not(:disabled):hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.action-box.static { background: transparent; border-color: transparent; padding: 0 6px; }
.action-box.vote:disabled { cursor: default; opacity: .55; }
.action-box.vote.is-voted { opacity: 1; color: var(--brand-ink); background: var(--brand); border-color: var(--brand); }
.action-box.vote-down.is-voted { color: #fff; background: var(--grave); border-color: var(--grave); }

.vote-note { margin: 10px 0 0; font-size: .78rem; color: var(--text-3); }

.review-navigation {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px;
}
.nav-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.nav-btn:disabled { opacity: .35; }
.review-counter { font-size: .8rem; color: var(--text-3); text-align: center; }
.review-counter strong { color: var(--text); font-variant-numeric: tabular-nums; margin-right: 4px; }

/* Entidad pública vinculada al nuevo GRIO (formulario, paso 1) */
.grio-input.is-vinculado { border-color: rgba(200, 255, 26, .55); margin-bottom: 6px; }
.entidad-vinculada {
  display: flex; align-items: center; gap: 8px;
  margin: -6px 0 14px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--text-2);
  font-size: .78rem;
  line-height: 1.3;
}
.grio-input.is-vinculado + .entidad-vinculada { margin-top: 0; }
.entidad-vinculada i { color: var(--brand); }
.entidad-vinculada span { flex: 1; min-width: 0; }
.entidad-vinculada button {
  flex: none;
  border: 0; border-radius: 8px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  font-size: .75rem; font-weight: 600;
}
.entidad-vinculada.sin-entidad { background: rgba(255, 255, 255, .04); }

.entidad-otras { margin: -6px 0 14px; }
.entidad-otras label { display: block; font-size: .75rem; color: var(--text-3); margin-bottom: 4px; }
.entidad-otras select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: .85rem;
}
.entidad-vinculada.sin-entidad i { color: var(--text-3); }

@media (min-width: 900px) {
  .review-card {
    left: auto;
    right: var(--gutter);
    top: calc(var(--gutter) + var(--cabecera-h) + 12px);
    bottom: auto;
    width: 410px;
    max-height: calc(100dvh - var(--cabecera-h) - var(--panel-h) - 4 * var(--gutter));
    padding: 16px 20px 18px;
    border-radius: var(--radius-lg);
    border-bottom: 1px solid var(--border-strong);
    animation: card-in .25s ease;
  }
  .sheet-handle { display: none; }
  @keyframes card-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
}


/* ============================================================
 * MODAL NUEVO GRIO / AYUDA
 * ============================================================ */
.grio-overlay {
  position: fixed; inset: 0;
  z-index: 1040;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(3, 7, 12, .66);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.grio-modal {
  width: 100%;
  max-height: 94dvh;
  display: flex; flex-direction: column;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow);
  animation: sheet-up .3s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 640px) {
  .grio-overlay { align-items: center; padding: 24px; }
  .grio-modal { max-width: 620px; max-height: 92dvh; border-radius: var(--radius-lg); animation: card-pop .25s ease; }
  .grio-modal--help { max-width: 640px; }
}
@keyframes card-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

.grio-modal-body { overflow-y: auto; padding: 18px 18px calc(18px + var(--safe-bottom)); overscroll-behavior: contain; }
@media (min-width: 640px) { .grio-modal-body { padding: 22px 26px 24px; } }

.grio-stepper {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--border);
}
.grio-stepper-item { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: .82rem; font-weight: 600; }
.grio-stepper-dot {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  font-size: .78rem;
}
.grio-stepper-item.is-active { color: var(--text); }
.grio-stepper-item.is-active .grio-stepper-dot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.grio-stepper-item.is-done .grio-stepper-dot { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.grio-stepper-line { flex: 1; height: 2px; max-width: 70px; background: var(--border-strong); border-radius: 2px; }
.grio-stepper-line.is-done { background: var(--brand); }
@media (max-width: 420px) { .grio-stepper-label { display: none; } .grio-stepper-item.is-active .grio-stepper-label { display: inline; } }

.grio-close {
  margin-left: auto;
  width: 38px; height: 38px;
  border: 0; border-radius: 12px;
  background: var(--surface-3);
  color: var(--text-2);
}
.grio-close:hover { color: var(--text); }

.grio-step-header { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.grio-step-header h3 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.grio-step-header p { margin: 2px 0 0; color: var(--text-3); font-size: .88rem; }

.step-circle {
  flex: none;
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.grio-label { display: block; margin: 0 0 6px 2px; font-size: .78rem; font-weight: 600; color: var(--text-2); }
.grio-intro { display: block; margin: 0 0 10px 2px; font-size: .86rem; line-height: 1.5; color: var(--text-2); }
.grio-intro strong { color: var(--text); }
.grio-intro em { font-style: normal; color: var(--text-3); }

.grio-input, .grio-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 16px;
  outline: 0;
  transition: border-color .15s, background .15s;
}
.grio-input { margin-bottom: 14px; }
.grio-input::placeholder, .grio-textarea::placeholder { color: var(--text-3); }
.grio-input:focus, .grio-textarea:focus { border-color: rgba(200, 255, 26, .6); background: rgba(255, 255, 255, .06); }
textarea.grio-input { resize: vertical; }
.grio-file { padding: 10px; }

.grio-textarea-wrapper {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.grio-textarea-wrapper:focus-within { border-color: rgba(200, 255, 26, .6); }
.grio-textarea-wrapper.is-dictating { border-color: var(--grave); box-shadow: 0 0 0 3px rgba(255, 59, 48, .18); }
.grio-textarea-wrapper .grio-textarea {
  display: block;
  min-height: 300px;
  border: 0; border-radius: 0;
  background: transparent;
  resize: vertical;
  line-height: 1.55;
}
.grio-textarea-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}
.voice-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
  font-size: .86rem; font-weight: 600;
}
.voice-btn i { color: var(--brand); }
.voice-btn-activo { background: var(--grave); border-color: var(--grave); color: #fff; }
.voice-btn-activo i { color: #fff; }
.voice-status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-2); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grave); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.char-counter { margin-left: auto; font-size: .76rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

.grio-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.grio-chip {
  display: flex; gap: 8px; align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .76rem; font-weight: 600; line-height: 1.25;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.grio-chip:hover, .grio-chip:focus-visible { border-color: rgba(200, 255, 26, .45); background: rgba(200, 255, 26, .06); }
.grio-chip i { color: var(--brand); font-size: 1.05rem; flex: none; }
.grio-chip-g { width: 18px; height: 18px; object-fit: contain; flex: none; }
@media (max-width: 640px) {
  .grio-chips { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .grio-chip { padding: 8px 10px; }
}

/* Modal con la información de los chips del formulario */
.info-grio { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 18px; }
.info-grio .modal-header { border-bottom: 1px solid var(--border); gap: 12px; align-items: flex-start; }
.info-grio-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.info-grio-tabs button {
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: transparent;
  color: var(--text-2); font-size: .78rem; font-weight: 600;
}
.info-grio-tabs button.is-active { background: var(--brand); border-color: var(--brand); color: #10140a; }
.info-grio h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 12px; }
.info-grio p, .info-grio li { color: var(--text-2); line-height: 1.6; font-size: .93rem; }
.info-grio strong { color: var(--text); }
.info-grio ul { padding-left: 1.1rem; margin-bottom: 12px; }
.info-grio-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.info-grio-link:hover { text-decoration: underline; }

.grio-info-box {
  display: flex; gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 164, 153, .1);
  border: 1px solid rgba(0, 164, 153, .3);
  color: var(--text-2);
  font-size: .85rem; line-height: 1.45;
}
.grio-info-box i { color: var(--teal); font-size: 1.2rem; }
.grio-info-box strong { color: var(--text); }

/* Los dos botones siempre en la misma fila, a partes iguales */
.grio-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.grio-option-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 0;
  padding: 9px 10px;
  line-height: 1.25; text-align: left;
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-2);
  font-size: .84rem; font-weight: 600;
}
.grio-option-btn i { flex: none; }
@media (max-width: 480px) { .grio-option-btn { font-size: .78rem; padding: 8px; } }
.grio-option-btn.is-active, .grio-option-btn:hover { color: var(--text); border-style: solid; background: var(--surface-3); }
.grio-extra { margin-bottom: 4px; }

.grio-submit-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 1rem; font-weight: 800;
  transition: filter .15s, transform .1s, opacity .15s;
}
.grio-submit-btn:hover { filter: brightness(1.05); }
.grio-submit-btn:active { transform: scale(.99); }
.grio-submit-btn:disabled { opacity: .45; cursor: not-allowed; }

.grio-privacy-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px;
  font-size: .78rem; color: var(--text-3);
}

.grio-preview {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
}
.grio-preview-head h4 { margin: 10px 0 8px; font-size: 1.1rem; font-weight: 800; }
.grio-preview-text {
  white-space: pre-line;
  color: var(--text-2);
  font-size: .92rem; line-height: 1.6;
}
.grio-check {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px 0 6px;
  font-size: .86rem; color: var(--text-2);
  cursor: pointer;
}
.grio-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.grio-check a { color: var(--brand); font-weight: 600; }
.grio-check.is-bloqueada { cursor: not-allowed; opacity: .55; }
.grio-consentimientos { margin: 0 0 14px; padding: 2px 12px 8px; border: 1px solid transparent; border-radius: 12px; transition: border-color .15s, background .15s; }
.grio-consentimientos .grio-check { margin: 10px 0 0; }
.grio-consentimientos.is-aviso { border-color: rgba(255, 59, 48, .5); background: rgba(255, 59, 48, .06); }
.grio-aviso { display: flex; gap: 8px; align-items: center; margin: 10px 0 0; font-size: .84rem; font-weight: 600; color: #ff6b62; }
.grio-pista { display: flex; gap: 6px; align-items: center; margin: 0 0 4px 30px; font-size: .8rem; color: var(--text-3); }
.grio-preview-label { display: block; margin: 12px 0 4px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.grio-preview-head .grio-preview-label { margin-top: 12px; }
.grio-preview-head h4 { margin-top: 0 !important; }
.grio-preview-fin { display: block; height: 1px; }
.grio-descartar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; }
.grio-descartar-confirma {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 59, 48, .08); border: 1px solid rgba(255, 59, 48, .35);
  font-size: .84rem; color: var(--text-2);
}
.grio-descartar-confirma > div { display: flex; gap: 6px; }
.grio-link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-2); font-size: .84rem; font-weight: 600;
}
.grio-link-btn:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, .05); }
.grio-link-btn.is-peligro { color: #ff6b62; }
.grio-link-btn.is-peligro:hover:not(:disabled) { background: rgba(255, 59, 48, .1); color: #ff8a83; }

/* Ayuda */
.grio-help-title-row { display: flex; align-items: center; gap: 10px; }
.grio-help-title { margin: 0; font-size: 1.35rem; font-weight: 800; }
.grio-help-lead { margin: 8px 0 16px; color: var(--text-2); }
.grio-help-art { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); }
.grio-help-pulse { animation: help-pulse 1.6s infinite; transform-origin: 330px 84px; }
@keyframes help-pulse { 0% { opacity: 1; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }
.grio-help-steps { margin: 18px 0 8px; padding: 0; list-style: none; display: grid; gap: 14px; }
.grio-help-steps li { display: flex; gap: 14px; }
.grio-help-steps h4 { margin: 4px 0 2px; font-size: .98rem; font-weight: 700; }
.grio-help-steps p { margin: 0; font-size: .87rem; color: var(--text-2); line-height: 1.5; }

/* Procesando IA */
.grio-ia-overlay {
  position: fixed; inset: 0; z-index: 1045;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(3, 7, 12, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.grio-ia-box {
  width: min(380px, 100%);
  padding: 28px 24px;
  text-align: center;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}
.grio-ia-spinner {
  width: 46px; height: 46px; margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--brand);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.grio-ia-title { font-weight: 800; font-size: 1.05rem; }
.grio-ia-message { margin-top: 6px; color: var(--text-2); font-size: .9rem; min-height: 2.6em; }


/* ============================================================
 * MODALES BOOTSTRAP Y TOASTS (tema oscuro)
 * ============================================================ */
.modal-content {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-weight: 800; font-size: 1.05rem; }
.modal-body h5 { font-weight: 800; margin: 4px 0 6px; }
.modal-body p { color: var(--text-2); }
.text-muted-2 { color: var(--text-2); font-size: .9rem; }
.modal-backdrop.show { opacity: .7; }
.modal-icon {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 18px;
  font-size: 1.7rem;
}
.modal-icon.ok { background: var(--brand-soft); color: var(--brand); }
.modal-icon.ko { background: rgba(255, 59, 48, .14); color: var(--grave); }

.btn-brand { background: var(--brand); color: var(--brand-ink); font-weight: 800; border: 0; border-radius: 12px; padding: 11px 18px; }
.btn-brand:hover, .btn-brand:focus { background: #d4ff4a; color: var(--brand-ink); }
.btn-ghost { background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px; padding: 11px 18px; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-eliminar { background: rgba(255, 84, 112, .14); color: #ff8fa3; border: 1px solid rgba(255, 84, 112, .45); border-radius: 12px; padding: 11px 18px; font-weight: 700; }
.btn-eliminar:hover, .btn-eliminar:focus { background: rgba(255, 84, 112, .26); color: #ffb3c0; }

/* Localizador de la reseña */
.localizador {
  margin-top: 18px; padding: 16px;
  border: 1px dashed var(--brand); border-radius: 14px;
  background: var(--brand-soft);
}
.localizador-titulo { margin: 0 0 6px; font-weight: 700; }
.localizador-codigo {
  margin-bottom: 10px;
  font: 800 2rem/1.2 ui-monospace, Consolas, Menlo, monospace;
  letter-spacing: .18em; color: var(--brand);
  user-select: all;
}
.localizador-ayuda { margin: 12px 0 0; font-size: .82rem; color: var(--text-2); }
.localizador-input {
  text-align: center; text-transform: uppercase;
  font: 700 1.3rem ui-monospace, Consolas, Menlo, monospace; letter-spacing: .16em;
}
.gestion-ayuda { margin: 10px 0 0; font-size: .82rem; color: var(--text-3); }
.gestion-error { margin: 10px 0 0; font-size: .88rem; color: #ff8fa3; }
.gestion-servicio { margin: 0 0 4px; font-size: .82rem; color: var(--brand); }
.gestion-texto { max-height: 34vh; overflow-y: auto; white-space: pre-wrap; font-size: .9rem; color: var(--text-2); }
.modal .btn-danger { border-radius: 12px; padding: 11px 18px; font-weight: 700; }

.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.share-grid button {
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.35rem;
}
.share-grid button:hover { background: var(--surface-3); }
.share-link { display: flex; gap: 8px; }
.share-link input {
  flex: 1; min-width: 0;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text-2);
  font-size: .85rem;
}

.toast-container {
  position: fixed;
  z-index: 1090;
  left: 50%;
  bottom: calc(var(--panel-h) + 2 * var(--gutter) + var(--safe-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
}
.toast {
  width: auto;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.toast-body { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 500; font-size: .9rem; }
.toast-body i { color: var(--brand); font-size: 1.1rem; }
.toast-body i.bi-exclamation-triangle-fill { color: var(--moderado); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ============================================================
   BIENVENIDA (modal al entrar)
   ============================================================ */
.bienvenida {
  position: fixed; inset: 0; z-index: 1060;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: transparent;
  cursor: pointer;
  animation: bienvenida-in .35s ease-out both;
}
/* Sin tarjeta: el texto va directamente sobre el mapa. Para que se lea
   sobre cualquier fondo, todo es blanco con un halo oscuro en capas. */
.bienvenida-card {
  --halo: 0 1px 2px rgba(0, 0, 0, .95), 0 0 14px rgba(0, 0, 0, .9), 0 0 34px rgba(0, 0, 0, .75);
  position: relative;
  width: 100%; max-width: 680px;
  padding: 24px 16px;
  text-align: center;
  color: #fff;
  text-shadow: var(--halo);
  animation: bienvenida-sube .45s cubic-bezier(.2, .8, .2, 1) both;
}
.bienvenida-cerrar {
  position: absolute; top: -8px; right: 0;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(7, 13, 20, .55);
  color: #fff;
  display: grid; place-items: center; font-size: 1.15rem;
  transition: background .15s, border-color .15s;
}
.bienvenida-cerrar:hover { background: rgba(7, 13, 20, .8); border-color: #fff; }
.bienvenida-logo {
  display: block; width: 260px; max-width: 72%; height: auto; margin: 0 auto 22px;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .85));
}
.bienvenida-pregunta {
  margin: 0 0 6px;
  font-size: clamp(1.15rem, 4.4vw, 1.6rem); font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: #fff;
}
.bienvenida-titulo {
  margin: 0;
  font-size: clamp(2.7rem, 11vw, 4.4rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.02;
  text-transform: uppercase; color: #fff;
}
.bienvenida-titulo span { color: var(--brand); }
.bienvenida-sep {
  display: block; width: 56px; height: 4px; margin: 22px auto; border-radius: 4px;
  background: var(--brand); box-shadow: 0 0 12px rgba(0, 0, 0, .8);
}
.bienvenida-lema {
  margin: 0 auto 14px; max-width: 560px; text-wrap: balance;
  font-size: clamp(1.35rem, 5.2vw, 1.9rem); font-weight: 800; line-height: 1.3; color: #fff;
}
.bienvenida-texto {
  margin: 0 auto 28px; max-width: 540px; text-wrap: balance;
  font-size: clamp(1.08rem, 4vw, 1.3rem); font-weight: 600; line-height: 1.55; color: #fff;
}
.bienvenida-texto strong { color: var(--brand); font-weight: 800; }
.bienvenida-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 30px;
  border: 0; border-radius: 999px;
  background: var(--brand); color: #10140a;
  font-weight: 800; font-size: 1.05rem;
  text-shadow: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .55);
  transition: transform .15s, box-shadow .15s;
}
.bienvenida-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(200, 255, 26, .3); }
@media (max-width: 480px) {
  .bienvenida-logo { margin-bottom: 18px; }
  .bienvenida-cerrar { top: -16px; }
}
@keyframes bienvenida-in { from { opacity: 0; } }
@keyframes bienvenida-sube { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  .bienvenida, .bienvenida-card { animation: none; }
}

/* Condiciones de uso / Normas de publicación dentro de la página */
.documento-modal .modal-header { gap: 10px; }
.documento-modal .modal-title { flex: 1; }
.documento-externo { color: var(--text-3); font-size: 1rem; }
.documento-externo:hover { color: var(--brand); }
.documento-frame { display: block; width: 100%; height: 70dvh; border: 0; background: #070d14; border-radius: 0 0 18px 18px; }

/* Espera de la IA: opción de cancelar si tarda */
.grio-ia-lento { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center; }
.grio-ia-lento p { margin: 0 0 6px; font-size: .84rem; color: var(--text-3); }

/* Paso 2: relato no publicable */
.grio-no-publicable {
  display: flex; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 59, 48, .08); border: 1px solid rgba(255, 59, 48, .35);
  color: var(--text-2); font-size: .9rem; line-height: 1.55;
}
.grio-no-publicable > i { color: #ff6b62; font-size: 1.25rem; }
.grio-no-publicable strong { display: block; margin-bottom: 4px; color: var(--text); }
.grio-no-publicable p { margin: 6px 0 0; }
.grio-no-publicable a { color: var(--brand); font-weight: 600; }

/* Mientras se ve la bienvenida, los controles del mapa no se mezclan con el texto */
.bienvenida ~ .map-controls { visibility: hidden; }
