/* TooWe Passenger Home v2.0 PE-1.
   Scope: Home content only. Top Navigation, Bottom Navigation and Halo stay
   owned by their frozen shared components. */

.tw-plain-app:has(.tw-home) > h1 {
  display: none;
}

.tw-plain-app:has(.tw-home) {
  max-width: 430px;
  padding: calc(88px + env(safe-area-inset-top)) 16px var(--tw-bottom-nav-content-inset);
  scroll-padding-bottom: var(--tw-bottom-nav-content-inset);
}

.tw-home {
  --tw-home-ink: #070a2d;
  --tw-home-muted: #5f6680;
  --tw-home-line: rgba(7, 10, 45, 0.1);
  --tw-home-primary: #5a35f2;
  --tw-home-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  --tw-home-control-height: var(--tw-control-height-md, 48px);
  --tw-home-control-radius: var(--tw-radius-control-md, 14px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--tw-home-ink);
}

.tw-home-header {
  margin: 0;
}

.tw-home-greeting h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 0;
}

.tw-home-moment-root:empty {
  display: none;
}

.tw-home-moment-root {
  width: 100%;
}

.tw-home-moment-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 18px;
}

.tw-home-moment-track {
  display: flex;
  width: 100%;
  max-width: 100%;
  align-items: flex-start;
  gap: 0;
  border-radius: inherit;
  touch-action: pan-y;
  transform: translate3d(0, 0, 0);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.tw-home-moment {
  container-type: inline-size;
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 1.8 / 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

.tw-home-moment::before {
  content: none;
}

.tw-home-moment::after {
  content: none;
}

.tw-home-moment-background {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  object-position: center;
}

.tw-home-moment-scrim {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.08) 32%, rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
}

.tw-home-moment-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  color: #ffffff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.tw-home-moment-icon-region {
  position: absolute;
  top: 24%;
  left: -1.5%;
  width: 25.5%;
  height: 46%;
}

