/**
 * app.css — стили Telegram Mini App
 *
 * Принципы:
 * - Только var(--tg-theme-*) для цветов — тёмная тема работает автоматически
 * - Фолбэки для просмотра в браузере (значения :root)
 * - Мобильный экран 320–430px, touch-friendly (мин. 44px)
 * - Никаких transform: rotateX/Y — глючит в Android WebView
 */

/* ──────────────────────────────────────────────────────────
   1. CSS-переменные (фолбэки для браузера)
────────────────────────────────────────────────────────── */
:root {
  --tg-theme-bg-color:           #ffffff;
  --tg-theme-secondary-bg-color: #f4f4f5;
  --tg-theme-section-bg-color:   #ffffff;
  --tg-theme-text-color:         #1a1a1a;
  --tg-theme-hint-color:         #8e8e93;
  --tg-theme-link-color:         #2aabee;
  --tg-theme-button-color:       #2aabee;
  --tg-theme-button-text-color:  #ffffff;
  --tg-theme-destructive-text-color: #ff3b30;

  /* Шорткаты */
  --bg:       var(--tg-theme-bg-color);
  --bg2:      var(--tg-theme-secondary-bg-color);
  --surface:  var(--tg-theme-section-bg-color);
  --text:     var(--tg-theme-text-color);
  --hint:     var(--tg-theme-hint-color);
  --accent:   var(--tg-theme-link-color);
  --btn:      var(--tg-theme-button-color);
  --btn-text: var(--tg-theme-button-text-color);

  /* Высота MainButton Telegram (~50px) + отступ */
  --main-btn-h: 60px;

  /* Высота нижнего таб-бара */
  --tab-bar-h: 56px;
}

/* ──────────────────────────────────────────────────────────
   2. Сброс и база
────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; outline: none; }
a { color: var(--accent); text-decoration: none; }

/* ──────────────────────────────────────────────────────────
   3. Экраны и переходы
────────────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  display: none;           /* скрыт по умолчанию */
  flex-direction: column;
  overflow: hidden;
  will-change: transform;
}

/* Активный экран */
.screen.active {
  display: flex;
}

/* Анимация входа справа (переход вперёд) */
.screen.slide-in-right {
  display: flex;
  animation: slideInRight 260ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Анимация входа слева (кнопка назад) */
.screen.slide-in-left {
  display: flex;
  animation: slideInLeft 260ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Фейд для экрана успеха */
.screen.fade-in {
  display: flex;
  animation: fadeIn 300ms ease forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-30%); opacity: 0.7; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Скроллируемая область внутри экрана */
.screen-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: var(--main-btn-h);
}

/* Отступ снизу под MainButton Telegram */
.screen-bottom-space { height: 20px; }

/* ──────────────────────────────────────────────────────────
   4. Разделители и секции
────────────────────────────────────────────────────────── */
.section-divider {
  height: 8px;
  background: var(--bg2);
}

.section {
  padding: 16px 16px 8px;
}

.screen-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* ──────────────────────────────────────────────────────────
   5. Экран 1: Каталог
────────────────────────────────────────────────────────── */

/* Шапка мастера */
.catalog-header {
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
}

.master-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.master-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.master-rating {
  font-size: 13px;
  color: var(--hint);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.rating-count { color: var(--hint); }

.greeting {
  margin-left: auto;
  font-size: 13px;
  color: var(--hint);
  text-align: right;
  flex-shrink: 0;
}

/* Фильтр-чипы */
.filter-wrap {
  background: var(--bg);
  padding: 10px 0 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid color-mix(in srgb, var(--hint) 15%, transparent);
}

.filter-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.1s;
  border: 1.5px solid color-mix(in srgb, var(--hint) 30%, transparent);
  color: var(--hint);
  background: var(--bg);
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
}

.chip.active {
  background: var(--btn);
  color: var(--btn-text);
  border-color: var(--btn);
}

.chip:active { transform: scale(0.96); }

/* Список услуг */
.services-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0 80px;
}

/* Карточка услуги в каталоге */
.service-card {
  margin: 0 16px 10px;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s;
  -webkit-user-select: none;
  user-select: none;
}

.service-card:active {
  transform: scale(0.982);
}

/* Превью-картинка (градиент + эмодзи) */
.service-thumb {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}

