@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #f3f5f7;
  --canvas: #eceff2;
  --text: #14161a;
  --muted: #67707e;
  --border: #d9dee5;
  --brand-blue: #006da8;
  --blue: #006da8;
  --blue-ink: #005b8d;
  --blue-soft: rgba(0, 109, 168, 0.1);
  --gold: #8a5a12;
  --gold-soft: #f6efe1;
  --green: #0b6b36;
  --green-soft: #eaf6ef;
  --danger: #b23a32;
  --shadow: 0 8px 24px rgba(17, 18, 20, 0.06);
  --radius: 8px;
  --radius-card: 10px;
  --radius-pill: 99px;
  --safe-top: max(env(safe-area-inset-top), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

:root[data-theme="dark"] {
  --bg: #14171f;
  --surface: #1b202b;
  --canvas: #0e1118;
  --text: #e9ebf0;
  --muted: #99a2b1;
  --border: #2d3442;
  --brand-blue: #59b8f4;
  --blue: #59b8f4;
  --blue-ink: #7cc7f7;
  --blue-soft: rgba(89, 184, 244, 0.13);
  --gold: #dfa952;
  --gold-soft: #2c2517;
  --green: #55c77b;
  --green-soft: #16281d;
  --danger: #ff8177;
  --shadow: none;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #14171f;
    --surface: #1b202b;
    --canvas: #0e1118;
    --text: #e9ebf0;
    --muted: #99a2b1;
    --border: #2d3442;
    --brand-blue: #59b8f4;
    --blue: #59b8f4;
    --blue-ink: #7cc7f7;
    --blue-soft: rgba(89, 184, 244, 0.13);
    --gold: #dfa952;
    --gold-soft: #2c2517;
    --green: #55c77b;
    --green-soft: #16281d;
    --danger: #ff8177;
    --shadow: none;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  height: var(--tg-viewport-height, 100dvh);
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  overflow: hidden;
  background: var(--bg);
}

.brand-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: calc(72px + var(--safe-top));
  padding: calc(14px + var(--safe-top)) 20px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand-lockup {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  gap: 10px;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.brand-name {
  display: inline-flex;
  min-width: 0;
  color: var(--text);
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.brand-name-aqua {
  color: var(--brand-blue);
}

.brand-name-lab {
  color: var(--text);
}

.app-frame {
  display: grid;
  height: calc(var(--tg-viewport-height, 100dvh) - 72px - var(--safe-top));
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

.main-content {
  grid-row: 1;
  width: 100%;
  max-width: 760px;
  min-height: 0;
  margin: 0 auto;
  padding: 32px 20px 30px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.page-title {
  margin: 0 0 34px;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.view-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.view-heading .page-title {
  margin: 0;
}

.view-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.home-grid,
.home-aside {
  min-width: 0;
}

.loyalty-overview {
  min-width: 0;
}

.level-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.level-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid currentColor;
  border-radius: var(--radius);
}

.level-icon .icon {
  width: 28px;
  height: 28px;
}

.level-line h2 {
  min-width: 0;
  margin: 0;
  color: var(--gold);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cashback-rate {
  color: var(--gold);
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.cashback-balance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--muted);
  font-size: 14px;
}

.cashback-balance-row strong {
  color: var(--blue-ink);
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.visit-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 36px;
  font-size: 15px;
  line-height: 1.35;
}

.summary-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.summary-item .icon {
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
}

.summary-next {
  justify-content: flex-end;
  text-align: right;
}

.summary-divider {
  width: 1px;
  height: 34px;
  background: var(--border);
}

.progress-block {
  margin-top: 34px;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  background: var(--surface);
  border-radius: 5px;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  min-width: 0;
  background: var(--gold);
  border-radius: inherit;
  transition: width 600ms cubic-bezier(0.22, 0.9, 0.28, 1) 150ms;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 15px;
  font-size: 15px;
}

.progress-meta span:last-child {
  text-align: right;
}

.home-aside {
  margin-top: 48px;
}

.content-section + .content-section,
.reward-group + .reward-group {
  margin-top: 38px;
}

.section-title {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
}

.row-card {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  text-align: left;
}

button.row-card {
  cursor: pointer;
  appearance: none;
}

button.row-card:active {
  transform: translateY(1px);
}

.row-card.is-available {
  background: var(--green-soft);
  border-color: var(--green);
}

.row-card.is-muted {
  color: var(--muted);
  box-shadow: none;
}

.row-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--text);
  background: var(--surface);
  border-radius: var(--radius);
}

.is-available .row-icon {
  color: var(--green);
  background: var(--bg);
}

.row-icon .icon {
  width: 24px;
  height: 24px;
}

.row-copy {
  min-width: 0;
}

.row-title {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.row-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.is-available .row-note {
  color: var(--green);
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.row-meta .icon {
  width: 19px;
  height: 19px;
}

.item-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  text-align: center;
}

.empty-state .icon {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
}

.empty-state strong {
  color: var(--text);
  font-size: 17px;
}

.empty-state p {
  max-width: 320px;
  margin: 7px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.consent-actions .retry-button {
  margin-top: 0;
}

#profile-consent-stub {
  max-width: 560px;
  margin: 0 auto;
  align-items: stretch;
  text-align: left;
}

#profile-consent-stub > .icon {
  align-self: center;
}

#profile-consent-stub > strong {
  text-align: center;
}

#profile-consent-stub > p {
  max-width: none;
  white-space: pre-line;
}

.consent-form {
  display: grid;
  width: 100%;
  gap: 10px;
  margin-top: 22px;
}

.consent-choice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.consent-choice input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin: 0;
  accent-color: var(--blue);
}

