/* Mobile accessibility hotfix — visual-only, no workflow changes.
   Scoped to the owner mobile root and the post-confirmation contact modal. */
html[data-theme="light"] #rt-contact-modal-card .rt-contact-header h2,
html[data-theme="dark"] #rt-contact-modal-card .rt-contact-header h2,
#rt-contact-modal-card .rt-contact-header h2 { color:#FFFFFF !important; opacity:1 !important; }
#rt-contact-modal-card .rt-contact-header p { color:#D1FAE5 !important; font-size:14px !important; line-height:1.55 !important; opacity:1 !important; }
html[data-theme="light"] #rt-contact-modal-card .rt-contact-label {color:#475569 !important;font-size:13px !important;}
#rt-contact-modal-card .rt-contact-btn-call,
#rt-contact-modal-card .rt-contact-btn-sms {background:#0F766E !important;color:#FFFFFF !important;font-size:15px !important;min-height:48px;}
html[data-theme="light"] #rt-contact-modal-card .rt-contact-btn-close {color:#334155 !important;font-size:14px !important;min-height:44px;}
#rt-contact-modal-card .rt-contact-phone-title {font-size:13px !important;line-height:1.5 !important;}
/* Avoid low-contrast brand-colored button labels in light mode.
   Target explicit inline teal backgrounds rather than all controls. */
html[data-theme="light"] #root button[style*="background-color: rgb(8, 184, 174)"],
html[data-theme="light"] #root [role="button"][style*="background-color: rgb(8, 184, 174)"],
html[data-theme="light"] #root button[style*="background-color: rgb(15, 118, 110)"] {color:#FFFFFF !important;}
/* Help, notes, remarks and field labels remain readable when native text is muted. */
html[data-theme="light"] #root input::placeholder,
html[data-theme="light"] #root textarea::placeholder {color:#64748B !important;opacity:1 !important;}
html[data-theme="dark"] #root input::placeholder,
html[data-theme="dark"] #root textarea::placeholder {color:#A9BACD !important;opacity:1 !important;}
/* Keyboard accessibility and tap affordance. */
#root button:focus-visible,
#rt-contact-modal-card a:focus-visible,
#rt-contact-modal-card button:focus-visible {outline:3px solid #2563EB !important;outline-offset:2px;}
@media (prefers-reduced-motion:reduce) {
 #rt-contact-modal-card, #rt-contact-modal-back {transition:none !important;}
}

/* Phase 2: readable notes, payment actions and semantic chips.
   Attribute selectors intentionally require a solid background to avoid changing
   outlined/ghost controls or the sign-in experience. */
html[data-theme="light"] #root [role="button"][style*="background-color: rgb(8, 184, 174)"],
html[data-theme="light"] #root [role="button"][style*="background-color: rgb(20, 184, 166)"],
html[data-theme="light"] #root [role="button"][style*="background-color: rgb(13, 148, 136)"],
html[data-theme="light"] #root button[style*="background-color: rgb(20, 184, 166)"],
html[data-theme="light"] #root button[style*="background-color: rgb(13, 148, 136)"] {
 color:#FFFFFF !important;
 -webkit-text-fill-color:#FFFFFF !important;
}
/* Explicitly scoped dark-on-dark status chips, only for filled badges. */
html[data-theme="light"] #root [style*="background-color: rgb(9, 36, 58)"][style*="border-radius"] {
 color:#F8FAFC;
}
/* Modal and form instructional text must wrap rather than clip. */
#rt-contact-modal-card .rt-contact-header p,
#rt-contact-modal-card .rt-contact-row,
#root textarea,
#root [role="alert"] {
 overflow-wrap:anywhere;
}
#rt-contact-modal-card .rt-contact-row {gap:12px;}
#rt-contact-modal-card .rt-contact-val {text-align:right;}
#rt-contact-modal-card .rt-contact-btn-close {min-height:44px;}
/* Keep native form labels visible at standard mobile zoom levels. */
#root input, #root textarea, #root select {min-width:0;}

