/*
 * Components (plan.md §7.4, §8). Mobile first; every tappable thing is at
 * least 44px high and every text at least 16px. Colours, sizes and timings
 * come from tokens.css.
 *
 * Glass is only for controls that float over content: top bar, bottom bar,
 * step bar, the bar with "Continue", sheets, menus, toasts and the shop-name
 * card on the cover photo. Content (lists, forms, calendar, text) is solid.
 * At most 3 glass surfaces on screen at once, none inside a scrolling list,
 * and the blur is never animated.
 */

/* === Glass ================================================================ */
.glass {
  color: var(--text);
  background:
    linear-gradient(180deg, var(--glass-sheen), transparent 55%),
    rgb(var(--glass-tint) / var(--glass-alpha));
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow:
    inset 0 1px 0 0 var(--glass-edge),
    inset 0 0 0 1px var(--glass-rim),
    var(--shadow-float);
}

/* Without backdrop blur, or when the device asks for less transparency, the
   same shapes become solid. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-solid);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .glass {
    background: Canvas;
    border: 1px solid CanvasText;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* === Icons ================================================================ */
.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}

/* === Buttons ============================================================== */
.btn {
  --btn-bg: var(--surface-2);
  --btn-bg-hover: var(--surface-3);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 var(--text-sm) / 1.2 var(--font-sans);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  --btn-bg: var(--primary);
  --btn-bg-hover: var(--primary-hover);
  --btn-fg: var(--on-primary);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-bg-hover: color-mix(in srgb, currentColor 9%, transparent);
  padding-inline: var(--space-4);
}

.btn--danger {
  --btn-bg: transparent;
  --btn-bg-hover: var(--danger-soft);
  --btn-fg: var(--danger);
  padding-inline: var(--space-4);
}

.btn--sm {
  min-height: var(--touch-min);
  padding-inline: var(--space-4);
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  --btn-bg: var(--surface-2);
  --btn-bg-hover: var(--surface-2);
  --btn-fg: var(--text-disabled);
  cursor: not-allowed;
  transform: none;
}

/* Loading: the label stays (so the width does not jump), a spinner appears. */
.btn[aria-busy="true"] {
  --btn-fg: var(--on-primary);
  cursor: progress;
}

.btn:not(.btn--primary)[aria-busy="true"] {
  --btn-fg: var(--text);
}

.spinner {
  display: none;
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

[aria-busy="true"] > .spinner {
  display: inline-block;
}

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: var(--touch-min);
  height: var(--touch-min);
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.btn-icon:active {
  transform: scale(0.94);
}

/* Light/dark toggle: shows the moon in light theme, the sun in dark. */
[data-theme-toggle] .icon--when-dark,
[data-theme-toggle][aria-pressed="true"] .icon--when-light {
  display: none;
}

[data-theme-toggle][aria-pressed="true"] .icon--when-dark {
  display: block;
}

.btn-icon--outline {
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn-icon:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
  transform: none;
}

/* === Segmented control (one choice out of 2 to 4) ========================= */
.segmented {
  display: inline-flex;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  padding: 4px;
  margin: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

/* Options never wrap onto a second row; on a narrow screen a long label
   wraps inside its own option instead. */
.segmented__option {
  position: relative;
  display: block;
  flex: 0 1 auto;
  min-width: 0;
}

.segmented__option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented__option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-xs);
  font: 600 var(--text-sm) / 1.15 var(--font-sans);
  text-align: center;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

@media (max-width: 24rem) {
  .segmented__option span {
    padding-inline: var(--space-3);
  }
}

.segmented__option input:checked + span {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 2px 8px -2px rgb(var(--shadow-rgb) / 0.3);
}

.segmented__option input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* === Accent picker ======================================================== */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  border: 0;
}

.swatch {
  position: relative;
  display: block;
}

.swatch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.swatch__inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-min);
  padding: 0 var(--space-4) 0 var(--space-2);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font: 600 var(--text-sm) / 1.2 var(--font-sans);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.swatch__dot {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--on-accent-fill);
}

.swatch__dot .icon {
  width: 1.125rem;
  height: 1.125rem;
  opacity: 0;
}

.swatch input:checked + .swatch__inner {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.swatch input:checked + .swatch__inner .icon {
  opacity: 1;
}

.swatch input:focus-visible + .swatch__inner {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* === Cards ================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}

.card__header--padded {
  padding: var(--space-5) var(--space-5) var(--space-3);
}

@media (min-width: 48rem) {
  .card {
    padding: var(--space-8);
  }

  .card--flush {
    padding: 0;
  }

  .card__header--padded {
    padding: var(--space-6) var(--space-8) var(--space-4);
  }
}

/* === Chips ================================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 1.75rem;
  padding: 0 0.625rem;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text);
  font: 600 var(--text-sm) / 1.2 var(--font-sans);
  white-space: nowrap;
}

.chip--accent {
  background: var(--accent-fill);
  color: var(--on-accent-fill);
}

.chip--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* A short list with check marks, as under the title in the reference image. */
.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.checklist .icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--success);
}

/* === Form fields ========================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.field__label {
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
}

.field__optional {
  color: var(--text-muted);
  font-weight: inherit;
}

/* One line of plain help under a setting (plan.md §7.3). */
.field__help {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

/* Errors say what to do, next to the field (plan.md §7.4). */
.field__error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--danger);
  font: 600 var(--text-sm) / 1.4 var(--font-sans);
}

/* Allowed, but worth fixing (e.g. customers will see "Me" as a name). */
.field__warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--danger);
  font: 600 var(--text-sm) / 1.4 var(--font-sans);
}

.field__warning .icon,
.icon--warn {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--danger);
  vertical-align: -0.2em;
}

.switch--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field__error .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.05em;
}

.input {
  width: 100%;
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: var(--text-md);
  line-height: 1.4;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.input:disabled {
  background: var(--surface-2);
  color: var(--text-disabled);
  border-color: var(--border);
}

textarea.input {
  min-height: 6rem;
  resize: vertical;
}

/* Times and codes: sans, equal-width digits. */
.input--time,
.input--code {
  font-family: var(--font-sans);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The browser draws the time in the device's format (Chrome in Greek: "9:00 π.μ."),
   so its width is not fixed. In a .time-range the two fields share the row. */
.input--time {
  width: auto;
  min-width: 7rem;
  padding-inline: var(--space-3);
}

.input--code {
  max-width: 14rem;
  font-size: var(--text-xl);
  letter-spacing: 0.35em;
  text-align: center;
}

/* Native <select>, with our own arrow so it looks the same everywhere. */
.select {
  position: relative;
  display: block;
}

.select .input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--space-12);
  cursor: pointer;
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--space-4);
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  background: currentColor;
  pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Checkbox: native, in the shop's accent, bigger than the default. */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: var(--touch-min);
  padding-block: var(--space-2);
  cursor: pointer;
}

.check input {
  width: 1.375rem;
  height: 1.375rem;
  flex: none;
  margin: 0.1em 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* On/off switch: a checkbox with role="switch". */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-min);
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
  cursor: pointer;
}

.switch__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch__track {
  position: relative;
  width: 3.25rem;
  height: 2rem;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-round);
  background: var(--surface-2);
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  transition: transform var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}

.switch__input:checked + .switch__track {
  border-color: var(--accent);
  background: var(--accent-fill);
}

.switch__input:checked + .switch__track::after {
  transform: translateX(1.25rem);
  background: var(--on-accent);
}

.switch__input:focus-visible + .switch__track {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Opening hours: a day switch and two time fields (plan.md §7.1 step 4). */
.hours {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hours__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-2);
  border-top: 1px solid var(--border);
}

.hours__row:first-child {
  border-top: 0;
}

.hours__row .switch {
  min-width: 9rem;
}

.time-range {
  display: flex;
  flex: 1 1 15rem;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 20rem;
}

.time-range .input--time {
  flex: 1 1 0;
  min-width: 0;
}

/* On a touch screen a tap anywhere opens the phone's time picker, so the small
   clock icon only takes room the time needs. */
@media (pointer: coarse) {
  .input--time::-webkit-calendar-picker-indicator {
    display: none;
  }
}

.hours__closed {
  color: var(--text-muted);
}

/* === Top bar (sticky, glass) ============================================== */
.topbar {
  position: sticky;
  top: max(var(--space-2), env(safe-area-inset-top));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: calc(100% - 2 * var(--space-2));
  max-width: calc(var(--page-max) - 2 * var(--space-4));
  min-height: var(--topbar-h);
  margin: var(--space-2) auto 0;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border-radius: var(--radius-lg);
}

.topbar__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 600 var(--text-lg) / 1.1 var(--font-display);
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Things that stick below the top bar (the step bar). */
.has-topbar {
  --sticky-top: calc(max(var(--space-2), env(safe-area-inset-top)) + var(--topbar-h) + var(--space-3));
}

/* === Bottom navigation (owner's panel, phone; glass) ======================= */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(var(--space-3), env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 2px;
  width: calc(100% - 2 * var(--space-2));
  max-width: 34rem;
  padding: 6px;
  border-radius: var(--radius-xl);
  transform: translateX(-50%);
  transition: transform var(--dur-slow) var(--ease-out);
}

/* Moved away (only with transform; the blur itself never animates). */
.tabbar.is-away {
  transform: translate(-50%, calc(100% + 2rem));
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 3.5rem;
  padding: var(--space-1) 2px;
  border-radius: calc(var(--radius-xl) - 6px);
  color: var(--text);
  font: 600 var(--text-sm) / 1.15 var(--font-sans);
  letter-spacing: -0.015em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-out);
}

/* Direction D: the current section is a quiet grey fill; only its icon
   takes the colour. */
.tabbar__item[aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
}

.tabbar__item[aria-current="page"] .icon {
  color: var(--accent);
}

