.hm-cal-wrap { max-width: 1200px; margin: 0 auto; }

/* убираем внешнюю рамку календаря */
.fc-theme-standard .fc-scrollgrid { border: 0 !important; }

/* порядок слоёв: фон -> контент -> кружочки */
.fc .fc-bg-event { z-index: 1 !important; pointer-events: none; opacity: 1 !important; }
.fc .fc-daygrid-day-frame { position: relative; }
.fc .fc-daygrid-day-top,
.fc .fc-daygrid-day-number,
.fc .fc-daygrid-day-events { position: relative; z-index: 5; }

/* ✅ ВАЖНО: делаем "верх" ячейки колонкой, чтобы под числом было место под кружочки */
.fc .fc-daygrid-day-top{
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 4px !important;
}

/* ✅ кружочки (железобетонно) */
.hm-dot-row{
  display: flex !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  margin-left: 6px !important;
  margin-top: 2px !important;
  position: relative !important;
  z-index: 999 !important;
  pointer-events: none;
}

.hm-dot{
  width: 14px !important;
  height: 14px !important;
  border-radius: 999px !important;
  display: inline-block !important;
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85) !important; /* чтобы было видно на любом фоне */
}

/* ✅ цвета кружочков (с !important, чтобы тема не перебила) */
.hm-dot-good     { background: #2fbf71 !important; }  /* зелёный */
.hm-dot-bad      { background: #ff3b30 !important; }  /* красный */
.hm-dot-ekadashi { background: #2d7ff9 !important; }
.hm-dot-rodovi   { background: #d8c3a5 !important; }
.hm-dot-eclipse  { background: #7a4a2a !important; }
.hm-dot-holidays { background: #ff8a00 !important; }

/* сегодня (чтобы ориентироваться) */
.fc .fc-day-today .fc-daygrid-day-number{ font-weight: 800; font-size: 1.18em; }
.fc .fc-day-today{ background: rgba(0,0,0,0.03) !important; }

/* ---------- MODAL ---------- */
.hm-modal{ position: fixed; inset: 0; display: none; z-index: 999999; }
.hm-modal.is-open{ display: block; }

.hm-modal__backdrop{
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  cursor: pointer;
}

.hm-modal__panel{
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  padding: 18px;
}

.hm-modal__close{
  position: absolute;
  right: 12px; top: 12px;
  width: 40px; height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.06);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  color: #111;
  display: grid;
  place-items: center;
  z-index: 2;
}
.hm-modal__close:hover{ background: rgba(0,0,0,0.12); }

.hm-modal__title{
  font-weight: 800;
  font-size: 18px;
  margin: 0 44px 12px 0;
  text-transform: capitalize;
}

.hm-modal__section{ margin-top: 12px; }
.hm-modal__h{ font-weight: 800; font-size: 14px; margin-bottom: 8px; }

.hm-modal__ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.hm-modal__li{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.02);
}

.hm-modal__empty{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.02);
  font-size: 13.5px;
  opacity: 0.85;
}

.hm-modal__periodList{ display: grid; gap: 10px; }
.hm-modal__periodCard{
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.02);
  padding: 12px 12px;
}
.hm-modal__periodTitle{
  font-weight: 800;
  margin-bottom: 6px;
}
.hm-modal__periodText{
  font-size: 13.5px;
  line-height: 1.35;
  opacity: 0.9;
}

/* ---------- LEGEND (one-line desktop) ---------- */
.hm-legend{
  margin: 0 0 12px 0;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
}

.hm-legend__title{
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.hm-legend__row{
  display: flex;
  flex-wrap: wrap;              /* перенос на мобилке */
  gap: 10px 12px;
  align-items: center;
}

.hm-legend__chip{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 999px;         /* “пилюля” */
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.70);
  white-space: nowrap;
}

.hm-legend__dot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85);
}

.hm-legend__text{
  font-size: 13.5px;
  line-height: 1;
  opacity: 0.92;
}

/* цвета */
.hm-legend__dot--good{ background: #2fbf71; }
.hm-legend__dot--bad{ background: #ff3b30; }
.hm-legend__dot--ekadashi{ background: #2d7ff9; }
.hm-legend__dot--rodovi{ background: #d8c3a5; }
.hm-legend__dot--eclipse{ background: #7a4a2a; }
.hm-legend__dot--holidays{ background: #ff8a00; }

/* адаптив */
@media (max-width: 520px){
  .hm-legend{ padding: 10px; border-radius: 14px; }
  .hm-legend__chip{ padding: 8px 10px; }
}

.fc .fc-day-sat .fc-daygrid-day-frame,
.fc .fc-day-sun .fc-daygrid-day-frame{
  background: rgba(255, 59, 48, 0.06); /* лёгкий оттенок */
  border-radius: 10px;
}

.fc .fc-col-header-cell-cushion{
  text-transform: uppercase;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
}

@media (max-width: 520px){
  .fc .fc-col-header-cell-cushion{
    font-size: 12px;
    letter-spacing: 0.05em;
  }
}
