/* ГРАНЬ — прототип Mini App.
   Тёплый чёрный, латунь, слоновая кость.
   Без сборщика: только нативные CSS и ES-модули. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/fonts/CormorantGaramond-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/fonts/CormorantGaramond-Italic-Variable.ttf")
    format("truetype");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

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

:root {
  color-scheme: dark;

  --bg: #0b0907;
  --surface: #15110d;
  --surface-raised: #1d1812;
  --brass: #c8a96a;
  --brass-rgb: 200, 169, 106;
  --brass-soft: rgba(var(--brass-rgb), 0.14);
  --brass-hover: #d4b77c;
  --on-accent: #191309;
  --ivory: #f0e8d8;
  --muted: #948a7a;
  --line: #2a241c;
  --danger: #a84b3f;
  --danger-rgb: 168, 75, 63;
  --danger-text: #d98c82;
  --danger-soft-text: #c77c72;
  --tabbar-bg: #0d0a08;
  --overlay-bg: rgba(11, 9, 7, 0.55);
  --backdrop: rgba(5, 4, 3, 0.66);
  --portrait-a: #2b241b;
  --portrait-b: #15110d;
  --portrait-c: #100d0a;
  --portrait-monogram: rgba(240, 232, 216, 0.16);
  --grain-opacity: 0.035;
  --card-radius: 2px;
  --button-radius: 10px;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --page-max: 560px;
  --gutter: 20px;
  --tabbar-height: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--brass);
  color: var(--on-accent);
}

body.sheet-open {
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

p,
h1,
h2 {
  margin: 0;
}

a {
  color: inherit;
}

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

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* Зерно: тонкая бумажная фактура поверх фона. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: var(--grain-opacity);
  transition: opacity 200ms ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 22px var(--gutter)
    calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 40px);
  min-height: 100vh;
  min-height: 100dvh;
}

.screen {
  padding-bottom: 8px;
}

.screen--sticky {
  padding-bottom: 96px;
}

.screen--enter {
  animation: screen-in 180ms ease-out;
}

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

  to {
    opacity: 1;
    transform: none;
  }
}

/* Загрузка */

.boot {
  min-height: 70dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.boot__mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--brass-rgb), 0.35);
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--brass);
}

.boot__name {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--muted);
}

.boot-error {
  min-height: 60dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Вход по телефону */

.auth {
  min-height: 78dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0 12px;
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--brass-rgb), 0.35);
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--brass);
}

.auth__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.auth__title {
  margin-top: 36px;
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 42px);
  font-weight: 500;
  line-height: 1.05;
}

.auth__sub {
  max-width: 34ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 30px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.field__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  background: var(--surface);
  color: var(--ivory);
  font: inherit;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.field__input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.field__input:focus {
  outline: none;
  border-color: rgba(var(--brass-rgb), 0.55);
  background: var(--surface-raised);
}

.auth__error {
  min-height: 18px;
  margin: 0;
  color: var(--danger-text);
  font-size: 12px;
  line-height: 1.4;
}

.auth__note {
  max-width: 36ch;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

/* Шапка */

.topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1;
}

.wordmark small {
  display: block;
  margin-top: 7px;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.topline__meta {
  max-width: 150px;
  padding-top: 1px;
  text-align: right;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.greeting {
  margin: 34px 0 26px;
  font-family: var(--font-display);
  font-size: clamp(34px, 9vw, 44px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.greeting em {
  font-style: italic;
  color: var(--brass);
}

/* Заголовок секции с подписью справа. */

/* «Как обычно» */

.usual {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: var(--surface);
  border: 1px solid rgba(var(--brass-rgb), 0.32);
  border-radius: var(--card-radius);
}

.usual__label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--brass);
}

.usual__master {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
}

.usual__service {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.usual__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.usual--empty .usual__master {
  font-size: 34px;
}

.usual--empty .usual__service {
  max-width: 30ch;
  line-height: 1.5;
}

.usual--empty .btn {
  margin-top: 20px;
}

.price {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* Кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition:
    transform 120ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    opacity 150ms ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.42;
}

.btn--brass:disabled {
  background: var(--surface-raised);
  border-color: var(--line);
  color: var(--muted);
  opacity: 1;
}

.btn--brass {
  background: var(--brass);
  color: var(--on-accent);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--ivory);
}

.btn--danger {
  border-color: rgba(var(--danger-rgb), 0.55);
  color: var(--danger-text);
}

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

@media (hover: hover) {
  .btn--brass:hover:not(:disabled) {
    background: var(--brass-hover);
  }

  .btn--ghost:hover:not(:disabled) {
    border-color: rgba(var(--brass-rgb), 0.4);
  }
}

/* Секции главной */

.section {
  margin-top: 32px;
}

.section__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
  color: var(--ivory);
}

.next-visit {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 14px 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: border-color 150ms ease;
}

.next-visit__date {
  min-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.next-visit__day {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}

.next-visit__month {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}

.next-visit__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.next-visit__time {
  font-size: 13px;
}

.next-visit__service {
  font-size: 12px;
  color: var(--muted);
}

.next-visit__arrow {
  width: 18px;
  color: var(--brass);
}

.cta-block {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.cta-block__text {
  margin-bottom: 14px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 21px;
}

.cta-block__note {
  margin-top: 10px;
  font-size: 11px;
  text-align: center;
  color: var(--muted);
}

@media (hover: hover) {
  .next-visit:hover {
    border-color: rgba(var(--brass-rgb), 0.4);
  }
}

/* Шапка экрана */

.screen-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin-bottom: 12px;
}

.screen-head--plain {
  grid-template-columns: 1fr auto;
}

.screen-head__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
}

.screen-head__count {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.icon-btn {
  width: 40px;
  height: 40px;
  margin-left: -6px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ivory);
  transition: border-color 150ms ease;
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .icon-btn:hover {
    border-color: rgba(var(--brass-rgb), 0.45);
  }
}

.step-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.progress {
  height: 1px;
  margin-bottom: 26px;
  background: var(--line);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--brass);
  transition: width 250ms ease;
}

.step-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 8.5vw, 40px);
  font-weight: 500;
  line-height: 1.05;
}

