/* MS booking widget — Cal.com embed layout (spec §10 screenshots) restyled to MS brand
   (Jamie, 31 Aug): dark #161211 + gold #ffdea7 + Trajan Pro caps headings, per the theme.
   Bump ?ver= on change. */
.bk-widget {
  --bk-bg: #161211;
  --bk-panel: #1c1817;
  --bk-brand: #ffdea7;   /* MS brand gold (theme), not Cal's #8f775f bronze */
  --bk-surface: #2a2422;
  --bk-surface-hover: #352e2b;
  --bk-pill: #1f1b1a;
  --bk-border: #3a3230;
  --bk-text: #ffffff;
  --bk-text-dim: #8a8078;
  --bk-brand-text: #161211;
  --bk-available-dot: #34d399;
  --bk-heading-font: 'Trajan Pro', 'Trajan', serif;   /* provided by the host site / demo page */
  /* font: inherit the site's stack — do not import one (§10.3) */
  color: var(--bk-text);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;  /* host pages often wrap us in .text-center — labels stay left (Jamie, 1 Sep) */
}
.bk-widget *, .bk-widget *::before, .bk-widget *::after { box-sizing: border-box; }
.bk-widget button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.bk-panel {
  display: flex;
  background: var(--bk-panel);
  border: 1px solid var(--bk-border);
  border-radius: 16px;
  min-height: 571px;
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
}
.bk-cal { flex: 1 1 58%; padding: 24px 28px; min-width: 0; }
.bk-side {
  flex: 1 1 42%;
  border-left: 1px solid var(--bk-border);
  padding: 24px 20px;
  display: flex; flex-direction: column;
  min-width: 0;
}

/* month header */
.bk-month-head { display: flex; align-items: center; margin-bottom: 18px; }
.bk-month-label { font-size: 16px; font-weight: 700; font-family: var(--bk-heading-font); text-transform: uppercase; letter-spacing: .04em; }
.bk-month-label .bk-year { color: var(--bk-text-dim); font-weight: 400; margin-left: 6px; }
.bk-month-nav { margin-left: auto; display: flex; gap: 4px; }
.bk-month-nav button {
  width: 32px; height: 32px; border-radius: 8px; color: var(--bk-text-dim);
  display: grid; place-items: center; font-size: 16px;
}
.bk-month-nav button:hover:not(:disabled) { background: var(--bk-surface); color: var(--bk-text); }
.bk-month-nav button:disabled { opacity: .3; cursor: default; }

/* calendar grid */
.bk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.bk-dow {
  text-transform: uppercase; font-size: 11px; letter-spacing: .06em;
  color: var(--bk-text-dim); text-align: center; padding: 6px 0 10px;
}
.bk-widget .bk-day {
  position: relative; aspect-ratio: 1; min-height: 44px;
  display: grid; place-items: center;
  border-radius: 8px; font-weight: 500; font-size: 14px;
}
.bk-widget .bk-day.bk-off { color: var(--bk-text-dim); font-weight: 400; }  /* unavailable: flat, dim */
.bk-widget .bk-day.bk-past { visibility: hidden; }                          /* reference: past cells blank */
.bk-widget .bk-day.bk-avail { background: var(--bk-surface); color: var(--bk-text); } /* available: raised tile */
.bk-widget .bk-day.bk-avail:not(.bk-sel):hover { background: var(--bk-surface-hover); }
.bk-widget .bk-day.bk-sel { background: var(--bk-brand); color: var(--bk-brand-text); }
.bk-widget .bk-day.bk-sel::after {
  content: ""; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--bk-brand-text);
}
.bk-widget .bk-day.bk-today:not(.bk-sel)::after {
  content: ""; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--bk-text-dim);
}
.bk-widget .bk-day .bk-mon-tag {
  position: absolute; top: 4px; left: 6px;
  font-size: 9px; font-weight: 600; letter-spacing: .05em; color: var(--bk-text-dim);
}
.bk-widget .bk-day.bk-sel .bk-mon-tag { color: var(--bk-brand-text); }

/* time column */
.bk-side-head { display: flex; align-items: center; margin-bottom: 14px; gap: 10px; }
.bk-side-date { font-weight: 700; font-size: 14px; font-family: var(--bk-heading-font); text-transform: uppercase; letter-spacing: .04em; }
.bk-side-date .bk-ord { color: var(--bk-text-dim); font-weight: 400; }
.bk-fmt { margin-left: auto; display: flex; background: var(--bk-pill); border: 1px solid var(--bk-border); border-radius: 8px; padding: 2px; }
.bk-widget .bk-fmt button { padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--bk-text-dim); }
.bk-widget .bk-fmt button.bk-on { background: var(--bk-surface-hover); color: var(--bk-text); }

