/* Shared holiday annotations. Official rest/work marks do not change task capacity. */
.holiday-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  font-style: normal;
  line-height: 18px;
  color: #9b3a37;
  background: #fbe5e2;
}
.holiday-badge.rest { color: #9b3a37; background: #fbe5e2; }
.holiday-badge.work { color: #315c9b; background: #e2ecfb; }
.holiday-name { display: block; min-width: 0; font-size: 12px; line-height: 18px; color: #725a56; }
.holiday-rest .holiday-name { color: #9b3a37; }
.holiday-work .holiday-name { color: #315c9b; }
.holiday-festival .holiday-name { color: #725a56; }

/* Full month view keeps holiday labels apart from task and work-record rows. */
.calendar-page .calendar-day.holiday-rest:not(.selected):not(.other) { background: #fff7f5; }
.calendar-page .calendar-day.holiday-work:not(.selected):not(.other) { background: #f3f7fd; }
.calendar-page .calendar-day.holiday-rest:not(.today):not(.selected) .day-number { color: #9b3a37; }
.calendar-page .calendar-day.holiday-work:not(.today):not(.selected) .day-number { color: #315c9b; }
.calendar-page .calendar-day .day-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.calendar-page .calendar-day .day-top .holiday-badge { margin-right: auto; }
.calendar-page .calendar-day .day-number { flex: 0 0 24px; margin: 0; }
.calendar-page .calendar-day > .holiday-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: -2px 0 5px; }
.calendar-page .calendar-day.other .holiday-name { opacity: .8; }
.calendar-page .calendar-day.selected > .holiday-name { color: #315c9b; }

/* Mini calendar reserves a readable holiday row, even on ordinary dates. */
.home-page .wb-calendar-cells {
  flex: 0 0 auto;
  min-height: calc(var(--wb-calendar-rows) * 54px + (var(--wb-calendar-rows) - 1) * 3px);
  max-height: none;
  grid-template-rows: repeat(var(--wb-calendar-rows), minmax(54px, auto));
}
.home-page .wb-calendar-cell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 18px 18px 6px;
  align-items: center;
  justify-items: center;
  align-content: center;
  gap: 1px;
  min-height: 54px;
  padding: 4px 2px;
}
.home-page .wb-calendar-cell > span:first-child { grid-column: 1; grid-row: 1; justify-self: start; width: 18px; margin-left: 0; text-align: center; line-height: 18px; }
.home-page .wb-calendar-cell > .holiday-badge { position: absolute; top: 4px; right: 3px; width: 16px; height: 16px; line-height: 16px; }
.home-page .wb-calendar-cell > .holiday-name { grid-column: 1; grid-row: 2; width: 100%; min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; line-height: 18px; text-align: center; }
.home-page .wb-calendar-cell > .wb-date-markers { grid-column: 1; grid-row: 3; }
.home-page .wb-calendar-cell.holiday-rest:not(.is-today):not(.is-selected):not(.is-other) { background: #fff7f5; color: #9b3a37; }
.home-page .wb-calendar-cell.holiday-work:not(.is-today):not(.is-selected):not(.is-other) { background: #f3f7fd; color: #315c9b; }
.home-page .wb-calendar-cell.is-other > .holiday-name { opacity: .8; }
.home-page .wb-calendar-cell.is-today.is-selected > .holiday-name { color: #fff; }
.home-page .wb-calendar-cell.is-today.is-selected > .holiday-badge { box-shadow: 0 0 0 1px #ffffff80; }

.holiday-summary {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 9px;
  color: #725a56;
  background: #f8f6f3;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.holiday-summary.rest { color: #8c3e38; background: #fff2ef; }
.holiday-summary.work { color: #315c9b; background: #eef4fd; }
.holiday-summary > .holiday-badge { margin-top: 1px; }
.holiday-source { margin: 9px 0 0; color: #59697a; font-size: 12px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.holiday-source a { color: #315c9b; text-decoration: underline; text-underline-offset: 3px; }
.holiday-source > span { display: block; }
.holiday-sync-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; margin-top: 4px; }
.holiday-source > .holiday-sync-line { display: flex; }
.holiday-sync-line > span { flex: 1 1 170px; min-width: 0; }
.holiday-sync-line small { display: block; font-size: 12px; color: #667586; }
.holiday-sync-button { min-height: 28px; padding: 3px 7px; border: 1px solid #d4dfed; border-radius: 7px; background: #fff; color: #315c9b; font-size: 12px; line-height: 1.5; }
.holiday-sync-button:hover { background: #edf4ff; }
.holiday-sync-button:disabled { opacity: .65; cursor: default; }
.holiday-sync-button:focus-visible { outline: 2px solid #2459e8; outline-offset: 2px; }
.holiday-source.unknown { color: #59697a; }
.calendar-page .calendar-main > .holiday-source { margin: 0; padding: 0 17px 12px; }
.home-page .wb-calendar .holiday-source { margin-top: 6px; }
.holiday-legend { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 12px; line-height: 1.5; }
.calendar-legend .holiday-badge, .home-page .wb-calendar-legend .holiday-badge { width: 18px; height: 18px; border-radius: 5px; font-size: 12px; line-height: 18px; }
.calendar-legend .holiday-legend, .home-page .wb-calendar-legend .holiday-legend { column-gap: 5px; }
