/* iOS-inspired UI — flat surfaces, system colors, SF-style rhythm */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;

  /* Light gray shell — neutral, easy on the eyes */
  --icloud-page: #ececee;
  --icloud-card: #ffffff;
  --icloud-blue: #0a84ff;
  --icloud-blue-deep: #0077ed;
  --icloud-field: #ffffff;
  --icloud-field-inner: #f5f5f7;
  --icloud-field-edge: rgba(55, 65, 100, 0.1);
  --icloud-shadow: 0 10px 40px rgba(20, 40, 95, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
  --icloud-shadow-hover: 0 14px 48px rgba(20, 40, 95, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);

  /* iCloud-style card edge strips (soft system blue / mist, not bold brand bars) */
  --icloud-card-edge: rgba(10, 132, 255, 0.09);
  --icloud-card-edge-soft: rgba(10, 132, 255, 0.045);
  --card-radius-outer: clamp(16px, 2.8vw, 22px);

  --ios-blue: var(--icloud-blue);
  --ios-blue-pressed: #006adb;
  --ios-indigo: #5856d6;
  --ios-label: #1d1d1f;
  --ios-secondary-label: rgba(60, 60, 67, 0.62);
  --ios-tertiary-label: rgba(60, 60, 67, 0.36);
  --ios-quaternary-label: rgba(60, 60, 67, 0.2);
  --ios-grouped-bg: var(--icloud-page);
  --ios-secondary-grouped-bg: var(--icloud-card);
  --ios-separator: rgba(60, 60, 67, 0.1);
  --ios-separator-opaque: #d2d4db;
  --ios-fill: rgba(10, 132, 255, 0.1);
  --ios-fill-secondary: rgba(120, 125, 145, 0.12);
  --ios-gray-5: #e8eaef;
  --ios-gray-6: var(--icloud-field-inner);
  --ios-red: #ff3b30;
  --ios-orange: #ff9500;
  --ios-yellow: #ffcc00;
  --ios-green: #34c759;
  --ios-teal: #5ac8fa;

  /* Layout tokens */
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --space: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --tap-min: 42px;
  --form-gap: clamp(6px, 1vw, 12px);
  --card-pad-x: clamp(12px, 2.8vw, 20px);
  --card-pad-y: clamp(12px, 2vw, 18px);
  /* Trip step: stack form/map below this width (see .trip-form) */
  --trip-split-bp: 1180px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--ios-label);
  background-color: var(--ios-grouped-bg);
  background-image: radial-gradient(ellipse 120% 85% at 50% -20%, rgba(120, 128, 145, 0.08), transparent 55%),
    radial-gradient(ellipse 90% 55% at 100% 8%, rgba(140, 145, 158, 0.07), transparent 48%),
    radial-gradient(ellipse 75% 45% at 0% 100%, rgba(110, 118, 132, 0.06), transparent 42%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.shell {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(8px, 2vw, 16px);
  padding-bottom: max(calc(var(--space) * 2), env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

.ios-card {
  position: relative;
  isolation: isolate;
  width: min(1080px, 100%);
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f8 100%);
  border-radius: var(--card-radius-outer);
  padding: var(--card-pad-y) clamp(14px, 3.5vw, 28px) calc(var(--card-pad-y) + 6px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--icloud-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
  overflow: hidden;
}

.ios-card > * {
  position: relative;
  z-index: 1;
}

.ios-card:has(.wizard-step-body) {
  padding-top: clamp(8px, 1.6vw, 14px);
  padding-bottom: clamp(8px, 1.6vw, 14px);
}

.ios-card:has(.wizard-step-body) .ios-header {
  margin-bottom: clamp(6px, 1.2vw, 10px);
}

.ios-card:has(.wizard-step-body) .ios-progress {
  margin-bottom: clamp(8px, 1.8vw, 14px);
}

.ios-card::before,
.ios-card::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.92;
}

.ios-card::before {
  left: 0;
  background: var(--icloud-card-edge);
  border-radius: var(--card-radius-outer) 0 0 var(--card-radius-outer);
}

.ios-card::after {
  right: 0;
  background: var(--icloud-card-edge-soft);
  border-radius: 0 var(--card-radius-outer) var(--card-radius-outer) 0;
}

@media (hover: hover) {
  .ios-card:hover {
    box-shadow: var(--icloud-shadow-hover), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
  }
}

.ios-header {
  text-align: center;
  margin-bottom: clamp(10px, 2vw, 16px);
}

.title {
  font-family: var(--font);
  font-size: clamp(1.28rem, 2.8vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ios-label);
  line-height: 1.15;
}

.subtitle {
  display: inline-block;
  margin: calc(var(--space) * 1) 0 0;
  padding: 0.42em 1.05em 0.44em;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(72, 72, 78, 0.88);
  letter-spacing: -0.012em;
  line-height: 1.35;
  background: #e4e4e8;
  border-radius: 999px;
  border: 1px solid rgba(120, 120, 132, 0.22);
}

/* Segmented step control (iOS UISegmentedControl) */
.tabs.ios-segment {
  display: flex;
  gap: 3px;
  padding: 3px;
  margin: 0 0 clamp(8px, 1.5vw, 12px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(236, 237, 241, 0.95));
  border-radius: var(--radius-sm);
  width: 100%;
  border: 1px solid rgba(110, 115, 128, 0.12);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.tab {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: clamp(0.7rem, 2.4vw, 0.8125rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ios-secondary-label);
  padding: clamp(6px, 1.5vw, 10px) clamp(4px, 1vw, 8px);
  min-height: clamp(34px, 8vw, 38px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius-sm) - 2px);
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
  user-select: none;
}

@media (hover: hover) {
  .tab:not(.tab-active):hover {
    color: var(--ios-label);
    background: rgba(255, 255, 255, 0.45);
  }
}

.tab-active {
  color: var(--ios-label);
  background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
  outline: 1px solid rgba(60, 80, 120, 0.1);
  box-shadow: inset 0 -2px 0 var(--icloud-blue), 0 1px 5px rgba(10, 132, 255, 0.09);
}

.wizard-done .tab-done {
  color: var(--ios-secondary-label);
  background: transparent;
  outline: none;
  box-shadow: none;
  font-weight: 700;
}

.wizard-done {
  opacity: 0.98;
}

.ios-progress {
  height: 5px;
  background: linear-gradient(180deg, #eef1f8 0%, #e4e9f2 100%);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: clamp(12px, 2.5vw, 20px);
  border: 1px solid rgba(60, 80, 120, 0.06);
}

.progress-fill {
  height: 100%;
  width: 33.333%;
  background: linear-gradient(90deg, #5ac8fa 0%, var(--icloud-blue) 55%, var(--icloud-blue-deep) 100%);
  border-radius: inherit;
  transition: width 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 0 14px rgba(10, 132, 255, 0.45);
}

.progress-fill.p2 {
  width: 66.666%;
}

.progress-fill.p3 {
  width: 100%;
}

/* Trip page: form + map — equal split side-by-side ≥1181px; stack below on smaller widths */
.trip-form {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 24px);
  align-items: stretch;
}

@media (min-width: 1200px) {
  .trip-form {
    gap: clamp(16px, 2vw, 28px);
  }
}

@media (max-width: 1180px) {
  .trip-form {
    grid-template-columns: 1fr;
  }
}

.col-form {
  display: flex;
  flex-direction: column;
  gap: var(--form-gap);
  min-width: 0;
}

.col-form-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--form-gap);
  min-width: 0;
  padding-bottom: max(48px, 10dvh, env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: max(48px, 10dvh);
}

/* Trip step only: avoid huge empty band + scrollbar tail under Next */
.trip-form .col-form-scroll {
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

@media (max-width: 820px) {
  .trip-form .row-2,
  .trip-form .row-datetimes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .trip-form .ios-switch {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

/* Form fields and Next scroll together inside the left column */
@media (min-width: 1181px) {
  .trip-form .col-form {
    align-self: stretch;
    max-height: calc(100dvh - clamp(168px, 21dvh, 232px));
    min-height: 0;
    overflow: hidden;
  }

  .trip-form .col-form-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-inline-end: clamp(8px, 1.2vw, 14px);
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    border-right: 1px solid var(--ios-separator);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(60, 80, 120, 0.32) transparent;
    -webkit-overflow-scrolling: touch;
  }

  /* Pin Next to bottom of column when the map column is taller than the form */
  .trip-form .col-form-scroll > .footer-actions {
    margin-top: auto;
  }

  .trip-form .col-form-scroll::-webkit-scrollbar {
    width: 8px;
  }

  .trip-form .col-form-scroll::-webkit-scrollbar-thumb {
    background: rgba(60, 80, 120, 0.28);
    border-radius: 999px;
  }
}

@media (max-width: 1180px) and (min-width: 700px) {
  .trip-form .col-form {
    max-height: min(62dvh, 580px);
    min-height: 0;
    overflow: hidden;
  }

  .trip-form .col-form-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-inline-end: clamp(8px, 1.2vw, 14px);
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(60, 80, 120, 0.32) transparent;
    -webkit-overflow-scrolling: touch;
  }

  .trip-form .col-form-scroll > .footer-actions {
    margin-top: auto;
  }

  .trip-form .col-form-scroll::-webkit-scrollbar {
    width: 8px;
  }

  .trip-form .col-form-scroll::-webkit-scrollbar-thumb {
    background: rgba(60, 80, 120, 0.28);
    border-radius: 999px;
  }
}

@media (max-width: 699px) {
  .trip-form .col-form-scroll {
    flex: 0 0 auto;
    overflow: visible;
  }
}

.col-map {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

@media (min-width: 1181px) {
  .col-map {
    position: sticky;
    top: clamp(8px, 2vh, 16px);
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100dvh - 32px);
  }

  /* Grow with the form column so the preview fills the row (no dead band under map) */
  .col-map .map-frame {
    flex: 1 1 auto;
    min-height: clamp(260px, 40vh, 400px);
    max-height: none;
  }

  .map-frame iframe {
    min-height: 100%;
  }
}

@media (max-width: 1180px) {
  .col-map .map-frame {
    min-height: clamp(220px, 36vh, 360px);
    max-height: min(400px, 42vh);
  }
}

.map-frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(60, 80, 120, 0.1);
  box-shadow: 0 2px 12px rgba(25, 45, 90, 0.07);
  background: var(--icloud-field);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.28s ease, transform 0.28s ease;
}

@media (hover: hover) {
  .map-frame:hover {
    box-shadow: 0 8px 28px rgba(25, 45, 90, 0.12);
    transform: translateY(-1px);
  }
}

.map-frame,
.map-frame iframe {
  width: 100%;
  border: 0;
}

.map-frame iframe,
.map-frame .trip-map-canvas.leaflet-container {
  flex: 1 1 auto;
  min-height: 220px;
}

.map-frame .trip-map-canvas {
  flex: 1 1 auto;
  width: 100%;
  min-height: 220px;
  background: var(--ios-gray-6);
  z-index: 0;
}

.map-frame .leaflet-container {
  font-family: var(--font);
}

.map-frame .leaflet-control-attribution {
  font-size: 0.625rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--ios-secondary-label);
  border-radius: 4px 0 0 0;
}

@media (max-width: 640px) {
  .trip-form .map-frame,
  .trip-form .map-frame iframe,
  .trip-form .map-frame .trip-map-canvas.leaflet-container,
  .trip-form .map-placeholder {
    min-height: clamp(200px, 38vw, 260px);
    max-height: 280px;
  }
}

.map-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  flex: 1;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--space) * 2);
  color: var(--ios-secondary-label);
  text-align: center;
  line-height: 1.5;
  font-size: 0.875rem;
  background: var(--ios-gray-6);
  outline: 1px dashed var(--ios-separator-opaque);
}