.bk-slots { overflow-y: auto; max-height: 460px; display: flex; flex-direction: column; gap: 8px; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: var(--bk-border) transparent; }
.bk-slots::-webkit-scrollbar { width: 6px; }
.bk-slots::-webkit-scrollbar-thumb { background: var(--bk-border); border-radius: 3px; }
.bk-slots::-webkit-scrollbar-track { background: transparent; }
.bk-widget .bk-slot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; border-radius: 10px;
  background: var(--bk-pill); border: 1px solid var(--bk-border);
  font-weight: 500; font-size: 14px;
}
.bk-widget .bk-slot:hover { border-color: var(--bk-brand); }
.bk-slot .bk-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bk-available-dot); }
.bk-empty { color: var(--bk-text-dim); text-align: center; margin-top: 40px; }

/* details form (§10.9: dark card, labels above, required *) */
.bk-form { display: flex; flex-direction: column; gap: 14px; }
.bk-chosen {
  font-size: 13px; color: var(--bk-text-dim); background: var(--bk-pill);
  border: 1px solid var(--bk-border); border-radius: 8px; padding: 8px 12px;
}
.bk-chosen strong { color: var(--bk-text); font-weight: 600; }
.bk-field label { display: block; font-size: 13px; margin-bottom: 6px; }
.bk-field label .bk-req { color: var(--bk-text-dim); }
.bk-input, .bk-textarea, .bk-cc {
  width: 100%; background: var(--bk-pill); border: 1px solid var(--bk-border);
  border-radius: 8px; color: var(--bk-text); padding: 10px 12px; font: inherit;
}
.bk-input:focus, .bk-textarea:focus, .bk-cc:focus { outline: none; border-color: var(--bk-brand); }
.bk-textarea { resize: vertical; min-height: 72px; }
.bk-phone-row { display: flex; gap: 8px; }
.bk-cc { width: auto; flex: 0 0 108px; }
.bk-widget .bk-guests-toggle { color: var(--bk-text-dim); font-size: 13px; text-align: left; padding: 2px 0; }
.bk-widget .bk-guests-toggle:hover { color: var(--bk-text); }
.bk-guest-row { display: flex; gap: 8px; align-items: center; }
.bk-guest-row button { color: var(--bk-text-dim); font-size: 16px; padding: 4px 8px; }
.bk-error-msg { color: #f0b4a8; font-size: 13px; }
.bk-actions { display: flex; justify-content: flex-end; gap: 14px; align-items: center; margin-top: 6px; }
.bk-widget .bk-back { color: var(--bk-text-dim); }
.bk-widget .bk-back:hover { color: var(--bk-text); }
.bk-widget .bk-confirm {
  background: var(--bk-brand); color: var(--bk-brand-text);
  padding: 10px 22px; border-radius: 10px; font-weight: 600;
}
.bk-widget .bk-confirm:hover { filter: brightness(1.08); }
.bk-widget .bk-confirm:disabled { opacity: .6; cursor: default; }

/* confirmation + error states */
.bk-done h3 { margin: 30px 0 10px; font-size: 16px; font-family: var(--bk-heading-font); text-transform: uppercase; letter-spacing: .04em; }
.bk-done p { color: var(--bk-text-dim); font-size: 13px; margin: 6px 0; }
.bk-done a { color: var(--bk-brand); }
.bk-fallback, .bk-svc-error { color: var(--bk-text-dim); text-align: center; padding: 30px 16px; }
.bk-svc-error a, .bk-fallback a { color: var(--bk-brand); text-decoration: none; }

/* mobile: stack below ~640px, keep 44px targets (§10.5) */
@media (max-width: 640px) {
  .bk-panel { flex-direction: column; min-height: 0; }
  .bk-side { border-left: 0; border-top: 1px solid var(--bk-border); }
  .bk-slots { max-height: none; }
  /* 7 × 44px cells + gaps = 344px; an INLINE widget inside a padded page container
     gets ~292px at 390 wide and clipped the Sunday column (measured 3 Sep 2026). */
  .bk-cal { padding: 16px 12px; }
  .bk-widget .bk-day { min-height: 36px; }
}

/* modal mode — button + overlay (Jamie, 1 Sep) */
.bk-widget .bk-open-btn, .bk-open-btn {
  background: var(--bk-brand, #ffdea7); color: var(--bk-brand-text, #161211);
  padding: 14px 28px; border-radius: 10px; font-weight: 600; font-size: 15px;
  border: 0; cursor: pointer; font-family: inherit;
}
.bk-open-btn:hover { filter: brightness(1.08); }
.bk-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10, 8, 7, .8);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
.bk-modal-overlay[hidden] { display: none; }
.bk-modal-box { position: relative; width: 100%; max-width: 820px; }
.bk-modal-close {
  position: absolute; top: -14px; right: -6px; z-index: 1;
  width: 36px; height: 36px; border-radius: 50%;
  background: #2a2422; color: #fff; border: 1px solid #3a3230;
  font-size: 20px; cursor: pointer;
}
.bk-modal-close:hover { background: #352e2b; }
@media (max-width: 640px) {
  .bk-modal-overlay { padding: 0; align-items: flex-start; }
  .bk-modal-box { max-width: none; min-height: 100%; }
  .bk-modal-close { top: 8px; right: 8px; position: fixed; }
}
