:root {
  --ink: #1f2320;
  --paper: #f4f1ea;
  --quiet: #3a8d7a;
  --loud: #c44e3e;
  --line: #ddd6c4;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
}
* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; overflow-x: hidden; }
body { font-family: "Space Grotesk", system-ui, sans-serif; color: var(--ink); background: var(--paper); }

.app { display: grid; grid-template-columns: 340px 1fr; height: 100vh; height: 100dvh; }
.panel { padding: 24px 20px; border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }

/* Por debajo de 700px (móviles) el panel de 340px casi no deja sitio para el
   mapa — la "franja verde" que se veía era el mapa aplastado a unos pocos
   píxeles de ancho, no un fallo del mapa en sí. En pantallas pequeñas
   apilamos: panel de búsqueda arriba (con scroll propio), mapa abajo con una
   altura fija y visible. */
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 45vh; height: auto; min-height: 100vh; min-height: 100dvh; }
  .panel { border-right: none; border-bottom: 1px solid var(--line); max-height: 55vh; }
  .map { min-height: 45vh; }
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--quiet), var(--loud), var(--quiet)); }
.brand h1 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
.tagline { margin: -8px 0 0; color: #5b5b52; font-size: 14px; }

.search { display: flex; flex-direction: column; gap: 12px; }
.search label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #5b5b52; }
.search input, .search select { font-family: "IBM Plex Mono", monospace; font-size: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; color: var(--ink); }
.input-with-button { display: flex; align-items: center; gap: 8px; }
.input-with-button input { flex: 1; }
.input-with-button button {
  width: 40px; height: 40px; padding: 0; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: white; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.input-with-button button:disabled { opacity: 0.5; cursor: default; }
.input-with-button button.active { background: var(--quiet); border-color: var(--quiet); }
.geocode-match { margin: -6px 0 0; font-size: 11px; color: #5b5b52; line-height: 1.3; }
.search button { margin-top: 4px; padding: 12px; border: none; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper); font-weight: 500; cursor: pointer; }
.secondary-button { background: white !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }

.favorites-section { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.favorites-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #5b5b52; }
.favorite-row { display: flex; align-items: center; gap: 8px; }
.favorite-load { flex: 1; text-align: left; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: white; cursor: pointer; font-size: 13px; }
.favorite-delete {
  width: 30px; height: 30px; padding: 0; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: white; cursor: pointer; color: var(--loud);
  display: flex; align-items: center; justify-content: center;
}

.status { font-size: 13px; min-height: 18px; }
.status.error { color: var(--loud); }

.route-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.route-list li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-lg); cursor: pointer; border: 1px solid transparent; }
.route-list li.active { background: white; border-color: var(--line); }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.route-meta { display: flex; flex-direction: column; gap: 2px; }
.route-meta strong { font-size: 13px; }
.stats { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: #5b5b52; }

.footnote { margin-top: auto; font-size: 11px; color: #8a8a7d; line-height: 1.4; }
.map { width: 100%; height: 100%; }

.report-section { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
#report-toggle { padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: white; cursor: pointer; font-family: "Space Grotesk", sans-serif; font-size: 13px; }
#report-toggle.active { background: var(--ink); color: var(--paper); }
.secondary-button.active { background: var(--quiet) !important; color: white !important; border-color: var(--quiet) !important; }
#track-location { border-radius: var(--radius-pill); padding: 10px 16px; }

.live-location-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--quiet); border: 3px solid white;
  box-shadow: 0 0 0 2px var(--quiet), 0 0 8px rgba(58, 141, 122, 0.6);
  animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 2px var(--quiet), 0 0 0 0 rgba(58, 141, 122, 0.5); }
  70% { box-shadow: 0 0 0 2px var(--quiet), 0 0 0 12px rgba(58, 141, 122, 0); }
  100% { box-shadow: 0 0 0 2px var(--quiet), 0 0 0 0 rgba(58, 141, 122, 0); }
}
.hint { font-size: 12px; color: #5b5b52; margin: 0; }

.report-form, .confirm-prompt, .recurring-prompt {
  display: flex; flex-direction: column; gap: 10px;
  background: white; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px;
  font-size: 13px;
}
.report-form select, .report-form input,
.recurring-prompt select { font-family: "IBM Plex Mono", monospace; font-size: 13px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.report-actions { display: flex; gap: 8px; justify-content: flex-end; }
.report-actions button { padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 12px; }
.report-actions button:last-child { background: var(--ink); color: var(--paper); border-color: var(--ink); }

#confirmation-prompts { display: flex; flex-direction: column; gap: 8px; }
.confirm-prompt { border-color: var(--loud); }

.privacy-link {
  margin-top: 8px; background: none; border: none; color: #5b5b52;
  font-size: 11px; text-decoration: underline; cursor: pointer; padding: 0;
  text-align: left; font-family: "Space Grotesk", sans-serif;
}

.privacy-modal-overlay {
  position: fixed; inset: 0; background: rgba(31, 35, 32, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
/* Sin esto, el atributo hidden del HTML no hace nada — la regla de arriba
   (display: flex) es CSS nuestro, y CSS nuestro siempre gana al estilo por
   defecto del navegador para [hidden], sea cual sea la especificidad. Por
   eso el botón "Entendido" marcaba el aviso como visto pero no lo ocultaba. */
.privacy-modal-overlay[hidden] {
  display: none;
}
.privacy-modal {
  background: var(--paper); border-radius: var(--radius-lg);
  padding: 24px; max-width: 520px; max-height: 82vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.privacy-modal h2 { margin: 0 0 16px; font-size: 18px; }
.privacy-modal h3 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: #5b5b52; }
.privacy-modal h3:first-of-type { margin-top: 0; }
.privacy-modal p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.privacy-modal ul { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.privacy-modal li { font-size: 13px; line-height: 1.5; }
.privacy-modal button {
  width: 100%; padding: 11px; border: none; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--paper); font-weight: 500; cursor: pointer;
}
