/* Slotbook. A calendar app a workshop opens every morning: white sheets on a
   cool stone canvas, Geist and Geist Mono, ink controls, and one colour per
   service so a day reads at a glance. */
:root {
  --canvas: #eff1ed;
  --sheet: #ffffff;
  --sheet-2: #f7f8f5;
  --ink: #15171a;
  --ink-2: #3a3e45;
  --muted: #646a72;
  --faint: #9aa0a6;
  --line: #e2e5df;
  --line-2: #cdd2ca;
  --shut: #edefea;
  --now: #c0355f;
  --ok: #14866d;
  --bad: #c43c3c;
  --tone: #14866d;
  --rh: 44px;
  --drh: 24px;
  --gutter: 16px;
  --r: 14px;
  --sans: 'Geist', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --shadow: 0 1px 2px rgba(21, 23, 26, .05), 0 8px 24px -12px rgba(21, 23, 26, .14);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 16px/1.5 var(--sans); }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono, .t, .dcount, .bk-time, .svc-meta { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[tabindex="-1"]:focus-visible { outline: none; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 30; background: var(--ink); color: #fff; padding: 12px 16px; min-height: 44px; border-radius: 10px; }
.skip:focus { top: 8px; }

/* ---------- app bar ---------- */
.top { background: var(--sheet); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1680px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark { width: 36px; height: 36px; flex: none; color: var(--ink); }
.brand-name { font-weight: 600; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; }
.brand-sub { font-size: 13px; color: var(--muted); }
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.tabs [role="tab"] { position: relative; z-index: 1; min-height: 44px; padding: 0 18px; border: 0; background: transparent; border-radius: 9px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .15s ease; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); font-weight: 600; }
.tabs [role="tab"]:hover { color: var(--ink); }
.tab-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: var(--sheet); border-radius: 9px; box-shadow: 0 1px 2px rgba(21, 23, 26, .1), 0 2px 8px -2px rgba(21, 23, 26, .12); transition: transform .28s cubic-bezier(.3, .7, .2, 1); }
.tabs[data-on="staff"] .tab-thumb { transform: translateX(100%); }

.intro { max-width: 1680px; margin: 0 auto; padding: 14px var(--gutter) 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 32px; }
.intro-lead { max-width: 78ch; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.sample-note { font-size: 13px; color: var(--muted); max-width: 62ch; }.tag { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .02em; border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; margin-right: 6px; line-height: 18px; vertical-align: 1px; }

main { max-width: 1680px; margin: 0 auto; padding: 14px var(--gutter) 64px; }
.page-title { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; margin-bottom: 14px; }

/* ---------- booking layout ---------- */
.book { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.side { display: grid; gap: 16px; min-width: 0; }
.step, .hours, .ticket { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.step-h { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.num { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--ink); color: #fff; font: 600 12px/1 var(--mono); }
.small-h { font: 500 11px/1.4 var(--mono); color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .08em; }
.services .page-title { margin-bottom: 16px; }

@media (min-width: 760px) {
  .book { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .side { grid-row: 1 / span 2; }
  .times { grid-column: 2; }
  .ticket-col { grid-column: 2; }
}
/* Wide screens: the services run across the top as one row of cards, so the
   month and the day timeline sit side by side on the first screen. */
@media (min-width: 1100px) {
  .book { grid-template-columns: minmax(0, 360px) minmax(0, 1fr) minmax(0, 380px); gap: 20px; }
  .side { display: contents; }
  .services { grid-column: 1 / 3; grid-row: 1; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 24px; }
  .services .page-title { margin: 0 0 14px; }
  .services .step-h { justify-self: end; margin-bottom: 14px; }
  .service-list { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ticket-col .perks { display: block; }
  .when { grid-column: 1; grid-row: 2; }
  .hours { grid-column: 1; grid-row: 3; }
  .times { grid-column: 2; grid-row: 2 / span 2; }
  .ticket-col { grid-column: 3; grid-row: 1 / span 3; position: sticky; top: 80px; }
}

/* ---------- services ---------- */
.service-list { display: grid; gap: 6px; }
.svc { --tw: color-mix(in srgb, var(--tone) 9%, white); display: grid; grid-template-columns: 20px 12px minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; padding: 11px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.svc:hover { border-color: var(--line-2); background: var(--sheet-2); }
.svc:active { transform: scale(.99); }
.svc input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--tone); }
.svc-block { width: 10px; height: calc(var(--len) * 6px); min-height: 7px; border-radius: 3px; background: var(--tone); margin-top: 3px; opacity: .85; }
.svc:has(input:checked) { border-color: var(--tone); background: var(--tw); }
.svc:has(input:checked) .svc-block { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 22%, transparent); }
.svc:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.svc input:focus-visible { outline: none; }
.svc-name { display: block; font-weight: 600; line-height: 1.3; }
.svc-blurb { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; margin-top: 1px; }
.svc-meta { display: grid; justify-items: end; font-size: 12px; color: var(--ink-2); line-height: 1.6; white-space: nowrap; }
@media (min-width: 1340px) {
  .service-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .svc { grid-template-columns: 20px 12px minmax(0, 1fr); align-content: start; padding: 12px; }
  .svc-meta { grid-column: 3; display: flex; gap: 14px; margin-top: 8px; font-size: 13px; }
}

/* What the page already handles, beside the ticket on wide screens. */
.perks { display: none; margin-top: 16px; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.perks h2 { font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.perks ul { list-style: none; padding: 0; display: grid; gap: 0; }
.perks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.perks li:last-child { border-bottom: 0; }
.perks li::before { content: ''; width: 10px; height: 10px; margin-top: 5px; border-radius: 3px; background: var(--tone, var(--ok)); opacity: .8; }
.perks b { color: var(--ink); font-weight: 600; }
.ticket-col:has(#details:not([hidden])) .perks { display: none; }

/* ---------- hours ---------- */
.hours { padding: 0; }
.hours summary { list-style: none; cursor: pointer; padding: 14px 16px; min-height: 44px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-radius: var(--r); }
.hours summary::-webkit-details-marker { display: none; }
.hours summary::after { content: ''; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; }
.hours[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.hours-in { padding: 0 16px 14px; }
.hours .nw { white-space: nowrap; }
.hours-in .small-h:first-child { margin-top: 0; }
.hours dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.hours dt { font-weight: 500; }
.hours dd { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--ink-2); }
.changes { list-style: none; padding: 0; font-size: 13px; }
.changes li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.changes .mono { font-size: 12px; color: var(--now); font-weight: 500; margin-right: 6px; }

/* ---------- month ---------- */
.when-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; }
.when-head .step-h { margin-bottom: 0; }
.zone { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; }
.zone select { min-height: 44px; min-width: 0; max-width: 190px; font-size: 13px; padding: 4px 26px 4px 8px; }
select, input, textarea { background: var(--sheet); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font-size: 16px; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 23, 26, .12); }
.zone-note { font-size: 13px; color: var(--ink-2); background: var(--sheet-2); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.cal-title { font-size: 15px; font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 1px solid transparent; background: transparent; border-radius: 10px; cursor: pointer; color: var(--ink); transition: background-color .15s ease; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover:not(:disabled) { background: var(--canvas); }
.icon-btn:disabled { color: var(--faint); cursor: not-allowed; opacity: .5; }
.icon-btn.sm { width: 44px; height: 44px; border-color: var(--line); }
.cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; }
.cal th { font: 500 11px/1 var(--mono); color: var(--muted); padding: 6px 0; text-align: center; }
.cal td { height: 46px; min-width: 0; padding: 0; text-align: center; vertical-align: middle; border-radius: 10px; }
.cal td.day { cursor: pointer; position: relative; transition: background-color .12s ease; }
.cal td.day:focus-visible { outline-offset: -2px; }
.dnum { display: block; font-size: 15px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dcount { display: block; font-size: 10px; line-height: 1.3; color: var(--muted); }
.dbar { position: absolute; left: 30%; right: 30%; bottom: 5px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.dbar::after { content: ''; position: absolute; inset: 0; background: var(--tone); transform-origin: left; transform: scaleX(var(--f)); }
.cal td.open .dnum { font-weight: 600; }
.cal td.open:hover { background: var(--canvas); }
.cal td.none { color: var(--faint); cursor: default; }
.cal td.today .dnum { color: var(--now); }
.cal td.override:not([aria-selected="true"])::before { content: ''; position: absolute; top: 5px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--now); }
.cal td[aria-selected="true"] { background: var(--ink); color: #fff; }
.cal td[aria-selected="true"] .dnum, .cal td[aria-selected="true"] .dcount { color: #fff; }
.cal td[aria-selected="true"] .dbar { background: rgba(255, 255, 255, .25); }
.cal td[aria-selected="true"] .dbar::after { background: #fff; }
.cal td[aria-selected="true"]:focus-visible { outline-color: var(--tone); outline-offset: 1px; }
.cal-help { font-size: 12px; color: var(--muted); padding: 6px 2px 0; }

/* ---------- day timeline ---------- */
.times-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.times-head .step-h { margin-bottom: 0; }
.day-step { display: flex; gap: 6px; }
.times-for { margin: 10px 0 4px; min-height: 22px; }
.times-for strong { font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.times-for .muted { font-size: 13px; margin-left: 4px; }
.tl-help { font-size: 13px; color: var(--muted); margin-bottom: 10px; max-width: 60ch; }
.tl { position: relative; display: grid; grid-template-rows: repeat(var(--rows), var(--rh)); border-top: 1px solid var(--line); }
.row { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 12px 0 0; border: 0; border-bottom: 1px dashed var(--line); background: transparent; text-align: left; }
.row.hour { border-top: 0; }
.row .t { flex: none; width: 64px; padding-left: 4px; font-size: 12px; color: var(--muted); }
.row.off .t { color: var(--faint); }
.row.closed { background: var(--shut); border-bottom-color: transparent; }
.row.closed .t { color: var(--faint); }
.gap { font-size: 12px; color: var(--muted); }
.slot { cursor: pointer; border-radius: 0; transition: background-color .12s ease; min-height: 0; }
.slot .t { color: var(--ink); font-weight: 600; font-size: 13px; }
.slot .off { font-size: 10px; font-weight: 500; margin-left: 4px; color: var(--muted); }
.slot .shop { font-size: 12px; color: var(--muted); }
.slot .go { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--tone); opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease; position: relative; z-index: 2; }
.slot:hover { background: color-mix(in srgb, var(--tone) 6%, white); }
.slot:hover .go, .slot:focus-visible .go { opacity: 1; transform: none; }
.slot:focus-visible { outline-offset: -2px; z-index: 3; }
.slot[aria-pressed="true"] .go { opacity: 0; }
.layer { position: absolute; inset: 0 0 0 72px; pointer-events: none; }
.tl .blk { position: absolute; left: 4px; right: 4px; top: calc(var(--k) * var(--rh) + 2px); height: calc(var(--n) * var(--rh) - 4px); border-radius: 10px; padding: 6px 10px; font-size: 12px; line-height: 1.3; overflow: hidden; }
.tl .busy { background: #e6e8e3; color: var(--muted); border: 1px solid #dadcd6; z-index: 1; }
.tl .ghost { border: 1.5px dashed var(--tone); background: color-mix(in srgb, var(--tone) 9%, transparent); z-index: 1; transition: top .12s ease; }
.tl .mine { pointer-events: auto; cursor: grab; touch-action: none; user-select: none; z-index: 4; background: var(--tone); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 10px 24px -10px color-mix(in srgb, var(--tone) 70%, black); display: flex; flex-direction: column; gap: 1px; transition: top .18s cubic-bezier(.3, .7, .2, 1), transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.tl .mine b { font: 600 13px/1.3 var(--mono); }
.tl .mine span { opacity: .9; }
.tl .mine.lift { cursor: grabbing; transform: scale(1.02); box-shadow: 0 18px 36px -14px rgba(0, 0, 0, .45); transition: top .06s linear, transform .15s ease; }
.tl .mine.bad { background: var(--faint); }
.tl .mine.drop { animation: drop .42s cubic-bezier(.25, .9, .3, 1.25); }
@keyframes drop { from { transform: translateY(-18px) scale(1.04); opacity: .4; box-shadow: 0 24px 40px -16px rgba(0, 0, 0, .4); } }

.soonest { padding: 18px; margin-top: 12px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 7%, white); border: 1px solid color-mix(in srgb, var(--tone) 25%, white); }
.soonest-label { font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tone); }
.soonest-when { margin: 6px 0 2px; font-size: 20px; letter-spacing: -.01em; }
.soonest-when .mono { margin-left: 6px; }
.soonest .muted { margin: 0 0 14px; font-size: 13px; }
.none-msg { color: var(--muted); margin: 12px 0; }

/* ---------- ticket ---------- */
.ticket { padding: 0; overflow: hidden; container-type: inline-size; }
.ticket-top { padding: 16px; border-top: 4px solid var(--tone); transition: border-color .2s ease; }
.ticket-k { font: 500 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ticket-steps { list-style: none; padding: 0; display: grid; gap: 0; }
.ticket-steps li { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.ticket-steps li:last-child { border-bottom: 0; }
.ticket-steps .tk { grid-row: 1 / span 2; font-size: 12px; color: var(--muted); padding-top: 2px; display: flex; align-items: center; gap: 6px; }
.ticket-steps .tk::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; transition: background-color .2s ease, border-color .2s ease; }
.ticket-steps .is-done .tk::before { background: var(--tone); border-color: var(--tone); }
.ticket-steps .tv { font-weight: 600; }
.ticket-steps li:not(.is-done) .tv { color: var(--faint); font-weight: 500; }
.ticket-steps .ts { font-size: 12px; color: var(--muted); }
.details { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: var(--sheet-2); scroll-margin-top: 90px; }
.summary dl, .done dl { display: grid; margin-bottom: 14px; }
.summary dl div, .done dl div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary dt, .done dt { font-size: 12px; color: var(--muted); padding-top: 2px; }
.summary { display: none; }
.fields { display: grid; gap: 12px 14px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 520px) { .fields { grid-template-columns: 1fr 1fr; } .field.wide { grid-column: 1 / -1; } }
.field label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.field .opt { font-weight: 400; font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; }
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(196, 60, 60, .12); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.err { font-size: 13px; color: var(--bad); font-weight: 500; margin-top: 4px; }
.err:empty { display: none; }
.errors { border: 1px solid rgba(196, 60, 60, .35); background: #fbf0ef; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.errors h3 { font-size: 15px; margin-bottom: 4px; }
.errors ul { padding-left: 18px; }
.errors a { color: var(--bad); font-weight: 500; display: inline-block; padding: 4px 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 11px; border: 1px solid transparent; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn.primary { background: var(--ink); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 6px 14px -8px rgba(21, 23, 26, .6); }
.btn.primary:hover { background: #2a2e34; }
.btn.line { background: var(--sheet); border-color: var(--line-2); color: var(--ink); }
.btn.line:hover { border-color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }

/* ---------- confirmation stub ---------- */
.done { max-width: 820px; margin: 24px auto 0; }
.stub { --tone: #14866d; display: grid; grid-template-columns: minmax(0, 1fr) 0 200px; background: var(--sheet); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(21, 23, 26, .35); overflow: hidden; }
.stub-main { padding: 24px; min-width: 0; }
.stub h2 { font-size: 28px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 14px; }
.stub-tear { position: relative; border-left: 2px dashed var(--line-2); }
.stub-tear::before, .stub-tear::after { content: ''; position: absolute; left: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--canvas); }
.stub-tear::before { top: -12px; }
.stub-tear::after { bottom: -12px; }
.stub-side { background: var(--tone); color: #fff; padding: 24px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.stub-wd { font: 500 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.stub-d { font-size: 72px; font-weight: 600; line-height: .95; letter-spacing: -.04em; }
.stub-m { font-size: 16px; font-weight: 500; }
.stub-t { font: 600 26px/1.2 var(--mono); margin-top: 14px; }
.stub-side .ref { margin-top: auto; padding-top: 18px; font-size: 12px; opacity: .9; }
.stub-side .ref .mono { display: block; font-size: 16px; font-weight: 600; }
.stub.print { animation: print .9s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes print { from { clip-path: inset(0 0 100% 0 round 18px); transform: translateY(-10px); } to { clip-path: inset(0 0 0 0 round 18px); transform: none; } }
.done .form-actions { margin-top: 20px; }
.fine { font-size: 12px; color: var(--muted); margin-top: 12px; }
@media (max-width: 600px) {
  .stub { grid-template-columns: minmax(0, 1fr); }
  .stub-tear { border-left: 0; border-top: 2px dashed var(--line-2); height: 0; }
  .stub-tear::before, .stub-tear::after { top: -12px; bottom: auto; }
  .stub-tear::before { left: -12px; }
  .stub-tear::after { left: auto; right: -12px; }
  .stub-side { order: 3; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .stub-d { font-size: 44px; }
  .stub-t { margin-top: 0; font-size: 22px; }
  .stub-side .ref { width: 100%; margin-top: 4px; padding-top: 8px; }
  .stub-main { padding: 20px 16px; }
  .stub h2 { font-size: 23px; }
}

/* ---------- diary ---------- */
.staff-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 20px; margin-bottom: 14px; }
.staff-head .page-title { margin-bottom: 4px; }
.staff-sub { font-size: 14px; color: var(--muted); max-width: 62ch; }
.day-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.day-nav .icon-btn { border-color: var(--line); background: var(--sheet); }
.staff-date { font-weight: 600; font-size: 15px; min-width: 170px; text-align: center; }
.diary-wrap { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .diary-wrap { grid-template-columns: minmax(0, 1fr) 340px; } }
.diary { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.dg-head, .dg-body { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); }
.dg-head { border-bottom: 1px solid var(--line); background: var(--sheet); }
.dg-corner { display: grid; place-items: end center; font: 500 9px/1 var(--mono); color: var(--faint); padding-bottom: 8px; }
.dh { display: grid; justify-items: center; gap: 0; padding: 8px 4px; min-height: 58px; border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; transition: background-color .15s ease; }
.dh:hover { background: var(--sheet-2); }
.dh-wd { font: 500 11px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dh-d { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dh.today .dh-d { color: var(--now); }
.dh.on .dh-d { background: var(--ink); color: #fff; }
.dh-note { font-size: 10px; color: var(--now); line-height: 1.2; }
.dg-body { position: relative; height: calc(var(--rows) * var(--drh)); }
.dg-gutter { position: relative; }
.dg-gutter span { position: absolute; right: 8px; top: calc(var(--k) * var(--drh)); transform: translateY(-50%); font: 500 10px/1 var(--mono); color: var(--muted); }
.dg-gutter span:first-child { transform: translateY(2px); }
.col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line), var(--line)), linear-gradient(#f0f2ee, #f0f2ee); background-size: 100% 1px, 100% 1px; background-repeat: repeat-y; background-position: 0 0, 0 var(--drh); background-size: 100% 1px, 100% 1px; }
.col { background: none; }
.col::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(var(--drh) * 2)); opacity: .9; }
.col.on { background: color-mix(in srgb, var(--ink) 2.5%, white); }
.shut { position: absolute; left: 0; right: 0; top: calc(var(--k) * var(--drh)); height: calc(var(--n) * var(--drh)); background: var(--shut); }
.now { position: absolute; left: -1px; right: 0; top: calc(var(--k) * var(--drh)); height: 2px; background: var(--now); z-index: 3; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--now); }
.diary .blk { position: absolute; z-index: 2; left: 3px; right: 3px; top: calc(var(--k) * var(--drh) + 1px); height: calc(var(--n) * var(--drh) - 2px); display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 3px 6px 3px 8px; border: 0; border-radius: 7px; background: color-mix(in srgb, var(--tone) 14%, white); box-shadow: inset 3px 0 0 var(--tone); color: var(--ink); text-align: left; font-size: 11px; line-height: 1.3; overflow: hidden; cursor: grab; touch-action: none; user-select: none; transition: box-shadow .15s ease, background-color .15s ease; }
.diary .blk:hover { background: color-mix(in srgb, var(--tone) 22%, white); }
.diary .blk b { font: 600 11px/1.3 var(--mono); color: color-mix(in srgb, var(--tone) 70%, black); }
.diary .blk .bs { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.diary .blk .bn { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.diary .blk.short { flex-direction: row; align-items: center; gap: 6px; }
.diary .blk.short .bn { display: none; }
.diary .blk.cancelled { cursor: default; opacity: .55; box-shadow: inset 3px 0 0 var(--faint); background: var(--sheet-2); text-decoration: line-through; }
.diary .blk.lift { z-index: 6; cursor: grabbing; box-shadow: inset 3px 0 0 var(--tone), 0 18px 34px -14px rgba(21, 23, 26, .5); background: color-mix(in srgb, var(--tone) 22%, white); }
.diary .blk:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 5; }
.diary .blk.settle { animation: settle .45s cubic-bezier(.25, .9, .3, 1.3); }
@keyframes settle { from { transform: scale(1.06); box-shadow: inset 3px 0 0 var(--tone), 0 16px 30px -12px rgba(21, 23, 26, .45); } }
body.dragging { cursor: grabbing; user-select: none; }
.dg .drop { position: absolute; z-index: 4; top: calc(var(--k) * var(--drh)); height: calc(var(--n) * var(--drh)); padding: 3px; pointer-events: none; }
.dg .drop::before { content: ''; position: absolute; inset: 1px 3px; border: 2px dashed var(--tone); border-radius: 7px; background: color-mix(in srgb, var(--tone) 10%, transparent); }
.dg .drop b { position: relative; display: inline-block; margin: 2px 0 0 6px; padding: 1px 6px; border-radius: 6px; background: var(--ink); color: #fff; font: 600 10px/1.5 var(--mono); }
.dg .drop.bad::before { border-color: var(--bad); background: rgba(196, 60, 60, .08); }
.dg .drop.bad b { background: var(--bad); }

.agenda { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.agenda-h { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.staff-hours { font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.agenda .fine { margin: 2px 0 12px; }
.bookings { list-style: none; padding: 0; display: grid; gap: 8px; }
.bk { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 12px; align-items: start; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; box-shadow: inset 3px 0 0 var(--tone); transition: background-color .4s ease; }
.bk.hl { background: color-mix(in srgb, var(--tone) 10%, white); }
.bk-time { font-weight: 600; font-size: 14px; line-height: 1.3; }
.bk-time span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.bk-svc { font-weight: 600; }
.bk p { overflow-wrap: anywhere; font-size: 13px; }
.bk .muted { font-size: 12px; }
.bk-act { grid-column: 1 / -1; display: grid; justify-items: end; gap: 6px; }
.bk.cancelled { color: var(--muted); box-shadow: inset 3px 0 0 var(--faint); }
.bk.cancelled .bk-svc { text-decoration: line-through; }
.bk.cancelled .tag { text-decoration: none; }
.confirm-q { font-weight: 600; font-size: 13px; }
.confirm-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty { color: var(--muted); padding: 12px 0; font-size: 14px; }
.reset { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 40; left: 50%; bottom: 20px; transform: translate(-50%, 16px); opacity: 0; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 16px; background: var(--ink); color: #fff; border-radius: 12px; font-size: 14px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5); transition: opacity .2s ease, transform .25s cubic-bezier(.3, .7, .2, 1); }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast-act { min-height: 36px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 9px; background: transparent; color: #fff; font-weight: 600; cursor: pointer; flex: none; }
.toast-act:hover { background: rgba(255, 255, 255, .1); }
.toast-act:focus-visible { outline-color: #fff; }

/* ---------- small screens ---------- */
@media (max-width: 759px) {
  :root { --rh: 46px; }
  .top-inner { padding-block: 8px; }
  .tabs { width: 100%; }
  .brand-sub { display: none; }
  .page-title { font-size: 23px; }
  .ticket-col { order: 3; }
  .staff-date { min-width: 0; flex: 1; }
  .day-nav { width: 100%; }
}
@media (max-width: 360px) {
  .step { padding: 14px 10px; }
  .cal { border-spacing: 1px; }
  .zone select { max-width: 150px; }
  .row .t { width: 54px; }
  .layer { left: 60px; }
}
@media (min-width: 2000px) {
  body { font-size: 17px; }
  :root { --rh: 44px; --drh: 28px; }
  main, .top-inner, .intro { max-width: 1840px; }
  .book { grid-template-columns: minmax(0, 380px) minmax(0, 1fr) minmax(0, 440px); gap: 28px; }
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--sheet); }
.foot-in { max-width: 1680px; margin: 0 auto; padding: 8px var(--gutter) 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; font-size: 14px; color: var(--muted); }
.foot-in > span { padding: 12px 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: .25em; overflow-wrap: anywhere; }
.foot a:hover { text-decoration-color: currentColor; }

/* ---------- room for what the script fills in, so nothing below jumps when it runs ---------- */
#services:empty { min-height: 459px; }
#ticket-steps:empty { min-height: 146px; }
.cal-wrap:has(#cal-body:empty) { min-height: 350px; }
#slots:empty { min-height: 172px; }
@media (min-width: 760px) { #services:empty { min-height: 378px; } #slots:empty { min-height: 793px; } }
@media (min-width: 1100px) { #services:empty { min-height: 176px; } }
@media (min-width: 1340px) { #services:empty { min-height: 139px; } }

/* ---------- QA pass: touch, phones and the folded cover ---------- */
.intro-lead { max-width: 62ch; }
.ticket-steps li:not(.is-done) .tv { color: var(--muted); }
@media (min-width: 1340px) {
  .svc-meta { flex-wrap: wrap; gap: 0 14px; white-space: normal; }
  .svc-meta span { white-space: nowrap; }
}
/* touch: a 30 minute booking in the diary is a 44px target */
@media (max-width: 1023px), (pointer: coarse) {
  :root { --drh: 46px; }
  .btn.sm, .toast-act { min-height: 44px; }
}
.dg-corner { color: var(--muted); font-size: 10px; }
.row.off .t { color: #6c7279; }
.row.closed .t { color: var(--muted); }
@media (max-width: 759px) {
  .sample-note, .cal-help, .fine, .hint, .tl-help, .zone-note, .staff-sub, .err, .empty, .soonest .muted, .bk p, .changes, .hours dl div { font-size: 15px; }
  .changes .mono, .hours dd { font-size: 13px; }
  .zone select { font-size: 16px; }
}
@media (max-width: 420px) {
  .zone { width: 100%; }
  .zone select { flex: 1; max-width: none; }
  .cal { border-spacing: 0; }
  .when .cal { margin: 0 -8px; width: calc(100% + 16px); }
  .svc { grid-template-columns: 20px 12px minmax(0, 1fr); }
  .svc-meta { grid-column: 3; display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: 4px; }
}
@media (max-width: 360px) {
  .tabs [role="tab"] { padding: 0 8px; white-space: normal; line-height: 1.2; }
  .zone { flex-wrap: wrap; }
  .zone label { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
