.bsf-calendar {
  --bsf-calendar-primary: #40527a;
  --bsf-calendar-border: #d9dee5;
  --bsf-calendar-muted: #737a84;
  --bsf-calendar-outside: #f3f4f5;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  color: #171c25;
  font-family: inherit;
}

.bsf-calendar-header {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.bsf-calendar-header h2 {
  margin: 0 !important;
  padding: 0 !important;
  color: #20242a !important;
  font-size: clamp(30px, 3vw, 48px) !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  text-align: center;
}

.bsf-calendar-arrow {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--bsf-calendar-primary) !important;
  font-size: 50px;
  font-weight: 300;
  line-height: 1;
  text-decoration: none !important;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.bsf-calendar-arrow:hover,
.bsf-calendar-arrow:focus-visible {
  color: #fff !important;
  background: var(--bsf-calendar-primary);
}

.bsf-calendar-toolbar {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bsf-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  min-height: 34px;
}

.bsf-calendar-legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 16px;
  line-height: 1.25;
}

.bsf-calendar-legend i {
  display: block;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border-radius: 50%;
}

.bsf-calendar-list-link {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: var(--bsf-calendar-primary) !important;
  text-decoration: none !important;
  border-radius: 5px;
}

.bsf-calendar-list-link:hover,
.bsf-calendar-list-link:focus-visible {
  background: #eef1f6;
}

.bsf-calendar-list-link svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.bsf-calendar-grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
}

.bsf-calendar-grid th,
.bsf-calendar-grid td {
  border: 1px solid var(--bsf-calendar-border);
}

.bsf-calendar-grid thead th {
  height: 54px;
  padding: 9px 7px;
  color: #111821;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  background: #fff;
}

.bsf-calendar-grid .bsf-week-heading,
.bsf-calendar-grid .bsf-week-number {
  width: 64px;
}

.bsf-calendar-grid .bsf-week-number {
  padding: 15px 5px;
  color: #1f2733;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  vertical-align: top;
  background: #fff;
}

.bsf-calendar-grid td {
  height: 122px;
  padding: 10px 9px 9px;
  vertical-align: top;
  background: #fff;
}

.bsf-calendar-grid td.bsf-day-outside {
  background: var(--bsf-calendar-outside);
}

.bsf-day-number {
  display: block;
  margin-bottom: 8px;
  color: var(--bsf-calendar-muted);
  font-size: 15px;
  line-height: 1;
  text-align: center;
}

.bsf-day-outside .bsf-day-number {
  opacity: 0;
}

.bsf-day-events {
  display: grid;
  gap: 5px;
}

.bsf-event-pill {
  display: block;
  min-width: 0;
  padding: 4px 7px;
  overflow: hidden;
  color: var(--bsf-event-text) !important;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--bsf-event-color);
  border-radius: 4px;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.bsf-event-pill span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bsf-event-pill:hover,
.bsf-event-pill:focus-visible {
  color: var(--bsf-event-text) !important;
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.bsf-more-events {
  display: block;
  padding: 2px 5px;
  color: var(--bsf-calendar-primary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.bsf-calendar-mobile {
  display: none;
}

.bsf-calendar-message,
.bsf-calendar-empty {
  margin: 0;
  padding: 22px;
  text-align: center;
  background: #f5f6f8;
  border: 1px solid var(--bsf-calendar-border);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .bsf-calendar-grid td {
    height: 106px;
    padding: 8px 5px;
  }

  .bsf-event-pill {
    padding-right: 4px;
    padding-left: 4px;
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .bsf-calendar-header {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
    margin-bottom: 18px;
  }

  .bsf-calendar-header h2 {
    font-size: 28px !important;
  }

  .bsf-calendar-arrow {
    width: 40px;
    height: 40px;
    font-size: 42px;
  }

  .bsf-calendar-toolbar {
    align-items: flex-start;
  }

  .bsf-calendar-legend {
    gap: 8px 13px;
  }

  .bsf-calendar-legend span {
    font-size: 14px;
  }

  .bsf-calendar-desktop {
    display: none;
  }

  .bsf-calendar-mobile {
    display: grid;
    gap: 20px;
  }

  .bsf-mobile-day {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--bsf-calendar-border);
    border-radius: 8px;
  }

  .bsf-mobile-day h3 {
    margin: 0 !important;
    padding: 12px 15px !important;
    color: #20252b !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    background: #f2f4f7;
    border-bottom: 1px solid var(--bsf-calendar-border);
  }

  .bsf-mobile-events {
    display: grid;
  }

  .bsf-mobile-event {
    position: relative;
    display: grid;
    gap: 3px;
    padding: 13px 15px 13px 20px;
    color: #1e2530 !important;
    text-decoration: none !important;
    border-bottom: 1px solid var(--bsf-calendar-border);
  }

  .bsf-mobile-event::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 5px;
    content: '';
    background: var(--bsf-event-color);
  }

  .bsf-mobile-event:last-child {
    border-bottom: 0;
  }

  .bsf-mobile-event:hover,
  .bsf-mobile-event:focus-visible {
    background: #f7f8fa;
  }

  .bsf-mobile-event strong {
    font-size: 16px;
  }

  .bsf-mobile-event span {
    color: #656d78;
    font-size: 13px;
  }
}

@media (max-width: 460px) {
  .bsf-calendar-header h2 {
    font-size: 23px !important;
  }

  .bsf-calendar-list-link {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
}

