.container {
  --header-height: 72px;
  --sticky-button-height: 124px;

  display: grid;
  grid-template-areas:
    "header"
    "content";
  grid-template-rows: var(--header-height) calc(100dvh - var(--header-height));
  position: relative;
}

.container.noHeader {
  grid-template-areas: "content";
  grid-template-rows: auto;
}

.root {
  display: grid;
  grid-area: content;
}

.header {
  align-self: flex-end;
  background-color: var(--Main-Grey-White);
  grid-area: header;
  padding: var(--Spacing-x3) var(--Spacing-x2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.select {
  justify-self: center;
  min-width: 100px;
  transform: translateX(24px);
}

.close {
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-self: flex-end;
}

div.months {
  display: grid;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

.month {
  display: grid;
  justify-items: center;
  scroll-snap-align: start;
}

.month:last-of-type {
  padding-bottom: calc(var(--sticky-button-height) + var(--Spacing-x2));
}

.monthCaption {
  justify-content: center;
}

.captionLabel {
  text-transform: capitalize;
}

.footer {
  align-self: flex-start;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 7.5%,
    #ffffff 82.5%
  );
  display: flex;
  grid-area: content;
  padding: var(--Spacing-x1) var(--Spacing-x2) var(--Spacing-x7);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.footer .button {
  width: 100%;
}

td.day,
td.rangeEnd,
td.rangeStart {
  font-family: var(--typography-Body-Bold-fontFamily);
  font-size: var(--typography-Body-Bold-fontSize);
  font-weight: 500;
  letter-spacing: var(--typography-Body-Bold-letterSpacing);
  line-height: var(--typography-Body-Bold-lineHeight);
  text-decoration: var(--typography-Body-Bold-textDecoration);
}

td.rangeEnd,
td.rangeStart {
  background: var(--Base-Background-Primary-Normal);
}

td.rangeEnd[aria-selected="true"]:not([data-outside="true"]) {
  border-radius: 0 50% 50% 0;
}

td.rangeStart[aria-selected="true"] {
  border-radius: 50% 0 0 50%;
}

td.rangeEnd[aria-selected="true"] button.dayButton:hover,
td.rangeStart[aria-selected="true"] button.dayButton:hover {
  background: var(--Primary-Light-On-Surface-Accent);
  border-radius: 50%;
}

td.rangeEnd[aria-selected="true"]:not([data-outside="true"]) button.dayButton,
td.rangeStart[aria-selected="true"]:not([data-outside="true"]) button.dayButton,
td.day[aria-selected="true"] button.dayButton {
  background: var(--Primary-Light-On-Surface-Accent);
  border: none;
  color: var(--Base-Button-Inverted-Fill-Normal);
}

td.day,
td.day[data-today="true"] {
  color: var(--UI-Text-High-contrast);
  height: 40px;
  padding: var(--Spacing-x-half);
  width: 40px;
}

td.day[data-outside="true"] button.dayButton {
  border: none;
}

td.rangeMiddle[aria-selected="true"] button.dayButton {
  background: var(--Base-Background-Primary-Normal);
  border: none;
  border-radius: 0;
  color: var(--UI-Text-High-contrast);
}

td.day[data-disabled="true"],
td.day[data-disabled="true"] button.dayButton,
td.day[data-outside="true"] ~ td.day[data-disabled="true"],
td.day[data-outside="true"] ~ td.day[data-disabled="true"] button.dayButton,
.week:has(td.day[data-outside="true"] ~ td.day[data-disabled="true"])
  td.day[data-outside="true"]
  button.dayButton {
  background: none;
  color: var(--Base-Text-Disabled);
  cursor: not-allowed;
}

.weekDay {
  color: var(--UI-Text-Placeholder);
  font-family: var(--typography-Caption-Labels-fontFamily);
  font-size: var(--typography-Caption-Labels-fontSize);
  font-weight: var(--typography-Caption-Labels-fontWeight);
  letter-spacing: var(--typography-Caption-Labels-letterSpacing);
  line-height: var(--typography-Caption-Labels-lineHeight);
  text-decoration: var(--typography-Caption-Labels-textDecoration);
  text-transform: uppercase;
}

@media screen and (min-width: 1367px) {
  .container {
    display: none;
  }
}
