/* Booking flow (mockup): white cards on a light surface, the accent fills what is selected, the main button sits at the bottom.
   Full screen on phones, a centred panel on desktop. After the service step, Setmore's booking page fills the same dialog. */
.book { padding: 0; border: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; background: var(--surface); color: var(--ink); overscroll-behavior: contain; }
.book::backdrop { background: rgb(18 17 16 / 0.62); }
.book[open] { display: block; }
@media (min-width: 760px) {
  .book { width: min(580px, calc(100vw - 48px)); height: min(860px, calc(100dvh - 48px)); margin: auto; border-radius: 24px; box-shadow: var(--shadow-float); } /* taste-skill-ignore */
  .book[data-mode="setmore"] { width: min(900px, calc(100vw - 48px)); height: min(85dvh, 1000px); }   /* only when Setmore's page is there */
}
html.is-locked { overflow: hidden; }   /* the page behind never scrolls while the dialog is open */
.book-shell { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100%; }
.book[data-mode^="setmore"] .book-shell { grid-template-rows: auto minmax(0, 1fr); }
.book[data-mode^="setmore"] .progress, .book[data-mode^="setmore"] .book-foot { display: none; }

/* top bar: back, what you're booking (and with whom), close */
.book-head { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 12px 6px; background: var(--surface); }
.book-head.no-back { grid-template-columns: minmax(0, 1fr) auto; padding-left: 20px; }
.book-head.no-back [data-back] { display: none; }
.book-headtext { display: grid; justify-items: start; gap: 2px; min-width: 0; }
.book-title { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-title:focus { outline: none; }
.book-sub { display: flex; align-items: center; gap: 8px; font-size: var(--step-small); color: var(--muted); max-width: 100%; }
.book-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-sub[hidden] { display: none; }
.book-close { min-height: 44px; padding: 0 14px 0 10px; gap: 6px; font-size: 0.95rem; background: var(--white); }
.book-close svg { width: 18px; height: 18px; }

/* progress: one segment per step, labels under them */
.progress { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 6px 20px 14px; }
.progress li { display: grid; gap: 6px; font-size: 0.8125rem; color: var(--muted); }
.progress li::before { content: ""; height: 4px; border-radius: 2px; background: var(--line); transition: background-color var(--dur-ui) ease; }
.progress li.done::before { background: var(--ink); }
.progress li[aria-current="step"]::before { background: var(--accent); }
.progress li[aria-current="step"] { color: var(--ink); font-weight: 700; }
.progress span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.book-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 24px; }
.book-body:focus { outline: none; }
@media (max-width: 400px) {
  .book .book-body { padding-inline: 12px; }
  .book-close { width: var(--tap); min-height: var(--tap); padding: 0; border-radius: 50%; }   /* icon only: the title gets the room */
  .book-close svg { width: 22px; height: 22px; }
  .book-close .close-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.step-h { font-size: 1.5rem; font-weight: 800; margin: 6px 0 16px; }
.step-h:focus { outline: none; }

/* cards: native radios inside labels, so arrows/space/tab work with no script */
.choice { position: relative; display: grid; gap: 6px; padding: 16px; background: var(--white); border-radius: var(--r-card); cursor: pointer; touch-action: manipulation;
  transition: background-color 150ms ease, transform var(--dur-press) var(--ease-out); }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: inherit; }
