:root {
  color-scheme: light;
  --booking-button-color: #006bff;
  --booking-button-text: #ffffff;
  --booking-outline-color: #006bff;
  --booking-outline-soft: #eef5ff;
  --navy: #082d52;
  --ink: #0b2540;
  --muted: #496985;
  --border: #cfdeec;
  --surface: #ffffff;
  --page: #f6f8fa;
  --danger: #b42318;
  --success: #176b45;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.booking-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 20px;
}

.booking-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(310px, 36%) minmax(0, 1fr);
  width: min(100%, 940px);
  min-height: 700px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(8, 45, 82, 0.08);
  transition: width 180ms ease;
}
.booking-card.has-selected-date { width: min(100%, 1100px); }
.booking-card.is-details { width: min(100%, 1060px); }

.powered-ribbon {
  position: absolute;
  z-index: 10;
  top: 19px;
  right: -48px;
  display: flex;
  width: 180px;
  min-height: 54px;
  transform: rotate(45deg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #4d565d;
  color: white;
  font-size: 7px;
  line-height: 1.05;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.18);
}
.powered-ribbon strong { margin-top: 2px; font-size: 10px; line-height: 1.05; text-transform: none; }
.powered-ribbon:focus-visible { outline: 3px solid var(--booking-outline-color); outline-offset: 3px; }