.map-placeholder code {
  font-size: 0.8125rem;
  color: var(--ios-label);
  background: var(--ios-gray-5);
  padding: 0.15em 0.45em;
  border-radius: 6px;
}

.map-frame .trip-route-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  max-width: min(100% - 20px, 280px);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ios-label);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(25, 45, 90, 0.1);
  border: 1px solid rgba(60, 80, 120, 0.12);
  pointer-events: none;
}

/* Google Places suggestions above float labels / sticky map column */
.pac-container {
  z-index: 20000 !important;
}

/* Programmatic Places (AutocompleteSuggestion) dropdown — same stacking as .pac-container */
.trip-ac-list {
  position: fixed;
  z-index: 20000;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: min(40vh, 280px);
  overflow-y: auto;
  background: var(--icloud-card);
  border: 1px solid var(--ios-separator-opaque);
  border-radius: var(--radius-md);
  box-shadow: var(--icloud-shadow);
  font-size: 0.875rem;
  color: var(--ios-label);
}

.trip-ac-item {
  padding: 10px 12px;
  cursor: pointer;
  line-height: 1.35;
}

@media (hover: hover) {
  .trip-ac-item:hover {
    background: var(--ios-fill-secondary);
  }
}

/* Trip type: second date hidden for one-way (requires :has) */
.field-return {
  min-width: 0;
}

