/* Nodus — the ODUS field platform.
 *
 * Sized for one hand in a car park, not a desk. Tap targets are 44px minimum,
 * type does not go below 14px, and nothing important sits within a thumb's
 * reach of a destructive action.
 *
 * The tokens below are ODUS's, copied from the brand kit unchanged. Nodus adds
 * no tokens of its own — per the kit, the only thing Nodus owns is its
 * wordmark. If a value here disagrees with the kit, the kit is right.
 */

/* --------------------------------------------------------------- typeface */

/* Self-hosted, not Google Fonts. The kit says to swap for @font-face "si se
 * requiere uso offline", and this is a PWA whose whole point is working in a
 * basement — a cross-origin font is a request the service worker cannot cache,
 * so the app would fall back to system-ui exactly when a seller opens it cold.
 * One variable file covers every weight the UI uses. */
@font-face {
  font-family: 'Inter Tight';
  src: url('./vendor/fonts/inter-tight-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Montserrat ExtraBold, pinned to weight 800 and subsetted to the six glyphs of
 * "NODUS." — 936 bytes rather than 35 KB. The kit is emphatic that this face is
 * for the logotype and nothing else, so shipping the whole alphabet would be
 * paying for a temptation. */
@font-face {
  font-family: 'Nodus Wordmark';
  src: url('./vendor/fonts/nodus-wordmark.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: block;
}

/* ----------------------------------------------------------------- tokens */

:root {
  /* coral */
  --coral-50: #FEE7E7;  --coral-100: #FECECE; --coral-200: #FEB6B6;
  --coral-300: #FD9494;  --coral-400: #FD8080; --coral-500: #FC6060;
  /* Added for contrast, not for the palette's sake: see --color-brand-fuerte. */
  --gray-600: #6E6E6E;
  --coral-600: #E55757;  --coral-700: #B34444; --coral-800: #8B3535;
  --coral-900: #6A2828;

  /* neutrals */
  --ink: #232323;
  --gray-900: #232323; --gray-700: #5C5C5C; --gray-500: #878787;
  --gray-400: #AFAEAE; --gray-300: #D3D1D1; --gray-200: #E6E3E1;
  --gray-100: #F1EDEA;
  --cream: #FFF7F0;
  --white: #FFFFFF;

  /* status */
  --status-success: #2FA36B; --status-success-soft: #E4F4EC;
  --status-warning: #E0922F; --status-warning-soft: #FBEEDD;
  --status-danger:  #E55757; --status-danger-soft:  #FDE7E7;
  --status-info:    #3C6E9C; --status-info-soft:    #E6EEF5;

  /* semantic */
  --color-brand: var(--coral-500);
  /* The brand colour when something readable sits on top of it, or when it is
     itself the thing that must be seen.
     Cream on coral-500 measures 2.84:1. That was the primary button in the
     whole product - Entrar, Check-in, Cerrar visita - below the 4.5:1 AA floor
     and below even the 3:1 large-text floor, on a phone, outdoors. coral-700
     is the same hue three steps down and measures 5.18:1.
     --color-brand keeps coral-500 for decoration (the wordmark's dot), which
     carries no information and sits beside large bold text. */
  --color-brand-fuerte: var(--coral-700);
  --color-brand-hover: var(--coral-600);
  --color-brand-active: var(--coral-700);
  --text-primary: var(--ink);
  --text-secondary: var(--gray-700);
  /* gray-600, not gray-500. #878787 measured 3.39:1 on the cream page and
     3.59:1 on a card - below the 4.5:1 AA floor for normal text, and this is
     the token every `.nota`, `.sub` and `<small>` uses, which in this product
     is where most of the explaining happens. #6E6E6E clears it at 4.81 and
     5.10 while staying a visible tier lighter than --text-secondary. */
  --text-muted: var(--gray-600);
  --text-on-brand: var(--cream);
  --text-brand: var(--coral-600);
  --surface-page: var(--cream);
  --surface-card: var(--white);
  --surface-subtle: var(--gray-100);
  --surface-sunken: var(--gray-200);
  --surface-dark: var(--ink);
  --border-subtle: var(--gray-200);
  --border-default: var(--gray-300);
  --border-strong: var(--gray-400);
  /* A focus indicator is non-text UI and needs 3:1 against what surrounds
     it; coral-500 on cream is 2.84:1. */
  --focus-ring: var(--coral-700);
  --focus-ring-soft: rgba(252, 96, 96, 0.30);

  /* type */
  --font-sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-wordmark: 'Nodus Wordmark', 'Montserrat', system-ui, sans-serif;
  --text-2xs: 0.6875rem; --text-xs: 0.75rem;  --text-sm: 0.875rem;
  --text-base: 1rem;     --text-md: 1.0625rem; --text-lg: 1.25rem;
  --text-xl: 1.5rem;     --text-2xl: 2rem;     --text-3xl: 2.4375rem;
  --text-4xl: 3rem;
  --leading-snug: 1.2; --leading-normal: 1.45; --leading-body: 1.55;
  --tracking-tight: -0.02em; --tracking-caps: 0.14em;

  /* space, on a 4px scale */
  --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;    --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem;    --space-10: 2.5rem; --space-12: 3rem;

  /* form */
  --radius-xs: 4px; --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --radius-xl: 24px; --radius-pill: 999px;

  /* warm shadows only — never neutral grey */
  --shadow-xs: 0 1px 2px rgba(35, 35, 35, 0.06);
  --shadow-sm: 0 1px 3px rgba(35, 35, 35, 0.08), 0 1px 2px rgba(35, 35, 35, 0.04);
  --shadow-md: 0 4px 12px rgba(35, 35, 35, 0.08), 0 2px 4px rgba(35, 35, 35, 0.04);
  --shadow-lg: 0 12px 28px rgba(35, 35, 35, 0.10), 0 4px 10px rgba(35, 35, 35, 0.05);
  --shadow-brand: 0 8px 24px rgba(252, 96, 96, 0.35);

  /* motion: 120–320ms, no bounce */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 320ms;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* `hidden` has to beat the layout rules below it. The browser hides an
   element with the attribute via `[hidden] { display: none }` in its own
   stylesheet, and any author `display:` on the same element wins over that
   regardless of specificity — which is how `#tabs { display: flex }` left
   the tab bar on screen throughout the login screen, letting a seller who
   was not signed in walk into the app. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: var(--text-base)/var(--leading-body) var(--font-sans);
  font-synthesis-weight: none;
  color: var(--text-primary); background: var(--surface-page);
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------------ shell */

#barra {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-card); border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 10;
}

/* The wordmark. One construction only: the word in Montserrat ExtraBold caps at
 * 0.02em tracking, and the final period in coral. The dot is the whole brand
 * gesture — it closes the word and points at the destination — so it is markup
 * rather than a character in a string, and cannot be lost to a translation. */
#marca {
  flex: 1; display: flex; align-items: baseline; gap: 0;
  font-family: var(--font-wordmark); font-weight: 800;
  font-size: var(--text-md); letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--ink); line-height: var(--leading-none, 1);
}
#marca .punto { color: var(--color-brand); }

/* The wordmark at access size. Same single construction as the header, larger:
 * the kit names the logotype, the app icon and the sign-in screen as the three
 * places the mark itself appears. Safe zone is the height of the N on all four
 * sides, which is what the margins below come to at this size. */
.marca-grande {
  font-family: var(--font-wordmark); font-weight: 800;
  font-size: var(--text-2xl); letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--ink); line-height: 1;
  margin: var(--space-10) 0 var(--space-8);
}
.marca-grande .punto { color: var(--color-brand); }
.acceso-titulo {
  font-size: var(--text-md); font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0; margin-bottom: var(--space-6);
}