/* Equal quarters, except that a longer label ("Ημερολόγιο") takes the room it
   needs instead of being cut: items keep their min-content width. Below 360px
   the margins shrink so the four 16px labels still fit. */
/* Five sections on a phone: the bar takes nearly the whole width and the
   labels get smaller, so "Ημερολόγιο" and "Στατιστικά" are never cut. */
@media (max-width: 30rem) {
  .tabbar {
    width: calc(100% - var(--space-2));
    padding: 4px;
    gap: 0;
  }

  .tabbar__item {
    padding-inline: 0;
    font-size: 0.75rem;
    letter-spacing: -0.02em;
  }
}

@media (max-width: 22.5rem) {
  .tabbar__item {
    font-size: 0.6875rem;
    letter-spacing: -0.03em;
  }
}

.has-tabbar {
  padding-bottom: calc(6rem + env(safe-area-inset-bottom));
}

/* Whatever gets the focus, or is scrolled to, stays clear of the bars that
   float over the page (WCAG 2.4.11). */
html:has(> body.has-tabbar),
html:has(.wizard .actionbar) {
  scroll-padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
}

/* === Step bar and "Continue" bar (booking flow; glass) ===================== */
.stepbar {
  position: sticky;
  top: var(--sticky-top, max(var(--space-2), env(safe-area-inset-top)));
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-3) var(--space-2);
  border-radius: var(--radius-lg);
}

.stepbar__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stepbar__text:first-child,
[hidden] + .stepbar__text {
  padding-left: var(--space-3);
}

.stepbar__count {
  font: 600 var(--text-sm) / 1.25 var(--font-sans);
}

.stepbar__title {
  font: 600 var(--text-lg) / 1.2 var(--font-display);
  letter-spacing: -0.015em;
}

.progress {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  grid-column: 1 / -1;
  gap: 4px;
  padding-left: var(--space-2);
}

.progress__step {
  height: 4px;
  border-radius: var(--radius-round);
  background: color-mix(in srgb, var(--text) 20%, transparent);
  transition: background-color var(--dur) var(--ease-out);
}

.progress__step.is-done {
  background: var(--text);
}

.actionbar {
  position: sticky;
  bottom: max(var(--space-3), env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border-radius: var(--radius-lg);
}

.actionbar__summary {
  flex: 1;
  min-width: 0;
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
}

.actionbar .btn {
  flex: none;
  min-width: 9rem;
}

/* === Booking flow ========================================================== */
.flow {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* While a step slides in it must not stick out past the screen edge (a phone
   would zoom out). "clip", unlike "hidden", keeps the step bar sticky. Only
   during the slide, so shadows are not cut the rest of the time. */
.flow:has(> .is-entering-forward, > .is-entering-back) {
  overflow-x: clip;
}

.flow__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.flow__step:focus {
  outline: none;
}

/* === Day strip and times (customer, phone) ================================= */
.daystrip {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.daystrip__track {
  position: relative;
  display: flex;
  gap: var(--space-2);
  margin: 0 calc(-1 * var(--space-1));
  padding: var(--space-1) var(--space-1) var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.daystrip__track::-webkit-scrollbar {
  display: none;
}

.day {
  position: relative;
  flex: none;
  scroll-snap-align: start;
}

.day input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.day__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 4.5rem;
  min-height: 5.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font: 600 var(--text-sm) / 1.15 var(--font-sans);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.day__name,
.day__note {
  color: var(--text-muted);
}

.day__num {
  font: 600 var(--text-xl) / 1.1 var(--font-display);
}

.day--today .day__name {
  color: var(--accent);
}

.day input:checked + .day__inner {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.day input:checked + .day__inner :is(.day__name, .day__note) {
  color: var(--on-primary);
}

.day input:disabled {
  cursor: not-allowed;
}

.day input:disabled + .day__inner {
  background: repeating-linear-gradient(135deg, var(--closed-a) 0 7px, var(--closed-b) 7px 10px);
  color: var(--text-muted);
}

.day input:focus-visible + .day__inner {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.slots-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
  gap: var(--space-2);
}

.slot-choice {
  position: relative;
  display: block;
}

.slot-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

/* A free time: soft green. When chosen it fills with the shop's accent. */
.slot {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 var(--space-2);
  border: 1px solid var(--free-border);
  border-radius: var(--radius-md);
  background: var(--free-bg);
  color: var(--free-text);
  font: 600 var(--text-md) / 1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  transition:
    color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.slot::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  background: var(--accent-fill);
  clip-path: circle(0% at 50% 50%);
  transition: clip-path var(--dur-slow) var(--ease-out);
}

.slot-choice input:checked + .slot {
  border-color: var(--accent);
  color: var(--on-accent-fill);
}

.slot-choice input:checked + .slot::before {
  clip-path: circle(75% at 50% 50%);
}

/* The chosen time is ticked in the day's list; the week (the same times, for
   large screens) shows it as chosen too, until another time is ticked. */
form:has(.picker__phone .is-chosen input:checked) .picker__wide .is-chosen .slot {
  border-color: var(--accent);
  color: var(--on-accent-fill);
}

form:has(.picker__phone .is-chosen input:checked) .picker__wide .is-chosen .slot::before {
  clip-path: circle(75% at 50% 50%);
}

.slot-choice input:focus-visible + .slot {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Time that cannot be booked: hatched, no text, not focusable. */
.slot-closed {
  min-height: var(--touch-min);
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, var(--closed-a) 0 7px, var(--closed-b) 7px 10px);
}

.slots__empty {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}

.tz-note {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* === Week (customer, large screens), as in docs/reference-calendar.png ===== */
.week__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
}

.week__title {
  font: 600 var(--text-lg) / 1.3 var(--font-serif);
  letter-spacing: 0;
  text-align: center;
}

.week__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.legend::before {
  content: "";
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 4px;
}

.legend--free::before {
  border: 1px solid var(--free-border);
  background: var(--free-bg);
}

.legend--closed::before {
  background: repeating-linear-gradient(135deg, var(--closed-a) 0 3px, var(--closed-b) 3px 5px);
  box-shadow: inset 0 0 0 1px var(--closed-b);
}

.week__legend .tz-note {
  margin-left: auto;
}

.week__scroll {
  /* position: hidden labels inside must not escape the scroll box and widen the page */
  position: relative;
  margin: var(--space-4) calc(-1 * var(--space-2)) 0;
  padding: 0 var(--space-2) var(--space-2);
  overflow-x: auto;
}

.week__grid {
  display: grid;
  grid-auto-columns: minmax(4.25rem, 1fr);
  grid-auto-flow: column;
  grid-template-columns: 3.5rem;
  gap: 0 var(--space-2);
  min-width: 32rem;
}

.week__col {
  display: grid;
  grid-auto-rows: var(--touch-min);
  grid-template-rows: 3.75rem;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.week__dayhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.2;
}

.week__dayname {
  font-size: var(--text-md);
}

.week__date {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-serif);
  font-weight: 400;
}

.week__col--today .week__dayname {
  color: var(--accent);
}

.week__time {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font: 600 var(--text-sm) / 1 var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.week__col .slot {
  min-height: var(--touch-min);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

/* === Lists (appointments, customers): solid ================================ */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 4.75rem;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
}

.row:first-child {
  border-top: 0;
}

.row__time {
  display: flex;
  flex-direction: column;
  font: 600 var(--text-md) / 1.25 var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.row__end {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.row__main {
  min-width: 0;
}

.row__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  font: 600 var(--text-md) / 1.3 var(--font-sans);
}

.row__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.row__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* The next appointment stands out (plan.md §7.2). */
.row--next {
  background: var(--accent-soft);
  box-shadow: inset 4px 0 0 var(--accent);
}

.row--past :is(.row__time, .row__title) {
  color: var(--text-muted);
}

/* === Empty state: always says what to do next (plan.md §7.4) =============== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty__icon .icon {
  width: 2rem;
  height: 2rem;
}

.empty__text {
  max-width: 26em;
  color: var(--text-muted);
}

.empty .btn {
  margin-top: var(--space-2);
}

/* === Shop cover with the name card on top (glass) ========================== */
.cover {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 17rem;
  padding: var(--space-3);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface-2);
}

.cover__img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover__card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3) var(--space-4);
  width: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.cover__logo {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--on-accent-fill);
  font: 600 var(--text-lg) / 1 var(--font-display);
}

.cover__name {
  font-size: var(--text-xl);
}

.cover__address {
  font-size: var(--text-sm);
  line-height: 1.4;
}

.cover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  grid-column: 1 / -1;
}

/* Services on the shop page: one tap each (plan.md §6 step 2). */
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 4.5rem;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.list > li:first-child > .service {
  border-top: 0;
}

.service:focus-visible {
  outline-offset: -3px;
}

.service__name {
  display: block;
  font: 600 var(--text-md) / 1.3 var(--font-sans);
}

.service__meta {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.service .icon {
  color: var(--text-muted);
}

/* === Success: the one "big moment" (plan.md §8) ============================ */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.success-mark {
  width: 5.5rem;
  height: 5.5rem;
  overflow: visible;
}

.success-mark__ring {
  fill: var(--accent-fill);
  stroke: var(--accent-fill);
  stroke-width: 3;
  transform: rotate(-90deg);
  transform-origin: center;
  transform-box: fill-box;
}

.success-mark__check {
  fill: none;
  stroke: var(--on-accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Summary (definition list) ============================================ */
.summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  margin: 0;
}

.summary dt {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.summary dd {
  margin: 0;
  font: 600 var(--text-md) / 1.5 var(--font-sans);
}

/* === Sheet (<dialog>, rises from the bottom; glass) ======================== */
.sheet {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: 34rem;
  max-height: min(88dvh, 46rem);
  margin: 0 auto;
  padding: var(--space-2) var(--space-3) max(var(--space-3), env(safe-area-inset-bottom));
  border: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.sheet::backdrop {
  background: var(--scrim, rgb(22 22 20 / 0.4));
}

.sheet__grabber {
  width: 2.5rem;
  height: 5px;
  margin: var(--space-1) auto var(--space-2);
  border-radius: var(--radius-round);
  background: color-mix(in srgb, var(--text) 35%, transparent);
}

.sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0 0 var(--space-3) var(--space-3);
}

/* Text that must be read sits on a solid panel, not on the glass. */
.sheet__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.sheet__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

@media (min-width: 40rem) {
  .sheet {
    bottom: var(--space-4);
    width: calc(100% - 2 * var(--space-4));
    border-radius: var(--radius-xl);
  }

  .sheet__actions {
    flex-direction: row-reverse;
    justify-content: flex-start;
  }
}

/* === Menu (popover; glass) ================================================= */
.menu {
  position: fixed;
  inset: auto;
  top: calc(max(var(--space-2), env(safe-area-inset-top)) + var(--topbar-h) + var(--space-3));
  right: max(var(--space-3), calc((100vw - var(--page-max)) / 2 + var(--space-4)));
  min-width: 15rem;
  margin: 0;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-lg);
}

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--touch-min);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font: 600 var(--text-sm) / 1.2 var(--font-sans);
  text-align: left;
  text-decoration: none;
}

.menu__item:focus-visible {
  outline-offset: -3px;
}

.menu__sep {
  height: 1px;
  margin: var(--space-1) var(--space-3);
  border: 0;
  background: color-mix(in srgb, var(--text) 15%, transparent);
}

/* Whose account the menu is: the email, quietly, above the items. */
.menu__who {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* === Settings, in groups (settings/index.html); two columns on a large screen === */
.settings-groups {
  display: grid;
  align-items: start;
  gap: var(--space-5);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.settings-group__title {
  padding-inline: var(--space-2);
  color: var(--text-muted);
  font: 500 var(--text-sm) / 1.3 var(--font-sans);
}

@media (min-width: 64rem) {
  .settings-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* === Side bar (owner's panel, large screens; glass) ========================= */
/* layouts/panel.html: from 64rem it replaces the top bar and the bottom bar,
   so the sections are always in view, the current one marked. */
.sidenav {
  display: none;
}

@media (min-width: 64rem) {
  .has-sidenav {
    --sidenav-w: 16rem;
    padding-left: calc(var(--sidenav-w) + var(--space-3));
    padding-bottom: var(--space-6);
  }

  .has-sidenav > .topbar,
  .has-sidenav > .tabbar {
    display: none;
  }

  .has-sidenav .toasts {
    bottom: var(--space-5);
  }

  html:has(> body.has-sidenav) {
    scroll-padding-bottom: var(--space-4);
  }

  .sidenav {
    position: fixed;
    top: var(--space-3);
    bottom: var(--space-3);
    left: var(--space-3);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    width: var(--sidenav-w);
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
    border-radius: var(--radius-xl);
  }

  .sidenav__shop {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-1) var(--space-2);
    color: var(--text);
    text-decoration: none;
  }

  .sidenav__logo {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent-fill);
    color: var(--on-accent-fill);
    font: 600 var(--text-sm) / 1 var(--font-display);
  }

  .sidenav__logo--picture {
    object-fit: cover;
    background: var(--surface);
  }

  .sidenav__name {
    min-width: 0;
    font: 600 var(--text-lg) / 1.15 var(--font-display);
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
  }

  .sidenav__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .sidenav__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: var(--touch-min);
    padding: var(--space-1) var(--space-3);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text);
    font: 600 var(--text-base) / 1.2 var(--font-sans);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .sidenav__item:hover {
    background: var(--surface-2);
  }

  .sidenav__item[aria-current="page"] {
    background: var(--surface-2);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--border);
  }

  .sidenav__item[aria-current="page"] .icon {
    color: var(--accent);
  }

  .sidenav__foot {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
  }

  .sidenav__foot > .prefs {
    padding: var(--space-2) var(--space-1) 0;
  }

  .sidenav__account {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .sidenav__email {
    overflow: hidden;
    color: inherit;
    font-size: var(--text-sm);
    font-weight: 400;
    opacity: 0.75;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* === Toasts (glass) ======================================================== */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(max(var(--space-3), env(safe-area-inset-bottom)) + 5.25rem);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: calc(100% - 2 * var(--space-3));
  max-width: 30rem;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 3.5rem;
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4);
  overflow: hidden;
  border-radius: var(--radius-lg);
  font: 600 var(--text-sm) / 1.35 var(--font-sans);
  pointer-events: auto;
}

.toast > .icon {
  color: var(--text);
}

.toast__text {
  flex: 1;
  min-width: 0;
}

.toast > .btn {
  flex: none;
}

/* Saved but something still needs doing, or not saved: it stays until closed. */
.toast--warning > .icon {
  color: var(--accent);
}

.toast--error > .icon {
  color: var(--danger);
}

/* In the wizard, above its bar with "Next". */
.toasts--wizard {
  bottom: calc(max(var(--space-3), env(safe-area-inset-bottom)) + 6rem);
}

/* Shows how long "Undo" stays (plan.md §7.3: 10 seconds). */
.toast__timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--text);
  opacity: 0.4;
  transform-origin: left;
}

/* === Footer with the language switch (plan.md §6) ========================== */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-8);
  color: var(--text-muted);
}