.dt-hint {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ios-tertiary-label);
  margin: calc(var(--space) * -0.25) 0 calc(var(--space) * 0.75);
  line-height: 1.35;
}

@supports selector(:has(*)) {
  .trip-form:has(#trip_ow:checked) .field-return {
    display: none;
  }

  .trip-form:has(#trip_rt:checked) .field-return {
    display: block;
  }

  .trip-form:has(#trip_ow:checked) .row-datetimes {
    grid-template-columns: 1fr;
  }

  .trip-form:has(#trip_rt:checked) .row-datetimes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trip-form:has(#trip_ow:checked) .dt-hint--rt {
    display: none;
  }

  .trip-form:has(#trip_rt:checked) .dt-hint--ow {
    display: none;
  }
}

.labelish {
  display: block;
  font-size: clamp(0.7rem, 1.8vw, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ios-tertiary-label);
  margin-bottom: clamp(4px, 1vw, 6px);
}

.field-toggles .toggle-row {
  margin-top: 0;
}

.hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ios-tertiary-label);
  margin-top: calc(var(--space) * -0.25);
  margin-bottom: calc(var(--space) * 0.75);
}

/* Grouped “cell” inputs — explicit types; .field input:not([type]) catches bare inputs in older markup */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="datetime-local"],
.field input:not([type]),
select,
textarea {
  width: 100%;
  min-height: var(--tap-min);
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 14px);
  border: none;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: clamp(0.9375rem, 2.5vw, 1rem);
  letter-spacing: -0.02em;
  color: var(--ios-label);
  background: var(--icloud-field);
  box-shadow: inset 0 0 0 1px var(--icloud-field-edge), 0 1px 2px rgba(25, 45, 75, 0.04);
  outline: none;
  transition: box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
.field input:not([type]),
textarea {
  appearance: none;
  -webkit-appearance: none;
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--icloud-field);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%233c3c43' fill-opacity='0.45' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
  padding: 0 2px;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.85;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: inset 0 0 0 2px rgba(10, 132, 255, 0.45), 0 2px 8px rgba(10, 132, 255, 0.12);
  background: #fff;
}

@media (hover: hover) {
  input[type="text"]:hover,
  input[type="email"]:hover,
  input[type="tel"]:hover,
  input[type="number"]:hover,
  input[type="datetime-local"]:hover,
  .field input:not([type]):hover,
  select:hover,
  textarea:hover {
    box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.22), 0 3px 12px rgba(25, 45, 90, 0.07);
  }
}

textarea {
  resize: vertical;
  min-height: clamp(72px, 18vw, 100px);
  line-height: 1.45;
}

.wizard-step-body {
  width: 100%;
  min-width: 0;
}

/* In-field labels — same pattern on trip + passenger steps */
.field-float {
  position: relative;
}

.field-float input,
.field-float textarea {
  padding-top: 1.28rem;
  padding-bottom: 0.52rem;
}

.field-float input {
  min-height: var(--tap-min);
}

.field-float textarea {
  min-height: clamp(72px, 16vw, 92px);
}

.field-float label {
  position: absolute;
  left: clamp(11px, 2.4vw, 14px);
  right: 8px;
  top: 50%;
  transform: translateY(-52%);
  font-size: clamp(0.88rem, 2.3vw, 0.97rem);
  font-weight: 500;
  color: var(--ios-tertiary-label);
  pointer-events: none;
  margin: 0;
  line-height: 1.2;
  transition: top 0.16s ease, transform 0.16s ease, font-size 0.16s ease, color 0.16s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-float--static label {
  top: 0.3rem;
  transform: none;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
}

.field-float:not(.field-float--static):not(.field-float--textarea) input:focus + label,
.field-float:not(.field-float--static):not(.field-float--textarea) input:not(:placeholder-shown) + label {
  top: 0.28rem;
  transform: none;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
}

.field-float--textarea textarea:focus + label,
.field-float--textarea textarea:not(:placeholder-shown) + label {
  top: 0.28rem;
  transform: none;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
}

.field-float--static input {
  padding-top: 1.34rem;
}

.field-float--textarea .field-micro {
  margin: 0.2rem 0 0 clamp(2px, 0.5vw, 4px);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ios-tertiary-label);
  line-height: 1.35;
}

.field-shell {
  position: relative;
}

.field-shell .infield-label {
  position: absolute;
  left: clamp(11px, 2.4vw, 14px);
  top: 0.3rem;
  z-index: 1;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ios-secondary-label);
  margin: 0;
  pointer-events: none;
}

.field-shell select {
  padding-top: 1.3rem;
  padding-bottom: 0.48rem;
  min-height: var(--tap-min);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.5vw, 12px);
}

.row-datetimes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.row-datetimes .field {
  min-width: 0;
}

.row-2 > .field,
.row-3 > .field,
.row-contact > .field {
  min-width: 0;
}

.row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 12px);
}