#tabs {
  display: flex; background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
}
#tabs button {
  flex: 1; min-height: 52px; border: 0; background: none; font: inherit;
  font-size: var(--text-sm); font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: color var(--duration-fast) var(--ease-standard);
  /* Overrides the pill radius every other button gets. Without it the 2px
     inset indicator below follows a 999px corner and draws an arc over the
     label instead of a bar under the tab. */
  border-radius: 0;
}
#tabs button.activo {
  color: var(--text-brand);
  box-shadow: inset 0 2px 0 var(--color-brand);
}
#app { flex: 1; overflow-y: auto; padding: var(--space-4); }
#atribucion {
  padding: var(--space-2) var(--space-4); font-size: var(--text-2xs);
  color: var(--text-muted); background: var(--surface-card);
}

/* -------------------------------------------------------- sync indicator */

.pill {
  font-size: var(--text-xs); font-weight: 600; padding: 5px 10px;
  border-radius: var(--radius-pill); background: var(--surface-subtle);
  color: var(--text-secondary); white-space: nowrap;
}
.pill.online   { background: var(--status-success-soft); color: #1F7A4F; }
.pill.offline  { background: var(--status-warning-soft); color: #8A5A18; }
.pill.pendiente{ background: var(--coral-50); color: var(--coral-800); }

/* ---------------------------------------------------------------- typography */

h1 {
  font-size: var(--text-xl); font-weight: 700; margin: 0 0 var(--space-1);
  letter-spacing: var(--tracking-tight); line-height: var(--leading-snug);
}
h2 {
  font-size: var(--text-md); font-weight: 700; margin: var(--space-6) 0 var(--space-3);
  letter-spacing: var(--tracking-tight);
}
.sub {
  color: var(--text-secondary); font-size: var(--text-sm); margin: 0 0 var(--space-4);
}
/* Eyebrow: the kit's one place for uppercase tracking. */
.eyebrow {
  font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--tracking-caps); color: var(--text-muted);
  margin: 0 0 var(--space-2);
}

/* ---------------------------------------------------------------- buttons */

button {
  font: inherit; font-weight: 600; border-radius: var(--radius-pill);
  cursor: pointer; min-height: 48px; padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border-default);
  background: var(--surface-card); color: var(--text-primary);
  transition: transform var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
/* Press = scale(0.97). No bounce anywhere in the system. */
button:active { transform: scale(0.97); }
button:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--focus-ring-soft);
  border-color: var(--focus-ring);
}
button:disabled { opacity: .5; cursor: default; transform: none; }

