/* ── TOKENS ────────────────────────────────────────────────────────────── */
:root {
  --bg-base:       #07090f;
  --bg-surface:    #0d1120;
  --bg-elevated:   #111827;
  --border:        #1e2d4a;
  --border-light:  #243352;

  --amber:         #f59e0b;
  --amber-dim:     #78490a;
  --amber-glow:    rgba(245, 158, 11, 0.12);
  --cyan:          #22d3ee;
  --cyan-dim:      #0e5a68;

  --text-primary:  #e2e8f0;
  --text-secondary:#aab6c9;   /* +contraste para subtítulos y detalles */
  --text-muted:    #7c8aa3;   /* +contraste para hints y etiquetas pequeñas */

  --font-mono:     'Space Mono', monospace;
  --font-sans:     'DM Sans', sans-serif;

  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;
}

/* ── RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Fondo con textura sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(245,158,11,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(34,211,238,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1150px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.brand-icon {
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  animation: pulse-amber 3s ease-in-out infinite;
}

.brand-icon svg {
  width: 34px;
  height: 34px;
  display: block;
}

.brand-accent { color: var(--amber); }

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: blink 2s ease-in-out infinite;
}

/* ── HERO ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1150px;
  margin: 0 auto;
  padding: 34px 24px 22px;          /* más compacto de inicio */
  transition: padding 0.35s ease;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 10px;
  transition: opacity 0.3s ease, margin 0.3s ease;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);   /* más contenido */
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
  transition: font-size 0.35s ease, margin 0.35s ease;
}

.hero-subtitle {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.6;
  transition: opacity 0.3s ease, max-height 0.35s ease;
}

/* ── HERO COLAPSADO (tras la primera búsqueda) ──────────────────────────── */
body.searched .hero {
  padding-top: 16px;
  padding-bottom: 6px;
}
body.searched .hero-label {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}
body.searched .hero-title {
  font-size: 1.15rem;
  margin-bottom: 0;
}
body.searched .hero-title br { display: none; }   /* en una sola línea */
body.searched .hero-subtitle {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
}

/* ── MAIN CONTENT ──────────────────────────────────────────────────────── */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── SEARCH CARD ───────────────────────────────────────────────────────── */
.search-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
  position: relative;
}

/* Línea decorativa superior */
.search-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0.5;
}

/* ── SEARCH FIELDS ─────────────────────────────────────────────────────── */
.search-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 100px;
}

.field-group--date { flex: 1.5; }

.route-arrow {
  font-family: var(--font-mono);
  color: var(--amber);
  font-size: 20px;
  padding-bottom: 26px;
  user-select: none;
  flex-shrink: 0;
}

.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

.field-input {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 10px 14px;
  text-transform: uppercase;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}

.field-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.field-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

/* Estilo especial para el input de fecha */
input[type="date"].field-input {
  font-size: 15px;
  color-scheme: dark;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── MODE TOGGLE ───────────────────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  transition: all 0.2s;
  text-align: left;
}

.mode-btn-icon {
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}

.mode-btn-sub {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  display: block;
}

.mode-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.mode-btn--active {
  border-color: var(--amber);
  background: var(--amber-glow);
  color: var(--amber);
}

.mode-btn--active .mode-btn-sub {
  color: rgba(245,158,11,0.6);
}

/* ── WEIGHTS PANEL ─────────────────────────────────────────────────────── */
.weights-panel {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  display: none; /* controlado por JS */
}

.weights-panel.visible { display: block; }

.weights-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.weights-note {
  color: var(--amber);
  font-size: 10px;
}

.sliders { display: flex; flex-direction: column; gap: 14px; }

.slider-row { display: flex; flex-direction: column; gap: 6px; }

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.slider-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
  box-shadow: 0 0 8px var(--amber-glow);
  transition: box-shadow 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(245,158,11,0.4);
}

.weights-sum {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 14px;
  text-align: right;
}

.weights-sum.ok { color: #22c55e; }
.weights-sum.error { color: #ef4444; }

/* ── SEARCH BUTTON ─────────────────────────────────────────────────────── */
.search-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--amber);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 14px 24px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.search-btn:hover {
  background: #fbbf24;
  box-shadow: 0 4px 20px rgba(245,158,11,0.35);
  transform: translateY(-1px);
}

.search-btn:active { transform: translateY(0); }

.search-btn:disabled {
  background: var(--amber-dim);
  color: #000;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-arrow {
  font-size: 16px;
  transition: transform 0.2s;
}

.search-btn:hover .btn-arrow { transform: translateX(3px); }

/* ── FORM ERROR ────────────────────────────────────────────────────────── */
.form-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 10px;
  font-family: var(--font-mono);
  min-height: 16px;
}