/* === Hover: only for a real pointer, so a tap on a phone leaves no stuck state === */
@media (hover: hover) {
  .btn:hover {
    background: var(--btn-bg-hover);
  }

  .btn-icon:hover {
    background: color-mix(in srgb, currentColor 10%, transparent);
  }

  .btn-icon--outline:hover {
    background: var(--surface-2);
  }

  .segmented__option:hover input:not(:checked) + span {
    background: var(--surface-3);
  }

  .input:hover {
    border-color: var(--text-muted);
  }

  .tabbar__item:hover {
    background: color-mix(in srgb, var(--text) 8%, transparent);
  }

  .day:hover input:enabled:not(:checked) + .day__inner {
    background: var(--surface-2);
  }

  .slot-choice:hover input:not(:checked) + .slot {
    background: var(--free-bg-hover);
  }

  .service:hover {
    background: var(--surface-2);
  }

  .menu__item:hover {
    background: color-mix(in srgb, var(--text) 9%, transparent);
  }
}

/* === Motion: only when the device has not asked for less ================== */
@media (prefers-reduced-motion: no-preference) {
  .flow__step.is-entering-forward {
    animation: step-in-forward var(--dur) var(--ease-out) both;
  }

  .flow__step.is-entering-back {
    animation: step-in-back var(--dur) var(--ease-out) both;
  }

  /* Times of a new day appear one after the other (max ~0.5s in total). */
  .slots.is-revealing > * {
    animation: slot-in 220ms var(--ease-out) both;
  }

  .slots.is-revealing > :nth-child(2) { animation-delay: 20ms; }
  .slots.is-revealing > :nth-child(3) { animation-delay: 40ms; }
  .slots.is-revealing > :nth-child(4) { animation-delay: 60ms; }
  .slots.is-revealing > :nth-child(5) { animation-delay: 80ms; }
  .slots.is-revealing > :nth-child(6) { animation-delay: 100ms; }
  .slots.is-revealing > :nth-child(7) { animation-delay: 120ms; }
  .slots.is-revealing > :nth-child(8) { animation-delay: 140ms; }
  .slots.is-revealing > :nth-child(9) { animation-delay: 160ms; }
  .slots.is-revealing > :nth-child(10) { animation-delay: 180ms; }
  .slots.is-revealing > :nth-child(11) { animation-delay: 200ms; }
  .slots.is-revealing > :nth-child(12) { animation-delay: 220ms; }
  .slots.is-revealing > :nth-child(n + 13) { animation-delay: 240ms; }

  .sheet[open] {
    animation: sheet-in var(--dur-slow) var(--ease-out);
  }

  .sheet[open]::backdrop {
    animation: fade-in var(--dur-slow) var(--ease-out);
  }

  .toast {
    animation: toast-in var(--dur) var(--ease-out) both;
  }

  .toast__timer {
    animation: toast-timer 10s linear both;
  }

  .spinner {
    animation: spin 0.8s linear infinite;
  }

  /* Draw the ring, fill it, then draw the tick: ~0.9s, never blocks a tap. */
  .success-mark.is-drawing .success-mark__ring {
    stroke-dasharray: 1;
    animation:
      draw 450ms var(--ease-in-out) both,
      ring-fill 200ms 400ms var(--ease-out) both;
  }

  .success-mark.is-drawing .success-mark__check {
    stroke-dasharray: 1;
    animation: draw 320ms 560ms var(--ease-out) both;
  }

  .success-mark.is-drawing {
    animation: pop 360ms 420ms var(--ease-out) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast__timer {
    display: none;
  }
}

@keyframes step-in-forward {
  from { opacity: 0; transform: translateX(1rem); }
  to { opacity: 1; transform: none; }
}

@keyframes step-in-back {
  from { opacity: 0; transform: translateX(-1rem); }
  to { opacity: 1; transform: none; }
}

@keyframes slot-in {
  from { opacity: 0; transform: translateY(0.5rem) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-0.5rem) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-timer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

@keyframes draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes ring-fill {
  from { fill-opacity: 0; }
  to { fill-opacity: 1; }
}

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* === Account pages: sign-in, sign-up, codes, security (plan.md §5.1) ======== *
 * One narrow column on every screen size, a solid card with the form. Only
 * the top bar and its menu are glass.                                        */
.entrance {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  padding: max(var(--space-8), env(safe-area-inset-top)) max(var(--space-4), env(safe-area-inset-right)) var(--space-4) max(var(--space-4), env(safe-area-inset-left));
}

.entrance__brand {
  font: 600 var(--text-xl) / 1.1 var(--font-display);
  letter-spacing: -0.02em;
}

.entrance__brand a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  text-decoration: none;
}

.entrance__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  text-align: center;
}