/* The single primary action. One per screen: if two of these are on screen at
 * once, the screen is wrong — that is the kit's rule, not a preference. */
button.primario {
  background: var(--color-brand-fuerte); border-color: var(--color-brand-fuerte);
  color: var(--text-on-brand); box-shadow: var(--shadow-brand);
}
button.primario:active { background: var(--color-brand-active); }
/* Outline secondary: 2px ink, per the kit's border rules. */
button.contorno { border: 2px solid var(--ink); background: transparent; }
button.ghost {
  min-height: 36px; padding: 7px var(--space-3); font-size: var(--text-sm);
}
button.ancho { width: 100%; }
.acciones {
  display: flex; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap;
}
.acciones > * { flex: 1 1 140px; }

/* ------------------------------------------------------------------ cards */

.tarjeta {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-4);
  margin-bottom: var(--space-3); box-shadow: var(--shadow-xs);
}
@media (min-width: 768px) { .tarjeta { padding: var(--space-6); } }
.tarjeta.hecha { opacity: .62; }
/* A stop with a booked time. The accent is the only left border in the system,
 * and it earns the exception: an appointment is the one commitment in the day a
 * seller must not miss, and it has to survive a glance at arm's length. */
.tarjeta.tibia { border-left: 3px solid var(--status-info); }

.fila { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.nombre {
  font-weight: 600; font-size: var(--text-base); line-height: var(--leading-snug);
}
.hora {
  font-variant-numeric: tabular-nums; font-weight: 600;
  font-size: var(--text-sm); color: var(--text-brand);
}

/* -------------------------------------------------- Nodus: fila de visita */

/* The base unit of the whole app: status dot · doctor and clinic · time and
 * reason · one action on the right. Exactly one primary action per row.
 *
 * Rows are 12px apart and each is a card, so the day reads as a stack of
 * discrete commitments rather than a table. */
.visita-fila {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: start; gap: var(--space-3);
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-4);
  margin-bottom: var(--space-3); box-shadow: var(--shadow-xs);
  cursor: pointer; text-align: left; width: 100%;
  transition: box-shadow var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.visita-fila:active { transform: scale(0.99); }
.visita-fila.ahora {
  border-color: var(--color-brand); box-shadow: var(--shadow-sm);
}
/* On a phone the action drops below the text instead of competing with it for
 * width. Squeezed into a third column beside a button, a clinic name wrapped to
 * three ragged lines — and the name is what the seller is matching against the
 * sign on the door, so it gets the room. Still the row's single action, still on
 * the right. */
@media (max-width: 460px) {
  .visita-fila.ahora { grid-template-columns: auto 1fr; }
  .visita-fila.ahora .accion {
    grid-column: 2; justify-self: end; margin-top: var(--space-3);
  }
}
.visita-fila.hecha { opacity: .62; }
/* A day that has not happened yet. Nothing to open, so nothing that looks
   openable: no pointer, no press response. Slightly recessed so the finished
   day above it stays the subject of the screen. */
.visita-fila.plan { cursor: default; background: var(--surface-subtle); }
.visita-fila.plan:active { transform: none; }
.visita-fila .cuerpo { min-width: 0; }
.visita-fila .quien {
  font-weight: 600; font-size: var(--text-base); line-height: var(--leading-snug);
  color: var(--text-primary);
}
.visita-fila .cuando {
  font-size: var(--text-sm); color: var(--text-secondary);
  margin-top: var(--space-1); line-height: var(--leading-normal);
}
.visita-fila .hora {
  font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-primary);
}
.visita-fila .accion { align-self: center; flex-shrink: 0; }
/* Lucide, 2px stroke, no fill, colour inherited. The kit bans emoji, so every
 * glyph in the UI is either type or an inline SVG like this one. */
