/* Share one compact row: quote centered in the free area, summaries on the right. */
.calendar-bottom-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) max-content;
  grid-template-areas: "quote stats";
  align-items: center;
  justify-items: center;
  gap: 14px;
  padding: 8px 18px;
  min-width: 0;
  overflow-x: auto;
}

.calendar-bottom-summary .quote-ticker-container {
  grid-area: quote;
  width: min(640px, 100%);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  justify-self: center;
}

.calendar-bottom-summary .quote-ticker-track {
  min-width: 0;
}

.calendar-bottom-summary .summary-chip-group {
  grid-area: stats;
  min-width: 0;
  max-width: 100%;
  justify-self: end;
  justify-content: flex-end;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 10px;
  line-height: 1.45;
}

.calendar-bottom-summary .summary-chip {
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-end;
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Existing feature styles use display:flex, so hidden must win the cascade. */
.app-sidebar [data-feature-disabled="task-board"][hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .calendar-bottom-summary {
    padding-inline: 10px;
  }

  .calendar-bottom-summary .summary-chip-group > span {
    display: none;
  }
}


/* Vacation names share the date row; only their text shrinks to the free width. */
.cell-top.has-leave-summary { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 0 5px; }
.cell-top.has-leave-summary > .date-number { flex: 0 0 22px; }
.cell-top.has-leave-summary > .today-pill, .cell-top.has-leave-summary > .holiday-tag { flex: 0 0 auto; margin-left: 0; }
.cell-top.has-leave-summary > .calendar-leave-summary { order: 1; flex: 1 1 0; }
.calendar-leave-summary { display: inline-flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; text-align: right; min-width: 0; max-width: 100%; height: 22px; color: var(--calendar-leave-text,#667085); font-size: 11.5px; line-height: 1.65; font-weight: 400; white-space: nowrap; }
.calendar-leave-track { display: inline-flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: baseline; white-space: nowrap; transform-origin: right center; }
.calendar-leave-person { display: inline-flex; flex: 0 0 auto; align-items: baseline; white-space: nowrap; }
.calendar-leave-item { display: inline; flex: 0 0 auto; margin: 0; padding: 1px 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; text-align: right; white-space: nowrap; word-break: normal; overflow-wrap: normal; cursor: pointer; }
.calendar-leave-item:hover { color: var(--calendar-leave-hover,#344054); text-decoration: underline; text-underline-offset: 3px; }
.calendar-leave-item:focus-visible { outline: 2px solid var(--calendar-leave-hover,#344054); outline-offset: 2px; }
.calendar-leave-item.is-past-event { opacity: .62; }
.calendar-leave-separator { flex: 0 0 auto; white-space: pre; }
.calendar-leave-summary .event-time-unspecified { padding-inline: .35em; border-width: .08em; border-radius: .35em; }
.calendar-week-content [data-week-leaves]:not(:empty) { margin-bottom: 6px; }
.calendar-date-heading { display: flex; align-items: center; flex-wrap: nowrap; gap: 4px 12px; }
.calendar-date-heading h3 { flex: 0 0 auto; }
.calendar-date-heading [data-day-leaves] { min-width: 0; flex: 1 1 0; }

/* Align leave names to the available date-header edge in every calendar view. */
.calendar-week-content [data-week-leaves] > .calendar-leave-summary,
.calendar-date-heading [data-day-leaves] > .calendar-leave-summary { display: flex; width: 100%; }

/* A narrow browser scrolls the month and its weekday headings together.
   Reserve real space for the date/holiday before fitting the leave names. */
.app-main:has(> .calendar-scroll > #monthGrid.is-continuous-month[style*="display: grid"]) { overflow-x: auto; overflow-y: hidden; }
.app-main:has(> .calendar-scroll > #monthGrid.is-continuous-month[style*="display: grid"]) > .day-header-grid,
.app-main:has(> .calendar-scroll > #monthGrid.is-continuous-month[style*="display: grid"]) > .calendar-scroll { min-width: 1120px; }

/* Consecutive weeks share one scroll surface without stretching distant rows. */
#calendarScrollWrapper:has(#monthGrid.is-continuous-month) { overflow-anchor: none; overscroll-behavior-y: contain; scroll-behavior: auto; }
#monthGrid.is-continuous-month { flex: 0 0 auto; min-height: 100%; grid-auto-rows: minmax(172px, max-content); align-content: start; overflow-anchor: none; }
#monthGrid.is-continuous-month .calendar-month-start { border-top-color: #a5b4fc; }
#monthGrid.is-continuous-month .date-number.is-month-start { flex: 0 0 auto; width: auto; min-width: 22px; height: auto; padding: 1px 5px; border-radius: 5px; background: #eef2ff; font-size: 11.5px; line-height: 1.65; word-break: keep-all; }
html[data-theme="dark"] #monthGrid.is-continuous-month .calendar-month-start { border-top-color: #798ac7; }
html[data-theme="dark"] #monthGrid.is-continuous-month .date-number.is-month-start:not(.today) { background: #2a3350; }

/* Only the time label is outlined; event and category surfaces stay unchanged. */
.event-time-unspecified {
  display:inline-block; vertical-align:baseline; box-sizing:border-box; padding:0 4px;
  border:1px solid #ba8088; border-radius:4px; background:#fff9f9; color:#75434b;
  font-size:.95em; font-weight:600; line-height:1.3; white-space:nowrap;
}
html[data-theme="dark"] .event-time-unspecified { border-color:#ab737d; background:#2b242e; color:#edc5cd; }
