/* ============================================================
   claws by ash - booking + admin
   Loaded only by book.html and admin.html. Uses the tokens in
   site.css; defines nothing the content pages care about.
   ============================================================ */

/* The two strong curves from the animate skill, scoped to booking so the
   site-wide --ease the content pages are tuned to stays as it is. */
:root {
  --bk-move: cubic-bezier(0.77, 0, 0.175, 1);   /* moving on screen */
  --bk-out:  cubic-bezier(0.23, 1, 0.32, 1);    /* entering */
}

/* Any class that sets display (.bk-qr is grid, .bk-thumb is flex) beats the
   hidden attribute, which is how the QR frame showed as a broken image before
   a QR file existed. This puts hidden back on top for every booking element. */
[hidden] { display: none !important; }

/* ---------- shared form furniture ---------- */
.bk-field { display: grid; gap: .45rem; margin-bottom: 1.15rem; }
.bk-field > label, .bk-legend {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .01em;
}
.bk-hint { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }

.bk-input, .bk-select, .bk-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  padding: .72rem .85rem;
  font-size: var(--fs-md);
  min-height: 46px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.bk-textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
/* iPhone Safari gives date and time boxes a built-in minimum width that ignores
   width:100%, so two side by side ran past the card and over each other, and a
   time box slid under its "Add time" button. Dropping the native look lets them
   shrink to the column like every other box; the picker still opens on tap. */
.bk-input[type="date"], .bk-input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  min-width: 0;
  max-width: 100%;
  line-height: 1.3;
}
.bk-input::-webkit-date-and-time-value { text-align: left; min-height: 1.3em; }
.bk-input::-webkit-datetime-edit { padding: 0; }
.bk-field { min-width: 0; }
/* iPhone Safari zooms the whole page into any box with text under 16px when it
   is tapped, which pushed the dashboard sideways off the screen. */
