.cowt-events {
  padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem);
  max-width: 1100px;
  margin: 0 auto;
}

.cowt-events__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.cowt-events__toggle {
  border: 1px solid rgba(148,163,184,.4);
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}

.cowt-events__toggle.is-active {
  background: var(--wp--preset--color--brand-blue);
  border-color: var(--wp--preset--color--brand-blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37,99,235,.24);
}

.cowt-events__toggle:hover,
.cowt-events__toggle:focus {
  border-color: var(--wp--preset--color--brand-blue);
}

.cowt-events__list,
.cowt-events__calendar {
  background: #fff;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 18px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 20px 40px rgba(15,23,42,.08);
}

.cowt-events__list {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.cowt-events__occurrence-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}


.cowt-events__item {
  display: grid;
  gap: .75rem;
  background: #fff;
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 16px;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: 0 16px 30px rgba(15,23,42,.08);
  transition: box-shadow .2s ease, transform .2s ease;
  scroll-margin-top: clamp(5rem, 12vh, 7rem);
}

.cowt-events__item.is-highlighted {
  border-color: var(--wp--preset--color--brand-blue);
  box-shadow: 0 24px 48px rgba(35,79,163,.28);
  position: relative;
}
.cowt-events__item.is-highlighted::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 3px rgba(35,79,163,.25);
  pointer-events: none;
  opacity: 0;
  animation: cowt-event-highlight 1.6s ease;
}
@keyframes cowt-event-highlight {
  0% { opacity: .55; }
  100% { opacity: 0; }
}

.cowt-events__item:hover,
.cowt-events__item:focus-within {
  box-shadow: 0 22px 40px rgba(15,23,42,.12);
  transform: translateY(-2px);
}

.cowt-events__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cowt-events__title {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.cowt-events__item a {
  color: inherit;
  text-decoration: none;
}

.cowt-events__item a:hover,
.cowt-events__item a:focus {
  color: var(--wp--preset--color--brand-blue);
}

.cowt-events__calendar-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,.35);
  background: rgba(37,99,235,.08);
  color: var(--wp--preset--color--brand-blue);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
  margin-left: auto;
}

.cowt-events__calendar-link:hover,
.cowt-events__calendar-link:focus {
  color: #fff;
  background: var(--wp--preset--color--brand-blue);
  border-color: var(--wp--preset--color--brand-blue);
  box-shadow: 0 12px 24px rgba(37,99,235,.25);
}

.cowt-events__calendar-link svg {
  width: 20px;
  height: 20px;
}

.cowt-events__calendar-link span {
  line-height: 1;
  white-space: nowrap;
}

.cowt-events__occurrence {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  font-weight: 600;
  color: rgba(15,23,42,.75);
}

.cowt-events__location {
  font-weight: 600;
  color: rgba(15,23,42,.65);
}

.cowt-events__description {
  margin-top: .5rem;
  color: rgba(15,23,42,.78);
  line-height: 1.6;
}

.cowt-events__description > *:last-child {
  margin-bottom: 0;
}

.cowt-events__register-wrap {
  margin-top: .75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
}

.cowt-events__register {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-radius: 999px;
  border: 1px solid var(--wp--preset--color--brand-blue);
  background: var(--wp--preset--color--brand-blue);
  color: #fff;
  font-weight: 600;
  padding: .55rem 1.5rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.cowt-events__register:hover,
.cowt-events__register:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(37,99,235,.2);
  outline: none;
}

.cowt-events__register.is-secondary {
  background: #fff;
  color: var(--wp--preset--color--brand-blue);
  border-color: rgba(37,99,235,.45);
}

.cowt-events__register.is-disabled {
  background: rgba(148,163,184,.2);
  border-color: rgba(148,163,184,.4);
  color: rgba(15,23,42,.55);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.cowt-events__register.is-loading {
  opacity: .7;
  pointer-events: none;
}

.cowt-events__register-note {
  font-size: .85rem;
  color: rgba(15,23,42,.65);
}

.cowt-events__register-note.is-error {
  color: #b91c1c;
}

.cowt-events__registrants {
  width: 100%;
  border: 1px dashed rgba(15,23,42,.18);
  border-radius: 12px;
  padding: .85rem 1rem;
  background: rgba(15,23,42,.03);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.cowt-events__registrants-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(15,23,42,.7);
  font-weight: 700;
}

.cowt-events__registrants-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.cowt-events__registrants-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  line-height: 1.4;
}