.consent-choice small {
  display: inline;
  color: var(--muted);
  font-size: 12px;
}

.consent-form .retry-button {
  width: 100%;
  margin-top: 8px;
}

.consent-form .dialog-status {
  margin-top: 0;
  text-align: left;
}

.system-state {
  display: flex;
  min-height: 58vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.system-state h1 {
  margin: 20px 0 0;
  font-size: 24px;
  line-height: 1.2;
}

.system-state p {
  max-width: 330px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.status-icon {
  width: 34px;
  height: 34px;
  color: var(--blue);
}

.status-icon.is-spinning {
  animation: spin 900ms linear infinite;
}

.loader {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.profile-form {
  max-width: 520px;
}

.profile-field {
  display: block;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile-field input,
.profile-field textarea,
.profile-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.profile-field textarea {
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
}

.profile-field input:focus-visible,
.profile-field textarea:focus-visible,
.profile-field select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.select-menu {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.select-menu__native {
  appearance: none;
  overflow: hidden;
  padding-right: 44px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-menu:not(.is-custom)::after {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-menu__trigger {
  display: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 8px 14px;
  color: var(--text);
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.select-menu__trigger:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--blue) 60%, var(--border));
}

.select-menu__trigger:focus-visible,
.select-menu.is-open .select-menu__trigger {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.select-menu__trigger:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.select-menu__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.select-menu__chevron {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 140ms ease;
}

.select-menu.is-open .select-menu__chevron {
  transform: rotate(180deg);
}

.select-menu__popup {
  position: fixed;
  z-index: 1000;
  display: grid;
  max-height: min(320px, 50vh);
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(17, 18, 20, 0.16);
  opacity: 1;
  transform: translateY(0);
  animation: select-menu-in 140ms ease-out;
}

.select-menu__popup.opens-above {
  transform-origin: bottom;
}

.select-menu__group {
  display: grid;
  min-width: 0;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.select-menu__group-label {
  min-width: 0;
  padding: 7px 10px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: normal;
  white-space: normal;
  word-break: normal;
  writing-mode: horizontal-tb;
}

.select-menu__option {
  display: grid;
  min-width: 0;
  min-height: 44px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}

.select-menu__option:hover,
.select-menu__option.is-active {
  background: var(--surface);
}

.select-menu__option:focus-visible {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.select-menu__option[aria-selected="true"] {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, var(--bg));
  font-weight: 600;
}

.select-menu__option[aria-disabled="true"] {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.58;
}

.select-menu__check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  opacity: 0;
}

.select-menu__check svg {
  width: 18px;
  height: 18px;
}

.select-menu__option[aria-selected="true"] .select-menu__check {
  opacity: 1;
}

.select-menu__option-text {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

.inline-form > .select-menu {
  flex: 1 1 160px;
}

@media (hover: hover) and (pointer: fine) {
  .select-menu.is-custom .select-menu__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
  }

  .select-menu.is-custom .select-menu__trigger {
    display: flex;
  }
}

@keyframes select-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .select-menu__popup {
    animation: none;
  }

  .select-menu__chevron {
    transition: none;
  }
}

.profile-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 4px;
  cursor: pointer;
}

.profile-toggle input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue);
}

.save-button {
  margin-top: 18px;
}

.profile-status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.profile-status.is-error {
  color: var(--danger);
}

/* ---------- Client booking ---------- */

.booking-title {
  margin-bottom: 24px;
}

.booking-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 42px;
  padding: 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.booking-band-copy {
  min-width: 0;
}

.booking-kicker,
.dialog-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.booking-band h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.booking-band p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.primary-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  color: var(--blue-ink);
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: 0 0 22px var(--blue-soft);
  font-weight: 500;
  cursor: pointer;
  transition: transform 120ms ease-out, background-color 120ms ease-out;
}

.primary-action:active:not(:disabled) {
  background: var(--blue-soft);
  transform: scale(0.97);
}

.primary-action.compact {
  min-height: 42px;
  padding: 0 14px;
  font-size: 14px;
}

.primary-action:disabled {
  cursor: default;
  opacity: 0.45;
}

.primary-action .icon,
.secondary-button .icon {
  width: 18px;
  height: 18px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading .section-title {
  margin: 0;
}

.section-heading > span {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin: 0 -20px 8px;
  padding: 2px 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 13px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.category-tab.is-active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--text);
}

.service-list {
  border-top: 1px solid var(--border);
}

.service-list > .empty-state {
  margin-top: 16px;
}

.service-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.booking-band > *,
.service-item > * {
  min-width: 0;
}

.service-copy,
.service-heading {
  min-width: 0;
}

.service-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.service-heading h3 {
  min-width: 0;
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
}

.yclients-panel {
  margin-bottom: 32px;
}

.yclients-panel .list-meta {
  margin-bottom: 18px;
  line-height: 1.45;
}

.yclients-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 12px;
}

