:root {
  --sky-top: #1a1233;
  --sky-mid: #c45a2a;
  --sky-end: #1b1220;
  --card: rgba(255, 246, 232, 0.7);
  --ink: #2a1a12;
  --muted: #7a5340;
  --line: rgba(90, 40, 16, 0.14);
  --accent: #d4531a;
  --accent-2: #f0b15a;
  --danger: #c43c2a;
  --gold: #e8c27a;
  --sans: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  height: 100dvh;
}

body {
  font-family: var(--sans);
  background: #140e18;
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

.gate {
  height: 100dvh;
  max-height: 100dvh;
  position: relative;
  overflow: hidden;
  background: #0b0810;
}

.hero {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero picture,
.hero-shot {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-shot {
  object-fit: cover;
  object-position: 50% 72%;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% 18%, rgba(255, 170, 70, 0.16) 0%, transparent 42%),
    linear-gradient(180deg, rgba(8, 6, 14, 0.18) 0%, transparent 28%, rgba(8, 6, 14, 0.22) 58%, rgba(8, 6, 14, 0.78) 100%);
  pointer-events: none;
}

.hero-copy {
  position: absolute;
  z-index: 2;
  left: max(20px, var(--safe-left));
  right: max(20px, var(--safe-right));
  top: max(22px, calc(14px + var(--safe-top)));
  color: #fff6e8;
  pointer-events: none;
}

.hero-copy .eyebrow {
  color: #f3c27a;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hero-copy h1 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 0.98;
  font-size: clamp(34px, 7.4vw, 58px);
  color: #fff8ee;
  text-shadow: 0 10px 34px rgba(6, 3, 10, 0.55);
}

.hero-copy .lede {
  max-width: 28ch;
  color: rgba(255, 244, 226, 0.86);
  font-size: 14px;
  margin: 8px 0 0;
  text-shadow: 0 4px 16px rgba(6, 3, 10, 0.5);
}

.login-card {
  position: absolute;
  z-index: 2;
  left: max(14px, var(--safe-left));
  right: max(14px, var(--safe-right));
  bottom: max(20px, calc(18px + var(--safe-bottom)));
  width: auto;
  max-height: calc(100dvh - 176px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(12px, 1.8dvh, 16px) 16px 12px;
  background: var(--card);
  border: 1px solid rgba(255, 232, 196, 0.42);
  border-radius: 22px;
  box-shadow:
    0 18px 50px rgba(6, 3, 10, 0.42),
    0 0 0 1px rgba(255, 210, 140, 0.08) inset;
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.anon-stamp {
  position: absolute;
  top: max(18px, calc(12px + var(--safe-top)));
  right: max(16px, var(--safe-right));
  z-index: 3;
  color: #f3c27a;
  font: 700 10px/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(243, 194, 122, 0.4);
  background: rgba(10, 7, 14, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.trip-bar strong {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.lede {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: clamp(8px, 1.6dvh, 14px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

.field > span {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field > input,
.suggest button {
  width: 100%;
  border: 1px solid rgba(90, 40, 16, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: 500 16px/1.4 var(--sans);
  padding: 11px 12px;
  outline: none;
  border-radius: 12px;
}

.field > input:focus {
  border-color: rgba(212, 83, 26, 0.45);
  box-shadow: 0 0 0 3px rgba(240, 177, 90, 0.22);
}

.login-card .field + .field,
.sheet .field + .field,
.sheet .pair + .field {
  margin-top: clamp(8px, 1.5dvh, 14px);
}

.form-error,
.trip-status {
  color: var(--danger);
  font-size: 13px;
  margin: 12px 0 0;
}

.trip-status {
  color: var(--muted);
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(240, 177, 90, 0.12);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: clamp(8px, 1.6dvh, 14px) 0 0;
}

.check input {
  accent-color: var(--accent);
}

.sign-in,
.chip,
.ghost {
  border: 0;
  cursor: pointer;
  font-family: var(--sans);
}

.sign-in {
  width: 100%;
  height: clamp(44px, 6.2dvh, 50px);
  margin-top: clamp(10px, 1.8dvh, 16px);
  border-radius: 999px;
  background: linear-gradient(180deg, #f08a3a 0%, #d4531a 100%);
  color: #fff8ee;
  font: 700 16px var(--sans);
  box-shadow: 0 10px 22px rgba(212, 83, 26, 0.32);
}

.sign-in:active {
  filter: brightness(0.96);
}

.sign-in:disabled {
  opacity: 0.45;
  cursor: default;
}

.fine-link {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 13px var(--sans);
  cursor: pointer;
}

.fine-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.fine-row .fine-link {
  width: auto;
  margin-top: 0;
}

.trip {
  position: relative;
  height: 100dvh;
  background: #1a1220;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(90% 70% at 58% 42%, transparent 36%, rgba(16, 8, 14, 0.34) 100%),
    linear-gradient(180deg, rgba(18, 10, 16, 0.18) 0%, transparent 22%, transparent 68%, rgba(18, 10, 16, 0.2) 100%);
}

.trip-bar,
.sheet {
  background: var(--card);
  border: 1px solid rgba(255, 232, 196, 0.42);
  box-shadow:
    0 16px 40px rgba(8, 4, 10, 0.28),
    0 0 0 1px rgba(255, 210, 140, 0.08) inset;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.trip-bar {
  position: absolute;
  top: calc(12px + var(--safe-top));
  left: max(12px, var(--safe-left));
  right: max(12px, var(--safe-right));
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  border-radius: 24px;
}

.trip-bar strong {
  display: block;
  font-size: 22px;
  color: var(--ink);
}

.who {
  margin-top: 2px;
  color: var(--muted);
  font: 500 12px var(--sans);
}

.trip-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trip-stamp {
  color: #c8963a;
  font: 700 10px/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(243, 194, 122, 0.4);
}

.ghost {
  background: transparent;
  color: var(--accent);
  font: 600 13px var(--sans);
  padding: 8px 10px;
}

.ghost.wide {
  width: 100%;
  margin-top: 10px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.sheet {
  position: absolute;
  left: max(12px, var(--safe-left));
  right: max(12px, var(--safe-right));
  bottom: calc(12px + var(--safe-bottom));
  z-index: 4;
  max-height: min(42vh, 380px);
  overflow: auto;
  padding: 10px 16px 14px;
  border-radius: 24px;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 2px auto 10px;
  border-radius: 999px;
  background: rgba(184, 134, 46, 0.35);
}

.sheet-kicker {
  color: var(--accent);
  font: 700 11px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.journey {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: stretch;
}

.journey-rail {
  margin: 18px 0 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #f0b15a 0%, #d4531a 100%);
  box-shadow: 0 0 12px rgba(240, 177, 90, 0.45);
}

.journey-fields .field.compact + .field.compact,
.journey-fields .pair + .field {
  margin-top: 12px;
}

.map-fab {
  position: absolute;
  right: max(14px, var(--safe-right));
  bottom: calc(min(42vh, 380px) + 28px);
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(243, 194, 122, 0.45);
  border-radius: 50%;
  background: rgba(255, 246, 232, 0.88);
  box-shadow: 0 10px 24px rgba(8, 4, 10, 0.28);
  cursor: pointer;
}

.map-fab-dot {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
  border-radius: 50%;
  background: #d4531a;
  box-shadow: 0 0 0 6px rgba(240, 177, 90, 0.28);
}

.trip.following .map-fab {
  border-color: rgba(212, 83, 26, 0.55);
  box-shadow: 0 0 0 4px rgba(240, 177, 90, 0.28), 0 10px 24px rgba(8, 4, 10, 0.28);
}

.car-mark {
  width: 40px;
  height: 40px;
}

.car-mark svg {
  display: block;
  width: 40px;
  height: 40px;
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(240, 177, 90, 0.9)) drop-shadow(0 3px 6px rgba(20, 8, 6, 0.45));
}

.pair {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.chip {
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(240, 177, 90, 0.22);
  color: var(--ink);
  font: 600 12px var(--sans);
}

.chip.wide {
  width: 100%;
  margin-top: 10px;
}

.slider {
  display: grid;
  gap: 6px;
  margin: 16px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.slider strong {
  color: var(--accent);
}

.slider input {
  width: 100%;
  accent-color: var(--accent);
}

.suggest {
  list-style: none;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.suggest button {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.suggest button:hover {
  background: #fff1dc;
}

.stops {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.stop {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font: 500 13px var(--sans);
  color: var(--ink);
}

.stop b {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #f0b15a;
  box-shadow: 0 0 10px rgba(240, 177, 90, 0.7);
}

.stop.on {
  border-color: var(--accent);
  background: rgba(255, 241, 220, 0.9);
}

.stop.on b {
  background: #2f6f4e;
  box-shadow: 0 0 10px rgba(47, 111, 78, 0.45);
}

#rebuild {
  margin-top: 12px;
}

.itinerary {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 2px 0 12px;
}

.itinerary li {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.itinerary small {
  color: var(--accent);
  font: 700 10px/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.itinerary span {
  font: 600 15px/1.2 var(--serif);
  color: var(--ink);
}

.itinerary .now {
  border-color: var(--accent);
  background: rgba(255, 241, 220, 0.95);
  box-shadow: 0 0 18px rgba(240, 177, 90, 0.28);
}

.itinerary .done {
  opacity: 0.45;
}

.itinerary .done span {
  text-decoration: line-through;
}

.stop small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.leaflet-container {
  font-family: var(--sans);
  background: #1a1220;
}

.leaflet-tile-pane {
  filter: sepia(0.32) saturate(1.18) contrast(1.1) brightness(0.9);
}

.leaflet-top.leaflet-right {
  top: 86px;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  color: var(--ink) !important;
  background: rgba(255, 246, 232, 0.9) !important;
  border: 0 !important;
}

.leaflet-bar {
  border: 1px solid rgba(243, 194, 122, 0.35) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 22px rgba(8, 4, 10, 0.28) !important;
  overflow: hidden;
}

.leaflet-control-attribution {
  background: rgba(255, 246, 232, 0.62) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #fff6e8;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(8, 4, 10, 0.28);
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.map-pin {
  position: relative;
  width: 28px;
  height: 38px;
  margin-left: -14px;
  margin-top: -38px;
}

.map-pin i {
  display: block;
  position: relative;
  width: 22px;
  height: 22px;
  margin: 2px auto 0;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(160deg, #f6c56a 0%, #d4531a 72%);
  box-shadow: 0 0 16px rgba(240, 177, 90, 0.78), 0 6px 12px rgba(40, 12, 8, 0.35);
}

.map-pin i::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 248, 232, 0.85);
}

.map-pin.end span {
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  z-index: 1;
  color: #fff8ee;
  font: 700 10px/1 var(--sans);
  text-align: center;
  text-shadow: 0 1px 2px rgba(40, 12, 8, 0.45);
}

.map-pin.picked i {
  background: linear-gradient(160deg, #8ed4ad 0%, #2f6f4e 72%);
  box-shadow: 0 0 14px rgba(80, 170, 120, 0.55);
}

@media (max-width: 800px) {
  .hero-shot {
    object-position: 50% 78%;
  }

  .hero-copy {
    padding-right: 86px;
  }

  .hero-copy h1 {
    font-size: clamp(32px, 9vw, 42px);
  }

  .check {
    display: none;
  }

  .login-card {
    max-height: min(46dvh, calc(100dvh - 186px));
    bottom: max(22px, calc(20px + var(--safe-bottom)));
  }

  .field > input {
    padding: 10px 12px;
  }

  .sheet {
    max-height: 38vh;
  }

  .map-fab {
    bottom: calc(38vh + 26px);
  }

  .trip-stamp {
    display: none;
  }
}

@media (max-width: 800px) and (max-height: 760px) {
  .check,
  .hero-copy .lede {
    display: none;
  }

  .login-card {
    max-height: min(50dvh, calc(100dvh - 148px));
  }
}

@media (max-width: 800px) and (max-height: 640px) {
  .anon-stamp {
    top: 12px;
    right: 12px;
    padding: 5px 8px;
  }

  .hero-copy .eyebrow {
    margin-bottom: 4px;
  }

  .hero-copy h1 {
    font-size: 28px;
  }

  .field > input {
    padding: 8px 12px;
  }
}

@media (min-width: 801px) {
  .hero-shot {
    object-position: 46% 58%;
  }

  .hero-copy {
    left: 44px;
    right: auto;
    top: 40px;
    max-width: 520px;
  }

  .hero-copy h1 {
    font-size: 62px;
  }

  .hero-copy .lede {
    font-size: 16px;
  }

  .login-card {
    left: 40px;
    right: auto;
    bottom: 36px;
    width: min(390px, calc(100vw - 80px));
    max-height: calc(100dvh - 220px);
    padding: 20px 22px 16px;
    border-radius: 26px;
  }

  .trip-bar,
  .sheet {
    left: 16px;
    right: auto;
    width: min(400px, calc(100vw - 32px));
  }

  .sheet {
    max-height: min(62dvh, 560px);
  }

  .map-fab {
    right: 20px;
    bottom: 92px;
  }

  .leaflet-top.leaflet-right {
    top: 16px;
  }
}