/* Ordinary links in running text, made big enough to tap. */
.link-tap {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
}

.page--narrow {
  max-width: 40rem;
  padding-block: var(--space-6) var(--space-8);
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* "or" between Google and the email form. */
.or {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* The Google button keeps Google's own "G" next to the label. */
.btn__logo {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}

/* Messages after an action and form-wide errors: solid, never glass. */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font: 600 var(--text-sm) / 1.45 var(--font-sans);
}

.notice .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1em;
}

.notice--success .icon {
  color: var(--success);
}

.notice--error {
  background: var(--danger-soft);
  color: var(--danger);
}

.notices {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --- Legal texts (templates/legal/texts/): long reading, in the serif ---------- */
.entrance--wide {
  max-width: 46rem;
}

.legal-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-family: var(--font-serif);
  overflow-wrap: anywhere;
}

.legal-text h2 {
  margin-top: var(--space-5);
  font-size: var(--text-lg);
}

.legal-text h3 {
  margin-top: var(--space-3);
  font-size: var(--text-md);
}

.legal-text ul,
.legal-text ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-5);
}

/* Wide tables scroll inside the text on a phone, never the page. */
.legal-text table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.legal-text th,
.legal-text td {
  padding: var(--space-2);
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.legal-text hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
}

/* What the code does not do yet, or what is not decided: for the owner and
   the lawyer, removed before the text is published (docs/legal/README.md). */
.drafting-note {
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

/* The security settings: one row per subject, each a link to its screen. */
.setting {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  min-height: 4.5rem;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.list > li:first-child > .setting {
  border-top: 0;
}

.setting:focus-visible {
  outline-offset: -3px;
}

.setting__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.setting__icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.setting__title {
  display: block;
  font: 600 var(--text-md) / 1.3 var(--font-sans);
}

.setting__value {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.setting > .icon {
  color: var(--text-muted);
}

/* Signed-in devices. */
.device {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  min-height: 4.5rem;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
}

.list > li:first-child > .device,
.list > .device:first-child {
  border-top: 0;
}

.device__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  font: 600 var(--text-md) / 1.3 var(--font-sans);
}

.device__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

/* The authenticator app's QR code: dark on white in both themes, so every
   phone camera reads it. */
.qr {
  display: block;
  width: 13rem;
  max-width: 100%;
  margin-inline: auto;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--qr-bg);
}

.secret {
  font: 600 var(--text-md) / 1.5 var(--font-sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Recovery codes: two columns of equal-width digits. */
.codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  list-style: none;
  font: 600 var(--text-md) / 1.4 var(--font-sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-align: center;
}

@media (hover: hover) {
  .setting:hover {
    background: var(--surface-2);
  }
}

/* The name in the top bar is a link home. A block, not a flex box, so that a
   long name ends with "…" (text-overflow does nothing inside a flex box). */
a.topbar__title {
  display: block;
  line-height: var(--touch-min);
  color: inherit;
  text-decoration: none;
}

/* Rows in a flush card line up with the card's padded header on wide screens. */
@media (min-width: 48rem) {
  .device,
  .setting {
    padding-inline: var(--space-8) var(--space-6);
  }
}

/* ======================================================================== *
 * Phase 3: set-up wizard, settings, the shop's public page (plan.md §6-§7). *
 * ======================================================================== */

.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: -0.015em;
}

/* --- The wizard: one question per screen ---------------------------------- */
.wizard {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding-top: max(var(--space-3), env(safe-area-inset-top));
}

.wizard__question {
  font-size: var(--text-2xl);
}

.wizard .actionbar {
  margin-top: var(--space-2);
}

.wizard .actionbar .btn {
  min-width: 10rem;
}

/* A group of choices under one label (types of business, colours, phone). */
fieldset.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset.field > legend {
  padding: 0;
}

/* Types of business: big cards with an icon, two per row on a phone. */
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

@media (min-width: 40rem) {
  .choices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.choice {
  position: relative;
  display: block;
}

.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 5.5rem;
  height: 100%;
  padding: var(--space-3);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font: 600 var(--text-sm) / 1.25 var(--font-sans);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

.choice__inner .icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent);
}

.choice input:checked + .choice__inner {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice input:focus-visible + .choice__inner {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.segmented--wide {
  display: flex;
  width: 100%;
}

.segmented--wide .segmented__option {
  flex: 1 1 0;
}

/* Three long Greek labels do not fit side by side on a phone: one under the other. */
@media (max-width: 30rem) {
  .segmented--wide:has(> :nth-child(3)) {
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

  .segmented--wide:has(> :nth-child(3)) .segmented__option span {
    border-radius: var(--radius-md);
  }
}

/* Team step: the list of people only for "We are a team". Without :has()
   support it simply stays visible. */
body:has(input[name="mode"][value="solo"]:checked) [data-team-panel],
body:has(input[name="mode"][value="team"]:checked) [data-when-solo] {
  display: none;
}

/* --- Rows that save themselves (services, team) ---------------------------- */
.items {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.item__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.item__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
}

@media (min-width: 34rem) {
  .item__main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 13rem);
  }

  .item__main > :is(.item__switch, .item__wide) {
    grid-column: 1 / -1;
  }
}

/* A service's second row (settings/_service_row.html): the price is a few
   digits, so its field is short; the free time after it next to it; the
   switch at the end of the row on a wide screen, under them on a phone. */
.item__details {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2) var(--space-4);
}

.item__price {
  flex: 0 0 7.5rem;
}

.item__buffer {
  flex: 1 1 9rem;
  max-width: 13rem;
}

.item__details > .item__switch {
  flex: 1 0 100%;
  min-height: var(--control-h);
}

@media (min-width: 48rem) {
  .item__details > .item__switch {
    flex: 0 1 auto;
    margin-inline-start: auto;
  }
}

.item__delete {
  display: flex;
  align-items: center;
  min-height: var(--control-h);
}

.item__delete .btn-icon {
  color: var(--text-muted);
}

/* A little more room for the name on a phone. */
.item__main .input {
  padding-inline: var(--space-3);
}

.item--off .item__name .input {
  color: var(--text-muted);
}

/* What went wrong with a whole row (e.g. its "Delete" was refused): under it,
   across its full width, not squeezed next to the button. */
.item > .field__error {
  grid-column: 1 / -1;
}

.item--new {
  grid-template-columns: minmax(0, 1fr);
  border-style: dashed;
  background: transparent;
}

.item__add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

/* A plain line in a flush card (time off). */
.items--flush {
  gap: 0;
}

.item--line {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.item--line:first-child {
  border-top: 0;
}

/* --- "Saving… / Saved": quiet, next to what changed (plan.md §7.2) --------- */
.autosave {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.autosave__status {
  min-height: 1.5rem;
  color: var(--text-muted);
  font: 600 var(--text-sm) / 1.4 var(--font-sans);
}

.autosave__status:empty {
  min-height: 0;
}

.autosave__status[data-state="saved"] {
  color: var(--success);
}

.autosave__status[data-state="saved"]::before {
  content: "✓ ";
}

.autosave__status[data-state="error"] {
  color: var(--danger);
}

/* The Save button is for browsers without JavaScript (static/js/panel.js). */
.has-panel-js form[data-autosave] [data-fallback],
.has-panel-js form[data-refresh-times] [data-fallback] {
  display: none;
}

/* --- Opening hours: lists of times, 24-hour ---------------------------------- */
.select--time {
  flex: 1 1 0;
  min-width: 0;
}

.select--time .input--time {
  width: 100%;
  min-width: 0;
  padding-right: var(--space-8);
  padding-left: var(--space-3);
}

.select--time::after {
  right: var(--space-2);
}

.hours__day {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.hours__day > :is(.hours__open, .hours__break, .field__error) {
  grid-column: 1 / -1;
}

@media (min-width: 34rem) {
  .hours__day {
    grid-template-columns: 11rem minmax(0, 1fr);
  }

  .hours__day > :is(.hours__open, .hours__closed, .hours__break, .field__error) {
    grid-column: 2;
  }

  .hours__day > .hours__closed {
    grid-row: 1;
  }
}

.hours__day .time-range {
  max-width: none;
}

.hours__dayname {
  font-size: var(--text-md);
}

.hours__closed {
  display: flex;
  align-items: center;
  min-height: var(--touch-min);
  color: var(--text-muted);
}

/* A gap in the day (e.g. 14:00-17:00): right under the day's times, in the
   same column, on a band of its own with its label above its times, so it
   reads as part of that day at every width, never as a stray row. */
.hours__break {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-3);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}

.hours__break-label {
  color: var(--text-muted);
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
}

/* A day switched off shows "Closed" instead of its times. */
.hours__day:has(.switch__input:not(:checked)) :is(.hours__open, .hours__break) {
  display: none;
}

.hours__day:has(.switch__input:checked) .hours__closed {
  display: none;
}

/* A team member's own hours show only when the switch is on. */
.hours-form:has(#own-hours:not(:checked)) .own-hours {
  display: none;
}

.hours__add-break {
  align-self: flex-start;
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

/* --- Settings screens ---------------------------------------------------------- */
/* A card whose action cannot be undone (deleting a shop or an account). */
.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}

.screen-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.screen-head__back {
  align-self: flex-start;
  gap: var(--space-1);
  margin-left: calc(-1 * var(--space-1));
  text-decoration: none;
}

.screen-head__back .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* The shop's opening hours on its public page. */
.hours {
  display: grid;
  gap: var(--space-1);
  margin: 0;
}

.hours__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  padding-block: var(--space-1);
}

.hours__row dt {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}

.hours__row dd {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-3);
  margin: 0 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.hours__row--today dd {
  color: var(--text);
  font-weight: 600;
}

/* Light/dark and the language, at the top of every page (components/prefs.html). */
.prefs {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-1);
}

.prefs__language {
  display: flex;
}

.prefs__language-button {
  font: 600 var(--text-sm) / 1 var(--font-sans);
  letter-spacing: 0.02em;
}

/* In a step bar: back, the step's name, then these; the progress below. */
.stepbar__text {
  grid-column: 2;
  grid-row: 1;
}

.stepbar > .prefs {
  grid-column: 3;
  grid-row: 1;
}

/* A page without a bar of its own (a shop's page): the row at its top. */
.page-top {
  display: flex;
  justify-content: flex-end;
  padding-block: var(--space-2) 0;
}

.entrance__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* The platform's logo: mark and name (components/logo.html). */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.logo__mark {
  flex: none;
  width: 1.5em;
  height: 1.5em;
}