.choice:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.choice.is-on { background: var(--accent); }
.choice:active:not(.is-off) { transform: scale(0.98); }
.choice.is-off { cursor: not-allowed; background: rgb(18 17 16 / 0.04); }
.choice.is-off .choice-name, .choice.is-off .choice-icon { opacity: 0.5; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-grid .is-wide, .choice-grid:has(.is-wide) > *, .choice-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }  /* no orphan cards */
.svc-group + .svc-group { margin-top: 18px; }
.group-label { font-size: var(--step-small); font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.pre { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: -6px 0 14px; font-weight: 600; }
.link-btn { border: 0; background: none; padding: 12px 0; font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.choice-icon { width: 30px; height: 30px; margin-bottom: 6px; }
.choice-name { font-weight: 700; line-height: 1.3; }
.choice-meta { font-size: var(--step-small); color: var(--muted); }
.choice.is-on .choice-meta, .choice.is-on .choice-sub { color: var(--ink); }
.choice-list { display: grid; gap: 10px; }
.choice--row { grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 14px; }
.choice-text { display: grid; gap: 2px; min-width: 0; }
.choice-sub { font-size: 0.95rem; color: var(--muted); }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; filter: grayscale(1); background: var(--bone-2); flex: none; }
.avatar--xs { width: 28px; height: 28px; }
.avatar--any { display: grid; place-items: center; background: var(--surface); }
.avatar--any svg { width: 28px; height: 28px; }

/* bottom bar */
.book-foot { display: grid; gap: 10px; padding: 12px 20px max(16px, env(safe-area-inset-bottom)); background: var(--surface-2); }
.mini { font-weight: 700; font-size: 0.95rem; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-foot .btn:disabled { background: var(--disabled); color: var(--disabled-ink); }

/* ---------- Setmore's booking page ---------- */
.book[data-mode^="setmore"] .book-body { display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 0; overflow: hidden; }
.sm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: 0 20px 10px; font-size: var(--step-small); color: var(--muted); }
.sm-bar > span { flex: 1 1 22ch; }
.sm-note-short { display: none; }
@media (max-width: 599px) {   /* phones: one row, so the booking page keeps the screen */
  .sm-bar { flex-wrap: nowrap; padding-bottom: 0; font-size: 0.8125rem; line-height: 1.35; }
  .sm-bar > span { flex: 1 1 auto; min-width: 0; }
  .sm-note { display: none; } .sm-note-short { display: block; }
}
.sm-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; white-space: nowrap; }
.sm-tab svg { width: 18px; height: 18px; flex: none; }
.sm-area { position: relative; min-height: 0; background: var(--white); overflow: hidden; }
.book[data-mode^="setmore"] .book-body > .sm-area:only-child { grid-row: 1 / -1; background: var(--surface); }
@media (min-width: 760px) { .sm-area { margin: 0 12px 12px; border-radius: var(--r-card); } }
.sm-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--white); opacity: 0; transition: opacity 200ms ease-out; }
.sm-area.is-loaded .sm-frame { opacity: 1; }
.sm-area.is-loaded .sm-skel { visibility: hidden; }
/* skeleton: the rough shape of a booking page, until the frame says it has loaded */
.sm-skel { display: grid; align-content: start; gap: 14px; padding: 28px 24px; }
.sm-skel span { height: 18px; border-radius: 9px; background: var(--bone-2); animation: skel 1.2s ease-in-out infinite alternate; }
.sm-skel span:nth-child(1) { width: 46%; height: 26px; }
.sm-skel span:nth-child(2) { width: 72%; }
.sm-skel span:nth-child(3), .sm-skel span:nth-child(4), .sm-skel span:nth-child(5) { height: 64px; border-radius: var(--r-field); }
.sm-skel span:nth-child(6) { width: 38%; }
@keyframes skel { from { opacity: 1; } to { opacity: 0.45; } }
/* when the page cannot show here: a clear card, never an empty panel */
.sm-card { display: grid; justify-items: center; align-content: center; gap: 16px; text-align: center; padding: 32px 24px; }
.sm-area > .sm-card:only-child { min-height: 100%; }
.sm-fallback { position: absolute; inset: 0; background: var(--white); }
.sm-card-h { font: 800 var(--step-name)/1.05 var(--display); text-transform: uppercase; max-width: 22ch; }
.sm-card-h a { white-space: nowrap; }
.sm-card p:not(.sm-card-h) { max-width: 38ch; color: var(--muted); }
.sm-card p a { color: var(--ink); font-weight: 700; }
.sm-card .btn { white-space: normal; }
/* online booking not set up yet: one calm white card, one way forward */
.sm-area--off { display: grid; place-items: center; padding: 20px; }
.sm-card--off { width: min(100%, 440px); background: var(--white); border-radius: var(--r-card); padding: 32px 24px; }
.sm-area > .sm-card--off:only-child { min-height: 0; }
.sm-card p.sm-off-h { font-size: var(--step-lead); font-weight: 700; line-height: 1.35; color: var(--ink); max-width: 26ch; }
@media (min-width: 760px) { .book[data-mode="setmore-off"] { height: fit-content; }   /* a modal dialog is inset: 0, so auto would stretch it */ .book[data-mode="setmore-off"] .sm-area--off { padding: 8px 20px 24px; } }
.sm-off-h a { white-space: nowrap; }

@media (hover: hover) and (pointer: fine) {
  .choice:not(.is-on):not(.is-off):hover { background: var(--white-hover); }
  .book-close:hover { background: var(--white-hover); }
}

/* ---------- motion (emil-design-eng) ---------- */
/* Open: phones get a sheet from the bottom edge, desktop a centred modal. Close is faster than open. */
.book { transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete; }
.book:not([open]) { transform: translateY(100%); }
.book[open] { transition-duration: 340ms; transition-timing-function: var(--ease-drawer); }
@starting-style { .book[open] { transform: translateY(100%); } }
.book::backdrop { transition: opacity 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete; }
.book:not([open])::backdrop { opacity: 0; }
@starting-style { .book[open]::backdrop { opacity: 0; } }
@media (min-width: 760px) {
  .book:not([open]) { transform: scale(0.96); opacity: 0; }
  .book[open] { transition-duration: 220ms; transition-timing-function: var(--ease-out); }
  @starting-style { .book[open] { transform: scale(0.96); opacity: 0; } }
}
/* Step change: content travels a short way in the direction of the step */
.book-body.swap { animation: step-in var(--dur-step) var(--ease-out); }
.book-body[data-dir="back"] { --dx: -16px; }
@keyframes step-in { from { opacity: 0; transform: translateX(var(--dx, 16px)); } }
@media (prefers-reduced-motion: reduce) {
  .book, .book:not([open]), .book[open] { transform: none !important; }
  @starting-style { .book[open] { transform: none; opacity: 0; } }
  .book-body.swap { animation-name: fade-in; }
  .sm-skel span { animation: none; }
  .choice:active, .btn:active { transform: none !important; }
}
