/* Kinvra AI — /book, the "Book a call" scheduler (public/book.js).
   Loaded after site.css and pages.css; everything here is prefixed bk-. */

.pg-hero.bk-hero { padding-block: 44px 40px; }
.pg-hero.bk-hero .pg-title { font-size: clamp(2.5rem, 5.4vw, 3.9rem); }
.pg-hero.bk-hero .pg-lede { margin-top: 14px; max-width: 40ch; }
.pg-hero.bk-hero .pg-note a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

.bk-stage { position: relative; padding-block: 0 104px; }
.bk-card {
  --bk-radius: 28px;
  --bk-accent: #0071e3;
  --bk-accent-ink: #0058b9;
  --bk-tint: rgba(0, 113, 227, 0.08);
  --bk-tint-2: rgba(0, 113, 227, 0.14);
  --bk-muted: #636366;
  --bk-hair: rgba(0, 0, 0, 0.08);
  position: relative;
  max-width: 1040px;
  margin-inline: auto;
  border-radius: var(--bk-radius);
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--bk-hair), 0 2px 4px rgba(0, 0, 0, 0.03), 0 40px 90px -48px rgba(24, 24, 60, 0.35);
  scroll-margin-top: 72px;
}
html:not(.js) .bk-app { display: none; }
.bk-nojs { padding: clamp(28px, 5vw, 48px); text-align: center; }
.bk-nojs p { margin-top: 12px; color: var(--bk-muted); }
.bk-nojs a { text-decoration: underline; text-underline-offset: 2px; }

.bk-app { display: grid; grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); min-height: 560px; }
.bk-card:is([data-view="message"], [data-view="manage"], [data-view="confirm-move"]) .bk-app { min-height: 380px; }

/* ---------- summary panel ---------- */
.bk-side { position: relative; padding: 32px 28px; border-right: 1px solid var(--bk-hair); border-radius: var(--bk-radius) 0 0 var(--bk-radius); background: linear-gradient(180deg, #fbfbfd 0%, #f6f6fa 100%); }
.bk-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--bk-muted); }
.bk-brand svg { width: 22px; height: 22px; }
.bk-brand rect { fill: var(--ink); }
.bk-brand path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bk-side-title { margin-top: 14px; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; }
.bk-facts { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.bk-facts li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.35; color: var(--ink-2); animation: bk-fade 0.35s var(--ease); }
.bk-facts svg { width: 20px; height: 20px; flex: none; margin-top: -1px; fill: none; stroke: var(--bk-muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#bk-f-topic, #bk-f-when { font-weight: 600; color: var(--ink); }
.bk-side-note { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--bk-hair); font-size: 13.5px; line-height: 1.45; color: var(--bk-muted); }

/* ---------- main column ---------- */
.bk-main { position: relative; min-width: 0; padding: 30px 36px 36px; }
.bk-view { transition: opacity 0.32s var(--ease), transform 0.32s var(--ease); }
.bk-view.bk-enter { opacity: 0; transform: translateY(10px); }
.bk-h { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; outline: none; }
.bk-h:focus-visible { outline: 2px solid var(--bk-accent); outline-offset: 4px; border-radius: 6px; }
.bk-sub { margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--bk-muted); }
.bk-view-head { display: flex; align-items: center; gap: 10px; }
.bk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 26px; }

.bk-back, .bk-icon-btn { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; transition: background-color 0.2s var(--ease), opacity 0.2s var(--ease); }
.bk-back { margin-left: -8px; background: var(--bg-2); }
.bk-back:hover, .bk-icon-btn:hover:not(:disabled) { background: #e8e8ed; }
.bk-back svg, .bk-icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bk-icon-btn:disabled { opacity: 0.3; cursor: default; }
.bk-back:focus-visible, .bk-icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.45); }

