/* hårbor booking app — layout only; colours/controls come from the theme tokens + components. */
.hb-bk { min-height: 100dvh; background: var(--bg); color: var(--fg); font-family: var(--font-sans); }
.hb-bk__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px var(--gutter); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; background: var(--bg); }
.hb-bk__tools { display: flex; align-items: center; gap: 12px; }
.hb-bk__main { max-width: var(--container); margin: 0 auto; padding: 40px var(--gutter) 96px; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.hb-bk__col { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.hb-bk__aside { flex: 1 1 300px; max-width: 380px; position: sticky; top: 100px; }
.hb-bk__head { display: flex; flex-direction: column; gap: 8px; }
.hb-bk__head .hb-muted { font-size: 15px; line-height: 1.5; }
.hb-bk__stack { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hb-bk__stack-lg { display: flex; flex-direction: column; gap: 20px; align-items: stretch; }
.hb-bk__loading { padding: 80px var(--gutter); text-align: center; color: var(--fg-muted); }
.hb-over--line { padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.hb-bk .hb-service { cursor: pointer; }

.hb-bk__nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 8px; }
.hb-bk__nav-total { display: none; flex-direction: column; line-height: 1.1; }
.hb-bk__nav-spacer { flex: 1; }

.hb-barbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.hb-barber { align-items: stretch; }
.hb-barber .hb-bk__stack { gap: 4px; }

.hb-dt { display: flex; flex-wrap: wrap; gap: 40px; }
.hb-dt__cal { flex: 1 1 280px; max-width: 360px; }
.hb-dt__slots { flex: 1 1 240px; display: flex; flex-direction: column; gap: 20px; }
.hb-dt__date { font-weight: 700; font-size: 16px; }
.hb-slots__group { display: flex; flex-direction: column; gap: 10px; }
.hb-slots__label { font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.hb-slots__list { display: flex; flex-wrap: wrap; gap: 6px; }

.hb-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.hb-gift-row { display: flex; gap: 8px; align-items: flex-start; }
.hb-gift-row .hb-btn { margin-top: 23px; }
.hb-grow { flex: 1; }
.hb-bk__checks { display: flex; flex-direction: column; gap: 14px; }
.hb-captcha { min-height: 0; }

.hb-bk__confirm { max-width: var(--container-narrow); margin: 0 auto; padding: 64px var(--gutter) 96px; display: flex; flex-direction: column; gap: 32px; }
.hb-bk__tick { width: 48px; height: 48px; display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); border-radius: 2px; }
.hb-rebook { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.hb-cal-menu { position: relative; }
.hb-cal-menu summary { list-style: none; cursor: pointer; }
.hb-cal-menu summary::-webkit-details-marker { display: none; }
.hb-cal-menu__list { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; display: flex; flex-direction: column; min-width: 190px; padding: 6px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-2); box-shadow: var(--shadow-2); }
.hb-cal-menu__list .hb-btn { justify-content: flex-start; }

.hb-toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; max-width: calc(100vw - 32px); }
.hb-booking-root .hb-overlay { position: fixed; }

@media (max-width: 900px) {
  .hb-bk__main { padding-top: 24px; gap: 32px; }
  .hb-bk__aside { position: static; max-width: none; flex-basis: 100%; }
  .hb-bk__nav { position: sticky; bottom: 0; z-index: 4; background: var(--bg); border-top: 1px solid var(--border); margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); }
  .hb-bk__nav-total { display: flex; margin-right: auto; }
  .hb-bk__nav-spacer { display: none; }
  .hb-bk__header { padding: 14px var(--gutter); }
  .hb-bk__confirm { padding-top: 40px; }
}
@media (max-width: 480px) { .hb-bk__theme { display: none; } }

@media (max-width: 560px) {
  .hb-step:not(.hb-step--current) .hb-step__text { display: none; }
  .hb-step--current .hb-step__label { font-size: 11px; }
  .hb-bk .hb-steps { display: flex; } .hb-bk .hb-step { flex: 1 1 0; } .hb-bk .hb-step--current { flex: 0 0 auto; } /* current step is as wide as its label; the others share the rest */
}

/* ---------- Staff app ---------- */
.hb-staff__main { max-width: 1280px; margin: 0 auto; padding: 24px var(--gutter) 96px; }
.hb-staff__tabs { border-bottom: 1px solid var(--border); padding: 0 var(--gutter); overflow-x: auto; background: var(--bg); position: sticky; top: 61px; z-index: 4; }
.hb-staff__tabs .hb-tabs { border-bottom: 0; padding-top: 14px; min-width: max-content; }
.hb-staff__user { display: none; }
@media (min-width: 700px) { .hb-staff__user { display: inline; } }
.hb-sday__bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.hb-sday__nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hb-sday__title { font-size: 20px; letter-spacing: -0.01em; min-width: 0; }
.hb-sday__pick { width: 160px; }
.hb-scols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .hb-scols { grid-template-columns: 1fr; } }
.hb-scol { display: flex; flex-direction: column; gap: 10px; }
.hb-scol__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border-strong); }
.hb-scol__empty { padding: 12px 0; }
.hb-soff { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--bg-sunken); border-radius: var(--radius-2); font-size: 13px; color: var(--fg-muted); }
.hb-sb { display: flex; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-2); }
.hb-sb.is-dim { opacity: .55; }
.hb-sb__time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; min-width: 44px; line-height: 1.2; }
.hb-sb__time span { color: var(--fg-subtle); font-size: 12px; }
.hb-sb__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.hb-sb__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hb-sb__name { font-weight: 700; }
.hb-sb__note { font-size: 13px; background: var(--accent-soft); color: var(--fg); padding: 6px 10px; border-radius: var(--radius-1); }
.hb-sb__actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.hb-sweek { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.hb-sweek__day { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-2); cursor: pointer; color: var(--fg); font-family: var(--font-sans); text-align: left; }
.hb-sweek__day:hover { border-color: var(--fg); }
.hb-sweek__day strong { font-size: 26px; letter-spacing: -0.02em; }
.hb-sweek__dow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }
.hb-srow { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.hb-srow > div:first-child { flex: 1; min-width: 180px; }
.hb-srow.is-dim { opacity: .55; }
.hb-srow--btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; color: var(--fg); font-family: var(--font-sans); }
.hb-hours-ed__row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.hb-hours-ed__ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hb-hours-ed__r { display: inline-flex; gap: 4px; align-items: center; }
.hb-hours-ed__r .hb-input { width: 110px; height: 36px; padding: 0 8px; }
.hb-slog { max-height: 420px; overflow: auto; }
.hb-card--pad-md { padding: var(--space-5); }
select.hb-input { height: var(--control-md); }
@media (max-width: 560px) { .hb-hours-ed__row { grid-template-columns: 1fr; } .hb-staff__tabs { top: 53px; } }

