/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
 * A heuristic that applies CSS to mobile
 * viewports (i.e. phones, not tablets).
 *
 * Usage:
 * @include mobile-viewport() {
 *   :host {
 *     background-color: blue;
 *   }
 * }
 */
/**
 * Convert a pixels given value into rem
 * 
 * @param pixels - Value in pixels to be converted (i.e. px)
 * @param context (optional) - Baseline value
 */
/**
 * Convert a font size to a dynamic font size.
 * Fonts that participate in Dynamic Type should use
 * dynamic font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param unit (optional) - The unit to convert to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a maximum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a minimum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * maximum and minimum font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a pixels given value into rem
 * 
 * @param pixels - Value in pixels to be converted (i.e. px)
 * @param context (optional) - Baseline value
 */
/**
 * Convert a font size to a dynamic font size.
 * Fonts that participate in Dynamic Type should use
 * dynamic font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param unit (optional) - The unit to convert to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a maximum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * a minimum font size.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * Convert a font size to a dynamic font size but impose
 * maximum and minimum font sizes.
 * @param size - The initial font size including the unit (i.e. px or pt)
 * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
 * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
 * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
 * convert to a unit other than $baselineUnit.
 */
/**
 * A heuristic that applies CSS to tablet
 * viewports.
 *
 * Usage:
 * @include tablet-viewport() {
 *   :host {
 *     background-color: green;
 *   }
 * }
 */
/**
 * A heuristic that applies CSS to mobile
 * viewports (i.e. phones, not tablets).
 *
 * Usage:
 * @include mobile-viewport() {
 *   :host {
 *     background-color: blue;
 *   }
 * }
 */
:host {
  /**
   * @prop --background: The primary background of the datetime component.
   */
  display: flex;
  flex-flow: column;
  background: var(--background);
  overflow: hidden;
}

:host(.datetime-size-fixed) {
  width: auto;
  height: auto;
}

:host(.datetime-size-cover) {
  width: 100%;
}

:host(:not(.datetime-ready)) .datetime-year {
  position: absolute;
  pointer-events: none;
}

:host(.datetime-ready) .datetime-year {
  display: none;
}

/**
 * Changing the physical order of the
 * picker columns in the DOM is added
 * work, so we just use `order` instead.
 *
 * The picker automatically configures
 * the text alignment, so when switching
 * the order we need to manually switch
 * the text alignment too.
 */
:host .wheel-order-year-first .day-column {
  order: 3;
  text-align: end;
}

:host .wheel-order-year-first .month-column {
  order: 2;
  text-align: end;
}

:host .wheel-order-year-first .year-column {
  order: 1;
  text-align: start;
}

/**
 * This allows the calendar to take
 * up 100% of the remaining height.
 * On iOS, if there are more than
 * 5 rows of dates, the dates should
 * be resized to fit into this
 * container.
 */
:host .datetime-calendar,
:host .datetime-year {
  display: flex;
  flex: 1 1 auto;
  flex-flow: column;
}

:host(.show-month-and-year) .datetime-year {
  display: flex;
}

:host(.show-month-and-year) .calendar-next-prev,
:host(.show-month-and-year) .calendar-days-of-week,
:host(.show-month-and-year) .calendar-body,
:host(.show-month-and-year) .datetime-time {
  display: none;
}

:host(.month-year-picker-open) .datetime-footer {
  display: none;
}

:host(.datetime-disabled) {
  pointer-events: none;
}
:host(.datetime-disabled) .calendar-days-of-week,
:host(.datetime-disabled) .datetime-time {
  opacity: 0.4;
}

:host(.datetime-readonly) {
  pointer-events: none;
  /**
   * Allow user to navigate months
   * while in readonly mode
   */
  /**
   * Disabled buttons should have full opacity
   * in readonly mode
   */
}
:host(.datetime-readonly) .calendar-action-buttons,
:host(.datetime-readonly) .calendar-body,
:host(.datetime-readonly) .datetime-year {
  pointer-events: initial;
}
:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),
:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled] {
  opacity: 1;
}

/**
 * Title should not wrap
 * to the next line and should
 * show ellipsis instead.
 */
