/* /demos/booking-calendar/: our booking app's client booking page (.bjc) and owner calendar (.bjo) on sample data.
   The look is the app's own (book.css and the calendar part of app.css): Cabinet Grotesk for names and headings,
   Instrument Sans for the rest, ink plum, jam for actions, mint for free times, and the calendar's fixed state colors.
   Changed for this site: no fully rounded pills (8 to 10px corners), the not-working hatch is an SVG tile instead of a
   gradient, no capitals. No style attribute anywhere (CSP style-src 'self'): booking.js sets positions and colors
   through the CSSOM. */
@font-face { font-family: 'Cabinet Grotesk'; src: url('/fonts/CabinetGrotesk-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/Instrument-Sans-var-normal-latin.woff2') format('woff2'); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }

#bj, .bj-scrim, .bj-toast {
  --paper: #F6F4FA; --card: #fff; --ink: #23182E; --muted: #5C5266; --faint: #8F8599; --line: #E2DCE8; --line-2: #CFC6D8;
  --shade: #EEEAF3; --jam: #D81B5A; --jam-ink: #AE1048; --jam-soft: #FCE3EC; --mint: #DDF4EA; --mint-ink: #17603F; --mint-line: #A9DEC4;
  --head: 'Cabinet Grotesk', 'Instrument Sans', system-ui, sans-serif; --text: 'Instrument Sans', system-ui, sans-serif;
  --k-open: #fff; --k-hour: #ECE8F0; --k-half: #F5F2F8; --k-closed: #E9E5EE; --k-closed-ink: #4F4559; --k-off: #F8F6FA; --k-off-stripe: #E4DFEA;
  --k-break: #FBF1DE; --k-break-edge: #D9A441; --k-break-ink: #6B4A0E; --k-blocked: #EEF0F4; --k-blocked-edge: #8A94A6; --k-blocked-ink: #354052;
  --k-card-ink: #23182E; --k-card-muted: #574D61; --k-done: #F5F3F7; --k-done-ink: #5C5266;
  --k-paid: #DDF4EA; --k-paid-ink: #17603F; --k-due: #FFF0D1; --k-due-ink: #7A4B00; --k-due-edge: #C98A12;
  --k-visit: #EEEAF3; --k-visit-ink: #4A4054; --k-noshow: #FDE6E6; --k-noshow-ink: #A11B1B; --k-now: #D81B5A;
  color: var(--ink); font: 16px/1.5 var(--text);
}
:where(#bj, .bj-scrim) *, .bj-toast { box-sizing: border-box; }
:where(#bj, .bj-scrim) :where(button, input, textarea) { font: inherit; color: inherit; }
:where(#bj, .bj-scrim) :focus-visible { outline: 3px solid var(--jam); outline-offset: 2px; }
:where(#bj, .bj-scrim) :where(h2, h3, h4) { font-family: var(--head); line-height: 1.1; margin: 0; }
:where(#bj, .bj-scrim) :where(p, dl, ul, ol) { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* icons: masks, so they take the text color */
.ci { display: inline-block; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; vertical-align: -2px; }
.ci-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.ci-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.ci-x { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E"); }
.ci-lock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2.5'/%3E%3Cpath d='M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5'/%3E%3C/svg%3E"); }
.ci-cup { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 9h12v5a5 5 0 0 1-5 5h-2a5 5 0 0 1-5-5z'/%3E%3Cpath d='M16.5 10.5h1.5a2.5 2.5 0 0 1 0 5h-1.8M8 3.5v2.5M12 3.5v2.5'/%3E%3C/svg%3E"); }
.ci-moon { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z'/%3E%3C/svg%3E"); }
.ci-store { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M4 10v9.5h16V10M3 10l2-5.5h14L21 10M9 19.5V14h6v5.5'/%3E%3C/svg%3E"); }
.ci-prev { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 6l-6 6 6 6'/%3E%3C/svg%3E"); }
.ci-next { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 6l6 6-6 6'/%3E%3C/svg%3E"); }
.ci-card { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5.5' width='18' height='13' rx='2.5'/%3E%3Cpath d='M3 10h18M7 15h4'/%3E%3C/svg%3E"); }

/* ── the stage ── */
.bj-controls { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.biz-switch { display: flex; gap: 8px; flex-wrap: wrap; }
.biz-switch button { display: grid; gap: 1px; text-align: left; min-width: 150px; padding: 9px 14px 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.biz-switch button b { font: 700 15.5px/1.2 var(--head); }
.biz-switch button small { color: var(--muted); font-size: 13px; }
.biz-switch button:hover { border-color: var(--ink); }
.biz-switch button[aria-pressed='true'] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pane-tabs { display: none; }
.bj-panes { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 24px; align-items: start; }
.bj-panes > * { min-width: 0; }
.pane-label { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ── the client's booking page ── */
.bjc { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 18px 18px 22px; scroll-margin-top: 60px; }
.bk-head { padding: 2px 4px 18px; }
.bk-head .pane-label { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sample { font-size: 13px; color: var(--jam-ink); font-weight: 600; margin-bottom: 4px ; }
.biz-name { font-size: clamp(30px, 3vw, 36px); font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.biz-name::after { content: ''; display: block; width: 72px; height: 10px; margin-top: 10px; background: no-repeat left center / 72px 10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 12'%3E%3Cpath d='M2 7q11-7 22 0t22 0 22 0 22 0' fill='none' stroke='%23D81B5A' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.biz-meta { color: var(--muted); margin-top: 10px ; font-size: 14.5px; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin: 0 0 12px; }
.steps.n5 { grid-template-columns: repeat(5, 1fr); }
.steps li { font-size: 12.5px; font-weight: 600; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li.past { border-color: var(--ink); color: var(--ink); }
.steps li.now { border-color: var(--jam); color: var(--ink); }
.picked { font-size: 14px; color: var(--muted); margin: 0 0 10px ; }
.picked b { color: var(--ink); font-weight: 600; }

.bjc .panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px 22px; }
.bjc .panel.enter { animation: bj-rise .28s ease-out both; }
@keyframes bj-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bjc .q { font-size: 25px; font-weight: 800; margin-bottom: 14px; outline: none; }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); padding: 4px 0; margin: -4px 0 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.back:hover { color: var(--ink); }

.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; padding: 13px 15px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.choice:hover { border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); transform: translateY(-1px); }
.c-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.c-name { font-weight: 600; font-size: 16.5px; }
.c-desc { color: var(--muted); font-size: 14px; }
.c-side { display: grid; justify-items: end; gap: 1px; flex: none; }
.c-price { font: 700 18px/1.1 var(--head); }
.c-len { color: var(--muted); font-size: 13px; }
.avatar { --c: var(--ink); width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--c); color: #fff; font: 800 18px/1 var(--head); }
.avatar.any { background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%2317603F'%3E%3Ccircle cx='8' cy='9' r='3'/%3E%3Ccircle cx='16' cy='9' r='3'/%3E%3Cpath d='M2 19c0-3.3 2.7-5 6-5s6 1.7 6 5zM12.5 19c.3-1.8-.3-3.4-1.6-4.6.9-.3 2-.4 3.1-.4 3.3 0 6 1.7 6 5z'/%3E%3C/g%3E%3C/svg%3E") center / 24px no-repeat; }

.days { display: grid; grid-auto-flow: column; grid-auto-columns: 54px; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.day { scroll-snap-align: start; display: grid; justify-items: center; gap: 1px; padding: 7px 0 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; transition: background .12s, border-color .12s; }
.day:hover:not(:disabled) { border-color: var(--ink); }
.day .d-wd { font-size: 12px; font-weight: 600; color: var(--muted); }
.day .d-n { font: 800 20px/1.05 var(--head); }
.day .d-f { font-size: 11.5px; font-weight: 700; color: var(--mint-ink); background: var(--mint); border-radius: 6px; padding: 0 6px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.day.none { background: transparent; border-style: dashed; cursor: default; }
.day.none .d-n, .day.none .d-wd { color: #A69DB0; }
.day.none .d-f { background: none; color: #A69DB0; }
.day.on { background: var(--ink); border-color: var(--ink); }
.day.on .d-wd, .day.on .d-n { color: #fff; }
.day.on .d-f { background: var(--jam); color: #fff; }
@media (min-width: 900px) { .days { grid-auto-flow: row; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; padding-bottom: 4px; } }
.day-title { font: 700 18px/1.2 var(--head); margin: 10px 0 12px ; }
.slot-group + .slot-group { margin-top: 14px; }
.slot-group h4 { font: 600 13px/1 var(--text); color: var(--muted); margin-bottom: 8px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.bjc .chip { border: 1px solid var(--mint-line); background: var(--mint); color: var(--mint-ink); font-weight: 700; font-size: 15px; padding: 10px 4px; border-radius: 10px; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; transition: background .12s, color .12s, transform .12s; }
.bjc .chip:hover { background: var(--mint-ink); color: #fff; transform: translateY(-1px); }
.tz { color: var(--muted); font-size: 13px; margin-top: 14px ; }

.ticket { background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--jam); border-radius: 12px; padding: 13px 15px; margin-bottom: 16px; display: grid; gap: 3px; }
.ticket .t-when { font: 800 20px/1.15 var(--head); }
.ticket .t-pay { color: var(--muted); font-size: 14px; }
.ticket .t-where { color: var(--muted); }
.ticket .t-status { font-size: 13px; font-weight: 700; color: var(--mint-ink); display: inline-flex; gap: 5px; align-items: center; }
.ticket.big { padding: 16px 16px 16px 18px; }
.ticket.big .t-when { font-size: 24px; }

.details { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; }
.f-label { font-weight: 600; font-size: 14.5px; display: flex; gap: 8px; align-items: baseline; }
.opt { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.field input, .field textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 11px; padding: 11px 13px; background: #fff; font-size: 16px; }
.field textarea { resize: vertical; min-height: 78px; }
.field input:focus, .field textarea:focus { border-color: var(--ink); outline: 3px solid var(--jam-soft); outline-offset: 0; }
.policy { color: var(--muted); font-size: 14px; }
.go, .ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 20px; border-radius: 12px; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; border: 2px solid var(--jam); background: var(--jam); color: #fff; text-align: center; transition: background .15s, border-color .15s, color .15s; }
.go:hover { background: var(--jam-ink); border-color: var(--jam-ink); color: #fff; }
.go:disabled { opacity: .65; cursor: progress; }
.details .go, .bjc .panel > .go { width: 100%; }
.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.ghost:hover { background: var(--ink); color: #fff; }
.link { border: 0; background: none; color: var(--jam-ink); text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; cursor: pointer; font-weight: 600; font-size: 14.5px; justify-self: start; margin-top: 10px; }
.link.steal { color: var(--muted); font-weight: 500; margin-top: 0; }
.note { background: var(--paper); border-radius: 12px; padding: 11px 13px; }
.note.warn { background: var(--jam-soft); color: var(--jam-ink); font-weight: 600; margin-bottom: 12px ; }
.details .note.warn { margin: 0 ; }
.pay { margin: 0 0 14px; display: grid; }
.pay div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay dt { color: var(--muted); }
.pay dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.pay .now dt, .pay .now dd { color: var(--ink); font-weight: 700; }
.card-slot { display: flex; gap: 12px; align-items: flex-start; border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 13px 14px; margin-bottom: 14px; }
.card-slot .ci { width: 26px; height: 26px; color: var(--muted); margin-top: 1px; }
.card-slot b { display: block; font-weight: 600; }
.card-slot small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.bjc .panel > .policy { margin-top: 10px; }
.done .sent { color: var(--muted); margin-bottom: 16px ; font-size: 15px; }
.acts { display: flex; flex-wrap: wrap; gap: 10px; }
.acts > * { flex: 1 1 170px; }

/* ── the owner's calendar ── */
.bjo { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; scroll-margin-top: 60px; }
.app-top { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: inset 0 -3px 0 var(--jam); }
.biz-mark { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: #fff; font: 800 13px/1 var(--head); }
.app-biz { display: grid; min-width: 0; }
.app-biz b { font: 800 17px/1.15 var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-biz small { color: var(--jam-ink); font-size: 12.5px; font-weight: 600; }
.app-top .pane-label { margin-left: auto; text-align: right; }
.app-body { padding: 16px 18px 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 2px solid var(--jam); background: var(--jam); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14.5px; }
.btn.line { background: var(--card); border: 1px solid var(--line-2); color: var(--ink); }
.btn.line:hover { border-color: var(--ink); }
.btn.danger { background: var(--card); color: var(--jam-ink); border-color: var(--jam-ink); }
.btn.danger:hover, .btn.danger[data-sure='1'] { background: var(--jam-ink); color: #fff; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; color: var(--ink); }
.icon-btn .ci { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn.small { width: 34px; height: 34px; }
.seg { display: inline-flex; background: var(--shade); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(35, 24, 46, .12); }
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-titles { min-width: 0; margin-left: 6px; }
.cal-title { font: 800 22px/1.15 var(--head); white-space: nowrap; }
.cal-sum { color: var(--muted); font-size: 13.5px; margin-top: 2px ; }
.cal-sum b { color: var(--ink); }
.cal-sum .owed { color: var(--k-due-ink); font-weight: 600; }
.cal-sub { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 10px; }
.people-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.people-pick.phone-only { display: none; }
.pp { --c: var(--ink); display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--card); padding: 6px 12px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.pp small { color: var(--muted); font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pp.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pp.off .dot { background: var(--k-off); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink)); flex: none; }
.cal-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cal-key li { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sw-k { width: 24px; height: 16px; border-radius: 5px; display: grid; place-items: center; position: relative; overflow: hidden; border: 1px solid var(--line-2); color: var(--muted); }
.sw-k .ci { width: 10px; height: 10px; }
.sw-k.k-closed { background: var(--k-closed); border-color: transparent; color: var(--k-closed-ink); }
.sw-k.k-off { background: url('hatch.svg'); }
.sw-k.k-brk { background: var(--k-break); border: 0; box-shadow: inset 3px 0 0 var(--k-break-edge); color: var(--k-break-ink); }
.sw-k.k-blk { background: var(--k-blocked); border: 1.5px dashed var(--k-blocked-edge); color: var(--k-blocked-ink); }
.sw-k.k-buf { background: #FBF4F7; border: 1px dashed #E5A9BF; }
.sw-k.k-due { background: var(--k-due); border: 1.5px dashed var(--k-due-edge); color: var(--k-due-ink); }
.sw-k.k-now { border: 0; background: none; }
.sw-k.k-now::before { content: ''; position: absolute; left: 8px; right: 0; top: 50%; border-top: 2px solid var(--k-now); }
.sw-k.k-now::after { content: ''; position: absolute; left: 3px; top: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--k-now); }

/* the grid: positions come from --t (minutes from the top) and --d (minutes long), set by booking.js */
.cal-scroll { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow-y: auto; overflow-x: hidden; height: 640px; position: relative; overscroll-behavior: contain; }
.cal { --axis: 60px; --ppm: 1.35px; }
.cal-head, .cal-body { display: grid; grid-template-columns: var(--axis) var(--tracks); }
.cal-head { position: sticky; top: 0; z-index: 12; background: var(--card); border-bottom: 1px solid var(--line); }
.corner { background: var(--card); }
.col-head { --c: var(--ink); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-left: 1px solid var(--line); min-width: 0; background: none; text-align: left; color: inherit; font-size: 15px; }
.col-head .av { width: 32px; height: 32px; font-size: 14px; }
.av { --c: var(--ink); flex: none; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font: 800 17px var(--head); }
.col-head.off .av { background: var(--k-off); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.ch-text { min-width: 0; display: grid; }
.col-head .ch-name { font: 800 16px/1.15 var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-head { cursor: pointer; padding: 9px 10px; }
.day-head:hover { background: var(--paper); }
.day-head.today { box-shadow: inset 0 -3px 0 var(--k-now); }
.day-head.today .ch-name { color: var(--jam-ink); }
.week-view .col-head .ch-name { font-size: 14.5px; }
.cal-body { position: relative; height: calc(var(--span) * var(--ppm)); }
.axis { position: relative; z-index: 9; background: var(--card); border-right: 1px solid var(--line); }
.tick { position: absolute; right: 8px; top: calc(var(--t) * var(--ppm)); transform: translateY(-50%); font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tick:first-child { transform: none; top: 4px; }
.col { position: relative; border-left: 1px solid var(--line); background: var(--k-open); min-width: 0; }
.lines { position: absolute; inset: 0; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='81' viewBox='0 0 8 81' preserveAspectRatio='none'%3E%3Crect y='39.5' width='8' height='1' fill='%23F3F0F6'/%3E%3Crect y='80' width='8' height='1' fill='%23ECE8F0'/%3E%3C/svg%3E"); background-size: 100% calc(60 * var(--ppm)); }
.col > div:not(.lines), .col > button { position: absolute; top: calc(var(--t) * var(--ppm)); height: calc(var(--d) * var(--ppm)); }
.col > .closed { left: 0; right: 0; z-index: 1; background: var(--k-closed); color: var(--k-closed-ink); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; padding: 0 12px; overflow: hidden; }
.closed span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.day-view .col:not(.lead) > .closed span { visibility: hidden; }
.week-view .col > .closed { padding: 0 8px; font-size: 12px; }
.col > .nw { left: 0; right: 0; z-index: 1; background: url('hatch.svg'); padding: 6px 8px; overflow: hidden; }
.nw-tag { display: inline-flex; align-items: center; gap: 5px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; border-radius: 7px; padding: 1px 8px 1px 6px; white-space: nowrap; max-width: 100%; overflow: hidden; }
.col > .nw.day { display: flex; justify-content: center; align-items: flex-start; padding-top: 22px; overflow: visible; }
.dayoff { display: grid; justify-items: center; gap: 4px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px 12px; max-width: 92%; position: sticky; top: 60px; }
.dayoff .ci { width: 20px; height: 20px; color: var(--muted); }
.dayoff b { font: 800 16px/1.1 var(--head); }
.dayoff small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.col > .brk { left: 4px; right: 6px; z-index: 3; background: var(--k-break); border-left: 3px solid var(--k-break-edge); border-radius: 0 8px 8px 0; color: var(--k-break-ink); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; padding: 0 10px; overflow: hidden; white-space: nowrap; }
.brk small { font-weight: 600; font-variant-numeric: tabular-nums; }
.col > .blk { left: 4px; right: 6px; z-index: 3; background: var(--k-blocked); border: 1.5px dashed var(--k-blocked-edge); border-radius: 8px; color: var(--k-blocked-ink); padding: 4px 10px; font-size: 12.5px; display: grid; align-content: start; gap: 1px; overflow: hidden; }
.blk b { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk small { font-weight: 600; font-variant-numeric: tabular-nums; }

/* bookings: near-white with the person's color on the edge */
.col > .bk { --c: var(--ink); --ce: var(--c); left: 4px; right: 6px; z-index: 4; min-height: 18px; display: flex; flex-direction: column; gap: 1px; padding: 5px 8px 5px 10px; overflow: hidden; text-align: left; cursor: pointer; color: var(--k-card-ink); font-size: 12.5px; line-height: 1.25; background: color-mix(in srgb, var(--c) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--ce) 28%, var(--card)); border-left: 4px solid var(--ce); border-radius: 8px; transition: background .15s, box-shadow .15s; }
.col > .bk:hover { background: color-mix(in srgb, var(--c) 13%, var(--card)); z-index: 6; }
.bk .r1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bk .who { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bk .tm-s { color: var(--k-card-muted); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.bk .st { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; font-weight: 700; color: var(--k-card-muted); }
.bk .r2 { color: var(--k-card-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk .foot { margin-top: auto; display: flex; gap: 6px; align-items: center; padding-top: 3px; min-width: 0; overflow: hidden; }
.bk.mid .foot { margin-top: 2px; padding-top: 0; }
.bk.tight { flex-direction: row; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; }
.bk.tight .r1 { flex: 1; }
.bk.tight .who { font-size: 13px; }
.bjo .chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 7px 1px 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bjo .chip .ci, .bj-scrim .chip .ci { width: 11px; height: 11px; }
.chip.paid { background: var(--k-paid); color: var(--k-paid-ink); }
.chip.due { background: var(--k-due); color: var(--k-due-ink); box-shadow: inset 0 0 0 1px var(--k-due-edge); }
.chip.visit { background: var(--k-visit); color: var(--k-visit-ink); }
.chip.noshow { background: var(--k-noshow); color: var(--k-noshow-ink); }
.chip.price { color: var(--k-card-muted); padding: 0 ; }
.col > .bk.past, .col > .bk.done { background: var(--k-done); border-color: var(--line); border-left-color: color-mix(in srgb, var(--ce) 45%, var(--k-done)); color: var(--k-done-ink); }
.bk.past .who { font-weight: 600; }
.col > .bk.due { border-style: dashed; border-left-style: solid; border-color: var(--k-due-edge); border-left-color: var(--ce); }
.col > .bk.noshow { background: var(--card); border: 1px dashed color-mix(in srgb, var(--k-noshow-ink) 55%, var(--card)); border-left: 4px solid color-mix(in srgb, var(--ce) 45%, var(--card)); }
.bk.noshow .who { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--k-done-ink); }
.col > .bk.live { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ce); z-index: 5; background: color-mix(in srgb, var(--c) 11%, var(--card)); }
.live-tag, .new-tag { background: var(--ce, var(--jam)); color: #fff; border-radius: 5px; padding: 0 6px; font-size: 11.5px; font-weight: 700; }
/* the booking just made: solid jam, so it reads at a glance */
.col > .bk.new { --ce: var(--jam); background: var(--jam); border-color: var(--jam); color: #fff; z-index: 7; }
.col > .bk.new .tm-s, .col > .bk.new .r2, .col > .bk.new .chip.price { color: #FFE3EC; }
.col > .bk.new .new-tag { background: #fff; color: var(--jam-ink); }
.col > .bk.new .chip.paid, .col > .bk.new .chip.visit { background: rgba(255, 255, 255, .2); color: #fff; }
.col > .bk.new:hover { background: var(--jam-ink); }
.bk.flash { animation: bj-flash 1.4s ease-out 2; }
@keyframes bj-flash { 0% { box-shadow: 0 0 0 0 rgba(216, 27, 90, .55); } 70% { box-shadow: 0 0 0 10px rgba(216, 27, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(216, 27, 90, 0); } }
.col > .bk.has-buf { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.col > .buf { --c: var(--ink); left: 4px; right: 6px; z-index: 2; background: color-mix(in srgb, var(--c) 4%, var(--card)); border: 1px dashed color-mix(in srgb, var(--c) 38%, var(--card)); border-top: 0; border-left: 4px solid color-mix(in srgb, var(--c) 38%, var(--card)); border-radius: 0 0 8px 8px; display: flex; align-items: center; padding-left: 8px; font-size: 11px; font-weight: 600; color: var(--k-card-muted); overflow: hidden; white-space: nowrap; pointer-events: none; }
.cal-body > .now, .col > div.now { position: absolute; top: calc(var(--t) * var(--ppm)); height: 0; left: var(--axis); right: 0; border-top: 2px solid var(--k-now); z-index: 8; pointer-events: none; }
.col > div.now { left: 0; }
.now::before { content: ''; position: absolute; left: -6px; top: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--k-now); box-shadow: 0 0 0 3px var(--card); }
.now-pill { position: absolute; left: 4px; z-index: 10; top: calc(var(--t) * var(--ppm)); transform: translateY(-50%); background: var(--k-now); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 5px; border-radius: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-view .col > .bk { left: 3px; right: 4px; padding: 4px 6px 4px 8px; }
.week-view .bk .who { font-size: 13px; }

/* agenda: the days as a list */
.cal-scroll.ag { padding: 4px 16px 12px; }
.ag-day { padding: 12px 0 6px; border-bottom: 1px solid var(--line); }
.ag-day:last-child { border-bottom: 0; }
.ag-date { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font: 800 17px/1.2 var(--head); margin-bottom: 8px ; }
.ag-date small { font: 600 13px var(--text); color: var(--muted); white-space: nowrap; }
.ag-day.today .ag-date span { color: var(--jam-ink); }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ag-row { --c: var(--ink); width: 100%; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; text-align: left; background: color-mix(in srgb, var(--c) 6%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 22%, var(--card)); border-left: 4px solid var(--c); border-radius: 10px; padding: 8px 12px 8px 10px; cursor: pointer; color: var(--ink); }
button.ag-row:hover { background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.ag-row.blk { background: var(--k-blocked); border: 1.5px dashed var(--k-blocked-edge); color: var(--k-blocked-ink); cursor: default; grid-template-columns: 74px minmax(0, 1fr); }
.ag-row.past { background: var(--k-done); border-color: var(--line); border-left-color: color-mix(in srgb, var(--c) 45%, var(--k-done)); color: var(--k-done-ink); }
.ag-row.noshow b { text-decoration: line-through; }
.ag-row.new { background: var(--jam); border-color: var(--jam); color: #fff; }
.ag-row.new small { color: #FFE3EC; }
.ag-row.new .new-tag { background: #fff; color: var(--jam-ink); margin-left: 6px; }
.ag-time { display: grid; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-time small, .ag-main small { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.ag-row.new .ag-time small { color: #FFE3EC; }
.ag-main { display: grid; min-width: 0; }
.ag-main b { display: flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-money { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.ag-row.new .chip { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.ag-none { color: var(--muted); font-size: 14px; padding: 2px 0 6px; }

/* the sheet: a side panel on a desktop, a bottom sheet on a phone */
body.bj-has-sheet { overflow: hidden; }
.bj-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(35, 24, 46, .38); display: flex; justify-content: flex-end; opacity: 0; transition: opacity .18s; }
.bj-scrim.in { opacity: 1; }
.bj-scrim .sheet { width: min(440px, 100%); height: 100%; background: var(--card); display: flex; flex-direction: column; transform: translateX(24px); transition: transform .2s ease-out; box-shadow: -12px 0 40px rgba(35, 24, 46, .18); color: var(--ink); font: 15.5px/1.5 var(--text); }
.bj-scrim.in .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h4 { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.sheet-body { padding: 18px; overflow-y: auto; flex: 1; }
.bj-scrim .stack { display: grid; gap: 16px; }
.bj-scrim p { margin: 0; }
.muted { color: var(--muted); }
.detail-ticket { position: relative; background: var(--paper); border-radius: 12px; padding: 14px 16px 14px 20px; display: grid; gap: 3px; overflow: hidden; }
.detail-ticket .spine { --c: var(--ink); position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.dt-when { font: 800 20px/1.2 var(--head); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.acts-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cancel-box { display: grid; gap: 10px; justify-items: start; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.bj-toast { position: fixed; z-index: 70; left: 50%; bottom: 28px; transform: translateX(-50%); background: #23182E; color: #fff; padding: 11px 18px; border-radius: 12px; font: 600 15px/1.4 'Instrument Sans', system-ui, sans-serif; box-shadow: 0 8px 28px rgba(35, 24, 46, .25); transition: opacity .4s; max-width: calc(100% - 32px); }
.bj-toast.out { opacity: 0; }

@media (max-width: 1180px) and (min-width: 900px) {
  .bj-panes { grid-template-columns: 380px minmax(0, 1fr); gap: 18px; }
  .cal-title { font-size: 19px; }
}
@media (max-width: 899px) {
  .bj-controls { flex-direction: column; gap: 10px; margin-bottom: 14px; }
  .biz-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .biz-switch button { min-width: 0; padding: 8px 10px 9px; }
  .biz-switch button b { font-size: 14.5px; }
  .biz-switch button small { display: none; }
  .biz-switch button { text-align: center; }
  .pane-tabs { display: flex; background: var(--shade); border-radius: 12px; padding: 3px; }
  .pane-tabs button { flex: 1; border: 0; background: none; padding: 7px 8px; border-radius: 9px; font-weight: 700; font-size: 15px; color: var(--muted); cursor: pointer; }
  .pane-tabs button[aria-pressed='true'] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(35, 24, 46, .14); }
  .bj-panes { grid-template-columns: minmax(0, 1fr); }
  #bj[data-pane='client'] .bjo, #bj[data-pane='owner'] .bjc { display: none; }
  .bjc { padding: 14px 12px 16px; border-radius: 18px; }
  .bjc .panel { padding: 18px 14px 20px; border-radius: 16px; }
  .bjc .q { font-size: 23px; }
  .steps li { font-size: 11.5px; }
  .app-top { padding: 10px 14px; }
  .app-top .pane-label, .bk-head .pane-label, .cal-key { display: none; }
  .app-body { padding: 12px 10px 12px; }
  .cal-bar { gap: 10px; }
  .cal-nav { width: 100%; flex-wrap: wrap; }
  .cal-titles { flex-basis: 100%; margin: 4px 0 0; }
  .cal-title { font-size: 19px; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .cal-sub { flex-direction: column; align-items: stretch; }
  .people-pick.phone-only { display: flex; }
  .cal-scroll { height: 560px; border-radius: 12px; }
  .cal { --axis: 50px; --ppm: 1.4px; }
  .day-view .cal-head { display: none; }
  .day-view .cal-body { grid-template-columns: var(--axis) minmax(0, 1fr); }
  .day-view .col:not(.sel) { display: none; }
  .day-view .col:not(.lead) > .closed span { visibility: visible; }
  .bk .who { font-size: 14.5px; }
  .cal-scroll.ag { padding: 2px 10px 10px; }
  .ag-row { grid-template-columns: 62px minmax(0, 1fr); }
  .ag-money { grid-column: 2; justify-content: flex-start; }
  .bj-scrim { align-items: flex-end; }
  .bj-scrim .sheet { width: 100%; height: auto; max-height: 88vh; border-radius: 18px 18px 0 0; transform: translateY(24px); }
  .sheet-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .bjc .panel.enter, .bk.flash { animation: none; }
  .bj-scrim, .bj-scrim .sheet, .choice, .bjc .chip, .day, .go, .ghost { transition: none; }
  .choice:hover, .bjc .chip:hover { transform: none; }
}