.logo__track {
  stroke: color-mix(in srgb, var(--text) 16%, transparent);
}

.logo__centre {
  fill: var(--text);
}

.logo__stop-1 {
  stop-color: var(--brand-1);
}

.logo__stop-2 {
  stop-color: var(--brand-2);
}

/* A password field with its "show" button inside the border. */
.input-reveal {
  position: relative;
  display: block;
}

.input-reveal .input {
  width: 100%;
  padding-inline-end: calc(var(--touch-min) + var(--space-1));
}

.input-reveal__button {
  position: absolute;
  inset-block: 0;
  inset-inline-end: var(--space-1);
  display: grid;
  place-items: center;
  width: var(--touch-min);
  margin-block: auto;
  height: var(--touch-min);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.input-reveal__button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.input-reveal__button .icon--when-shown,
.input-reveal__button[aria-pressed="true"] .icon--when-hidden {
  display: none;
}

.input-reveal__button[aria-pressed="true"] .icon--when-shown {
  display: block;
}

/* An input with a unit after it ("€"), inside its border. */
.input-affix {
  position: relative;
  display: block;
}

.input-affix .input {
  width: 100%;
  padding-inline-end: calc(var(--space-3) + 1.5ch);
}

.input-affix__text {
  position: absolute;
  inset-block: 0;
  inset-inline-end: var(--space-3);
  display: flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
}

.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: start;
}

.field-pair .input {
  width: 100%;
  min-width: 0;
}

/* On a phone the two would clip their text (a date, a placeholder): one under the other. */
@media (max-width: 30rem) {
  .field-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

.checks {
  display: flex;
  flex-direction: column;
}

.fixed-value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  font: 600 var(--text-md) / 1.3 var(--font-sans);
}

.fixed-value .icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
}

.soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
}

.soon .field__help {
  flex-basis: 100%;
}

.soon .switch {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Logo and cover photo. */
.picture {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
  align-items: start;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.picture:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.picture > form:last-child:not(.picture__form),
.picture > .focus-form {
  grid-column: 1 / -1;
}

/* On a phone the preview sits above its form, which then has the full width. */
@media (max-width: 30rem) {
  .picture {
    grid-template-columns: minmax(0, 1fr);
  }
}

.picture__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.picture__preview {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-muted);
  object-fit: cover;
}

.picture__preview--cover {
  width: 6.5rem;
}

.picture__preview--logo {
  border-radius: 50%;
}

/* "Choose a photo": our button (a label) in front of the browser's file input,
   which stays in the page for the keyboard and the form, but unseen. */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
}

.file-button {
  align-self: flex-start;
  max-width: 100%;
  white-space: normal;
  cursor: pointer;
}

.file-input:focus-visible + .file-button {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.file-name {
  color: var(--text-muted);
  font: 600 var(--text-sm) / 1.4 var(--font-sans);
  overflow-wrap: anywhere;
}

/* Things only JavaScript can do (static/js/panel.js), e.g. "Same break on every open day". */
html:not(.has-panel-js) .js-only {
  display: none;
}

/* Scrolled to on load: clear of the sticky bars at the top. */
[data-error-summary] {
  scroll-margin-top: 7rem;
}

.error-summary {
  margin: 0;
  padding-left: var(--space-4);
}

.error-summary a {
  color: inherit;
}

/* The link to the page, with "Copy link". */
.linkbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

@media (min-width: 30rem) {
  .linkbox {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.linkbox__url {
  align-self: center;
  font: 600 var(--text-md) / 1.4 var(--font-sans);
  overflow-wrap: anywhere;
}

/* A long secret link on one line, cut at the end: the copy button takes all of it. */
.linkbox__url--clip {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  color: var(--text-muted);
  font-weight: 400;
}

.qr--large {
  width: 15rem;
}

.qr-card {
  align-items: stretch;
}

.qr-card__url {
  font: 600 var(--text-md) / 1.4 var(--font-sans);
  text-align: center;
  overflow-wrap: anywhere;
}

/* --- The end of the wizard: the page is ready --------------------------------- */
.done {
  align-items: stretch;
}

.done__mark {
  align-self: center;
}

.done .wizard__question {
  text-align: center;
}

/* The page as customers see it, a little smaller, nothing in it tappable. */
.preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-xl);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
}

/* --- The shop's public page ------------------------------------------------------ */
/* One column on a phone; on a wider screen the page grows with it (like the
   landing page) and puts the hours and the description beside the services. */
.page--shop {
  max-width: 40rem;
}

.shop-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--space-4);
  padding-top: max(var(--space-4), env(safe-area-inset-top));
  padding-bottom: var(--space-8);
}

.shop-about__text {
  overflow-wrap: anywhere;
}

@media (min-width: 48rem) {
  .page--shop {
    max-width: 58rem;
  }

  .shop-page {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: var(--space-5);
  }

  .shop-page > * {
    grid-column: 1;
  }

  .shop-page > .cover {
    grid-column: 1 / -1;
    min-height: 20rem;
  }

  /* Beside the services: the description and the hours, one under the other. */
  .shop-page > .shop-about,
  .shop-page > .hours-card {
    grid-column: 2;
  }

  .shop-page--about > .shop-about {
    grid-row: 2;
  }

  .shop-page > .hours-card {
    grid-row: 2;
  }

  .shop-page--about > .hours-card {
    grid-row: 3;
  }

  .shop-page--about > .shop-about + * {
    grid-row: 2 / span 2;
  }

  .shop-page:not(.shop-page--about) > .cover + * {
    grid-row: 2;
  }
}

@media (min-width: 64rem) {
  .page--shop {
    max-width: min(88vw, 76rem);
  }

  .shop-page > .cover {
    min-height: 24rem;
  }
}

.cover {
  min-height: 15rem;
}

/* Without a photo: the shop's colour behind the glass card. */
.cover:not(.cover--photo) {
  min-height: 12rem;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
    radial-gradient(90% 80% at 100% 100%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
    var(--surface-2);
}

.cover__logo--picture {
  object-fit: cover;
  background: var(--surface);
}

h1.cover__name {
  font-size: var(--text-2xl);
}

/* The same name in the wizard's preview, where it is not the page's heading. */
p.cover__name {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-snug);
  letter-spacing: -0.015em;
}

a.service {
  text-decoration: none;
}

.footer form + .text-muted {
  flex-basis: 100%;
}

/* The wizard's footer lines up with its narrow column. */
.wizard + .footer {
  max-width: 40rem;
}

/* --- The booking pages (plan.md §6; templates/booking/) ------------------------------ */
.booking {
  padding-top: max(var(--space-3), env(safe-area-inset-top));
}

.page--booking-wide {
  max-width: 58rem;
  padding-bottom: var(--space-8);
}

.booking__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-4);
}

.booking__step:focus {
  outline: none;
}

.booking-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.booking-head__shop {
  color: var(--accent);
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
}

/* One choice, two layouts: a strip of days and that day's times on a phone,
   the week as in docs/reference-calendar.png on a large screen. */
.picker__wide {
  display: none;
}

@media (min-width: 48rem) {
  .picker__phone {
    display: none;
  }

  .picker__wide {
    display: block;
  }

  /* The week is the choice here, and a day's "see its free times" (in the
     phone layout) is hidden: "Continue" stays the main action. */
  [data-continue] {
    --btn-bg: var(--primary);
    --btn-bg-hover: var(--primary-hover);
    --btn-fg: var(--on-primary);
  }
}