/* Model type labels use their semantic color rather than white on white. */
/* Solid CTA labels are commonly nested spans/divs in RN Web. */
html[data-theme="light"] #root #rt-bookings-new-btn,
html[data-theme="light"] #root #rt-fleet-add-btn,
html[data-theme="light"] #root #rt-portal-copy-btn,
html[data-theme="light"] #root #rt-push-enable-btn {
 color:#FFFFFF !important;
}
html[data-theme="light"] #root #rt-bookings-new-btn *,
html[data-theme="light"] #root #rt-fleet-add-btn *,
html[data-theme="light"] #root #rt-portal-copy-btn *,
html[data-theme="light"] #root #rt-push-enable-btn * {
 color:#FFFFFF !important;
 -webkit-text-fill-color:#FFFFFF !important;
 opacity:1 !important;
}
html[data-theme="light"] #root .rt-light-muted-text {color:#475569 !important;}
/* Contact modal is injected outside #root and needs separate light-theme handling. */
html[data-theme="light"] #rt-contact-modal-card .rt-contact-header h2,
html[data-theme="light"] #rt-contact-modal-card .rt-contact-header p {
 color:#FFFFFF !important;
 -webkit-text-fill-color:#FFFFFF !important;
}
html[data-theme="light"] #rt-contact-modal-card .rt-contact-btn-call,
html[data-theme="light"] #rt-contact-modal-card .rt-contact-btn-sms {
 color:#FFFFFF !important;
 -webkit-text-fill-color:#FFFFFF !important;
}
html[data-theme="light"] #rt-contact-modal-card .rt-contact-phone-title {color:#115E59 !important;}
html[data-theme="light"] #rt-contact-modal-card .rt-contact-phone-number {color:#075985 !important;}
/* Avoid truncation of long payment remarks and notes. */
#rt-contact-modal-card .rt-contact-detail-box,
#rt-contact-modal-card .rt-contact-header {overflow-wrap:break-word;}


/* Owner mobile: solid brand CTAs retain white labels across both themes.
   Only solid buttons; outlined and ghost buttons remain unchanged. */
#root :is(button,[role="button"]):is(
 [style*="background-color: rgb(8, 184, 174)"],
 [style*="background-color: rgb(20, 184, 166)"],
 [style*="background-color: rgb(13, 148, 136)"],
 [style*="background-color: rgb(15, 118, 110)"],
 [style*="background-color: rgb(37, 99, 235)"],
 [style*="background-color: rgb(22, 101, 207)"],
 [style*="background-color: rgb(2, 132, 199)"],
 [style*="background-color: #08B8AE"],
 [style*="background-color: #0F766E"],
 [style*="background-color: #2563EB"]
),
#root :is(.btn-primary,.rt-native-btn-submit) {
 color:#FFFFFF !important;
 -webkit-text-fill-color:#FFFFFF !important;
}
#root :is(button,[role="button"]):is(
 [style*="background-color: rgb(8, 184, 174)"],
 [style*="background-color: rgb(20, 184, 166)"],
 [style*="background-color: rgb(13, 148, 136)"],
 [style*="background-color: rgb(15, 118, 110)"],
 [style*="background-color: rgb(37, 99, 235)"],
 [style*="background-color: rgb(2, 132, 199)"],
 [style*="background-color: #08B8AE"],
 [style*="background-color: #0F766E"],
 [style*="background-color: #2563EB"]
) :is(span,svg,svg *,[dir="auto"]),
#root .btn-primary :is(span,svg,svg *) {
 color:#FFFFFF !important;
 -webkit-text-fill-color:#FFFFFF !important;
}
/* White-centered status pills; preserve semantic text and outline hues. */
#root :is(:is(.rt-booking-status-pill, [data-rt-class="rt-booking-status-pill"]),:is(.rt-fleet-type-tag, [data-rt-class="rt-fleet-type-tag"])),
#root :is(:is(.rt-booking-status-pill, [data-rt-class="rt-booking-status-pill"]),:is(.rt-fleet-type-tag, [data-rt-class="rt-fleet-type-tag"]))[style] {
 background:#FFFFFF !important;
 background-color:#FFFFFF !important;
}
/* Preserve existing semantic label color on model tags. */

/* Ensure existing status semantics are retained when white-filled. */
#root :is(.rt-booking-status-pill-text, [data-rt-class="rt-booking-status-pill-text"]),
#root :is(.rt-fleet-type-tag-text, [data-rt-class="rt-fleet-type-tag-text"]) {
 opacity:1 !important;
}
/* Avoid inheriting the generic card text color over semantic status colors. */

/* Specificity-safe mobile status chips: white center, semantic border/text untouched. */
html[data-theme="light"] #root :is(.rt-booking-status-pill, [data-rt-class="rt-booking-status-pill"]),
html[data-theme="dark"] #root :is(.rt-booking-status-pill, [data-rt-class="rt-booking-status-pill"]),
html[data-theme="light"] #root :is(.rt-fleet-type-tag, [data-rt-class="rt-fleet-type-tag"]),
html[data-theme="dark"] #root :is(.rt-fleet-type-tag, [data-rt-class="rt-fleet-type-tag"]) {
 background:#FFFFFF !important;
 background-color:#FFFFFF !important;
}

