:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1b302a;
  background: #f3f6f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --surface-subtle: #edf2ef;
  --ink: #1b302a;
  --muted: #526760;
  --brand: #123d38;
  --brand-hover: #0d312c;
  --border: #c5d1cb;
  --focus: #9a6500;
  --notice-bg: #fff5df;
  --notice-border: #d6b36d;
  --notice-ink: #57421e;
  --error: #9c2b25;
  --error-bg: #fff0ed;
  --button-disabled-bg: #e3e9e5;
  --button-disabled-border: #cbd5cf;
  --button-disabled-ink: #43544d;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 1rem;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 48px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 4px;
  color: #ffffff;
  background: var(--brand);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.site-header {
  color: #ffffff;
  background: var(--brand);
}

.site-header__inner,
.site-footer__inner {
  display: flex;
  width: min(100% - 40px, 1120px);
  min-height: 68px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: inherit;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.header-note {
  margin: 0;
  color: #e5eeea;
  font-size: 0.9rem;
}

.page-shell {
  width: min(100% - 40px, 1120px);
  margin-inline: auto;
  padding-block: 52px 36px;
}

.intro {
  max-width: 760px;
  margin-bottom: 32px;
}

.eyebrow,
.step-label {
  margin: 0 0 9px;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.15rem, 4.2vw, 3.25rem);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.intro__copy {
  max-width: 66ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: start;
  gap: 20px;
}

.booking-panel,
.estimate-panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.section-heading {
  display: flex;
  margin-bottom: 24px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.step-label span {
  margin-inline: 4px;
  color: #84948d;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-caption {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.ride-form {
  display: grid;
  gap: 18px;
}

.form-field {
  min-width: 0;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 650;
}

.form-field input,
.form-field select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #9eafa7;
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

.form-field input::placeholder {
  color: #667a72;
  opacity: 1;
}

.form-field input:hover,
.form-field select:hover {
  border-color: #637b70;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

.route-fields {
  min-width: 0;
  margin: 2px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.route-fields legend {
  padding: 0;
  font-weight: 680;
}

.field-help {
  max-width: 62ch;
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 0.9rem;
}

.input-with-unit {
  position: relative;
}

.input-with-unit input {
  padding-right: 58px;
}

.input-with-unit span {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.input-hint {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--error);
  color: var(--error);
  background: var(--error-bg);
}

.form-actions,
.review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  padding: 11px 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 680;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button--primary {
  color: #ffffff;
  background: var(--brand);
}

.button--primary:hover {
  background: var(--brand-hover);
}

.button--quiet {
  border-color: var(--border);
  color: var(--brand);
  background: var(--surface);
}

.button--quiet:hover {
  border-color: #71877c;
  background: var(--surface-subtle);
}

.button--disabled,
.button--disabled:disabled,
.button:disabled,
.button:disabled:hover {
  border-color: var(--button-disabled-border);
  color: var(--button-disabled-ink);
  background: var(--button-disabled-bg);
  cursor: not-allowed;
}

.button--full {
  width: 100%;
  margin-top: 18px;
}

.section-heading--estimate {
  margin-bottom: 18px;
}

.estimate-empty {
  padding: 17px 16px;
  border-left: 3px solid #91a69a;
  background: var(--surface-subtle);
}

.estimate-empty p {
  margin: 0;
  color: var(--muted);
}

.estimate-total {
  padding: 19px 18px;
  border: 1px solid #d1ddd6;
  border-radius: 7px;
  background: var(--surface-subtle);
}

.estimate-total__label,
.estimate-total__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.estimate-total__label {
  font-weight: 650;
}

.estimate-total__amount {
  display: block;
  margin: 4px 0 2px;
  color: var(--brand);
  font-size: clamp(2.1rem, 4vw, 2.7rem);
  font-weight: 740;
  letter-spacing: -0.045em;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.fare-breakdown {
  margin: 18px 0 0;
}

.fare-row {
  display: flex;
  padding: 9px 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e1e7e3;
  font-size: 0.92rem;
}

.fare-row dt {
  color: var(--muted);
}

.fare-row dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.fare-row--total {
  border-bottom: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 740;
}

.fare-row--total dt {
  color: var(--ink);
}

.estimate-notice {
  margin-top: 17px;
  padding: 13px 14px;
  border: 1px solid var(--notice-border);
  border-radius: 6px;
  color: var(--notice-ink);
  background: var(--notice-bg);
  font-size: 0.86rem;
}

.estimate-notice p {
  margin: 0;
}

.estimate-notice strong {
  font-weight: 750;
}

.trip-review {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.section-heading--review {
  margin-bottom: 12px;
}

.section-heading--review h3:focus {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.trip-summary {
  margin: 0;
}

.trip-summary__row {
  padding: 9px 0;
  border-bottom: 1px solid #e1e7e3;
}

.trip-summary__row dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.trip-summary__row dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.trip-summary__row--total dd {
  color: var(--brand);
  font-weight: 740;
}

.review-actions {
  margin-top: 17px;
}

.privacy-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: #e9efeb;
}

.site-footer__inner {
  min-height: 60px;
  font-size: 0.84rem;
}

.site-footer__inner p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 800px) {
  .booking-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .estimate-panel {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .site-header__inner,
  .site-footer__inner,
  .page-shell {
    width: min(100% - 28px, 1120px);
  }

  .site-header__inner {
    min-height: 60px;
  }

  .header-note {
    font-size: 0.8rem;
  }

  .page-shell {
    padding-block: 34px 26px;
  }

  .intro {
    margin-bottom: 24px;
  }

  .intro h1 {
    font-size: clamp(2rem, 10vw, 2.6rem);
  }

  .intro__copy {
    font-size: 1rem;
  }

  .booking-layout {
    gap: 14px;
  }

  .booking-panel,
  .estimate-panel {
    padding: 20px 17px;
    border-radius: 9px;
  }

  .section-caption {
    display: none;
  }

  .field-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }

  .form-actions,
  .review-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .form-actions .button,
  .review-actions .button {
    width: 100%;
  }

  .site-footer__inner {
    min-height: 56px;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    color: #edf3ef;
    background: #111b17;
    --canvas: #111b17;
    --surface: #192621;
    --surface-subtle: #23332c;
    --ink: #edf3ef;
    --muted: #c0cdc6;
    --brand: #123d38;
    --brand-hover: #1a5047;
    --brand-text: #b9d9cb;
    --border: #4d6056;
    --focus: #f0c45b;
    --notice-bg: #332c1b;
    --notice-border: #a58a4b;
    --notice-ink: #f5e6bc;
    --error: #ffb9b1;
    --error-bg: #412622;
    --button-disabled-bg: #34423b;
    --button-disabled-border: #53645a;
    --button-disabled-ink: #c0ccc5;
  }

  body {
    color: var(--ink);
    background: var(--canvas);
  }

  .eyebrow,
  .step-label {
    color: var(--brand-text);
  }

  .step-label span {
    color: #a4b6ad;
  }

  .form-field input,
  .form-field select {
    border-color: #7a8c82;
    color: var(--ink);
    background: #192621;
  }

  .form-field input::placeholder {
    color: #bac8c0;
  }

  .form-field input:hover,
  .form-field select:hover {
    border-color: #b2c3ba;
  }

  .button--quiet {
    border-color: #64786d;
    color: #d8e7df;
    background: var(--surface);
  }

  .button--quiet:hover {
    border-color: #a6b9ae;
    background: var(--surface-subtle);
  }

  .button--disabled,
  .button--disabled:disabled,
  .button:disabled,
  .button:disabled:hover {
    border-color: var(--button-disabled-border);
    color: var(--button-disabled-ink);
    background: var(--button-disabled-bg);
  }

  .estimate-total {
    border-color: #4d6257;
  }

  .estimate-total__amount,
  .trip-summary__row--total dd {
    color: #c0e0d1;
  }

  .fare-row,
  .trip-summary__row {
    border-color: #3c4a43;
  }

  .estimate-empty {
    border-left-color: #8aa595;
  }

  .site-footer {
    border-color: #35443c;
    color: #c0cdc6;
    background: #18231e;
  }

  .skip-link {
    color: #ffffff;
    background: #174f46;
  }
}

/* Passenger and driver beta surfaces */
:root {
  --success: #185d39;
  --success-bg: #e7f2ea;
  --warning: #5a461d;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-shell > main {
  flex: 1;
}

.site-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.nav-button,
.local-nav__button,
.auth-tab {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 640;
  line-height: 1.25;
  cursor: pointer;
}

.nav-button {
  color: #ffffff;
}

.nav-button:hover {
  border-color: #76938a;
  background: #1c4b44;
}

.nav-button.is-active {
  color: var(--brand);
  background: #ffffff;
}

.nav-button--signout {
  margin-left: 4px;
  border-color: #76938a;
}

.account-label {
  max-width: 22ch;
  overflow: hidden;
  color: #e5eeea;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-button:focus-visible,
.local-nav__button:focus-visible,
.auth-tab:focus-visible,
.suggestion-list [role="option"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.offline-notice {
  color: var(--notice-ink);
  background: var(--notice-bg);
  border-bottom: 1px solid var(--notice-border);
}

.offline-notice__inner {
  padding-block: 10px;
}

.offline-notice p {
  margin: 0;
}

.auth-view,
.app-view {
  width: 100%;
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
  align-items: start;
  gap: clamp(28px, 6vw, 76px);
  padding-block: clamp(34px, 7vw, 78px);
}

.auth-intro,
.view-intro {
  min-width: 0;
}

.auth-intro h1,
.view-intro h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.1rem, 4.2vw, 3.25rem);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.account-panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.auth-tabs {
  display: flex;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.auth-tab {
  position: relative;
  margin-bottom: -1px;
  border-radius: 5px 5px 0 0;
  color: var(--muted);
}

.auth-tab:hover,
.local-nav__button:hover {
  color: var(--brand);
  background: var(--surface-subtle);
}

.auth-tab.is-active {
  border-color: var(--border);
  border-bottom-color: var(--surface);
  color: var(--brand);
  background: var(--surface);
}

.stacked-form {
  display: grid;
  gap: 16px;
}

.stacked-form .button--full {
  margin-top: 2px;
}

.auth-message,
.form-status,
.driver-access-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-message,
.form-status {
  min-height: 1.5em;
  margin: 12px 0 0;
}

.driver-access-note {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.view-intro {
  display: flex;
  margin-bottom: 25px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.view-intro .intro__copy {
  margin-top: 12px;
}

.local-nav {
  display: flex;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}

.local-nav__button {
  margin-bottom: -1px;
  border-radius: 5px 5px 0 0;
  color: var(--muted);
}

.local-nav__button.is-active {
  border-color: var(--border);
  border-bottom-color: var(--canvas);
  color: var(--brand);
  background: var(--canvas);
}

.passenger-panel,
.driver-queue {
  min-width: 0;
}

.location-field {
  position: relative;
}

.location-field input[aria-expanded="true"] {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.suggestion-list {
  position: absolute;
  z-index: 3;
  top: calc(100% - 1px);
  right: 0;
  left: 0;
  max-height: 250px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid #9eafa7;
  border-radius: 0 0 6px 6px;
  background: var(--surface);
  list-style: none;
  box-shadow: 0 5px 12px rgb(27 48 42 / 12%);
}

.suggestion-list [role="option"] {
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  align-items: center;
  border: 0;
  border-radius: 3px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.suggestion-list [role="option"]:hover,
.suggestion-list [role="option"][aria-selected="true"] {
  background: var(--surface-subtle);
}

.route-status:empty {
  display: none;
}

.route-status,
.state-message {
  margin: 12px 0;
  padding: 11px 13px;
  border-left: 3px solid #91a69a;
  color: var(--muted);
  background: var(--surface-subtle);
}

.state-message--loading {
  border-left-color: #567a68;
}

.state-message--error {
  border-left-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

.state-message--warning {
  border-left-color: var(--notice-border);
  color: var(--notice-ink);
  background: var(--notice-bg);
}

.route-result {
  margin-top: 16px;
}

.route-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 14px 16px;
  gap: 14px;
  background: var(--surface-subtle);
}

.route-summary dt,
.request-details dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.route-summary dd,
.request-details dd {
  margin: 3px 0 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.map-shell {
  margin-top: 12px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.route-map {
  position: relative;
  width: 100%;
  height: 320px;
  min-height: 270px;
  overflow: hidden;
  background: #e6ece8;
}

.route-map .map-state {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  max-width: min(32ch, calc(100% - 24px));
  margin: 0;
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
}

.quote-details .estimate-total {
  margin-bottom: 12px;
}

.estimate-notice,
.quote-notice {
  margin-top: 17px;
  padding: 13px 14px;
  border: 1px solid var(--notice-border);
  border-radius: 6px;
  color: var(--notice-ink);
  background: var(--notice-bg);
  font-size: 0.86rem;
}

.quote-notice p,
.estimate-notice p {
  margin: 0;
}

.trip-review {
  margin-top: 20px;
}

.trip-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.trip-summary__row--total {
  grid-column: 1 / -1;
}

.booking-state {
  margin-top: 20px;
  padding: 16px;
  border-left: 3px solid var(--border);
  background: var(--surface-subtle);
}

.booking-state h3,
.booking-state p {
  margin-top: 0;
}

.booking-state p:last-child {
  margin-bottom: 0;
}

.booking-state--success {
  border-left-color: var(--success);
  color: var(--success);
  background: var(--success-bg);
}

.booking-state--error {
  border-left-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

.ride-history-list,
.driver-request-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.history-item {
  display: flex;
  min-width: 0;
  padding: 17px 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
}

.history-item p {
  margin: 0;
}

.history-item__route > p:first-child {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.route-separator {
  margin-inline: 8px;
  color: var(--muted);
}

.history-item__meta,
.history-item__fare p:first-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.history-item__fare {
  flex: 0 0 auto;
  text-align: right;
}

.history-item__fare p:last-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.role-label {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.driver-queue > .section-heading {
  margin-bottom: 14px;
}

.driver-request {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

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

.request-heading h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.request-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.request-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0;
  gap: 16px;
}

.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.request-feedback {
  margin: 12px 0;
  color: var(--muted);
}

@media (max-width: 800px) {
  .auth-view {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .account-panel {
    width: 100%;
    max-width: 620px;
  }

  .request-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header__inner {
    flex-wrap: wrap;
    padding-block: 10px;
    gap: 6px 12px;
  }

  .site-header__inner > .brand {
    margin-right: auto;
  }

  .site-nav {
    order: 3;
    width: 100%;
    padding-bottom: 2px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .site-nav .nav-button {
    flex: 0 0 auto;
  }

  .account-label {
    display: none;
  }

  .header-note {
    margin-left: auto;
  }

  .auth-view {
    padding-block: 32px 26px;
    gap: 22px;
  }

  .account-panel {
    padding: 20px 17px;
    border-radius: 9px;
  }

  .view-intro {
    display: block;
  }

  .role-label {
    margin-top: 12px;
  }

  .local-nav {
    overflow-x: auto;
  }

  .local-nav__button {
    flex: 0 0 auto;
  }

  .route-summary,
  .trip-summary,
  .request-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .history-item__fare {
    display: flex;
    width: 100%;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
  }

  .history-item__fare p:first-child {
    margin-top: 0;
  }

  .request-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-actions .button {
    width: 100%;
  }

  .route-map {
    height: 250px;
    min-height: 230px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --success: #a7d7b6;
    --success-bg: #1d3528;
    --warning: #f5e6bc;
  }

  .auth-tab.is-active {
    border-bottom-color: var(--surface);
    color: var(--brand-text);
  }

  .auth-tab:hover,
  .local-nav__button:hover {
    color: var(--brand-text);
  }

  .local-nav__button.is-active {
    border-bottom-color: var(--canvas);
    color: var(--brand-text);
  }

  .map-shell {
    border-color: var(--border);
  }

  .route-map {
    background: #263831;
  }

  .route-map__attribution a {
    color: #23312f;
    text-decoration: underline;
    text-underline-offset: 0.12em;
  }

  .route-map__attribution a:hover,
  .route-map__attribution a:focus-visible {
    color: #123d38;
  }

  .booking-state--success {
    border-left-color: var(--success);
    color: var(--success);
    background: var(--success-bg);
  }
}

.auth-action-link {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  margin-top: 7px;
  padding: 8px 0;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  color: var(--brand);
  background: transparent;
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-action-link:hover {
  color: var(--brand-hover);
}

.auth-action-link:focus-visible,
.recovery-panel h3:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

#forgot-password-help {
  margin: 0;
}

.recovery-feedback {
  min-height: 1.5em;
}

.recovery-feedback > p {
  margin: 8px 0 0;
}

.recovery-loading {
  min-height: 1.5em;
  margin: 8px 0 0;
}

.recovery-success {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--success);
  color: var(--success);
  background: var(--success-bg);
}

.recovery-panel {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.recovery-panel__heading h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.recovery-panel__heading .input-hint {
  max-width: 60ch;
  margin: 7px 0 0;
}

#password-recovery-form {
  margin-top: 16px;
}

#password-recovery-form .button {
  width: 100%;
}

#password-recovery-form .button--full {
  margin-top: 2px;
}

#password-recovery-back {
  margin-top: 0;
}

@media (prefers-color-scheme: dark) {
  .auth-action-link {
    color: var(--brand-text);
  }

  .auth-action-link:hover {
    color: #e0f1e8;
  }
}

/* Route stops, recurring schedules, and driver availability */
#auth-back-to-planner {
  margin-top: 18px;
}

.stops-fieldset,
.recurrence-fieldset,
.weekday-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.stops-fieldset > legend,
.recurrence-fieldset > legend,
.weekday-fieldset > legend {
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 680;
}

.optional-label {
  margin-left: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.location-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.location-input-row > input {
  flex: 1 1 auto;
}

.stop-remove {
  flex: 0 0 auto;
  min-width: 78px;
  min-height: 48px;
  padding-inline: 10px;
}

.stops-fieldset > #add-stop-button {
  margin-top: 6px;
}

.stops-fieldset .state-message {
  margin-top: 12px;
}

.toggle-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
}

.toggle-row input,
.availability-day input[type="checkbox"],
.weekday-options input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}

.toggle-row label {
  font-weight: 600;
}

.recurrence-options {
  display: grid;
  margin-top: 12px;
  padding: 14px;
  gap: 16px;
  border-left: 3px solid #91a69a;
  background: var(--surface-subtle);
}

.weekday-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  gap: 5px;
}

.weekday-options label {
  display: flex;
  min-height: 44px;
  padding: 4px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.weekday-options input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.weekday-options label:focus-within,
.availability-day label:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.pricing-card {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-subtle);
}

.pricing-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.pricing-caption {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.pricing-list {
  margin-top: 8px;
}

.pricing-list .fare-row {
  padding-block: 5px;
  border-bottom: 0;
  font-size: 0.86rem;
}

.trip-review {
  margin: 0 0 16px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.trip-review .fare-row {
  padding-block: 7px;
}

.trip-review dd {
  max-width: 65%;
  overflow-wrap: anywhere;
  text-align: right;
}

.availability-form {
  display: grid;
  gap: 14px;
}

.availability-days {
  border-top: 1px solid var(--border);
}

.availability-day {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr);
  padding: 10px 0;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.availability-day > label:first-child {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.availability-day > label:not(:first-child) {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.availability-day input[type="time"] {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid #9eafa7;
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
}

.availability-day input:disabled {
  opacity: 0.62;
}

.driver-availability {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.history-series-cancel {
  min-height: 44px;
  margin-top: 6px;
  padding: 7px 9px;
  font-size: 0.8rem;
}

.history-series-feedback {
  max-width: 28ch;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.skip-link:focus-visible {
  position: relative;
  top: auto;
  left: auto;
  display: block;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 8px auto;
  transform: none;
}

@media (max-width: 560px) {
  .weekday-options {
    grid-template-columns: repeat(4, minmax(55px, 1fr));
  }

  .availability-day {
    grid-template-columns: minmax(0, 1fr) minmax(95px, 1fr) minmax(95px, 1fr);
    gap: 7px;
  }

  .availability-day > label:not(:first-child) {
    display: grid;
    gap: 2px;
    font-size: 0.75rem;
  }

  .availability-day input[type="time"] {
    padding-inline: 4px;
  }

  .location-input-row {
    align-items: stretch;
  }

  .stop-remove {
    min-width: 70px;
    padding-inline: 7px;
  }
}

@media (prefers-color-scheme: dark) {
  .availability-day input[type="time"] {
    border-color: #7a8c82;
    color: var(--ink);
    background: var(--surface);
  }

  .pricing-card,
  .trip-review {
    border-color: var(--border);
  }
}
