/* FareScope overrides on top of Tailwind CDN — instrument-cluster dark theme.
   Tokens: ink #0a0e14 · panel #121821 · panel2 #0e141c · line #1f2a37 · txt #e6eaf0
           muted #8b97a7 · green #34d399 · amber #fbbf24 · crimson #f43f5e · indigo #818cf8
   Fonts: Archivo (display) · Spline Sans Mono (mono). */

/* ---- global native-app feel ---- */
html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
/* chrome isn't text-selectable; prices/codes are (long-press copy) */
header, .chip, .btn-primary, .btn-ghost, .badge, .seg-toggle, .example-chip, .deeplink {
  -webkit-user-select: none; user-select: none;
}
.font-mono, .price, .code { -webkit-user-select: text; user-select: text; }

/* ---- safe-area (iOS notch / home indicator) ---- */
.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: calc(env(safe-area-inset-bottom) + 1.25rem); }
.safe-x { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }

/* ---- inputs ---- */
.fld {
  width: 100%;
  margin-top: 4px;
  background: #0e141c;
  border: 1px solid #1f2a37;
  border-radius: 8px;
  padding: 10px 11px;
  color: #e6eaf0;
  font-family: "Spline Sans Mono", monospace;
  font-size: 14px;
  outline: none;
  min-height: 44px;
}
.fld:focus { border-color: #34d399; box-shadow: 0 0 0 1px #34d39933; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }

/* ---- buttons ---- */
.btn-primary {
  background: #34d399; color: #06210f; font-weight: 600; border-radius: 9px;
  padding: 12px 14px; font-size: 14px; min-height: 44px;
  transition: filter 0.15s, transform 0.08s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: #0e141c; color: #e6eaf0; border: 1px solid #1f2a37; border-radius: 9px;
  padding: 12px 14px; font-size: 14px; min-height: 44px;
  transition: border-color 0.15s, transform 0.08s;
}
.btn-ghost:hover { border-color: #818cf8; }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost.on { border-color: #818cf8; color: #818cf8; }

/* ---- chips ---- */
.chip {
  border: 1px solid #1f2a37; border-radius: 999px; padding: 7px 12px; font-size: 12px;
  font-family: "Spline Sans Mono", monospace; color: #8b97a7; cursor: pointer;
  min-height: 36px; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chip.on { border-color: #818cf8; color: #c7ccf8; background: #818cf81a; }

/* ---- caveats ---- */
.caveat { border: 1px solid #1f2a37; border-radius: 8px; padding: 4px 9px; color: #8b97a7; background: #0e141c; }
.caveat.warn { border-color: #fbbf2440; color: #fbbf24; }
.caveat-strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid #1f2a37; border-radius: 8px; padding: 7px 11px;
  font-size: 11px; color: #8b97a7; background: #0e141c;
}
.caveat-strip.warn { border-color: #fbbf2440; color: #fbbf24; }
.caveat-strip button { color: #818cf8; }

/* ---- deeplinks ---- */
.deeplink {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid #1f2a37;
  border-radius: 8px; padding: 8px 11px; font-size: 13px; color: #e6eaf0;
  text-decoration: none; min-height: 40px; transition: border-color 0.15s;
}
.deeplink:hover { border-color: #34d399; }
.deeplink.amber:hover { border-color: #fbbf24; }
.deeplink.indigo:hover { border-color: #818cf8; }

/* ---- combobox / autocomplete ---- */
.combo { position: relative; }
.combo-sub { display: block; margin-top: 3px; font-size: 11px; color: #8b97a7; min-height: 14px; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: #0e141c; border: 1px solid #1f2a37; border-radius: 8px;
  max-height: 40vh; overflow-y: auto; box-shadow: 0 10px 28px #00000080;
}
.combo-list.up { top: auto; bottom: calc(100% + 4px); }
.combo-opt {
  display: flex; align-items: center; gap: 8px; padding: 10px 11px; cursor: pointer;
  min-height: 44px; border-left: 2px solid transparent;
}
.combo-opt:hover, .combo-opt.active { background: #818cf81a; border-left-color: #818cf8; }
.combo-opt .lbl { color: #e6eaf0; font-size: 13px; }
.combo-opt .sub { color: #8b97a7; font-size: 11px; }
.combo-opt .code { margin-left: auto; color: #8b97a7; font-family: "Spline Sans Mono", monospace; font-size: 12px; }
.combo-opt .ic { width: 18px; text-align: center; }
.combo-opt mark { color: #34d399; background: transparent; font-weight: 600; }
.combo-opt.special .lbl { color: #818cf8; }

/* ---- cost tag + quota meter (free-search clarity) ---- */
.cost-tag {
  font-family: "Spline Sans Mono", monospace; font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 999px; border: 1px solid #1f2a37; margin-left: 6px;
}
.cost-tag.free { color: #34d399; border-color: #34d39955; background: #34d39912; }
.cost-tag.spend { color: #fbbf24; border-color: #fbbf2455; background: #fbbf2412; }
.quota-meter { display: inline-flex; align-items: center; gap: 6px; }
.quota-bar { width: 46px; height: 5px; border-radius: 999px; background: #1f2a37; overflow: hidden; }
.quota-bar > i { display: block; height: 100%; background: #34d399; transition: width 0.3s; }
.quota-bar.warn > i { background: #fbbf24; }
.quota-bar.hot > i { background: #f43f5e; }

/* ---- badges ---- */
.badge {
  font-family: "Spline Sans Mono", monospace; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 6px; border-radius: 6px; border: 1px solid;
}
.badge-green { color: #34d399; border-color: #34d39955; background: #34d39912; }
.badge-amber { color: #fbbf24; border-color: #fbbf2455; background: #fbbf2412; }
.badge-indigo { color: #818cf8; border-color: #818cf855; background: #818cf812; }
.badge-crimson { color: #f43f5e; border-color: #f43f5e55; background: #f43f5e12; }

/* ---- result card ---- */
.result-card { background: #121821; border: 1px solid #1f2a37; border-radius: 12px; padding: 16px; }
.result-card.top { box-shadow: 0 0 0 1px #34d39966; }
.result-card:hover { border-color: #2a3a4d; }
.route-dot { color: #8b97a7; }
.route-dot b { color: #e6eaf0; }
.price { font-family: "Spline Sans Mono", monospace; }
.verdict { font-family: "Spline Sans Mono", monospace; font-size: 10px; padding: 1px 6px; border-radius: 999px; }
.verdict.good { color: #34d399; border: 1px solid #34d39955; }

/* ---- summary / sort bar ---- */
.summary-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #121821; border: 1px solid #1f2a37; border-radius: 12px; padding: 10px 13px;
}
.seg-toggle { display: inline-flex; border: 1px solid #1f2a37; border-radius: 8px; overflow: hidden; }
.seg-toggle button {
  padding: 6px 10px; font-size: 11px; color: #8b97a7; min-height: 36px; background: transparent;
}
.seg-toggle button.on { background: #818cf81a; color: #c7ccf8; }

/* ---- hero / empty state ---- */
.hero { background: #121821; border: 1px solid #1f2a37; border-radius: 14px; padding: 20px; }
.hero-tiles { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .hero-tiles { grid-template-columns: 1fr 1fr; } }
.hero-tile { border: 1px solid #1f2a37; border-radius: 10px; padding: 12px; background: #0e141c; }
.hero-tile .t { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.example-chip {
  border: 1px solid #1f2a37; border-radius: 999px; padding: 8px 13px; font-size: 13px;
  font-family: "Spline Sans Mono", monospace; color: #c7ccf8; background: #818cf812;
  cursor: pointer; min-height: 40px; display: inline-flex; align-items: center;
}
.example-chip:hover { border-color: #818cf8; }

/* ---- state panels (empty / zero / error / quota) ---- */
.state-panel { text-align: center; padding: 28px 16px; color: #8b97a7; }
.state-panel .ic { font-size: 26px; }
.state-panel .hd { color: #e6eaf0; font-weight: 600; margin-top: 6px; }
.state-banner {
  border: 1px solid #fbbf2440; color: #fbbf24; background: #fbbf240d;
  border-radius: 8px; padding: 8px 11px; font-size: 12px;
}

/* ---- destinations grid (anywhere) ---- */
.dest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .dest-grid { grid-template-columns: 1fr 1fr 1fr; } }
.dest-card {
  border: 1px solid #1f2a37; border-radius: 10px; padding: 12px; background: #121821; cursor: pointer;
  transition: border-color 0.15s;
}
.dest-card:hover { border-color: #34d399; }

/* ---- saved cards ---- */
.saved-card {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid #1f2a37;
  border-radius: 999px; padding: 6px 6px 6px 12px; font-size: 12px;
  font-family: "Spline Sans Mono", monospace; color: #8b97a7;
}
.saved-card .go { cursor: pointer; color: #c7ccf8; }
.saved-card .x, .saved-card .pin { cursor: pointer; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.saved-card .x:hover { color: #f43f5e; }
.saved-card .pin.on { color: #fbbf24; }

/* ---- skeletons + reveal ---- */
.skel-card { background: #121821; border: 1px solid #1f2a37; border-radius: 12px; padding: 16px; }
.skel { background: #1a2433; border-radius: 6px; }
.dot-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: #34d399; }

@media (prefers-reduced-motion: no-preference) {
  .skel {
    background: linear-gradient(90deg, #121821, #1f2a37, #121821);
    background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite;
  }
  @keyframes skel { to { background-position: -200% 0; } }
  .result-card, .dest-card { animation: rise 0.28s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .dot-pulse { animation: pulse 1s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.3; } }
  #settings .drawer { transition: transform 0.28s ease; }
}

/* ---- settings drawer slide ---- */
#settings .drawer { transform: translateX(100%); }
#settings:not(.hidden) .drawer { transform: translateX(0); }
