
:root {
  --bk-bg: #ffffff;
  --bk-surface: #f2f2f2;
  --bk-ink: #111111;
  --bk-muted: #5a5a5a;
  --bk-accent: #111111;
  --bk-accent-ink: #ffffff;
  --bk-focus: var(--bk-accent);
  --bk-font-display: inherit;
  --bk-font-body: inherit;
  --bk-title-weight: 600;
  --bk-title-case: none;
  --bk-title-stretch: normal;
  --bk-radius: 12px;
  --bk-backdrop: rgba(0, 0, 0, 0.55);
  --bk-error: #c4271b;
}

html:has(.bk[open]) { overflow: hidden; }
.bk [hidden] { display: none !important; }

.bk-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.bk {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: calc(var(--bk-radius) * 1.5) calc(var(--bk-radius) * 1.5) 0 0;
  background: var(--bk-bg);
  color: var(--bk-ink);
  font-family: var(--bk-font-body);
  font-size: 1rem;
  line-height: 1.45;
  letter-spacing: normal;
  overflow: hidden;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.25);
}
.bk *, .bk *::before, .bk *::after { box-sizing: border-box; }
.bk::backdrop { background: var(--bk-backdrop); }
.bk[open] { display: flex; }

@media (min-width: 760px) {
  .bk {
    width: min(600px, calc(100% - 48px));
    max-height: min(88dvh, 860px);
    margin: auto;
    border-radius: calc(var(--bk-radius) * 1.5);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .bk[open] { animation: bk-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .bk[open]::backdrop { animation: bk-fade 0.32s ease; }
}
@keyframes bk-in { from { transform: translateY(24px); opacity: 0; } }
@keyframes bk-fade { from { opacity: 0; } }

.bk__form {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  max-height: inherit;
  margin: 0;
}


.bk__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
}
.bk__kicker {
  margin: 0 0 4px;
  color: var(--bk-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bk__title {
  margin: 0;
  font-family: var(--bk-font-display);
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: var(--bk-title-weight);
  font-stretch: var(--bk-title-stretch);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: var(--bk-title-case);
}
.bk__close {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -6px -8px 0 0;
  border: 0;
  border-radius: 50%;
  background: var(--bk-surface);
  color: var(--bk-ink);
  cursor: pointer;
}
.bk__close::before,
.bk__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}
.bk__close::after { transform: translate(-50%, -50%) rotate(-45deg); }


.bk__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 22px 24px;
}
.bk__step + .bk__step { margin-top: 28px; }
.bk__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0 0 12px;
  font-family: var(--bk-font-display);
  font-size: 1.125rem;
  font-weight: var(--bk-title-weight);
  font-stretch: var(--bk-title-stretch);
  text-transform: var(--bk-title-case);
  line-height: 1.2;
}
.bk__hint {
  color: var(--bk-muted);
  font-family: var(--bk-font-body);
  font-size: 0.875rem;
  font-weight: 400;
  font-stretch: normal;
  text-transform: none;
}
.bk__gname {
  margin: 0 0 8px;
  color: var(--bk-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bk__group + .bk__group,
.bk__slots + .bk__slots { margin-top: 16px; }


.bk__services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.bk__svc,
.bk__day,
.bk__slot {
  border: 2px solid transparent;
  border-radius: var(--bk-radius);
  background: var(--bk-surface);
  color: var(--bk-ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.bk__svc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  text-align: left;
}
.bk__svc-text { display: grid; gap: 1px; min-width: 0; }
.bk__svc-name { font-weight: 600; line-height: 1.2; }
.bk__svc-detail { color: var(--bk-muted); font-size: 0.875rem; line-height: 1.25; }
.bk__svc-price { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }

.bk__svc:hover,
.bk__day:hover,
.bk__slot:hover { border-color: var(--bk-accent); }

.bk__svc[aria-pressed="true"],
.bk__day[aria-pressed="true"],
.bk__slot[aria-pressed="true"] {
  border-color: var(--bk-accent);
  background: var(--bk-accent);
  color: var(--bk-accent-ink);
}
.bk__svc[aria-pressed="true"] .bk__svc-detail { color: inherit; opacity: 0.8; }


.bk__days {
  display: flex;
  gap: 8px;
  margin: 0 -22px;
  padding: 2px 22px 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 22px;
  scrollbar-width: thin;
}
.bk__day {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 68px;
  padding: 10px 4px;
  scroll-snap-align: start;
}
.bk__day-wd,
.bk__day-mo { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.bk__day-num { font-family: var(--bk-font-display); font-size: 1.5rem; font-weight: var(--bk-title-weight); line-height: 1.05; letter-spacing: 0; font-variant-numeric: lining-nums tabular-nums; }


.bk__slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.bk__slot {
  min-height: 44px;
  padding: 8px 4px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}


.bk__fields { display: grid; gap: 12px; }
@media (min-width: 520px) { .bk__fields { grid-template-columns: 1fr 1fr; } }
.bk__field { display: grid; gap: 6px; font-size: 0.875rem; font-weight: 600; }
.bk__field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: var(--bk-radius);
  background: var(--bk-surface);
  color: var(--bk-ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
}
.bk__field input:focus { border-color: var(--bk-accent); outline: none; }
.bk__field input[aria-invalid="true"] { border-color: var(--bk-error); }
.bk__error { min-height: 0; margin: 10px 0 0; color: var(--bk-error); font-size: 0.9375rem; font-weight: 600; }
.bk__error:empty { display: none; }


.bk__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  background: var(--bk-surface);
}
.bk__sum { min-width: 0; flex: 1 1 200px; }
.bk__total { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.bk__note { margin: 2px 0 0; color: var(--bk-muted); font-size: 0.8125rem; line-height: 1.35; }

.bk__go,
.bk__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 2px solid var(--bk-accent);
  border-radius: var(--bk-radius);
  background: var(--bk-accent);
  color: var(--bk-accent-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.bk__go { flex: 1 1 200px; }
.bk__go[aria-disabled="true"] {
  border-color: transparent;
  background: var(--bk-bg);
  color: var(--bk-muted);
  cursor: default;
}
.bk__btn--quiet { background: transparent; color: var(--bk-ink); }

.bk__close:focus-visible,
.bk__svc:focus-visible,
.bk__day:focus-visible,
.bk__slot:focus-visible,
.bk__go:focus-visible,
.bk__btn:focus-visible,
.bk__done:focus-visible {
  outline: 3px solid var(--bk-focus);
  outline-offset: 3px;
}
.bk__done:focus { outline: none; }


.bk__done {
  padding: 6px 22px calc(26px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.bk__when {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 10px 0 20px;
}
.bk__date {
  display: grid;
  justify-items: center;
  min-width: 96px;
  padding: 12px 10px;
  border-radius: var(--bk-radius);
  background: var(--bk-accent);
  color: var(--bk-accent-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bk__dnum { font-family: var(--bk-font-display); font-size: 2.75rem; font-weight: var(--bk-title-weight); line-height: 1; letter-spacing: 0; }
.bk__time { font-family: var(--bk-font-display); font-size: clamp(2rem, 8vw, 2.75rem); font-weight: var(--bk-title-weight); font-stretch: var(--bk-title-stretch); line-height: 1; }
.bk__what { margin: 0; font-size: 1.125rem; font-weight: 600; }
.bk__pay { margin: 6px 0 0; color: var(--bk-muted); }
.bk__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.bk__actions > * { flex: 1 1 160px; }