.daystrip {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.daystrip__track {
  flex: 1;
  display: flex;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  padding: var(--space-1) var(--space-1) var(--space-2);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.daystrip__track::-webkit-scrollbar {
  display: none;
}

.daystrip__track > li {
  flex: none;
  scroll-snap-align: start;
}

.daystrip__more {
  flex: none;
}

.daylink {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 4rem;
  min-height: 5rem;
  padding-inline: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font: 600 var(--text-sm) / 1.15 var(--font-sans);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.daylink__name,
.daylink__note {
  color: var(--text-muted);
}

.daylink__num {
  font: 600 var(--text-xl) / 1.1 var(--font-display);
}

.daylink--today .daylink__name {
  color: var(--accent);
}

/* A day without free times: hatched like a time that cannot be booked. */
.daylink--none,
.daylink--off {
  background: repeating-linear-gradient(135deg, var(--closed-a) 0 7px, var(--closed-b) 7px 10px);
}

.daylink--off {
  color: var(--text-muted);
}

.daylink[aria-current="date"] {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.daylink[aria-current="date"] :is(.daylink__name, .daylink__note) {
  color: var(--on-primary);
}

.daylink:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* The week: a cell holds one time. */
.week__cell {
  display: grid;
  gap: 4px;
}

/* With a mouse the week is compact, close to docs/reference-calendar.png:
   a working day fits on the screen. Fingers keep 44 px rows. */
@media (pointer: fine) {
  .week__col {
    grid-auto-rows: 1.75rem;
    gap: 4px;
  }

  .week__col .slot,
  .week__col .slot-closed {
    min-height: 1.75rem;
  }
}

/* Which of the two 03:00 on the night the clocks go back. */
.slot__note {
  display: block;
  font: 500 var(--text-sm) / 1.1 var(--font-sans);
}

.slot:has(.slot__note) {
  flex-direction: column;
  padding-block: var(--space-1);
}

.week__time .slot__note {
  margin-left: var(--space-1);
}

/* "Continue with Google": the alternative to the form, smaller than its main button. */
.google-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.google-option__text {
  flex: 1 1 14rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.week__nav-space {
  width: var(--touch-min);
}

.week__empty {
  margin-top: var(--space-4);
}

/* "Kept for you until 14:32", with the minutes left. */
.hold {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}

.hold .icon {
  color: var(--accent);
}

.hold__left {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Buttons on the grey "no free times" box stand out from it (the main one
   keeps its own colours). */
.slots__empty .btn:not(.btn--primary) {
  --btn-bg: var(--surface);
  --btn-bg-hover: var(--surface-3);
}

/* "Add to calendar": Google, and the .ics file for Apple and Outlook, side by side. */
.calendar-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-2);
}

/* An email proved with Google or a code. */
.proved {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  font: 600 var(--text-md) / 1.3 var(--font-sans);
  overflow-wrap: anywhere;
}

.proved .icon {
  color: var(--success);
}

.break {
  overflow-wrap: anywhere;
}

.privacy-note {
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* The trap for bots (booking/_honeypot.html): never on screen. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (hover: hover) {
  .daylink:hover:not([aria-current="date"]) {
    background-color: var(--surface-2);
  }
}

/* Each step slides in from the side it comes from (plan.md §8, 150-250 ms). */
@media (prefers-reduced-motion: no-preference) {
  .booking__step {
    animation: step-in-forward var(--dur) var(--ease-out) both;
  }

  :root[data-direction="back"] .booking__step {
    animation-name: step-in-back;
  }
}

/* === The owner's day: Today, Calendar, appointments, customers (Phase 5) ===== */
.page--wide {
  padding-block: var(--space-6) var(--space-8);
}

.center {
  text-align: center;
}

.screen-head--split {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* A row of a list that opens its own page: the whole name block is the link. */
.row__link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--touch-min);
  color: inherit;
  text-decoration: none;
}

.row__link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.row__actions form {
  display: contents;
}

.list--compact .row {
  min-height: 3.5rem;
  padding-left: var(--space-3);
}

.card__actions {
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid var(--border);
}

/* Links that look like the segmented control (Day / Week). */
.segmented__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--touch-min) - 2 * 4px);
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  color: var(--text);
  font: 600 var(--text-sm) / 1 var(--font-sans);
  text-decoration: none;
}

.segmented__link.is-current {
  background: var(--primary);
  color: var(--on-primary);
}

/* Neither "Day" nor "Week" chosen: the screen picks (.cal--auto), and the
   switch shows what it picked: the day on a phone or a tablet, the week on
   a large screen (the same width as the rule that picks it). */
main:has(.cal--auto) .cal-switch .segmented__link:first-child {
  background: var(--primary);
  color: var(--on-primary);
}

@media (min-width: 62rem) {
  main:has(.cal--auto) .cal-switch .segmented__link:first-child {
    background: transparent;
    color: inherit;
  }

  main:has(.cal--auto) .cal-switch .segmented__link:last-child {
    background: var(--primary);
    color: var(--on-primary);
  }
}

.segmented__link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Calendar --------------------------------------------------------------- */
.cal {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Without "Day" or "Week" chosen, the screen picks: the day on a phone, the
   week on a large screen (the page holds both). */
.cal--auto .cal-week {
  display: none;
}

@media (min-width: 62rem) {
  .cal--auto .cal-week {
    display: block;
  }

  .cal--auto .cal-day {
    display: none;
  }
}

.cal__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) 0;
}

.cal__title {
  font: 600 var(--text-lg) / 1.3 var(--font-serif);
  letter-spacing: 0;
  text-align: center;
}

.cal__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-3) var(--space-4) 0;
  font-size: var(--text-sm);
}

.cal__legend .tz-note {
  margin-left: auto;
}

.legend--busy::before {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

/* A strip of days, as links. */
.cal-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4) 0;
}

form .cal-strip,
.card.stack > .cal-strip {
  padding: 0;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-strip__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 3.25rem;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.cal-strip__name {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.cal-strip__num {
  font: 600 var(--text-md) / 1 var(--font-sans);
}

.cal-strip__day.is-today .cal-strip__name {
  color: var(--accent);
  font-weight: 600;
}

.cal-strip__day.is-current {
  background: var(--primary);
  color: var(--on-primary);
}

.cal-strip__day.is-current .cal-strip__name {
  color: var(--on-primary);
}

.cal-strip__day:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.cal__scroll {
  /* The table may be wider than a phone (the week): it scrolls on its own,
     never the page. */
  position: relative;
  max-height: max(24rem, calc(100dvh - 16rem));
  margin-top: var(--space-3);
  overflow: auto;
  overscroll-behavior: contain;
}

.cal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.cal-table--week {
  min-width: 46rem;
}

.cal__corner,
.cal__time {
  width: 3.5rem;
}

.cal__colhead {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--space-2) var(--space-1);
  background: var(--surface);
  font: 600 var(--text-sm) / 1.2 var(--font-sans);
  text-align: center;
  overflow-wrap: anywhere;
}

.cal__corner {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

.cal__daylink {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: var(--touch-min);
  justify-content: center;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

.cal__dayname {
  font-weight: 600;
}

.cal__date {
  color: var(--text-muted);
  font-weight: 400;
}

.cal__colhead.is-today .cal__dayname {
  color: var(--accent);
}

.cal__time {
  padding: 0 var(--space-2) 0 0;
  color: var(--text-muted);
  font: 400 var(--text-sm) / 1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  text-align: right;
  vertical-align: top;
  /* Only the full hours are shown: the quarter hours are for screen readers. */
  color: transparent;
}

.cal__row--hour .cal__time {
  color: var(--text-muted);
}

.cal__row--hour > .cal__cell,
.cal__row--hour > .cal__time {
  border-top: 1px solid var(--border);
}

.cal__cell {
  height: var(--touch-min);
  padding: 2px;
  vertical-align: top;
}

.cal__cell--closed {
  background: repeating-linear-gradient(135deg, var(--closed-a) 0 7px, var(--closed-b) 7px 10px);
  background-clip: padding-box;
}

.cal__label {
  display: inline-block;
  margin: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.cal__cell--past {
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
}

/* A free time: the whole cell is the link to a new appointment. Soft green,
   like the free times of docs/reference-calendar.png, with a quiet "+" that
   says it can be tapped (a phone has no hover to tell it). */
.cal__free {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: calc(var(--touch-min) - 4px);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--free-bg) 55%, transparent);
  color: var(--free-text);
  text-decoration: none;
}

.cal__free::after {
  content: "+";
  font: 600 var(--text-lg) / 1 var(--font-sans);
  opacity: 0.4;
}

.cal__free:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.cal__free:focus-visible::after {
  opacity: 1;
}

.cal-appt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: calc(var(--touch-min) - 4px);
  margin-bottom: 2px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent-fill);
  color: var(--text);
  font: 400 var(--text-sm) / 1.3 var(--font-sans);
  text-decoration: none;
  overflow: hidden;
}

/* A lone appointment fills the rows it spans (a percentage height does not
   reach through a cell's rowspan, so it is placed over the whole cell);
   several (different people at once, in the week) stack, each as tall as
   its text. */
.cal__cell--busy {
  position: relative;
}

.cal__cell--busy > .cal-appt:only-child {
  position: absolute;
  inset: 2px;
  margin-bottom: 0;
}

.cal-appt:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -1px;
}

/* Each line of an entry is one line: cut with "…", never broken mid-word
   or sliced in half by the bottom of the box (the box hides whole lines). */
.cal-appt > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cal-appt__time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cal-appt__name {
  font-weight: 600;
}

.cal-appt__meta {
  color: var(--text-muted);
}

/* One row high: the time and the name on one line, the name cut short with
   "…"; the service is on the appointment's own page. */
.cal-appt--short {
  flex-direction: row;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.cal-appt--short .cal-appt__time {
  flex: none;
  color: var(--text);
  font-weight: 600;
}

.cal-appt--short .cal-appt__name {
  min-width: 0;
  font-weight: 600;
}

.cal-appt--short .cal-appt__meta {
  display: none;
}

.cal-appt--completed,
.cal-appt--no_show {
  background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--border-strong);
}

.cal-appt--no_show .cal-appt__name {
  text-decoration: line-through;
}

.cal-appt--hold {
  justify-content: center;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--text-muted);
}

/* --- New appointment, new time ----------------------------------------------- */
.more {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Looks like what it does, "+ add": an optional field the owner opens with a tap
   (a plain label here read as a field that failed to load). */
.more__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  min-height: var(--touch-min);
  color: var(--accent);
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
  list-style: none;
  cursor: pointer;
}

.more__toggle::-webkit-details-marker {
  display: none;
}

.more__icon {
  flex: none;
  transition: transform 0.15s ease;
}

.more[open] > .more__toggle .more__icon {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .more__icon {
    transition: none;
  }
}

.more__toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.choice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pill {
  position: relative;
  display: inline-flex;
}

.pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pill span {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0 var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  font: 600 var(--text-sm) / 1.2 var(--font-sans);
}

