.calendar-nav {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #dce3d8;
  border-radius: 10px;
  background: #eef2e9;
}

.calendar-nav button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0 0 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 500 25px/1 Georgia, serif;
  transition: background .16s, transform .16s;
}

.calendar-nav button:hover {
  background: #fff;
  transform: translateY(-1px);
}

.calendar-month {
  margin: 20px 0 13px;
  font: 700 18px "DM Mono", monospace;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 7px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.calendar-day,
.calendar-blank {
  min-height: 35px;
}

.calendar-day {
  position: relative;
  border: 0;
  border-radius: 6px;
  background: #edf0ea;
  color: var(--muted);
  cursor: default;
  font: 13px "DM Mono", monospace;
}

.calendar-day.trained {
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.calendar-day.level-1 { background: #dcebc5; }
.calendar-day.level-2 { background: #b8d977; }
.calendar-day.level-3 { background: #7cad4a; color: #0d281b; }
.calendar-day.level-4 { background: #3f7644; color: white; }

.calendar-day.trained:hover,
.calendar-day.selected {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.calendar-preview {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 7px);
  left: 50%;
  display: block;
  width: max-content;
  max-width: 170px;
  padding: 7px 9px;
  border: 1px solid #cdd7c7;
  border-radius: 9px;
  background: #10251d;
  color: white;
  font: 500 11px/1.45 "Noto Sans SC", sans-serif;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 4px);
  transition: opacity .15s, transform .15s;
  visibility: hidden;
}

.calendar-day.trained:hover .calendar-preview,
.calendar-day.trained:focus-visible .calendar-preview {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.calendar-day.today:not(.trained) {
  box-shadow: inset 0 0 0 1px #8ba17d;
}

.calendar-detail {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcf9;
}

.calendar-detail .muted {
  font-size: 13px;
}

.calendar-detail-date {
  margin: 0 0 9px;
  color: #61753c;
  font-size: 12px;
  font-weight: 800;
}

.calendar-session {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid #e8ece5;
}

.calendar-session-main {
  flex: 1 1 auto;
  min-width: 0;
}

.calendar-session-heading {
  display: grid;
  grid-template-columns: 80px max-content;
  align-items: center;
  column-gap: 8px;
  min-height: 25px;
}

.calendar-session-heading > strong {
  min-width: 0;
}

.calendar-exercises {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}

.calendar-exercises.same-body-exercises {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 640px) {
  .calendar-exercises.same-body-exercises {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .calendar-exercises.same-body-exercises {
    grid-template-columns: 1fr;
  }
}

.calendar-exercise {
  padding: 9px 10px;
  border-radius: 10px;
  background: #f2f5ee;
}

.calendar-exercise > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-exercise > div strong {
  min-width: 0;
}

.calendar-exercise-delete {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 5px;
  border: 0;
  border-radius: 6px;
  background: #fff3ee;
  color: #aa4a31;
  cursor: pointer;
  font: 700 10px inherit;
}

.calendar-exercise-delete:disabled {
  cursor: wait;
  opacity: .55;
}

.calendar-exercise > span,
.calendar-exercise ol {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.calendar-exercise-body {
  padding: 2px 5px;
  border-radius: 5px;
  background: #dcebcf;
  color: #547047;
  font-size: 10px;
  font-weight: 800;
}

.calendar-exercise ol {
  padding-left: 16px;
  line-height: 1.65;
}

.calendar-edit {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 25px;
  margin: 0;
  padding: 0 6px;
  border: 1px solid #b9c9ae;
  border-radius: 6px;
  background: transparent;
  color: #547047;
  cursor: pointer;
  font: 700 10px inherit;
  line-height: 1;
}

.calendar-edit:hover {
  background: #edf3e7;
  color: var(--ink);
}

.calendar-session strong,
.calendar-session span {
  display: block;
}

.calendar-session strong {
  font-size: 14px;
}

.calendar-session span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.calendar-session > span {
  flex: 0 0 auto;
  text-align: right;
}