@media (max-width: 960px) {
  .row-contact {
    grid-template-columns: 1fr 1fr;
  }

  .row-contact .field:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .row-2,
  .row-3,
  .row-contact {
    grid-template-columns: 1fr;
  }

  .row-contact .field:nth-child(3) {
    grid-column: auto;
  }
}

.toggle-row {
  display: flex;
  gap: calc(var(--space) * 1.25);
  flex-wrap: wrap;
}

.toggle-row--switches {
  align-items: center;
  gap: clamp(12px, 2.5vw, 20px);
}

/* iOS-style switch + label (Trip type radios + Equipment checkboxes) */
.ios-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: min(160px, 100%);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ios-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.ios-switch-track {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eceef2 0%, #e2e5ea 100%);
  box-shadow: inset 0 0 0 1px rgba(60, 80, 120, 0.14);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.ios-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.06);
  transition: transform 0.22s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.ios-switch input:checked + .ios-switch-track {
  background: linear-gradient(180deg, #5ac8fa 0%, var(--icloud-blue) 100%);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.35), 0 2px 8px rgba(10, 132, 255, 0.22);
}

.ios-switch input:checked + .ios-switch-track::after {
  transform: translateX(16px);
}

.ios-switch-label {
  font-weight: 600;
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  letter-spacing: -0.02em;
  color: var(--ios-secondary-label);
  line-height: 1.25;
  min-width: 0;
  flex: 1 1 auto;
}

.ios-switch input:checked ~ .ios-switch-label {
  color: var(--ios-label);
}

.ios-switch input:focus-visible + .ios-switch-track {
  box-shadow: inset 0 0 0 1px rgba(60, 80, 120, 0.14), 0 0 0 3px rgba(10, 132, 255, 0.32);
}

.ios-switch input:focus-visible:checked + .ios-switch-track {
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.45), 0 0 0 3px rgba(10, 132, 255, 0.32);
}

@media (hover: hover) {
  .ios-switch:hover .ios-switch-label {
    color: var(--ios-label);
  }

  .ios-switch:hover .ios-switch-track {
    box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.2), 0 1px 3px rgba(25, 45, 90, 0.06);
  }

  .ios-switch:hover input:checked + .ios-switch-track {
    box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.45), 0 3px 10px rgba(10, 132, 255, 0.28);
  }
}

.footer-actions {
  margin-top: clamp(10px, 2vw, 16px);
  padding-top: clamp(10px, 2vw, 16px);
  border-top: 1px solid rgba(60, 80, 120, 0.08);
}

.footer-actions.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--space) * 1.5);
}

.btn {
  border: 0;
  border-radius: var(--radius-md);
  min-height: clamp(40px, 10vw, 44px);
  padding: 0 clamp(14px, 3vw, 18px);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.18s ease, background 0.22s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(180deg, #52adff 0%, var(--icloud-blue) 38%, var(--icloud-blue-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--ios-blue-pressed);
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3);
}

.btn-muted {
  background: linear-gradient(180deg, #f3f4f8 0%, var(--ios-gray-5) 100%);
  color: var(--ios-label);
  box-shadow: inset 0 0 0 1px rgba(60, 80, 120, 0.08);
}

.btn-muted:hover {
  filter: brightness(0.99);
  box-shadow: inset 0 0 0 1px rgba(60, 80, 120, 0.12), 0 4px 12px rgba(25, 45, 90, 0.07);
  transform: translateY(-1px);
}

.btn-muted:active {
  transform: translateY(0);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--form-gap);
}

.form-sheet {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
}

@media (min-width: 520px) {
  .stack.narrow.form-sheet {
    max-width: min(480px, 100%);
  }
}

.page-flow {
  width: 100%;
}

.form-sheet-wide {
  max-width: 100%;
  margin-inline: 0;
}

.thank-panel {
  padding-top: clamp(4px, 1.5vw, 12px);
}

.thank-actions {
  margin-top: calc(var(--space) * 1.5);
  margin-bottom: 0;
}

.stack.narrow {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.stack.narrow .title {
  margin-bottom: calc(var(--space) * 0.5);
}

/* Thank-you confirmation (post-submit) */
.thank-you-page {
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 20px) 0 clamp(24px, 4vw, 40px);
  text-align: center;
}

.thank-you-hero {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(12px, 3vw, 20px);
}

.thank-you-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(52, 199, 89, 0.18), rgba(52, 199, 89, 0.08));
  outline: 2px solid rgba(52, 199, 89, 0.35);
  box-shadow: 0 8px 28px rgba(52, 199, 89, 0.15);
}

.thank-you-check::after {
  content: "";
  width: 14px;
  height: 26px;
  border: solid #22a559;
  border-width: 0 3.5px 3.5px 0;
  transform: rotate(45deg) translateY(-3px);
  margin-top: -4px;
}

.thank-you-title {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ios-label);
}

.thank-you-lead {
  margin: 0 0 clamp(16px, 3vw, 24px);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ios-secondary-label);
  font-weight: 500;
  max-width: 42ch;
  margin-inline: auto;
}

.thank-you-warn {
  margin: -8px auto clamp(18px, 3vw, 26px);
  padding: 12px 14px;
  max-width: 46ch;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #9a5b16;
  background: rgba(255, 149, 0, 0.12);
  border-radius: var(--radius-md);
  outline: 1px solid rgba(255, 149, 0, 0.28);
}

.thank-new-btn {
  display: inline-flex;
  justify-content: center;
  min-width: min(100%, 260px);
}

.field-error {
  color: var(--ios-red);
  font-size: 0.8125rem;
  font-weight: 600;
  margin: calc(var(--space) * 0.75) 0 0;
  letter-spacing: -0.01em;
}

.field-float .field-error {
  margin-top: 4px;
}

.banner-error {
  background: rgba(255, 59, 48, 0.1);
  color: #c62828;
  padding: calc(var(--space) * 1.75);
  border-radius: var(--radius-md);
  outline: 1px solid rgba(255, 59, 48, 0.22);
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: calc(var(--space) * 2);
}

.success {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ios-label);
  margin: 0;
}