/* ── STATES ────────────────────────────────────────────────────────────── */
.state-loading,
.state-error,
.state-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.state-loading.visible,
.state-error.visible,
.state-empty.visible { display: flex; }

.state-icon {
  font-size: 28px;
  color: var(--text-muted);
}

.state-error button {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  transition: border-color 0.2s, color 0.2s;
}

.state-error button:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* ── LOADING RING ──────────────────────────────────────────────────────── */
.loading-ring {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── RESULTS ───────────────────────────────────────────────────────────── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.results-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.results-mode {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--amber);
  background: var(--amber-glow);
  border: 1px solid var(--amber-dim);
  border-radius: 20px;
  padding: 4px 10px;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── OFFER CARD ────────────────────────────────────────────────────────── */
.offer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  transition: border-color 0.2s, transform 0.2s;
  animation: slide-in 0.3s ease both;
  cursor: default;
}

.offer-card:nth-child(1) { animation-delay: 0.05s; }
.offer-card:nth-child(2) { animation-delay: 0.10s; }
.offer-card:nth-child(3) { animation-delay: 0.15s; }

.offer-card:hover {
  border-color: var(--border-light);
  transform: translateX(3px);
}

.offer-card--top {
  border-color: var(--amber-dim);
  background: linear-gradient(135deg, rgba(245,158,11,0.05) 0%, var(--bg-surface) 60%);
}

.offer-card--top:hover { border-color: var(--amber); }

/* Rank badge */
.offer-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 44px;
}

.rank-number {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}

.offer-card--top .rank-number { color: var(--amber); }

.rank-score {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.offer-card--top .rank-score { color: rgba(245,158,11,0.7); }

/* Center info */
.offer-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.offer-airline {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offer-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 300;
}

.meta-icon {
  font-size: 11px;
  color: var(--text-muted);
}

.offer-verdict {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 3px;
  width: fit-content;
}

.verdict--best {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.2);
}

.verdict--good {
  background: rgba(245,158,11,0.1);
  color: var(--amber);
  border: 1px solid var(--amber-dim);
}

.verdict--ok {
  background: rgba(148,163,184,0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Right: price */
.offer-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.offer-price {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  white-space: nowrap;
}

.offer-currency {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── FOOTER ────────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.site-footer code {
  color: var(--cyan);
  background: rgba(34,211,238,0.08);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(34,211,238,0.15);
}

/* ── ANIMATIONS ────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes pulse-amber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .search-fields { flex-direction: column; }
  .route-arrow { transform: rotate(90deg); padding: 0; align-self: center; }
  .offer-card { grid-template-columns: auto 1fr; grid-template-rows: auto auto; }
  .offer-price-col { grid-column: 2; align-items: flex-start; }
  .hero-title { font-size: 1.8rem; }
  .mode-toggle { flex-direction: column; }
}

/* ── CITY INPUT (v0.3) ─────────────────────────────────────────────────────── */
/* Variante para nombres de ciudad: sin mayúsculas forzadas, menos espaciado */
.field-input--city {
  text-transform: none;
  font-size: 16px;
  letter-spacing: 0.01em;
  font-weight: 400;
  font-family: var(--font-sans);
}

.field-input--city::placeholder {
  text-transform: none;
  font-style: italic;
}

/* ── ROUND-TRIP TOGGLE (v0.3) ──────────────────────────────────────────────── */
.roundtrip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 16px;
  background: none;
  border: none;
  user-select: none;
}

.roundtrip-toggle:hover .roundtrip-box { border-color: var(--amber); }

/* Ocultamos el checkbox nativo */
.roundtrip-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.roundtrip-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}

.roundtrip-box::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #000;
  opacity: 0;
  transition: opacity 0.15s;
}

.roundtrip-toggle input:checked ~ .roundtrip-box {
  background: var(--amber);
  border-color: var(--amber);
}

.roundtrip-toggle input:checked ~ .roundtrip-box::after { opacity: 1; }

.roundtrip-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.roundtrip-sub { display: none; }   /* línea secundaria ocultada para compactar */

/* ── LEGS EN LA CARD (v0.3) ────────────────────────────────────────────────── */
.offer-legs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.leg-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  min-width: 48px;
  text-align: center;
}