/* stepper */
.bk-steps { display: flex; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: none; }
.bk-steps li { display: inline-flex; align-items: center; gap: 7px; padding-right: 10px; font-size: 13px; font-weight: 500; color: var(--bk-muted); }
.bk-steps li:not(:last-child)::after { content: ""; width: 22px; height: 1px; margin-left: 4px; background: var(--line); }
.bk-step-dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-2); color: var(--bk-muted); font-size: 12px; font-weight: 600; transition: background-color 0.3s var(--ease), color 0.3s var(--ease); }
.bk-steps li[aria-current="step"] { color: var(--ink); font-weight: 600; }
.bk-steps li[aria-current="step"] .bk-step-dot { background: var(--bk-accent); color: #fff; }
.bk-steps li.is-done .bk-step-dot { background: var(--bk-tint-2); color: var(--bk-accent-ink); }

/* skeletons */
.bk-skel { display: block; border-radius: 12px; background: linear-gradient(90deg, #f0f0f3 25%, #e7e7ec 37%, #f0f0f3 63%); background-size: 400% 100%; animation: bk-shimmer 1.4s ease infinite; }
.bk-skeleton { display: grid; gap: 14px; }
.bk-skel-title { width: 62%; height: 28px; }
.bk-skel-line { width: 44%; height: 16px; }
.bk-skel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.bk-skel-chip { height: 58px; border-radius: 16px; }
.bk-skel-button { width: 160px; height: 44px; margin-top: 12px; border-radius: 980px; }
.bk-skel-day { width: 36px; height: 36px; margin: 4px auto; border-radius: 50%; }
.bk-skel-slot { height: 48px; margin-bottom: 8px; }
@keyframes bk-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@keyframes bk-fade { from { opacity: 0; transform: translateY(3px); } }

/* ---------- step 1: topic chips + length ---------- */
.bk-fieldset { margin: 20px 0 0; padding: 0; border: 0; min-width: 0; }
.bk-legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.bk-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bk-chip { position: relative; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 14px 16px; border-radius: 16px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.2s var(--ease); animation: bk-fade 0.4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.bk-chip:hover { box-shadow: inset 0 0 0 1px #a9a9b0; }
.bk-chip:active { transform: scale(0.99); }
.bk-chip input, .bk-seg-item input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bk-chip-text { flex: 1; font-size: 16px; font-weight: 500; line-height: 1.3; }
.bk-chip-mark { position: relative; width: 22px; height: 22px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #c7c7cc; transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.bk-chip-mark::after { content: ""; position: absolute; left: 7px; top: 4px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0.6); opacity: 0; transition: transform 0.2s var(--ease), opacity 0.2s var(--ease); }
.bk-chip:has(input:checked) { background: var(--bk-tint); box-shadow: inset 0 0 0 2px var(--bk-accent); }
.bk-chip input:checked ~ .bk-chip-mark { background: var(--bk-accent); box-shadow: none; }
.bk-chip input:checked ~ .bk-chip-mark::after { opacity: 1; transform: rotate(45deg) scale(1); }
.bk-chip:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--bk-accent), 0 0 0 4px rgba(0, 113, 227, 0.22); }

.bk-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.055); }
.bk-seg-item { position: relative; display: block; }
.bk-seg-item span { display: block; min-width: 76px; padding: 9px 14px; border-radius: 9px; font-size: 15px; font-weight: 600; text-align: center; color: var(--ink-2); transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease); }
.bk-seg-item input:checked + span { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.bk-seg-item input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.45); }

.bk-inline-error { margin-top: 14px; font-size: 14px; font-weight: 500; color: #c4001a; }
.bk-banner { margin-top: 14px; padding: 11px 14px; border-radius: 12px; background: #fff4e0; color: #7a4100; font-size: 14.5px; font-weight: 500; }
.bk-banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- step 2: calendar + times ---------- */
.bk-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 250px); gap: 30px; margin-top: 18px; }
.bk-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bk-month { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.bk-cal-nav { display: flex; gap: 4px; }
.bk-grid { width: 100%; table-layout: fixed; border-collapse: collapse; }
.bk-grid th { padding: 6px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--bk-muted); text-align: center; }
.bk-grid td { padding: 3px 0; text-align: center; }
.bk-grid[aria-busy="true"] tbody { opacity: 0.6; }
.bk-day { position: relative; display: inline-grid; place-items: center; width: 100%; max-width: 46px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #8e8e93; font-size: 16px; font-weight: 400; font-variant-numeric: tabular-nums; cursor: default; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease); }
.bk-day.is-open { background: var(--bk-tint); color: var(--bk-accent-ink); font-weight: 600; cursor: pointer; }
.bk-day.is-open:hover { background: var(--bk-tint-2); }
.bk-day.is-open:active { transform: scale(0.94); }
.bk-day.is-today::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.bk-day.is-selected, .bk-day.is-selected:hover { background: var(--bk-accent); color: #fff; box-shadow: 0 8px 18px -8px rgba(0, 113, 227, 0.8); }
.bk-day:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--bk-accent); }