.linkish {
  color: var(--icloud-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.linkish:hover {
  color: var(--icloud-blue-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 16px);
  margin-bottom: clamp(12px, 2.5vw, 20px);
}

@media (max-width: 900px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Summary step — mobile-first layout + brand accents */
.summary-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  padding-bottom: max(clamp(8px, 3vw, 20px), env(safe-area-inset-bottom, 0px));
}

.summary-page .summary-actions {
  margin-top: clamp(6px, 1.5vw, 12px);
  margin-bottom: max(clamp(8px, 3vw, 20px), env(safe-area-inset-bottom, 0px));
  padding-bottom: 2px;
}

.summary-page .summary-grid {
  align-items: start;
  gap: clamp(8px, 2vw, 12px);
  margin-bottom: clamp(6px, 1.5vw, 12px);
}

.summary-page .panel {
  position: relative;
  min-width: 0;
  padding: clamp(8px, 2vw, 14px);
  padding-left: clamp(10px, 2.5vw, 16px);
  border: 1px solid rgba(110, 115, 128, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 2px 12px rgba(40, 45, 55, 0.05);
}

/* Left summary: vehicle + route — clearer hierarchy */
.summary-page .panel--trip-card {
  padding: clamp(14px, 2.5vw, 22px);
  padding-left: clamp(16px, 3vw, 22px);
  border: 1px solid rgba(110, 115, 128, 0.14);
  background: linear-gradient(168deg, #ffffff 0%, #f4f4f6 55%, #eceef2 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98), 0 4px 22px rgba(40, 45, 55, 0.07);
}

.summary-page .panel--trip-card::before {
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.45), rgba(10, 132, 255, 0.12));
}

.summary-trip-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-page .panel--trip-card .vehicle-panel-title {
  margin-bottom: 0;
}

.summary-equip-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.summary-equip-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: rgba(72, 72, 78, 0.9);
  background: #e8e8ec;
  border: 1px solid rgba(110, 115, 128, 0.2);
  line-height: 1.25;
}

.summary-route-shell {
  margin-top: 14px;
  padding: 16px 14px 18px 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(168deg, #fafafa 0%, #f0f1f4 100%);
  border: 1px solid rgba(110, 115, 128, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 2px 10px rgba(40, 45, 55, 0.04);
}

.summary-page .panel--trip-card .summary-route {
  margin-top: 0;
}

.summary-page .panel--trip-card .summary-route-stop {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px 14px;
}

.summary-page .panel--trip-card .pin {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  -webkit-mask: radial-gradient(circle at 35% 32%, #000 58%, transparent 60%) center / 18px 18px no-repeat;
  mask: radial-gradient(circle at 35% 32%, #000 58%, transparent 60%) center / 18px 18px no-repeat;
}

.summary-page .panel--trip-card .summary-route-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: var(--ios-secondary-label);
}

.summary-page .panel--trip-card .addr {
  font-size: 0.97rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--ios-label);
}

.summary-page .panel--trip-card .summary-route-line {
  margin: 7px 0 7px 12px;
  min-height: 18px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.42), rgba(10, 132, 255, 0.14));
}

.summary-page .panel--trip-card .summary-route-meta {
  margin-top: 10px;
  gap: 8px;
}

.summary-page .panel--trip-card .time-chip {
  padding: 7px 12px;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(25, 45, 90, 0.07);
}

.summary-page .panel--trip-card .trip-type-pill {
  padding: 6px 12px;
  font-size: 0.74rem;
}

.summary-page .panel-title {
  margin-bottom: 0.15rem;
}

.panel--your-info .panel-title {
  margin-bottom: 6px;
}

.summary-contact-block {
  margin: 0;
  padding: 4px 0 2px 14px;
  border-left: 3px solid rgba(10, 132, 255, 0.28);
}

.summary-contact-row {
  display: grid;
  grid-template-columns: minmax(4.25rem, 5.25rem) minmax(0, 1fr);
  gap: 6px 12px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(60, 60, 67, 0.14);
}

.summary-contact-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.summary-contact-key {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ios-tertiary-label);
}

.summary-contact-val {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--ios-label);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.summary-page .muted {
  margin: 0 0 4px;
  font-size: 0.8125rem;
}

.summary-page .summary-route {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 6px;
}

.summary-route-stop {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px 12px;
  align-items: start;
}

.summary-route-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ios-tertiary-label);
  margin-bottom: 2px;
}

.summary-route-body {
  min-width: 0;
}

.summary-route-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.summary-page .time-stack.time-stack--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
}

.summary-page .time-fallback.time-fallback--inline {
  margin-top: 0;
}

.trip-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--icloud-blue-deep);
  background: rgba(10, 132, 255, 0.1);
  border: 1px solid rgba(10, 132, 255, 0.22);
  white-space: nowrap;
}

.summary-route-line {
  width: 2px;
  min-height: 14px;
  margin: 4px 0 4px 10px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.35), rgba(10, 132, 255, 0.08));
}

.summary-page .metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.summary-page .metric.metric--stat-line {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  min-width: 0;
  overflow: hidden;
}

.summary-page .metric.metric--stat-line > .icon {
  margin-top: 2px;
  flex-shrink: 0;
}

.metric-stat-rows {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-stat-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.metric-stat-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  line-height: 1.2;
}

.metric-stat-word {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ios-secondary-label);
}

.metric-stat-label .metric-stat-dir {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ios-tertiary-label);
}

.metric-stat-val {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ios-label);
  line-height: 1.2;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.metric-stat-line--sub {
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px dashed rgba(60, 80, 120, 0.12);
}

.metric-stat-line--sub .metric-stat-word {
  color: var(--ios-tertiary-label);
}

.metric-stat-line--sub .metric-stat-val {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
}

.summary-page .sep {
  margin: 6px 0;
}

.summary-page .line {
  margin: 0 0 8px;
}

.summary-page .panel-subheading {
  margin: 0 0 4px;
  font-size: 0.72rem;
}

.summary-page .metric {
  padding: 7px 8px;
  min-width: 0;
  min-height: 0;
}

.summary-page .ml {
  font-size: 0.65rem;
}

.summary-page .metric-values {
  gap: 4px;
  margin-top: 2px;
}

