.month-block {
  width: calc(7 * var(--calendar-cell-size, 2rem));
  display: flex;
  flex-direction: column;
}

.month-title {
  height: var(--calendar-title-height, 2rem);
  font-size: var(--calendar-title-size, 1rem);
  font-weight: 500;
  background: #000;
  color: #fff;
  font-family: var(--font-family-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--calendar-title-gap, 0.25rem);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, var(--calendar-cell-size, 2rem));
  grid-template-rows: repeat(7, var(--calendar-cell-size, 2rem));
  font-family: var(--font-family-secondary);
  font-weight: 200;
  font-size: var(--calendar-font-size, 0.75rem);
}

.cell {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cell.day {
  position: relative;
}

.cell.day {
  position: relative;
}

.cell.weekday {
  background: #f5f5f5;
}

.cell[data-weekday="0"] {
  background: #b6b6b6;
}

.cell[data-weekday="6"] {
  background: #d3d3d3;
}

.calendar-year {
  display: grid;
  grid-template-columns: repeat(var(--calendar-year-cols, 4), calc(7 * var(--calendar-cell-size, 2rem)));
  column-gap: var(--calendar-gap, 0.5rem);
  row-gap: var(--calendar-gap, 0.5rem);
  align-items: start;
  justify-content: center;
}

.cell.day.marked {
  background: #000;
  color: #fff;
}

.cell.day.today:not(.marked) {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.cell.day.today.marked {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.cell.day.out-month {
  opacity: 0.2;
}

.cell.day.holiday {
  background: #f1f1f1;
  color: #2b2b2b;
}

.cell.day.holiday::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2b2b2b;
}

.cell.day.season,
.cell.day.season-range {
  background-color: inherit;
  background-image: var(--season-tint, none);
  background-size: cover;
}

.cell.day.season-summer {
  --season-tint: linear-gradient(rgba(255, 246, 220, 0.6), rgba(255, 246, 220, 0.6));
}

.cell.day.season-autumn {
  --season-tint: linear-gradient(rgba(248, 238, 227, 0.6), rgba(248, 238, 227, 0.6));
}

.cell.day.season-winter {
  --season-tint: linear-gradient(rgba(238, 245, 251, 0.6), rgba(238, 245, 251, 0.6));
}

.cell.day.season-spring {
  --season-tint: linear-gradient(rgba(238, 249, 241, 0.6), rgba(238, 249, 241, 0.6));
}

.cell.day.season.season-range.season-summer {
  background: #ffeec2;
}

.cell.day.season.season-range.season-autumn {
  background: #f2e0cf;
}

.cell.day.season.season-range.season-winter {
  background: #e0edf7;
}

.cell.day.season.season-range.season-spring {
  background: #e2f5e8;
}

.cell.day.season::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #2b2b2b;
  opacity: 0.6;
}

.cell.day.marked.season::before {
  background: #fff;
}

.no-season-colors .cell.day.season:not(.marked),
.no-season-colors .cell.day.season-range:not(.marked) {
  background: transparent;
  background-image: none;
}

.no-season-colors .cell.day.season[data-weekday="0"]:not(.marked),
.no-season-colors .cell.day.season-range[data-weekday="0"]:not(.marked) {
  background: #b6b6b6;
  background-image: none;
}

.no-season-colors .cell.day.season[data-weekday="6"]:not(.marked),
.no-season-colors .cell.day.season-range[data-weekday="6"]:not(.marked) {
  background: #d3d3d3;
  background-image: none;
}

.cell.day.marked,
.cell.day.marked.holiday {
  background: #000;
  color: #fff;
}

.no-holidays .cell.day.holiday:not(.marked) {
  background: transparent;
  box-shadow: none;
}

.no-holidays .cell.day.holiday {
  box-shadow: none;
}

.no-holidays .cell.day.holiday::after {
  opacity: 0;
}

.cell.day.marked.holiday::after {
  background: #fff;
}

.cell.day.marked.season-range {
  background: #000;
  color: #fff;
}

.cell.day.marked.filtered-out {
  opacity: 0.25;
}

@media print {
  .cell.day.today {
    box-shadow: none !important;
  }

  .calendar-tooltip {
    display: none !important;
  }
}

.cell.day.holiday {
  box-shadow: inset 0 0 0 1px #8d8d8d;
}

.cell.day.holiday::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2b2b2b;
}

.calendar-tooltip {
  position: absolute;
  max-width: 220px;
  padding: 0.4rem 0.6rem;
  background: #111;
  color: #fff;
  font-family: var(--font-family-secondary);
  font-size: 0.7rem;
  line-height: 1.3;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--box-shadow-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  white-space: pre-line;
  z-index: var(--z-index-tooltip);
}

.cell.day.note {
  background-image: radial-gradient(
    circle at 6px calc(100% - 6px),
    rgba(0, 0, 0, 0.55) 0 2px,
    transparent 3px
  );
  background-repeat: no-repeat;
}

.cell.day.marked.note {
  background-image: radial-gradient(
    circle at 6px calc(100% - 6px),
    #ffffff 0 2px,
    transparent 3px
  );
}

.cell.day.drag-select {
  box-shadow: inset 0 0 0 2px rgba(13, 27, 42, 0.25);
  background: rgba(13, 27, 42, 0.08);
}

.cell.day.recurring::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(13, 27, 42, 0.35);
}

.note-editor {
  position: absolute;
  width: 240px;
  background: #fff7d6;
  border: 1px solid #e3d3a4;
  border-radius: var(--border-radius-md);
  box-shadow: var(--box-shadow-md);
  padding: 0.6rem;
  z-index: var(--z-index-popover);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.note-editor.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.note-editor__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-family: var(--font-family-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.note-editor__close {
  border: none;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.note-editor__textarea {
  width: 100%;
  border: 1px solid #e3d3a4;
  border-radius: var(--border-radius-sm);
  padding: 0.4rem;
  font-family: var(--font-family-secondary);
  font-size: 0.75rem;
  resize: vertical;
  background: #fffdf4;
}

.note-editor__actions {
  margin-top: 0.4rem;
  display: flex;
  justify-content: flex-end;
}

.note-editor__save {
  border: none;
  background: #2b2b2b;
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family-primary);
  font-size: 0.7rem;
  cursor: pointer;
}