/* a11y: pressed (not selected) buttons in segmented groups; readable step labels */
.hb-tabs--segmented .hb-tab[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.hb-step { color: var(--fg-muted); }
.hb-step--current { color: var(--fg); }
.hb-cal__dow { color: var(--fg-muted); }

/* ======================================================================
   13.0 tablet & touch · 13.1.5 motion · booking extensions · customer portal
   ====================================================================== */

/* No double-tap delay on anything tappable (pinch-zoom stays available on the public pages). */
.hb-booking-root :is(button, a, summary, label, input, select, textarea, [role="button"], [role="checkbox"]),
.hb-bk :is(button, a, summary, label, input, select, textarea, [role="button"], [role="checkbox"]) { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Overlay follows the visible viewport while the on-screen keyboard is open; safe areas respected. */
.hb-booking-root.is-open { height: var(--hb-vvh, auto); }
.hb-bk__header { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); padding-top: max(20px, env(safe-area-inset-top)); }
.hb-bk__main, .hb-bk__confirm { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.hb-bk__main { padding-bottom: max(96px, calc(48px + env(safe-area-inset-bottom))); }
.hb-booking-root .hb-overlay, .hb-bk .hb-overlay { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.hb-bk .hb-dialog { max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; }
.hb-bk input, .hb-bk textarea, .hb-bk select { font-size: max(16px, 1em); } /* iOS never zooms into a focused field */
.hb-bk .hb-input { scroll-margin: 120px 0 140px; }

/* Hover styles only where hover exists, so states never stick after a tap. */
@media (hover: none) {
  .hb-bk .hb-slot:hover:not([disabled]), .hb-bk .hb-day:hover:not([disabled]), .hb-bk .hb-tag:hover, .hb-bk .hb-barber:hover, .hb-bk .hb-service:hover .hb-service__toggle, .hb-bk .hb-input:hover { border-color: revert-layer; }
  .hb-bk .hb-slot:hover:not([disabled]):not([aria-pressed="true"]) { border-color: var(--border-strong); }
  .hb-bk .hb-day:hover:not([disabled]) { border-color: transparent; }
  .hb-bk .hb-tag:hover:not([aria-pressed="true"]) { border-color: var(--border-strong); }
  .hb-bk .hb-barber:hover:not([aria-pressed="true"]) { border-color: var(--border); }
  .hb-bk .hb-service:hover .hb-service__toggle { border-color: var(--border-strong); }
  .hb-bk .hb-service[aria-checked="true"]:hover .hb-service__toggle { border-color: var(--fg); }
  .hb-bk .hb-input:hover { border-color: var(--border-strong); }
}

/* Finger-sized targets (>= 44px with >= 8px between them) on touch devices. */
@media (pointer: coarse) {
  .hb-bk .hb-btn--sm { min-height: 44px; padding-left: 16px; padding-right: 16px; }
  .hb-bk .hb-iconbtn, .hb-bk .hb-iconbtn.hb-btn--sm { min-width: 44px; min-height: 44px; }
  .hb-bk .hb-slot { height: 48px; min-width: 80px; }
  .hb-bk .hb-slots__list { gap: 8px; }
  .hb-bk .hb-day { min-height: 44px; }
  .hb-bk .hb-cal__grid { gap: 6px; }
  .hb-bk .hb-tag { min-height: 44px; padding: 0 16px; }
  .hb-bk .hb-chips { gap: 8px; }
  .hb-bk .hb-check, .hb-bk .hb-switch { min-height: 44px; align-items: center; }
  .hb-bk .hb-check__box { width: 24px; height: 24px; }
  .hb-bk .hb-switch__track { width: 48px; height: 28px; }
  .hb-bk .hb-switch__thumb { width: 22px; height: 22px; }
  .hb-bk .hb-service { min-height: 64px; }
  .hb-bk .hb-bk__tools { gap: 12px; }
  .hb-bk .hb-tabs--segmented .hb-tab { min-height: 40px; }
  .hb-bk .hb-cal-menu__list .hb-btn { min-height: 48px; }
  .hb-bk__nav { gap: 12px; }
  .hb-bk__nav .hb-btn { min-height: 48px; }
}

/* Tablet widths: no wasted half-empty screens, no horizontal scroll. */
.hb-bk, .hb-bk__main, .hb-bk__col { max-width: 100%; }
.hb-bk { overflow-x: clip; }
@media (min-width: 601px) and (max-width: 900px) {
  .hb-bk__main { max-width: 760px; }
  .hb-bk__confirm { max-width: 720px; padding-top: 48px; }
  .hb-bk__aside .hb-card { max-width: none; }
  .hb-barbers { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .hb-bk__main { gap: 32px; }
  .hb-bk__col { flex-basis: 440px; }
  .hb-bk__aside { flex-basis: 280px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .hb-bk__header { padding-top: 10px; padding-bottom: 10px; position: static; }
  .hb-bk__main { padding-top: 16px; }
  .hb-bk__confirm { padding-top: 24px; gap: 20px; }
}
@media (max-width: 360px) { .hb-slot { min-width: 64px; } .hb-bk__nav .hb-btn { padding: 0 14px; } }
.hb-dt__cal { min-width: 0; }
@media (max-width: 700px) { .hb-dt { gap: 24px; } .hb-dt__cal { max-width: none; flex-basis: 100%; } }
.hb-gift-row { flex-wrap: wrap; }

/* ---- 13.1.5 motion: overlay in/out, step transitions, drawn check ---- */
@keyframes hb-bk-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes hb-bk-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px); } }
@keyframes hb-pane-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes hb-draw { to { stroke-dashoffset: 0; } }
@keyframes hb-pop { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }
.hb-booking-root.is-open > .hb-bk { animation: hb-bk-in var(--dur-3) var(--ease-out) both; }
.hb-booking-root.is-closing { pointer-events: none; }
.hb-booking-root.is-closing > .hb-bk { animation: hb-bk-out var(--dur-2) var(--ease-in-out) both; }
.hb-pane { display: flex; flex-direction: column; gap: 32px; animation: hb-pane-in var(--dur-2) var(--ease-out) both; }
.hb-drawcheck path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: hb-draw 420ms var(--ease-out) 180ms forwards; }
.hb-bk__tick { animation: hb-pop var(--dur-3) var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) {
  .hb-booking-root.is-open > .hb-bk, .hb-booking-root.is-closing > .hb-bk, .hb-pane, .hb-bk__tick { animation: none; }
  .hb-booking-root.is-closing > .hb-bk { opacity: 0; }
  .hb-drawcheck path { animation: none; stroke-dashoffset: 0; }
}

/* ---- form helpers ---- */
.hb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-stepper { display: inline-flex; align-items: center; gap: 12px; }
.hb-stepper__v { min-width: 2.5ch; text-align: center; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.hb-bk__extras { display: flex; flex-direction: column; gap: 16px; }
.hb-optlabel { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.hb-optlabel .hb-small { font-weight: 400; max-width: 46ch; }
.hb-switch { align-items: flex-start; }
.hb-party { display: flex; flex-direction: column; gap: 16px; padding: 16px 0 4px 16px; border-left: 2px solid var(--border); }
.hb-grouprow { gap: 16px; }
.hb-grouprow .hb-muted { text-align: right; }

/* ---- slots: off-peak marker, "next free" shortcuts, full days ---- */
.hb-slot { position: relative; }
.hb-slot--offpeak:not([disabled]) { padding-right: 8px; }
.hb-slot__off { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--accent-text); }
.hb-slot--later { min-width: 0; width: 100%; justify-content: flex-start; text-align: left; height: auto; min-height: 44px; padding: 10px 14px; }
.hb-slots__later { flex-direction: column; align-items: stretch; }
.hb-slot--waitlist { flex-direction: column; gap: 1px; min-height: 48px; border-style: dashed; color: var(--fg-muted); }
.hb-slot__waitlist { font-size: 10px; font-weight: 700; color: var(--accent-text); }
.hb-day--full:not([aria-pressed="true"]) { color: var(--fg-muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---- customer portal /my/ ---- */
.hb-portal { gap: 40px; }
.hb-portal__top { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; justify-content: space-between; }
.hb-portal__sec { display: flex; flex-direction: column; gap: 16px; }
.hb-portal__login { max-width: 520px; }
.hb-pbook { display: flex; flex-direction: column; gap: 16px; }
.hb-pbook.is-dim { opacity: .65; }
.hb-pbook__head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: flex-start; }
.hb-pbook__badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hb-actions { flex-wrap: wrap; gap: 8px; }
.hb-loyalty { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-loyalty__dot { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.hb-loyalty__dot.is-on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.hb-loyalty__dot.is-gift { border-color: var(--accent); color: var(--accent-text); }
.hb-link { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 480px) { .hb-portal__top .hb-actions { width: 100%; } .hb-portal__top .hb-actions .hb-btn { flex: 1 1 auto; } }
@media (max-width: 480px) {
  .hb-bk__nav { gap: 8px; }
  .hb-bk__nav .hb-btn { padding: 0 14px; white-space: nowrap; }
  .hb-bk__nav .hb-btn:last-child { flex: 1 1 auto; min-width: 0; }
  .hb-bk__nav .hb-btn--ghost { padding: 0 8px; }
}
