
:root {
  color-scheme: dark;
  --ink: #f5f7ff;
  --muted: #b9c7dc;
  --line: rgba(126, 159, 255, 0.33);
  --glass: rgba(10, 18, 43, 0.79);
  --glass-strong: rgba(12, 22, 53, 0.93);
  --violet: #8c56ff;
  --blue: #4db6ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 20%, rgba(40, 184, 255, 0.15), transparent 34%),
    radial-gradient(circle at 68% 78%, rgba(122, 61, 255, 0.24), transparent 40%),
    #020611;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.map-shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 74px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.topbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(75, 118, 255, 0.16), transparent 40%),
    rgba(5, 12, 31, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(87, 206, 255, 0.28), rgba(123, 61, 255, 0.38));
  border: 1px solid rgba(140, 187, 255, 0.48);
  box-shadow: 0 0 28px rgba(100, 93, 255, 0.28);
  font-size: 28px;
}

.eyebrow {
  color: #8fdcff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: min(55vw, 760px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 25px;
  line-height: 1.06;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.glass-button,
.icon-button {
  border: 1px solid rgba(135, 169, 255, 0.42);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(120, 142, 255, 0.24), rgba(66, 56, 139, 0.28)),
    rgba(13, 24, 58, 0.84);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.glass-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 850;
}

.glass-button.primary {
  background:
    linear-gradient(180deg, rgba(139, 89, 255, 0.58), rgba(74, 43, 161, 0.68)),
    rgba(13, 24, 58, 0.9);
}

.glass-button:disabled {
  opacity: 0.48;
  cursor: default;
}

.map-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(106, 150, 255, 0.42);
  border-radius: 24px;
  background: #101827;
  box-shadow: var(--shadow);
}

.map {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(62, 122, 205, 0.25), transparent 34%),
    #111a2a;
}

.status-card,
.waiting-card,
.route-card {
  position: absolute;
  border: 1px solid rgba(130, 167, 255, 0.42);
  background:
    linear-gradient(145deg, rgba(54, 125, 196, 0.18), transparent 35%),
    var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.status-card {
  left: 50%;
  top: 50%;
  z-index: 10;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: min(420px, calc(100% - 36px));
  padding: 18px 20px;
  border-radius: 18px;
}

.status-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

#status-copy {
  color: var(--muted);
  font-size: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.route-card {
  top: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 8;
  width: min(430px, calc(100% - 28px));
  padding: 18px;
  border-radius: 20px;
  overflow: auto;
}

.route-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.route-heading h2 {
  margin-top: 5px;
  font-size: 24px;
  line-height: 1.08;
}

.route-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  font-size: 25px;
}

.route-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.metric {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid rgba(122, 163, 255, 0.25);
  border-radius: 15px;
  background: rgba(4, 13, 34, 0.62);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.route-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 199, 92, 0.38);
  border-radius: 13px;
  background: rgba(104, 70, 11, 0.42);
  color: #ffe6ac;
  font-size: 13px;
}

.steps-title {
  margin-top: 18px;
  color: #d6e8ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-steps {
  margin: 10px 0 0;
  padding: 0 0 4px 24px;
}

.route-steps li {
  margin: 0 0 10px;
  padding-left: 4px;
  color: #edf5ff;
  font-size: 14px;
  line-height: 1.35;
}

.waiting-card {
  left: 20px;
  bottom: 20px;
  z-index: 7;
  max-width: 360px;
  padding: 18px 20px;
  border-radius: 18px;
}

.waiting-icon {
  margin-bottom: 8px;
  color: #8ddcff;
  font-size: 30px;
}

.waiting-card h2 {
  font-size: 22px;
}

.waiting-card p {
  margin-top: 6px;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .map-shell {
    grid-template-rows: auto minmax(0, 1fr);
    padding: 6px;
    gap: 6px;
  }

  .topbar {
    align-items: flex-start;
    border-radius: 18px;
  }

  .brand-mark,
  #locate-button {
    display: none;
  }

  h1 {
    max-width: 40vw;
    font-size: 18px;
  }

  .glass-button {
    min-height: 40px;
    padding: 0 11px;
    font-size: 12px;
  }

  .route-card {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: 48%;
  }
}