.tw-home-moment-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tw-home-moment-copy {
  position: absolute;
  top: 11%;
  right: 48.1%;
  bottom: 18%;
  left: 21%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.tw-home-moment:not(.tw-home-moment-weather) .tw-home-moment-copy {
  top: 11%;
}

.tw-home-moment-primary {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  font-size: clamp(18px, 10cqw, 24px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.tw-home-moment-title {
  display: -webkit-box;
  max-width: 100%;
  max-height: 2.16em;
  margin: 3px 0 0;
  overflow: hidden;
  padding: 0 0 1px;
  font-size: clamp(11px, 7.2cqw, 16px);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tw-home-moment:not(.tw-home-moment-weather) .tw-home-moment-primary,
.tw-home-moment:not(.tw-home-moment-weather) .tw-home-moment-title {
  max-height: 2.16em;
  margin-top: 0;
  font-size: clamp(11px, 5.9cqw, 13px);
  line-height: 1.08;
}

.tw-home-moment-weather .tw-home-moment-secondary {
  margin-top: 10px;
}

.tw-home-moment:not(.tw-home-moment-weather) .tw-home-moment-secondary {
  margin-top: 10px;
}

.tw-home-moment-secondary {
  display: block;
  max-height: 2.24em;
  margin: 0;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: pre-line;
}

.tw-home-moment-dots {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 5%;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
  pointer-events: none;
}

.tw-home-moment-dots button {
  display: block !important;
  width: 7px !important;
  min-width: 7px !important;
  height: 7px !important;
  min-height: 7px !important;
  margin: 0;
  padding: 0 !important;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
}

.tw-home-moment-dots button.active {
  width: 18px !important;
  min-width: 18px !important;
  background: #ffffff;
}

.tw-home-moment-dots button:focus-visible {
  outline: 3px solid var(--tw-home-primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .tw-home-moment-track {
    transition-duration: 1ms;
  }
}

.tw-home-search-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.tw-home-search-card.tw-c-input-field.tw-c-search-field {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 44px 1px 44px;
  grid-template-areas: "icon text clear sep mic";
  column-gap: 4px;
  align-items: center;
  height: var(--tw-home-control-height);
  min-height: var(--tw-home-control-height);
  padding: 0 4px 0 10px;
  border: 1px solid var(--tw-home-line);
  border-radius: var(--tw-home-control-radius);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
  color: var(--tw-home-ink);
}

.tw-home-search-card--origin {
  grid-template-areas: "icon text clear sep mic";
}

.tw-home-search-card--origin .tw-home-search-icon {
  grid-area: icon;
}

.tw-home-search-card--origin .tw-home-search-text {
  grid-area: text;
}

.tw-home-search-card--origin .tw-home-clear-button {
  grid-area: clear;
}

.tw-home-search-card--origin .tw-home-search-separator--before-mic {
  grid-area: sep;
}

.tw-home-search-card--origin .tw-home-mic-button {
  grid-area: mic;
}

.tw-home-search-card--destination {
  grid-template-areas: "icon text clear sep mic";
}

.tw-home-search-card--destination .tw-home-search-icon {
  grid-area: icon;
}

.tw-home-search-card--destination .tw-home-search-text {
  grid-area: text;
}

.tw-home-search-card--destination .tw-home-clear-button {
  grid-area: clear;
}

.tw-home-search-card--destination .tw-home-search-separator--before-mic {
  grid-area: sep;
}

.tw-home-search-card--destination .tw-home-mic-button {
  grid-area: mic;
}

.tw-home-search-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: var(--tw-home-primary);
}

.tw-home-search-card--destination .tw-home-search-icon {
  color: #ff9d18;
}

.tw-home-search-icon svg {
  width: 19px;
  height: 19px;
}

.tw-home-search-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tw-home-search-text label {
  display: block;
  margin: 0;
  font-size: 12px;
  line-height: 14px;
  font-weight: 700;
  color: var(--tw-home-ink);
}

.tw-home-search-text input {
  width: 100%;
  min-width: 0;
  min-height: 0 !important;
  margin: 2px 0 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  background: transparent !important;
  color: var(--tw-home-muted);
  font: 500 var(--tw-font-control-size, 16px) / var(--tw-font-control-line, 20px) var(--tw-font-family) !important;
}

.tw-home-search-text input::placeholder {
  color: var(--tw-home-muted);
  opacity: 1;
}

.tw-home-search-text small {
  display: none;
}

.tw-home-search-separator {
  width: 1px;
  height: 26px;
  background: rgba(7, 10, 45, 0.07);
}

.tw-home-search-separator--before-clear {
  display: none;
}

.tw-home-clear-button,
.tw-home-mic-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tw-home-ink);
}

.tw-home-clear-button {
  color: #6b7280;
}

.tw-home-clear-button[hidden] {
  display: none;
}

.tw-home-search-card.tw-c-input-field.tw-c-search-field[data-is-clearable="false"] {
  grid-template-areas: "icon text text sep mic";
}

.tw-home-search-card.tw-c-input-field.tw-c-search-field[data-home-route-field="true"] {
  grid-template-columns: 36px minmax(0, 1fr) 1px 44px;
  grid-template-areas: "icon text sep action";
}

.tw-home-search-card[data-home-route-field="true"] .tw-home-clear-button,
.tw-home-search-card[data-home-route-field="true"] .tw-home-mic-button {
  grid-area: action;
}

.tw-home-search-card[data-home-route-field="true"][data-is-clearable="true"] .tw-home-mic-button,
.tw-home-search-card[data-home-route-field="true"][data-is-clearable="false"] .tw-home-clear-button {
  display: none;
}

.tw-home-search-card[data-home-route-field="true"] .tw-home-search-text input:not(:placeholder-shown) {
  color: var(--tw-home-ink);
}

.tw-home-clear-button svg,
.tw-home-mic-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

.tw-home-mic-button {
  background: transparent;
  color: #070a2d;
}

.tw-home-submit-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.tw-home-primary-action-zone {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.tw-home-primary-action-zone .tw-c-primary-button {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--tw-home-control-radius);
  background: var(--tw-home-primary);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(90, 53, 242, 0.2);
  font: 800 15px / 20px var(--tw-font-family);
  text-decoration: none;
  cursor: pointer;
}

.tw-home-primary-action-zone .tw-c-primary-button[disabled],
.tw-home-primary-action-zone .tw-c-primary-button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.tw-home-primary-action-zone .tw-c-primary-button.loading::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: twHomeButtonLoading 0.72s linear infinite;
}

.tw-home-primary-error {
  min-height: 16px;
  margin: 0;
  color: #f21654;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}

.tw-home-primary-error[hidden] {
  display: none;
}

@keyframes twHomeButtonLoading {
  to {
    transform: rotate(360deg);
  }
}

.tw-home-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tw-home-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tw-home-section-title h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--tw-home-ink);
}

.tw-home-section-title a {
  color: var(--tw-home-primary);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
  text-decoration: none;
}