.service-thumb-emoji {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

/* Тело карточки */
.service-body {
  padding: 12px 16px 16px;
}

.service-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.service-card-meta {
  font-size: 14px;
  color: var(--hint);
  display: flex;
  align-items: center;
  gap: 6px;
}

.service-card-price {
  font-weight: 600;
  color: var(--accent);
}

.meta-separator { opacity: 0.5; }

/* Shimmer-скелетон */
.skeleton-card {
  margin: 0 16px 12px;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
}

.skeleton-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, var(--bg2) 25%, color-mix(in srgb, var(--bg2) 70%, white) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-body {
  padding: 12px 16px 16px;
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--bg2) 25%, color-mix(in srgb, var(--bg2) 70%, white) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 8px;
}

.skeleton-line.w70 { width: 70%; }
.skeleton-line.w50 { width: 50%; }

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

/* Пустое состояние */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--hint);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 14px; }

/* ──────────────────────────────────────────────────────────
   6. Экран 2: Карточка услуги
────────────────────────────────────────────────────────── */

/* Галерея */
.gallery {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  aspect-ratio: 4 / 3;
  background: var(--bg2);
}

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.gallery-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  flex-shrink: 0;
}

/* Dots-индикатор */
.gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background 0.2s, transform 0.2s;
}

.gallery-dot.active {
  background: #ffffff;
  transform: scale(1.3);
}

/* Заголовок услуги */
.service-header {
  padding: 16px 16px 10px;
}

.service-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 8px;
  padding: 3px 10px;
  margin-bottom: 8px;
}

.service-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 10px;
}

.service-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-dot {
  color: var(--hint);
  font-size: 18px;
  line-height: 1;
}

.meta-icon { font-size: 16px; }

/* Описание */
.service-desc {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
}

.service-desc.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-expand {
  font-size: 14px;
  color: var(--accent);
  margin-top: 6px;
  padding: 4px 0;
  font-weight: 500;
}

/* Табы экрана услуги */
.service-tabs {
  display: flex;
  border-bottom: 1.5px solid rgba(142,142,147,.2);
  margin: 0 16px;
}

.service-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--hint);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: color 150ms ease, border-color 150ms ease;
}

.service-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-rating {
  font-size: 12px;
  font-weight: 600;
  color: inherit;
}

.service-tab-panel {
  padding-top: 4px;
}

/* Рейтинг-бейдж */
.rating-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Список отзывов */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-card {
  background: var(--bg2);
  border-radius: 12px;
  padding: 12px 14px;
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.review-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.review-date {
  font-size: 12px;
  color: var(--hint);
}

.review-stars {
  font-size: 12px;
  color: #f5a623;
  margin-bottom: 4px;
}

.review-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

/* ──────────────────────────────────────────────────────────
   7. Экран 3: Дата и время
────────────────────────────────────────────────────────── */

/* Стрип дней */
.day-strip-wrap {
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
}

.day-strip-wrap::-webkit-scrollbar { display: none; }

.day-strip {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px 0;
  width: max-content;
}

.day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 64px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
  background: var(--bg2);
  gap: 2px;
}

.day-cell:active { transform: scale(0.94); }

.day-cell.active {
  background: var(--btn);
  color: var(--btn-text);
}

.day-cell.weekend { opacity: 0.4; cursor: default; pointer-events: none; }

.day-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.day-cell.active .day-name { color: var(--btn-text); opacity: 0.8; }

.day-num {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.day-cell.active .day-num { color: var(--btn-text); }

/* Подпись под стрипом */
.selected-date-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.service-duration-hint {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 16px;
}

/* Группы слотов */
.slot-group {
  margin-bottom: 18px;
}

.slot-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.slots-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Слот времени */
.slot-btn {
  min-width: 80px;
  height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
  background: var(--bg2);
  color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.slot-btn:active:not(.busy) { transform: scale(0.95); }

.slot-btn.selected {
  background: var(--btn);
  color: var(--btn-text);
  border-color: var(--btn);
}

.slot-btn.busy {
  color: var(--hint);
  border-color: color-mix(in srgb, var(--hint) 25%, transparent);
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
  text-decoration: line-through;
}

.no-slots-msg {
  font-size: 14px;
  color: var(--hint);
  padding: 20px 0;
  text-align: center;
}

/* ──────────────────────────────────────────────────────────
   8. Экран 4: Подтверждение
────────────────────────────────────────────────────────── */

/* Секция формы */
.form-section {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}

.form-field {
  padding: 10px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--hint) 18%, transparent);
  display: flex;
  flex-direction: column;
}

.form-field.form-field--last { border-bottom: none; }

.form-label {
  font-size: 12px;
  color: var(--hint);
  margin-bottom: 3px;
  font-weight: 500;
}

.form-label .optional {
  font-weight: 400;
  opacity: 0.7;
}

.form-input {
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 2px 0;
  width: 100%;
  min-height: 30px;
}

