:root {
  --bg-main: #0B0E10;
  --bg-card: #171B1F;
  --bg-elevated: #1D2227;
  --bg-nav: rgba(14, 18, 21, 0.94);
  --bg-nav-active: #1C2218;
  --border: #2B3035;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text-main: #F5F5F0;
  --text-muted: #969B9F;
  --text-dim: #686E73;
  --accent: #DAFA45;
  --accent-press: #C5E635;
  --accent-text: #10130B;
  --pill-light: #F2F1EC;
  --pill-light-text: #10130B;
  --danger: #F05252;
  --success: #34D399;
  --warning: #FBBF24;
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
  --pad-x: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-size: 15.5px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 15.5px;
  color: var(--text-main);
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-top: calc(14px + var(--safe-top));
  padding-bottom: calc(96px + var(--safe-bottom));
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* Верхняя шапка основных экранов */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 22px;
}

.brand-trigger {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 4px 0;
  min-height: 44px;
  cursor: pointer;
  color: var(--text-main);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-wordmark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--text-main);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.14s ease, transform 0.12s ease;
}

.icon-btn:active {
  background: var(--bg-card);
  transform: scale(0.95);
}

/* Компактная шапка вложенных экранов */
.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 18px;
  gap: 10px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px 8px 4px;
  background: none;
  border: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 15.5px;
  cursor: pointer;
}

.sub-header-title {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Крупная типографика по референсам */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

.display-title {
  font-size: clamp(32px, 8.8vw, 40px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1px;
  margin: 0 0 20px 0;
}

.display-title .muted-line {
  display: block;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 2px;
}

.page-title {
  font-size: clamp(32px, 8.5vw, 38px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.9px;
  margin: 0 0 22px 0;
}

/* Поисковая строка */
.search-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.search-input {
  width: 100%;
  min-height: 52px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 44px 12px 46px;
  color: var(--text-main);
  font-size: 15.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

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

.search-input:focus {
  border-color: var(--accent);
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Горизонтальные пилюли категорий */
.pills-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 26px;
  scrollbar-width: none;
}

.pills-row::-webkit-scrollbar {
  display: none;
}

.category-pill {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.category-pill:active {
  transform: scale(0.96);
}

.category-pill.active-home {
  background: var(--pill-light);
  color: var(--pill-light-text);
  border-color: var(--pill-light);
}

.category-pill.active-lime {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* Заголовки секций */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 14px 0;
}

.section-heading {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 0;
}

.section-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

/* Рекомендуемая крупная карточка на Главной */
.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.15s ease;
}

.featured-card:active {
  transform: scale(0.985);
}

.featured-index {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.featured-main {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.featured-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 4px 0;
}

.featured-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
}

.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
}

.featured-hint {
  font-size: 14px;
  color: var(--text-muted);
}

.lime-square-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Компактные карточки на Главной */
.compact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.compact-card:active {
  transform: scale(0.985);
}

.compact-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.compact-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Крупные карточки в Каталоге */
.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: transform 0.14s ease;
}

.catalog-card:active {
  transform: scale(0.985);
}

.catalog-cat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.catalog-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.catalog-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.catalog-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 3px 0;
}

.catalog-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

.catalog-cta {
  display: inline-block;
  font-size: 14px;
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--text-muted);
}

/* Логотипы сервисов */
.service-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.service-logo.sm {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.service-logo.lg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

/* Строка-ссылка с разделителями (Как проходит покупка / Не нашли нужное) */
.bottom-inline-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 12px 2px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  width: 100%;
  color: var(--text-main);
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

/* Переключатель Текущие / История в Заказах */
.segmented-control {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 28px;
}

.segment-btn {
  min-height: 44px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.segment-btn.active {
  background: var(--pill-light);
  color: var(--pill-light-text);
}

/* Пустое состояние Заказов по референсу */
.orders-empty-wrap {
  text-align: center;
  padding: 36px 12px 28px 12px;
}

.orders-empty-icon {
  width: 96px;
  height: 68px;
  margin: 0 auto 22px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orders-empty-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 10px 0;
  letter-spacing: -0.4px;
}

.orders-empty-sub {
  font-size: 15.5px;
  color: var(--text-muted);
  max-width: 310px;
  margin: 0 auto 26px auto;
}

/* Кнопки */
.btn-lime {
  width: 100%;
  min-height: 56px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 16.5px;
  font-weight: 700;
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.14s ease, opacity 0.14s ease;
}

.btn-lime:active {
  transform: scale(0.985);
  background: var(--accent-press);
}

.btn-lime:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-surface {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.btn-surface:active {
  background: var(--bg-elevated);
}

.btn-danger-outline {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(240, 82, 82, 0.4);
  background: rgba(240, 82, 82, 0.1);
  color: #F87171;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
}

/* Профиль — карточки и группы меню */
.profile-account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.profile-avatar-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  flex-shrink: 0;
}

.group-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px 4px;
}

.menu-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 22px;
}

.menu-row {
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.menu-row:last-child {
  border-bottom: none;
}

.menu-row:active {
  background: var(--bg-elevated);
}

.menu-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logout-row {
  width: 100%;
  min-height: 52px;
  padding: 10px 6px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
}

/* Поля ввода и формы */
.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field-input, .field-select, .field-textarea {
  width: 100%;
  min-height: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  color: var(--text-main);
  margin-bottom: 14px;
  outline: none;
}

.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--accent);
}

/* Выбор тарифа на странице товара */
.option-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.option-card.selected {
  border-color: var(--accent);
  background: rgba(218, 250, 69, 0.06);
}

.option-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Статус-бейджи */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-main);
}

.status-pill.COMPLETED { background: rgba(218, 250, 69, 0.16); color: var(--accent); }
.status-pill.AWAITING_PAYMENT { background: rgba(251, 191, 36, 0.16); color: var(--warning); }
.status-pill.PAID, .status-pill.PROCESSING { background: rgba(52, 211, 153, 0.16); color: var(--success); }
.status-pill.CANCELED, .status-pill.REFUNDED { background: rgba(240, 82, 82, 0.16); color: var(--danger); }

/* Нижняя навигация по референсам */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 90;
}

.bottom-bar-inner {
  max-width: 480px;
  margin: 0 auto;
  height: 74px;
  padding: 6px 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.nav-tab {
  border: none;
  background: transparent;
  border-radius: 16px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.nav-tab.active {
  background: var(--bg-nav-active);
  color: var(--accent);
}

.nav-tab.active::before {
  content: "";
  position: absolute;
  top: -6px;
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* Нижняя выдвижная панель (Bottom Sheet) и модальные окна */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-panel {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 20px var(--pad-x) calc(24px + var(--safe-bottom)) var(--pad-x);
}

.dialog-panel {
  width: calc(100% - 40px);
  max-width: 400px;
  margin: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
}

/* Skeleton загрузки */
.skeleton {
  background: linear-gradient(90deg, #171B1F 25%, #22272D 50%, #171B1F 75%);
  background-size: 200% 100%;
  animation: skelPulse 1.4s ease-in-out infinite;
  border-radius: var(--radius-lg);
}

@keyframes skelPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toast-notice {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  z-index: 500;
  max-width: 90vw;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}