@media (hover: none) {
  .bk-input, .bk-select, .bk-textarea { font-size: max(16px, var(--fs-md)); }
}
.bk-input:hover, .bk-select:hover, .bk-textarea:hover { border-color: var(--line); }
.bk-input:focus-visible, .bk-select:focus-visible, .bk-textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.bk-input::placeholder, .bk-textarea::placeholder { color: var(--ink-3); opacity: 1; }
.bk-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: right 1.05rem center, right .75rem center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}
.bk-input[aria-invalid="true"], .bk-select[aria-invalid="true"] { border-color: #E2707A; }
.bk-err { font-size: var(--fs-xs); color: #F09AA2; }

/* ---------- step chrome ---------- */
.bk-steps {
  display: flex; flex-wrap: wrap; gap: .4rem 1.1rem;
  margin-bottom: 2.4rem; padding: 0; list-style: none;
  font-size: var(--fs-xs); color: var(--ink-3);
}
/* Counted on the li, not its ::before: Safari stops counting a pseudo-element
   whose content is swapped for the tick, so the next step showed "1 Slot". */
.bk-steps li { display: flex; align-items: center; gap: .45rem; counter-increment: bk-step; }
.bk-steps li::before {
  content: counter(bk-step);
  display: grid; place-items: center;
  width: 22px; height: 22px; flex: 0 0 22px;
  border: 1px solid var(--line); border-radius: 50%;
  font-size: 11px; font-weight: 700;
}
.bk-steps { counter-reset: bk-step; }
.bk-steps li[data-on] { color: var(--ink); }
.bk-steps li[data-on]::before { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.bk-steps li[data-done]::before {
  content: '✓'; background: var(--brand-soft); border-color: var(--brand); color: var(--brand);
}
.bk-stepbtn {
  background: none; border: 0; padding: .55rem 0; min-height: 44px;
  color: inherit; font: inherit; cursor: pointer;
}
.bk-stepbtn:disabled { cursor: default; }
.bk-stepbtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
@media (hover: hover) and (pointer: fine) {
  .bk-stepbtn:not(:disabled):hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
}

.bk-step { display: none; }
.bk-step[data-active] { display: block; animation: bk-fwd .28s var(--bk-out) both; }
.bk-step[data-active][data-dir="back"] { animation-name: bk-back; }
.bk-step[data-active][data-dir="none"] { animation: none; }
@keyframes bk-fwd  { from { opacity: 0; transform: translateX(18px); } }
@keyframes bk-back { from { opacity: 0; transform: translateX(-18px); } }
@keyframes bk-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bk-step[data-active], .bk-step[data-active][data-dir="back"] { animation-name: bk-fade; }
}

/* Progress: one bar that fills as the steps go by. scaleX, not width. */
.bk-progress { height: 2px; margin: -1.5rem 0 2.4rem; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.bk-progress-fill {
  display: block; height: 100%; background: var(--brand);
  transform: scaleX(.25); transform-origin: left center;
  transition: transform .3s var(--bk-move);
}
@media (prefers-reduced-motion: reduce) { .bk-progress-fill { transition: none; } }

.bk-h { font-size: clamp(1.45rem, 1.2rem + 1.2vw, 1.95rem); line-height: 1.18; letter-spacing: -.02em; }
.bk-sub { color: var(--ink-2); font-size: var(--fs-md); margin-top: .55rem; max-width: 52ch; }

.bk-actions {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid var(--line-2);
}
.bk-actions .bk-spacer { margin-left: auto; }
.bk-pick { font-size: var(--fs-sm); color: var(--ink-2); }
.bk-pick b { color: var(--ink); }
.bk-pick-g { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
@media (max-width: 899px) {
  .bk-actions-sticky {
    position: sticky; bottom: 0; z-index: 6; flex-wrap: nowrap;
    margin-inline: calc(-1 * var(--gutter));
    padding: .8rem var(--gutter) calc(.8rem + env(safe-area-inset-bottom));
    background: rgba(11, 14, 20, .94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
}

/* ---------- choice cards ---------- */
.bk-group { margin-bottom: 1.9rem; }
.bk-group-h { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
.bk-group-p { color: var(--ink-3); font-size: var(--fs-sm); margin-top: .25rem; }
.bk-opts { display: grid; gap: .6rem; margin-top: .95rem; }

.bk-opt { position: relative; display: block; cursor: pointer; }
.bk-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.bk-opt-in {
  display: flex; align-items: center; gap: .9rem;
  min-height: 56px; padding: .8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color .17s var(--ease), background .17s var(--ease), transform .17s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .bk-opt:hover .bk-opt-in { border-color: var(--brand); }
}
.bk-opt:active .bk-opt-in { transform: scale(.985); }
.bk-opt input:focus-visible + .bk-opt-in { outline: 2px solid var(--brand); outline-offset: 2px; }
.bk-opt input:checked + .bk-opt-in { border-color: var(--brand); background: var(--brand-soft); }
.bk-dot {
  flex: 0 0 18px; width: 18px; height: 18px; display: grid; place-items: center;
  border: 1px solid var(--ink-3); border-radius: 50%;
  transition: border-color .18s ease;
}
.bk-dot::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  transform: scale(0.4); opacity: 0;
  transition: transform .22s var(--bk-out), opacity .15s ease;
}
.bk-opt input:checked + .bk-opt-in .bk-dot { border-color: var(--brand); }
.bk-opt input:checked + .bk-opt-in .bk-dot::after { transform: none; opacity: 1; }

/* Removal: three tap-cards instead of a dropdown. */
.bk-fieldset { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.bk-fieldset > legend { padding: 0; margin-bottom: .45rem; }
.bk-chips { display: grid; gap: .6rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .bk-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bk-chip .bk-opt-in { min-height: 52px; }
.bk-chip .bk-opt-label { font-size: var(--fs-sm); }
.bk-chip .bk-opt-price { font-size: var(--fs-sm); }
.bk-opt-label { flex: 1; font-size: var(--fs-md); }
.bk-opt-price { font-size: var(--fs-md); font-weight: 700; color: var(--brand); white-space: nowrap; }
.bk-opt-price small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- slot picker ---------- */
/* A day strip over a time grid. The two strong curves are from the animate
   skill, scoped to the picker so the site-wide --ease the other pages are
   tuned to stays as it is. Motion is transform and opacity only. */
.sp {
  --sp-move: var(--bk-move);
  --sp-out:  var(--bk-out);
}
.sp-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; min-height: 44px; }
.sp-head-times { margin-top: 1.7rem; }
.sp-eyebrow {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-2);
}
.sp-month { margin-left: auto; font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }
.sp-nav { display: none; gap: .4rem; }
.sp-arrow {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-lg);
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  transition: border-color .16s ease, color .16s ease, opacity .16s ease;
}
.sp-arrow:disabled { opacity: .3; cursor: default; }
.sp-arrow:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.sp-strip {
  position: relative; display: flex; gap: .6rem;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 4px; margin: -4px;       /* room for the focus ring, which overflow would clip */
  scroll-padding-inline: 4px;       /* or snapping pulls the first day 4px past the text edge */
}
.sp-strip::-webkit-scrollbar { display: none; }
/* Fade the right edge only while there is more to scroll to. */
.sp-strip[data-more] {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3.5rem), transparent);
          mask-image: linear-gradient(90deg, #000 calc(100% - 3.5rem), transparent);
}

.sp-day {
  position: relative; z-index: 1; flex: 0 0 5.1rem; scroll-snap-align: start;
  display: grid; justify-items: center; gap: .35rem; padding: .95rem .4rem .85rem;
  background: transparent; color: var(--ink); font: inherit;
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.sp-dow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; color: var(--ink-2); transition: color .2s ease; }
.sp-num { font-size: 1.55rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sp-free { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; transition: color .2s ease; }
.sp-day[aria-checked="true"] { color: var(--on-brand); border-color: transparent; }
.sp-day[aria-checked="true"] .sp-dow,
.sp-day[aria-checked="true"] .sp-free { color: var(--on-brand); }
.sp-day:disabled { cursor: not-allowed; border-color: var(--line-2); color: var(--ink-3); }
.sp-day:disabled .sp-dow { color: var(--ink-3); }
.sp-day:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The selection highlight: one element that slides between days. */
.sp-pill {
  position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none;
  background: var(--brand); border-radius: var(--r);
  box-shadow: var(--shadow-sm);     /* neutral elevation, not a coloured glow */
  opacity: 0;
}
.sp-pill[data-on] { opacity: 1; }
.sp-pill[data-ready] { transition: transform .28s var(--sp-move); }

.sp-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.sp-time {
  display: grid; place-items: center; gap: .15rem; min-height: 3.3rem; padding: .7rem .5rem;
  background: transparent; color: var(--ink); font: inherit;
  font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease,
              transform .12s var(--sp-out);
  /* backwards, not both: once it has played, :active owns transform again */
  animation: sp-in .26s var(--sp-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.sp-time-note { font-size: var(--fs-xs); font-weight: 400; color: var(--ink-3); }
.sp-time:active { transform: scale(.97); }
.sp-time[aria-checked="true"] {
  background: var(--brand-soft); border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.sp-time:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sp-empty { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--fs-md); }
@keyframes sp-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes sp-fade { from { opacity: 0; } }

/* Rises in once a time is picked. Its space is always reserved, so nothing
   below it jumps when it appears. */
.sp-bar {
  display: flex; align-items: center; gap: 1rem; margin-top: 1.4rem;
  padding: .8rem .8rem .8rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  opacity: 0; transform: translateY(8px); visibility: hidden;
  transition: opacity .22s var(--sp-out), transform .26s var(--sp-out), visibility 0s .26s;
}
.sp-bar[data-show] {
  opacity: 1; transform: none; visibility: visible;
  transition: opacity .22s var(--sp-out), transform .26s var(--sp-out), visibility 0s;
}
.sp-bar-txt { color: var(--ink-2); font-size: var(--fs-md); }
.sp-bar-txt b { color: var(--ink); font-weight: 700; }
.sp-bar .ad-btn { margin-left: auto; }

@media (hover: hover) and (pointer: fine) {
  .sp-nav { display: inline-flex; }
  .sp-arrow:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
  .sp-day:hover:not(:disabled):not([aria-checked="true"]) { border-color: var(--brand); }
  .sp-time:hover:not([aria-checked="true"]) { border-color: var(--brand); }
}
@media (max-width: 380px) {
  .sp-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .sp-pill[data-ready] { transition: none; }
  .sp-time { animation-name: sp-fade; }
  .sp-bar, .sp-bar[data-show] { transform: none; }
}

/* ---------- summary rail ---------- */
/* minmax(0,1fr), never the implicit auto track: the day strip scrolls
   sideways, and an auto column grows to its full width and widens the phone. */
.bk-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .bk-layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 3.5rem; } }

.bk-summary {
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 1.3rem 1.4rem;
}
@media (min-width: 900px) { .bk-summary { position: sticky; top: 92px; } }
.bk-summary h2 {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem;
}
.bk-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; font-size: var(--fs-sm); }
.bk-row + .bk-row { border-top: 1px solid var(--line-2); }
.bk-row dt { color: var(--ink-3); }
.bk-row dd { margin: 0; text-align: right; font-weight: 600; }
.bk-row-total { margin-top: .5rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: var(--fs-md); }
.bk-row-total dd { color: var(--brand); font-size: var(--fs-xl); }
.bk-empty { color: var(--ink-3); font-size: var(--fs-sm); font-style: italic; }

/* ---------- notices ---------- */
.bk-notice {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .95rem 1.1rem; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface);
  font-size: var(--fs-sm); line-height: 1.55; margin-block: 1.3rem;
}
.bk-notice strong { display: block; margin-bottom: .2rem; }
.bk-notice-brand { border-color: var(--brand); background: var(--brand-soft); }
.bk-notice-warn  { border-color: #C9803A; background: rgba(201, 128, 58, .1); }
.bk-notice-bad   { border-color: #E2707A; background: rgba(226, 112, 122, .1); }

/* ---------- deposit + upload ---------- */
.bk-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-xl); font-weight: 700; letter-spacing: .08em; color: var(--brand);
}
.bk-timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.bk-row-ref dd { display: flex; align-items: center; gap: .7rem; justify-content: flex-end; }
.bk-copy {
  min-height: 44px; min-width: 44px; padding: 0 .8rem;
  background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-xs); font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
  transition: border-color .16s ease, color .16s ease, transform .12s var(--bk-out);
}
.bk-copy:active { transform: scale(.96); }
.bk-copy[data-done] { color: var(--brand); border-color: var(--brand); }
.bk-copy:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .bk-copy:hover { border-color: var(--brand); color: var(--ink); } }

/* The hold drains in real time: linear, because it is a clock. */
.bk-holdbar { display: block; height: 3px; margin-top: .8rem; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.bk-holdbar-fill {
  display: block; height: 100%; background: var(--brand);
  transform-origin: left center; transition: transform 1s linear, background-color .3s ease;
}
.bk-holdbar-fill[data-low] { background: #D9A441; }

/* The one moment allowed a flourish: the receipt is in. Drawn once. */
.bk-success { align-items: center; }
.bk-success b { white-space: nowrap; }   /* a reference split over two lines reads as two */
.bk-tick { flex: 0 0 44px; width: 44px; height: 44px; fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bk-tick circle, .bk-tick path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.bk-tick circle { animation: bk-draw .5s var(--bk-out) .05s forwards; }
.bk-tick path   { animation: bk-draw .32s var(--bk-out) .4s forwards; }
@keyframes bk-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bk-tick circle, .bk-tick path { animation: none; stroke-dashoffset: 0; }
  .bk-holdbar-fill { transition: background-color .3s ease; }
}

.bk-drop {
  display: grid; place-items: center; gap: .5rem;
  padding: 2rem 1.2rem; text-align: center; cursor: pointer;
  border: 1px dashed var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink-3); font-size: var(--fs-sm);
  transition: border-color .17s var(--ease), color .17s var(--ease), background .17s var(--ease);
}
.bk-drop:hover, .bk-drop[data-over] { border-color: var(--brand); color: var(--ink); background: var(--brand-soft); }
.bk-drop input { position: absolute; opacity: 0; width: 0; height: 0; }
.bk-thumb { margin-top: .9rem; display: flex; align-items: center; gap: .9rem; }
.bk-thumb img {
  width: 76px; height: 76px; object-fit: cover;
  border-radius: var(--r); border: 1px solid var(--line);
}

/* ---------- checkbox ---------- */
.bk-check { display: flex; gap: .8rem; align-items: flex-start; cursor: pointer; font-size: var(--fs-sm); line-height: 1.55; }
.bk-check input {
  appearance: none; flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px;
  border: 1px solid var(--ink-3); border-radius: 2px;
  cursor: pointer;
  /* The tick is a background image, not ::after: Firefox draws no pseudo
     elements inside a checkbox. It grows in through background-size. */
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306131C' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0 no-repeat;
  transition: background-color .15s ease, border-color .15s ease, background-size .2s var(--bk-out), transform .12s var(--bk-out);
}
.bk-check input:checked { background-color: var(--brand); border-color: var(--brand); background-size: 13px; }
.bk-check input:active { transform: scale(.92); }
.bk-check input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- spinner ---------- */
.bk-busy { pointer-events: none; opacity: .6; }
.bk-spin {
  display: inline-block; width: 14px; height: 14px; margin-right: .5rem;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: bk-spin .7s linear infinite; vertical-align: -2px;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* ============================================================
   admin - phone first. She is doing this on the bus between
   classes, not at a desk.
   ============================================================ */
.ad-body { background: var(--bg); min-height: 100dvh; }
.ad-wrap { width: 100%; max-width: 940px; margin-inline: auto; padding: 1.1rem var(--gutter) 5rem; }

.ad-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .8rem;
  padding: .85rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.ad-top b { font-size: var(--fs-md); letter-spacing: -.01em; }
.ad-top .bk-spacer { margin-left: auto; }

.ad-tabs {
  display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none;
  padding: .9rem var(--gutter); border-bottom: 1px solid var(--line-2);
  position: sticky; top: 53px; z-index: 19;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}
.ad-tabs::-webkit-scrollbar { display: none; }
.ad-tab {
  flex: 0 0 auto; min-height: 42px; padding: .5rem 1rem;
  background: transparent; border: 1px solid transparent; border-radius: var(--r);
  color: var(--ink-3); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.ad-tab:hover { color: var(--ink); background: var(--surface); }
.ad-tab[aria-selected="true"] { color: var(--on-brand); background: var(--brand); }
.ad-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Four tabs overflow a 375px phone at full padding, and a tab she cannot see
   is a tab she never finds. Tighten them so the whole set fits without a swipe. */
@media (max-width: 430px) {
  .ad-tabs { padding-inline: 1rem; gap: .15rem; }
  .ad-tab { padding: .5rem .6rem; font-size: var(--fs-xs); }
}

.ad-panel { display: none; padding-top: 1.8rem; }
.ad-panel[data-active] { display: block; }
.ad-h { font-size: var(--fs-lg); font-weight: 700; margin-bottom: .3rem; }
.ad-p { color: var(--ink-3); font-size: var(--fs-sm); margin-bottom: 1.3rem; line-height: 1.55; }

/* month grid */
.ad-month { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; }
.ad-month b { font-size: var(--fs-md); }
.ad-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.ad-dow {
  text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3); padding-bottom: .4rem;
}
.ad-cell {
  position: relative; min-height: 58px; padding: .3rem;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 2px;
  font-size: 11px; color: var(--ink-3); cursor: pointer; text-align: left;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.ad-cell:hover { border-color: var(--brand); }
.ad-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ad-cell[data-out] { opacity: .3; cursor: default; }
.ad-cell[data-today] { border-color: var(--ink-3); }
.ad-cell[data-sel] { border-color: var(--brand); background: var(--brand-soft); }
.ad-cell-n { font-weight: 700; color: var(--ink-2); }
.ad-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; }
.ad-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.ad-dot[data-s="open"]    { background: var(--brand); }
.ad-dot[data-s="held"]    { background: #F3E2A0; }   /* pastel yellow: being paid for */
.ad-dot[data-s="review"]  { background: #B48CE8; }   /* receipt in, waiting on her */
.ad-dot[data-s="booked"]  { background: #5FBF8C; }
.ad-dot[data-s="blocked"] { background: var(--ink-3); opacity: .5; }

.ad-key { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: 1rem; font-size: var(--fs-xs); color: var(--ink-3); }
.ad-key span { display: inline-flex; align-items: center; gap: .4rem; }

/* day detail + lists */
.ad-card {
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 1.1rem 1.2rem; margin-top: 1.2rem;
}
.ad-card + .ad-card { margin-top: .75rem; }
.ad-card-h { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .85rem; }
.ad-card-h b { font-size: var(--fs-md); }

.ad-slot {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .7rem 0; border-top: 1px solid var(--line-2); font-size: var(--fs-sm);
}
.ad-slot:first-of-type { border-top: 0; }
.ad-slot-t { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 72px; }
.ad-slot .bk-spacer { margin-left: auto; }

.ad-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .18rem .55rem; border-radius: 2px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid var(--line);
}
.ad-pill[data-s="open"]            { color: var(--brand); border-color: var(--brand); }
.ad-pill[data-s="held"]            { color: #F3E2A0; border-color: #F3E2A0; }
.ad-pill[data-s="builder"]         { color: #B08A6A; border-color: #B08A6A; }   /* brown: builder gel */
.ad-pill[data-s="ext"]             { color: #F2A65A; border-color: #F2A65A; }   /* orange: extensions */
.ad-pill[data-s="removal"]         { color: #F29AC6; border-color: #F29AC6; }   /* pink */
.ad-pill[data-s="discount"]        { color: #EF6F6C; border-color: #EF6F6C; }   /* red */
.ad-pill[data-s="booked"],
.ad-pill[data-s="confirmed"]       { color: #5FBF8C; border-color: #5FBF8C; }
.ad-pill[data-s="blocked"]         { color: var(--ink-3); }
.ad-pill[data-s="awaiting_review"],
.ad-pill[data-s="review"]          { color: #B48CE8; border-color: #B48CE8; }
.ad-pill[data-s="pending"]         { color: var(--ink-3); }
.ad-pill[data-s="noshow"],
.ad-pill[data-s="cancelled"]       { color: #E2707A; border-color: #E2707A; }
.ad-pill[data-s="done"]            { color: var(--ink-3); }

.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  /* 44px on both axes. Tap targets have failed on width in three previous
     builds and on height in this one, so neither gets to be the short side. */
  min-height: 44px; min-width: 44px; padding: .45rem .9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease);
}
.ad-btn:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-2px); }
/* A primary button that is not ready yet must not look ready, or it gets
   tapped over and over by someone who thinks the page is broken. */
.ad-btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.ad-btn:active { transform: scale(.97); }
.ad-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ad-btn[data-primary] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ad-btn[data-danger]:hover { border-color: #E2707A; color: #F09AA2; }
.ad-btn-sm { min-height: 44px; padding: .25rem .65rem; font-size: var(--fs-xs); }

.ad-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.ad-inline .bk-field { margin-bottom: 0; flex: 1 1 110px; }

.ad-meta { display: grid; gap: .3rem; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: .9rem; }
.ad-meta a { color: var(--brand); }
.ad-shots { display: flex; gap: .7rem; flex-wrap: wrap; margin: .9rem 0; }
.ad-shots a { display: block; }
.ad-shots img {
  width: 132px; height: 132px; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--r);
}
.ad-shots figcaption { font-size: 10px; color: var(--ink-3); margin-top: .3rem; text-transform: uppercase; letter-spacing: .06em; }

.ad-pat { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.ad-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .5rem .4rem .8rem; min-height: 38px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
}
.ad-chip button {
  display: grid; place-items: center; width: 32px; height: 32px;
  background: none; border: 0; border-radius: 2px;
  color: var(--ink-3); font-size: 15px; line-height: 1; cursor: pointer;
}
.ad-chip button:hover { color: #F09AA2; background: rgba(226, 112, 122, .12); }

.ad-toast {
  position: fixed; left: 50%; bottom: 1.3rem; transform: translateX(-50%) translateY(140%);
  z-index: 60; max-width: min(92vw, 460px);
  padding: .8rem 1.15rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--brand);
  box-shadow: var(--shadow-sm); font-size: var(--fs-sm); line-height: 1.5;   /* the coloured edge carries it */
  /* An empty toast is only a few pixels tall, so translateY alone leaves a
     stray box peeking over the fold. Hide it outright until it has something
     to say. */
  opacity: 0; visibility: hidden;
  transition: transform .34s var(--ease), opacity .34s var(--ease), visibility .34s;
}
.ad-toast[data-on] { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.ad-toast[data-bad] { border-color: #E2707A; }

.ad-login { max-width: 360px; margin: 16vh auto 0; padding-inline: var(--gutter); }

.ad-empty { color: var(--ink-3); font-size: var(--fs-sm); font-style: italic; padding: 1.6rem 0; }

/* Bookings tab: the daily 'reminders to send' line sits above the cards. */
.ad-remind-banner { margin-bottom: 1rem; }

/* Her DuitNow QR on the deposit step. White card, because a QR on a dark
   ground reads poorly in some bank-app scanners. */
.bk-qr { margin: 1.2rem 0 1.4rem; display: grid; gap: .8rem; justify-items: start; }
/* Her two QR cards (Maybank 828x1055, Touch 'n Go 880x1280) side by side,
   each in its own pale frame as the apps export them. */
.bk-pay { margin: 1.2rem 0 1.4rem; }
/* Stacked on a phone, so each QR is big enough for another phone to scan off
   the screen; side by side from 520px up, with the Save links on one line. */
.bk-qrs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; max-width: 300px; }
.bk-qrs .bk-qr { margin: 0; gap: .5rem; }
@media (min-width: 520px) {
  .bk-qrs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; max-width: 600px; }
  .bk-qrs .bk-qr { grid-template-rows: 1fr auto; align-content: space-between; }
}
.bk-qr img { width: 100%; height: auto; border-radius: 10px; }
.bk-qr-tip { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; margin-top: .8rem; }
.bk-qr-tip + .bk-qr-tip { margin-top: .3rem; }
.bk-tng { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: 1rem;
  padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  font-size: var(--fs-sm); color: var(--ink-2); }
.bk-tng b { color: var(--ink); font-size: var(--fs-md); letter-spacing: .02em; white-space: nowrap; }
.bk-qr figcaption { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; max-width: 46ch; }

/* Five steps do not fit across a phone with every label showing. Below 520px
   only the current step keeps its name; the others shrink to their number,
   and a done step's button still covers its circle so it stays tappable. */
@media (max-width: 520px) {
  .bk-steps { gap: .4rem .85rem; flex-wrap: nowrap; }
  .bk-steps li:not([data-on]) { position: relative; }
  .bk-steps li:not([data-on]) .bk-stepbtn {
    position: absolute; inset: -11px; min-height: 0; padding: 0;
    font-size: 0; color: transparent;
  }
}

/* One soft pulse on the field the customer missed (book.js flag()). */
@keyframes bk-flag {
  0%   { box-shadow: 0 0 0 0 rgba(226, 112, 122, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(226, 112, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 112, 122, 0); }
}
.bk-flag { animation: bk-flag .9s var(--bk-out) 2; border-radius: var(--r); }

/* "Put 123456 as the payment reference": bold, the number in the same blue as
   the reference box above it, so the two read as the same thing. */
.bk-payref b { color: var(--ink); font-weight: 600; }
.bk-payref .bk-ref-copy { color: var(--brand); font-weight: 700; letter-spacing: .04em; }

/* Days of the week for "Open slots on repeat": seven toggles in a row. */
.ad-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; margin-top: .5rem; }
.ad-daychip { position: relative; display: block; }
.ad-daychip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ad-daychip span {
  display: grid; place-items: center; min-height: 44px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 600; transition: background .15s, border-color .15s, color .15s;
}
.ad-daychip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ad-daychip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The dashboard's own "are you sure?" box (admin.js ask()). */
.ad-ask { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: 16px; background: rgba(5, 7, 10, .72); }
.ad-ask[hidden] { display: none !important; }
.ad-ask-box { width: min(420px, 100%); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-2); padding: 1.4rem 1.4rem 1.1rem; }
.ad-ask-box p { white-space: pre-line; line-height: 1.55; }
.ad-ask-box .bk-actions { margin-top: 1.2rem; }

/* Full-size receipt / reference viewer (admin.js). */
.ad-view { position: fixed; inset: 0; z-index: 95; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  gap: .8rem; padding: 16px; background: rgba(5, 7, 10, .92); }
.ad-view[hidden] { display: none !important; }
.ad-view-pic { min-height: 0; display: grid; }
.ad-view-pic img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.ad-view-bar { display: flex; gap: .7rem; max-width: 520px; width: 100%; margin: 0 auto; }

/* Edit-in-place box on a booking card. */
.ad-editbox { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-2); }

/* Picture boxes in Add a booking / Edit (admin.js picker()). */
.ad-file { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: .6rem 1.1rem;
  border: 1px dashed var(--line); border-radius: var(--r); color: var(--ink-2); font-size: var(--fs-sm);
  font-weight: 600; cursor: pointer; margin-top: .35rem; }
.ad-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ad-file:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (hover: hover) { .ad-file:hover { border-color: var(--brand); color: var(--ink); } }
.ad-picks { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.ad-picks:empty { display: none; }
.ad-pick { position: relative; width: 72px; height: 72px; }
.ad-pick img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }
.ad-pick button { position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer; }

/* "Welcome back" on the details step (book.js fillMe). */
.bk-me-forget { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; margin-left: .2rem; }

.ad-linkbtn { background: none; border: 0; font: inherit; cursor: pointer; }