.cowt-events__registrant-name {
  font-weight: 600;
  color: rgba(15,23,42,.85);
}

.cowt-events__registrant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  font-size: .88rem;
  color: rgba(15,23,42,.7);
}

.cowt-events__registrant-meta span,
.cowt-events__registrant-meta a {
  display: inline-flex;
  align-items: center;
}

.cowt-events__registrant-username {
  font-weight: 600;
}

.cowt-events__registrant-phone {
  font-family: var(--wp--preset--font-family--system-sans, inherit);
}

.cowt-events__registrant-names,
.cowt-events__registrant-levels,
.cowt-events__registrant-phone {
  color: rgba(15,23,42,.7);
}

.cowt-events__registrant-email {
  color: var(--wp--preset--color--brand-blue);
  text-decoration: underline;
  font-size: .9rem;
}

.cowt-events__registrants-empty {
  font-size: .9rem;
  color: rgba(15,23,42,.6);
}

.cowt-events__item--modal {
  border-bottom: none;
  padding-bottom: 0;
}

.cowt-events__calendar {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  display: none;
}

.cowt-events__calendar.is-active {
  display: block;
}

.cowt-events__calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cowt-events__calendar-label {
  font-weight: 700;
  font-size: 1.1rem;
}

.cowt-events__calendar-nav {
  border: none;
  background: rgba(15,23,42,.08);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
}

.cowt-events__calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .5rem;
}

.cowt-events__weekday {
  font-weight: 700;
  text-transform: uppercase;
  font-size: .75rem;
  color: rgba(71,85,105,.85);
}

.cowt-events__day {
  min-height: 120px;
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 14px;
  padding: .6rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  background: #fff;
}
.cowt-events__day--muted {
  opacity: .35;
}

.cowt-events__day--today {
  border-color: var(--wp--preset--color--brand-blue);
  box-shadow: 0 8px 24px rgba(37,99,235,.18);
}

.cowt-events__day-number {
  font-weight: 700;
  color: rgba(15,23,42,.75);
}

.cowt-events__day-events {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.cowt-events__day-event {
  border-left: 3px solid var(--wp--preset--color--brand-blue);
  padding-left: .5rem;
  font-size: .85rem;
  color: rgba(15,23,42,.8);
}

button.cowt-events__day-event {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid var(--wp--preset--color--brand-blue);
  padding: 0;
  padding-left: .5rem;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

button.cowt-events__day-event:hover,
button.cowt-events__day-event:focus {
  color: var(--wp--preset--color--brand-blue);
}

button.cowt-events__day-event:focus {
  outline: 2px solid var(--wp--preset--color--brand-blue);
  outline-offset: 2px;
}

.cowt-events__day-event-title {
  display: block;
  font-weight: 600;
}

.cowt-events__day-event-time {
  display: block;
  color: rgba(15,23,42,.65);
  margin-top: .15rem;
  font-size: .78rem;
}

.cowt-events__day-event--empty {
  border-left: none;
  padding-left: 0;
  color: rgba(148,163,184,.7);
  font-style: italic;
  cursor: default;
}

@media (max-width: 860px){
  .cowt-events__calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cowt-events__weekday {
    display: none;
  }

  .cowt-events__day {
    min-height: auto;
    padding: .75rem;
  }

  @supports selector(:has(*)) {
    .cowt-events__day--muted,
    .cowt-events__day:not(:has(.cowt-events__day-number)) {
      display: none;
    }
  }

  .cowt-events__day--muted {
    display: none;
  }
}

@media (max-width: 640px){
  .cowt-events__controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .cowt-events__calendar-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}


.cowt-events--next .cowt-events__list {
  gap: clamp(.9rem, 2.6vw, 1.4rem);
}

.cowt-events--next .cowt-events__item {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(.9rem, 2.4vw, 1.3rem);
  box-shadow: 0 14px 28px rgba(15,23,42,.08);
}