.yclients-actions > * {
  min-height: 44px;
  white-space: nowrap;
}

.sync-warning { color: var(--danger); font-weight: 600; }

.service-heading strong {
  flex: 0 0 auto;
  color: var(--blue-ink);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.service-price,
.service-dialog-price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.old-price {
  color: var(--muted);
  font-weight: 400;
  text-decoration: line-through;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 2px;
}

.promo-price {
  color: var(--blue-ink);
  font-weight: 600;
}

.promo-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.service-copy > p {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.service-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.service-actions .secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 13px;
}

.service-select.is-selected {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green);
}

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.selection-bar > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.selection-bar strong {
  font-size: 15px;
}

.selection-bar > div:first-child span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
}

.icon-button .icon {
  width: 20px;
  height: 20px;
}

.client-actions {
  margin-top: 46px;
}

.action-row {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.action-row:first-of-type {
  border-top: 1px solid var(--border);
}

.action-row > span:nth-child(2) {
  min-width: 0;
}

.action-row strong,
.action-row small {
  display: block;
  overflow-wrap: anywhere;
}

.action-row strong {
  font-size: 14.5px;
  font-weight: 500;
}

.action-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.action-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--blue);
  background: var(--surface);
  border-radius: 7px;
}

.action-icon .icon {
  width: 22px;
  height: 22px;
}

.action-row > .icon:last-child {
  width: 19px;
  height: 19px;
  color: var(--muted);
}

.privacy-actions {
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.privacy-actions h2 {
  margin: 0;
  font-size: 18px;
}

.privacy-actions p {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.policy-link {
  display: inline-block;
  color: var(--blue);
  font-size: 13px;
  line-height: 1.4;
}

.consent-form .policy-link {
  margin-top: 2px;
}

.privacy-actions .policy-link {
  margin: 0 0 16px;
}

.danger-button {
  min-height: 44px;
  padding: 0 16px;
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: transform 120ms ease-out;
}

.danger-button:active:not(:disabled) {
  transform: scale(0.97);
}

.danger-button.filled {
  color: #ffffff;
  background: var(--danger);
}

:root[data-theme="dark"] .danger-button.filled {
  color: #111214;
}

.client-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  padding: 24px;
  overflow-y: auto;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.client-dialog::backdrop {
  background: rgb(0 0 0 / 58%);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.dialog-header > div {
  min-width: 0;
}

.dialog-header h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.service-dialog-price {
  color: var(--blue-ink);
  font-size: 18px;
  font-weight: 600;
}

.dialog-copy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.dialog-primary {
  width: 100%;
  margin-top: 24px;
}

.quote-consent-button {
  width: 100%;
  margin-top: 10px;
}

.quote-form .profile-field {
  margin-bottom: 16px;
}

.file-field {
  display: block;
  margin-top: 2px;
}

.file-field .field-label span {
  font-weight: 500;
}

.file-field input {
  width: 100%;
  min-height: 44px;
  padding: 6px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.file-field input::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 0 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
}

.file-field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.photo-picker {
  min-width: 0;
}

.photo-picker .photo-picker__input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0 !important;
  opacity: 0;
}

.photo-picker__actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-picker__action {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--blue);
  background: var(--bg);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.photo-picker__action:hover {
  background: color-mix(in srgb, var(--blue) 8%, var(--bg));
}

.photo-picker__action:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.photo-picker__action.is-disabled {
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.65;
}

.photo-picker__action .icon {
  width: 20px;
  height: 20px;
}

.photo-picker__camera {
  display: none;
  color: var(--bg);
  background: var(--blue);
}

.photo-picker__camera:hover {
  background: color-mix(in srgb, var(--blue) 88%, var(--text));
}

.photo-picker.has-mobile-camera .photo-picker__camera {
  display: inline-flex;
}

.photo-picker__preview {
  display: grid;
  min-width: 0;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.photo-picker__thumbnail {
  display: block;
  width: 72px;
  height: 60px;
  object-fit: cover;
  background: var(--bg);
  border-radius: 6px;
}

.photo-picker__details {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.photo-picker__name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-picker__size {
  color: var(--muted);
  font-size: 12px;
}

.photo-picker__remove {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--danger);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

.photo-picker__remove:hover {
  border-color: var(--danger);
}

.photo-picker__remove:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.photo-picker__remove .icon {
  width: 18px;
  height: 18px;
}

@media (hover: none) and (pointer: coarse) {
  .photo-picker__camera {
    display: inline-flex;
  }
}

.dialog-status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--green);
  font-size: 13px;
  line-height: 1.4;
}

.dialog-status.is-error {
  color: var(--danger);
}

.dialog-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.dialog-actions.horizontal {
  display: flex;
  justify-content: flex-end;
}

.dialog-actions > button {
  width: 100%;
}

.dialog-actions.horizontal > button {
  width: auto;
}

.app-toast {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 50%;
  z-index: 100;
  width: min(440px, calc(100% - 32px));
  padding: 13px 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--green);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 36px rgb(0 0 0 / 18%);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  transform: translateX(-50%);
}

.app-toast.is-error {
  color: var(--danger);
  border-color: var(--danger);
}

.retry-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 22px;
  padding: 0 18px;
  color: var(--blue-ink);
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: 0 0 22px var(--blue-soft);
  font-weight: 500;
  cursor: pointer;
  transition: transform 120ms ease-out, background-color 120ms ease-out;
}

