.hr-multical-container {
  width: 100%;
  color: var(--hr-mc-fg, #333);
}

/* Positioning context for the selection popup. */
.hr-multical-wrap {
  position: relative;
}

/* ---------- Section heading ---------- */
.hr-multical-container .hr-widget-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.hr-multical-container .hr-widget-section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
}
.hr-multical-container .hr-widget-section-line {
  flex: 1;
  height: 1px;
  background: var(--hr-mc-border, #e5e5e5);
}

/* ---------- Scroll container ---------- */
.hr-multical-scroll {
  position: relative;
  overflow: auto;
  /* Fallback only — the widget sets an inline max-height from options.maxHeight
     (#686), which overrides this. Kept for no-inline-style safety. */
  max-height: 70vh;
  border: 1px solid var(--hr-mc-border, #e5e5e5);
  border-radius: 8px;
}

.hr-multical-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  font-size: 0.8125rem;
}

/* ---------- Header ---------- */
.hr-multical-month,
.hr-multical-day {
  background: var(--hr-mc-header-bg, #f7f7f8);
  border-bottom: 1px solid var(--hr-mc-border, #e5e5e5);
  border-left: 1px solid var(--hr-mc-border, #e5e5e5);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.hr-multical-month {
  padding: 6px 8px;
  font-size: 0.75rem;
  color: var(--hr-mc-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hr-multical-day {
  width: 44px;
  min-width: 44px;
  padding: 4px 2px;
  line-height: 1.2;
}
.hr-multical-day.is-weekend {
  color: var(--hr-mc-muted, #999);
}
.hr-multical-day-num {
  display: block;
  font-weight: 700;
}
.hr-multical-day-wd {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--hr-mc-muted, #999);
}

/* First column (property) */
.hr-multical-corner,
.hr-multical-prop {
  background: var(--hr-mc-header-bg, #f7f7f8);
  border-right: 1px solid var(--hr-mc-border, #e5e5e5);
  text-align: left;
}
.hr-multical-corner {
  min-width: 200px;
  width: 200px;
}
.hr-multical-prop {
  background: var(--hr-mc-row-bg, #fff);
  border-bottom: 1px solid var(--hr-mc-border, #e5e5e5);
  min-width: 200px;
  width: 200px;
  font-weight: 500;
}
.hr-multical-prop-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  color: inherit;
  text-decoration: none;
}
a.hr-multical-prop-inner:hover .hr-multical-prop-title {
  text-decoration: underline;
}
.hr-multical-thumb {
  flex: 0 0 auto;
  width: 44px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--hr-mc-header-bg, #eee);
}
.hr-multical-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hr-multical-thumb-ph {
  display: block;
  width: 100%;
  height: 100%;
}
.hr-multical-prop-title {
  font-size: 0.8125rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- Cells ---------- */
.hr-multical-cell {
  width: 44px;
  min-width: 44px;
  height: 36px;
  border-left: 1px solid var(--hr-mc-border, #e5e5e5);
  border-bottom: 1px solid var(--hr-mc-border, #e5e5e5);
  text-align: center;
  vertical-align: middle;
}
.hr-multical-cell.is-available {
  background: var(--hr-mc-avail-bg, #e4f4d9);
}
.hr-multical-cell.is-booked {
  background: var(--hr-mc-booked-bg, #fdd2d2);
}
.hr-multical-cell-empty {
  background: transparent;
}
.hr-multical-price {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--hr-mc-price, #666);
}

/* ---------- Sticky header + first column ---------- */
.hr-multical-scroll.sticky-header thead th {
  position: sticky;
  z-index: 2;
}
.hr-multical-scroll.sticky-header .hr-multical-month-row th {
  top: 0;
}
.hr-multical-scroll.sticky-header .hr-multical-day-row th {
  top: 33px;
}
.hr-multical-scroll.sticky-header .hr-multical-corner,
.hr-multical-scroll.sticky-header .hr-multical-prop {
  position: sticky;
  left: 0;
  z-index: 1;
}
.hr-multical-scroll.sticky-header .hr-multical-corner {
  z-index: 3;
}

/* ---------- States ---------- */
.hr-multical-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.hr-multical-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--hr-mc-border, #ddd);
  border-top-color: var(--hr-mc-fg, #333);
  border-radius: 50%;
  animation: hr-multical-spin 0.8s linear infinite;
}
@keyframes hr-multical-spin {
  to { transform: rotate(360deg); }
}
.hr-multical-empty {
  padding: 32px;
  text-align: center;
  color: var(--hr-mc-muted, #999);
}
.hr-multical-loadmore {
  display: flex;
  justify-content: center;
  padding: 16px;
}
.hr-multical-loadmore-btn {
  padding: 8px 20px;
  border: 1px solid var(--hr-mc-border, #ccc);
  border-radius: 6px;
  background: var(--hr-mc-row-bg, #fff);
  color: var(--hr-mc-fg, #333);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.hr-multical-loadmore-btn:hover:not(:disabled) {
  background: var(--hr-mc-header-bg, #f0f0f0);
}
.hr-multical-loadmore-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------- Date selection (allowSelectDates) ---------- */
.hr-multical-cell.is-interactive {
  cursor: pointer;
  user-select: none;
}
/* Min-stay window after a picked check-in (#603): grayed out with a
   not-allowed cursor; hover-preview/range fill below still paints over it. */
.hr-multical-cell.is-minstay-blocked {
  background: var(--hr-mc-disabled-bg, #ececec);
}
.hr-multical-cell.is-interactive.is-minstay-blocked {
  cursor: not-allowed;
}
.hr-multical-cell.is-minstay-blocked .hr-multical-price {
  color: var(--hr-mc-muted, #999);
}
.hr-multical-cell.is-hover-preview {
  background: var(--hr-mc-hover-bg, #d3ecc4);
}
.hr-multical-cell.is-range {
  background: var(--hr-mc-selected-bg, #b7db9f);
}
.hr-multical-cell.is-selected {
  background: var(--hr-mc-selected-bg, #b7db9f);
  box-shadow: inset 0 0 0 2px var(--hr-mc-accent, #f59e0c);
}
.hr-multical-cell.is-selected .hr-multical-price,
.hr-multical-cell.is-range .hr-multical-price {
  color: var(--hr-mc-selected-fg, #1f3d15);
}

/* Selection summary + Clear bar */
.hr-multical-selbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--hr-mc-border, #e5e5e5);
  border-radius: 8px;
  background: var(--hr-mc-header-bg, #f7f7f8);
  font-size: 0.8125rem;
}
.hr-multical-selbar-text {
  font-weight: 600;
  color: var(--hr-mc-fg, #333);
}
.hr-multical-selbar-clear {
  padding: 4px 12px;
  border: 1px solid var(--hr-mc-border, #ccc);
  border-radius: 6px;
  background: var(--hr-mc-row-bg, #fff);
  color: var(--hr-mc-fg, #333);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.hr-multical-selbar-clear:hover {
  background: var(--hr-mc-header-bg, #f0f0f0);
}

/* Reserve / Clear popup anchored under the checkout cell */
.hr-multical-popup {
  position: absolute;
  z-index: 20;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--hr-mc-border, #e5e5e5);
  border-radius: 8px;
  background: var(--hr-mc-row-bg, #fff);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.hr-multical-popup-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--hr-mc-fg, #333);
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}
.hr-multical-popup-item:hover {
  background: var(--hr-mc-header-bg, #f0f0f0);
}
.hr-multical-popup-item:first-child {
  color: var(--hr-mc-accent, #f59e0c);
  font-weight: 700;
}

/* Error / notice banner */
.hr-multical-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--hr-mc-notice-bg, #fef3cd);
  color: var(--hr-mc-notice-fg, #8a6d00);
  font-size: 0.8125rem;
  font-weight: 500;
}
.hr-multical-notice.is-danger {
  background: var(--hr-mc-booked-bg, #fdd2d2);
  color: var(--hr-mc-booked-fg, #881616);
}
.hr-multical-notice-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.hr-multical-notice-close:hover {
  opacity: 1;
}

/* Keyboard focus (#1582). The grid is one tabstop with a roving tabindex, so
   the ring is the ONLY thing telling a keyboard user where they are — it is
   drawn inset because a cell sits flush against its neighbours and an outset
   ring would be clipped by the scroll container and the sticky header.
   :focus-visible, so a pointer user never sees it. */
.hr-multical-table :is(td, th):focus-visible {
  outline: 2px solid var(--hr-mc-fg, #333);
  outline-offset: -2px;
  position: relative;
  z-index: 2;
}

.hr-multical-selbar-clear:focus-visible,
.hr-multical-notice-close:focus-visible,
.hr-multical-popup-item:focus-visible,
.hr-multical-loadmore-btn:focus-visible {
  outline: 2px solid var(--hr-mc-fg, #333);
  outline-offset: 2px;
}

/* The selection bar is mounted whenever selection is possible so its live
   region can announce; with nothing selected it takes no visual space. */
.hr-multical-selbar.is-empty {
  padding: 0;
  border: 0;
  margin: 0;
  min-height: 0;
}
