:root {
  color-scheme: light;
  --ink: #102333;
  --muted: #687781;
  --navy: #081b2d;
  --navy-soft: #122d43;
  --gold: #c7983d;
  --gold-light: #f3dfb1;
  --paper: #f5f3ee;
  --card: #ffffff;
  --line: #dde1df;
  --green: #147a61;
  --green-soft: #e5f4ef;
  --blue: #28678c;
  --blue-soft: #e5f1f7;
  --orange: #a95720;
  --orange-soft: #fff0e2;
  --red: #aa3840;
  --red-soft: #fbeaec;
  --gray-soft: #eef0ef;
  --shadow: 0 16px 45px rgba(8, 27, 45, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-width: 320px;
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(199, 152, 61, 0.45);
  outline-offset: 2px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
  background: var(--navy);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 6vw, 5rem);
  overflow: hidden;
  color: white;
}

.login-brand::after {
  position: absolute;
  right: -18%;
  bottom: -28%;
  width: 34rem;
  height: 34rem;
  border: 1px solid rgba(215, 173, 90, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgba(215, 173, 90, 0.04), 0 0 0 10rem rgba(215, 173, 90, 0.025);
  content: "";
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mark {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid rgba(215, 173, 90, 0.7);
  border-radius: 0.75rem;
  background: var(--gold);
  color: var(--navy);
  font-family: Inter, sans-serif;
  font-weight: 900;
}

.brand-message {
  position: relative;
  z-index: 1;
  max-width: 35rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-message h1 {
  max-width: 11ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.brand-message p:last-child {
  max-width: 35rem;
  margin: 1.5rem 0 0;
  color: #bfccd5;
  font-size: 1.05rem;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
  border-radius: 2rem 0 0 2rem;
  background: var(--paper);
}

.login-card {
  width: min(100%, 28rem);
}

.login-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.login-card > p {
  margin: 0.5rem 0 2rem;
  color: var(--muted);
}

.login-card a {
  color: var(--blue);
  font-weight: 700;
}

.onboarding-shell .login-panel {
  overflow-y: auto;
}

.onboarding-shell .login-card {
  padding: 2rem 0;
}

.onboarding-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.eyebrow.dark {
  color: var(--orange);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  background: var(--navy);
  color: white;
}

.sidebar .wordmark {
  padding: 0 0.5rem 1.5rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0.9rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: #b8c7d1;
  text-align: left;
  font-weight: 650;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.09);
  color: white;
}

.nav-button.active::before {
  width: 0.25rem;
  height: 1.35rem;
  border-radius: 2rem;
  background: var(--gold);
  content: "";
}

.sidebar-user {
  margin-top: auto;
  padding: 1rem 0.6rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-user span {
  margin-top: 0.15rem;
  color: #9eb0bc;
  font-size: 0.82rem;
}

.main {
  min-width: 0;
  padding: 2rem clamp(1.25rem, 3vw, 3rem) 6rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}

.page-header p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.header-actions,
.actions,
.inline-fields,
.filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  background: var(--navy);
  color: white;
  font-weight: 750;
  text-decoration: none;
}

.button:hover {
  background: var(--navy-soft);
}

.button.secondary {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.button.secondary:hover {
  border-color: #bac3c2;
  background: #fafafa;
}

.button.gold {
  background: var(--gold);
  color: var(--navy);
}

.button.danger {
  background: var(--red);
}

.button.small {
  min-height: 2.3rem;
  padding: 0.5rem 0.72rem;
  font-size: 0.85rem;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(8, 27, 45, 0.03);
}

.card-pad {
  padding: 1.25rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.stat {
  padding: 1.1rem 1.2rem;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.dispatch-grid {
  display: grid;
  grid-template-columns: minmax(22rem, 0.95fr) minmax(26rem, 1.35fr);
  gap: 1rem;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.map {
  min-height: 34rem;
  overflow: hidden;
  border-radius: 1rem;
  background: #dfe7e7;
}

.map-empty {
  min-height: 24rem;
  display: grid;
  place-items: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.trip-list {
  display: grid;
  gap: 0.75rem;
  max-height: 42rem;
  padding-right: 0.2rem;
  overflow: auto;
}

.trip-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 0.85rem;
  background: white;
}

.trip-card.closed {
  border-left-color: #9aa5aa;
  opacity: 0.83;
}

.trip-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.trip-card h3 {
  margin: 0;
  font-size: 1rem;
}

.trip-card .code {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.route {
  display: grid;
  grid-template-columns: 0.8rem 1fr;
  gap: 0.25rem 0.65rem;
  margin: 0.85rem 0;
}

.route-mark {
  position: relative;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.35rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
}

.route-mark.destination {
  border-radius: 0.1rem;
  background: var(--navy);
  border-color: var(--navy);
}

.route div:nth-child(2n) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trip-meta {
  display: flex;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  margin: 0.7rem 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.trip-summary {
  display: flex;
  gap: 0.35rem 0.8rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.45rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.trip-summary strong {
  color: var(--ink);
}

.quote-summary {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.trip-disclosure {
  margin-top: 0.45rem;
}

.trip-disclosure > summary {
  display: inline-flex;
  min-height: 2.2rem;
  align-items: center;
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  list-style: none;
}

.trip-disclosure > summary::-webkit-details-marker {
  display: none;
}

.trip-disclosure > summary::after {
  content: " +";
  margin-left: 0.25rem;
}

.trip-disclosure[open] > summary::after {
  content: " −";
}

.trip-detail-content {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--gray-soft);
  color: #4f5c64;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status.requested { background: var(--orange-soft); color: var(--orange); }
.status.assigned,
.status.acknowledged { background: var(--blue-soft); color: var(--blue); }
.status.en_route,
.status.arrived,
.status.onboard { background: var(--green-soft); color: var(--green); }
.status.canceled,
.status.no_show { background: var(--red-soft); color: var(--red); }

.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: #97a2a6;
}

.dot.online { background: var(--green); }
.dot.stale { background: var(--orange); }

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

.field {
  display: grid;
  gap: 0.4rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.label {
  color: #3e4d57;
  font-size: 0.84rem;
  font-weight: 750;
}

.field input,
.field select,
.field textarea,
.select {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.68rem 0.75rem;
  border: 1px solid #ccd3d1;
  border-radius: 0.65rem;
  background: white;
  color: var(--ink);
}

.field textarea {
  min-height: 6rem;
  resize: vertical;
}

.address-field {
  position: relative;
}

.address-suggestions {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  z-index: 1200;
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: white;
  box-shadow: 0 12px 30px rgba(8, 27, 45, 0.2);
}

.address-suggestion {
  display: block;
  width: 100%;
  padding: 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.address-suggestion:last-child {
  border-bottom: 0;
}

.address-suggestion:hover,
.address-suggestion:focus {
  background: var(--paper);
  outline: none;
}

.address-block {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

.address-block legend {
  padding: 0 0.4rem;
  color: var(--ink);
  font-weight: 800;
}

.address-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.address-fields-grid .address-street {
  grid-column: 1 / -1;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(199, 152, 61, 0.12);
  outline: none;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.8rem;
  font-weight: 650;
}

.checkbox input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--navy);
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem 0.75rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 3rem 1.5rem;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.duty-card {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 0;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
}

.duty-card.on {
  background: var(--green);
}

.duty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.duty-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.duty-card p {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.75);
}

.driver-trip {
  margin-top: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
}

.driver-trip .route {
  font-size: 1.05rem;
}

.driver-trip-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.driver-trip-actions .button {
  min-height: 3.25rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-grid .card {
  padding: 1.2rem;
}

.admin-create-hotel {
  max-width: 44rem;
  padding: 1.2rem;
}

.admin-grid h2 {
  margin: 0 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.stack {
  display: grid;
  gap: 0.8rem;
}

.notice {
  padding: 0.85rem 1rem;
  border: 1px solid #d8c38e;
  border-radius: 0.7rem;
  background: #fff8e8;
  color: #684f1b;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2000;
  max-width: min(26rem, calc(100vw - 2.5rem));
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(0.75rem);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--red);
}

.mobile-header,
.mobile-nav {
  display: none;
}

.leaflet-popup-content strong,
.leaflet-popup-content span {
  display: block;
}

.leaflet-popup-content span {
  margin-top: 0.2rem;
  color: #5a6871;
}

.driver-pin-wrap {
  border: 0;
  background: transparent;
}

.driver-pin {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
  border: 4px solid white;
  border-radius: 50% 50% 50% 0;
  background: var(--green);
  box-shadow: 0 4px 12px rgba(8, 27, 45, 0.3);
  transform: rotate(-45deg);
}

.driver-pin.assigned { background: var(--blue); }
.driver-pin.passenger { background: var(--orange); }
.driver-pin.stale { background: #899397; }

.loading {
  min-height: 70vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

@media (max-width: 1050px) {
  .dispatch-grid {
    grid-template-columns: 1fr;
  }

  .map {
    min-height: 28rem;
  }

  .admin-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .login-shell {
    display: block;
    background: var(--paper);
  }

  .login-brand {
    min-height: 15rem;
    padding: 1.5rem;
  }

  .brand-message h1 {
    max-width: 14ch;
    font-size: 2.7rem;
  }

  .brand-message p:last-child {
    display: none;
  }

  .login-panel {
    min-height: calc(100vh - 15rem);
    padding: 2rem 1.25rem;
    border-radius: 1.5rem 1.5rem 0 0;
    transform: translateY(-1.5rem);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--navy);
    color: white;
  }

  .mobile-header .wordmark {
    font-size: 1.25rem;
  }

  .mobile-header .mark {
    width: 2rem;
    height: 2rem;
  }

  .main {
    padding: 1.35rem 1rem calc(5.5rem + env(safe-area-inset-bottom));
  }

  .page-header {
    align-items: flex-start;
  }

  .page-header h1 {
    font-size: 2.15rem;
  }

  .page-header .header-actions {
    justify-content: flex-end;
  }

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

  .form-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .map {
    min-height: 22rem;
  }

  .mobile-nav {
    position: fixed !important;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    padding: 0.45rem 0.75rem calc(0.45rem + env(safe-area-inset-bottom));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem 1rem 0 0;
    background: var(--navy);
    box-shadow: 0 12px 35px rgba(8, 27, 45, 0.28);
  }

  .mobile-nav .nav-button {
    width: auto;
    flex: 1;
    justify-content: center;
    padding: 0.7rem 0.45rem;
    font-size: 0.8rem;
    text-align: center;
  }

  .mobile-nav .nav-button.active::before {
    display: none;
  }

  .driver-trip-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .weekday-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-header {
    display: block;
  }

  .page-header .header-actions {
    margin-top: 1rem;
  }

  .stats {
    gap: 0.6rem;
  }

  .stat {
    padding: 0.9rem;
  }

  .stat strong {
    font-size: 1.65rem;
  }

  .duty-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.account-dialog {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: transparent;
  box-shadow: 0 24px 80px rgba(8, 27, 45, 0.3);
}

.admin-list + .admin-list {
  margin-top: 1rem;
}

.account-dialog::backdrop {
  background: rgba(8, 27, 45, 0.58);
}

.account-dialog .card {
  max-height: calc(100vh - 2rem);
  padding: 1.25rem;
  overflow-y: auto;
}

.section-gap {
  margin-top: 1rem;
}

.section-copy,
.muted-copy {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.mobile-records {
  display: none;
  gap: 0.75rem;
}

.mobile-records.always-visible {
  display: grid;
}

.record-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: white;
}

.record-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.record-card-top > div {
  min-width: 0;
}

.record-card-top strong,
.record-card-top span {
  display: block;
  overflow-wrap: anywhere;
}

.record-card-top span:not(.status) {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.record-route {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
  margin: 0.75rem 0;
  overflow-wrap: anywhere;
}

.record-route strong {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0 0;
}

.metric-list div {
  min-width: 0;
}

.metric-list dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.metric-list dd {
  margin: 0.1rem 0 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.currency-input {
  position: relative;
}

.currency-input > span {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  z-index: 1;
  color: var(--muted);
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.currency-input input {
  padding-left: 2.25rem !important;
}

.compact-form {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) auto;
  align-items: end;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.invite-form {
  grid-template-columns: repeat(3, minmax(9rem, 1fr)) auto;
}

.invite-result {
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid #d8c38e;
  border-radius: 0.75rem;
  background: #fff8e8;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.copy-row input {
  min-width: 0;
}

.invite-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.invite-card .metric-list {
  margin: 0.65rem 0;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.compact-status {
  margin-top: 0.75rem;
}

.change-review {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #d8c38e;
  border-radius: 0.75rem;
  background: #fff8e8;
}

.change-review > div > span,
.notice > span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.change-list {
  margin: 0;
  padding-left: 1.1rem;
}

.notice.compact {
  display: inline-flex;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
}

.calendar-card {
  margin-bottom: 1rem;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  padding: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-width: 0;
  min-height: 5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  text-align: left;
}

.calendar-day strong {
  color: var(--blue);
  font-size: 0.72rem;
}

.calendar-day.outside {
  background: #f7f7f5;
  color: #9aa3a7;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.checkbox.compact {
  min-height: 2.3rem;
  font-size: 0.82rem;
}

.form-submit-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.private-trip-page {
  max-width: 72rem;
}

.hotel-map-section {
  margin-bottom: 1rem;
}

.hotel-map {
  min-height: 22rem;
}

.update-banner {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 4000;
  width: min(34rem, calc(100vw - 1.5rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.85rem;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.update-banner .button {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  html,
  body,
  #app,
  .app-shell,
  .main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 14px;
  }

  .mobile-header {
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
  }

  .mobile-header .wordmark {
    gap: 0.45rem;
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .mobile-header .mark {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
  }

  .mobile-header .actions {
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .mobile-header .button {
    min-height: 2.35rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.74rem;
  }

  .main {
    padding: 0.9rem 0.7rem calc(5.4rem + env(safe-area-inset-bottom));
  }

  .page-header {
    gap: 0.65rem;
    margin-bottom: 0.9rem;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  .page-header p {
    margin-top: 0.25rem;
    font-size: 0.82rem;
  }

  .eyebrow {
    margin-bottom: 0.35rem;
    font-size: 0.66rem;
  }

  .page-header .header-actions {
    gap: 0.4rem;
  }

  .page-header .header-actions .button,
  .form-page-header > .button {
    min-height: 2.45rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }

  .button {
    min-height: 2.7rem;
    padding: 0.6rem 0.75rem;
  }

  .button.small {
    min-height: 2.5rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.78rem;
  }

  .card {
    border-radius: 0.8rem;
  }

  .card-pad,
  .admin-grid .card,
  .driver-trip {
    padding: 0.8rem;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .stat {
    min-width: 0;
    padding: 0.7rem;
  }

  .stat span {
    font-size: 0.64rem;
  }

  .stat strong {
    font-size: 1.35rem;
    overflow-wrap: anywhere;
  }

  .section-heading {
    gap: 0.5rem;
    margin-bottom: 0.7rem;
  }

  .section-heading h2,
  .section-heading h3 {
    font-size: 1.12rem;
  }

  .section-heading > span {
    font-size: 0.75rem;
  }

  .trip-list {
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .trip-card {
    min-width: 0;
    padding: 0.65rem;
  }

  .trip-card h3 {
    font-size: 0.95rem;
  }

  .trip-card .code,
  .trip-meta,
  .status {
    font-size: 0.7rem;
  }

  .route {
    margin: 0.45rem 0;
    font-size: 0.82rem;
  }

  .trip-meta {
    gap: 0.35rem 0.65rem;
    margin: 0.55rem 0;
  }

  .trip-summary {
    gap: 0.25rem 0.55rem;
    margin: 0.35rem 0 0.15rem;
    font-size: 0.7rem;
  }

  .trip-disclosure > summary {
    min-height: 2rem;
    padding: 0.35rem 0.58rem;
    font-size: 0.72rem;
  }

  .field {
    min-width: 0;
    gap: 0.3rem;
  }

  .field label,
  .label {
    font-size: 0.76rem;
  }

  .field input,
  .field select,
  .field textarea,
  .select {
    min-width: 0;
    min-height: 2.7rem;
    padding: 0.58rem 0.65rem;
    font-size: 16px;
  }

  .field textarea {
    min-height: 5rem;
  }

  .form-grid,
  .admin-grid,
  .address-fields-grid,
  .assignment-grid,
  .compact-form,
  .invite-form,
  .copy-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .onboarding-shell .login-card {
    padding: 0;
  }

  .address-fields-grid .address-street,
  .field.full {
    grid-column: auto;
  }

  .address-block {
    padding: 0.7rem;
  }

  .address-block legend {
    font-size: 0.82rem;
  }

  .desktop-table {
    display: none;
  }

  .mobile-records {
    display: grid;
  }

  .record-card {
    padding: 0.75rem;
  }

  .metric-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .record-actions {
    align-items: stretch;
  }

  .record-actions > .button {
    flex: 1 1 7rem;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 0.55rem;
  }

  .filters .field:has(#driver-filter) {
    grid-column: 1 / -1;
  }

  .calendar-day {
    min-height: 3.15rem;
    padding: 0.25rem;
    font-size: 0.75rem;
  }

  .calendar-day strong {
    font-size: 0.56rem;
    line-height: 1.1;
  }

  .calendar-weekdays span {
    padding: 0.2rem 0;
    font-size: 0.58rem;
  }

  .map,
  .hotel-map {
    min-height: 18rem;
  }

  .mobile-nav {
    right: 0;
    bottom: 0;
    left: 0;
    gap: 0.15rem;
    padding: 0.3rem 0.45rem calc(0.3rem + env(safe-area-inset-bottom));
    border-radius: 0.8rem 0.8rem 0 0;
  }

  .mobile-nav .nav-button {
    min-width: 0;
    min-height: 2.8rem;
    padding: 0.5rem 0.25rem;
    font-size: 0.72rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .toast {
    right: 0.6rem;
    bottom: calc(5.1rem + env(safe-area-inset-bottom));
    max-width: calc(100vw - 1.2rem);
    font-size: 0.86rem;
  }

  .account-dialog {
    width: calc(100vw - 0.5rem);
    max-height: calc(100dvh - 0.5rem);
    border-radius: 0.75rem;
  }

  .account-dialog .card {
    max-height: calc(100dvh - 0.5rem);
    padding: 0.8rem;
  }

  .account-dialog .section-heading {
    position: sticky;
    top: -0.8rem;
    z-index: 3;
    margin: -0.8rem -0.8rem 0.2rem;
    padding: 0.8rem;
    border-bottom: 1px solid var(--line);
    background: white;
  }

  .private-trip-page {
    padding-bottom: 0;
  }

  .form-submit-bar {
    position: sticky;
    bottom: calc(5rem + env(safe-area-inset-bottom));
    z-index: 5;
    margin: 0 -0.8rem;
    padding: 0.65rem 0.8rem;
    border-top: 1px solid var(--line);
    background: white;
  }

  .form-submit-bar .button {
    flex: 1;
  }

  .empty {
    padding: 1.6rem 0.8rem;
  }
}

@media (max-width: 390px) {
  .mobile-header .wordmark {
    font-size: 0.92rem;
  }

  .mobile-header .button {
    padding-inline: 0.42rem;
    font-size: 0.68rem;
  }

  .page-header {
    display: block;
  }

  .page-header .header-actions,
  .form-page-header > .button {
    margin-top: 0.6rem;
  }

  .calendar-day strong {
    display: none;
  }

  .financial-stats .stat strong {
    font-size: 1.1rem;
  }
}

[hidden] {
  display: none !important;
}

.place-controls { display:grid; gap:10px; margin-bottom:14px; min-width:0; }
.place-controls .trip-actions { display:flex; flex-wrap:wrap; gap:8px; }
.place-controls select { width:100%; min-width:0; }
.airport-details[hidden] { display:none !important; }
.airport-details { padding:12px; border:1px solid #dce1df; border-radius:12px; }
#assignment-responses { margin-top:20px; }
#assignment-responses summary { cursor:pointer; padding:12px 0; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.trip-message-panel { min-width:0; max-width:100%; }
.trip-message-panel summary { width:fit-content; margin-bottom:.75rem; }
.trip-message-panel textarea { width:100%; box-sizing:border-box; resize:vertical; }
.trip-import-result { margin-top:1rem; overflow-wrap:anywhere; }
.trip-import-result ul { padding-left:1.25rem; }
#import-review[hidden] { display:none; }

/* Keep scrolling inside the content pane. The dock occupies a real layout row,
   so iOS document scrolling cannot displace it or cover the last trip action. */
@media (max-width: 760px) {
  body.signed-in {
    height: 100%;
    overflow: hidden;
  }
  body.signed-in #app {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }
  body.signed-in .app-shell {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }
  body.signed-in .mobile-header {
    position: static;
    padding-top: calc(0.55rem + env(safe-area-inset-top));
  }
  body.signed-in .main {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-bottom: 1rem;
    scroll-padding-bottom: 1rem;
  }
  body.signed-in .mobile-nav {
    position: static !important;
    width: 100%;
    margin: 0;
    padding-left: max(0.45rem, env(safe-area-inset-left));
    padding-right: max(0.45rem, env(safe-area-inset-right));
  }
  body.signed-in .form-submit-bar {
    bottom: 0;
  }
}