.chevron { display: block; color: var(--text-muted); }

/* A control that reads as text. Used where the affordance belongs on the
 * content itself — a person's name — rather than on a button beside it that
 * has to be labelled with a concept. */
button.enlace {
  all: unset; cursor: pointer; font-weight: 600;
  color: var(--text-brand); border-radius: var(--radius-xs);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--coral-200);
}
button.enlace:hover { text-decoration-color: var(--color-brand); }
button.enlace:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ------------------------------------------------- estados de visita (§3) */

/* Five states, five treatments, fixed by the kit. The shape carries the meaning
 * as well as the colour, so the row still reads correctly to a seller who
 * cannot distinguish coral from amber in direct sunlight. */
.estado {
  width: 14px; height: 14px; border-radius: 50%; margin-top: 4px;
  flex-shrink: 0; display: block;
}
/* Confirmada / visita hecha */
.estado.hecha { background: var(--status-success); }
/* En curso / ahora — a coral dot with a halo that pulses */
.estado.ahora {
  background: var(--color-brand);
  box-shadow: 0 0 0 4px var(--coral-100);
  animation: latido 1.8s var(--ease-standard) infinite;
}
@keyframes latido {
  0%, 100% { box-shadow: 0 0 0 3px var(--coral-100); }
  50%      { box-shadow: 0 0 0 7px var(--coral-50); }
}
/* Por confirmar / reagendada — amber, never red */
.estado.por-confirmar { background: var(--status-warning); }
/* Pendiente / futura — an empty 2px ring */
.estado.pendiente {
  background: transparent; border: 2px solid var(--gray-400);
}
/* No se logró — only ever rendered with a captured reason beside it */
.estado.fallida { background: var(--status-danger); }

/* --------------------------------------- Nodus: barra de avance del día */

/* One honest number above the agenda. Never a productivity percentage, never a
 * performance traffic light — the kit forbids both, and §3's "visibilidad, no
 * vigilancia" is the reason. */
.avance {
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.avance .cuenta {
  /* The kit's "dato grande" band is 40–56px at weight 700. This is the one
   * number a seller reads from arm's length, so it sits at the bottom of that
   * band rather than the top of the heading scale. */
  font-size: 2.5rem; font-weight: 700; line-height: 1;
  letter-spacing: var(--tracking-tight);
}
.avance .cuenta .de { color: var(--text-muted); font-weight: 600; }
.avance .glosa {
  font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-1);
}
.avance .riel {
  height: 6px; border-radius: var(--radius-pill); background: var(--surface-sunken);
  margin-top: var(--space-3); overflow: hidden;
}
.avance .riel i {
  display: block; height: 100%; border-radius: var(--radius-pill);
  background: var(--status-success);
  transition: width var(--duration-slow) var(--ease-standard);
}

/* Visible to a screen reader, not to the eye. For the words that colour and
 * iconography carry visually and cannot carry to assistive tech. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* The chevron is a real button now, so it needs to stop looking like one: no
 * border, no fill, just the glyph with a target big enough to hit. 44px keeps
 * it comfortable for a thumb and well past WCAG's 24px web minimum. */