.leg-tag--out {
  background: rgba(34,211,238,0.1);
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
}

.leg-tag--ret {
  background: rgba(245,158,11,0.1);
  color: var(--amber);
  border: 1px solid var(--amber-dim);
}

.leg-detail {
  display: flex;
  gap: 12px;
  color: var(--text-secondary);
  font-weight: 300;
}

/* ── PER-LEG SCORES (v0.4) ─────────────────────────────────────────────────── */
.leg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.leg-detail { flex: 1; }

.leg-score {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 52px;
  text-align: right;
}

.leg-score small {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}

.leg-score--high { color: #4ade80; }
.leg-score--mid  { color: var(--amber); }
.leg-score--low  { color: #ef4444; }

/* Reemplaza el antiguo rank-score por una etiqueta de posición */
.rank-pos {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Footer de la card: veredicto + score global discreto */
.offer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.offer-global {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  cursor: help;
}

/* ── AUTOCOMPLETE DROPDOWN (v0.4) ──────────────────────────────────────────── */
.ac-wrap {
  position: relative;
}

.ac-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: none;            /* JS lo muestra cuando hay resultados */
}

.ac-list.visible { display: block; }

.ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}

.ac-item:hover,
.ac-item.active {
  background: var(--amber-glow);
}

.ac-item-label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 400;
}

.ac-item.active .ac-item-label { color: var(--amber); }

.ac-item-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 7px;
  flex-shrink: 0;
}

/* ── OPTIONS ROW & PRIORITY CHOOSER (v0.4) ─────────────────────────────────── */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 16px;
}

.options-row .roundtrip-toggle { margin-bottom: 0; }

.priority-group {
  display: flex;
  gap: 8px;
}

.priority-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 11px 14px;
  transition: all 0.18s;
  text-align: left;
}

.priority-icon { font-size: 15px; margin-bottom: 3px; }

.priority-name {
  font-size: 13px;
  font-weight: 500;
}

.priority-sub {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
}

.priority-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.priority-btn--active {
  border-color: var(--amber);
  background: var(--amber-glow);
  color: var(--amber);
}

.priority-btn--active .priority-sub { color: rgba(245, 158, 11, 0.6); }

@media (max-width: 600px) {
  .priority-group { flex-direction: column; }
}

/* ── HORARIO EN EL TRAMO (v0.4) ────────────────────────────────────────────── */
.leg-detail {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.leg-time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.leg-time sup {
  font-size: 9px;
  color: var(--amber);
  font-weight: 700;
  margin-left: 1px;
}

.leg-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ── AVISO SOBRE RESULTADOS (v0.4) ─────────────────────────────────────────── */
.results-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid var(--cyan-dim);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.results-notice-icon {
  color: var(--cyan);
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── FILTROS CUSTOM: CLASE + RANGOS (v0.5) ─────────────────────────────────── */
.class-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.class-btn {
  flex: 1;
  min-width: 80px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px;
  transition: all 0.18s;
}

.class-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.class-btn--active {
  border-color: var(--amber);
  background: var(--amber-glow);
  color: var(--amber);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-input {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.range-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.range-input::placeholder { color: var(--text-muted); }

.range-sep {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── INTERRUPTOR "PERSONALIZAR" (v0.5) ─────────────────────────────────────── */
.customize-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  user-select: none;
  transition: border-color 0.2s;
}

.customize-toggle:hover { border-color: var(--border-light); }

.customize-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.customize-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}

.customize-box::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #000;
  opacity: 0;
  transition: opacity 0.15s;
}

.customize-toggle input:checked ~ .customize-box {
  background: var(--amber);
  border-color: var(--amber);
}

.customize-toggle input:checked ~ .customize-box::after { opacity: 1; }

.customize-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.customize-sub {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
}

/* Indicador a la derecha: muestra el modo activo de forma discreta */
.customize-hint {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.04em;
}

/* ── REJILLA DE FILTROS HORIZONTAL (v0.5) ──────────────────────────────────── */
.filters-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.filter-block { flex: 1; min-width: 200px; }

.filter-block--narrow { flex: 0 1 200px; }

@media (max-width: 720px) {
  .filters-grid { flex-direction: column; gap: 16px; }
  .filter-block, .filter-block--narrow { width: 100%; min-width: 0; }
}

/* ── ENLACES LEGALES EN EL FOOTER (v0.6) ───────────────────────────────────── */
.footer-legal {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.footer-legal a:hover { color: var(--amber); }