/* Requests first, compact fleet and accounting at the bottom. */
main:has(.carrierSignup) {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
main:has(.carrierSignup) > #homeSurface,
main:has(.carrierSignup) > .layout {
  display: contents;
}
main:has(.carrierSignup) > .notice {
  order: 0;
  margin: 0;
}
main:has(.carrierSignup) > .intro {
  order: 1;
  margin: 0;
}
main:has(.carrierSignup) .carrierSignup {
  order: 2;
  margin: 0;
  padding: 16px 20px;
}
main:has(.carrierSignup) .board {
  order: 3;
  width: 100%;
}
main:has(.carrierSignup) .fleetCards {
  order: 4;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 12px 0 0;
}
main:has(.carrierSignup) .fleetCards article {
  padding: 10px;
  text-align: center;
}
main:has(.carrierSignup) .fleetCards img {
  height: 76px;
  width: 100%;
  object-fit: contain;
}
main:has(.carrierSignup) .miniStat {
  order: 5;
  margin: 0;
}
main:has(.carrierSignup) aside {
  order: 6;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
  width: 100%;
}
.chatDisclaimer {
  font-size: 12px;
  line-height: 1.9;
  padding: 12px 14px;
  margin: 12px 0;
  border-inline-start: 3px solid #d96a25;
  background: #fff1e4;
  color: #6c4c32;
  border-radius: 8px;
}
.imageComposer {
  margin: 12px 0;
}
.imageDraft {
  margin-top: 12px;
}
.imageDraft img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 10px;
}
.imageStatus {
  font-size: 12px;
  margin-top: 7px;
}
.chatImage {
  display: block;
  max-width: 340px;
  text-decoration: none;
}
.chatImage img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
}
.chatImage small {
  display: block;
  margin-top: 5px;
}
.imageDraft[hidden] {
  display: none;
}
#themeToggle {
  width: 42px;
  height: 42px;
  padding: 6px;
  font-size: 21px;
  flex-shrink: 0;
}
.soubWordmark .roadMark {
  display: none;
}
.brandRoad {
  display: block;
  width: 156px;
  height: 34px;
  position: relative;
  overflow: hidden;
  margin-top: 4px;
  border-radius: 5px;
  background: linear-gradient(#92999f 0 2px, #626971 2px 32px, #92999f 32px);
  direction: ltr;
}
.brandRoad:before {
  content: '';
  position: absolute;
  inset: 17px 0 auto;
  height: 2px;
  background: repeating-linear-gradient(90deg, #fff 0 14px, transparent 14px 24px);
  opacity: 0.8;
}
.roadVehicle {
  position: absolute;
  bottom: 3px;
  font-size: 25px;
  line-height: 1;
  animation: driveRoad 8s linear infinite;
  z-index: 1;
  filter: drop-shadow(0 2px 1px #0006);
}
.roadVehicle.truck {
  animation-delay: -4s;
}
.roadVehicle.bike {
  animation-delay: 0s;
}
@keyframes driveRoad {
  from {
    transform: translateX(170px);
  }
  to {
    transform: translateX(-55px);
  }
}
html[data-theme='night'] {
  color-scheme: dark;
  --ink: #e9edf5;
  --muted: #b3bfd1;
  --line: #384457;
  --green: #f47b35;
}
html[data-theme='night'] body {
  background: #101721;
  color: #e9edf5;
}
html[data-theme='night']
  :is(
    header,
    .board,
    .panel,
    dialog,
    .dialogPinnedHeader,
    .dialogPinnedFooter,
    .notificationPanel,
    .roleLanding.designLanding,
    .card,
    .fleetCards article,
    .carrierSignup,
    .homeWelcome,
    .accountCard
  ) {
  background: #182231 !important;
  border-color: #384457 !important;
  color: #e9edf5;
}
html[data-theme='night']
  :is(
    h1,
    h2,
    h3,
    h4,
    label,
    .brand b,
    .soubWordmark b,
    .soubWordmark small,
    .landingTitle h2,
    .landingTitle p,
    .landingCaption,
    .serviceCopy
  ) {
  color: #eef2fa;
}
html[data-theme='night'] :is(p, small, time, .editIntro) {
  color: #b3bfd1;
}
html[data-theme='night']
  :is(input, select, textarea, button.outline, button.close, nav button, #switchRole, #themeToggle) {
  background: #222f40;
  color: #edf2fa;
  border-color: #465267;
}
html[data-theme='night']
  :is(
    .notice,
    .miniStat > div,
    .locationBox,
    .vehicleMapSetup,
    .negotiationPanel,
    .deliveryPanel,
    .voiceComposer,
    .imageComposer,
    .quantityInfo,
    .notificationItem,
    .welcomeContent,
    .offer,
    .roleChoice.operatorChoice,
    .roleChoice.carrierChoice
  ) {
  background: #253244 !important;
  border-color: #465267 !important;
  color: #eef2fa;
}
html[data-theme='night'] :is(.accepted, .agreementBox, .agreementDetails, .messageList article) {
  background: #233246 !important;
  color: #eef2fa;
}
html[data-theme='night'] .messageList .mineMessage {
  background: #443226 !important;
}
html[data-theme='night'] :is(.chatDisclaimer, .notificationItem.unread) {
  background: #3c3027;
  color: #f3d2b8;
}
html[data-theme='night'] :is(.primary, nav button.active) {
  background: #dc580d !important;
  color: #fff !important;
}
html[data-theme='night'] .serviceArt {
  mix-blend-mode: normal;
  border-radius: 12px;
}
html[data-theme='night'] .brandRoad {
  background: linear-gradient(#6f849b 0 1px, #172536 2px, #34485c 70%, #142133);
  box-shadow:
    0 3px 12px #60a9ea30,
    inset 0 -5px 8px #b8d5ec30;
}
html[data-theme='night'] .roadVehicle:before {
  content: '';
  position: absolute;
  right: 70%;
  top: 10px;
  width: 55px;
  height: 15px;
  background: linear-gradient(90deg, transparent, #fff3bca6);
  clip-path: polygon(0 0, 100% 40%, 100% 60%, 0 100%);
  filter: blur(2px);
}
html[data-theme='night'] .roadVehicle:after {
  content: '';
  position: absolute;
  right: 65%;
  top: 23px;
  width: 48px;
  height: 7px;
  background: linear-gradient(90deg, transparent, #fff1b77a);
  filter: blur(3px);
  transform: skewX(25deg);
}
.landingScene {
  position: relative;
  isolation: isolate;
}
html[data-theme='night'] .landingScene {
  background-blend-mode: multiply;
  background-color: #687887;
}
html[data-theme='night'] .landingScene:before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 10px 6px at 80% 63%, #fffbd6 25%, #ffe9ad80 60%, transparent 100%),
    radial-gradient(ellipse 10px 6px at 45% 63%, #fffbd6 25%, #ffe9ad80 60%, transparent 100%),
    radial-gradient(ellipse 6px 7px at 36% 78%, #fff9cd 25%, #ffebac80 65%, transparent 100%);
  filter: drop-shadow(0 0 8px #ffdc86);
}
html[data-theme='night'] .landingScene:after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 12% 3% at 76% 76%, #ffe7a34a, transparent),
    radial-gradient(ellipse 12% 3% at 47% 75%, #ffe7a34a, transparent),
    radial-gradient(ellipse 9% 2% at 35% 88%, #ffe7a340, transparent);
  mix-blend-mode: screen;
}
@media (max-width: 700px) {
  .brandRoad {
    width: 130px;
    height: 32px;
  }
  main:has(.carrierSignup) .fleetCards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  main:has(.carrierSignup) .fleetCards img {
    height: 58px;
  }
  main:has(.carrierSignup) .fleetCards article {
    font-size: 11px;
    padding: 7px;
  }
  html[data-theme='night'] .landingScene:before {
    background:
      radial-gradient(ellipse 7px 5px at 69% 57%, #fffbd6 25%, transparent),
      radial-gradient(ellipse 7px 5px at 48% 57%, #fffbd6 25%, transparent),
      radial-gradient(ellipse 5px 5px at 28% 77%, #fffbd6 25%, transparent);
  }
  html[data-theme='night'] .landingScene:after {
    background:
      radial-gradient(ellipse 14% 3% at 65% 75%, #ffe7a350, transparent),
      radial-gradient(ellipse 12% 3% at 28% 88%, #ffe7a340, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .roadVehicle {
    animation: none;
    left: 15px;
  }
  .roadVehicle.truck {
    left: 90px;
  }
}

/* Night switch follows the supplied crescent, stars and white slider reference. */
#themeToggle {
  width: 90px;
  height: 44px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 24px;
  background: transparent !important;
  box-shadow: none;
  direction: ltr;
}
.themeSky {
  display: block;
  position: relative;
  width: 90px;
  height: 44px;
  background: #0a1b25;
  border: 2px solid #f7fcff;
  border-radius: 24px;
  box-shadow: 0 0 0 1px #64798b;
  overflow: hidden;
}
.themeMoon {
  position: absolute;
  right: 7px;
  top: 5px;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #fff02e;
  box-shadow: 0 0 7px #fff02140;
}
.themeMoon:after {
  content: '';
  position: absolute;
  right: 7px;
  top: -5px;
  width: 27px;
  height: 27px;
  background: #0a1b25;
  border-radius: 50%;
}
.themeStars {
  position: absolute;
  left: 44px;
  top: 2px;
  color: #ffed33;
  font-size: 12px;
  line-height: 15px;
}
.themeStars i {
  display: block;
  font-size: 9px;
  font-style: normal;
  margin-left: 2px;
}
.themeKnob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 34px;
  height: 34px;
  background: #fff;
  border: 2px solid #e7eef4;
  border-radius: 50%;
  box-shadow: 0 1px 4px #0008;
  transition: transform 0.2s;
}
html:not([data-theme='night']) .themeKnob {
  transform: translateX(46px);
}
html:not([data-theme='night']) .themeSky {
  background: #80b9d8;
}
html:not([data-theme='night']) .themeMoon {
  left: 7px;
  right: auto;
  background: #ffe270;
}
html:not([data-theme='night']) .themeMoon:after,
html:not([data-theme='night']) .themeStars {
  display: none;
}
main:has(.carrierSignup) > footer {
  order: 10;
  width: 100%;
  margin-top: 20px;
}
main:has(.carrierSignup) > .intro {
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.topCommission {
  width: 340px;
  max-width: 100%;
  flex-shrink: 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdfa;
}
.topCommission h2 {
  font-size: 17px;
  margin: 0;
}
.topCommission .commissionEquation {
  margin: 3px 0;
  justify-content: flex-start;
  font-size: 21px;
}
.topCommission .commissionSummary {
  margin: 0;
}
.topCommission .commissionSummary p {
  font-size: 11px;
  line-height: 1.6;
  margin: 2px 0;
}
.topCommission .commissionProgress {
  margin: 6px 0;
  height: 4px;
}

main:has(.carrierSignup) .fleetHeading {
  order: 4;
  margin: 16px 0 -10px;
  font-size: 22px;
}
main:has(.carrierSignup) .miniStat {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
main:has(.carrierSignup) aside .panel.dark {
  display: none;
}
/* Keep the background crop and lamps in the same coordinate system at every width. */
.landingScene {
  align-self: center;
  min-height: 0;
  aspect-ratio: 590/730;
  width: 100%;
  max-height: none;
}
html[data-theme='night'] .landingScene:before,
html[data-theme='night'] .landingScene:after {
  display: none;
}
.headlightLayer {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
html[data-theme='night'] .headlightLayer {
  display: block;
}
/* Lamp centers follow the actual v77 photo assets, with a local lens halo only. */
.headlight {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w, 1.6%);
  height: var(--h, 0.7%);
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg));
  border-radius: 50%;
  background: radial-gradient(ellipse, #fffff6 22%, #fff7d8 55%, #ffe6a855, transparent 85%);
  box-shadow:
    0 0 3px 1px #fff4cd99,
    0 0 9px 3px #ffdfa64d;
}
.headlight:before {
  content: '';
  position: absolute;
  inset: -100% -80%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #fff3cc40, transparent 70%);
  filter: blur(3px);
}
.headlight:after {
  content: none;
}
/* Explicit surfaces and text pairs avoid white-on-white and navy-on-navy sections. */
html[data-theme='night']
  :is(
    .toolbar,
    #carrierCityFilters,
    .contact,
    .requestRoutePreview,
    .requestRouteSection,
    .driverHireButton,
    .equipmentFacts,
    .editNotice,
    .driverGrid article,
    .driverBooking,
    .topCommission,
    footer,
    .welcomeChoice,
    .category,
    .vehiclePreview
  ) {
  background: #1e2c3e !important;
  border-color: #43536b !important;
  color: #eef3fb !important;
}
html[data-theme='night']
  :is(
    .route,
    .route b,
    .card h3,
    .card h2,
    .commissionEquation,
    .commissionEquation b,
    .commissionTotal,
    .price,
    .requestRoutePreview b,
    .requestRouteSection b,
    .driverHireButton b,
    .driverHireButton span,
    .equipmentFacts b
  ) {
  color: #eef3fb !important;
}
html[data-theme='night']
  :is(
    .toolbar h2,
    #carrierCityFilters label,
    .requestRoutePreview p,
    .requestRouteSection p,
    .contact p,
    .driverHireButton small,
    .topCommission small,
    footer
  ) {
  color: #c7d3e5 !important;
}
html[data-theme='night']
  :is(.requestRoutePreview a, .requestRouteSection a, .contact a, .distanceInfo, .distanceInfo b) {
  color: #ffc48e !important;
}
html[data-theme='night']
  :is(
    .notificationBell,
    .voiceRecord,
    .chip,
    .step .num,
    .roleSwitchIcon,
    .cargoGallery button,
    .ratingChoices button
  ) {
  background: #2b3c52 !important;
  color: #eef3fb !important;
  border-color: #43536b !important;
}
html[data-theme='night'] #detailsDialog .dialoghead .close {
  background: #2b3c52 !important;
  color: #eef3fb !important;
}
html[data-theme='night'] :is(.editButton, .receiptPending, .pendingReceipt) {
  background: #433521 !important;
  color: #ffe0a6 !important;
  border-color: #796342 !important;
}
html[data-theme='night'] :is(.cancelButton, .mapHideButton) {
  background: #432731 !important;
  color: #ffd3d8 !important;
  border-color: #86505b !important;
}
html[data-theme='night'] :is(.receiptDone, .mapShowButton, .sentMark, .pointButton.pointSelected) {
  background: #1d3b33 !important;
  color: #c3f5df !important;
  border-color: #40745e !important;
}
html[data-theme='night'] .acceptedPhoto {
  background: #26364b !important;
  color: #eef3fb !important;
}
html[data-theme='night'] :is(.dialogScrollBody, dialog) {
  scrollbar-color: #65758b #182231;
}
html[data-theme='night'] .ratingChoices button.filled {
  color: #ffe074 !important;
}
@media (max-width: 700px) {
  #themeToggle {
    width: 76px;
    transform: scale(0.86);
    transform-origin: center;
  }
  .topCommission {
    width: 100%;
  }
  main:has(.carrierSignup) > .intro {
    align-items: stretch;
  }
  .landingScene {
    aspect-ratio: 337/260;
    max-height: none;
  }
  .headlight {
    left: var(--mx);
    top: var(--my);
    width: var(--mw, 1.35%);
    height: var(--mh, 0.95%);
    box-shadow:
      0 0 2px 1px #fff4cd80,
      0 0 6px 2px #ffdfa640;
  }
}
@media (prefers-reduced-motion: reduce) {
  .themeKnob {
    transition: none;
  }
}

html[data-theme='night']
  :is(.acceptedSummary, .deliveryEvidence, .agreementSuccess, .accountSurface, .driverCard) {
  background: #223044 !important;
  border-color: #465267 !important;
  color: #edf2fa;
}
html[data-theme='night'] :is(.acceptedSummary p, .deliveryEvidence p, .negotiationPanel p) {
  color: #c1cbdb;
}
html[data-theme='night'] :is(.badge, .pill) {
  background: #30415a;
  color: #e8effa;
}
html[data-theme='night'] .driverMessageButton {
  background: #dc580d !important;
  border-color: #dc580d !important;
}
html[data-theme='night'] .agreementStatus.delivered {
  background: #193e32;
  color: #b8efce;
}
html[data-theme='night'] .agreementStatus.agreed {
  background: #443522;
  color: #ffd99e;
}

html[data-theme='night'] .route .city {
  color: #f5f8ff !important;
}
html[data-theme='night'] .route .city small {
  color: #c5d0e1 !important;
}
.board > .toolbar[hidden],
#carrierCityFilters[hidden] {
  display: none !important;
}
