/*
 * Guest booking sheet: service > professional > date & time > details > confirm, plus manage and lookup.
 * Structure (base.css): fixed header + progress strip, a scrolling body, a fixed action bar.
 * Compact on purpose: related things sit 8-12px apart, groups 16-24px apart, rows keep >=44px touch targets.
 */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: inline-grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--ink); flex: none; }
.invisible { visibility: hidden; }

/* ---------- step typography ---------- */
.step { animation: fade .22s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.step h3 { font-size: var(--fs-h3); line-height: 1.15; margin-bottom: var(--s-3); outline: none; }
.step > .lead { margin-top: calc(var(--s-2) * -1); margin-bottom: var(--s-4); }
.step h4 { font-family: var(--body); font-size: var(--fs-label); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); margin: var(--s-5) 0 var(--s-2); }
.step h3 + .opt-group h4, .step h3 + h4 { margin-top: var(--s-2); }

/* ---------- selectable rows (service, person): compact, one clear selected state ---------- */
.opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "meta meta"; column-gap: var(--s-4); row-gap: 2px; align-items: baseline; width: 100%; text-align: left; padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-2); min-height: 52px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--ink); }
.opt.sel { border-color: var(--ink); background: var(--tint); box-shadow: inset 0 0 0 1px var(--ink); }
.opt-name { grid-area: name; min-width: 0; font-size: var(--fs-m); font-weight: 500; line-height: 1.3; overflow-wrap: break-word; }
.opt-price { grid-area: price; font-size: var(--fs-m); font-weight: 500; line-height: 1.3; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.opt-meta { grid-area: meta; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; font-size: var(--fs-xs); line-height: 1.4; color: var(--muted); }
.opt-dur { white-space: nowrap; font-variant-numeric: tabular-nums; }
.opt-desc::before { content: " · "; white-space: pre; }

.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--s-2); }
.pro { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "av name" "av role"; column-gap: var(--s-3); align-items: center; text-align: left; padding: var(--s-3) var(--s-4); min-height: 64px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, background .15s; }
.pro:hover { border-color: var(--ink); }
.pro.sel { border-color: var(--ink); background: var(--tint); box-shadow: inset 0 0 0 1px var(--ink); }
.pro .avatar { grid-area: av; } .pro strong { grid-area: name; font-weight: 500; font-size: 16px; line-height: 1.3; align-self: end; overflow-wrap: anywhere; }
.pro .muted { grid-area: role; font-size: var(--fs-xs); line-height: 1.35; align-self: start; }

