/* Match the driver Calendar's blue selected-day treatment. */
#root .calendar-panel .rental-shift-selector button.active {
  border: 2px solid #0789f7;
  color: #095da8;
  background: linear-gradient(180deg, #eff7ff 0%, #e1efff 100%);
  box-shadow: none;
}

#root .calendar-panel .rental-shift-selector button.active > span,
#root .calendar-panel .rental-shift-selector button.active > small {
  color: #095da8;
}

html[data-theme='dark'] #root .calendar-panel .rental-shift-selector button.active {
  border-color: #6dbbff;
  color: #eff8ff;
  background: linear-gradient(180deg, #1c4161 0%, #173854 100%);
}

html[data-theme='dark'] #root .calendar-panel .rental-shift-selector button.active > span {
  color: #eff8ff;
}

html[data-theme='dark'] #root .calendar-panel .rental-shift-selector button.active > small {
  color: #b9dfff;
}

/* The installed app injects important segmented-control styles after the web
   styles. Draw the selection inside the existing button to preserve its size. */
html.mx-native-design-sandbox #root .calendar-panel .rental-shift-selector button.active {
  border: 2px solid #007aff !important;
  color: #0057b8 !important;
  background: rgba(0, 122, 255, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.08) !important;
}

html.mx-native-design-sandbox #root .calendar-panel .rental-shift-selector button.active > span,
html.mx-native-design-sandbox #root .calendar-panel .rental-shift-selector button.active > small {
  color: #0057b8 !important;
  -webkit-text-fill-color: #0057b8 !important;
}

/* Let both editable cards grow to fit their controls inside the scrolling Calendar. */
#root .calendar-panel.dual-editable-weeks {
  grid-template-rows: none;
  grid-auto-rows: max-content;
}

@media (max-width: 680px) {
  html:not(:has(.driver-portal-tour)) #root .calendar-panel.dual-editable-weeks {
    padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }
}

/* Keep the same day tiles when current-week choices become read-only. */
#root .calendar-panel .current-week-submitted .day-strip .day-dot {
  border-radius: 12px;
}

html.mx-native-design-sandbox #root .calendar-panel :is(.editable-current-week, .request-week, .current-week-submitted) .day-strip .day-dot {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 56px !important;
  min-height: 56px !important;
  border-radius: 10px !important;
  padding: 4px 2px !important;
}

html.mx-native-design-sandbox #root .calendar-panel :is(.editable-current-week, .current-week-submitted) .day-strip .day-dot:is(.active, .confirmed) {
  border: 2px solid #007aff !important;
  color: #0057b8 !important;
  background: rgba(0, 122, 255, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.08) !important;
}

html.mx-native-design-sandbox #root .calendar-panel :is(.editable-current-week, .current-week-submitted) .day-strip .day-dot:is(.active, .confirmed) > :is(span, strong, small) {
  color: #0057b8 !important;
  -webkit-text-fill-color: #0057b8 !important;
}

html.mx-native-design-sandbox[data-theme='dark'] #root .calendar-panel .rental-shift-selector button.active {
  border-color: #0a84ff !important;
  color: #eaf5ff !important;
  background: rgba(10, 132, 255, 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.18) !important;
}

html.mx-native-design-sandbox[data-theme='dark'] #root .calendar-panel .rental-shift-selector button.active > span,
html.mx-native-design-sandbox[data-theme='dark'] #root .calendar-panel .rental-shift-selector button.active > small {
  color: #eaf5ff !important;
  -webkit-text-fill-color: #eaf5ff !important;
}

html.mx-native-design-sandbox[data-theme='dark'] #root .calendar-panel :is(.editable-current-week, .current-week-submitted) .day-strip .day-dot:is(.active, .confirmed) {
  border-color: #0a84ff !important;
  color: #eaf5ff !important;
  background: rgba(10, 132, 255, 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.18) !important;
}

html.mx-native-design-sandbox[data-theme='dark'] #root .calendar-panel :is(.editable-current-week, .current-week-submitted) .day-strip .day-dot:is(.active, .confirmed) > strong {
  color: #f5f5f7 !important;
  -webkit-text-fill-color: #f5f5f7 !important;
}

html.mx-native-design-sandbox[data-theme='dark'] #root .calendar-panel :is(.editable-current-week, .current-week-submitted) .day-strip .day-dot:is(.active, .confirmed) > :is(span, small) {
  color: #64d2ff !important;
  -webkit-text-fill-color: #64d2ff !important;
}

/* Restore the wider shift controls while retaining the outlined day colors
   and transparent space between the two choices. */
#root .calendar-panel .request-controls-row {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 8px !important;
}
#root .calendar-panel .request-controls-row > .toggle-row { grid-column: auto; }
#root .calendar-panel .rental-shift-selector {
  grid-column: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
#root .calendar-panel .rental-shift-selector button {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  min-height: 50px;
  padding: 6px 4px;
  border-radius: 12px;
}
#root .calendar-panel .rental-shift-selector button > small {
  max-width: 100%;
  margin-top: 3px;
  white-space: nowrap;
  text-align: center;
  font-size: 9px;
  line-height: 1;
}
html.mx-native-design-sandbox #root .calendar-panel .rental-shift-selector button {
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 11px !important;
  padding: 6px 4px !important;
}