button.ir {
  min-height: 44px; min-width: 44px; padding: 0;
  border: 0; background: none; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
button.ir:hover { color: var(--text-primary); }

/* ------------------------------------------------------------------ badges */

.etiqueta {
  font-size: var(--text-2xs); font-weight: 600; padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--surface-subtle); color: var(--text-secondary);
}
.etiqueta.azul  { background: var(--status-info-soft);    color: var(--status-info); }
.etiqueta.ambar { background: var(--status-warning-soft); color: #8A5A18; }
.etiqueta.verde { background: var(--status-success-soft); color: #1F7A4F; }
.etiqueta.roja  { background: var(--status-danger-soft);  color: var(--coral-800); }

.dir { color: var(--text-secondary); font-size: var(--text-sm); margin-top: 3px; }
.meta {
  color: var(--text-muted); font-size: var(--text-xs); margin-top: var(--space-2);
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3);
  align-items: center;
}

/* ------------------------------------------------------------------ forms */

label {
  display: block; font-size: var(--text-2xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracking-caps);
  color: var(--text-muted); margin: var(--space-4) 0 var(--space-2);
}
input, select, textarea {
  width: 100%; font: inherit; padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-default);
  background: var(--surface-card); color: var(--text-primary);
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--focus-ring-soft);
}
textarea { min-height: 84px; resize: vertical; }

/* --------------------------------------------------------------- messages */

.aviso {
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); margin: var(--space-3) 0;
  line-height: var(--leading-normal);
}
.aviso.info  { background: var(--status-info-soft);    color: var(--status-info); }
.aviso.warn  { background: var(--status-warning-soft); color: #8A5A18; }
.aviso.error { background: var(--status-danger-soft);  color: var(--coral-800); }
.aviso.ok    { background: var(--status-success-soft); color: #1F7A4F; }
.cargando { color: var(--text-muted); }
.vacio {
  text-align: center; color: var(--text-secondary);
  padding: var(--space-10) var(--space-5);
}

/* ------------------------------------------- Nodus: cierre de visita (chips) */

/* Chips instead of free-text wherever the answer is knowable in advance. A
 * seller standing in a doorway taps; they do not type. */
.resultados { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.resultados button {
  text-align: left; min-height: 44px; flex: 0 1 auto;
  padding: var(--space-2) var(--space-4); font-size: var(--text-sm);
  border-radius: var(--radius-pill);
}
.resultados button[aria-pressed="true"] {
  border-color: var(--color-brand); background: var(--coral-50);
  color: var(--coral-800);
}

/* ------------------------------------------------------------------ mapa */

/* The map screen manages its own scrolling, so #app must not add another
   scroll container around a full-height canvas. */
#app.mapa-activo { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.mapa-cabecera { padding: var(--space-4) var(--space-4) var(--space-2); }
.mapa-cabecera h1 { margin: 0; }
.mapa-cabecera .sub { margin: 2px 0 0; }
.mapa-filtros {
  display: flex; gap: var(--space-2); padding: 0 var(--space-4) var(--space-3);
  overflow-x: auto; scrollbar-width: none; flex-shrink: 0;
}
.mapa-filtros::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--border-default); background: var(--surface-card);
  color: var(--text-secondary); border-radius: var(--radius-pill);
  padding: 9px var(--space-4); font-size: var(--text-sm); font-weight: 600;
  white-space: nowrap; min-height: 44px; cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
}
.chip:active { transform: scale(0.97); }
.chip.activo {
  background: var(--color-brand); border-color: var(--color-brand);
  color: var(--text-on-brand);
}

/* flex:1 with min-height:0 rather than a fixed height: Leaflet needs a sized
   container, and a percentage height inside a flex column collapses to zero. */
#mapa-lienzo { flex: 1; min-height: 320px; background: var(--surface-sunken); }

.mapa-leyenda {
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-1);
  font-size: var(--text-xs); color: var(--text-secondary);
  background: var(--surface-card); flex-shrink: 0;
}
.mapa-leyenda span { display: flex; align-items: center; gap: var(--space-2); }
.mapa-leyenda i { width: 10px; height: 10px; border-radius: 50%; }
.mapa-nota {
  margin: 0; padding: 0 var(--space-4) var(--space-3);
  font-size: var(--text-xs); color: var(--text-muted);
  background: var(--surface-card); flex-shrink: 0;
}

/* Numbered route pin. The number is the visiting order, which is the one thing
   a seller needs to read off the map at a glance. */
.pin-orden span {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; color: var(--cream);
  font-size: var(--text-xs); font-weight: 700; border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(35, 35, 35, .35);
}
.mapa-popup {
  font-size: var(--text-sm); line-height: var(--leading-normal); min-width: 190px;
}
.mapa-popup b { font-size: var(--text-base); font-weight: 600; }
.mapa-popup div { margin-top: 3px; }
.mapa-popup .ambar { color: #8A5A18; font-weight: 600; }
.mapa-popup .gris { color: var(--text-muted); }
.leaflet-container { font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}