.summary-page .metric-tag {
  font-size: 0.62rem;
}

.summary-page .mv {
  font-size: 0.8125rem;
}

.summary-page .mv.cost {
  font-size: 0.95rem;
  line-height: 1.2;
}

.summary-page .data-grid {
  font-size: 0.8125rem;
}

.summary-page .data-grid th,
.summary-page .data-grid td {
  padding: clamp(6px, 1.4vw, 9px) clamp(8px, 2vw, 11px);
}

.summary-page .panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 4px;
  background: rgba(10, 132, 255, 0.22);
  opacity: 1;
}

.summary-page .loc > div:last-child {
  min-width: 0;
}

.summary-page .addr {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.summary-page .time {
  overflow-wrap: anywhere;
}

.vehicle-panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.vehicle-panel-title-text {
  min-width: 0;
}

.icon.veh {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, #5ac8fa 0%, var(--icloud-blue) 100%);
  box-shadow: 0 2px 10px rgba(10, 132, 255, 0.2);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 24px 24px;
  mask-size: 24px 24px;
}

.veh-wheelchair {
  -webkit-mask-image: url("/assets/icons/veh-wheelchair.svg");
  mask-image: url("/assets/icons/veh-wheelchair.svg");
}

.veh-ambulatory {
  -webkit-mask-image: url("/assets/icons/veh-ambulatory.svg");
  mask-image: url("/assets/icons/veh-ambulatory.svg");
}

.veh-stretcher-van {
  -webkit-mask-image: url("/assets/icons/veh-stretcher-van.svg");
  mask-image: url("/assets/icons/veh-stretcher-van.svg");
}

.veh-default {
  -webkit-mask-image: url("/assets/icons/veh-default.svg");
  mask-image: url("/assets/icons/veh-default.svg");
}

/* Summary only: slightly larger, softer vehicle glyph (favicon stays neutral) */
.summary-page .icon.veh {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  -webkit-mask-size: 28px 28px;
  mask-size: 28px 28px;
  box-shadow: 0 3px 14px rgba(10, 132, 255, 0.2);
}

.summary-page .vehicle-panel-title {
  gap: 14px;
  align-items: center;
}

.summary-page .time-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 6px;
}

.summary-page .time-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  background: var(--icloud-field);
  border: 1px solid rgba(60, 80, 120, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 1px 4px rgba(25, 45, 90, 0.06);
  width: fit-content;
  max-width: 100%;
}

.summary-page .time-chip-text {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ios-label);
}

.summary-page .time-chip .icon.cal {
  background: var(--icloud-blue);
}

.summary-page .time-chip .icon.clock {
  background: var(--icloud-blue);
  -webkit-mask-image: url("/assets/icons/clock.svg");
  mask-image: url("/assets/icons/clock.svg");
  -webkit-mask-size: 16px 16px;
  mask-size: 16px 16px;
}

.summary-page .time-fallback {
  margin-top: 10px;
}

.summary-page .time-fallback-text {
  font-weight: 600;
  color: var(--ios-secondary-label);
}

.summary-page .line .icon.person,
.summary-page .line .icon.phone {
  background: var(--icloud-blue);
}

.panel-subheading {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ios-tertiary-label);
}

.panel-footnote {
  margin: 0 0 14px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ios-tertiary-label);
}

.metric-body {
  flex: 1;
  min-width: 0;
}

.metric-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.metric-value-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.metric-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ios-secondary-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.metric-value-row .mv {
  text-align: right;
}

.metric-value-row--secondary .mv {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ios-secondary-label);
}