.bk-tz { position: relative; display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bk-hair); }
.bk-tz label { display: grid; place-items: center; }
.bk-tz svg { width: 18px; height: 18px; fill: none; stroke: var(--bk-muted); stroke-width: 1.7; }
.bk-tz select { flex: 1; min-width: 0; max-width: 100%; padding: 8px 32px 8px 10px; border: 0; border-radius: 10px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23636366' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center / 11px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); appearance: none; cursor: pointer; text-overflow: ellipsis; }
.bk-tz select:hover { background-color: var(--bg-2); }
.bk-tz select:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.45); }

.bk-times { min-width: 0; scroll-margin-top: 70px; }
.bk-times-title { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; line-height: 36px; }
.bk-times-note { margin: 2px 0 12px; font-size: 13px; line-height: 1.4; color: var(--bk-muted); }
.bk-slots { list-style: none; margin: 0; padding: 0 4px 4px 0; display: grid; gap: 8px; max-height: 392px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.bk-slots li { animation: bk-fade 0.35s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.bk-slot { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 14px; border: 0; border-radius: 12px; background: var(--bg); box-shadow: inset 0 0 0 1px rgba(0, 88, 185, 0.4); color: var(--bk-accent-ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease); }
.bk-slot:hover { background: var(--bk-tint); box-shadow: inset 0 0 0 2px var(--bk-accent); }
.bk-slot:active { transform: scale(0.98); }
.bk-slot:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--bk-accent), 0 0 0 4px rgba(0, 113, 227, 0.25); }
.bk-slot.is-selected { background: var(--bk-accent); color: #fff; box-shadow: none; }
.bk-slot-et { font-size: 12.5px; font-weight: 500; color: var(--bk-muted); }
.bk-slot.is-selected .bk-slot-et { color: rgba(255, 255, 255, 0.85); }
.is-loading-slots .bk-slots { opacity: 0.5; pointer-events: none; }

/* ---------- step 3: details ---------- */
.bk-form { display: grid; gap: 16px; margin-top: 20px; }
.bk-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bk-form .field label { color: var(--ink); font-weight: 500; }
.bk-form .optional { color: var(--bk-muted); }
.bk-form .field input, .bk-form .field textarea { padding: 12px 14px; font-size: 16px; }
.bk-form .field textarea { min-height: 104px; }
.bk-count { justify-self: end; margin-top: -2px; font-size: 12px; color: var(--bk-muted); font-variant-numeric: tabular-nums; }
.bk-field-error { font-size: 13.5px; font-weight: 500; color: #c4001a; }
.bk-submit { position: relative; width: 100%; min-height: 50px; margin-top: 4px; font-weight: 600; }
.bk-fine { font-size: 12.5px; color: var(--bk-muted); text-align: center; }
.bk-fine a { color: var(--bk-muted); text-decoration: underline; text-underline-offset: 2px; }

.bk-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; animation: bk-spin 0.8s linear infinite; }
.is-busy .bk-spinner { display: inline-block; }
.pill.is-busy { cursor: progress; }
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* ---------- confirmation ---------- */
.bk-done { text-align: center; padding: 10px 0 4px; }
.bk-check { width: 76px; height: 76px; margin: 4px auto 18px; }
.bk-check svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bk-check-ring { stroke: #34c759; stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; transform: rotate(-90deg); transform-origin: 50% 50%; }
.bk-check-mark { stroke: #34c759; stroke-width: 3.5; stroke-dasharray: 36; stroke-dashoffset: 36; }
.bk-check.is-drawn .bk-check-ring { stroke-dashoffset: 0; transition: stroke-dashoffset 0.6s cubic-bezier(0.65, 0, 0.35, 1); }
.bk-check.is-drawn .bk-check-mark { stroke-dashoffset: 0; transition: stroke-dashoffset 0.35s 0.45s cubic-bezier(0.65, 0, 0.35, 1); }
.bk-done .bk-h { font-size: clamp(28px, 4vw, 34px); letter-spacing: -0.035em; }
.bk-done-when { margin-top: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.bk-done-et { margin-top: 2px; font-size: 14.5px; color: var(--bk-muted); }
.bk-done-where { margin-top: 14px; font-size: 15.5px; color: var(--ink-2); }
.bk-join { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 11px 20px; border-radius: 980px; background: var(--bk-accent); color: #fff; font-weight: 600; }
.bk-join:hover { background: var(--blue-hover); text-decoration: none; }
.bk-cal-add { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.bk-cal-add .pill { font-size: 15px; min-height: 42px; padding: 9px 18px; }
.bk-mail { max-width: 460px; margin: 24px auto 0; padding: 16px 18px; border-radius: 16px; background: var(--bg-2); text-align: left; }
.bk-mail strong { display: block; font-size: 15px; }
.bk-mail p { margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.bk-next { max-width: 460px; margin: 22px auto 0; padding: 0; list-style: none; counter-reset: bk-next; text-align: left; display: grid; gap: 12px; }
.bk-next li { position: relative; padding-left: 36px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); counter-increment: bk-next; }
.bk-next li::before { content: counter(bk-next); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bk-tint); color: var(--bk-accent-ink); font-size: 12.5px; font-weight: 700; }
.bk-next a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- change or cancel ---------- */
.bk-summary { display: grid; gap: 0; margin: 18px 0 0; border-radius: 16px; background: var(--bg-2); }
.bk-summary-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 13px 16px; }
.bk-summary-row + .bk-summary-row { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.bk-summary dt { font-size: 14px; color: var(--bk-muted); }
.bk-summary dd { margin: 0; font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.bk-danger { color: #c4001a; box-shadow: inset 0 0 0 1px rgba(196, 0, 26, 0.5); }
.bk-danger:hover { background: rgba(196, 0, 26, 0.06); }
.bk-danger-fill { background: #d70015; }
.bk-danger-fill:hover { background: #bf0013; }
.bk-cancel { margin-top: 22px; }
.bk-message .bk-actions { margin-top: 20px; }

/* ---------- what to expect ---------- */
.bk-expect .pg-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .bk-app { grid-template-columns: minmax(0, 1fr); }
  .bk-side { padding: 22px 24px 18px; border-right: 0; border-bottom: 1px solid var(--bk-hair); border-radius: var(--bk-radius) var(--bk-radius) 0 0; }
  .bk-side-title { margin-top: 8px; font-size: 22px; }
  .bk-facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 16px; margin-top: 12px; }
  .bk-side-note { display: none; }
  .bk-picker { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .bk-slots { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: none; overflow: visible; }
  .bk-cal { max-width: 420px; width: 100%; margin-inline: auto; }
}
@media (max-width: 640px) {
  .pg-hero.bk-hero { padding-block: 30px 26px; }
  .bk-stage { padding-bottom: 72px; }
  .bk-stage .wrap { padding-inline: 12px; }
  .bk-card { --bk-radius: 22px; }
  .bk-side { padding: 18px 18px 14px; }
  .bk-brand { display: none; }
  .bk-side-title { margin-top: 0; font-size: 20px; }
  .bk-facts { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .bk-facts li { font-size: 14.5px; }
  .bk-main { padding: 20px 16px 24px; }
  .bk-h { font-size: 21px; }
  .bk-steps { margin-bottom: 16px; }
  .bk-steps li { padding-right: 4px; }
  .bk-steps li:not(:last-child)::after { width: 12px; }
  .bk-chips { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .bk-chip { min-height: 54px; padding: 12px 14px; }
  .bk-actions .pill { flex: 1 1 100%; }
  .bk-grid th { font-size: 11px; }
  .bk-day { font-size: 15px; }
  .bk-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-slot { flex-direction: column; gap: 0; min-height: 52px; }
  .bk-row { grid-template-columns: minmax(0, 1fr); }
  .bk-cal-add .pill { flex: 1 1 100%; }
  .bk-summary-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bk-expect .pg-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1020px) and (min-width: 641px) {
  .bk-expect .pg-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .bk-view, .bk-view.bk-enter { transition: none; opacity: 1; transform: none; }
  .bk-skel { animation: none; }
  .bk-chip, .bk-slots li, .bk-facts li { animation: none; }
  .bk-check-ring, .bk-check-mark { stroke-dashoffset: 0; transition: none; }
}
