:root {
  --black: #000000;
  --ink: #111111;
  --muted: #5e5e5e;
  --line: #e2e2e2;
  --panel: #ffffff;
  --soft-panel: #f5f5f5;
  --map: #e6ebe7;
  --road: #c3cdc7;
  --route: #161f2c;
  --green: #0e8345;
  --blue: #286ef0;
  --header: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--panel);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
}

body[data-theme="dark"] {
  --black: #ffffff;
  --ink: #f5f7f6;
  --muted: #b6beb9;
  --line: #2b332f;
  --panel: #101412;
  --soft-panel: #1a201d;
  --map: #202823;
  --road: #39423d;
  --route: #eef5f0;
  --green: #39b86f;
  --blue: #78a7ff;
  --header: #0b0f0d;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.loading-screen {
  align-items: center;
  background: var(--panel);
  display: grid;
  inset: 0;
  justify-items: center;
  opacity: 1;
  pointer-events: auto;
  position: fixed;
  transition: opacity 220ms ease, visibility 220ms ease;
  visibility: visible;
  z-index: 100;
}

.loading-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.loading-panel {
  display: grid;
  gap: 14px;
  width: min(280px, calc(100vw - 48px));
}

.loading-line,
.loading-dot {
  animation: loadingPulse 1s ease-in-out infinite alternate;
  background: var(--soft-panel);
  display: block;
}

.loading-line {
  border-radius: 999px;
  height: 14px;
}

.loading-line.wide {
  height: 22px;
  width: 86%;
}

.loading-line.short {
  width: 48%;
}

.loading-line.mid {
  width: 68%;
}

.loading-dot {
  border-radius: 50%;
  height: 70px;
  margin: 8px 0;
  width: 70px;
}

@keyframes loadingPulse {
  from {
    opacity: 0.55;
  }

  to {
    opacity: 1;
  }
}