.pill input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.pill input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Times that book (or move) at once: buttons that look like free times. */
.slot--submit {
  width: 100%;
  cursor: pointer;
  font-family: var(--font-sans);
}

.slot--submit.is-chosen,
.slot--submit:active {
  border-color: var(--accent);
  background: var(--accent-fill);
  color: var(--on-accent-fill);
}

.slot--submit:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.other-time {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.other-time__fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-2);
  align-items: end;
}

.other-time__fields .field {
  gap: 0;
}

.other-time__fields .input {
  width: 100%;
  min-width: 0;
}

.other-time__fields .btn {
  grid-column: 1 / -1;
}

@media (min-width: 36rem) {
  .other-time__fields {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  }

  .other-time__fields .btn {
    grid-column: auto;
  }
}

/* --- Customers ------------------------------------------------------------- */
.search {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.search__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.person-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 4rem;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.list > li:first-child > .person-row {
  border-top: 0;
}

.person-row:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.person-row > .icon {
  color: var(--text-muted);
}

.person-row__main:only-of-type,
.person-row > .person-row__main:first-child {
  grid-column: 1 / 3;
}

.person-row__initials {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 var(--text-md) / 1 var(--font-sans);
}

.person-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.person-row__name {
  font: 600 var(--text-md) / 1.3 var(--font-sans);
  overflow-wrap: anywhere;
}

.person-row__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}

.radio-list {
  display: flex;
  flex-direction: column;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding-left: var(--space-5);
}

/* "Undo" in its toast: the form sits in the row like a button. */
.toast--undo form {
  display: contents;
}

@media (hover: hover) {
  .cal__free:hover::after {
    opacity: 1;
  }

  .cal__free:hover {
    background: var(--free-bg);
  }

  .cal-appt:hover {
    background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%);
  }

  .person-row:hover,
  .row__link:hover .row__title {
    text-decoration: underline;
  }

  .pill:hover input:not(:checked) + span {
    background: var(--surface-2);
  }

  .slot--submit:hover {
    background: var(--free-bg-hover);
  }

  .segmented__link:not(.is-current):hover,
  .cal-strip__day:not(.is-current):hover {
    background: var(--surface-2);
  }
}

/* --- Several services in one appointment (booking/times.html) ------------------ */
.add-services {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.add-services__title {
  font: 600 var(--text-base) / 1.3 var(--font-sans);
}

.add-services__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--touch-min);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: 600 var(--text-sm) / 1.2 var(--font-sans);
  text-decoration: none;
}

.chip-link:hover {
  background: var(--surface-2);
}

.chip-link__meta {
  color: var(--text-muted);
  font-weight: 400;
}

.chip-link--on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chip-link__x {
  margin-left: var(--space-1);
  opacity: 0.7;
}

/* === Large screens: everything grows (the owner's wish of 17/11/2026) ===========
   A phone keeps its one column; a tablet gets a little more room; a computer
   uses its width: the type itself grows a step on wide screens (every size is
   in rem), and the columns that were sized for a phone widen. */
@media (min-width: 64rem) {
  .page--narrow {
    max-width: 52rem;
  }

  .entrance--wide {
    max-width: 64rem;
  }

  .page--booking-wide {
    max-width: 68rem;
  }

  .page--shop {
    max-width: min(90vw, 80rem);
  }
}

@media (min-width: 90rem) {
  :root {
    --page-max: 88rem;
  }

  .page--narrow {
    max-width: 58rem;
  }

  .page--booking-wide {
    max-width: 76rem;
  }

  .entrance--wide {
    max-width: 72rem;
  }
}

/* The legal texts' tables: a real table on a large screen, each column wide
   enough for its words; on a phone they scroll sideways, never squeezed to
   a word per line. */
.legal-text table {
  display: table;
  width: 100%;
}

.legal-text .table-wrap,
.legal-text table {
  overflow-x: auto;
}

.legal-text th,
.legal-text td {
  min-width: 9rem;
  overflow-wrap: normal;
  hyphens: auto;
}

@media (max-width: 48rem) {
  .legal-text table {
    display: block;
  }

  .legal-text th,
  .legal-text td {
    min-width: 12rem;
  }
}

/* === Cookie banner (components/cookie_banner.html) ============================= */
/* Small, in a bottom corner on a large screen, above the bottom bar on a phone. */
.cookie-banner {
  position: fixed;
  left: max(var(--space-3), env(safe-area-inset-left));
  right: max(var(--space-3), env(safe-area-inset-right));
  bottom: max(var(--space-3), env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 34rem;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  font: 400 var(--text-sm) / 1.45 var(--font-sans);
}

.has-tabbar .cookie-banner {
  bottom: calc(max(var(--space-3), env(safe-area-inset-bottom)) + 5.5rem);
}

.cookie-banner__title {
  font: 600 var(--text-base) / 1.2 var(--font-sans);
}

.cookie-banner__text {
  margin: 0;
  line-height: 1.45;
}

/* The three choices side by side, equal, at every width. */
.cookie-banner__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.cookie-banner__actions .btn {
  padding-inline: var(--space-2);
  white-space: normal;
  line-height: 1.2;
}

@media (max-width: 30rem) {
  .cookie-banner {
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .cookie-banner__title {
    display: none;
  }
}

@media (min-width: 64rem) {
  .has-sidenav .cookie-banner {
    left: auto;
    bottom: var(--space-4);
  }

  .cookie-banner {
    right: auto;
  }
}

/* === A picture's focal point (settings/_focus.html) ============================== */
.focus-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Folded by default: it is set once, then rarely changed. */
.focus-details__summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
  cursor: pointer;
}

.focus-details[open] > .focus-details__summary {
  margin-bottom: var(--space-2);
}

.focus-details__body {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 48rem) {
  .focus-details__body {
    grid-template-columns: minmax(0, 28rem) minmax(0, 1fr);
    align-items: start;
  }
}

.focus-picker {
  position: relative;
  max-width: 28rem;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  cursor: crosshair;
  user-select: none;
  touch-action: manipulation;
}

.focus-picker__img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* The point chosen: a ring with a dot, centred on it (left/top: static/css/focus.css). */
.focus-picker__dot {
  position: absolute;
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 18%, transparent 20%);
  box-shadow: 0 0 0 2px rgb(0 0 0 / 0.45), 0 2px 10px rgb(0 0 0 / 0.4);
  translate: -50% -50%;
  pointer-events: none;
}

.focus-previews {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

.focus-preview {
  display: block;
  object-fit: cover;
  background: var(--surface-2);
}

.focus-preview--round {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
}

.focus-preview--wide {
  width: 12rem;
  height: 4.5rem;
  border-radius: var(--radius-sm);
}

.focus-preview--tall {
  width: 6rem;
  height: 6.5rem;
  border-radius: var(--radius-sm);
}

.focus-preview-frame {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.focus-form__list {
  flex: 1 1 9rem;
}

/* With JavaScript the photo itself is the control; the lists stay for keyboards. */
.has-panel-js .focus-form__lists {
  font-size: var(--text-sm);
}

/* === The gallery: settings (settings/photos.html) and the shop's page ============= */
.photo-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.photo-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.photo-item__number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-2);
  font: 600 var(--text-sm) / 1 var(--font-sans);
}

.photo-item__actions form {
  margin: 0;
}

.shop-photos__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 70%;
  gap: var(--space-2);
  margin: 0;
  padding: 0 0 var(--space-1);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  list-style: none;
}

.shop-photos__list > li {
  scroll-snap-align: start;
}

.shop-photos__item {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
}

.shop-photos__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale var(--dur-slow) var(--ease-out);
}

.shop-photos__item:hover img {
  scale: 1.04;
}

@media (min-width: 40rem) {
  .shop-photos__list {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    grid-auto-columns: auto;
    overflow: visible;
  }
}

/* === Scores 1-10 (booking/review.html) ========================================= */
.scores {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
}

@media (min-width: 30rem) {
  .scores {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
}

.score {
  position: relative;
}

.score input {
  position: absolute;
  opacity: 0;
}

.score span {
  display: grid;
  place-items: center;
  min-height: var(--touch-min);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  font: 600 var(--text-base) / 1 var(--font-sans);
  cursor: pointer;
}

.score input:checked + span {
  border-color: var(--accent);
  background: var(--accent-fill);
  color: var(--on-accent-fill);
}

.score input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* === Reviews (public/_shop_content.html) ========================================== */
.rating-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-top: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--accent-fill);
  color: var(--on-accent-fill);
  font: 600 var(--text-sm) / 1.4 var(--font-sans);
  text-decoration: none;
}

.rating-badge__score {
  font-weight: 600;
}

.rating-badge__of {
  opacity: 0.8;
}

.rating-badge__count {
  margin-left: var(--space-1);
  font-weight: 400;
}

.shop-reviews__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.shop-reviews__total {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.shop-reviews__score {
  color: var(--text);
  font: 600 var(--text-xl) / 1 var(--font-display);
}

.shop-reviews__filter {
  align-self: flex-start;
}

.review-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
}

.review__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  font-family: var(--font-sans);
}

.review__score {
  display: grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--text);
  font: 600 var(--text-base) / 1 var(--font-sans);
}

.review__author {
  font-weight: 600;
}

.review__date {
  font-size: var(--text-sm);
}

.review__text {
  margin: 0;
  overflow-wrap: anywhere;
}

