:root {
  --brand: #3b82f6;
  --brand-dark: #2563eb;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #ffffff;
  --soft: #f3f4f6;
  --border: #e5e7eb;
  --danger: #ef4444;
  --radius: 16px;
  --top-h: 44px; /* alto del logo y de Mapa|Lista (iguales) */
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.16);

  --st-proposed: #3b82f6;
  --st-approved: #eab308;
  --st-cv_sent: #f97316;
  --st-interview: #8b5cf6;
  --st-hired: #22c55e;
  --st-not_hired: #ef4444;
  --st-discarded: #6b7280;
  --st-deleted: #374151;

  /* Fondos suaves de avisos y botones (cambian en modo oscuro) */
  --hint-bg: #eff6ff;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --row-hover: #f9fafb;
  --home: #0f766e;
  --transit-bg: #ecfdf5;
  --transit-bg-active: #d1fae5;
  --danger-soft-active: #fee2e2;
  color-scheme: light;
}

/* Modo oscuro: se activa al elegir el estilo de mapa "Oscuro" (ver basemap-picker.js) */
:root[data-theme="dark"] {
  --brand-dark: #93c5fd;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --bg: #1f2937;
  --soft: #111827;
  --border: #374151;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  --st-deleted: #57534e;
  --hint-bg: #1e3a5f;
  --error-bg: #3f1d1d;
  --error-text: #fca5a5;
  --row-hover: #273449;
  --home: #14b8a6;
  --transit-bg: #0f2f2b;
  --transit-bg-active: #134e4a;
  --danger-soft-active: #4c1d1d;
  color-scheme: dark; /* inputs, selects y el selector de fecha también oscuros */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--soft);
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

#map { position: fixed; inset: 0; }

