.Calendar {
  --bg-color: var(--color-blue5);
  // https://lea.verou.me/blog/2024/contrast-color/#using-rcs-to-automatically-compute-a-contrasting-text-color
  --l-threshold: 0.7;
  --l: clamp(0, (var(--l-threshold, 0.623) / l - 1) * infinity, 1);

  .ColorManagerButton {
    margin-right: 10px;

    & > a {
      text-decoration: none;
    }
  }

  .calendarRow {
    display: flex;
    flex-wrap: nowrap;
  }

  .calendarEvent {
    background-color: var(--bg-color);
    border-radius: 5px;
    box-sizing: border-box;
    color: oklch(from var(--bg-color) var(--l) 0 h);
    display: flex;
    margin: 5px;
    padding: 5px;
    width: calc(100% - 10px);

    &[data-cancelled='true'] {
      text-decoration: line-through;
    }
  }

  .calendarEvent-time {
    font-weight: 700;
    margin-right: 5px;
    white-space: nowrap;
  }

  .calendarEvent-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    & > a {
      color: oklch(from var(--bg-color) var(--l) 0 h);
      text-decoration: unset;
    }
  }

  .Month-day {
    align-content: flex-start;
    display: flex;
    flex: 1 1 calc(100% / 7);
    flex-wrap: wrap;
    justify-content: space-between;
    min-height: 200px;
    min-width: 0;

    &::before {
      content: none;
    }
  }

  .Month-dow {
    flex-basis: 0;
    margin: var(--gap-xs) 0 0 var(--gap-xs);
    overflow: hidden;
    padding: var(--gap-xs) var(--gap-s);
    position: static;
    text-wrap: nowrap;
    width: 1px;
  }

  .Month-dom {
    margin: var(--gap-xs) var(--gap-xs) 0 var(--gap-xs);
    padding: var(--gap-xs) var(--gap-s);
    position: static;
  }

  .viewAllEvents {
    border-top: 1px solid var(--color-gray4);
    margin: 5px;
    padding: 2px;

    & > a {
      color: var(--color-gray7);
    }
  }

  .calendarDay-today {
    &.Month-day {
      background-color: var(--color-gray1);
    }

    .Month-dom {
      align-items: center;
      background-color: var(--color-blue5);
      border-radius: 50%;
      color: white;
      display: flex;
      height: 4ch;
      justify-content: center;
      width: 4ch;
    }
  }
}