.site-header {
  align-items: center;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-left,
.nav-right {
  align-items: center;
  display: flex;
  gap: 28px;
}

.nav-left a,
.nav-right a {
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
}

.wordmark {
  font-size: 28px !important;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.signup {
  background: var(--ink);
  border-radius: 999px;
  color: var(--panel) !important;
  font-weight: 700;
  padding: 11px 17px;
}

.theme-toggle,
.locale-toggle {
  background: var(--soft-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  min-height: 34px;
  padding: 0 14px;
}

.theme-toggle:focus-visible,
.locale-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.page {
  display: grid;
  grid-template-columns: 424px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.trip-card {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 34px 36px 28px 40px;
  position: relative;
  z-index: 2;
}

.sheet-handle {
  display: none;
}

.demo-banner {
  align-items: center;
  background: var(--soft-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 10px 12px;
}

.demo-banner strong {
  font-size: 13px;
}

.demo-banner span {
  color: var(--muted);
  font-size: 12px;
}

.status-row {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

h1 {
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

.rating {
  align-items: center;
  background: var(--soft-panel);
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  display: flex;
  gap: 5px;
  padding: 6px 10px;
}

.rating span {
  color: var(--ink);
  font-size: 13px;
}

.rating strong {
  font-size: 13px;
}

.trip-timeline {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0;
  list-style: none;
  margin: 26px 0 0;
  padding: 0 0 24px;
}

.trip-timeline li {
  color: var(--muted);
  display: grid;
  gap: 12px;
  grid-template-columns: 18px 1fr;
  min-height: 46px;
  position: relative;
}

.trip-timeline li + li {
  padding-top: 10px;
}

.trip-timeline li::after {
  background: var(--line);
  content: "";
  height: calc(100% - 18px);
  left: 8px;
  position: absolute;
  top: 20px;
  width: 2px;
}

.trip-timeline li:last-child::after {
  display: none;
}

.trip-timeline span {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 50%;
  height: 18px;
  margin-top: 1px;
  position: relative;
  width: 18px;
  z-index: 1;
}

.trip-timeline strong {
  color: inherit;
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.trip-timeline p {
  font-size: 12px;
  line-height: 1.35;
  margin: 4px 0 0;
}

.trip-timeline .is-complete {
  color: var(--ink);
}

.trip-timeline .is-complete::after {
  background: var(--green);
}

.trip-timeline .is-complete span {
  background: var(--green);
  border-color: var(--green);
}

.trip-timeline .is-complete span::after {
  border-bottom: 2px solid var(--panel);
  border-right: 2px solid var(--panel);
  content: "";
  height: 7px;
  left: 5px;
  position: absolute;
  top: 2px;
  transform: rotate(45deg);
  width: 4px;
}

.trip-timeline .is-current {
  color: var(--ink);
}

.trip-timeline .is-current span {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(14, 131, 69, 0.12);
}

.trip-timeline .is-current span::after {
  background: var(--ink);
  border-radius: 50%;
  content: "";
  height: 6px;
  left: 4px;
  position: absolute;
  top: 4px;
  width: 6px;
}

.identity {
  display: grid;
  grid-template-columns: 80px 1fr;
  margin-top: 30px;
  padding-bottom: 28px;
}

.portrait {
  align-self: center;
  border-radius: 50%;
  grid-row: 1 / span 4;
  height: 66px;
  object-fit: cover;
  width: 66px;
}

.vehicle-photo {
  align-items: center;
  background: var(--soft-panel);
  border-radius: 3px;
  display: grid;
  height: 84px;
  justify-items: center;
  overflow: hidden;
  width: 164px;
}

.vehicle-photo img {
  display: block;
  max-height: 74px;
  max-width: 152px;
  object-fit: contain;
}

.plate {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-top: 14px;
}

.vehicle-name {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  margin: 7px 0 18px;
}

.driver-name {
  font-size: 16px;
}

.driver-actions {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  padding: 0 0 24px;
}

.driver-actions button {
  background: var(--soft-panel);
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  min-height: 42px;
  padding: 0 14px;
}

.driver-actions button:hover {
  background: var(--soft-panel);
}

.driver-actions button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.action-toast {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 10px 0 0;
  min-height: 17px;
}

.stops {
  border-bottom: 1px solid var(--line);
  list-style: none;
  margin: 0;
  padding: 26px 0 28px;
}

.stops li {
  display: grid;
  gap: 15px;
  grid-template-columns: 22px 1fr auto;
  min-height: 70px;
  position: relative;
}

.stops li + li {
  margin-top: 14px;
}

.stops li:first-child::after {
  background: var(--line);
  content: "";
  height: 62px;
  left: 10px;
  position: absolute;
  top: 24px;
  width: 2px;
}

.stop-icon {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 50%;
  height: 20px;
  margin-top: 2px;
  position: relative;
  width: 20px;
  z-index: 1;
}

.stop-icon.selected::after {
  background: var(--ink);
  border-radius: 50%;
  content: "";
  height: 8px;
  left: 3px;
  position: absolute;
  top: 3px;
  width: 8px;
}

.stop-icon.square {
  background: var(--ink);
  border-radius: 3px;
}

.stop-copy strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.stop-copy p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  margin: 6px 0 0;
}

.navigate {
  align-self: start;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.share-panel {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 92px;
  padding: 24px 0;
}

.share-copy h2 {
  font-size: 16px;
  line-height: 1.2;
  margin: 0;
}

.share-copy p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 6px 0 14px;
}

.share-copy button {
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  color: var(--panel);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  padding: 0 14px;
}

.share-copy button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.preview-link {
  color: var(--blue);
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  margin-left: 10px;
}

.qr-code {
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(11, 1fr);
  height: 92px;
  padding: 7px;
  width: 92px;
}

.qr-code span {
  background: var(--panel);
  display: block;
}

.qr-code span.is-dark {
  background: var(--ink);
}

.safety-card {
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}

.safety-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
}

.safety-heading > span {
  align-items: center;
  background: var(--ink);
  border-radius: 50%;
  color: var(--panel);
  display: grid;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  height: 24px;
  place-items: center;
  width: 24px;
}

.safety-heading h2 {
  font-size: 16px;
  line-height: 1.2;
  margin: 0;
}

.safety-heading p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 5px 0 0;
}

.safety-card dl {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin: 18px 0;
}

.safety-card dl > div {
  background: var(--soft-panel);
  border-radius: 6px;
  padding: 10px 12px;
}

.safety-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.safety-card dd {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
}

.safety-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.safety-actions button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 12px;
}

.safety-actions button:hover {
  background: var(--soft-panel);
}

.safety-actions button[data-safety-action="emergency"] {
  border-color: var(--ink);
}

.safety-actions button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.privacy {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  gap: 12px;
  padding-top: 24px;
}

.privacy span {
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  display: grid;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  height: 22px;
  place-items: center;
  width: 22px;
}

.privacy p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.privacy a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}

.map-wrap {
  background: var(--map);
  min-height: calc(100vh - 64px);
  overflow: hidden;
  position: relative;
}

#map {
  display: block;
  height: 100%;
  min-height: calc(100vh - 64px);
  width: 100%;
}

.leaflet-container {
  font-family: Arial, Helvetica, sans-serif;
}

.leaflet-tile-pane {
  filter: grayscale(1) saturate(0.35) contrast(0.95) brightness(1.08);
}

body[data-theme="dark"] .leaflet-tile-pane {
  filter: grayscale(1) invert(1) saturate(0.22) contrast(0.92) brightness(0.72);
}

.leaflet-control-attribution {
  font-size: 10px;
}

.map-status {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  left: 50%;
  padding: 9px 14px;
  position: absolute;
  top: 24px;
  transform: translateX(-50%);
  z-index: 700;
}

.map-label {
  align-items: center;
  background: var(--panel);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  display: flex;
  gap: 10px;
  max-width: 230px;
  padding: 10px 12px;
  position: absolute;
  z-index: 700;
}

.map-label::before {
  border: 8px solid transparent;
  border-top-color: var(--panel);
  bottom: -16px;
  content: "";
  left: 22px;
  position: absolute;
}

.map-label span {
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-label strong {
  font-size: 13px;
}

.map-label.from {
  left: 108px;
  top: 132px;
}

.map-label.to {
  bottom: 104px;
  right: 132px;
}

.zoom-controls {
  bottom: 24px;
  display: grid;
  gap: 10px;
  position: absolute;
  right: 24px;
  z-index: 700;
}

.zoom-controls button {
  background: var(--panel);
  border: 0;
  border-radius: 2px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  color: var(--ink);
  display: grid;
  font-size: 24px;
  font-weight: 700;
  height: 42px;
  place-items: center;
  width: 42px;
}

.inspector-toggle {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  bottom: 24px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  left: 24px;
  min-height: 36px;
  padding: 0 14px;
  position: absolute;
  z-index: 710;
}

.graphql-inspector {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  bottom: 72px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  color: var(--ink);
  left: 24px;
  max-width: min(440px, calc(100vw - 48px));
  padding: 14px;
  position: absolute;
  width: 380px;
  z-index: 720;
}

.graphql-inspector > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.graphql-inspector h2 {
  font-size: 14px;
  line-height: 1.2;
  margin: 0;
}

.graphql-inspector button {
  background: var(--soft-panel);
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 30px;
  padding: 0 12px;
}

.graphql-inspector pre {
  background: var(--soft-panel);
  border-radius: 6px;
  color: var(--ink);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin: 0;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.map-marker {
  align-items: center;
  background: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 50%;
  display: grid;
  height: 24px;
  justify-items: center;
  width: 24px;
}

.leaflet-marker-icon.map-marker,
.leaflet-marker-icon.map-vehicle-icon {
  background: transparent;
  border: 0;
}

.map-marker::after {
  background: var(--ink);
  border-radius: 50%;
  content: "";
  height: 8px;
  width: 8px;
}

.map-marker.dropoff {
  background: var(--ink);
  border-radius: 3px;
}

.map-marker.dropoff::after {
  display: none;
}

.map-vehicle-marker {
  height: 54px;
  transform: rotate(var(--vehicle-rotation, 28deg));
  transform-origin: 50% 50%;
  width: 82px;
  will-change: transform;
}

.map-vehicle-marker img {
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.preview-page {
  min-height: 100vh;
}

.preview-shell {
  display: grid;
  min-height: calc(100vh - 64px);
  padding: 48px 24px;
  place-items: center;
}

.preview-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  max-width: 780px;
  overflow: hidden;
  width: 100%;
}

.preview-icon-row {
  align-items: center;
  display: flex;
  gap: 20px;
  padding: 24px;
}

.preview-icon-row img {
  border-radius: 22px;
  height: 86px;
  width: 86px;
}

.preview-icon-row h1 {
  font-size: 28px;
}

.preview-icon-row p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  margin: 8px 0 0;
}

.preview-og {
  display: block;
  width: 100%;
}

.preview-meta {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 20px 24px 24px;
}

.preview-meta div {
  background: var(--soft-panel);
  border-radius: 6px;
  padding: 12px;
}

.preview-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.preview-meta dd {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .site-header {
    height: 58px;
    padding: 0 18px;
  }

  .nav-left {
    gap: 20px;
  }

  .nav-left a:not(.wordmark),
  .nav-right a:first-child {
    display: none;
  }

  .page {
    display: block;
    min-height: calc(100vh - 58px);
  }

  .trip-card {
    border-radius: 22px 22px 0 0;
    border-right: 0;
    border-top: 1px solid var(--line);
    bottom: 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.14);
    left: 0;
    max-height: 72vh;
    overflow-y: auto;
    padding: 18px 20px 36px;
    position: fixed;
    right: 0;
    transform: translateY(0);
    transition: transform 220ms ease;
    z-index: 20;
  }

  body.sheet-collapsed .trip-card {
    transform: translateY(calc(100% - 158px));
  }

  .sheet-handle {
    background: transparent;
    border: 0;
    cursor: grab;
    display: grid;
    height: 22px;
    margin: 0 0 8px;
    padding: 0;
    place-items: center;
    width: 100%;
  }

  .sheet-handle span {
    background: var(--line);
    border-radius: 999px;
    display: block;
    height: 4px;
    width: 42px;
  }

  .sheet-handle:active {
    cursor: grabbing;
  }

  .trip-timeline {
    margin-top: 22px;
  }

  .map-wrap {
    min-height: calc(100vh - 58px);
  }

  #map {
    min-height: calc(100vh - 58px);
  }

  .map-label.from {
    left: 18px;
    top: 86px;
  }

  .map-label.to {
    bottom: 24px;
    right: 82px;
  }

  .share-panel {
    grid-template-columns: 1fr 84px;
  }

  .qr-code {
    height: 84px;
    width: 84px;
  }

  .preview-shell {
    padding: 28px 16px;
  }

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

  .preview-meta {
    grid-template-columns: 1fr;
  }

  .map-status {
    top: 18px;
  }

  .inspector-toggle {
    bottom: 18px;
    left: 18px;
  }

  .graphql-inspector {
    bottom: 62px;
    left: 18px;
    max-width: calc(100vw - 36px);
  }

}