.metric--cost {
  border-color: rgba(10, 132, 255, 0.18);
  background: linear-gradient(180deg, #fafcff 0%, #f0f6ff 100%);
}

.summary-page .mv.cost {
  color: var(--icloud-blue-deep);
  font-size: 1.08rem;
}

button.payment-summary-trigger {
  margin-top: 8px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: var(--icloud-blue);
}

button.payment-summary-trigger:hover {
  color: var(--icloud-blue-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Short viewports — shared Trip / Passengers / Summary; slightly relaxed vs ultra-tight */
@media (max-height: 860px) {
  .shell:has(.wizard-step-body) {
    padding: 8px 12px 10px;
    min-height: auto;
  }

  .ios-card:has(.wizard-step-body) {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: clamp(12px, 2.4vw, 22px);
    padding-right: clamp(12px, 2.4vw, 22px);
  }

  .ios-card:has(.wizard-step-body) .ios-header {
    margin-bottom: 8px;
  }

  .ios-card:has(.wizard-step-body) .title {
    font-size: clamp(1.12rem, 2.4vw, 1.42rem);
    line-height: 1.14;
  }

  .ios-card:has(.wizard-step-body) .subtitle {
    margin-top: 6px;
    padding: 0.32em 0.85em 0.34em;
    font-size: 0.78rem;
  }

  .ios-card:has(.wizard-step-body) .tabs.ios-segment {
    margin-bottom: 8px;
    padding: 3px;
    gap: 3px;
  }

  .ios-card:has(.wizard-step-body) .tab {
    min-height: 34px;
    padding: 5px 7px;
    font-size: 0.75rem;
  }

  .ios-card:has(.wizard-step-body) .ios-progress {
    margin-bottom: 8px;
    height: 5px;
  }

  /* Trip request + Passengers — same footer rhythm as summary */
  .wizard-step-body .footer-actions {
    margin-top: 8px;
    padding-top: 10px;
  }

  .wizard-step-body .footer-actions.split {
    gap: calc(var(--space) * 1.35);
  }

  .wizard-step-body .footer-actions .btn {
    min-height: 42px;
    font-size: 1rem;
    padding-left: 14px;
    padding-right: 14px;
  }

  .trip-form {
    gap: clamp(11px, 2vw, 20px);
  }

  .trip-form .col-form-scroll {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }

  .summary-page {
    padding-bottom: 8px;
  }

  .summary-page .summary-grid {
    gap: 8px;
    margin-bottom: 8px;
  }

  .summary-page .panel {
    padding: 9px 11px;
    padding-left: 12px;
  }

  .summary-page .panel--trip-card {
    padding: 10px 11px 12px;
    padding-left: 13px;
  }

  .summary-page .panel--trip-card .summary-route-shell {
    margin-top: 10px;
    padding: 11px 10px 12px 9px;
  }

  .summary-page .panel--trip-card .addr {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .summary-page .panel-title,
  .summary-page .vehicle-panel-title-text {
    font-size: 1.02rem;
  }

  .summary-page .panel--trip-card .summary-route {
    margin-top: 0;
  }

  .summary-page .summary-route {
    margin-top: 6px;
  }

  .summary-route-kicker {
    margin-bottom: 1px;
    font-size: 0.62rem;
  }

  .summary-page .addr {
    font-size: 0.86rem;
    line-height: 1.25;
  }

  .summary-route-meta {
    margin-top: 6px;
    gap: 6px;
  }

  .trip-type-pill {
    padding: 4px 9px;
    font-size: 0.7rem;
  }

  .summary-page .time-chip-text {
    font-size: 0.8rem;
  }

  .summary-page .time-chip {
    padding: 5px 9px;
  }

  .summary-route-line {
    margin: 3px 0 3px 11px;
    min-height: 12px;
  }

  .summary-page .icon.veh {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 11px;
    -webkit-mask-size: 24px 24px;
    mask-size: 24px 24px;
  }

  .panel--your-info .panel-title {
    margin-bottom: 6px;
  }

  .summary-contact-row {
    padding: 5px 0;
  }

  .summary-contact-val {
    font-size: 0.88rem;
  }

  .summary-page .sep {
    margin: 6px 0;
  }

  .summary-page .panel-subheading {
    margin: 0 0 4px;
    font-size: 0.7rem;
  }

  .summary-page .metrics {
    gap: 7px;
    margin-bottom: 6px;
  }

  .summary-page .metric {
    padding: 7px 8px;
  }

  .summary-page .metric.metric--stat-line {
    padding: 7px 9px;
    gap: 7px;
  }

  .metric-stat-val {
    font-size: 0.88rem;
  }

  .summary-page .mv.cost {
    font-size: 0.95rem;
  }

  .summary-page .data-grid {
    font-size: 0.76rem;
  }

  .summary-page .data-grid th,
  .summary-page .data-grid td {
    padding: 4px 7px;
  }

  .summary-page .summary-actions {
    margin-top: 6px;
    margin-bottom: 8px;
  }

  .summary-page .summary-actions .btn {
    min-height: 42px;
    font-size: 1rem;
    padding-left: 14px;
    padding-right: 14px;
  }

  button.payment-summary-trigger {
    margin-top: 6px;
    font-size: 0.83rem;
  }
}

@media (max-height: 720px) {
  .shell:has(.wizard-step-body) {
    padding: 6px 10px 8px;
  }

  .ios-card:has(.wizard-step-body) {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .ios-card:has(.wizard-step-body) .tab {
    min-height: 32px;
    padding: 4px 6px;
  }

  .summary-page .data-grid th,
  .summary-page .data-grid td {
    padding: 3px 6px;
  }

  .summary-page .panel {
    padding: 7px 9px;
    padding-left: 10px;
  }
}

.payment-summary-dialog:not([open]) {
  display: none !important;
}

.payment-summary-dialog[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 10000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 20px));
  max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px));
  margin: 0;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  box-shadow: 0 28px 90px rgba(12, 28, 64, 0.38);
  overscroll-behavior: contain;
}

.payment-summary-dialog::backdrop {
  background: rgba(18, 32, 58, 0.42);
  backdrop-filter: blur(5px);
}

.payment-summary-inner {
  padding: 12px 14px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  flex: 1 1 auto;
  max-height: inherit;
  overflow: hidden;
}

.payment-summary-hero {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(90, 200, 250, 0.35) 0%, rgba(10, 132, 255, 0.2) 100%);
  border: 1px solid rgba(10, 132, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.payment-summary-hero-i {
  font-size: 1.25rem;
  font-weight: 700;
  font-style: italic;
  color: var(--icloud-blue-deep);
  line-height: 1;
}

.payment-summary-title {
  margin: 0 0 10px;
  flex-shrink: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ios-label);
}

.payment-summary-rows {
  text-align: left;
  border: 1px solid rgba(60, 80, 120, 0.1);
  border-radius: var(--radius-md);
  background: var(--icloud-field);
  padding: 2px 0;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.payment-summary-total {
  flex-shrink: 0;
  margin: 0 0 10px;
  border-radius: var(--radius-md);
}

.payment-summary-close-form {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  display: block;
  width: 100%;
  max-width: 260px;
  margin-inline: auto;
  flex-shrink: 0;
}

.payment-summary-close-form .payment-summary-close {
  width: 100%;
}

.payment-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(60, 60, 67, 0.06);
}

.payment-summary-row:last-child {
  border-bottom: none;
}

.payment-summary-label {
  color: var(--ios-secondary-label);
  font-weight: 500;
  line-height: 1.3;
  min-width: 0;
}

.payment-summary-value {
  font-weight: 600;
  color: var(--ios-label);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.payment-summary-row--total {
  background: rgba(10, 132, 255, 0.08);
}

.payment-summary-total.payment-summary-row--total {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  text-align: left;
}

.payment-summary-row--total .payment-summary-label {
  font-weight: 700;
  color: var(--ios-label);
}

.payment-summary-row--total .payment-summary-value {
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--icloud-blue-deep);
}

.payment-summary-close {
  min-height: 44px;
}

/* Stacked “receipt” rows — easier to scan than squeezed table columns */
@media (max-width: 560px) {
  .summary-page .data-grid {
    display: block;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .summary-page .data-grid tbody {
    display: block;
  }

  .summary-page .data-grid tr {
    display: block;
    margin-bottom: 8px;
    padding: 9px 11px;
    background: var(--icloud-field);
    border-radius: var(--radius-md);
    border: 1px solid rgba(10, 132, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(25, 45, 90, 0.05);
  }

  .summary-page .data-grid th,
  .summary-page .data-grid td {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
  }

  .summary-page .data-grid th {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ios-tertiary-label);
    margin-bottom: 4px;
  }

  .summary-page .data-grid td {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--ios-label);
    word-break: break-word;
  }
}

/* Summary: stack estimate cards before they get too narrow */
@media (max-width: 720px) {
  .summary-page .metrics {
    grid-template-columns: 1fr;
  }
}

/* Summary actions: full-width stack on phones */
@media (max-width: 520px) {
  .summary-page .summary-actions.footer-actions.split {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .summary-page .summary-actions .btn {
    width: 100%;
    min-height: 48px;
  }
}

.panel {
  background: linear-gradient(180deg, #fbfcff 0%, #f4f7fc 100%);
  border-radius: var(--radius-lg);
  padding: clamp(12px, 2.5vw, 18px);
  border: 1px solid rgba(60, 80, 120, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 3px rgba(25, 45, 90, 0.05);
}

.panel-title {
  margin: 0 0 calc(var(--space) * 0.5);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.mv.muted {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
}

.muted {
  color: var(--ios-secondary-label);
  margin-top: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.route {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vw, 14px);
  margin-top: clamp(10px, 2vw, 16px);
}

.loc {
  display: flex;
  gap: calc(var(--space) * 1.5);
  align-items: flex-start;
}

.addr {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.time {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ios-secondary-label);
  margin-top: calc(var(--space) * 0.75);
  display: flex;
  align-items: center;
  gap: calc(var(--space) * 0.75);
}

.mid {
  text-align: center;
  color: var(--ios-secondary-label);
}

.arrow {
  font-size: 1.35rem;
  font-weight: 300;
  background: linear-gradient(135deg, #5ac8fa 0%, var(--icloud-blue) 55%, var(--icloud-blue-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mid-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ios-tertiary-label);
  text-transform: none;
}

.icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  flex: 0 0 22px;
}

.pin {
  background: linear-gradient(145deg, #5ac8fa 0%, var(--icloud-blue) 100%);
  mask: radial-gradient(circle at 35% 32%, #000 58%, transparent 60%) center / 16px 16px no-repeat;
  border-radius: 50%;
}

.clock {
  background: var(--ios-tertiary-label);
  -webkit-mask-image: url("/assets/icons/clock.svg");
  mask-image: url("/assets/icons/clock.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 15px 15px;
  mask-size: 15px 15px;
}

.cal {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: var(--icloud-blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM9 14H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm-8-4H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2z'/%3E%3C/svg%3E")
    center / 16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM9 14H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm-8-4H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2z'/%3E%3C/svg%3E")
    center / 16px 16px no-repeat;
}

.person {
  background: var(--ios-secondary-label);
  mask: radial-gradient(circle, #000 58%, transparent 60%) center / 13px 13px no-repeat;
}

.phone {
  background: var(--ios-secondary-label);
  mask: linear-gradient(#000, #000) center / 14px 3px no-repeat;
}

.line {
  display: flex;
  align-items: center;
  gap: calc(var(--space) * 1.25);
  margin: 0 0 calc(var(--space) * 1.25);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.sep {
  border: 0;
  border-top: 1px solid var(--ios-separator);
  margin: calc(var(--space) * 2) 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.5vw, 12px);
  margin-bottom: clamp(12px, 2vw, 18px);
}

.metric {
  display: flex;
  gap: calc(var(--space) * 1);
  align-items: flex-start;
  padding: clamp(10px, 2vw, 14px);
  background: var(--icloud-field);
  border-radius: var(--radius-md);
  border: 1px solid rgba(60, 80, 120, 0.08);
  box-shadow: 0 2px 8px rgba(25, 45, 90, 0.06);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

@media (hover: hover) {
  .metric:hover {
    box-shadow: 0 6px 18px rgba(25, 45, 90, 0.1);
    transform: translateY(-2px);
  }
}

@media (max-width: 680px) {
  .metrics {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    margin-inline: calc(-1 * var(--space));
    padding-inline: var(--space);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .metric {
    flex: 0 0 min(240px, 82vw);
    scroll-snap-align: start;
  }
}

.ml {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ios-secondary-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mv {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 0.95rem;
}

.mv.cost {
  color: var(--ios-green);
  font-size: 1.05rem;
}

.m-clock,
.m-ruler,
.m-money {
  border-radius: 8px;
  background: linear-gradient(145deg, #5ac8fa 0%, var(--icloud-blue) 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 16px 16px;
  mask-size: 16px 16px;
}

.m-clock {
  -webkit-mask-image: url("/assets/icons/clock.svg");
  mask-image: url("/assets/icons/clock.svg");
}

.m-ruler {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 7h16v2H4V7zm0 5h16v2H4v-2zm0 5h10v2H4v-2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M4 7h16v2H4V7zm0 5h16v2H4v-2zm0 5h10v2H4v-2z'/%3E%3C/svg%3E");
}

.m-money {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z'/%3E%3C/svg%3E");
}

.data-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(60, 80, 120, 0.1);
  box-shadow: 0 2px 10px rgba(25, 45, 90, 0.05);
}

.data-grid th,
.data-grid td {
  border-bottom: 1px solid rgba(60, 60, 67, 0.08);
  padding: clamp(10px, 2vw, 12px) clamp(10px, 2vw, 14px);
  text-align: left;
  vertical-align: top;
  background: var(--icloud-field);
}

.data-grid tr:last-child th,
.data-grid tr:last-child td {
  border-bottom: none;
}

.data-grid th {
  width: 36%;
  color: var(--ios-secondary-label);
  font-weight: 600;
  font-size: 0.8125rem;
}

.data-grid td {
  font-weight: 500;
  color: var(--ios-label);
}

.wizard-step-body .panel {
  border-radius: var(--radius-md);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .progress-fill {
    transition: none;
    box-shadow: none;
  }

  .ios-card:hover {
    transform: none !important;
  }

  .btn-primary:hover,
  .btn-muted:hover {
    transform: none !important;
  }

  .map-frame:hover,
  .metric:hover {
    transform: none !important;
  }
}
