.chiwaty-booking-root {
  --chiwaty-primary: #0f172a;
  --chiwaty-surface: #ffffff;
  --chiwaty-text: #0f172a;
  --chiwaty-muted: #64748b;
  --chiwaty-border: #dbe4ee;
  --chiwaty-soft: #f8fafc;
  --chiwaty-radius: 24px;
  color: var(--chiwaty-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  width: 100%;
  max-width: 100%;
}

.chiwaty-booking-shell.is-popup {
  display: inline-flex;
}

.chiwaty-booking__launcher,
.chiwaty-booking__primary,
.chiwaty-booking__secondary,
.chiwaty-booking__slot,
.chiwaty-booking__card {
  font: inherit;
}

.chiwaty-booking__launcher,
.chiwaty-booking__primary,
.chiwaty-booking__secondary {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 12px 18px;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.chiwaty-booking__launcher,
.chiwaty-booking__primary {
  background: var(--chiwaty-primary);
  color: #fff;
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.45);
}

.chiwaty-booking__secondary {
  background: #fff;
  color: var(--chiwaty-text);
  border: 1px solid var(--chiwaty-border);
}

.chiwaty-booking__launcher:hover,
.chiwaty-booking__primary:hover,
.chiwaty-booking__secondary:hover,
.chiwaty-booking__slot:hover,
.chiwaty-booking__card:hover {
  transform: translateY(-1px);
}

.chiwaty-booking__primary[disabled],
.chiwaty-booking__secondary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chiwaty-booking__modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.chiwaty-booking__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.chiwaty-booking__dialog {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.chiwaty-booking__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--chiwaty-text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.chiwaty-booking {
  border: 1px solid var(--chiwaty-border);
  border-radius: var(--chiwaty-radius);
  background: var(--chiwaty-surface);
  color: var(--chiwaty-text);
  padding: 28px;
  box-shadow: 0 24px 56px -36px rgba(15, 23, 42, 0.25);
  display: grid;
  gap: 22px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.chiwaty-booking__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.chiwaty-booking__eyebrow,
.chiwaty-booking__kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chiwaty-muted);
}

.chiwaty-booking__header h3,
.chiwaty-booking__card h4 {
  margin: 0;
}

.chiwaty-booking__muted {
  margin: 6px 0 0;
  color: var(--chiwaty-muted);
  font-size: 14px;
}

.chiwaty-booking__logo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 18px;
  background: #fff;
}

.chiwaty-booking__loading,
.chiwaty-booking__empty {
  border: 1px dashed var(--chiwaty-border);
  border-radius: calc(var(--chiwaty-radius) - 8px);
  padding: 18px;
  background: var(--chiwaty-soft);
  color: var(--chiwaty-muted);
}

.chiwaty-booking__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
}

.chiwaty-booking__steps > li:first-child {
  margin-left: 0 !important;
}