.retry-button:active:not(:disabled) {
  background: var(--blue-soft);
  transform: scale(0.97);
}

.retry-button .icon {
  width: 18px;
  height: 18px;
}

.app-nav {
  position: relative;
  z-index: 30;
  display: grid;
  grid-row: 2;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: calc(72px + var(--safe-bottom));
  padding: 8px 8px var(--safe-bottom);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

#admin-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#admin-nav.is-owner {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#admin-nav .nav-item {
  font-size: 11px;
}

.nav-item {
  display: flex;
  min-width: 0;
  min-height: 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.nav-item.is-active {
  color: var(--blue);
}

.nav-item:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.48;
}

.nav-item .icon {
  width: 23px;
  height: 23px;
}

.icon {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.icon > i,
.icon > svg {
  display: none;
  width: 100%;
  height: 100%;
  stroke-width: 1.9;
}

.icon-fallback {
  display: block;
  font-size: 1.15em;
  line-height: 1;
}

.icons-ready .icon > svg {
  display: block;
}

.icons-ready .icon-fallback {
  display: none;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .main-content {
    padding-right: 16px;
    padding-left: 16px;
  }

  .page-title {
    font-size: 27px;
  }

  .booking-band {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 20px 16px;
  }

  .booking-band .primary-action {
    width: 100%;
  }

  .category-tabs {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .service-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .service-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
    gap: 6px;
  }

  .service-actions {
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .service-actions > * {
    max-width: 100%;
  }

  .inline-form,
  .dialog-actions.horizontal,
  .confirm-dialog-actions {
    flex-direction: column;
  }

  .inline-form > *,
  .dialog-actions.horizontal > button,
  .confirm-dialog-actions > button {
    width: 100%;
    max-width: 100%;
  }

  .service-actions .service-book {
    flex: 1 1 126px;
  }

  .selection-bar {
    align-items: flex-end;
    gap: 10px;
    padding: 12px;
  }

  .selection-actions .primary-action span:last-child {
    display: inline;
    white-space: nowrap;
  }

  .selection-actions .primary-action {
    width: auto;
    min-width: 116px;
    padding: 0 12px;
  }

  .app-nav {
    padding-right: 0;
    padding-left: 0;
  }

  .app-nav .nav-item {
    padding-right: 0;
    padding-left: 0;
    font-size: 10px;
  }

  .nav-item > span:last-child {
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
    writing-mode: horizontal-tb;
  }

  .client-dialog {
    padding: 20px;
  }

  .level-line {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .level-icon {
    width: 48px;
    height: 48px;
  }

  .cashback-rate {
    grid-column: 2;
    margin-top: -8px;
    font-size: 16px;
  }

  .visit-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 30px;
  }

  .summary-divider {
    display: none;
  }

  .summary-next {
    justify-content: flex-start;
    padding-left: 33px;
    text-align: left;
  }

  .row-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 15px;
  }

  .row-icon {
    width: 40px;
    height: 40px;
  }

  .row-title {
    font-size: 16px;
  }

  .row-meta {
    font-size: 14px;
  }

  .row-card.has-inline-action {
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
  }

  .row-card.has-inline-action .row-meta {
    grid-column: 2;
    justify-content: flex-start;
    padding-left: 0;
  }

  .row-card.has-inline-action .reward-use-button {
    width: 100%;
  }

  .tier-grid .tier-card {
    padding: 14px;
  }

  .tier-card input {
    font-size: 15px;
  }

  .visit-form .secondary-button {
    width: 100%;
  }

  .catalog-category .catalog-category-body {
    padding-right: 12px;
    padding-left: 12px;
  }

  .service-form input[name="title"] {
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .yclients-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .yclients-actions > * {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  .page-title {
    font-size: 24px;
  }

  .brand-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-name {
    font-size: 20px;
  }

  .app-nav .nav-item {
    font-size: 9px;
  }
}

@media (min-width: 1000px) {
  .app-shell {
    width: min(100%, 1280px);
    height: auto;
    margin: 0 auto;
    overflow: visible;
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
  }

  .brand-header {
    position: relative;
    min-height: 92px;
    padding: 22px 36px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .brand-name {
    font-size: 28px;
  }

  .app-frame {
    display: grid;
    height: auto;
    grid-template-columns: 170px minmax(0, 1fr);
    grid-template-rows: minmax(calc(100vh - 92px), auto);
    min-height: calc(100vh - 92px);
  }

  .app-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    min-height: calc(100vh - 92px);
    flex-direction: column;
    grid-column: 1;
    grid-row: 1;
    gap: 14px;
    padding: 44px 16px;
    border-top: 0;
    border-right: 1px solid var(--border);
  }

  .nav-item {
    min-height: 78px;
    gap: 8px;
    font-size: 14px;
  }

  .nav-item .icon {
    width: 27px;
    height: 27px;
  }

  .main-content {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    margin: 0;
    padding: 48px 44px 64px;
    overflow: visible;
  }

  .page-title {
    margin-bottom: 46px;
    font-size: 27px;
  }

  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
    align-items: start;
    gap: 64px;
  }

  .view[data-view="booking"] {
    max-width: 1000px;
  }

  .home-aside {
    margin-top: 0;
  }

  .view[data-view="history"],
  .view[data-view="rewards"] {
    max-width: 850px;
  }

  .system-state {
    min-height: 62vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Admin app (admin.html/admin.js) ---------- */

.admin-badge {
  flex: 0 1 124px;
  max-width: 124px;
  min-width: 0;
  margin-left: 12px;
  padding: 3px 10px;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.admin-header-actions {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.admin-header-actions .admin-badge {
  margin-left: 0;
}

.settings-dialog form {
  display: grid;
  gap: 18px;
}

.demo-reset-button {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.demo-reset-button:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 360px) {
  .admin-badge {
    flex-basis: 100px;
    max-width: 100px;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10px;
  }

  .admin-header-actions {
    gap: 4px;
    margin-left: 8px;
  }

  .demo-reset-button {
    width: 40px;
    height: 40px;
    margin-left: 4px;
  }
}

#access-denied .status-icon {
  color: var(--danger);
}

.confirm-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgb(0 0 0 / 52%);
}

.confirm-dialog form {
  padding: 22px;
}

.confirm-dialog h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.confirm-dialog-actions .retry-button {
  min-height: 44px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 38px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.search-row {
  margin-bottom: 14px;
}

.search-row input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-row input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.list-meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.pager-button {
  min-height: 44px;
  padding: 0 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
}

.pager-button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.5;
}

.back-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 4px;
  color: var(--blue);
  background: none;
  border: 0;
  font-weight: 500;
  cursor: pointer;
}

.detail-heading {
  margin: 0 0 2px;
  font-size: 26px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.detail-section + .detail-section {
  margin-top: 34px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius);
}

.detail-field-label {
  color: var(--muted);
  font-size: 12px;
}

.detail-field-value {
  font-size: 16px;
  font-weight: 600;
}

.notification-panel {
  padding: 24px 0 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.notification-eligibility {
  margin: -7px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.notification-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.notification-form .profile-field,
.notification-form .file-field,
.notification-form .profile-status {
  min-width: 0;
  margin: 0;
}

.notification-message-field,
.notification-counter,
.notification-photo-field,
.notification-form .profile-status {
  grid-column: 1 / -1;
}

.notification-counter {
  margin: -8px 0 0;
}

.notification-submit {
  justify-self: start;
}

.notification-history-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.notification-history-item {
  min-width: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.notification-history-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-history-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notification-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.notification-status.is-sent {
  color: var(--green);
}

.notification-status.is-failed {
  color: var(--danger);
}

.notification-history-item p {
  margin: 9px 0 7px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.notification-history-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.admin-form {
  max-width: none;
}

.profile-source-note {
  margin: -8px 0 18px;
}

#quick-intake-availability {
  margin: -12px 0 18px;
  line-height: 1.4;
}

.promotion-editor {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.promotion-schedule-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.promotion-schedule-fields .profile-field {
  min-width: 0;
}

.promotion-status {
  margin: 10px 0 14px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
}

.inline-form {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.inline-form input,
.inline-form textarea,
.inline-form select {
  flex: 1 1 160px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.inline-form textarea {
  min-height: 88px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
}

.visit-form select {
  min-width: 0;
}

.visit-form .profile-field {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
}

.visit-form .secondary-button {
  align-self: flex-end;
}

.secondary-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: transform 120ms ease-out, background-color 120ms ease-out;
}

.secondary-button:active:not(:disabled) {
  background: var(--surface);
  transform: scale(0.97);
}

.secondary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.text-button {
  min-height: 44px;
  padding: 8px 4px;
  color: var(--muted);
  background: none;
  border: 0;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.text-button.danger-text {
  color: var(--danger);
  margin: 6px 0 20px;
}

.reward-use-button {
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
}

.catalog-category {
  margin-bottom: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.catalog-category.is-hidden-entity {
  border-style: dashed;
  box-shadow: none;
}

.catalog-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
}

.catalog-toggle {
  display: flex;
  flex: 1 1 220px;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: none;
  border: 0;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.catalog-toggle .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.catalog-category-title {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.catalog-category-title.is-hidden-label {
  color: var(--muted);
}

.catalog-category-body {
  padding: 0 16px 18px;
  border-top: 1px solid var(--border);
}

.service-card {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.service-card > .catalog-visibility {
  justify-self: start;
}

.service-card:last-of-type {
  border-bottom: 0;
}

.service-card.is-hidden-entity {
  opacity: 0.6;
}

.catalog-visibility {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.catalog-visibility.is-visible {
  color: var(--green);
  background: var(--green-soft);
}

.catalog-visibility.is-hidden {
  color: var(--muted);
  background: var(--surface);
}

.service-form {
  display: grid;
  gap: 18px;
}

.service-form .profile-field,
.service-form .profile-status {
  margin: 0;
}

.service-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.visibility-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.visibility-toggle input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--blue);
}

.visibility-toggle:has(input:disabled) {
  opacity: 0.55;
  cursor: default;
}

.service-visibility-toggle {
  padding: 2px 0 8px;
  color: var(--text);
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}

.tier-card {
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.char-counter {
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

/* ---------- Daily operations ---------- */

.active-wash,
.rating-prompt {
  min-width: 0;
  margin-bottom: 18px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.active-wash {
  border-left: 4px solid var(--blue);
}

.active-wash-heading,
.profile-section-heading,
.vehicle-heading,
.shift-job-heading,
.rating-prompt {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.active-wash-heading > div,
.vehicle-heading,
.shift-job-title,
.rating-prompt > div {
  min-width: 0;
}

.active-wash-heading h2,
.profile-section-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 9px;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
}

.wash-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.wash-progress li {
  min-width: 0;
  padding-top: 10px;
  color: var(--muted);
  border-top: 3px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.wash-progress li.is-complete {
  color: var(--green);
  border-top-color: var(--green);
}

.wash-progress li.is-current {
  color: var(--blue);
  border-top-color: var(--blue);
}

.active-wash-details,
.shift-job-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
}

.active-wash-details > div,
.shift-job-details > div {
  min-width: 0;
}

.active-wash-details dt,
.shift-job-details dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.active-wash-details dd,
.shift-job-details dd {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.active-wash-eta {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.active-wash-eta .icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.active-wash-eta strong {
  color: var(--text);
}

.rating-prompt {
  align-items: center;
  border-left: 4px solid var(--gold);
}

.rating-prompt > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rating-prompt > div span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.rating-summary {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 5px;
}

.rating-summary-service {
  min-width: 0;
  overflow-wrap: break-word;
}

.rating-summary-vehicle {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  white-space: nowrap;
}

.booking-vehicle-field {
  display: grid;
  max-width: 430px;
  gap: 5px;
  margin-top: 18px;
}

.booking-vehicle-field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.booking-vehicle-field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.booking-vehicle-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.booking-vehicle-category {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.booking-vehicle-category strong {
  min-width: 0;
  color: var(--blue);
  font-size: 13px;
  overflow-wrap: break-word;
  text-align: right;
}

.booking-service-field {
  display: grid;
  max-width: 430px;
  gap: 7px;
  margin-top: 18px;
}

.booking-field-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.booking-choice-buttons {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.repeat-service[hidden] + #booking-services-open {
  grid-column: 1 / -1;
}

.booking-choice {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  justify-content: flex-start;
  padding: 9px 11px;
  overflow: hidden;
  text-align: left;
  white-space: normal;
  word-break: normal;
}

.booking-choice.is-selected {
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-color: var(--blue);
}

.booking-choice-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.booking-choice-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.booking-choice-copy strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.25;
  overflow-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.booking-service-summary {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.booking-service-summary strong {
  min-width: 0;
  color: var(--blue);
  overflow-wrap: break-word;
  text-align: right;
}

.booking-services-dialog {
  width: min(640px, calc(100% - 28px));
  overflow: hidden;
}

.booking-services-dialog[open] {
  display: flex;
  flex-direction: column;
}

.booking-services-hint {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.booking-services-list {
  display: grid;
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  gap: 18px;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.booking-services-group {
  min-width: 0;
}

.booking-services-group h3 {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.3;
}

.booking-service-option {
  display: grid;
  min-width: 0;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.booking-service-option input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue);
}

.booking-service-option-copy {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.booking-service-option-copy > strong {
  min-width: 0;
  overflow-wrap: break-word;
}

.booking-service-option-price {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.booking-services-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.booking-services-footer > button {
  min-height: 44px;
}

.booking-services-dialog .dialog-status {
  margin: 10px 0 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .booking-service-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .booking-service-summary strong {
    text-align: left;
  }

  .booking-service-option-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .booking-services-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .booking-services-footer > button {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .booking-choice-buttons {
    grid-template-columns: minmax(0, 1fr);
  }
}

.repeat-service,
.icon-text-button,
.vehicle-action,
.shift-action,
.rating-prompt .secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
}

.repeat-service {
  margin-top: 0;
  padding-right: 12px;
  padding-left: 12px;
  font-size: 13px;
}

.repeat-service .icon,
.icon-text-button .icon,
.vehicle-action .icon,
.shift-action .icon {
  width: 17px;
  height: 17px;
}

.profile-vehicles {
  margin: 8px 0 24px;
  padding: 18px 0 4px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-section-heading {
  align-items: center;
  margin-bottom: 12px;
}

.vehicles-list {
  display: grid;
  min-width: 0;
}

.vehicle-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.vehicle-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.vehicle-copy > span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.vehicle-copy > .vehicle-category {
  color: var(--blue);
  font-weight: 600;
  overflow-wrap: break-word;
}

.vehicle-heading {
  justify-content: flex-start;
}

.vehicle-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.vehicle-default-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.vehicle-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.vehicle-action {
  padding-right: 10px;
  padding-left: 10px;
  font-size: 12px;
}

.danger-icon-button {
  color: var(--danger);
}

.vehicle-default-toggle {
  margin-top: 4px;
  margin-bottom: 18px;
}

.vehicle-catalog-fields,
.vehicle-catalog-grid,
.vehicle-catalog-grid > * {
  min-width: 0;
}

.vehicle-catalog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.vehicle-catalog-grid[hidden] {
  display: none;
}

.vehicle-class-result {
  min-height: 22px;
  margin: -4px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: normal;
  white-space: normal;
  word-break: normal;
  writing-mode: horizontal-tb;
}

.vehicle-class-result.is-known {
  color: var(--blue);
  font-weight: 600;
}

.vehicle-manual-toggle {
  min-height: 44px;
  margin: 0 0 18px;
  padding: 4px 0;
  align-self: flex-start;
  color: var(--blue);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.vehicle-manual-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.operations-dialog {
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px);
  padding-bottom: calc(20px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rating-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 8px;
  margin: 20px 0;
}

.rating-button {
  display: flex;
  min-width: 44px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.rating-button .icon {
  width: 18px;
  height: 18px;
}

.rating-button.is-selected {
  color: var(--gold);
  background: var(--gold-soft);
  border-color: var(--gold);
}

.rating-comment-field .field-label span,
.intake-client-field .field-label span,
.admin-operations-dialog .field-label span {
  font-weight: 500;
}

.shift-heading {
  align-items: center;
}

.shift-heading > div {
  min-width: 0;
}

.shift-heading .page-title {
  margin: 0 0 5px;
}

.shift-heading p {
  white-space: normal;
}

.shift-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  overflow-x: hidden;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.shift-count {
  display: flex;
  min-width: 0;
  min-height: 70px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg);
}

.shift-count strong {
  font-size: 21px;
}

.shift-count span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.shift-filters {
  display: flex;
  gap: 8px;
  margin: 0 -4px 16px;
  padding: 2px 4px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.shift-filters::-webkit-scrollbar {
  display: none;
}

.shift-filter {
  min-height: 44px;
}

.shift-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.shift-job-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 17px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.shift-job-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shift-job-title strong,
.shift-job-title span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.shift-job-title span {
  color: var(--muted);
  font-size: 13px;
}

.status-expected,
.status-completed {
  color: var(--muted);
}

.status-washing {
  color: var(--gold);
  background: var(--gold-soft);
}

.status-ready {
  color: var(--green);
  background: var(--green-soft);
}

.shift-job-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.shift-job-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 18px;
}

.shift-action {
  min-height: 44px;
}

.shift-overview {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.shift-overview > .section-title {
  margin-bottom: 18px;
}

.operations-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.operations-form-grid .profile-field {
  min-width: 0;
}

.admin-operations-dialog {
  width: min(620px, calc(100% - 32px));
}

.intake-client-results {
  display: grid;
  max-height: 220px;
  margin: -10px 0 18px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.intake-client-results button {
  display: flex;
  min-width: 0;
  min-height: 50px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--bg);
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
}

.intake-client-results button:last-child {
  border-bottom: 0;
}

.intake-client-results button span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (min-width: 1000px) {
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

@media (min-width: 680px) {
  .vehicle-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .notification-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .notification-submit {
    width: 100%;
    justify-self: stretch;
  }

  .promotion-schedule-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-actions {
    align-items: stretch;
  }

  .active-wash,
  .rating-prompt {
    padding: 16px;
  }

  .active-wash-heading,
  .rating-prompt,
  .shift-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .active-wash-heading .status-pill {
    align-self: flex-start;
  }

  .wash-progress {
    gap: 5px;
  }

  .wash-progress li {
    font-size: 10px;
  }

  .active-wash-details,
  .shift-job-details,
  .operations-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rating-prompt .secondary-button,
  .shift-heading .primary-action,
  .shift-action {
    width: 100%;
  }

  .vehicle-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .vehicle-actions {
    justify-content: flex-start;
  }

  .vehicle-action {
    flex: 1 1 150px;
  }

  .shift-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .shift-counts {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .shift-heading .page-title {
    font-size: 27px;
  }

  .operations-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 12px);
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 480px) {
  .shift-counts {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .shift-count {
    min-height: 64px;
    align-items: center;
    padding: 8px 2px;
    text-align: center;
  }

  .shift-count span {
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
  }
}

/* ---------- Design system: patterns and animation utilities ---------- */

.list-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border) 48px,
    var(--border) calc(100% - 48px),
    transparent
  );
}

.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 260ms cubic-bezier(0.2, 0.7, 0.3, 1),
    opacity 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.accordion-body > * {
  min-height: 0;
  overflow: hidden;
}

.accordion-body.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.accordion-chevron {
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.is-open .accordion-chevron,
.accordion-chevron.is-open {
  transform: rotate(90deg);
}

.skeleton {
  color: transparent;
  background: linear-gradient(
    100deg,
    var(--surface) 40%,
    var(--border) 50%,
    var(--surface) 60%
  );
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: skeleton-shimmer 1.1s linear infinite;
  pointer-events: none;
  user-select: none;
}

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.skeleton-replace {
  animation: fade-in 150ms ease-out both;
}

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

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes list-item-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes slide-from-right {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes slide-from-left {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.anim-view-in {
  animation: fade-up 200ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.anim-list-item {
  animation: list-item-in 320ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--stagger-index, 0) * 40ms);
}

.anim-page-in {
  animation: slide-from-right 220ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.anim-page-back {
  animation: slide-from-left 220ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.anim-toast-in {
  animation: toast-in 220ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .anim-view-in,
  .anim-list-item,
  .anim-page-in,
  .anim-page-back,
  .anim-toast-in,
  .skeleton,
  .skeleton-replace {
    animation: none;
  }

  .accordion-body,
  .accordion-chevron,
  .progress-fill,
  .primary-action,
  .retry-button,
  .secondary-button,
  .danger-button {
    transition: none;
  }

  .primary-action:active:not(:disabled),
  .retry-button:active:not(:disabled),
  .secondary-button:active:not(:disabled),
  .danger-button:active:not(:disabled) {
    transform: none;
  }
}

/* ---------- Phase 2: клиентское приложение — вкладки, страница услуги, skeleton ---------- */

.nav-item .icon {
  transition: transform 200ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.nav-item.is-active .icon {
  transform: scale(1.12);
}

body.has-subpage .app-nav {
  display: none;
}

.app-toast.anim-toast-in {
  animation: app-toast-in 220ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes app-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }

  to {
    transform: translate(-50%, 0);
  }
}

.service-item {
  cursor: pointer;
}

.service-list .skeleton,
.item-list .skeleton,
#home-reward .skeleton,
#last-visit .skeleton {
  margin: 12px 0;
}

#category-tabs .skeleton {
  flex: 0 0 auto;
}

/* Страница услуги */
.service-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-page-back {
  align-self: flex-start;
}

/* Слайдер и плейсхолдер живут внутри main-content с боковыми полями 20px —
   запас от краёв экрана для iOS edge-swipe. */
.service-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 150px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
}

.service-photo-empty .icon {
  width: 28px;
  height: 28px;
}

.service-photo-empty p {
  margin: 0;
  font-size: 12.5px;
}

.ba-slider {
  position: relative;
  height: 240px;
  overflow: hidden;
  border-radius: var(--radius-card);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ba-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--blue);
  transform: translateX(-50%);
}

.ba-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  background: var(--bg);
  border: 2px solid var(--blue);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.service-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.service-chip {
  flex: 0 0 auto;
  padding: 6px 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.service-page-title {
  margin: 0;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.service-page-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.service-page-price .promo-price {
  font-size: 19px;
}

.service-page-description {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

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

.similar-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}

@media (max-width: 360px) {
  .ba-slider {
    height: 180px;
  }
}

@media (min-width: 1024px) {
  .service-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(340px, 1fr));
    column-gap: 36px;
  }

  .service-item {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 14px;
  }

  .service-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .service-list > .empty-state,
  .service-list > .skeleton {
    grid-column: 1 / -1;
  }

  .service-item:hover,
  .similar-row:hover {
    background: var(--surface);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-toast.anim-toast-in {
    animation: none;
  }

  .nav-item .icon {
    transition: none;
  }
}

/* ---------- Phase 3: админка — смена, клиенты, каталог, уровни, рассылка ---------- */

.shift-counts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Пилюли статусов смены: ожидает — контур muted; принята — синяя;
   моем — золотая; готова — зелёная; завершена — surface. */
.status-expected {
  background: transparent;
}

.status-accepted {
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-color: var(--blue);
}

.status-completed {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--border);
}

.client-avatar {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
}

.client-row-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.client-filter-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.client-filter-heading .list-meta {
  margin: 0;
}

.compact-button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12.5px;
}

.shift-managed-note {
  margin: 14px 0 0;
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .client-row {
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    row-gap: 9px;
  }

  .client-row .client-row-meta {
    grid-column: 2;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-left: 0;
    font-size: 13px;
    white-space: normal;
  }

  .client-row .client-row-meta .icon {
    margin-left: auto;
  }

  .client-filter-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.level-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 9px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.client-yclients-link {
  margin-bottom: 18px;
}

.tier-pill-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.tier-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 3px 12px;
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tier-pill-gold,
.tier-pill-vip {
  color: var(--gold);
  background: var(--gold-soft);
}

.tier-cashback {
  color: var(--muted);
  font-size: 13px;
}

.queue-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.queue-pending {
  color: var(--gold);
  background: var(--gold-soft);
}

.queue-sending {
  color: var(--blue-ink);
  background: var(--blue-soft);
}

.queue-completed {
  color: var(--green);
  background: var(--green-soft);
}

.queue-failed {
  color: var(--danger);
  background: transparent;
}

.queue-cancelled {
  color: var(--muted);
  background: var(--surface);
}

.broadcast-cancel-button {
  min-height: 44px;
  padding: 0 6px;
  color: var(--danger);
  background: none;
  border: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

#shift-counts .skeleton,
#shift-filters .skeleton {
  margin: 0;
}

#catalog-accordion .skeleton {
  margin: 12px 0;
}

#overview-stats .skeleton,
#tiers-list .skeleton,
#shift-board .skeleton {
  margin: 0;
}

@media (min-width: 1024px) {
  .confirm-dialog,
  .operations-dialog {
    width: min(440px, calc(100% - 32px));
  }

  .row-card.client-row:hover {
    background: var(--surface);
  }
}

/* --- Показатели: ряды и дельты периодов --- */
.stat-row-title {
  margin: 18px 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card {
  position: relative;
}

.stat-delta {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.stat-delta.is-up {
  color: var(--green);
  background: var(--green-soft);
}

.stat-delta.is-down {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.stat-card:has(.stat-delta) .stat-value {
  padding-right: 58px;
}