:host .datetime-header .datetime-title {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

:host .datetime-action-buttons.has-clear-button {
  width: 100%;
}

:host .datetime-action-buttons,
::slotted([slot=buttons]),
.datetime-action-buttons .datetime-action-buttons-container {
  display: flex;
}

/**
 * Date/Year button should be on
 * the opposite side of the component
 * as the Next/Prev buttons
 */
:host .calendar-action-buttons {
  display: flex;
  justify-content: space-between;
}

:host .calendar-days-of-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.calendar-days-of-week .day-of-week {
  /**
   * Center the days of the week within each cell
   * if the container size is changed as a result
   * of Dynamic Type.
   */
  -webkit-margin-start: auto;
  margin-inline-start: auto;
  -webkit-margin-end: auto;
  margin-inline-end: auto;
  margin-top: 0;
  margin-bottom: 0;
}

:host .calendar-body {
  /**
   * Show all calendar months inline
   * and allow them to take up 100% of
   * the free space. Do not use CSS Grid
   * here as there are issues with nested grid
   * on older browsers.
   */
  display: flex;
  flex-grow: 1;
  scroll-snap-type: x mandatory;
  /**
   * Need to explicitly set overflow-y: hidden
   * for older implementations of scroll snapping.
   */
  overflow-x: scroll;
  overflow-y: hidden;
  scrollbar-width: none;
  /**
   * Hide blue outline on calendar body
   * when it is focused.
   */
  outline: none;
}

:host .calendar-body .calendar-month {
  display: flex;
  flex-flow: column;
  /**
   * Swiping should snap to at
   * most one month at a time.
   */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex-shrink: 0;
  width: 100%;
}

:host .calendar-body .calendar-month-disabled {
  /**
   * Disables swipe gesture snapping for scroll-snap containers
   */
  scroll-snap-align: none;
}

/**
 * Hide scrollbars on Chrome and Safari
 */
:host .calendar-body::-webkit-scrollbar {
  display: none;
}

:host .calendar-body .calendar-month-grid {
  /**
   * Create 7 columns for
   * 7 days in a week.
   */
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

:host .calendar-day-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

/**
 * Center the day text vertically
 * and horizontally within its grid cell.
 */
.calendar-day {
  -webkit-padding-start: 0px;
  padding-inline-start: 0px;
  -webkit-padding-end: 0px;
  padding-inline-end: 0px;
  padding-top: 0px;
  padding-bottom: 0px;
  -webkit-margin-start: 0px;
  margin-inline-start: 0px;
  -webkit-margin-end: 0px;
  margin-inline-end: 0px;
  margin-top: 0px;
  margin-bottom: 0px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  border: none;
  outline: none;
  background: none;
  color: currentColor;
  cursor: pointer;
  appearance: none;
  z-index: 0;
}

.calendar-day[disabled] {
  pointer-events: none;
}

:host .datetime-time {
  display: flex;
  justify-content: space-between;
}

:host .time-header {
  display: flex;
  align-items: center;
}

:host .time-body {
  display: flex;
  border: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  appearance: none;
}

:host(.in-item) {
  position: static;
}

.calendar-month-year {
  min-width: 0;
}

.calendar-month-year-toggle {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-decoration: inherit;
  text-indent: inherit;
  text-overflow: inherit;
  text-transform: inherit;
  white-space: inherit;
  position: relative;
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}

.calendar-month-year-toggle ion-icon {
  flex-shrink: 0;
}

.calendar-month-year-toggle #toggle-wrapper {
  display: inline-flex;
  align-items: center;
}

:host {
  /**
   * @prop --focus-ring-color: The color of the ring around the focused element.
   * @prop --focus-ring-width: The width of the ring around the focused element.
   */
  --background: var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));
  --focus-ring-color: var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));
  --focus-ring-width: var(--token-border-radius-025, var(--token-scale-050, 2px));
  /**
   * TODO(FW-6931): Remove these variables upon solving the root cause
   */
  --body-opacity: 0;
  --year-opacity: 0;
}

/**
   * TODO(FW-6931): Remove all this css related to opacity upon solving the root cause
   */
:host .calendar-body {
  opacity: var(--body-opacity);
}

:host .datetime-year {
  opacity: var(--year-opacity);
}

:host(.datetime-ready) .calendar-body {
  --body-opacity: 1;
}

:host(.datetime-ready) .datetime-year {
  --year-opacity: 1;
}