.tw-home-address-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.tw-home-address-card {
  min-width: 0;
  min-height: 66px;
  padding: 8px 5px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--tw-home-line);
  border-radius: 13px;
  background: #ffffff;
  color: var(--tw-home-primary);
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.04);
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}

.tw-home-address-card span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
}

.tw-home-address-card svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

.tw-home-address-card strong {
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 9.5px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--tw-home-ink);
}

.tw-home-address-add strong {
  color: var(--tw-home-ink);
}

.tw-home-notification-section {
  margin: 0;
}

/* Shared Home card and selection primitives. Passenger output is unchanged;
   Driver Home consumes the same canonical Home surface and control tokens. */
.tw-home .tw-c-trip-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(7, 10, 45, 0.08);
  border-radius: 20px;
  background: #ffffff;
  color: var(--tw-home-ink);
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.08);
}

.tw-home .tw-c-trip-card-main {
  min-width: 0;
}

.tw-home .tw-c-trip-card-main h2,
.tw-home .tw-c-trip-card-main p,
.tw-home .tw-c-trip-card-main small {
  margin: 0;
}

.tw-home .tw-c-trip-card-main h2 {
  color: var(--tw-home-ink);
  font-size: 18px;
  line-height: 1.22;
  font-weight: 800;
}

.tw-home .tw-c-trip-card-main p,
.tw-home .tw-c-trip-card-main small {
  display: block;
  margin-top: 5px;
  color: #414965;
  font-size: 13px;
  line-height: 1.38;
  font-weight: 500;
}

.tw-home .tw-c-trip-card-side {
  min-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  text-align: right;
}

.tw-home .tw-c-trip-card-side strong {
  color: var(--tw-home-ink);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.tw-home .tw-c-trip-card-side .tw-card-chevron {
  width: 44px;
  min-width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tw-home-soft);
  color: var(--tw-home-primary);
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}

.tw-home .tw-c-switch {
  position: relative;
  width: 52px;
  min-width: 52px;
  height: 32px;
  min-height: 32px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #d8d9e2;
  box-shadow: none;
}

.tw-home .tw-c-switch > span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
  transition: transform 220ms cubic-bezier(0.2, 0, 0, 1);
}

.tw-home .tw-c-switch[aria-checked="true"] {
  background: var(--tw-home-primary);
}

.tw-home .tw-c-switch[aria-checked="true"] > span {
  transform: translateX(20px);
}

.tw-home-nearest-card.tw-c-trip-card {
  min-height: 84px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto 18px;
  gap: 10px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--tw-home-line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--tw-home-ink);
  box-shadow: 0 7px 20px rgba(16, 24, 40, 0.05);
  text-decoration: none;
}

.tw-home-nearest-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--tw-home-ink);
}

.tw-home-nearest-icon svg {
  width: 28px;
  height: 28px;
}

.tw-home-nearest-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tw-home-nearest-copy small,
.tw-home-nearest-copy em {
  font-size: 12px;
  line-height: 1.2;
  color: var(--tw-home-ink);
  font-style: normal;
}

.tw-home-nearest-copy strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.22;
  font-weight: 800;
}

.tw-home-nearest-price {
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.tw-home-nearest-status {
  justify-self: end;
  padding: 8px 12px;
  border-radius: 10px;
  background: #d9f7e5;
  color: #138444;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
}

.tw-home-nearest-arrow,
.tw-home-nearest-arrow svg {
  width: 18px;
  height: 18px;
}

.tw-home-nearest-card--empty {
  grid-template-columns: 42px minmax(0, 1fr);
}

@media (max-width: 380px) {
  .tw-plain-app:has(.tw-home) {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tw-home {
    gap: 12px;
  }

  .tw-home-address-grid {
    gap: 8px;
  }

  .tw-home-address-card {
    min-height: 66px;
  }

  .tw-home-address-card strong {
    font-size: 9px;
  }

  .tw-home-nearest-card {
    grid-template-columns: 34px minmax(0, 1fr) auto 16px;
  }

  .tw-home-nearest-status {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .tw-home-moment-track {
    scroll-behavior: auto;
  }
}

/* DQ-PASSENGER-01: real-data resilience and cleaner section rhythm. */
.tw-home-greeting {
  min-width: 0;
}

.tw-home-greeting h1 {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tw-home-section-title {
  margin-bottom: 2px;
}

.tw-home-address-card,
.tw-home-nearest-card {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.tw-home-address-card:active,
.tw-home-nearest-card:active {
  transform: scale(0.985);
}