.review__reply {
  margin-left: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.review__reply p {
  margin: 0;
}

.review__reply-by {
  color: var(--text-muted);
  font: 600 var(--text-sm) / 1.4 var(--font-sans);
}

/* Google's address search in the shop settings (static/js/maps.js). */
.place-search {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.place-search > .btn {
  align-self: flex-start;
}

.place-search__input {
  width: 100%;
}

/* --- A team member's photo (settings/_staff_photo.html, booking/person.html) --- */
.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  font: 600 var(--text-sm) / 1 var(--font-sans);
  object-fit: cover;
}

.setting > .avatar {
  width: 2.5rem;
  height: 2.5rem;
}

.avatar--lg {
  width: 6rem;
  height: 6rem;
  font-size: var(--text-xl);
}

.staff-photo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.staff-photo > .picture__form {
  flex: 1 1 16rem;
}

a.service--person {
  justify-content: flex-start;
  gap: var(--space-3);
}

a.service--person > .icon:last-child {
  margin-left: auto;
}

/* === Smooth, unbroken motion (18/11/2026) =====================================
 * One easing everywhere (--ease-out: soft, no bounce), short durations.
 * - From page to page: the bars and the side bar stay put, the page's
 *   content cross-fades with a small rise (a view transition between two
 *   documents; browsers without it simply load the page).
 * - Everything that can be tapped eases its colours, borders and shadow,
 *   and gives a little under the finger.
 * - The account menu and the questions of the landing page open and close
 *   smoothly; light <-> dark is one cross-fade (static/js/ui.js).
 * None of it when the device asks for less motion.                          */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  html {
    scroll-behavior: smooth;
    interpolate-size: allow-keywords;
  }

  .sidenav {
    view-transition-name: sidenav;
  }

  .topbar {
    view-transition-name: topbar;
  }

  .tabbar {
    view-transition-name: tabbar;
  }

  ::view-transition-old(root) {
    animation: page-out 160ms var(--ease-out) both;
  }

  ::view-transition-new(root) {
    animation: page-in 360ms var(--ease-out) both;
  }

  /* The bars move only if they really changed (another page's bar). */
  ::view-transition-group(sidenav),
  ::view-transition-group(topbar),
  ::view-transition-group(tabbar) {
    animation-duration: var(--dur);
    animation-timing-function: var(--ease-out);
  }

  /* Light <-> dark: a plain cross-fade, nothing rises. */
  :root[data-swap="theme"]::view-transition-old(root) {
    animation: fade-out var(--dur-slow) var(--ease-out) both;
  }

  :root[data-swap="theme"]::view-transition-new(root) {
    animation: fade-in var(--dur-slow) var(--ease-out) both;
  }

  .btn,
  .btn-icon,
  .service,
  .setting,
  .chip-link,
  .cal__free,
  .cal-appt,
  .sidenav__item,
  .tabbar__item,
  .menu__item,
  .slot,
  .swatch__inner,
  .segmented__link,
  .segmented__option span,
  .link-tap,
  .input,
  .switch__track,
  .card {
    transition:
      background-color var(--dur) var(--ease-out),
      border-color var(--dur) var(--ease-out),
      color var(--dur) var(--ease-out),
      box-shadow var(--dur) var(--ease-out),
      transform var(--dur-fast) var(--ease-out);
  }

  .service:active,
  .setting:active,
  .chip-link:active,
  .cal__free:active,
  .cal-appt:active,
  .sidenav__item:active,
  .tabbar__item:active,
  .slot:active {
    transform: scale(0.985);
  }

  /* The account menu: in and out (the "in" keyframes above stay for older
     browsers; this adds the way out). */
  .menu {
    transition:
      opacity var(--dur) var(--ease-out),
      transform var(--dur) var(--ease-out),
      overlay var(--dur) allow-discrete,
      display var(--dur) allow-discrete;
    opacity: 0;
    transform: translateY(-0.375rem) scale(0.98);
  }

  .menu:popover-open {
    opacity: 1;
    transform: none;
  }

  @starting-style {
    .menu:popover-open {
      opacity: 0;
      transform: translateY(-0.375rem) scale(0.98);
    }
  }

  /* Questions and "the numbers, day by day": open and close to their height. */
  details::details-content {
    overflow: clip;
    block-size: 0;
    transition:
      block-size var(--dur-slow) var(--ease-out),
      content-visibility var(--dur-slow) allow-discrete;
  }

  details[open]::details-content {
    block-size: auto;
  }
}

@keyframes page-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* --- The current section's mark (components/nav_items.html) -------------------
 * A short honey line: on top of the current tab in the bottom bar, on the
 * left of the current item in the side bar. From page to page it slides
 * from the old section to the new one, however far apart they are (each
 * bar's mark has its own view-transition name).                           */
.tabbar__item,
.sidenav__item {
  position: relative;
}

.tabbar__item {
  text-align: center;
}

.nav-indicator {
  position: absolute;
  border-radius: var(--radius-round);
  background: var(--accent-fill);
  pointer-events: none;
}

.tabbar .nav-indicator {
  top: 3px;
  left: calc(50% - 0.75rem);
  width: 1.5rem;
  height: 3px;
}

.sidenav .nav-indicator {
  top: 0.625rem;
  bottom: 0.625rem;
  left: 0;
  width: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .tabbar .nav-indicator {
    view-transition-name: nav-mark-tab;
  }

  .sidenav .nav-indicator {
    view-transition-name: nav-mark-side;
  }

  ::view-transition-group(nav-mark-tab),
  ::view-transition-group(nav-mark-side) {
    animation-duration: var(--dur-slow);
    animation-timing-function: var(--ease-out);
  }
}

/* --- "Your shop on your home screen" (panel/_install.html) --------------------- *
 * Small: an icon, one line of title, one of text, two small buttons in a row.
 * The body takes the room left by the icon and wraps in it (min-width: 0):
 * otherwise it kept its one-line width and pushed the page wider than a
 * phone, and Chrome zoomed the whole page out like a desktop site.        */
.install-hint {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.install-hint[hidden] {
  display: none;
}

.install-hint__icon {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
}

.install-hint__body {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-width: 0;
}

.install-hint__title {
  flex-basis: 100%;
  font: 600 var(--text-sm) / 1.3 var(--font-sans);
  letter-spacing: 0;
}

.install-hint__text {
  flex-basis: 100%;
  order: 1;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.install-hint__actions {
  display: flex;
  flex-wrap: wrap;
  order: 2;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.push-card__icon {
  display: grid;
  place-items: center;
  background: var(--accent-fill);
  color: var(--on-accent-fill);
}


/* --- The calendar on a phone (18/11/2026) ---------------------------------------
 * The hours take the screen: no page title (the bottom bar says it), no
 * Day/Week switch (a week does not fit; a day's column in the week leads
 * to it), a small date line, no legend. The days and the arrows stay at
 * the top while the hours scroll, and the hours scroll with the page
 * itself: one scroll, wherever the finger is (no box scrolling inside the
 * page). static/js/panel.js opens it at the current time.                */
@media (max-width: 47.99rem) {
  .cal-page-head {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .cal-day.card {
    overflow: clip;
  }

  .cal-day .cal__top {
    position: sticky;
    top: var(--sticky-top, 0);
    z-index: 5;
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    /* Covers the gap between the top bar and this part, so the hours that
       scroll by never show through it. */
    box-shadow: 0 calc(-1 * var(--space-3)) 0 0 var(--bg);
  }

  .cal-day .cal__head {
    gap: var(--space-2);
    padding: var(--space-2) var(--space-2) 0;
  }

  .cal-day .cal__title {
    font: 600 var(--text-sm) / 1.3 var(--font-sans);
  }

  .cal-day .cal-strip {
    padding: var(--space-1) var(--space-2) 0;
  }

  .cal-day .cal-strip__day {
    min-height: var(--touch-min);
  }

  .cal-day .cal__legend {
    display: none;
  }

  .cal-day .cal__scroll {
    max-height: none;
    margin-top: 0;
    overflow: visible;
  }

  .cal-day .cal__colhead,
  .cal-day .cal__corner {
    position: static;
  }
}

/* --- Where a customer's appointment stands (booking/manage.html) ------------- */
.appt-state {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.appt-state__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-round);
  background: var(--surface-2);
  color: var(--text-muted);
}

.appt-state--done .appt-state__icon {
  background: var(--accent-fill);
  color: var(--on-accent-fill);
}

.appt-state--cancelled_by_customer .appt-state__icon,
.appt-state--cancelled_by_business .appt-state__icon {
  background: var(--danger-soft);
  color: var(--danger);
}

/* A cancelled or past appointment: its details, quieter. */
.summary--past dd {
  color: var(--text-muted);
}

.appt-state--cancelled_by_customer ~ .summary--past dd,
.appt-state--cancelled_by_business ~ .summary--past dd {
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
}

/* --- "Your choice" (booking/_selection.html) ------------------------------------
 * What is being booked is the largest thing after the question: each service
 * in large type with its length and price; "Anything else?" below it,
 * quieter (dashed, smaller), so a suggestion never looks like the choice.  */
.selection {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.selection__label {
  color: var(--text-muted);
  font: 500 var(--text-sm) / 1.3 var(--font-sans);
}

.selection__services {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.selection__service {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-3);
  border-left: 3px solid var(--accent-fill);
}

.selection__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.selection__name {
  font: 600 var(--text-xl) / 1.2 var(--font-sans);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.selection__meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.selection__remove {
  flex: none;
}

.selection__total {
  font: 600 var(--text-sm) / 1.4 var(--font-sans);
}

.selection__more {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.selection__more-title {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.chip-link--suggest {
  flex-wrap: wrap;
  border-style: dashed;
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
}

.chip-link--suggest:hover {
  color: var(--text);
}

/* The bar at the bottom: what, then when. */
.actionbar__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.actionbar__what {
  overflow: hidden;
  color: var(--text-muted);
  font: 500 var(--text-sm) / 1.3 var(--font-sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* The platform's logo at the top of a business's page and the booking
   steps: back to the front page (the search). */
.page-top--home {
  justify-content: space-between;
  align-items: center;
}

.page-top__home {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  color: var(--text);
  font: 600 var(--text-md) / 1 var(--font-sans);
  text-decoration: none;
}