/* ---------- date + time ---------- */
.time-layout { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: var(--s-5); align-items: start; }
@media (max-width: 760px) { .time-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: calc(var(--s-1) * -1) 0 var(--s-1); }
.cal-head strong { font-size: var(--fs-m); font-weight: 600; }
.cal-head .icon-btn { width: 40px; height: 40px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dow { text-align: center; font-size: 14px; color: var(--muted); font-weight: 500; padding: 0 0 var(--s-1); }
.day { aspect-ratio: 1; min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; border-radius: 50%; font-weight: 500; font-size: var(--fs-s); transition: background .12s; }
.day.avail::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.day.sel.avail::after { background: var(--on-brand); }
.day:not([disabled]):hover { background: var(--tint); box-shadow: inset 0 0 0 1px var(--ink); }
.day[disabled] { color: color-mix(in srgb, var(--ink) 34%, var(--bg)); font-weight: 400; cursor: default; }
.day.today { box-shadow: inset 0 0 0 1px var(--line-strong); }
.day.sel { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.slot-title { margin: 0 0 var(--s-2) !important; }
.slot-group { margin-bottom: var(--s-3); } .slot-group > .muted { font-size: 14px; display: block; margin-bottom: var(--s-1); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: var(--s-2); }
.slot { min-height: 44px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-s); font-weight: 500; font-size: var(--fs-s); white-space: nowrap; transition: border-color .12s, background .12s; }
.slot:hover { border-color: var(--ink); }
.slot.sel { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.slot-hint { padding: var(--s-3) 0; font-size: var(--fs-s); }
.more-times { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin-top: var(--s-3); background: none; border: 1px dashed var(--line-strong); border-radius: var(--r-s); font-size: var(--fs-s); font-weight: 500; transition: border-color .15s, background .15s; }
.more-times:hover { border-color: var(--ink); background: var(--tint); }
.slot-empty { display: grid; gap: var(--s-1); justify-items: start; padding: var(--s-4); background: var(--tint); border-radius: var(--r-s); font-size: var(--fs-s); line-height: 1.45; }
.slot-empty strong { font-weight: 600; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: var(--r-s); padding: var(--s-3) var(--s-4); font-size: var(--fs-s); margin: var(--s-3) 0; font-weight: 500; }

/* ---------- service brief + person chooser (time step) ---------- */
.brief { margin: calc(var(--s-1) * -1) 0 var(--s-4); }
.brief-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-3); font-size: var(--fs-s); }
.brief-line strong { font-size: var(--fs-m); font-weight: 600; }
.brief-line span { color: var(--muted); font-variant-numeric: tabular-nums; }
.brief-desc { margin-top: 2px; font-size: var(--fs-s); line-height: 1.45; color: var(--muted); max-width: 52ch; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-4); }
.who-lab { font-size: var(--fs-s); color: var(--muted); margin-right: var(--s-1); }
.chip-btn { min-height: 40px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; font-size: var(--fs-s); font-weight: 500; transition: border-color .15s, background .15s; }
.chip-btn:hover { border-color: var(--ink); }
.chip-btn[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.slot-title .tz { font-weight: 400; color: var(--muted); font-size: var(--fs-s); letter-spacing: 0; text-transform: none; }

/* ---------- appointment details: one compact panel (service + price, then a 2x2 of facts), plain sections beneath ---------- */
.sum2 { padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: var(--s-4); }
.sum-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); }
.sum-svc { min-width: 0; font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: break-word; }
.sum-price { flex: none; font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); margin: var(--s-3) 0 0; padding-top: var(--s-3); border-top: 1px solid var(--line); }
.facts dt { font-size: var(--fs-xs); color: var(--muted); }
.facts dd { margin: 0; font-size: var(--fs-m); font-weight: 500; line-height: 1.3; overflow-wrap: break-word; font-variant-numeric: tabular-nums; }
.sum2 .grp-note { margin-top: var(--s-3); }
.sum-sec { margin: 0 0 var(--s-4); }
.sum-sec h4 { margin: 0 0 var(--s-1); }
.sum-sec .grp-head h4 { margin: 0; }
.grp-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s-1); }
.sum-text { font-size: var(--fs-m); line-height: 1.5; overflow-wrap: break-word; }
.sum-text strong { font-weight: 500; }
.grp-note { font-size: var(--fs-xs); color: var(--muted); }
.loc { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); font-size: var(--fs-m); }
.loc address { font-style: normal; line-height: 1.5; min-width: 0; overflow-wrap: break-word; }
.loc .textlink { flex: none; min-height: 28px; font-size: var(--fs-s); }
.policy { font-size: var(--fs-xs); line-height: 1.45; color: var(--muted); margin: var(--s-4) 0 var(--s-2); max-width: 52ch; }
.policy strong { color: var(--ink); font-weight: 500; }
.small { font-size: var(--fs-xs); margin: var(--s-3) 0; line-height: 1.45; }

/* ---------- done / manage ---------- */
.done-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.done-head h3 { margin: 0; min-width: 0; flex: 1; }
.done-head .chip { flex: none; }
.done-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; flex: none; animation: pop .45s var(--ease); }
.done-icon.wait { background: var(--warn-bg); color: var(--warn); } .done-icon svg { width: 20px; height: 20px; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.done-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin: var(--s-4) 0 var(--s-2); }
.done-actions .btn { padding-inline: var(--s-3); white-space: normal; text-align: center; line-height: 1.2; }
.manage-btn { margin-top: 0; }
@media (max-width: 359px) { .done-actions { grid-template-columns: minmax(0, 1fr); } }
.done .lead { margin-bottom: var(--s-4); max-width: 38ch; }

.demo-box { background: var(--tint); border: 1px dashed var(--line-strong); border-radius: var(--r-s); padding: var(--s-3) var(--s-4); font-size: var(--fs-s); color: var(--muted); margin-bottom: var(--s-4); }
.demo-box .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .12em; color: var(--ink); }
.help { margin-top: var(--s-4); } .help a { font-weight: 500; }