:host .datetime-header {
  -webkit-padding-start: var(--token-space-400, var(--token-scale-400, 16px));
  padding-inline-start: var(--token-space-400, var(--token-scale-400, 16px));
  -webkit-padding-end: var(--token-space-400, var(--token-scale-400, 16px));
  padding-inline-end: var(--token-space-400, var(--token-scale-400, 16px));
  padding-top: var(--token-space-200, var(--token-scale-200, 8px));
  padding-bottom: var(--token-space-400, var(--token-scale-400, 16px));
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
  height: var(--token-scale-1400, 56px);
  margin-bottom: var(--token-space-200, var(--token-scale-200, 8px));
  border-bottom: var(--token-border-style-solid, solid) var(--token-border-size-025, var(--token-scale-025, 1px)) var(--token-primitives-neutral-400, #d5d5d5);
}

:host .datetime-header .datetime-title {
  font-size: var(--token-font-size-450, 18px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-0, 0%);
  line-height: var(--token-font-line-height-700, var(--token-scale-700, 28px));
  text-decoration: none;
  text-transform: none;
  color: var(--token-primitives-neutral-800, #626262);
}

:host .datetime-header .datetime-selected-date {
  font-size: var(--token-font-size-350, 14px);
  font-weight: var(--token-font-weight-regular, 400);
  letter-spacing: var(--token-font-letter-spacing-0, 0%);
  line-height: var(--token-font-line-height-600, var(--token-scale-600, 24px));
  text-decoration: none;
  text-transform: none;
  color: var(--token-primitives-neutral-1000, #3b3b3b);
}

.calendar-action-buttons {
  padding-top: var(--token-space-200, var(--token-scale-200, 8px));
  padding-bottom: var(--token-space-200, var(--token-scale-200, 8px));
  align-items: center;
  height: var(--token-scale-1400, 56px);
  box-sizing: border-box;
}

.calendar-month-year {
  flex: 1 0 0;
}

.calendar-month-year-toggle {
  border-radius: var(--token-border-radius-full, 999px);
  font-size: var(--token-font-size-400, 16px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-1, 1%);
  line-height: var(--token-font-line-height-600, var(--token-scale-600, 24px));
  text-decoration: none;
  text-transform: none;
  -webkit-padding-start: var(--token-space-400, var(--token-scale-400, 16px));
  padding-inline-start: var(--token-space-400, var(--token-scale-400, 16px));
  -webkit-padding-end: var(--token-space-400, var(--token-scale-400, 16px));
  padding-inline-end: var(--token-space-400, var(--token-scale-400, 16px));
  padding-top: var(--token-space-200, var(--token-scale-200, 8px));
  padding-bottom: var(--token-space-200, var(--token-scale-200, 8px));
  min-width: var(--token-scale-1600, 64px);
  min-height: var(--token-scale-1000, 40px);
  border: var(--focus-ring-width) var(--token-border-style-solid, solid) transparent;
  color: var(--token-semantics-primary-base, var(--token-semantics-primary-700, var(--token-primitives-blue-700, #105cef)));
}

@media (any-hover: hover) {
  .calendar-month-year-toggle:hover {
    background: var(--token-primitives-neutral-200, #eae9e9);
  }
}
.calendar-month-year-toggle.ion-focused {
  border-color: var(--focus-ring-color);
}

.calendar-month-year-toggle.ion-activated {
  background: var(--token-primitives-neutral-200, #eae9e9);
}

.calendar-next-prev ion-button.button-has-icon-only {
  --color: var(--token-primitives-neutral-1000, #3b3b3b);
  --background-activated: var(--token-primitives-neutral-200, #eae9e9);
  --background-hover: var(--token-primitives-neutral-200, #eae9e9);
  --background-hover-opacity: 1;
  min-height: var(--token-scale-1000, 40px);
}

.calendar-next-prev ion-button.button-has-icon-only.ion-focused::part(native) {
  border: var(--token-border-size-050, var(--token-scale-050, 2px)) var(--token-border-style-solid, solid) var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));
  outline: none;
}

.calendar-days-of-week {
  font-size: var(--token-font-size-300, 12px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-2, 1.5%);
  line-height: var(--token-font-line-height-500, var(--token-scale-500, 20px));
  text-decoration: none;
  text-transform: uppercase;
  align-content: center;
  height: var(--token-scale-1200, 48px);
  color: var(--token-primitives-neutral-800, #626262);
}

.calendar-day {
  border-radius: var(--token-border-radius-full, 999px);
  -webkit-padding-start: var(--token-space-100, var(--token-scale-100, 4px));
  padding-inline-start: var(--token-space-100, var(--token-scale-100, 4px));
  -webkit-padding-end: var(--token-space-100, var(--token-scale-100, 4px));
  padding-inline-end: var(--token-space-100, var(--token-scale-100, 4px));
  padding-top: var(--token-space-100, var(--token-scale-100, 4px));
  padding-bottom: var(--token-space-100, var(--token-scale-100, 4px));
  font-size: var(--token-font-size-350, 14px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-1, 1%);
  line-height: var(--token-font-line-height-500, var(--token-scale-500, 20px));
  text-decoration: none;
  text-transform: none;
  width: var(--token-scale-1200, 48px);
  min-width: var(--token-scale-1200, 48px);
  height: var(--token-scale-1200, 48px);
  color: var(--token-text-default, var(--token-primitives-neutral-1200, #242424));
}

.calendar-day[disabled]:not(.calendar-day-constrained) {
  color: var(--token-primitives-neutral-500, #a2a2a2);
}

.calendar-day.calendar-day-today {
  color: var(--token-semantics-primary-base, var(--token-semantics-primary-700, var(--token-primitives-blue-700, #105cef)));
}

.calendar-day.calendar-day-active,
.calendar-day.calendar-day-active.calendar-day-adjacent-day {
  background: var(--token-semantics-primary-100, var(--token-primitives-blue-100, #e9ecfc));
}

.calendar-day:focus-visible {
  border: var(--focus-ring-width) var(--token-border-style-solid, solid) var(--focus-ring-color);
}

@media (any-hover: hover) {
  .calendar-day:not([disabled]):not(:active):hover {
    background: var(--token-semantics-primary-200, var(--token-primitives-blue-200, #e4e8ff));
  }
}
.calendar-day:active,
.calendar-day.calendar-day-adjacent-day:active {
  background: var(--token-bg-primary-subtle-press, var(--token-semantics-primary-300, var(--token-primitives-blue-300, #d0d7fa)));
}

.calendar-day.calendar-day-adjacent-day {
  color: var(--token-text-subtlest, var(--token-primitives-neutral-800, #626262));
}

.calendar-day.calendar-day-active.calendar-day-adjacent-day {
  color: var(--token-text-default, var(--token-primitives-neutral-1200, #242424));
}

:host .datetime-time {
  -webkit-padding-start: var(--token-space-400, var(--token-scale-400, 16px));
  padding-inline-start: var(--token-space-400, var(--token-scale-400, 16px));
  -webkit-padding-end: var(--token-space-400, var(--token-scale-400, 16px));
  padding-inline-end: var(--token-space-400, var(--token-scale-400, 16px));
  padding-top: var(--token-space-100, var(--token-scale-100, 4px));
  padding-bottom: var(--token-space-100, var(--token-scale-100, 4px));
}

:host .datetime-time .time-header {
  font-size: var(--token-font-size-400, 16px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-1, 1%);
  line-height: var(--token-font-line-height-600, var(--token-scale-600, 24px));
  text-decoration: none;
  text-transform: none;
  color: var(--token-primitives-neutral-800, #626262);
}

:host .datetime-time button {
  -webkit-padding-start: var(--token-space-200, var(--token-scale-200, 8px));
  padding-inline-start: var(--token-space-200, var(--token-scale-200, 8px));
  -webkit-padding-end: var(--token-space-200, var(--token-scale-200, 8px));
  padding-inline-end: var(--token-space-200, var(--token-scale-200, 8px));
  padding-top: var(--token-space-0, var(--token-scale-0, 0px));
  padding-bottom: var(--token-space-0, var(--token-scale-0, 0px));
  font-size: var(--token-font-size-350, 14px);
  font-weight: var(--token-font-weight-medium, 500);
  letter-spacing: var(--token-font-letter-spacing-0, 0%);
  line-height: var(--token-font-line-height-600, var(--token-scale-600, 24px));
  text-decoration: none;
  text-transform: none;
  border-radius: var(--token-border-radius-full, 999px);
  display: flex;
  align-items: center;
  height: var(--token-scale-800, 32px);
  background-color: var(--token-primitives-neutral-100, #f3f3f3);
  color: var(--token-text-default, var(--token-primitives-neutral-1200, #242424));
}

:host .datetime-footer {
  padding-left: 0;
  padding-right: 0;
  padding-top: var(--token-space-200, var(--token-scale-200, 8px));
  padding-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  margin-top: var(--token-space-200, var(--token-scale-200, 8px));
  margin-bottom: 0;
  border-left: 0;
  border-right: 0;
  border-top: var(--token-border-style-solid, solid) var(--token-border-size-025, var(--token-scale-025, 1px)) var(--token-primitives-neutral-400, #d5d5d5);
  border-bottom: 0;
}

:host .datetime-buttons .datetime-action-buttons,
.datetime-action-buttons .datetime-action-buttons-container,
::slotted([slot=buttons]) {
  flex-flow: column;
  align-items: stretch;
  gap: var(--token-space-200, var(--token-scale-200, 8px));
}