:root {
  color-scheme: dark;
  --bg: #08101c;
  --panel: #101827;
  --panel-2: #141f31;
  --border: #26344a;
  --text: #f3f6fb;
  --muted: #91a1b8;
  --accent: #67d4ff;
  --accent-strong: #23aee6;
  --good: #67e8a5;
  --danger: #ff7f8f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(35, 174, 230, 0.10), transparent 30rem),
    linear-gradient(180deg, #08101c 0%, #0b1320 100%);
  color: var(--text);
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 36px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 24px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.045em; }
h2 { font-size: 1rem; margin-bottom: 16px; }

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.subtitle, .muted, footer, small { color: var(--muted); }
.subtitle { margin-bottom: 0; }

.status {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(16, 24, 39, 0.82);
  font-size: 0.78rem;
}
.status.ready { color: var(--good); }
.status.failed { color: var(--danger); }

.card, .quote-card, .stat-card {
  background: rgba(16, 24, 39, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card { padding: 22px; }
.form-card { margin-bottom: 20px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label { display: grid; gap: 8px; font-weight: 700; font-size: 0.88rem; }
label small { font-weight: 500; line-height: 1.35; }

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0b1422;
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(35, 174, 230, .15);
}
input:disabled { opacity: .6; cursor: wait; }

button {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: .45; }
.primary { margin-top: 20px; width: 100%; background: var(--accent-strong); color: #04111a; }
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.secondary { background: #17263a; color: var(--text); border: 1px solid var(--border); }

.error {
  margin-top: 16px;
  color: #ffd8dd;
  background: rgba(255, 74, 98, .10);
  border: 1px solid rgba(255, 127, 143, .35);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .9rem;
}

.result { display: grid; gap: 16px; }
.quote-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(20, 31, 49, .98), rgba(13, 43, 61, .98));
}
.quote-value { font-size: clamp(2rem, 7vw, 3.8rem); line-height: 1; font-weight: 900; letter-spacing: -.04em; }
.quote-card .muted { margin: 8px 0 0; }

.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { padding: 18px; display: grid; gap: 6px; box-shadow: none; }
.stat-card span { color: var(--muted); font-size: .8rem; }
.stat-card strong { font-size: 1.28rem; }
.stat-card small { font-size: .74rem; }

.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pill { font-size: .7rem; color: var(--good); border: 1px solid rgba(103, 232, 165, .28); background: rgba(103,232,165,.06); border-radius: 999px; padding: 5px 9px; }

.breakdown { display: grid; gap: 0; }
.breakdown > div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid rgba(38,52,74,.7); }
.breakdown > div:last-child { border-bottom: 0; }
.breakdown span { color: var(--muted); }
.breakdown .subtotal { padding-top: 15px; color: var(--text); }
.breakdown .subtotal span { color: var(--text); font-weight: 800; }
.compact { margin-top: 16px; }

.route-list { margin: 0; padding-left: 26px; }
.route-list li { padding: 8px 4px; }
.route-list .leg { color: var(--muted); font-size: .8rem; margin-left: 7px; }

.operator-card summary { cursor: pointer; font-weight: 800; }
footer { margin-top: 22px; font-size: .76rem; line-height: 1.5; }
footer p { margin-bottom: 0; }

@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 980px); padding-top: 28px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .grid.two, .stats { grid-template-columns: 1fr; }
  .quote-card { align-items: stretch; flex-direction: column; }
  .quote-card .secondary { width: 100%; }
  .section-heading { align-items: flex-start; flex-direction: column; }
}

/* Searchable EVE system autocomplete */
.system-autocomplete {
  position: relative;
}

.system-suggestions {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 290px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b1422;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .42);
}

.system-suggestions[hidden] {
  display: none;
}

.system-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.system-option + .system-option {
  margin-top: 2px;
}

.system-option:hover,
.system-option.active {
  background: rgba(35, 174, 230, .14);
}

.system-option-name {
  min-width: 0;
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .015em;
}

.system-option-region {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
}

.system-no-results {
  padding: 10px 11px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
}

input.system-selected {
  border-color: rgba(103, 232, 165, .7);
  box-shadow: 0 0 0 3px rgba(103, 232, 165, .08);
}
