.event-calendar-shell {
  position: relative;
  min-height: 34rem;
  border: 1px solid var(--ng-border);
  border-radius: 10px;
  background: var(--ng-surface-raised);
  box-shadow: 0 18px 42px rgba(20, 27, 42, 0.08);
  padding: 1.25rem;
}

.event-calendar-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  position: absolute;
  top: 1.55rem;
  right: 1.25rem;
  z-index: 2;
  color: var(--ng-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.event-calendar-status .lucide,
.event-calendar-status [data-lucide] {
  width: 1rem;
  height: 1rem;
  animation: event-calendar-spin 0.85s linear infinite;
}

.event-calendar-message {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  border: 1px dashed rgba(19, 115, 181, 0.28);
  border-radius: 8px;
  background: var(--ng-blue-soft);
  margin-bottom: 1rem;
  padding: 1.2rem;
  text-align: center;
}

.event-calendar-message[hidden],
.event-calendar-status[hidden] {
  display: none;
}

.event-calendar-message > .lucide,
.event-calendar-message > [data-lucide] {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--ng-blue-strong);
}

.event-calendar-message h3 {
  color: var(--ng-ink);
  font-size: 1rem;
  margin: 0;
}

.event-calendar-message p {
  color: var(--ng-muted);
  margin: 0;
}

.event-calendar-message--error {
  border-color: rgba(178, 123, 8, 0.35);
  background: rgba(255, 248, 230, 0.9);
}

.event-calendar-message--error > .lucide,
.event-calendar-message--error > [data-lucide] {
  color: var(--ng-amber-strong);
}

.event-calendar--failed {
  display: none;
}

.event-calendar-shell .fc {
  color: var(--ng-ink);
  font-family: var(--ng-font-sans, sans-serif);
  font-size: 0.92rem;
}

.event-calendar-shell .fc .fc-toolbar {
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  padding-right: 7rem;
}

.event-calendar-shell .fc .fc-toolbar-title {
  color: var(--ng-ink);
  font-family: var(--ng-font-display, sans-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 750;
}

.event-calendar-shell .fc .fc-button {
  min-height: 2.35rem;
  border: 1px solid var(--ng-border);
  border-radius: 7px;
  background: var(--ng-surface-raised);
  color: var(--ng-ink-soft);
  box-shadow: none;
  font-weight: 750;
}

.event-calendar-shell .fc .fc-button:hover,
.event-calendar-shell .fc .fc-button:focus,
.event-calendar-shell .fc .fc-button:active {
  border-color: rgba(19, 115, 181, 0.45);
  background: var(--ng-blue-soft);
  color: var(--ng-blue-strong);
}

.event-calendar-shell .fc .fc-button:focus-visible,
.event-calendar-shell .fc a:focus-visible {
  outline: 3px solid rgba(19, 115, 181, 0.24);
  outline-offset: 2px;
}

.event-calendar-shell .fc-theme-classic td,
.event-calendar-shell .fc-theme-classic th,
.event-calendar-shell .fc-theme-classic .fc-scrollgrid {
  border-color: var(--ng-border);
}

.event-calendar-shell .fc .fc-col-header-cell {
  background: rgba(240, 245, 249, 0.95);
}

.event-calendar-shell .fc .fc-col-header-cell-cushion {
  color: var(--ng-ink-soft) !important;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.35rem;
  text-transform: uppercase;
}

.event-calendar-shell .fc .fc-daygrid-day-number {
  color: var(--ng-ink) !important;
  font-weight: 750;
  padding: 0.45rem 0.55rem;
}

.event-calendar-shell .fc .fc-day-today {
  background: rgba(19, 115, 181, 0.08) !important;
}

.event-calendar-shell .fc .fc-day-other .fc-daygrid-day-number {
  color: var(--ng-muted) !important;
}

.event-calendar-shell .fc .fc-event {
  border: 1px solid rgba(19, 115, 181, 0.32);
  border-radius: 5px;
  background: var(--ng-blue-strong);
  color: #fff !important;
  cursor: pointer;
  font-weight: 700;
}

.event-calendar-shell .fc .fc-daygrid-event,
.event-calendar-shell #event-calendar [role="gridcell"] a[href] {
  align-items: flex-start;
  white-space: normal;
}