.event-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 30px 30px 24px;
  border-right: 1px solid var(--border);
}
.business-identity { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--navy);
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
}
.brand-mark[hidden] { display: none; }
.brand-mark.has-business-favicon { border: 1px solid var(--border); background: white; }
.brand-favicon { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; }
.eyebrow { margin: 0; color: var(--muted); font-size: 15px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; color: #001d3b; font-size: clamp(26px, 3vw, 34px); line-height: 1.12; }
h2 { margin-bottom: 22px; color: #001d3b; font-size: 23px; line-height: 1.2; }
h3 { margin-bottom: 18px; color: #001d3b; font-size: 16px; font-weight: 500; }
.event-description { margin-bottom: 22px; color: var(--muted); font-size: 14px; line-height: 1.55; white-space: pre-line; }
.event-meta { display: grid; gap: 15px; }
.event-meta p { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: #315b80; font-size: 14px; font-weight: 650; line-height: 1.45; }
.event-meta p > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.event-meta p a { overflow-wrap: anywhere; word-break: break-word; }
.event-meta svg { width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.event-footer { display: flex; flex-wrap: wrap; gap: 20px; margin-top: auto; padding-top: 35px; }
.event-footer a, .privacy-copy a, .booking-footer a { color: var(--booking-outline-color); font-size: 12px; font-weight: 700; text-decoration: none; }
.event-footer a:hover, .privacy-copy a:hover { text-decoration: underline; }

.booking-workspace { position: relative; min-width: 0; padding: 32px; }
.calendar-step { min-height: 630px; }
.calendar-panel { width: min(100%, 430px); margin: 0 auto; }
.calendar-panel > h2 { margin-bottom: 30px; }
.month-navigation { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; margin: 0 0 24px; text-align: center; }
.month-navigation strong { color: #001d3b; font-size: 14px; }
.month-button, .back-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--booking-outline-color);
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
}
.month-button:hover, .back-button:hover { background: var(--booking-outline-soft); }
.month-button:focus-visible, .back-button:focus-visible { outline: 3px solid var(--booking-outline-soft); border-color: var(--booking-outline-color); }
.month-button:disabled { cursor: not-allowed; opacity: 0.3; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin-bottom: 8px; color: #315b80; font-size: 11px; text-align: center; }
.calendar-weekdays span { padding: 6px 0; }
.calendar-grid { row-gap: 4px; }
.calendar-day, .calendar-spacer {
  display: grid;
  width: 42px;
  height: 42px;
  margin: auto;
  place-items: center;
}
.calendar-day {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #315b80;
  cursor: default;
  font-size: 15px;
}
.calendar-day.is-available { background: var(--booking-outline-soft); color: var(--booking-outline-color); cursor: pointer; }
.calendar-day.is-available:hover { box-shadow: inset 0 0 0 2px var(--booking-outline-color); }
.calendar-day.is-selected { background: var(--booking-button-color); color: var(--booking-button-text); font-weight: 750; }
.calendar-day:focus-visible { outline: 3px solid var(--booking-outline-color); outline-offset: 2px; }
.calendar-day:disabled { color: #aebbc6; }
.timezone-control { margin-top: 22px; }
.timezone-control label { display: block; margin-bottom: 7px; color: #001d3b; font-size: 12px; font-weight: 800; }
.timezone-control select { max-width: 100%; min-height: 34px; padding: 4px 24px 4px 0; border: 0; background: white; color: var(--ink); font-size: 13px; }
.timezone-control select:focus-visible { outline: 2px solid var(--booking-outline-color); outline-offset: 3px; }

.booking-card.has-selected-date .calendar-step { display: grid; grid-template-columns: minmax(330px, 1fr) 300px; gap: 28px; }
.booking-card.has-selected-date .calendar-panel { width: 100%; margin: 0; }
.time-panel { min-width: 0; }
.desktop-time-header { padding-top: 56px; }
.time-list-heading { display: none; text-align: center; }
.slot-list { display: grid; max-height: 515px; gap: 10px; overflow-y: auto; padding-right: 8px; scrollbar-color: #6d879d transparent; scrollbar-width: thin; }
.slot-choice-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.slot-choice-row.is-selected { grid-template-columns: 1fr 1fr; }
.slot-button, .slot-next {
  min-height: 52px;
  padding: 10px 12px;
  border: 2px solid var(--booking-outline-color);
  border-radius: 5px;
  background: white;
  color: var(--booking-outline-color);
  cursor: pointer;
  font-weight: 750;
  text-align: center;
}
.slot-button:hover, .slot-button:focus-visible { background: var(--booking-outline-soft); outline: 0; }
.slot-choice-row.is-selected .slot-button { border-color: #8b9aa7; background: #8b9aa7; color: white; }
.slot-next { border-color: var(--booking-button-color); background: var(--booking-button-color); color: var(--booking-button-text); }
.slot-next:hover, .slot-next:focus-visible { filter: brightness(0.92); outline: 3px solid var(--booking-outline-soft); outline-offset: 1px; }
.mobile-time-header, .mobile-timezone-summary, .mobile-copy { display: none; }

.details-step, .management-step, .confirmation-step, .appointment-summary { width: min(100%, 620px); padding: 4px 0 24px; }
.details-step h2 { margin-bottom: 4px; }
.selected-slot { margin: 0 0 18px; color: var(--muted); font-size: 13px; font-weight: 650; }
.form-field { margin: 16px 0; }
.form-field label { display: block; margin-bottom: 7px; color: #001d3b; font-size: 13px; font-weight: 700; }
.form-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--ink);
}
.form-field input:focus { outline: 3px solid var(--booking-outline-soft); border-color: var(--booking-outline-color); }
.form-actions, .management-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.desktop-change-time { display: none; }
.privacy-copy { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.button {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
}
.button:disabled { cursor: wait; opacity: 0.65; }
.button-primary { border-color: var(--booking-button-color); background: var(--booking-button-color); color: var(--booking-button-text); }
.button-primary:hover { filter: brightness(0.92); }
.button-secondary { border-color: var(--booking-outline-color); background: white; color: var(--booking-outline-color); }
.button-danger { background: var(--danger); color: white; }
.button-link { display: inline-flex; align-items: center; text-decoration: none; }
.event-back { margin: -8px 0 24px; }
.appointment-summary { margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.appointment-summary p { margin-bottom: 6px; }
.confirmation-icon { display: grid; width: 54px; height: 54px; margin-bottom: 16px; place-items: center; border-radius: 999px; background: #e5f5ec; color: var(--success); font-size: 28px; font-weight: 800; }

.notice { margin-bottom: 20px; padding: 12px 14px; border-radius: 7px; line-height: 1.45; }
.notice-error { border: 1px solid #f1b7b3; background: #fff2f1; color: #8f1d14; }
.notice-success { border: 1px solid #a9d6bf; background: #edf9f2; color: #155838; }
.loading-state { display: flex; min-height: 540px; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.spinner { width: 21px; height: 21px; border: 2px solid #cad3cf; border-top-color: var(--booking-button-color); border-radius: 999px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 18px; border-radius: 8px; background: #f5f8fb; color: var(--muted); font-size: 13px; text-align: center; }
.description, .muted { color: var(--muted); line-height: 1.55; }

@media (max-width: 899px) {
  .booking-shell { display: block; padding: 0; }
  .booking-card, .booking-card.has-selected-date, .booking-card.is-details {
    display: block;
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .powered-ribbon { position: fixed; top: 17px; right: -51px; }
  .event-panel { min-height: 230px; padding: 28px 58px 26px 24px; border-right: 0; border-bottom: 1px solid var(--border); text-align: center; }
  .business-identity { justify-content: center; margin-bottom: 6px; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .event-panel h1 { margin-bottom: 20px; font-size: 27px; }
  .event-description { margin: -7px auto 18px; max-width: 520px; }
  .event-meta { width: min(100%, 520px); margin: 0 auto; text-align: left; }
  .event-footer { justify-content: center; padding-top: 38px; }
  .booking-workspace { padding: 28px 16px; }
  .calendar-step { min-height: 0; }
  .calendar-panel { width: min(100%, 420px); }
  .calendar-panel > h2 { margin: 0 0 22px; text-align: center; }
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }
  .calendar-day, .calendar-spacer { width: 43px; height: 43px; }
  .timezone-control { margin: 22px auto 0; }
  .booking-card.has-selected-date .calendar-step { display: block; }
  .booking-card.is-times .event-panel, .booking-card.is-times .calendar-panel { display: none; }
  .booking-card.is-times .booking-workspace { padding: 0; }
  .booking-card.is-times .time-panel { display: block !important; }
  .mobile-time-header { display: grid; grid-template-columns: 50px 1fr 50px; align-items: start; padding: 18px 16px 12px; border-bottom: 0; text-align: center; }
  .mobile-time-header h2 { margin: 8px 0 3px; font-size: 23px; }
  .mobile-time-header p { margin-bottom: 0; font-size: 13px; }
  .mobile-timezone-summary { display: grid; gap: 8px; padding: 8px 58px 28px; border-bottom: 1px solid var(--border); font-size: 13px; }
  .mobile-timezone-summary strong { font-size: 12px; }
  .desktop-time-header { display: none; }
  .time-list-heading { display: block; padding: 20px 16px 8px; }
  .time-list-heading h2 { margin-bottom: 14px; }
  .time-list-heading p { margin-bottom: 8px; font-size: 13px; }
  .slot-list { max-height: none; padding: 10px 16px 28px; overflow: visible; }
  .slot-button, .slot-next { min-height: 53px; }
  .booking-card.is-details .event-panel { min-height: 0; padding-top: 20px; text-align: left; }
  .booking-card.is-details .business-identity { display: none; }
  .booking-card.is-details .event-description, .booking-card.is-details .event-footer { display: none; }
  .booking-card.is-details .event-panel h1 { margin-bottom: 20px; text-align: center; }
  .booking-card.is-details .event-meta { width: 100%; }
  .booking-card.is-details .event-back { z-index: 2; display: grid !important; position: absolute; top: 20px; left: 16px; margin: 0; border-color: var(--border); }
  .booking-card.is-details .booking-workspace { padding: 28px 15px 36px; }
  .details-step { width: 100%; }
  .details-step h2 { font-size: 22px; }
  .form-field { margin: 22px 0; }
  .form-actions { display: block; }
  .form-actions .button { width: 100%; }
  .desktop-change-time { display: none; }
  .privacy-copy { margin-top: 20px; }
  .booking-card.is-confirmation .event-panel { display: none; }
  .booking-card.is-confirmation .booking-workspace { padding-top: 80px; }
}

@media (max-width: 420px) {
  .event-panel { padding-left: 16px; }
  .business-identity { gap: 8px; }
  .eyebrow { font-size: 13px; }
  .event-description { font-size: 13px; }
  .calendar-grid { row-gap: 3px; }
  .calendar-day, .calendar-spacer { width: 40px; height: 40px; }
  .timezone-control select { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