/* Semantic outlined pills: keep label and border hues; remove colored interior. */
#root :is(.status-pill,.status-badge,.status-chip,.vehicle-type-tag,.vehicle-class-tag,:is(.rt-booking-status-pill, [data-rt-class="rt-booking-status-pill"]),:is(.rt-fleet-type-tag, [data-rt-class="rt-fleet-type-tag"])):not(button):not([role="button"]) {
 background-color:#FFFFFF !important;
 background-image:none !important;
}

/* Shared solid-action treatment, including modal portals outside the Expo root.
   The palette bridge marks saturated green/teal/blue backgrounds, not ghost controls. */
html body .rt-solid-color-action.rt-solid-color-action.rt-solid-color-action,
html body .rt-solid-color-action.rt-solid-color-action.rt-solid-color-action :is(span,div,strong,small,svg,svg *),
html body #root .rt-solid-color-action.rt-solid-color-action.rt-solid-color-action,
html body #root .rt-solid-color-action.rt-solid-color-action.rt-solid-color-action :is(span,div,strong,small,svg,svg *) {
 color:#FFFFFF !important;
 -webkit-text-fill-color:#FFFFFF !important;
}
/* White vehicle capsules need a colored label; the existing blue outline is retained. */
html body #root :is(.rt-fleet-type-tag-text, [data-rt-class="rt-fleet-type-tag-text"]) {
 color:#0369A1 !important;
 -webkit-text-fill-color:currentColor !important;
}
html body #root :is(:is(.rt-booking-status-pill-text, [data-rt-class="rt-booking-status-pill-text"]),:is(.rt-fleet-status-tag-text, [data-rt-class="rt-fleet-status-tag-text"])) {
 -webkit-text-fill-color:currentColor !important;
}
html body #root :is(.rt-fleet-status-tag, [data-rt-class="rt-fleet-status-tag"]) {
 background:#FFFFFF !important;
}

/* Review and calendar status capsules are rendered outside the Expo root. */
html body .rt-semantic-pill,
html body #root [data-rt-class="rt-semantic-pill"] {
 background:#FFFFFF !important;
 background-image:none !important;
 -webkit-text-fill-color:currentColor !important;
}

/* The cyan install action uses a gradient and bypasses the solid palette bridge. */
html body #rt-btn-install {color:#FFFFFF !important;-webkit-text-fill-color:#FFFFFF !important;}

/* ==========================================================================
   Recent Booking Activities Modal — Scoped Theme & Accessibility Engine
   Supports: Light Mode, Dark Mode, System Auto with immediate live updates.
   ========================================================================== */

/* 1. Backdrop */
#rt-recent-activities-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  background-color: rgba(5, 13, 24, 0.78) !important;
  transition: background-color 0.22s ease !important;
}

html[data-theme="light"] #rt-recent-activities-backdrop {
  background-color: rgba(15, 23, 42, 0.45) !important;
}

/* 2. Modal Card */
#rt-recent-activities-card {
  width: 100% !important;
  max-width: 440px !important;
  max-height: 85vh !important;
  border-radius: 18px !important;
  padding: 18px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  background-color: #0A1626 !important;
  border: 1px solid #193552 !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(25, 53, 82, 0.5) !important;
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease !important;
}

html[data-theme="light"] #rt-recent-activities-card {
  background-color: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px #E2E8F0 !important;
}

/* 3. Header */
#rt-recent-activities-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 12px !important;
  padding-bottom: 12px !important;
  flex-shrink: 0 !important;
  border-bottom: 1px solid #142A42 !important;
}

html[data-theme="light"] #rt-recent-activities-header {
  border-bottom: 1px solid #E2E8F0 !important;
}

/* 4. Title */
#rt-recent-activities-title,
#rt-recent-activities-title * {
  color: #F8FAFC !important;
  -webkit-text-fill-color: #F8FAFC !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  letter-spacing: -0.3px !important;
}

html[data-theme="light"] #rt-recent-activities-title,
html[data-theme="light"] #rt-recent-activities-title * {
  color: #0F172A !important;
  -webkit-text-fill-color: #0F172A !important;
}

/* 5. Top Close X button */
#rt-recent-activities-close-x {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 18px !important;
  background-color: #142A42 !important;
  border: 1px solid #1E3A5F !important;
  color: #94A3B8 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: transform 0.15s ease, background-color 0.18s ease !important;
}

#rt-recent-activities-close-x * {
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

