/* Calendar (desktop): the whole day cell is one target (calendar-day-select-v1.js).
   Chips are a read-only preview; they open from the right rail. */
@media (min-width: 721px) {
  #calendarView .calendar.cs-day-select .day,
  #calendarGrid.cs-day-select .day {
    position: relative;
    cursor: pointer;
  }

  /* Chips no longer act as their own buttons in the grid. */
  #calendarGrid.cs-day-select .day .event {
    cursor: inherit;
  }

  #calendarGrid.cs-day-select .day:not(.is-selected):not(.agenda-selected):hover {
    background: color-mix(in srgb, var(--ink, #101a37) 6%, var(--card, #fff));
  }

  #calendarGrid.cs-day-select .day:focus-visible {
    outline: 2px solid #3164f4;
    outline-offset: -2px;
    z-index: 1;
  }

  /* "+" sits in the day-number row (above the first chip) so it never covers an
     amount: 32x20 hit area, 26x18 visible pill. */
  #calendarGrid.cs-day-select .day-add {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 32px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    font: 700 15px/1 'DM Sans', system-ui, sans-serif;
    color: #285cf4;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
  }

  #calendarGrid.cs-day-select .day-add::before {
    content: '';
    position: absolute;
    inset: 1px 3px;
    border-radius: 6px;
    background: var(--card, #fff);
    box-shadow: inset 0 0 0 1px var(--line, #dce3f1);
    z-index: -1;
  }

  #calendarGrid.cs-day-select .day:hover .day-add,
  #calendarGrid.cs-day-select .day:focus-within .day-add,
  #calendarGrid.cs-day-select .day.is-selected .day-add,
  #calendarGrid.cs-day-select .day.agenda-selected .day-add {
    opacity: 1;
  }

  #calendarGrid.cs-day-select .day-add:hover::before {
    background: color-mix(in srgb, #285cf4 10%, var(--card, #fff));
  }

  #calendarGrid.cs-day-select .day-add:focus-visible {
    outline: 2px solid #3164f4;
    outline-offset: -1px;
    border-radius: 6px;
    opacity: 1;
  }

  body[data-theme="midnight"] #calendarGrid.cs-day-select .day-add {
    color: #8fb0ff;
  }

  body[data-theme="midnight"] #calendarGrid.cs-day-select .day-add::before {
    background: #141a36;
    box-shadow: inset 0 0 0 1px #2c3358;
  }

  body[data-theme="midnight"] #calendarGrid.cs-day-select .day:focus-visible {
    outline-color: #8fb0ff;
  }
}

@media (min-width: 721px) and (hover: none) {
  /* Touch laptops/tablets: no hover, so keep "+" visible on the selected day only (rules above). */
  #calendarGrid.cs-day-select .day:hover:not(.is-selected):not(.agenda-selected) .day-add {
    opacity: 0;
  }
}