.step-sub {
  max-width: 34ch;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* Услуги */

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

.service-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.service-row__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.service-row__name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.05;
  transition: color 150ms ease;
}

.service-row__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.service-row__price {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.service-row__time {
  font-size: 10.5px;
  color: var(--muted);
}

@media (hover: hover) {
  .service-row:hover .service-row__name {
    color: var(--brass);
  }
}

/* Выбранная услуга / мастер */

.choice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  text-align: left;
}

.choice strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
}

.choice__meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.choice__change {
  font-size: 11px;
  color: var(--brass);
  white-space: nowrap;
}

/* Мастера */

.master-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.master-card {
  text-align: left;
}

.master-card__portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background:
    radial-gradient(
      120% 100% at 30% 10%,
      var(--portrait-a) 0%,
      var(--portrait-b) 60%,
      var(--portrait-c) 100%
    );
  transition: border-color 150ms ease;
}

.master-card__monogram {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  color: var(--portrait-monogram);
  transform: translateY(-6px);
}

.master-card__grade {
  position: absolute;
  left: 50%;
  bottom: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(var(--brass-rgb), 0.18);
  border-radius: var(--card-radius);
  background: var(--overlay-bg);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  color: var(--brass);
  transform: translateX(-50%);
}

.master-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 9px;
}

.master-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.master-card__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.master-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--brass);
}

.master-card__rating .icon {
  width: 11px;
  height: 11px;
}

.master-card__meta {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
}

@media (hover: hover) {
  .master-card:hover .master-card__portrait {
    border-color: rgba(var(--brass-rgb), 0.5);
  }
}

/* Профиль мастера: вкладка «Мастер». */

.master-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 24px;
}

.master-profile__portrait {
  width: 120px;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--card-radius) - 4px);
  background:
    radial-gradient(
      120% 100% at 30% 10%,
      var(--portrait-a) 0%,
      var(--portrait-b) 60%,
      var(--portrait-c) 100%
    );
}

.master-profile__monogram {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  color: var(--portrait-monogram);
}

.master-profile__name {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: clamp(30px, 8vw, 38px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.master-profile__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.master-profile__rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--brass);
}

.master-profile__rating svg {
  width: 14px;
  height: 14px;
}