#rt-recent-activities-close-x:active {
  transform: scale(0.92) !important;
  opacity: 0.85 !important;
}

html[data-theme="light"] #rt-recent-activities-close-x {
  background-color: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
}

html[data-theme="light"] #rt-recent-activities-close-x * {
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
}

/* 6. Scroll Body */
#rt-recent-activities-scroll {
  max-height: 380px !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  flex: 1 1 auto !important;
  min-height: 60px !important;
  padding-right: 2px !important;
}

/* 7. Activity Items & Separators */
#rt-recent-activities-card div[style*="borderBottomWidth"] {
  border-bottom-color: #142A42 !important;
}

html[data-theme="light"] #rt-recent-activities-card div[style*="borderBottomWidth"] {
  border-bottom-color: #F1F5F9 !important;
}

/* Item Title / Vehicle */
#rt-recent-activities-scroll div[style*="fontWeight: '800'"],
#rt-recent-activities-scroll div[style*="font-weight: 800"],
#rt-recent-activities-scroll div[style*="fontWeight:800"],
#rt-recent-activities-scroll div[style*="font-weight:700"],
#rt-recent-activities-scroll div[style*="font-weight: 700"] {
  color: #F8FAFC !important;
  -webkit-text-fill-color: #F8FAFC !important;
}

html[data-theme="light"] #rt-recent-activities-scroll div[style*="fontWeight: '800'"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="font-weight: 800"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="fontWeight:800"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="font-weight:700"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="font-weight: 700"] {
  color: #0F172A !important;
  -webkit-text-fill-color: #0F172A !important;
}

/* Action Badge */
#rt-recent-activities-scroll div[style*="00E5A3"],
#rt-recent-activities-scroll div[style*="0, 229, 163"] {
  color: #00E5A3 !important;
  -webkit-text-fill-color: #00E5A3 !important;
}

html[data-theme="light"] #rt-recent-activities-scroll div[style*="00E5A3"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="0, 229, 163"] {
  color: #0D9488 !important;
  -webkit-text-fill-color: #0D9488 !important;
}

/* Details */
#rt-recent-activities-scroll div[style*="94A3B8"],
#rt-recent-activities-scroll div[style*="148, 163, 184"],
#rt-recent-activities-scroll div[style*="8899A6"],
#rt-recent-activities-scroll div[style*="136, 153, 166"] {
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
}

html[data-theme="light"] #rt-recent-activities-scroll div[style*="94A3B8"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="148, 163, 184"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="8899A6"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="136, 153, 166"] {
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
}

/* Timestamps & Empty text */
#rt-recent-activities-scroll div[style*="64748B"],
#rt-recent-activities-scroll div[style*="100, 116, 139"],
#rt-recent-activities-empty {
  color: #64748B !important;
  -webkit-text-fill-color: #64748B !important;
}

html[data-theme="light"] #rt-recent-activities-scroll div[style*="64748B"],
html[data-theme="light"] #rt-recent-activities-scroll div[style*="100, 116, 139"],
html[data-theme="light"] #rt-recent-activities-empty {
  color: #64748B !important;
  -webkit-text-fill-color: #64748B !important;
}

/* 8. Footer Close Button */
#rt-recent-activities-close-btn {
  margin-top: 14px !important;
  background-color: #08B8AE !important;
  background: #08B8AE !important;
  border-radius: 12px !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  border: none !important;
  width: 100% !important;
  box-shadow: 0 2px 8px rgba(8, 184, 174, 0.25) !important;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.18s ease !important;
}

#rt-recent-activities-close-btn:active {
  opacity: 0.88 !important;
  transform: scale(0.98) !important;
}

/* SOLID PRIMARY BUTTON WHITE TEXT RULE */
#rt-recent-activities-close-btn,
#rt-recent-activities-close-btn *,
#rt-recent-activities-close-btn-text,
#rt-recent-activities-close-btn-text * {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
}

/* Extend Booking & Booking History accessibility rules */
#rt-extend-submit-btn,
#rt-extend-submit-btn *,
[data-rtclass~="rt-solid-primary-action"],
[data-rtclass~="rt-solid-primary-action"] * {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

/* Equal width 3-column quick extension buttons touch target */
#rt-booking-extension-form [role="button"][style*="border-radius: 12px"],
#rt-booking-extension-form [role="button"][style*="border-radius: 13px"] {
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Status badges: strictly white background with colored border and text */
.rt-booking-status-pill,
[data-rtclass="rt-booking-status-pill"],
[data-rt-class="rt-booking-status-pill"] {
  background-color: #FFFFFF !important;
  background: #FFFFFF !important;
}
