:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #203e37;
  background: #f5f4ee;
  --fc-border-color: #e0e5de;
  --fc-today-bg-color: #f4f7e8;
  --fc-page-bg-color: #fff;
  --fc-neutral-bg-color: #f7f8f4;
  --fc-list-event-hover-bg-color: #f0f4ed;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow: hidden; }
button { font: inherit; }
[hidden] { display: none !important; }

#calendar-container {
  position: fixed;
  inset: 24px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dce2d8;
  border-radius: 12px;
  overflow: hidden;
}

#calendar { flex: 1; min-height: 0; }
.fc { font-size: 12px; }
.fc a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:focus-visible { outline: 2px solid #8f9e32; outline-offset: 3px; }
.toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
}
.toolbar h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -.6px;
  text-align: center;
  text-transform: capitalize;
}
.navigation { display: flex; align-items: center; gap: 5px; }
.icon-button, .button-small {
  border: 1px solid #e0e5de;
  background: #fff;
  color: #203e37;
  border-radius: 6px;
}
.icon-button { width: 33px; height: 33px; padding: 0; font-size: 25px; line-height: 1; }
.button-small { margin-left: 6px; padding: 7px 12px; font-size: 12px; font-weight: 600; }
.icon-button:hover, .button-small:hover { background: #edf1e7; }
.view-switch {
  justify-self: end;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #f1f3ee;
  border-radius: 7px;
}
.view-switch button {
  border: 0;
  border-radius: 5px;
  padding: 8px 14px;
  background: transparent;
  color: #68766f;
  font-size: 12px;
  font-weight: 550;
}
.view-switch button:hover { color: #203e37; }
.view-switch button[aria-pressed="true"] {
  color: #203e37;
  background: #fff;
  box-shadow: 0 1px 3px #00000012;
}

.fc .fc-scrollgrid { border-left: 0; border-right: 0; border-bottom: 0; }
.fc .fc-scrollgrid-section > td { border-right: 0; }
.fc .fc-col-header-cell {
  padding: 10px 0;
  background: #fafbf8;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #68766f;
  font-weight: 600;
}
.fc .fc-daygrid-day-top { padding: 8px 10px 4px; }
.fc .fc-daygrid-day-number { padding: 0; font-weight: 500; }
.fc .fc-day-today .fc-daygrid-day-number {
  background: #203e37;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -3px -3px 0 0;
}
.fc .fc-daygrid-day-events { margin: 2px 5px 8px; }
.fc .fc-event:not(.fc-list-event) { border: 0; border-radius: 4px; margin-bottom: 4px; }
.fc .fc-daygrid-block-event .fc-event-main { padding: 5px 7px; }
.fc .fc-daygrid-block-event .fc-event-main-frame { display: block; }
.fc .fc-event-time {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 750;
  opacity: 1;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}
.fc .fc-event-title { font-weight: 550; white-space: normal; overflow-wrap: break-word; word-break: normal; line-height: 1.4; }
.fc .fc-event:not(.fc-list-event):focus-visible,
.fc .fc-list-event-title a[href]:focus-visible { outline: 2px solid #52734d; outline-offset: 2px; }
.fc .event-public { background: #e8f0e4; cursor: default; }
.fc .event-public:not(.fc-list-event) { border-left: 3px solid #7c995e; }
.fc .event-linked { cursor: pointer; }
.fc .event-public .fc-event-main { color: #315134; }
.fc .event-private {
  background: repeating-linear-gradient(-45deg, #f5f1ed, #f5f1ed 5px, #f0ebe6 5px, #f0ebe6 6px);
  cursor: default;
}
.fc .event-private:not(.fc-list-event) { border-left: 3px solid #b5a396; }
.fc .event-private .fc-event-main { color: #78665b; }
.fc .fc-list { border-left: 0; border-right: 0; border-bottom: 0; }
.fc .fc-list-table { border-collapse: separate; border-spacing: 0; }
.fc .fc-list-table td,
.fc .fc-list-table th {
  border: 0;
  border-top: 1px solid var(--fc-border-color);
}
.fc .fc-list-day-cushion { background: #f5f7f1; padding: 12px 20px; }
.fc .fc-list-event td { padding: 14px 20px; }
.fc .fc-list-table .fc-list-event { box-shadow: none; }
.fc .fc-list-table .fc-list-event::before,
.fc .fc-list-table .fc-list-event::after { content: none; }
.fc .fc-list-event-dot { border-color: #7c995e; }
.fc .event-private .fc-list-event-dot { border-color: #b5a396; }
.fc .fc-list-table tr.event-private { background: #f3eee9; }
.fc .fc-list-event-time { font-weight: 750; font-variant-numeric: tabular-nums; }
.fc .fc-timegrid-event .fc-event-main { padding: 4px 6px; }
.fc .fc-timegrid-slot-label-cushion { font-weight: 600; color: #68766f; }
.fc .fc-list-event-title { line-height: 1.5; overflow-wrap: anywhere; }
.fc .fc-list-empty { background: #fff; color: #68766f; }

#notice { padding: 12px 20px; background: #fff1d6; color: #583b00; line-height: 1.5; }

.fc .event-expanded-harness { z-index: 10 !important; }
.fc .fc-timegrid-event.event-expanded {
  bottom: auto;
  height: var(--expanded-height);
}
.fc .event-expanded .fc-event-main,
.fc .event-expanded .fc-event-main-frame { height: auto; }
.fc .event-expanded .fc-event-main-frame { display: block; overflow: visible; }
.fc .event-expanded .fc-event-time { max-height: none; white-space: normal; overflow: visible; }
.fc .event-expanded .fc-event-time::after { content: none; }
.fc .event-expanded .fc-event-title { max-height: none; font-size: inherit; position: static; overflow: visible; }
.fc .fc-timegrid-event.event-size-probe { height: auto; visibility: hidden; pointer-events: none; }

.repeat-icon,
.event-recurring .fc-event-time::before,
.event-recurring-all-day .fc-event-title::before,
.event-recurring .fc-list-event-title::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 5px;
  vertical-align: -2px;
  background-color: currentColor;
  opacity: .7;
  mask: 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' stroke-linejoin='round'%3E%3Cpath d='m17 2 4 4-4 4M3 11V9a3 3 0 0 1 3-3h15M7 22l-4-4 4-4M21 13v2a3 3 0 0 1-3 3H3'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 600px) {
  #calendar-container { inset: 8px; border-radius: 9px; }
  .toolbar { grid-template-columns: 1fr auto; padding: 14px 12px; gap: 12px 8px; }
  .toolbar h2 { grid-row: 1; grid-column: 1 / -1; text-align: left; font-size: 22px; }
  .navigation { gap: 4px; }
  .icon-button { width: 30px; height: 31px; font-size: 23px; }
  .button-small { margin-left: 2px; padding: 7px 9px; font-size: 11px; }
  .view-switch button { padding: 8px 9px; font-size: 11px; }
  .fc .fc-col-header-cell { font-size: 9px; padding: 9px 0; }
  .fc .fc-daygrid-day-top { padding: 7px 5px 4px; }
  .fc .fc-daygrid-day-events { margin: 2px 2px 6px; }
  .fc .fc-daygrid-block-event .fc-event-main { padding: 4px 3px; }
  .fc .fc-event-title { font-size: 10px; }
  .fc .fc-event-time { font-size: 10px; }
  .fc .fc-list-day-cushion { padding: 12px; }
  .fc .fc-list-event td { padding: 12px 8px; }
  .fc .fc-list-event-time { white-space: nowrap; font-size: 11px; }
}

@media (max-width: 360px) {
  .toolbar { padding: 12px 8px; }
  .view-switch button { padding: 8px 7px; }
}

@media (max-width: 600px) {
  html, body { background: #fafafa; color: #151515; }
  html { overflow-y: auto; }
  body.mobile-month-mode, body.mobile-week-mode { overflow: visible; }
  .mobile-month-mode #calendar-container, .mobile-week-mode #calendar-container {
    position: relative;
    inset: auto;
    margin: 8px;
    min-height: calc(100dvh - 16px);
    overflow: hidden;
    background: #fafafa;
  }
  #calendar-container {
    border-color: #e2e2e2;
    --fc-border-color: #e2e2e2;
    --fc-today-bg-color: #f4f4f4;
    --fc-neutral-bg-color: #f5f5f5;
    --fc-list-event-hover-bg-color: #f0f0f0;
  }
  .toolbar { padding: 16px 12px 12px; gap: 12px 8px; background: #fff; }
  .toolbar h2 { grid-row: 1; grid-column: 1; font-size: 20px; letter-spacing: -.6px; }
  .navigation { grid-row: 1; grid-column: 2; justify-self: end; }
  .icon-button { width: 34px; height: 40px; font-size: 24px; }
  .button-small { min-height: 40px; margin-left: 0; padding: 7px 9px; font-size: 12px; }
  .icon-button, .button-small { color: #151515; border-color: #e2e2e2; background: #fff; }
  .icon-button:hover, .button-small:hover { background: #f2f2f2; }
  .view-switch { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; background: #f3f3f3; }
  .view-switch button { flex: 1; min-height: 40px; padding: 8px; font-size: 13px; color: #666; }
  .view-switch button[aria-pressed="true"] { color: #151515; background: #fff; }
  button:focus-visible, .agenda-event:focus-visible { outline: 2px solid #555; outline-offset: 2px; }

  .month-picker { padding: 0 10px 12px; background: #fff; border-bottom: 1px solid #e2e2e2; }
  .month-weekdays, .month-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .month-weekdays span { padding: 9px 0; text-align: center; font-size: 11px; color: #666; }
  .month-day { position: relative; width: 100%; height: 42px; padding: 4px 0 10px; background: none; border: 0; border-radius: 8px; color: #151515; font-size: 14px; }
  .month-day.outside-month { color: #9a9a9a; }
  .month-day:hover { background: #f2f2f2; }
  .month-day[aria-current="date"] > span:first-child { font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
  .month-day[aria-pressed="true"] { background: #151515; color: #fff; }
  .day-dot { position: absolute; width: 4px; height: 4px; bottom: 5px; left: calc(50% - 2px); background: #52734d; border-radius: 50%; }
  .month-day[aria-pressed="true"] .day-dot { background: #fff; }
  .week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 0 10px 12px; border-bottom: 1px solid #e2e2e2; background: #fff; }
  .week-day { position: relative; min-width: 0; height: 64px; padding: 8px 0 12px; border: 0; border-radius: 8px; background: transparent; color: #151515; }
  .week-day .day-name { display: block; margin-bottom: 4px; font-size: 11px; text-transform: uppercase; color: #666; }
  .week-day .day-number { display: block; font-size: 16px; font-weight: 650; }
  .week-day:hover { background: #f2f2f2; }
  .week-day[aria-current="date"] .day-number { text-decoration: underline; text-underline-offset: 3px; }
  .week-day[aria-pressed="true"] { background: #151515; color: #fff; }
  .week-day[aria-pressed="true"] .day-name, .week-day[aria-pressed="true"] .day-dot { color: #fff; }
  .week-day[aria-pressed="true"] .day-dot { background: #fff; }
  .day-agenda { padding: 18px 14px 22px; }
  .day-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
  .day-heading h3 { margin: 0; color: #151515; font-size: 16px; font-weight: 650; }
  .day-heading h3::first-letter { text-transform: uppercase; }
  #selected-day-today { color: #666; font-size: 12px; }
  .agenda-event { display: block; padding: 13px 14px; margin-bottom: 10px; border: 1px solid #e2e2e2; border-left: 3px solid #52734d; border-radius: 7px; background: #fff; color: #151515; text-decoration: none; cursor: default; }
  .agenda-event.event-private { border-left-color: #777; background: #f2f2f2; color: #555; }
  .agenda-event.event-linked { cursor: pointer; }
  .agenda-event.event-linked:hover { border-color: #52734d; }
  .agenda-time { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
  .agenda-title { display: block; font-size: 16px; font-weight: 500; line-height: 1.5; white-space: normal; overflow-wrap: break-word; word-break: normal; }
  .agenda-empty { color: #666; font-size: 15px; line-height: 1.5; margin: 22px 0; }
  #notice { color: #333; background: #f0f0f0; }

  .fc { font-size: 13px; }
  .fc .fc-col-header-cell, .fc .fc-list-day-cushion { color: #666; background: #f7f7f7; }
  .fc .fc-day-today .fc-daygrid-day-number { background: #151515; }
  .fc .event-public { background: #fff; border-left-color: #52734d; }
  .fc .event-public .fc-event-main { color: #151515; }
  .fc .event-private, .fc .fc-list-table tr.event-private { background: #f2f2f2; border-left-color: #777; }
  .fc .event-private .fc-event-main { color: #555; }
  .fc .fc-event-title { font-size: 12px; }
  .fc .fc-event-time { font-size: 12px; }
  .fc .fc-list-event-time { font-size: 13px; }
  .fc .fc-timegrid-slot-label-cushion { color: #666; }
  .fc .fc-list-event-dot { border-color: #52734d; }
  .fc .event-private .fc-list-event-dot { border-color: #777; }
}

@media (max-width: 360px) {
  .toolbar h2 { font-size: 18px; }
  .toolbar { padding-left: 8px; padding-right: 8px; }
  .day-agenda { padding-left: 12px; padding-right: 12px; }
}