/* --- Título --- */
/* Título + botón "?" juntos, arriba a la izquierda */
.topbar-left {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  z-index: 500;
  display: flex;
  gap: 8px;
}
.brand {
  height: var(--top-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.brand-app { color: var(--brand); }

.help-btn {
  width: var(--top-h);
  height: var(--top-h);
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--brand);
  font-size: 1.35rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.help-btn:active { transform: scale(0.95); }

/* Celus muy angostos: sin el 📍 entran título, "?" y Mapa|Lista */
@media (max-width: 380px) {
  .brand-pin { display: none; }
  .brand { padding: 0 14px; }
}

/* --- Botones --- */
button { font: inherit; cursor: pointer; }

.btn {
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-weight: 700;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-dark); }
.btn-secondary { background: var(--soft); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 500;
  min-height: 56px;
  padding: 0 24px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}
.fab:active { transform: scale(0.97); }
.sheet-open .fab { display: none; }

.empty-card {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(100px + env(safe-area-inset-bottom));
  z-index: 500;
  margin: 0 auto;
  max-width: 360px;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 600;
}
.sheet-open .empty-card { display: none; }

/* --- Colores por estado: cada elemento toma --c (fondo) y --on (texto encima) --- */
[class*="-proposed"] { --c: var(--st-proposed); }
[class*="-approved"] { --c: var(--st-approved); --on: #422006; } /* amarillo: texto oscuro */
[class*="-cv_sent"] { --c: var(--st-cv_sent); }
[class*="-interview"] { --c: var(--st-interview); }
[class*="-hired"] { --c: var(--st-hired); }
[class*="-not_hired"] { --c: var(--st-not_hired); }
[class*="-discarded"] { --c: var(--st-discarded); }
[class*="-deleted"] { --c: var(--st-deleted); }

/* --- Pines --- */
.pin {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  background: var(--c, var(--brand));
  border: 3px solid #fff;
  transform: rotate(-45deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}
.pin b {
  transform: rotate(45deg);
  color: var(--on, #fff);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.pin span {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
}
.pin-draft {
  width: 40px;
  height: 40px;
  background: var(--danger);
  animation: bounce 0.4s ease-out;
}
.pin-draft span { inset: 11px; }
@keyframes bounce {
  from { transform: rotate(-45deg) translate(10px, -10px); }
  to { transform: rotate(-45deg); }
}

/* --- Chips de filtro --- */
.filters {
  position: fixed;
  top: calc(12px + var(--top-h) + 10px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  gap: 8px;
  padding: 2px 12px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px 6px 6px;
  border: 2px solid var(--c);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
}
.chip:not(.chip-on) { opacity: 0.75; }
.chip-on { background: var(--c); color: var(--on, #fff); }

.chip-short {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--c);
  color: var(--on, #fff);
  font-size: 0.8rem;
  font-weight: 800;
}
.chip-on .chip-short { background: rgba(255, 255, 255, 0.3); color: inherit; }

/* --- Panel (bottom sheet en celular, lateral en compu) --- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  max-height: 62vh;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 30px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  animation: slide-up 0.2s ease-out;
}
@supports (height: 1dvh) { .sheet { max-height: 62dvh; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }

#sheet-body {
  overflow-y: auto;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--soft);
  font-size: 1.1rem;
}

@media (min-width: 768px) {
  .sheet {
    top: 0;
    left: auto;
    width: 400px;
    max-height: none;
    border-radius: 0;
    box-shadow: -6px 0 30px rgba(15, 23, 42, 0.15);
    animation-name: slide-left;
  }
  @supports (height: 1dvh) { .sheet { max-height: none; } }
  @keyframes slide-left { from { transform: translateX(40px); opacity: 0; } }
  .sheet-open .leaflet-right,
  .sheet-open .filters { right: 400px; }
}

h2 {
  margin: 0 52px 12px 0;
  font-size: 1.35rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

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

/* --- Formulario --- */
.add-form { display: flex; flex-direction: column; gap: 14px; }

.label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.label small { font-weight: 400; color: var(--muted); }

input, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font: inherit;
  font-size: 16px; /* evita el zoom de iOS */
  color: inherit;
  background: var(--bg);
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); }

.hint {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.95rem;
}
.hint-ok { background: var(--hint-bg); color: var(--brand-dark); }

.results { list-style: none; margin: -6px 0 0; padding: 0; }
.results:empty { display: none; }
.results li.muted { padding: 10px 4px; }
.result {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  text-align: left;
  color: inherit;
}
.result:active { background: var(--soft); }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions:empty { display: none; }
.suggestion {
  min-height: 44px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: var(--soft);
  color: inherit;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--error-bg);
  color: var(--error-text);
  font-weight: 600;
}

/* --- Ficha --- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  background: var(--c);
  color: var(--on, #fff);
  font-weight: 700;
}
.status .chip-short { background: rgba(255, 255, 255, 0.3); color: inherit; height: 26px; }

.highlight {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
  font-weight: 600;
}

/* --- Acciones de la ficha --- */
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.actions .row { display: flex; gap: 10px; }
.actions .row > .btn { flex: 1; }
.btn-status { background: var(--c); color: var(--on, #fff); font-size: 1.05rem; }
.btn-status:active { filter: brightness(0.92); }
.btn-link {
  align-self: center;
  min-height: 44px;
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 600;
  text-decoration: underline;
}
.small-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }

.subform { padding: 14px; border-radius: var(--radius); background: var(--soft); }
.subform-title { margin: 0; font-weight: 700; }
.subform input { background: var(--bg); }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option {
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: inherit;
  font-weight: 600;
}
.option[aria-pressed="true"] { border-color: var(--st-discarded); background: var(--st-discarded); color: #fff; }

.detail dl { margin: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.detail dt { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.detail dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.multiline { white-space: pre-wrap; }
.selectable { user-select: text; }

/* --- Toast y diálogo --- */
.toast {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 12px 20px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
}
.toast-error { background: #b91c1c; }

.confirm {
  border: none;
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 24px;
  max-width: min(360px, calc(100% - 32px));
  box-shadow: var(--shadow);
}
.confirm::backdrop { background: rgba(15, 23, 42, 0.4); }
.confirm p { margin: 0 0 20px; font-size: 1.1rem; font-weight: 600; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* --- Historial --- */
.history-box { margin-bottom: 12px; border-top: 1px solid var(--border); padding-top: 4px; }
.history-box summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history li { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.history time { font-size: 0.85rem; color: var(--muted); }
.history .undone span { text-decoration: line-through; color: var(--muted); }

/* Ícono SVG dentro del pin y del chip (ej. el tacho de "Eliminado") */
.pin b svg, .chip-short svg { display: block; }

/* --- Mapa ↔ Lista --- */
.view-toggle {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 500;
  display: flex;
  height: var(--top-h);
  border-radius: 999px;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.view-toggle button {
  height: var(--top-h); /* todo el alto es tocable */
  min-width: 64px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-weight: 700;
}
/* El borde blanco interno hace que el activo se vea como una pastilla adentro */
.view-toggle button[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: inset 0 0 0 3px var(--bg); }

/* --- Vista Lista --- */
.list {
  position: fixed;
  inset: 0;
  z-index: 450; /* arriba del mapa, abajo de chips y botones */
  overflow-y: auto;
  padding: calc(144px + env(safe-area-inset-top)) 12px calc(110px + env(safe-area-inset-bottom));
  background: var(--soft);
}

/* En la lista, la zona de arriba (título, Mapa|Lista, chips) tiene fondo propio
   para que las tarjetas no pasen por debajo de los chips al scrollear */
.view-list::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 460; /* arriba de la lista (450), abajo de chips y botones (500) */
  height: calc(126px + env(safe-area-inset-top)); /* hasta abajo de los chips */
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.list > * { max-width: 960px; margin-left: auto; margin-right: auto; }
.list-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
#list-search { flex: 1 1 220px; }
#list-sort {
  flex: 0 1 auto;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.list-empty { text-align: center; color: var(--muted); font-weight: 600; padding: 32px 16px; }

.list-table { width: 100%; border-collapse: collapse; }
.list-table tr[tabindex] { cursor: pointer; }
.list-table tr[tabindex]:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.col-name { font-weight: 700; overflow-wrap: anywhere; }
.col-date { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* Celular: cada fila es una tarjeta */
@media (max-width: 767px) {
  .list-table thead { display: none; }
  .list-table, .list-table tbody, .list-table tr, .list-table td { display: block; }
  .list-table tr {
    margin-bottom: 10px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  }
  .list-table tr:active { background: var(--row-hover); }
  .list-table td { padding: 2px 0; }
  .list-table td:empty { display: none; }
  .list-table td[data-label="Rubro"]::before,
  .list-table td[data-label="Puesto"]::before { content: attr(data-label) ": "; color: var(--muted); }
  .col-name { font-size: 1.1rem; margin-bottom: 2px; }
  .col-status { margin: 8px 0 4px; }
}

/* Compu: tabla */
@media (min-width: 768px) {
  .sheet-open .list { right: 400px; }
  .list-table { background: var(--bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  .list-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
  }
  .list-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  .list-table tbody tr:hover { background: var(--row-hover); }
  .list-table tbody tr:last-child td { border-bottom: none; }
}

.view-list .leaflet-control-container { display: none; }

/* --- F6: casa y Cómo llego --- */

.pin-home { --c: var(--home); width: 38px; height: 38px; }
.pin-home b { display: grid; place-items: center; }

/* Botones sobre el mapa (abajo a la izquierda, arriba del zoom) */
.map-btn {
  min-height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.distance { margin: 10px 0 0; color: var(--muted); font-weight: 600; }

/* "Cómo llego" es un link con forma de botón */
.btn-transit {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  background: var(--transit-bg);
  color: var(--home);
  border: 2px solid var(--home);
  text-decoration: none;
  text-align: center;
}
.btn-transit:active { background: var(--transit-bg-active); }

.col-distance { color: var(--muted); white-space: nowrap; }
@media (max-width: 767px) {
  .col-distance { font-weight: 600; }
}

/* Acción destructiva suave (ej. "Quitar tu casa") */
.btn-danger-soft { background: var(--error-bg); color: var(--error-text); margin-top: 8px; }
.btn-danger-soft:active { background: var(--danger-soft-active); }

/* --- Estilo del mapa --- */
.basemap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.basemap-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 44px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: inherit;
  text-align: left;
}
.basemap-card-on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25); }
.basemap-card small { color: var(--muted); }
.basemap-swatch {
  display: flex;
  width: 100%;
  height: 44px;
  margin-bottom: 4px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.basemap-swatch i { flex: 1; }

/* --- Créditos del mapa: botoncito "i" que se abre al tocarlo --- */
.leaflet-control-attribution.attr-compact {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  color: transparent; /* el texto queda oculto hasta abrirlo */
  background: var(--bg);
  opacity: 0.92;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
}
/* Mismo margen que el resto de los controles (Leaflet le pone 0 a los créditos) */
.leaflet-container .leaflet-control-attribution.attr-compact { margin: 0 0 10px 10px; }
.attr-compact::before {
  content: "i";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font: italic 700 16px Georgia, serif;
}
/* Cerrado: los links (que Leaflet pinta de azul) también quedan ocultos y no se tocan */
.leaflet-container .attr-compact:not(.attr-open) a { color: transparent; pointer-events: none; }
.leaflet-control-attribution.attr-compact.attr-open {
  width: auto;
  height: auto;
  max-width: calc(100vw - 32px);
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text);
  white-space: normal;
}
.attr-open::before { display: none; }

/* Zoom (+/−) de Leaflet en modo oscuro: por defecto es siempre blanco */
:root[data-theme="dark"] .leaflet-bar a,
:root[data-theme="dark"] .leaflet-bar a:hover {
  background-color: var(--bg);
  color: var(--text);
  border-bottom-color: var(--border);
}

/* --- Guía "¿Cómo se usa?" --- */
.help {
  position: fixed;
  inset: 0;
  z-index: 1500; /* arriba del panel (1000), abajo del toast (2000) */
  display: flex;
  justify-content: center;
  background: var(--soft);
}
.help-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(14px + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
  .help { align-items: center; padding: 24px; background: rgba(15, 23, 42, 0.45); }
  .help-card { max-height: min(820px, 100%); border-radius: 20px; box-shadow: var(--shadow); }
}
.help-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-kicker { color: var(--muted); font-weight: 700; }
.help-body { flex: 1; overflow-y: auto; padding: 8px 2px 16px; }
.help-title { margin: 12px 0 8px; font-size: 1.7rem; }
.help-text { margin: 10px 0; font-size: 1.1rem; line-height: 1.45; }

.help-nav { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.help-dots { display: flex; justify-content: center; gap: 6px; }
.help-dots span { width: 8px; height: 8px; border-radius: 4px; background: var(--border); transition: width 0.2s; }
.help-dots span.on { width: 24px; background: var(--brand); }
.help-buttons { display: flex; gap: 10px; }
.help-buttons .btn { flex: 1; min-height: 52px; font-size: 1.05rem; }

/* Dibujos: los componentes reales, quietos y en su lugar */
.demo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 18px 14px;
  border-radius: var(--radius);
  background: var(--soft);
  pointer-events: none;
}
.demo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.demo-arrow { color: var(--muted); font-size: 1.3rem; line-height: 1; }
.demo-note { color: var(--muted); }
.demo-box .fab,
.sheet-open .demo-box .fab,
.demo-box .view-toggle { position: static; display: inline-flex; align-items: center; }
.demo-box .btn { display: inline-flex; align-items: center; justify-content: center; }
.demo-box .btn-transit { width: auto; margin-top: 0; padding: 12px 24px; }
.demo-box .pin { margin: 6px 0 10px; }
.demo-input {
  display: block;
  width: 100%;
  max-width: 280px;
  padding: 12px 14px;
  border: 2px solid var(--brand);
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
}
.demo-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.demo-legend li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-legend .chip { box-shadow: none; }

/* Mini mapa del paso 1: calles dibujadas con gradientes */
.demo-map {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 160px;
  border-radius: 14px;
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, transparent 46%, var(--border) 46%, var(--border) 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, var(--border) 46%, var(--border) 54%, transparent 54%);
  background-size: 70px 70px;
}
.demo-map .pin { position: absolute; margin: 0; }
.demo-map .pin:nth-child(1) { left: 18%; top: 22%; }
.demo-map .pin:nth-child(2) { left: 55%; top: 12%; }
.demo-map .pin:nth-child(3) { left: 72%; top: 52%; }

/* --- Pantalla de clave --- */
.lock {
  position: fixed;
  inset: 0;
  z-index: 1800; /* arriba de todo (también de la guía), abajo del toast */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: var(--soft);
}
.lock-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 380px;
  padding: 28px 22px;
  border-radius: 20px;
  background: var(--bg);
  box-shadow: var(--shadow);
  text-align: center;
}
.lock-card p { margin: 0; }
.lock-brand { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.lock-title { margin: 6px 0 0; font-size: 1.4rem; }
.lock-card input { text-align: center; }
.lock-note { font-size: 0.85rem; }
.logout-link { display: block; margin: 18px auto 0; }