.event-calendar-shell .fc .fc-daygrid-event .fc-event-main,
.event-calendar-shell .fc .fc-daygrid-event .fc-event-title-container,
.event-calendar-shell #event-calendar [role="gridcell"] a[href] > div:last-child {
  min-width: 0;
}

.event-calendar-shell .fc .fc-daygrid-event .fc-event-time {
  flex: 0 0 auto;
}

.event-calendar-shell .fc .fc-daygrid-event .fc-event-title,
.event-calendar-shell #event-calendar [role="gridcell"] a[href] > div:last-child > div {
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
}

.event-calendar-shell .fc .fc-event:hover,
.event-calendar-shell .fc .fc-event:focus {
  border-color: #075c9a;
  background: #075c9a;
  color: #fff !important;
}

.event-calendar-shell .fc .fc-daygrid-more-link {
  color: var(--ng-blue-strong) !important;
  font-size: 0.78rem;
  font-weight: 800;
}

.event-calendar-shell .fc .fc-popover {
  border: 1px solid var(--ng-border);
  border-radius: 8px;
  background: var(--ng-surface-raised);
  box-shadow: 0 18px 42px rgba(20, 27, 42, 0.16);
  overflow: hidden;
}

body > [role="dialog"][data-date][id*="popover-"] {
  z-index: 20;
  overflow: hidden;
  border: 1px solid var(--ng-border);
  border-radius: 8px;
  background: var(--ng-surface-raised, #fff);
  color: var(--ng-ink);
  box-shadow: 0 18px 42px rgba(20, 27, 42, 0.2);
}

body > [role="dialog"][data-date][id*="popover-"] > div:nth-child(2) {
  border-bottom: 1px solid var(--ng-border);
  background: var(--ng-blue-soft, #eef5fb);
}

body > [role="dialog"][data-date][id*="popover-"] > div:nth-child(3) {
  background: var(--ng-surface-raised, #fff);
}

body > [role="dialog"][data-date][id*="popover-"] a[href] {
  color: var(--ng-blue-strong) !important;
}

body > [role="dialog"][data-date][id*="popover-"] a[href]:hover,
body > [role="dialog"][data-date][id*="popover-"] a[href]:focus-visible {
  background: var(--ng-blue-soft, #eef5fb);
}

.event-calendar-shell .fc .fc-popover-header {
  background: var(--ng-blue-soft);
  color: var(--ng-ink);
  font-weight: 800;
}

.event-list-timeframe {
  display: inline-flex;
  gap: 0.35rem;
  border: 1px solid var(--ng-border);
  border-radius: 8px;
  background: var(--ng-surface-raised);
  margin-bottom: 1rem;
  padding: 0.3rem;
}

.event-list-timeframe__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 6px;
  color: var(--ng-ink-soft) !important;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.48rem 0.72rem;
}

.event-list-timeframe__item.is-active {
  background: var(--ng-blue-soft);
  color: var(--ng-blue-strong) !important;
}

.event-list-timeframe__item .lucide,
.event-list-timeframe__item [data-lucide] {
  width: 1rem;
  height: 1rem;
}

@keyframes event-calendar-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767.98px) {
  .event-calendar-shell {
    min-height: 28rem;
    padding: 0.8rem;
  }

  .event-calendar-status {
    position: static;
    justify-content: center;
    margin-bottom: 0.6rem;
  }

  .event-calendar-shell .fc .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding-right: 0;
  }

  .event-calendar-shell .fc .fc-toolbar-chunk:nth-child(2) {
    order: -1;
  }

  .event-calendar-shell .fc .fc-toolbar-title {
    text-align: center;
  }

  .event-calendar-shell .fc .fc-toolbar-chunk:first-child {
    display: flex;
    justify-content: center;
  }

  .event-calendar-shell .fc .fc-col-header-cell-cushion {
    font-size: 0.68rem;
    letter-spacing: 0;
    padding-inline: 0.1rem;
  }

  .event-calendar-shell .fc .fc-daygrid-day-number {
    padding: 0.32rem;
  }

  .event-calendar-shell .fc .fc-event {
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-calendar-status .lucide,
  .event-calendar-status [data-lucide] {
    animation: none;
  }
}