.chiwaty-booking__step {
  border: 1px solid var(--chiwaty-border);
  border-radius: 18px;
  padding: 14px;
  background: var(--chiwaty-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  box-sizing: border-box;
}

.chiwaty-booking__step.is-active {
  border-color: var(--chiwaty-primary);
  background: rgba(15, 23, 42, 0.04);
}

.chiwaty-booking__step.is-done .chiwaty-booking__step-index,
.chiwaty-booking__step.is-active .chiwaty-booking__step-index {
  background: var(--chiwaty-primary);
  color: #fff;
}

.chiwaty-booking__step-index {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  border: 1px solid var(--chiwaty-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.chiwaty-booking__step-label {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.chiwaty-booking__panel {
  display: grid;
  gap: 18px;
}

.chiwaty-booking__cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.chiwaty-booking__card {
  border: 1px solid var(--chiwaty-border);
  border-radius: calc(var(--chiwaty-radius) - 6px);
  background: #fff;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.chiwaty-booking__card.is-selected {
  border-color: var(--chiwaty-primary);
  box-shadow: 0 18px 40px -32px rgba(15, 23, 42, 0.4);
}

.chiwaty-booking__card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chiwaty-booking__price {
  font-size: 14px;
  font-weight: 700;
}

.chiwaty-booking__description {
  margin: 0;
  color: var(--chiwaty-muted);
  font-size: 14px;
  line-height: 1.5;
}

.chiwaty-booking__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--chiwaty-muted);
}

.chiwaty-booking__section-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.chiwaty-booking__field {
  display: grid;
  gap: 8px;
}

.chiwaty-booking__field--wide {
  grid-column: 1 / -1;
}

.chiwaty-booking__field span {
  font-size: 13px;
  font-weight: 700;
}

.chiwaty-booking__field input,
.chiwaty-booking__field select,
.chiwaty-booking__field textarea,
.chiwaty-booking__readonly {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--chiwaty-border);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  color: var(--chiwaty-text);
}

.chiwaty-booking__readonly {
  background: var(--chiwaty-soft);
  color: var(--chiwaty-muted);
}

.chiwaty-booking__calendar {
  border: 1px solid var(--chiwaty-border);
  border-radius: calc(var(--chiwaty-radius) - 6px);
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.chiwaty-booking__calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chiwaty-booking__calendar-header strong {
  font-size: 14px;
  text-transform: capitalize;
}

.chiwaty-booking__calendar-nav {
  width: 36px;
  height: 36px;
  border: 1px solid var(--chiwaty-border);
  border-radius: 999px;
  background: #fff;
  color: var(--chiwaty-text);
  cursor: pointer;
}

.chiwaty-booking__calendar-nav[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.chiwaty-booking__calendar-weekdays,
.chiwaty-booking__calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.chiwaty-booking__calendar-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--chiwaty-muted);
}

.chiwaty-booking__calendar-day {
  min-height: 40px;
  border: 1px solid var(--chiwaty-border);
  border-radius: 14px;
  background: #fff;
  color: var(--chiwaty-text);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.chiwaty-booking__calendar-day.is-selected {
  background: var(--chiwaty-primary);
  border-color: var(--chiwaty-primary);
  color: #fff;
}

.chiwaty-booking__calendar-day.is-outside,
.chiwaty-booking__calendar-day[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.chiwaty-booking__slot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chiwaty-booking__slots {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.chiwaty-booking__slot {
  border: 1px solid var(--chiwaty-border);
  border-radius: 18px;
  background: #fff;
  color: inherit;
  padding: 12px 14px;
  text-align: center;
  display: grid;
  gap: 4px;
  place-items: center;
  cursor: pointer;
}

.chiwaty-booking__slot strong {
  font-size: 14px;
  text-align: center;
}

.chiwaty-booking__slot span {
  font-size: 12px;
  color: var(--chiwaty-muted);
  text-align: center;
}

.chiwaty-booking__slot.is-active {
  background: var(--chiwaty-primary);
  color: #fff;
  border-color: var(--chiwaty-primary);
}

.chiwaty-booking__slot.is-active span {
  color: rgba(255, 255, 255, 0.85);
}

.chiwaty-booking__summary {
  display: grid;
  gap: 10px;
  border: 1px solid var(--chiwaty-border);
  border-radius: calc(var(--chiwaty-radius) - 6px);
  background: var(--chiwaty-soft);
  padding: 18px;
}

.chiwaty-booking__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.chiwaty-booking__summary-row span {
  color: var(--chiwaty-muted);
}

.chiwaty-booking__summary-note {
  border-top: 1px solid var(--chiwaty-border);
  padding-top: 12px;
}

.chiwaty-booking__summary-note span {
  display: block;
  margin-bottom: 6px;
  color: var(--chiwaty-muted);
  font-size: 13px;
  font-weight: 700;
}

.chiwaty-booking__summary-note p {
  margin: 0;
}

.chiwaty-booking__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chiwaty-booking__error,
.chiwaty-booking__warning,
.chiwaty-booking__success {
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 14px;
}

.chiwaty-booking__error {
  background: #fef2f2;
  color: #b91c1c;
}

.chiwaty-booking__warning {
  background: #fffbeb;
  color: #b45309;
}

.chiwaty-booking__success {
  background: #ecfdf5;
  color: #047857;
}

.chiwaty-booking__success-screen {
  display: grid;
  gap: 16px;
}

.chiwaty-booking__success-screen h3 {
  margin: 0;
}

.chiwaty-booking__success-screen p {
  margin: 0;
  color: var(--chiwaty-muted);
}

.chiwaty-booking__success-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.chiwaty-booking-admin-warning {
  border-radius: 16px;
  padding: 14px 16px;
  background: #fffbeb;
  color: #92400e;
}

@media (max-width: 960px) {
  .chiwaty-booking__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .chiwaty-booking__modal {
    padding: 12px;
  }

  .chiwaty-booking__dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .chiwaty-booking {
    padding: 16px;
    gap: 16px;
  }

  .chiwaty-booking__header {
    flex-direction: column;
    align-items: stretch;
  }

  .chiwaty-booking__steps {
    grid-template-columns: 1fr;
  }

  .chiwaty-booking__step {
    padding: 12px;
  }

  .chiwaty-booking__step-label {
    font-size: 13px;
  }

  .chiwaty-booking__logo {
    width: 52px;
    height: 52px;
  }

  .chiwaty-booking__cards,
  .chiwaty-booking__section-grid,
  .chiwaty-booking__slots {
    grid-template-columns: 1fr;
  }

  .chiwaty-booking__calendar {
    padding: 12px;
    gap: 10px;
  }

  .chiwaty-booking__calendar-weekdays,
  .chiwaty-booking__calendar-grid {
    gap: 6px;
  }

  .chiwaty-booking__calendar-day {
    min-height: 36px;
    border-radius: 12px;
    padding: 0;
  }

  .chiwaty-booking__card,
  .chiwaty-booking__slot,
  .chiwaty-booking__primary,
  .chiwaty-booking__secondary,
  .chiwaty-booking__launcher {
    width: 100%;
    box-sizing: border-box;
  }

  .chiwaty-booking__card-top,
  .chiwaty-booking__slot-bar,
  .chiwaty-booking__actions,
  .chiwaty-booking__summary-row {
    flex-direction: column;
    align-items: stretch;
  }

  .chiwaty-booking__summary-row {
    gap: 4px;
  }

  .chiwaty-booking__summary-row strong {
    word-break: break-word;
  }

  .chiwaty-booking__price {
    align-self: flex-start;
  }
}