.form-input::placeholder { color: var(--hint); opacity: 0.7; }

.form-textarea {
  min-height: 70px;
  resize: none;
  line-height: 1.5;
}

/* Подсветка поля с ошибкой */
.form-field.error .form-label { color: var(--tg-theme-destructive-text-color); }
.form-field.error .form-input { color: var(--tg-theme-destructive-text-color); }

/* Сводка записи */
.summary-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--hint) 12%, transparent);
}

.summary-row.summary-row--last { border-bottom: none; padding-bottom: 0; }

.summary-label {
  font-size: 14px;
  color: var(--hint);
  flex-shrink: 0;
}

.summary-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.summary-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

/* Политика отмены */
.cancel-policy {
  font-size: 13px;
  color: var(--hint);
  text-align: center;
  padding: 12px 0 4px;
}

/* ──────────────────────────────────────────────────────────
   9. Экран 5: Успех
────────────────────────────────────────────────────────── */
#screen-success {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#screen-success.active,
#screen-success.fade-in { display: flex; }

.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  flex: 1;
  overflow-y: auto;
  width: 100%;
}

/* Анимированная галочка */
.checkmark-wrap {
  margin-bottom: 24px;
}

.checkmark-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--btn);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: checkmarkPop 400ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes checkmarkPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.checkmark-svg {
  width: 44px;
  height: 44px;
}

/* Линия галочки рисуется */
.checkmark-circle-path {
  stroke: rgba(255,255,255,0.3);
  stroke-width: 2;
}

.checkmark-tick {
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawTick 400ms 300ms ease forwards;
}

@keyframes drawTick {
  to { stroke-dashoffset: 0; }
}

.success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
  animation: fadeUp 350ms 400ms ease both;
}

.success-sub {
  font-size: 15px;
  color: var(--hint);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
  animation: fadeUp 350ms 500ms ease both;
}

/* Сводка на экране успеха */
.success-summary {
  width: 100%;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  animation: fadeUp 350ms 600ms ease both;
}

.success-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--hint) 12%, transparent);
}

.success-row:last-child { border-bottom: none; padding-bottom: 0; }

.success-row-icon { font-size: 16px; flex-shrink: 0; }

/* Кнопка «+ В календарь» */
.btn-calendar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform 0.15s;
  animation: fadeUp 350ms 700ms ease both;
}

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

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────────────────────────────────
   10. Браузерная заглушка кнопок (вне Telegram)
────────────────────────────────────────────────────────── */
.browser-main-btn-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  z-index: 100;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 0.5px solid color-mix(in srgb, var(--hint) 20%, transparent);
}

.browser-main-btn {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  background: var(--btn);
  color: var(--btn-text);
  transition: opacity 0.15s, transform 0.1s;
}

.browser-main-btn:active:not(:disabled) { transform: scale(0.99); }

.browser-main-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.browser-back-btn-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  z-index: 100;
  padding: 6px 8px;
  background: var(--bg);
  border-bottom: 0.5px solid color-mix(in srgb, var(--hint) 20%, transparent);
}

.browser-back-btn {
  font-size: 17px;
  font-weight: 400;
  color: var(--accent);
  padding: 4px 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Отступ сверху для экранов когда видна браузерная кнопка назад */
.has-back-btn .screen-scroll,
.has-back-btn .services-list {
  padding-top: 52px;
}

/* ──────────────────────────────────────────────────────────
   11. Утилиты
────────────────────────────────────────────────────────── */
/* Анимация появления карточек */
.card-appear {
  animation: fadeUp 200ms ease both;
}

/* Кнопка «Повторить» при ошибке */
.error-state {
  text-align: center;
  padding: 60px 20px;
}

.error-icon { font-size: 48px; margin-bottom: 12px; }
.error-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.error-sub { font-size: 14px; color: var(--hint); margin-bottom: 20px; }

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--btn-text);
  background: var(--btn);
  min-height: 44px;
}

.btn-retry:active { transform: scale(0.98); }

/* ══════════════════════════════════════════════════
   ОФФЕР-МОДАЛКА
══════════════════════════════════════════════════ */
.offer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  z-index: 1000;
}

.offer-overlay.offer-in {
  display: flex;
  animation: offerBgIn 0.3s ease both;
}

.offer-overlay.offer-in .offer-card {
  animation: offerCardIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.offer-overlay.offer-out {
  display: flex;
  animation: offerBgOut 0.25s ease both;
}

.offer-overlay.offer-out .offer-card {
  animation: offerCardOut 0.2s ease both;
}

@keyframes offerBgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes offerBgOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes offerCardIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes offerCardOut {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}

.offer-card {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 8px 24px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  width: 100%;
  max-width: 430px;
  text-align: center;
}

/* Drag handle */
.offer-card::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: color-mix(in srgb, var(--hint) 30%, transparent);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.offer-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
}

