* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

a,
button {
  touch-action: manipulation;
}

button:disabled {
  opacity: .5;
  cursor: wait;
}

svg.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 100;
  background: var(--ink);
  color: white;
  padding: 12px;
}

.skip-link:focus {
  top: 12px;
}

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

/* У полей рамка вплотную и мягкое кольцо: не наезжает на подсказку под полем */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -1.1px;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.35px;
}

h3 {
  font-size: 16px;
}

p+p {
  margin-top: 8px;
}

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

.small,
small {
  font-size: 13px;
}

.stack {
  display: grid;
  gap: 20px;
}

.card {
  --card-padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow);
  min-width: 0;
}

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

.empty {
  text-align: center;
  padding: 44px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-symbol {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--tone, var(--tone-gray)) 14%, white);
  border-radius: 24px;
  color: var(--tone, var(--tone-gray));
  margin-bottom: 24px;
}

.empty-symbol svg {
  width: 32px;
  height: 32px;
}

.empty h2 {
  font-size: 21px;
  margin-bottom: 10px;
}

.empty p {
  max-width: 330px;
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
}

.empty.compact {
  padding: 22px 12px;
}

.empty.compact p {
  margin-bottom: 0;
}

.toast-region {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 20px;
  right: 20px;
  z-index: 40;
  pointer-events: none;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 520px;
  margin: auto;
  background: var(--ink);
  color: white;
  border-radius: 16px;
  padding: 14px 20px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 14px;
}

summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 14px;
}

.modal {
  border: 0;
  border-radius: 24px;
  padding: 26px;
  max-width: 520px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow);
  background: var(--surface);
  color: var(--ink);
}

.modal::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}

.modal h2 {
  margin-bottom: 16px;
}

.modal .actions {
  margin-top: 22px;
}

.htmx-request .submit {
  opacity: .6;
  pointer-events: none;
}

@media(max-width:480px) {
  .row-meta .last-visit {
    display: none;
  }

  .list {
    padding: 0 16px;
  }

  .list-row {
    gap: 11px;
  }

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

  .row-chevron {
    display: none;
  }

  .modal {
    position: fixed;
    margin: 0;
    bottom: 0;
    max-width: 100%;
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding-bottom: max(26px, env(safe-area-inset-bottom));
  }

  .service-list .row-meta {
    max-width: 100px;
  }

  .row-sub {
    overflow-wrap: anywhere;
  }
}

@media(min-width:1024px) {
  .salon-caption {
    font-size: 12px;
    color: var(--muted);
    margin: 14px 12px 38px;
  }

  h1 {
    font-size: 36px;
    letter-spacing: -1.5px;
  }

  .toast-region {
    left: 256px;
  }

  .card {
    --card-padding: 24px;
  }

  .list {
    padding: 0 24px;
  }

  .empty {
    padding: 70px 30px;
  }
}

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 99;
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  text-align: center;
  font-size: 14px;
}

@media(min-width:1024px) {
  .directory-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    font-size: 13px;
    border-radius: 12px;
    overflow-wrap: anywhere;
  }

  .directory-row .avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
    border-radius: 10px;
  }
}

.money-amount {
  white-space: nowrap;
}

img,
svg {
  max-width: 100%;
}

.test-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 6px 16px;
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-size: 13px;
  text-align: center;
}