.master-profile__specialties {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.master-bio {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* Работы мастера: CSS-заглушки плитками. */

.portfolio {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.portfolio__item {
  margin: 0;
}

.portfolio__surface {
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 3px;
  background:
    radial-gradient(
      80% 58% at 30% 16%,
      rgba(255, 255, 255, 0.34) 0%,
      rgba(255, 255, 255, 0) 56%
    ),
    linear-gradient(160deg, var(--tone-a), var(--tone-b));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.portfolio__caption {
  margin-top: 7px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Даты и слоты */

.date-strip {
  display: flex;
  gap: 8px;
  margin: 22px calc(var(--gutter) * -1) 0;
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - 16px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - 16px),
    transparent 100%
  );
}

.date-strip::-webkit-scrollbar {
  display: none;
}

.date-chip {
  flex: 0 0 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.date-chip__weekday {
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
}

.date-chip__day {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
}

.date-chip__month {
  font-size: 9px;
  color: var(--muted);
}

.date-chip.is-active {
  border-color: var(--brass);
  background: var(--brass-soft);
}

.date-chip.is-active .date-chip__weekday,
.date-chip.is-active .date-chip__month {
  color: var(--brass);
}

.slots-title {
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.slot {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease;
}

.slot:disabled {
  opacity: 0.26;
}

.slot.is-selected {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--on-accent);
}

.slot--skeleton {
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  background: linear-gradient(
    90deg,
    var(--surface) 0%,
    var(--surface-raised) 50%,
    var(--surface) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  opacity: 0.7;
}

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

@media (hover: hover) {
  .slot:hover:not(:disabled) {
    border-color: rgba(var(--brass-rgb), 0.5);
  }
}

.empty-slots {
  margin-top: 16px;
  padding: 24px 16px;
  border: 1px dashed var(--line);
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

/* Нижняя панель действия */

.sticky-cta {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 10px);
  z-index: 40;
  width: min(calc(100% - 32px), calc(var(--page-max) - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid rgba(var(--brass-rgb), 0.28);
  border-radius: 12px;
  transform: translateX(-50%);
}

.sticky-cta__info {
  display: flex;
  flex-direction: column;
  padding-left: 6px;
}

.sticky-cta__info span {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.sticky-cta__info small {
  font-size: 10px;
  color: var(--muted);
}

.sticky-cta__btn {
  flex: 1;
}

/* Подтверждение */

.ticket {
  margin-top: 24px;
  padding: 4px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
}

.ticket__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.ticket__row span {
  font-size: 12px;
  color: var(--muted);
}

.ticket__row strong {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.ticket__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 16px 0;
}

.ticket__total span {
  font-size: 12px;
  color: var(--muted);
}

.ticket__total strong {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 500;
  color: var(--brass);
}

.fineprint {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

/* Успех */

.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62dvh;
  padding-top: 26px;
  text-align: center;
}

.success__mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--brass-rgb), 0.5);
  border-radius: 50%;
  color: var(--brass);
  animation: mark-in 240ms ease-out both;
}

.success__mark .icon {
  width: 28px;
  height: 28px;
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

.success__title {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 500;
  line-height: 1;
}

.success__lead {
  max-width: 28ch;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.success__ticket {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 26px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.success__service {
  font-family: var(--font-display);
  font-size: 24px;
}

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

.success .btn + .btn {
  margin-top: 10px;
}

/* Мои записи */

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
}

.segmented button {
  min-height: 38px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}

.segmented button.is-active {
  background: var(--surface-raised);
  color: var(--ivory);
}

.booking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.booking-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
}

.booking-card__date {
  min-width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.booking-card__day {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
}

.booking-card__month {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}

.booking-card__time {
  margin-top: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--brass);
}

.booking-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.booking-card__head {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.booking-card__service {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.05;
}

.booking-card__price {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.booking-card__meta {
  font-size: 11px;
  color: var(--muted);
}

.status {
  display: inline-block;
  margin-top: 2px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 9.5px;
  color: var(--muted);
}

.status--confirmed {
  color: var(--brass);
  border-color: rgba(var(--brass-rgb), 0.32);
}

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

.status--cancelled,
.status--cancelled_by_client {
  color: var(--danger-soft-text);
  border-color: rgba(var(--danger-rgb), 0.35);
}

.link-btn {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: currentColor;
}

@media (hover: hover) {
  .link-btn:hover {
    color: var(--ivory);
  }
}

.empty {
  margin-top: 24px;
  padding: 48px 20px;
  border: 1px dashed var(--line);
  text-align: center;
}

.empty__title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}

.empty__text {
  max-width: 28ch;
  margin: 8px auto 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.empty .btn {
  margin-top: 20px;
}

/* Нижняя навигация */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 6px max(12px, calc((100vw - var(--page-max)) / 2 + 12px))
    calc(6px + env(safe-area-inset-bottom));
  background: var(--tabbar-bg);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  max-width: 186px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px 0;
  font-size: 10px;
  color: var(--muted);
}

.tab .icon {
  width: 19px;
  height: 19px;
}

.tab.is-active {
  color: var(--brass);
}

/* Нижний лист */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--backdrop);
  animation: fade-in 180ms ease both;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 71;
  width: 100%;
  max-width: var(--page-max);
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid rgba(var(--brass-rgb), 0.28);
  border-radius: 16px 16px 0 0;
  transform: translateX(-50%);
  animation: sheet-up 220ms ease both;
}

.sheet__grabber {
  display: block;
  width: 36px;
  height: 3px;
  margin: 0 auto 18px;
  background: var(--line);
  border-radius: 2px;
}

.sheet__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.sheet__text {
  margin: 10px 0 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.sheet .btn + .btn {
  margin-top: 10px;
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translate(-50%, 24px);
  }
}

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

/* Тост */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 78px);
  z-index: 80;
  max-width: min(90vw, 420px);
  padding: 9px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  font-size: 12px;
  text-align: center;
  color: var(--ivory);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Большие экраны: та же мобильная колонка, но с полями. */

@media (min-width: 760px) {
  :root {
    --gutter: 28px;
  }

  .app {
    border-inline: 1px solid var(--line);
  }

  .master-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tabbar {
    left: 50%;
    right: auto;
    width: min(100%, var(--page-max));
    transform: translateX(-50%);
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
    border-inline: 1px solid var(--line);
  }

  .greeting {
    margin-top: 42px;
  }
}

/* ─── Темы ─────────────────────────────────────────────────────────── */

/* Studio: холодный монохром, один шрифт, мягкие формы. */
html[data-theme="studio"] {
  --bg: #101113;
  --surface: #18191c;
  --surface-raised: #202226;
  --brass: #d9d2c3;
  --brass-rgb: 217, 210, 195;
  --brass-soft: rgba(var(--brass-rgb), 0.1);
  --brass-hover: #e6e0d3;
  --on-accent: #141517;
  --ivory: #eceae6;
  --muted: #9a9c9f;
  --line: #2a2c30;
  --danger: #c2605a;
  --danger-rgb: 194, 96, 90;
  --danger-text: #e0908a;
  --danger-soft-text: #d98a84;
  --tabbar-bg: #0c0d0f;
  --overlay-bg: rgba(16, 17, 19, 0.62);
  --backdrop: rgba(5, 6, 7, 0.72);
  --portrait-a: #26282c;
  --portrait-b: #16181b;
  --portrait-c: #0e0f11;
  --portrait-monogram: rgba(236, 234, 230, 0.12);
  --grain-opacity: 0;
  --card-radius: 16px;
  --button-radius: 12px;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="studio"] .wordmark {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

[data-theme="studio"] .wordmark small {
  letter-spacing: 0.08em;
}

[data-theme="studio"] .greeting {
  margin: 30px 0 22px;
  font-size: clamp(30px, 7.6vw, 38px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

[data-theme="studio"] .greeting em {
  font-style: normal;
  color: var(--muted);
}

[data-theme="studio"] .usual {
  border-color: var(--line);
}

[data-theme="studio"] .usual__label {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

[data-theme="studio"] .usual__master {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

[data-theme="studio"] .usual__service {
  font-size: 12.5px;
}

[data-theme="studio"] .usual__foot {
  margin-top: 22px;
}

[data-theme="studio"] .price {
  font-size: 15px;
  font-weight: 500;
}

[data-theme="studio"] .section__title {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

[data-theme="studio"] .screen-head__title {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

[data-theme="studio"] .cta-block__text {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

[data-theme="studio"] .next-visit__day {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

[data-theme="studio"] .step-title {
  font-size: clamp(28px, 7.4vw, 34px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

[data-theme="studio"] .service-row__name {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

[data-theme="studio"] .master-card__name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

[data-theme="studio"] .master-card__grade {
  border-radius: 999px;
}

[data-theme="studio"] .ticket__total strong {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

[data-theme="studio"] .success__title {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

[data-theme="studio"] .success__service {
  font-size: 20px;
  font-weight: 500;
}

[data-theme="studio"] .btn {
  font-weight: 600;
  letter-spacing: 0;
}

[data-theme="studio"] .segmented button {
  border-radius: 9px;
}

[data-theme="studio"] .status {
  padding: 3px 9px;
  border-radius: 999px;
}

[data-theme="studio"] .success__ticket {
  border-radius: var(--card-radius);
}

[data-theme="studio"] .sticky-cta {
  border-color: var(--line);
}

/* YUDIN: «Графит и кость» — премиальный монохром, чёрный / графит / кость.
   Без тёплого: только нейтральные серые, hairline и воздух. */
html[data-theme="yudin"] {
  --bg: #0c0d0f;
  --surface: #141619;
  --surface-raised: #1b1e22;
  --brass: #d8d5ce;
  --brass-rgb: 216, 213, 206;
  --brass-soft: rgba(var(--brass-rgb), 0.1);
  --brass-hover: #e7e4dd;
  --on-accent: #101113;
  --ivory: #ededeb;
  --muted: #9b9ea3;
  --line: #282b30;
  --danger: #c05b54;
  --danger-rgb: 192, 91, 84;
  --danger-text: #e0908a;
  --danger-soft-text: #d98a84;
  --tabbar-bg: #0a0b0d;
  --overlay-bg: rgba(12, 13, 15, 0.66);
  --backdrop: rgba(4, 5, 6, 0.78);
  --portrait-a: #2b2e33;
  --portrait-b: #17191c;
  --portrait-c: #0e0f11;
  --portrait-monogram: rgba(237, 237, 235, 0.16);
  --grain-opacity: 0;
  --card-radius: 14px;
  --button-radius: 10px;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="yudin"] body {
  background: radial-gradient(120% 55% at 50% 0%, #15171a 0%, var(--bg) 62%);
}

/* Тихая брендовая полоса вместо лаковой панели. */
[data-theme="yudin"] .topline__meta {
  max-width: 150px;
  font-size: 10.5px;
}

[data-theme="yudin"] .wordmark {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

[data-theme="yudin"] .wordmark small {
  margin-top: 8px;
  font-size: 8.5px;
  letter-spacing: 0.24em;
}

[data-theme="yudin"] .usual {
  border-color: var(--line);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
}

[data-theme="yudin"] .usual__label {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

[data-theme="yudin"] .usual__master em {
  font-style: normal;
  color: var(--muted);
}

[data-theme="yudin"] .section__title {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ivory);
}

[data-theme="yudin"] .screen-head__title {
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.01em;
}

[data-theme="yudin"] .step-title {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

[data-theme="yudin"] .service-row__name,
[data-theme="yudin"] .master-card__name {
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.01em;
}

[data-theme="yudin"] .auth__mark {
  width: 48px;
  height: 48px;
  border-color: var(--line);
  font-size: 28px;
}

[data-theme="yudin"] .auth__name {
  font-size: 14px;
  letter-spacing: 0.22em;
}

[data-theme="yudin"] .auth__title {
  font-weight: 600;
  letter-spacing: -0.03em;
}

[data-theme="yudin"] .field__label {
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

[data-theme="yudin"] .auth__note {
  font-size: 10.5px;
}

[data-theme="yudin"] .date-chip {
  border-radius: var(--button-radius);
}

[data-theme="yudin"] .tab {
  position: relative;
}

[data-theme="yudin"] .tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 1px;
  background: var(--brass);
}

[data-theme="yudin"] .success__mark {
  border-color: var(--line);
}

[data-theme="yudin"] .success__title {
  font-weight: 600;
  letter-spacing: -0.03em;
}

[data-theme="yudin"] .sheet {
  border-radius: 18px 18px 0 0;
}

[data-theme="yudin"] .empty {
  border-style: solid;
  border-color: var(--line);
}

[data-theme="yudin"] .master-card__grade {
  border-radius: 4px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
}

[data-theme="yudin"] .status {
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.04em;
}

[data-theme="yudin"] .btn {
  min-height: 48px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Переключатель тем для демонстрации: открывается с ?preview=1. */
.theme-preview {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 90;
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
}

.theme-preview button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.theme-preview button.is-active {
  background: var(--brass);
  color: var(--on-accent);
}

body.has-preview .app {
  padding-top: 68px;
}

/* Чтобы тап по интерфейсу не выделял текст, как в браузере. */
.tab,
.btn,
.slot,
.date-chip,
.service-row,
.master-card,
.next-visit,
.segmented button,
.link-btn {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

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