.offer-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 10px;
}

.offer-sub {
  font-size: 15px;
  color: var(--hint);
  line-height: 1.45;
  margin-bottom: 18px;
}

.offer-bullets {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offer-bullets li {
  font-size: 14px;
  color: var(--text);
  padding-left: 20px;
  position: relative;
  line-height: 1.4;
}

.offer-bullets li::before {
  content: '•';
  position: absolute;
  left: 6px;
  color: var(--accent);
  font-weight: 700;
}

.offer-btn {
  display: block;
  width: 100%;
  min-height: 48px;
  background: #2aabee;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  -webkit-tap-highlight-color: transparent;
}

.offer-btn:active { opacity: 0.85; }

.offer-skip {
  background: none;
  border: none;
  color: var(--hint);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  -webkit-tap-highlight-color: transparent;
}

.offer-skip:active { opacity: 0.7; }

/* ══════════════════════════════════════════════════
   ОНБОРДИНГ
══════════════════════════════════════════════════ */
.onboarding-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 40px;
  z-index: 2000;
}

.onboarding-overlay.onb-in {
  display: flex;
  animation: offerBgIn 0.3s ease both;
}

.onboarding-overlay.onb-out {
  display: flex;
  animation: offerBgOut 0.25s ease both;
}

.onboarding-content {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.onboarding-logo {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 20px;
}

.onboarding-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 10px;
}

.onboarding-sub {
  font-size: 15px;
  color: var(--hint);
  line-height: 1.5;
  margin-bottom: 28px;
}

.onboarding-features {
  list-style: none;
  text-align: left;
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onboarding-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.35;
}

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.onboarding-btn {
  display: block;
  width: 100%;
  min-height: 52px;
  background: #2aabee;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.onboarding-btn:active { opacity: 0.85; }

/* ══════════════════════════════════════════════════
   КНОПКА «ПОДЕЛИТЬСЯ»
══════════════════════════════════════════════════ */
.share-btn {
  margin-left: auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg2);
  color: var(--accent);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:active { opacity: 0.7; }

.btn-book {
  display: block;
  width: 100%;
  min-height: 52px;
  background: #2aabee;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-book:active { opacity: 0.85; }

/* ══════════════════════════════════════════════════
   ТАБ-БАР (нижняя навигация)
══════════════════════════════════════════════════ */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  border-top: 0.5px solid color-mix(in srgb, var(--hint) 20%, transparent);
  display: none;
  align-items: stretch;
  z-index: 95;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-bar.visible { display: flex; }

.tab-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  height: var(--tab-bar-h);
  color: var(--hint);
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: color 150ms ease;
}

.tab-bar-item.active { color: var(--accent); }
.tab-bar-item:active { opacity: 0.65; }

.tab-bar-icon {
  font-size: 22px;
  line-height: 1;
}

.tab-bar-label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}

/* Сдвигаем контент вверх, когда виден таб-бар */
.has-tab-bar .services-list {
  padding-bottom: calc(var(--tab-bar-h) + env(safe-area-inset-bottom) + 20px);
}

.has-tab-bar .screen-scroll {
  padding-bottom: calc(var(--tab-bar-h) + env(safe-area-inset-bottom) + 8px);
}

/* ══════════════════════════════════════════════════
   ЭКРАН «О МАСТЕРЕ»
══════════════════════════════════════════════════ */
.about-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.about-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
}

.about-desc {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
}

.about-info-card {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}

.about-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  font-size: 15px;
  border-bottom: 0.5px solid color-mix(in srgb, var(--hint) 15%, transparent);
}

.about-info-row:last-child { border-bottom: none; }
.about-info-label { color: var(--text); }
.about-info-value { color: var(--hint); font-weight: 500; }

/* ══════════════════════════════════════════════════
   ЭКРАН «ПОРТФОЛИО»
══════════════════════════════════════════════════ */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.portfolio-item {
  aspect-ratio: 1;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}

/* ══════════════════════════════════════════════════
   ЭКРАН «МОИ ЗАПИСИ»
══════════════════════════════════════════════════ */
.booking-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
}

.booking-service {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.booking-meta {
  font-size: 14px;
  color: var(--hint);
  margin-bottom: 8px;
}

.booking-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.booking-status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, #34c759 15%, transparent);
  color: #34c759;
}
