.events-menu { position: relative; }
.events-menu > summary {
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  position: relative;
  border-radius: 8px;
}
.events-menu > summary::-webkit-details-marker { display: none; }
.events-menu-icon {
  width: 20px;
  height: 20px;
  background: currentColor;
  --calendar-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M7 3v4m10-4v4M8 14h2m4 0h2m-8 3h2m4 0h2'/%3E%3C/svg%3E");
  -webkit-mask: var(--calendar-icon) center / contain no-repeat;
  mask: var(--calendar-icon) center / contain no-repeat;
}
.events-menu[open] > summary { color: #a7bcff; }
.events-menu-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + 18px);
  right: 0;
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 104px);
  border: 1px solid #35456a;
  border-radius: 11px;
  background: #0b101c;
  box-shadow: 0 14px 38px #0008;
  overflow: hidden;
}
.events-menu[open] > .events-menu-panel {
  display: flex;
  flex-direction: column;
}
.events-menu-panel iframe {
  display: block;
  flex: 0 1 auto;
  width: 100%;
  height: min(550px, calc(100dvh - 145px));
  min-height: 0;
  border: 0;
}
.events-menu-panel > a {
  display: block;
  flex: none;
  padding: 8px 14px;
  border-top: 1px solid #293650;
  color: #a7bcff;
  font-size: 13px;
  font-weight: 700;
}
.events-menu-panel > a:hover { background: #16223e; }
.events-menu-panel > a:focus-visible { outline-offset: -4px; }
@media (max-width: 980px) {
  .events-menu { position: static; }
  .events-menu-panel {
    top: calc(100% + 4px);
    right: 12px;
    width: min(460px, calc(100% - 24px));
    max-height: calc(100dvh - 96px);
  }
}

.events-menu > summary.has-upcoming-event::after {
  content: '';
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: calc(50% + 3px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #73ead0;
  box-shadow: 0 0 0 2px #0b101c;
}
.calendar-panel td a.has-event.next-event {
  background: #163b48;
  color: #e5fff8;
  box-shadow: inset 0 0 0 2px #73ead0;
}
.calendar-panel .next-event .day-logo {
  width: min(54px, 94%);
  filter: drop-shadow(0 1px 3px #050b13);
}
.event-summary.next-event time {
  color: #91edda;
  font-weight: 700;
}
