/* Ava /book/ flow (2026-11-07). Uses each theme's tokens; one design metaphor per industry:
   legal = calm consultation intake · restaurant = quick reservation · plumbing = dispatch ticket ·
   property = viewing/showing · medical = practice onboarding checklist · homeservices = service call. */
.book{--bk-r:var(--radius-lg,var(--radius,14px));--bk-chip-r:999px;--bk-mono:var(--mono,var(--body));padding-bottom:clamp(56px,8vw,112px)}
.book-intro{padding-block:clamp(48px,7vw,96px) clamp(28px,4vw,48px)}
.book-intro h1{font-size:var(--h1-page,var(--h1));max-width:900px;margin-bottom:20px}
.book-intro .lede{max-width:640px}
.book-kicker{margin-top:12px;color:var(--muted);font-size:15px;max-width:640px}
.book-shell{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,340px);gap:clamp(24px,4vw,56px);align-items:start}
.book-main{min-width:0}
.book-card,.book-done-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--bk-r);padding:clamp(22px,3.2vw,44px);box-shadow:var(--lift,none);color:var(--ink)}
.book fieldset{border:0;margin:0;padding:0;min-width:0}
.book legend{padding:0;font-size:14px;font-weight:600;margin-bottom:10px;color:var(--ink)}
.book legend span,.book label>span{font-weight:400;color:var(--muted)}
.book-step h2{font-size:clamp(26px,2.6vw,38px);margin:0 0 26px;outline:none}
.book-step-count{font:600 12px/1.4 var(--bk-mono);letter-spacing:var(--label-tracking,.12em);text-transform:uppercase;color:var(--muted);margin-bottom:8px}
.book .field,.book .field-multi{margin-bottom:22px}
.book .field label{margin-bottom:0}
.book .field-hint{display:block;margin-top:6px;font-size:13px;color:var(--muted)}
.book .field-error{margin:6px 0 0;font-size:13px;color:var(--danger,#b3261e)}.book .field-error:empty{display:none}
.book .invalid input,.book .invalid select,.book .invalid textarea,.book input[aria-invalid=true],.book select[aria-invalid=true],.book textarea[aria-invalid=true]{border-color:var(--danger,#b3261e)}
.book .check.invalid span{color:var(--danger,#b3261e)}
.book textarea{resize:vertical;min-height:110px}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:20px}
.book .check{margin:6px 0 4px}
.book .check a{color:var(--ink)}
/* chips (multi-select, radios) */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{position:relative;margin:0;font-weight:500;font-size:14px}
.chip input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.chip span{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:9px 16px;border:1px solid var(--line-strong);border-radius:var(--bk-chip-r);background:var(--input-bg,transparent);color:var(--ink);cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.chip span::before{content:"";width:8px;height:8px;border-radius:50%;border:1px solid currentColor;opacity:.5;flex:none}
.chip:hover span{border-color:var(--ink)}
.chip input:checked+span{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.chip input:checked+span::before{background:currentColor;opacity:1}
.chip input:focus-visible+span{outline:2px solid var(--accent);outline-offset:3px}
.field-multi.invalid .chip span{border-color:var(--danger,#b3261e)}
/* progress */
.book-progress{list-style:none;margin:0 0 30px;padding:0 0 18px;display:flex;gap:6px 18px;flex-wrap:wrap;border-bottom:1px solid var(--line);counter-reset:none}
.book-progress li{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.book-progress b{display:inline-grid;place-items:center;min-width:28px;height:28px;padding:0 6px;border-radius:999px;border:1px solid var(--line-strong);font:600 11px/1 var(--bk-mono)}
.book-progress li[aria-current=step]{color:var(--ink);font-weight:600}
.book-progress li[aria-current=step] b{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.book-progress li.done b{border-color:var(--accent);color:var(--accent-strong,var(--accent))}
/* nav + status */
.book-nav{display:flex;justify-content:space-between;gap:12px;margin-top:30px;flex-wrap:wrap}
.book-nav [data-next]{margin-left:auto}
.book-status{margin-top:20px}
/* slots */
.slot-bar{display:flex;flex-wrap:wrap;align-items:end;justify-content:space-between;gap:8px 20px;margin-bottom:18px}
.slot-tz{margin:0;min-width:min(100%,300px)}
.slot-duration{margin:0 0 12px}
.slot-loading{display:flex;align-items:center;gap:12px;padding:28px 0;color:var(--muted)}
.slot-spinner{width:18px;height:18px;border-radius:50%;border:2px solid var(--line-strong);border-top-color:var(--accent);animation:bk-spin .9s linear infinite}
@keyframes bk-spin{to{transform:rotate(360deg)}}
.slot-error{padding:18px;border:1px solid var(--danger,#b3261e);border-radius:var(--radius,10px);margin-bottom:12px}
.slot-error p{color:var(--ink);margin-bottom:12px}
.slot-days{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(74px,1fr);gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;padding:2px 2px 10px;max-width:100%}
.slot-day{display:grid;justify-items:center;gap:2px;padding:12px 6px;border:1px solid var(--line-strong);border-radius:var(--radius,12px);background:var(--input-bg,transparent);color:var(--ink);scroll-snap-align:start;min-height:96px;transition:border-color .15s,background .15s}
.slot-day strong{font:600 24px/1.1 var(--display);letter-spacing:-.02em}
.slot-day .slot-dow,.slot-day .slot-mon{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.slot-day small{font-size:11px;color:var(--muted)}
.slot-day:hover{border-color:var(--ink)}
.slot-day[aria-pressed=true]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.slot-day[aria-pressed=true] span,.slot-day[aria-pressed=true] small{color:var(--accent-ink);opacity:.8}
.slot-pager{display:flex;justify-content:space-between;gap:12px;margin:6px 0 18px}
.slot-pager .button{min-height:40px;font-size:14px}
.slot-pager [data-later]{margin-left:auto}
.book .slot-times{margin-bottom:6px}
.slot-group+.slot-group{margin-top:14px}
.slot-group-name{font:600 12px/1.4 var(--bk-mono);text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin-bottom:8px}
.slot-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px}
.slot-time{position:relative;margin:0;font-weight:500}
.slot-time input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.slot-time span{display:flex;align-items:center;justify-content:center;min-height:46px;padding:8px 10px;border:1px solid var(--line-strong);border-radius:var(--input-radius,10px);background:var(--input-bg,transparent);font-variant-numeric:tabular-nums;font-size:15px;cursor:pointer;text-align:center}
.slot-time:hover span{border-color:var(--ink)}
.slot-time input:checked+span{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:650}
.slot-time input:focus-visible+span{outline:2px solid var(--accent);outline-offset:3px}
.slot-times.invalid .slot-time span{border-color:var(--danger,#b3261e)}
.book .slot-modes{margin-top:28px;padding-top:22px;border-top:1px solid var(--line)}
/* aside */
.book-aside{position:sticky;top:100px;min-width:0}
.book-aside-inner{border:1px solid var(--line);border-radius:var(--bk-r);padding:26px;background:var(--surface-2,var(--surface));color:var(--ink)}
.book-aside .eyebrow{margin-bottom:16px}
.aside-list{margin:0 0 20px;padding-left:20px;color:var(--muted);font-size:14px}.aside-list li+li{margin-top:10px}
.aside-rows{margin:0;display:grid;gap:0}
.aside-rows>div{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-top:1px solid var(--line);font-size:14px}
.aside-rows dt{color:var(--muted);flex:none}
.aside-rows dd{margin:0;text-align:right;font-weight:600;overflow-wrap:anywhere;min-width:0}
.aside-note{margin:18px 0 0}
.aside-chips{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.aside-chips li{font-size:12px;padding:5px 10px;border-radius:999px;border:1px solid var(--line-strong)}
.aside-pipeline{list-style:none;margin:18px 0 0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.aside-pipeline li{position:relative;padding-top:14px;font:600 11px/1.3 var(--bk-mono);text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.aside-pipeline li::before{content:"";position:absolute;left:0;right:0;top:0;height:4px;border-radius:4px;background:var(--line-strong)}
.aside-pipeline li.on{color:var(--ink)}.aside-pipeline li.on::before{background:var(--accent)}
.aside-check{list-style:none;margin:0 0 16px;padding:0}
.aside-check li{display:flex;align-items:center;gap:12px;padding:10px 0;font-size:14px;color:var(--muted)}
.aside-check li>span{width:22px;height:22px;border-radius:50%;border:1.5px solid var(--line-strong);flex:none;position:relative}
.aside-check li.done{color:var(--ink)}
.aside-check li.done>span{background:var(--accent);border-color:var(--accent)}
.aside-check li.done>span::after{content:"";position:absolute;left:7px;top:3px;width:5px;height:10px;border:solid var(--accent-ink);border-width:0 2px 2px 0;transform:rotate(45deg)}
/* confirmation */
.book-done{outline:none}
.book-done-card h2{font-size:clamp(32px,3.6vw,54px);margin-bottom:14px}
.book-done-card .lede{margin-bottom:26px}
.done-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px;margin:0 0 26px}
.done-facts>div{padding:14px 0;border-top:1px solid var(--line)}
.done-facts dt{font-size:12px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin-bottom:4px}
.done-facts dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.done-actions{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:18px}
.book.is-done .book-aside{opacity:.9}

/* ---------- legal: calm consultation intake (aside left, quiet outlines, no fills) */
.book-legal{--bk-chip-r:4px}
.book-legal .book-shell{grid-template-columns:minmax(240px,320px) minmax(0,1fr)}
.book-legal .book-aside{order:-1}
.book-legal .book-card{box-shadow:none;border-color:color-mix(in srgb,var(--accent) 30%,transparent)}
.book-legal .book-progress b{border-radius:0;border-width:0 0 1px;min-width:22px;padding:0}
.book-legal .book-progress li[aria-current=step] b{background:none;color:var(--accent);border-color:var(--accent)}
.book-legal .chip input:checked+span,.book-legal .slot-time input:checked+span{background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--ink);border-color:var(--accent)}
.book-legal .slot-day{border-radius:4px}
.book-legal .slot-day[aria-pressed=true]{background:transparent;color:var(--ink);border-color:var(--accent);box-shadow:inset 0 -3px 0 var(--accent)}
.book-legal .slot-day[aria-pressed=true] span,.book-legal .slot-day[aria-pressed=true] small{color:var(--muted)}
.book-legal .aside-list{list-style:none;padding:0;counter-reset:x}
.book-legal .aside-list li{counter-increment:x;position:relative;padding-left:40px}
.book-legal .aside-list li::before{content:counter(x,upper-roman);position:absolute;left:0;top:-4px;font:italic 400 24px/1 var(--display);color:var(--accent)}
.book-legal .book-step h2,.book-legal .book-done-card h2{font-weight:400}

/* ---------- restaurant: quick reservation (date-first, rounded pills, ticket stub) */
.book-restaurant{--bk-r:24px}
.book-restaurant .book-shell{grid-template-columns:minmax(0,1fr) minmax(250px,300px)}
.book-restaurant .book-progress{gap:4px;border:0;padding:5px;border-radius:999px;background:var(--surface-2,var(--bg));flex-wrap:nowrap}
.book-restaurant .book-progress li{flex:1 1 auto;justify-content:center;text-align:center;padding:8px 12px;border-radius:999px;min-width:0;line-height:1.25}
.book-restaurant .book-progress li b{display:none}
.book-restaurant .book-progress li[aria-current=step]{background:var(--accent);color:var(--accent-ink)}
.book-restaurant .slot-day{border-radius:18px}
.book-restaurant .slot-time span{border-radius:999px}
.book-restaurant .book-aside-inner{position:relative;background:var(--surface);border:2px dashed var(--line-strong);border-radius:18px}
.book-restaurant .book-aside-inner::before,.book-restaurant .book-aside-inner::after{content:"";position:absolute;top:50%;width:22px;height:22px;margin-top:-11px;border-radius:50%;background:var(--bg)}
.book-restaurant .book-aside-inner::before{left:-12px}.book-restaurant .book-aside-inner::after{right:-12px}
.book-restaurant .aside-rows dd{font-family:var(--display);font-size:17px}
.book-restaurant .book-done-card{border:2px dashed var(--accent)}

/* ---------- plumbing: dispatch ticket (mono labels, pipeline, time windows) */
.book-plumbing{--bk-chip-r:6px}
.book-plumbing .book-progress{position:relative;gap:0;flex-wrap:nowrap;justify-content:space-between;border:0;padding:0;margin-bottom:36px}
.book-plumbing .book-progress::before{content:"";position:absolute;left:14px;right:14px;top:14px;height:1px;background:var(--line-strong)}
.book-plumbing .book-progress li{position:relative;flex-direction:column;align-items:flex-start;gap:8px;font:600 11px/1.3 var(--bk-mono);text-transform:uppercase;letter-spacing:.08em;flex:1}
.book-plumbing .book-progress li:last-child{align-items:flex-end;text-align:right}
.book-plumbing .book-progress b{background:var(--surface);border-radius:4px}
.book-plumbing .slot-day{border-radius:6px}.book-plumbing .slot-day strong{font-family:var(--bk-mono);font-size:20px}
.book-plumbing .slot-row{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
.book-plumbing .slot-time span{justify-content:flex-start;border-left:3px solid var(--accent);font-family:var(--bk-mono);font-size:14px}
.book-plumbing .book-aside-inner{font-family:var(--bk-mono);border-top:4px solid var(--accent);border-radius:6px}
.book-plumbing .aside-rows>div{border-top-style:dashed}
.book-plumbing .aside-rows dd{font-weight:500}

/* ---------- property: viewing/showing (day cards with "Open" tab, listing card) */
.book-property .slot-days{grid-auto-columns:minmax(96px,1fr)}
.book-property .slot-day{position:relative;padding-top:26px;min-height:112px}
.book-property .slot-day::before{content:"Open";position:absolute;top:0;left:0;right:0;padding:3px 0;font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;background:var(--surface-2,var(--line));color:var(--muted);border-radius:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0}
.book-property .slot-day[aria-pressed=true]::before{background:var(--accent-ink);color:var(--accent);opacity:.9}
.book-property .book-aside-inner{padding:0;overflow:hidden;background:var(--surface)}
.book-property .book-aside-inner::before{content:"";display:block;height:120px;background:linear-gradient(160deg,color-mix(in srgb,var(--accent) 70%,var(--surface)),color-mix(in srgb,var(--accent) 25%,var(--surface-2,var(--surface))))}
.book-property .book-aside-inner>*{margin-inline:24px}
.book-property .book-aside-inner>.eyebrow{margin-top:20px}
.book-property .book-aside-inner>:last-child{margin-bottom:24px}

/* ---------- medical: practice onboarding (aside left checklist, soft) */
.book-medical{--bk-r:20px}
.book-medical .book-shell{grid-template-columns:minmax(240px,300px) minmax(0,1fr)}
.book-medical .book-aside{order:-1}
.book-medical .book-progress{display:none}
.book-medical .slot-day,.book-medical .slot-time span{border-radius:14px}

/* ---------- homeservices: service call (arrival windows, job card) */
.book-homeservices{--bk-chip-r:10px}
.book-homeservices .slot-row{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
.book-homeservices .slot-time span{justify-content:flex-start;border-left:3px solid var(--accent)}
.book-homeservices .book-aside-inner{border-top:4px solid var(--accent)}

/* ---------- responsive */
@media (max-width:980px){
  .book-shell,.book-legal .book-shell,.book-medical .book-shell,.book-restaurant .book-shell{grid-template-columns:minmax(0,1fr)}
  .book-aside{position:static;order:0}
  .book-legal .book-aside,.book-medical .book-aside{order:0}
  .book-medical .book-progress{display:flex}
}
@media (max-width:640px){
  .field-grid,.done-facts{grid-template-columns:minmax(0,1fr)}
  .book-card,.book-done-card{padding:20px 18px}
  .book-progress{flex-wrap:nowrap;gap:8px}
  .book-progress li[data-for=done]{display:none}
  .book-progress li[aria-current=step]{min-width:0}
  .book-progress li[aria-current=step] span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .book-progress li:not([aria-current=step]) span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .book-restaurant .book-progress li{flex:0 0 auto;padding:8px 10px}
  .book-restaurant .book-progress li[aria-current=step]{flex:1 1 auto}
  .book-restaurant .book-progress li:not([aria-current=step]) b{display:inline-grid;border:0;background:none;min-width:0;height:auto;padding:0}
  .book-plumbing .book-progress li{font-size:10px}
  .book-nav{flex-direction:column-reverse}
  .book-nav .button{width:100%}
  .book-nav [data-next]{margin-left:0}
  .slot-row,.book-plumbing .slot-row,.book-homeservices .slot-row{grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}
  .book-plumbing .slot-row,.book-homeservices .slot-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .done-actions .button{flex:1 1 100%}
}
@media (prefers-reduced-motion:reduce){.slot-spinner{animation:none}}
.field-grid .field-wide{grid-column:1/-1}
