/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #07070c;
  --bg-2: #0d0d15;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --solid: #12121c;
  --solid-2: #181824;
  --border: rgba(255, 255, 255, 0.075);
  --border-2: rgba(255, 255, 255, 0.13);
  --text: #f5f5fa;
  --text-2: #c9c9d6;
  --muted: #8a8aa0;
  --faint: #5d5d72;

  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;

  --grad: linear-gradient(135deg, #8b5cf6 0%, #c026d3 55%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(236, 72, 153, 0.16));
  --glow: 0 10px 40px -10px rgba(139, 92, 246, 0.55);

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 11px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 160ms;
  --t: 280ms;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 66px;
  --gutter: 16px;
  --maxw: 760px;
  /* Высота видимой области (обновляется из JS при открытии клавиатуры) */
  --app-h: 100dvh;

  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html.is-locked,
html.is-locked body {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
}

button:disabled {
  cursor: default;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--violet-2);
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--violet-2);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
}

.ico {
  flex: none;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.center {
  text-align: center;
}

.good {
  color: var(--green);
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(139, 92, 246, 0.4);
}

/* Фон-аврора: три размытых пятна, анимируются только transform */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-aurora span {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.16;
  will-change: transform;
}

.bg-aurora span:nth-child(1) {
  background: var(--violet);
  top: -35vmax;
  left: -25vmax;
  animation: drift 26s var(--ease) infinite alternate;
}

.bg-aurora span:nth-child(2) {
  background: var(--pink);
  top: -30vmax;
  right: -35vmax;
  opacity: 0.1;
  animation: drift 32s var(--ease) infinite alternate-reverse;
}

.bg-aurora span:nth-child(3) {
  background: var(--cyan);
  bottom: -50vmax;
  left: 10vmax;
  opacity: 0.06;
  animation: drift 38s var(--ease) infinite alternate;
}

@keyframes drift {
  to {
    transform: translate3d(8vmax, 6vmax, 0) scale(1.1);
  }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}

.app.is-flow {
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

.app.is-chat {
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  height: var(--app-h);
  min-height: 0;
  overflow: hidden;
}

.app.is-chat .view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.view {
  padding: 4px var(--gutter) 0;
}

.view--enter {
  animation: viewIn 340ms var(--ease) both;
}

/* Фоновая перерисовка (живые обновления) — без повторных входных анимаций */
.view.is-repaint {
  animation: none;
}

.is-repaint .product,
.is-repaint .order,
.is-repaint .cart-row,
.is-repaint .profile-head,
.is-repaint .steps__fill,
.is-repaint .stepper,
.is-repaint .empty,
.is-repaint .promo,
.is-repaint .rail__track > .promo,
.is-repaint .promo-input--applied,
.is-repaint .hero__hello,
.is-repaint .hero__title,
.is-repaint .hero__tagline {
  animation: none;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: calc(var(--safe-top) + 8px) var(--gutter) 8px;
  background: linear-gradient(to bottom, rgba(7, 7, 12, 0.92), rgba(7, 7, 12, 0.72));
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.topbar--hidden {
  display: none;
}

.topbar__title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar__title--lg {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.topbar__title--center {
  text-align: center;
}

.topbar__spacer {
  width: 40px;
  flex: none;
}

.topbar__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Tabbar с плавающей «пилюлей» */
.tabbar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 10px);
  transform: translateX(-50%);
  width: min(calc(100% - 20px), 520px);
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(var(--tabs, 4), 1fr);
  padding: 6px;
  border-radius: 24px;
  background: rgba(20, 20, 31, 0.78);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.7);
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}

.is-flow .tabbar,
.is-success .tabbar {
  transform: translate(-50%, 140%);
  opacity: 0;
  pointer-events: none;
}

.is-chat:not(.is-flow) .tabbar {
  display: none;
}

.tabbar__pill {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: calc((100% - 12px) / var(--tabs, 4));
  border-radius: 18px;
  background: var(--grad-soft);
  border: 1px solid rgba(167, 139, 250, 0.25);
  transform: translateX(calc(var(--active, 0) * 100%));
  transition: transform 420ms var(--spring);
  pointer-events: none;
}

.tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  border-radius: 18px;
  transition: color var(--t-fast) ease, transform var(--t-fast) ease;
}

.tab:active {
  transform: scale(0.92);
}

.tab--active {
  color: var(--text);
}

.tab--active .tab__icon {
  animation: tabPop 380ms var(--spring);
}

@keyframes tabPop {
  40% {
    transform: translateY(-3px) scale(1.12);
  }
}

.tab__icon {
  position: relative;
  display: grid;
  place-items: center;
}

.tab--active .tab__icon svg {
  color: var(--violet-2);
}

.tab__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tab__badge {
  position: absolute;
  top: -5px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px #14141f;
  animation: badgeIn 300ms var(--spring);
}

.tab__badge--soft {
  background: var(--violet);
}

@keyframes badgeIn {
  from {
    transform: scale(0);
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast), background var(--t-fast), box-shadow var(--t);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
}

.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--glow);
}

.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
  background-size: 250% 100%;
  background-position: 120% 0;
  pointer-events: none;
}

.btn--primary:not(:disabled):hover::after {
  animation: sheen 1.1s var(--ease);
}

@keyframes sheen {
  to {
    background-position: -120% 0;
  }
}

.btn--ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--soft {
  background: rgba(139, 92, 246, 0.15);
  color: var(--violet-2);
}

.btn--text {
  min-height: 38px;
  padding: 0 10px;
  color: var(--violet-2);
}

.btn--danger {
  background: linear-gradient(135deg, #ef4444, #f43f5e);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.6);
}

.btn--danger-text {
  color: var(--red) !important;
}

.btn--sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: var(--r-sm);
}

.btn--lg {
  min-height: 54px;
  font-size: 16px;
  border-radius: 17px;
}

.btn--block {
  width: 100%;
}

.is-busy {
  pointer-events: none;
  color: transparent !important;
}

.is-busy > * {
  opacity: 0;
}

.is-busy::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
}

.btn--soft.is-busy::before,
.btn--ghost.is-busy::before {
  border-color: rgba(167, 139, 250, 0.25);
  border-top-color: var(--violet-2);
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row > .btn {
  flex: 1;
}

.btn-row--start > .btn {
  flex: none;
}

.btn-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 14px;
  color: var(--text);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}

.icon-btn:active {
  transform: scale(0.9);
}

.icon-btn--soft {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.icon-btn--glass {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.icon-btn--sm {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--muted);
}

.icon-btn--danger {
  color: var(--red);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  color: var(--violet-2);
  font-weight: 600;
  font-size: 14px;
}

.add-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, 0.8);
  transition: transform var(--t-fast) var(--spring);
}

.add-btn:active {
  transform: scale(0.85) rotate(90deg);
}

/* ==========================================================================
   Chips, pills, badges
   ========================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
}

.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip--pending {
  background: rgba(251, 191, 36, 0.13);
  color: var(--amber);
}

.chip--pending .chip__dot {
  animation: pulse 1.6s ease-in-out infinite;
}

.chip--progress {
  background: rgba(34, 211, 238, 0.13);
  color: var(--cyan);
}

.chip--completed {
  background: rgba(52, 211, 153, 0.13);
  color: var(--green);
}

.chip--cancelled {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}

.pill--warn {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

.pill--hot {
  background: rgba(251, 146, 60, 0.14);
  color: #fb923c;
}

.pill--sale {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter) 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chips--wrap {
  flex-wrap: wrap;
  margin: -4px 0 12px;
  padding: 0;
  overflow: visible;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
  scroll-snap-align: start;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease);
}

.chip-btn:active {
  transform: scale(0.95);
}

.chip-btn--active {
  background: var(--text);
  color: #0b0b12;
  border-color: transparent;
}

.chip-btn--hot:not(.chip-btn--active) {
  border-color: rgba(236, 72, 153, 0.4);
  color: #f9a8d4;
}

.chip-btn--add {
  padding: 0 11px;
  gap: 2px;
  color: var(--violet-2);
  border-style: dashed;
}

.chip-btn--sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
}

.chip-btn__count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--violet-2);
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.chip-btn--active .chip-btn__count {
  background: rgba(11, 11, 18, 0.12);
  color: #0b0b12;
}

.badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge--sale {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.badge--hit {
  background: linear-gradient(135deg, #f97316, #f59e0b);
}

.badge--new {
  background: rgba(34, 211, 238, 0.85);
  color: #06212a;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-tag .chip {
  padding: 1px 6px;
  font-size: 10.5px;
}

.mini-tag--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Акцентные палитры для промо-карточек, тегов, папок */
.promo--violet,
.mini-tag--violet,
.chip-btn--violet,
.color-pick--violet,
.folder-badge--violet {
  --a1: #8b5cf6;
  --a2: #6d28d9;
  --a-text: #c4b5fd;
}

.promo--pink,
.mini-tag--pink,
.chip-btn--pink,
.color-pick--pink,
.folder-badge--pink {
  --a1: #ec4899;
  --a2: #be185d;
  --a-text: #f9a8d4;
}

.promo--cyan,
.mini-tag--cyan,
.chip-btn--cyan,
.color-pick--cyan,
.folder-badge--cyan {
  --a1: #06b6d4;
  --a2: #0e7490;
  --a-text: #67e8f9;
}

.promo--lime,
.mini-tag--lime,
.chip-btn--lime,
.color-pick--lime,
.folder-badge--lime,
.mini-tag--green {
  --a1: #84cc16;
  --a2: #3f6212;
  --a-text: #bef264;
}

.mini-tag--green {
  --a-text: var(--green);
  --a1: #10b981;
}

.promo--amber,
.mini-tag--amber,
.chip-btn--amber,
.color-pick--amber,
.folder-badge--amber {
  --a1: #f59e0b;
  --a2: #b45309;
  --a-text: #fcd34d;
}

.promo--red,
.mini-tag--red,
.chip-btn--red,
.color-pick--red,
.folder-badge--red {
  --a1: #ef4444;
  --a2: #991b1b;
  --a-text: #fca5a5;
}

.mini-tag[class*="mini-tag--"]:not(.mini-tag--ghost):not(.mini-tag--order) {
  background: color-mix(in srgb, var(--a1) 16%, transparent);
  color: var(--a-text);
}

.mini-tag--order {
  padding-right: 3px;
}

.chip-btn[class*="chip-btn--"]:not(.chip-btn--active):not(.chip-btn--add):not(.chip-btn--hot):not(.chip-btn--sm) {
  border-color: color-mix(in srgb, var(--a1, #8b5cf6) 30%, transparent);
}

/* ==========================================================================
   Toast / overlays / misc
   ========================================================================== */
.toast-host {
  position: fixed;
  z-index: 200;
  left: 0;
  right: 0;
  top: calc(var(--safe-top) + 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 var(--gutter);
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 440px;
  padding: 11px 16px 11px 11px;
  border-radius: 16px;
  background: rgba(28, 28, 42, 0.92);
  border: 1px solid var(--border-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
  font-size: 14px;
  font-weight: 600;
  animation: toastIn 420ms var(--spring) both;
}

.toast--out {
  animation: toastOut 260ms var(--ease) forwards;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--violet-2);
}

.toast--success .toast__icon {
  background: rgba(52, 211, 153, 0.18);
  color: var(--green);
}

.toast--error .toast__icon {
  background: rgba(248, 113, 113, 0.18);
  color: var(--red);
}

.toast--warning .toast__icon {
  background: rgba(251, 191, 36, 0.18);
  color: var(--amber);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate3d(0, -16px, 0) scale(0.94);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translate3d(0, -12px, 0) scale(0.96);
  }
}

.offline {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 22px);
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

.ptr {
  position: fixed;
  z-index: 40;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  width: 38px;
  height: 38px;
  margin-left: -19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--solid-2);
  border: 1px solid var(--border-2);
  opacity: 0;
  transform: translate3d(0, -50px, 0) scale(0.6);
  transition: opacity 200ms, transform 300ms var(--spring);
  pointer-events: none;
}

.ptr--on {
  opacity: 1;
  transform: translate3d(0, calc(var(--pull, 0) * 30px), 0) scale(calc(0.6 + var(--pull, 0) * 0.4));
}

.ptr__ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(167, 139, 250, 0.25);
  border-top-color: var(--violet-2);
  transform: rotate(calc(var(--pull, 0) * 300deg));
}

.ptr--ready .ptr__ring {
  border-color: var(--violet-2);
}

.ptr--loading .ptr__ring {
  border-color: rgba(167, 139, 250, 0.25);
  border-top-color: var(--violet-2);
  animation: spin 700ms linear infinite;
}

.splash {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  background: var(--bg);
  transition: opacity 420ms var(--ease), visibility 420ms;
}

.splash--out {
  opacity: 0;
  visibility: hidden;
}

.splash__logo {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 28px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 20px 60px -10px rgba(139, 92, 246, 0.7);
  animation: splashPulse 1.6s var(--ease) infinite;
}

.splash__bar {
  width: 120px;
  height: 3px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.splash__bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  animation: loading 1.1s var(--ease) infinite;
}

@keyframes splashPulse {
  50% {
    transform: scale(1.06);
  }
}

@keyframes loading {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(260%);
  }
}

.fatal {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  background: var(--bg);
  animation: viewIn 400ms var(--ease);
}

.fatal__glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--violet);
  filter: blur(100px);
  opacity: 0.18;
}

.fatal__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 26px;
  background: var(--grad-soft);
  border: 1px solid var(--border-2);
  color: var(--violet-2);
  margin-bottom: 6px;
}

.fatal__title {
  position: relative;
  font-size: 22px;
  font-weight: 800;
}

.fatal__text {
  position: relative;
  max-width: 320px;
  color: var(--muted);
}

/* ==========================================================================
   Telegram-only gate (браузер закрыт)
   ========================================================================== */
.gate {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 20px calc(28px + var(--safe-bottom));
  background: var(--bg);
  animation: viewIn 400ms var(--ease);
}

.gate__glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--violet);
  filter: blur(100px);
  opacity: 0.18;
}

.gate__logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 28px;
  background: var(--grad-soft);
  border: 1px solid var(--border-2);
  color: var(--violet-2);
  box-shadow: var(--glow);
}

.gate__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 380px;
  padding: 22px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
}

.gate__title {
  font-size: 21px;
  font-weight: 800;
  text-align: center;
}

.gate__text {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.gate__steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gate__step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
}

.gate__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 1px solid var(--border-2);
  color: var(--violet-2);
  font-size: 12px;
  font-weight: 800;
}

.gate__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--glow);
  transition: transform var(--t-fast) var(--spring), opacity var(--t-fast) var(--ease);
}

.gate__btn:active {
  transform: scale(0.97);
}

.gate__btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
  box-shadow: none;
}

.gate__note {
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 400;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  z-index: 450;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, calc(0.92 * var(--fade, 1)));
  opacity: 0;
  transition: opacity 220ms var(--ease);
}

.lightbox--in {
  opacity: 1;
}

.lightbox__img {
  max-width: 100%;
  max-height: 86dvh;
  border-radius: 16px;
  object-fit: contain;
  transform: scale(0.94);
  transition: transform 300ms var(--spring);
}

.lightbox--in .lightbox__img {
  transform: none;
}

.lightbox__close {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(167, 139, 250, 0.2);
  border-top-color: var(--violet-2);
  animation: spin 760ms linear infinite;
}

.spinner--sm {
  width: 18px;
  height: 18px;
  border-width: 2.5px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--muted);
  font-size: 13.5px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 44px 20px;
  text-align: center;
  animation: viewIn 400ms var(--ease);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin-bottom: 8px;
  border-radius: 24px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--violet-2);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  50% {
    transform: translateY(-6px);
  }
}

.empty__title {
  font-size: 17px;
  font-weight: 800;
}

.empty__subtitle {
  max-width: 300px;
  color: var(--muted);
  font-size: 14px;
}

.empty .btn {
  margin-top: 12px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--text-2);
  font-size: 13.5px;
}

.notice svg {
  margin-top: 1px;
  color: var(--violet-2);
}

.notice--warn {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fde68a;
}

.notice--warn svg {
  color: var(--amber);
}

.footnote {
  margin: 22px 0 6px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
}

/* Skeletons */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-2);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 8px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.skeleton-card--order {
  padding: 18px;
}

.skeleton--media {
  aspect-ratio: 1;
  border-radius: 16px;
}

.skeleton--line {
  height: 13px;
}

.skeleton--short {
  width: 55%;
}

.skeleton--avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: none;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
}

.skeleton-row__lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Avatar */
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--size, 44px);
  height: var(--size, 44px);
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--hue, 262) 75% 62%), hsl(calc(var(--hue, 262) + 40) 70% 45%));
  color: #fff;
  font-weight: 800;
  font-size: calc(var(--size, 44px) * 0.36);
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar__online {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: calc(var(--size, 44px) * 0.26);
  height: calc(var(--size, 44px) * 0.26);
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2.5px var(--bg);
}

/* Switch */
.switch {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  cursor: pointer;
}

.switch__input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.switch__track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--surface-3);
  transition: background var(--t) var(--ease);
}

.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 340ms var(--spring);
}

.switch__input:checked + .switch__track {
  background: var(--grad);
}

.switch__input:checked + .switch__track .switch__thumb {
  transform: translateX(20px);
}

.switch__input:focus-visible + .switch__track {
  outline: 2px solid var(--violet-2);
  outline-offset: 2px;
}

/* ==========================================================================
   Sheets & dialogs
   ========================================================================== */
.sheet {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(3, 3, 8, 0);
  transition: background var(--t) var(--ease);
}

.sheet--in {
  background: rgba(3, 3, 8, 0.66);
}

.sheet--out {
  background: rgba(3, 3, 8, 0);
  pointer-events: none;
}

.sheet__panel {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  max-height: calc(100dvh - var(--safe-top) - 40px);
  display: flex;
  flex-direction: column;
  border-radius: 28px 28px 0 0;
  background: linear-gradient(to bottom, #171724, #11111b);
  border: 1px solid var(--border-2);
  border-bottom: 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.8);
  transform: translate3d(0, 105%, 0);
  transition: transform 460ms var(--ease);
  will-change: transform;
}

.sheet--in .sheet__panel {
  transform: none;
}

.sheet--out .sheet__panel {
  transform: translate3d(0, 105%, 0);
  transition-duration: 300ms;
}

.sheet__panel--tall {
  height: calc(100dvh - var(--safe-top) - 40px);
}

.sheet__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 56px 6px;
  flex: none;
}

.sheet__grab {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 40px;
  height: 5px;
  margin-left: -20px;
  border-radius: 99px;
  background: var(--surface-3);
}

.sheet__title {
  font-size: 16.5px;
  font-weight: 800;
  text-align: center;
}

.sheet__close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  transition: transform var(--t-fast) var(--ease);
}

.sheet__close:active {
  transform: scale(0.88);
}

.sheet__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 20px 18px;
  -webkit-overflow-scrolling: touch;
}

.sheet__body > * + * {
  margin-top: 14px;
}

.sheet__foot {
  flex: none;
  padding: 12px 20px calc(var(--safe-bottom) + 14px);
  border-top: 1px solid var(--border);
  background: rgba(17, 17, 27, 0.9);
}

.sheet__panel:not(:has(.sheet__foot)) .sheet__body {
  padding-bottom: calc(var(--safe-bottom) + 22px);
}

.sheet-hint {
  color: var(--muted);
  font-size: 13.5px;
}

.dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 6px;
  text-align: center;
}

.dialog__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  background: var(--grad-soft);
  color: var(--violet-2);
  animation: popIn 420ms var(--spring);
}

.dialog__icon--danger {
  background: rgba(248, 113, 113, 0.14);
  color: var(--red);
}

@keyframes popIn {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

.dialog__title {
  font-size: 19px;
  font-weight: 800;
}

.dialog__text {
  color: var(--muted);
  max-width: 340px;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  text-align: left;
  transition: background var(--t-fast);
  animation: rowIn 360ms var(--ease) both;
}

.action-item:nth-child(2) { animation-delay: 25ms; }
.action-item:nth-child(3) { animation-delay: 50ms; }
.action-item:nth-child(4) { animation-delay: 75ms; }
.action-item:nth-child(5) { animation-delay: 100ms; }
.action-item:nth-child(6) { animation-delay: 125ms; }
.action-item:nth-child(n + 7) { animation-delay: 150ms; }

.action-item:active {
  background: var(--surface-2);
}

.action-item__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--violet-2);
  font-size: 18px;
}

.action-item--danger .action-item__icon,
.action-item--danger .action-item__label {
  color: var(--red);
}

.action-item--active .action-item__icon {
  background: var(--grad);
  color: #fff;
}

.action-item__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.action-item__label {
  font-weight: 700;
}

.action-item__hint {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-item__check {
  color: var(--violet-2);
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
}

/* ==========================================================================
   Forms
   ========================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field__label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 15.5px;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.field__input::placeholder {
  color: var(--faint);
}

.field__input:focus {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(139, 92, 246, 0.06);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.field__input--area {
  resize: vertical;
  min-height: 90px;
  line-height: 1.45;
}

.field__input[type="datetime-local"] {
  color-scheme: dark;
}

.field__hint {
  color: var(--faint);
  font-size: 12.5px;
}

.field__hint.is-over {
  color: var(--red);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-with-btn {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-btn .btn {
  flex: none;
  min-height: 48px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.toggle-row--flat {
  padding: 4px 0;
  background: none;
  border: 0;
}

.toggle-row__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 14.5px;
}

.toggle-row__text .muted {
  font-size: 12.5px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.segmented--scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented--scroll::-webkit-scrollbar {
  display: none;
}

.segmented__item {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background var(--t) var(--ease), color var(--t-fast);
}

.segmented__item.is-active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.4);
}

.segmented__count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.25);
  color: var(--violet-2);
  font-size: 11px;
  line-height: 19px;
  text-align: center;
}

.emoji-row,
.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emoji-pick {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 20px;
  transition: transform var(--t-fast) var(--spring), border-color var(--t-fast);
}

.emoji-pick.is-active {
  border-color: var(--violet-2);
  background: rgba(139, 92, 246, 0.16);
  transform: scale(1.08);
}

.color-pick {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
  transition: transform var(--t-fast) var(--spring), box-shadow var(--t-fast);
}

.color-pick.is-active {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--a1);
}

.photo-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-field__preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1.3;
  max-height: 260px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  animation: viewIn 300ms var(--ease);
}

.photo-field__preview--wide {
  aspect-ratio: 1.8;
}

.photo-field__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-field__preview.is-loading img {
  filter: blur(4px) brightness(0.6);
}

.photo-field__preview .spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -13px 0 0 -13px;
}

.photo-field__x {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(8px);
}

.photo-field__pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  border-radius: 16px;
  border: 1.5px dashed rgba(167, 139, 250, 0.35);
  background: rgba(139, 92, 246, 0.06);
  color: var(--violet-2);
  font-weight: 700;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease);
}

.photo-field__pick:active {
  transform: scale(0.98);
  background: rgba(139, 92, 246, 0.12);
}

/* ==========================================================================
   Cards & lists (shared)
   ========================================================================== */
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack--tight {
  gap: 8px;
}

.card {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.card--list {
  padding: 4px;
}

.card--form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 10px;
}

.section-head .section-title {
  margin: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 24px 0 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.section-title svg {
  color: var(--violet-2);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 15px;
  text-align: left;
  transition: background var(--t-fast);
}

button.list-row:active {
  background: var(--surface-2);
}

.list-row + .list-row {
  box-shadow: 0 -1px 0 var(--border);
}

.list-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.list-row__text b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14.5px;
}

.list-row__text .muted {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row__end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.list-row__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  background: var(--surface-2);
}

.list-row__icon--warn {
  background: rgba(251, 191, 36, 0.13);
  color: var(--amber);
}

.result-info {
  min-height: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin: 2px 2px 8px;
}

.result-info:empty {
  margin: 0;
}

/* ==========================================================================
   Catalog
   ========================================================================== */
.hero {
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  padding: calc(var(--safe-top) + 26px) var(--gutter) 18px;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.35), transparent 65%);
  pointer-events: none;
  animation: float 7s ease-in-out infinite;
}

.hero .hero__cart {
  position: absolute;
  top: calc(var(--safe-top) + 20px);
  right: var(--gutter);
  z-index: 2;
}

.hero__text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 56px;
}

.hero__hello {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  animation: viewIn 500ms var(--ease) both;
}

.hero__title {
  font-size: 34px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #fff 30%, #d8b4fe 65%, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: viewIn 600ms 60ms var(--ease) both;
}

.hero__tagline {
  color: var(--text-2);
  font-size: 14.5px;
  animation: viewIn 600ms 120ms var(--ease) both;
}

.hero .notice {
  margin-top: 14px;
}

.cart-btn {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--pink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2.5px var(--bg);
  transform: scale(0);
  transition: transform 300ms var(--spring);
}

.cart-badge--on {
  transform: scale(1);
}

.cart-badge.is-bump {
  animation: bump 450ms var(--spring);
}

@keyframes bump {
  35% {
    transform: scale(1.45);
  }
}

.cart-fab {
  position: fixed;
  z-index: 29;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 8px 0 18px;
  border-radius: 99px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  box-shadow: 0 14px 34px -8px rgba(192, 38, 211, 0.7);
  transform: translate(-50%, 30px) scale(0.85);
  opacity: 0;
  pointer-events: none;
  transition: transform 420ms var(--spring), opacity 260ms var(--ease);
}

.cart-fab.is-on {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.cart-fab:active {
  transform: translate(-50%, 0) scale(0.95);
}

.cart-fab__count {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  line-height: 30px;
  text-align: center;
}

/* Промо-рейл */
.rail {
  margin: 4px 0 18px;
}

.rail__head {
  margin-bottom: 10px;
}

.rail__head .section-title {
  margin: 0;
}

.rail__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter) 6px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.rail__track::-webkit-scrollbar {
  display: none;
}

.rail__track > .promo {
  flex: 0 0 min(86%, 380px);
  scroll-snap-align: start;
  animation: cardIn 520ms calc(var(--i, 0) * 70ms) var(--ease) both;
}

.rail__track > .promo:only-child {
  flex-basis: 100%;
}

.rail__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.rail__dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  transition: width var(--t) var(--ease), background var(--t);
}

.rail__dot.is-on {
  width: 20px;
  background: var(--violet-2);
}

/* Промо-карточка */
.promo {
  --a1: #8b5cf6;
  --a2: #6d28d9;
  --a-text: #c4b5fd;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 176px;
  padding: 18px;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--a1) 75%, transparent), transparent 60%),
    linear-gradient(150deg, color-mix(in srgb, var(--a2) 85%, #000) 0%, #12121c 85%);
  border: 1px solid color-mix(in srgb, var(--a1) 40%, transparent);
  box-shadow: 0 16px 40px -18px color-mix(in srgb, var(--a1) 70%, transparent);
}

.promo--compact {
  min-height: 0;
}

.promo__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  mask-image: linear-gradient(to left, #000 20%, transparent 90%);
  -webkit-mask-image: linear-gradient(to left, #000 20%, transparent 90%);
}

.promo__shine {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.13) 48%, transparent 60%);
  transform: translateX(-120%);
  animation: promoShine 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes promoShine {
  0%,
  60% {
    transform: translateX(-120%);
  }
  80%,
  100% {
    transform: translateX(120%);
  }
}

.promo__top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.promo__kind {
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.promo__pin {
  display: grid;
  place-items: center;
  color: var(--a-text);
}

.promo__until {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
}

.promo__emoji {
  position: absolute;
  right: 16px;
  top: 34px;
  font-size: 46px;
  line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
  animation: float 4.5s ease-in-out infinite;
}

.promo--compact .promo__emoji {
  font-size: 34px;
  top: 30px;
}

.promo__title {
  margin-top: 6px;
  padding-right: 64px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
}

.promo__body {
  padding-right: 40px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13.5px;
  white-space: pre-line;
}

.promo__code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 7px 7px 7px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  transition: transform var(--t-fast) var(--ease), border-color var(--t), background var(--t);
  margin-top: 12px;
}

.promo__code:active {
  transform: scale(0.97);
}

.promo__code-text {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
}

.promo__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: #fff;
  color: #11111b;
  font-size: 13px;
  font-weight: 800;
  transition: background var(--t), color var(--t);
}

.promo__code.is-copied {
  border-color: var(--green);
  border-style: solid;
  background: rgba(16, 185, 129, 0.18);
}

.promo__code.is-copied .promo__copy {
  background: var(--green);
  color: #052e1f;
  animation: bump 420ms var(--spring);
}

.promo__new {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #fff;
  color: #11111b;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.06em;
  animation: pulseScale 1.8s ease-in-out infinite;
}

@keyframes pulseScale {
  50% {
    transform: scale(1.08);
  }
}

/* Тулбар каталога */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 calc(var(--gutter) * -1) 12px;
  padding: calc(var(--safe-top) + 10px) var(--gutter) 10px;
  background: linear-gradient(to bottom, rgba(7, 7, 12, 0.96) 70%, rgba(7, 7, 12, 0));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.toolbar__row {
  display: flex;
  gap: 10px;
}

.search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search__icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  display: grid;
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.search__input::-webkit-search-cancel-button {
  display: none;
}

.search__input::placeholder {
  color: var(--faint);
}

.search__input:focus {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(139, 92, 246, 0.07);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.search__clear {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  animation: popIn 260ms var(--spring);
}

/* Сетка товаров */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid--empty {
  grid-template-columns: 1fr;
}

.is-catalog .grid {
  padding-bottom: 64px;
}

@media (min-width: 560px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t) var(--ease), border-color var(--t);
  animation: cardIn 520ms calc(var(--i, 0) * 45ms) var(--ease) both;
}

.product:active {
  transform: scale(0.975);
}

@media (hover: hover) {
  .product:hover {
    border-color: rgba(167, 139, 250, 0.3);
    transform: translateY(-2px);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0) scale(0.98);
  }
}

.media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(236, 72, 153, 0.08));
}

.media__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(167, 139, 250, 0.4);
}

.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 450ms var(--ease), transform 700ms var(--ease);
}

.media img.media__img--in {
  opacity: 1;
  transform: none;
}

.media--card {
  aspect-ratio: 1;
  margin: 6px 6px 0;
  border-radius: 17px;
}

.media--sheet {
  aspect-ratio: 1.15;
  max-height: 46dvh;
  width: 100%;
  border-radius: 22px;
}

.media--zoom {
  cursor: zoom-in;
}

.media--thumb {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 15px;
}

.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 10, 16, 0.5);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: color var(--t-fast);
}

.fav-btn--on {
  color: #fb7185;
}

.fav-btn.is-pop {
  animation: heartPop 480ms var(--spring);
}

@keyframes heartPop {
  30% {
    transform: scale(1.35);
  }
  60% {
    transform: scale(0.92);
  }
}

.stock-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(10, 10, 16, 0.62);
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.product__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  padding: 10px 12px 12px;
}

.product__cat {
  color: var(--violet-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.product__name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.product__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.product__action {
  display: flex;
  flex: none;
}

.product .stepper {
  height: 36px;
}

.product .stepper__btn {
  width: 30px;
}

.price-tag {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.price {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.price--sale {
  color: #f472b6;
}

.price--lg {
  font-size: 22px;
}

.price-old {
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: line-through;
}

.price-tag--lg {
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}

.price-tag--lg .price {
  font-size: 26px;
}

.price-tag--lg .price-old {
  font-size: 15px;
}

.price-tag--sm .price {
  font-size: 13.5px;
  color: var(--muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 3px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  animation: popIn 300ms var(--spring);
}

.stepper__btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 100%;
  border-radius: 10px;
  color: var(--text);
  transition: background var(--t-fast), transform var(--t-fast);
}

.stepper__btn:active:not(:disabled) {
  background: var(--surface-3);
  transform: scale(0.88);
}

.stepper__btn:disabled {
  opacity: 0.3;
}

.stepper__qty {
  min-width: 26px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Карточка товара в шторке */
.sheet__panel--product .sheet__head {
  min-height: 34px;
  padding-top: 18px;
}

.sheet-product {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-product__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sheet-product__badges:empty {
  display: none;
}

.sheet-product__name {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.sheet-product__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.sheet-product__desc {
  color: var(--text-2);
  white-space: pre-line;
}

.sheet-product__row {
  display: flex;
  gap: 10px;
}

.sheet-product__row .stepper {
  height: 54px;
}

.sheet-product__row .btn {
  flex: 1;
  min-height: 54px;
}

/* ==========================================================================
   Cart & checkout
   ========================================================================== */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.cart-row {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  animation: cardIn 420ms calc(var(--i, 0) * 50ms) var(--ease) both;
}

.cart-row .media--thumb {
  width: 84px;
  height: 84px;
}

.cart-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-row__head {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.cart-row__name {
  flex: 1;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-row__head .icon-btn {
  margin: -6px -6px 0 0;
}

.cart-row__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
}

.cart-row__foot .stepper {
  height: 36px;
}

.cart-row__foot .stepper__btn {
  width: 32px;
}

.cart-row__sum {
  font-weight: 800;
}

.promo-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 14px;
  border-radius: 17px;
  background: var(--surface);
  border: 1.5px dashed rgba(167, 139, 250, 0.3);
  transition: border-color var(--t);
}

.promo-input:focus-within {
  border-color: rgba(167, 139, 250, 0.7);
}

.promo-input.is-shake {
  animation: shake 420ms var(--ease);
  border-color: var(--red);
}

@keyframes shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

.promo-input__icon {
  color: var(--violet-2);
  display: grid;
}

.promo-input__field {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  background: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  outline: none;
}

.promo-input__field::placeholder {
  text-transform: none;
  letter-spacing: 0;
  color: var(--faint);
  font-weight: 500;
}

.promo-input--applied {
  border-style: solid;
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(16, 185, 129, 0.08);
  animation: popIn 380ms var(--spring);
}

.promo-input--applied .promo-input__icon {
  color: var(--green);
}

.promo-input__text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.promo-input__code {
  font-weight: 800;
  letter-spacing: 0.1em;
}

.promo-input__hint {
  color: var(--green);
  font-size: 12.5px;
  font-weight: 700;
}

.comment-card {
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.comment-card__label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.comment-field {
  width: 100%;
  border: 0;
  background: none;
  resize: none;
  outline: none;
  font-size: 15px;
}

.comment-field::placeholder {
  color: var(--faint);
}

.flow-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 16px calc(var(--gutter) * -1) 0;
  padding: 16px var(--gutter) calc(var(--safe-bottom) + 16px);
  background: linear-gradient(to bottom, rgba(7, 7, 12, 0), rgba(7, 7, 12, 0.94) 22%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--solid);
  border: 1px solid var(--border);
}

.summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--text-2);
  font-size: 14px;
}

.summary__row--good {
  color: var(--green);
  font-weight: 700;
}

.summary__row--total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
}

/* Success */
.success {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 30px) 4px calc(var(--safe-bottom) + 20px);
  text-align: center;
}

.success__badge {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 20px 60px -10px rgba(192, 38, 211, 0.8);
  animation: popIn 620ms var(--spring) both;
}

.success__badge svg {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw 500ms 300ms var(--ease) forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.success__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(236, 72, 153, 0.6);
  animation: ring 1.8s var(--ease) infinite;
}

.success__ring--2 {
  animation-delay: 0.6s;
}

@keyframes ring {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(1.9);
    opacity: 0;
  }
}

.success__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  animation: viewIn 500ms 200ms var(--ease) both;
}

.success__text {
  max-width: 320px;
  color: var(--muted);
  animation: viewIn 500ms 280ms var(--ease) both;
}

.success__ticket {
  width: 100%;
  max-width: 360px;
  margin: 10px 0;
  padding: 14px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px dashed var(--border-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: viewIn 500ms 360ms var(--ease) both;
}

.success__ticket-row {
  display: flex;
  justify-content: space-between;
}

.success__actions {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: viewIn 500ms 440ms var(--ease) both;
}

/* ==========================================================================
   Orders
   ========================================================================== */
.order {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  animation: cardIn 460ms calc(var(--i, 0) * 50ms) var(--ease) both;
}

.order[data-status="cancelled"] {
  opacity: 0.7;
}

.order__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.order__title {
  display: flex;
  flex-direction: column;
}

.order__id {
  font-size: 17px;
  font-weight: 800;
}

.order__date {
  color: var(--muted);
  font-size: 12.5px;
}

.order__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order__item {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.order__item-name {
  flex: 1;
  min-width: 0;
  color: var(--text-2);
}

.order__item-qty {
  color: var(--muted);
}

.order__item-price {
  font-weight: 700;
}

.order__comment,
.note-card {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  text-align: left;
  width: 100%;
}

.order__comment svg,
.note-card svg {
  flex: none;
  margin-top: 2px;
  color: var(--violet-2);
}

.order__discount {
  display: flex;
  justify-content: space-between;
  color: var(--green);
  font-size: 13.5px;
  font-weight: 700;
}

.order__discount span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.order__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.order__actions {
  display: flex;
  gap: 8px;
}

.order__actions .btn {
  flex: 1;
}

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 2px;
}

.steps__track {
  position: absolute;
  top: 12px;
  left: 16.6%;
  right: 16.6%;
  height: 3px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}

.steps__fill {
  height: 100%;
  width: 100%;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
  transition: transform 800ms var(--ease);
  animation: fillIn 900ms var(--ease) both;
}

@keyframes fillIn {
  from {
    transform: scaleX(0);
  }
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step__dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--solid-2);
  border: 2px solid var(--surface-3);
  color: #fff;
  transition: background var(--t), border-color var(--t);
}

.step--done .step__dot {
  background: var(--violet);
  border-color: var(--violet);
}

.step--current .step__dot {
  box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.2);
  animation: currentPulse 2s ease-in-out infinite;
}

@keyframes currentPulse {
  50% {
    box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.08);
  }
}

.step__label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.step--done .step__label {
  color: var(--text-2);
}

.steps--cancelled {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.08);
  color: var(--red);
  font-weight: 700;
  font-size: 13.5px;
}

.help-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 20px;
  background: var(--grad-soft);
  border: 1px solid rgba(167, 139, 250, 0.2);
  text-align: left;
  transition: transform var(--t-fast) var(--ease);
}

.help-card:active {
  transform: scale(0.98);
}

.help-card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
}

.help-card__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--text-2);
}

.help-card__text b {
  font-size: 15px;
  color: var(--text);
}

/* ==========================================================================
   Profile
   ========================================================================== */
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 0 18px;
  animation: viewIn 420ms var(--ease) both;
}

.profile-head .avatar {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px rgba(167, 139, 250, 0.5);
}

.profile-head__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.profile-head__name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.profile-head__handle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13.5px;
}

.profile-footer {
  margin: 22px 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.profile-footer__link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.profile-footer__meta,
.profile-footer__copy {
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  min-width: 0;
}

.stat__value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat--action {
  border-color: rgba(167, 139, 250, 0.3);
}

.profile-promos .stack {
  gap: 10px;
}

.row-group {
  margin-top: 18px;
  padding: 4px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.row-link {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px;
  border-radius: 17px;
  text-align: left;
  transition: background var(--t-fast);
}

.row-link:active {
  background: var(--surface-2);
}

.row-link + .row-link {
  box-shadow: 0 -1px 0 var(--border);
}

.row-link__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 13px;
  background: var(--grad-soft);
  color: var(--violet-2);
}

.row-link__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.row-link__title {
  font-weight: 700;
}

.row-link__sub {
  color: var(--muted);
  font-size: 12.5px;
}

.row-link__badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--pink);
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.row-link__chevron {
  color: var(--faint);
  display: grid;
}

/* ==========================================================================
   Chat (shared by customer & CRM)
   ========================================================================== */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  margin: 0 calc(var(--gutter) * -1);
}

.is-user-chat {
  padding-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  height: var(--app-h);
  min-height: 0;
  overflow: hidden;
}

.is-user-chat .view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}

.is-user-chat .chat-page {
  height: auto;
  flex: 1;
  min-height: 0;
}

/* Без верхней панели шапка чата сама отступает под статус-бар. */
.is-user-chat .chat-head {
  padding-top: calc(var(--safe-top) + 10px);
}

.chat-page--admin {
  height: auto;
  flex: 1;
  min-height: 0;
  margin: 0;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 var(--gutter) 8px;
  padding: 10px 12px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex: none;
}

.chat-head--admin {
  margin: 0;
  padding: calc(var(--safe-top) + 8px) 8px 8px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 16, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  gap: 4px;
}

.chat-head__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 15px;
  background: var(--grad);
  color: #fff;
}

.chat-head__online {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px #11111a;
}

.chat-head__who {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  border-radius: 14px;
  text-align: left;
}

.chat-head__ava {
  display: grid;
}

.chat-head__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-head__name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-head__status {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-head__status.is-online {
  color: var(--green);
}

.thread-info {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  flex: none;
  border-bottom: 1px solid var(--border);
}

.thread-info:empty {
  display: none;
}

.note-line {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  color: var(--amber);
  font-size: 12.5px;
  text-align: left;
}

.note-line span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 var(--gutter) 8px;
  flex: none;
  scrollbar-width: none;
}

.order-strip::-webkit-scrollbar {
  display: none;
}

.order-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.order-pill.is-active {
  border-color: var(--violet-2);
  background: rgba(139, 92, 246, 0.14);
}

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px var(--gutter) 10px;
  -webkit-overflow-scrolling: touch;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100%;
  justify-content: flex-end;
}

.chat-welcome {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
  animation: viewIn 500ms var(--ease);
}

.chat-welcome h3 {
  color: var(--text);
  font-size: 18px;
}

.chat-welcome__icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 24px;
  background: var(--grad-soft);
  color: var(--violet-2);
  animation: float 4s ease-in-out infinite;
}

.chat-day {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin: 10px 0 6px;
}

.chat-day span {
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(20, 20, 31, 0.85);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.msg {
  display: flex;
  max-width: 100%;
}

.msg--out {
  justify-content: flex-end;
}

.msg__bubble {
  position: relative;
  max-width: min(82%, 520px);
  padding: 9px 13px 7px;
  border-radius: 20px;
  background: var(--solid-2);
  border: 1px solid var(--border);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}

.msg--in .msg__bubble {
  border-bottom-left-radius: 7px;
}

.msg--out .msg__bubble {
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  border-color: transparent;
  border-bottom-right-radius: 7px;
  color: #fff;
}

.msg--auto .msg__bubble {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(139, 92, 246, 0.12));
  border-color: rgba(34, 211, 238, 0.25);
  color: var(--text);
}

.msg--new .msg__bubble {
  animation: msgIn 380ms var(--spring) both;
}

.msg--out.msg--new .msg__bubble {
  transform-origin: bottom right;
}

.msg--in.msg--new .msg__bubble {
  transform-origin: bottom left;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(8px);
  }
}

.msg--pending .msg__bubble {
  opacity: 0.7;
}

.msg__bubble--photo {
  padding: 4px 4px 7px;
}

.msg__bubble--photo .msg__text,
.msg__bubble--photo .msg__auto,
.msg__bubble--photo .msg__order {
  margin: 6px 9px 0;
}

.msg__bubble--photo .msg__meta {
  margin-right: 8px;
}

.msg__photo {
  width: 100%;
  max-width: 280px;
  max-height: 320px;
  min-height: 120px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--surface-2);
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 300ms;
}

.msg__photo.is-in {
  opacity: 1;
}

.msg__auto,
.msg__order {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.msg__auto {
  color: var(--cyan);
}

.msg__order {
  opacity: 0.85;
}

.msg__text {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.4;
}

.msg__text a {
  color: inherit;
  text-decoration: underline;
}

.msg__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  margin-left: 14px;
  float: right;
  font-size: 11px;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}

.msg__ticks {
  display: grid;
}

.msg__ticks.is-read {
  color: #a5f3fc;
  opacity: 1;
}

.msg--typing .msg__bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  animation: msgIn 300ms var(--spring);
}

.typing {
  display: inline-flex;
  gap: 4px;
}

.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet-2);
  animation: typing 1.2s ease-in-out infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.typing__label {
  color: var(--muted);
  font-size: 12.5px;
}

.chat-typing:empty {
  display: none;
}

.chat-typing {
  margin-top: 4px;
}

.chat-bottom {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px var(--gutter) calc(var(--safe-bottom) + 10px);
  border-top: 1px solid var(--border);
  background: rgba(10, 10, 16, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app:not(.is-chat) .chat-bottom {
  padding-bottom: 10px;
}

.quick-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter);
  scrollbar-width: none;
}

.quick-row::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 34px;
  padding: 0 13px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.22);
  color: #ddd6fe;
  font-size: 13px;
  font-weight: 600;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
  animation: rowIn 400ms var(--ease) both;
}

.quick-chip svg {
  color: var(--violet-2);
}

.quick-chip:active {
  transform: scale(0.94);
  background: rgba(139, 92, 246, 0.25);
}

.quick-row--templates .quick-chip {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

.quick-row--templates .quick-chip svg {
  color: var(--amber);
}

.reply-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.12);
  border-left: 3px solid var(--violet-2);
  color: #ddd6fe;
  font-size: 13px;
  font-weight: 600;
  animation: rowIn 300ms var(--ease);
}

.reply-tag span {
  flex: 1;
}

.reply-tag__x {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composer__row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.composer__attach {
  display: grid;
  place-items: center;
  width: 42px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  color: var(--muted);
  transition: color var(--t-fast), transform var(--t-fast) var(--ease);
}

.composer__attach:active {
  transform: scale(0.88);
  color: var(--violet-2);
}

.composer__field {
  flex: 1;
  min-width: 0;
  display: flex;
  border-radius: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast);
}

.composer__field:focus-within {
  border-color: rgba(167, 139, 250, 0.5);
}

.composer__input {
  width: 100%;
  min-height: 44px;
  max-height: 140px;
  padding: 11px 16px;
  border: 0;
  background: none;
  resize: none;
  outline: none;
  font-size: 15.5px;
  line-height: 1.4;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
}

.composer__input::placeholder {
  color: var(--faint);
}

.composer__send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--faint);
  transform: scale(0.9);
  transition: transform 300ms var(--spring), background var(--t), color var(--t), box-shadow var(--t);
}

.composer__send.is-ready {
  background: var(--grad);
  color: #fff;
  transform: scale(1);
  box-shadow: 0 8px 20px -6px rgba(192, 38, 211, 0.7);
}

.composer__send.is-ready:active {
  transform: scale(0.88);
}

.composer__preview {
  display: flex;
}

.composer__thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 16px;
  overflow: hidden;
  animation: popIn 320ms var(--spring);
}

.composer__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer__thumb.is-loading img {
  filter: brightness(0.5) blur(2px);
}

.composer__thumb .spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -9px 0 0 -9px;
}

.composer__thumb:not(.is-loading) .spinner {
  display: none;
}

.composer__thumb-x {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}

/* ==========================================================================
   Privacy policy
   ========================================================================== */
.policy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.policy__intro {
  color: var(--text-2);
}

.policy__section {
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.policy__title {
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 800;
}

.policy__text {
  color: var(--muted);
  font-size: 13.5px;
}

.policy__divider {
  height: 1px;
  background: var(--border);
}

.policy__confirm-title {
  font-weight: 800;
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.check:has(input:checked) {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(139, 92, 246, 0.08);
}

.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 7px;
  border: 2px solid var(--border-2);
  display: grid;
  place-items: center;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.check input:checked {
  background: var(--grad);
  border-color: transparent;
}

.check input:checked::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  animation: popIn 260ms var(--spring);
}

.check__text {
  font-size: 14px;
}

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-nav {
  position: sticky;
  top: calc(58px + var(--safe-top));
  z-index: 14;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: -4px calc(var(--gutter) * -1) 14px;
  padding: 6px var(--gutter) 10px;
  background: linear-gradient(to bottom, rgba(7, 7, 12, 0.92) 75%, rgba(7, 7, 12, 0));
  scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar {
  display: none;
}

.admin-nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 40px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 13.5px;
  transition: background var(--t), color var(--t-fast), transform var(--t-fast) var(--ease);
}

.admin-nav__item:active {
  transform: scale(0.95);
}

.admin-nav__item.is-active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(192, 38, 211, 0.7);
}

.admin-nav__dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 2px var(--bg);
  animation: pulse 1.6s ease-in-out infinite;
}

.admin-body {
  animation: viewIn 320ms var(--ease);
}

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-hero .muted {
  font-size: 13px;
  text-transform: capitalize;
}

.admin-hero__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

.live-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}

.live-pill--off {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi {
  --k: var(--violet);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--k) 16%, transparent), rgba(255, 255, 255, 0.025));
  border: 1px solid color-mix(in srgb, var(--k) 22%, transparent);
  text-align: left;
  overflow: hidden;
  animation: cardIn 460ms var(--ease) both;
  transition: transform var(--t-fast) var(--ease);
}

button.kpi:active {
  transform: scale(0.97);
}

.kpi:nth-child(2) { animation-delay: 50ms; }
.kpi:nth-child(3) { animation-delay: 100ms; }
.kpi:nth-child(4) { animation-delay: 150ms; }

.kpi--amber { --k: var(--amber); }
.kpi--pink { --k: var(--pink); }
.kpi--cyan { --k: var(--cyan); }

.kpi__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--k) 20%, transparent);
  color: var(--k);
}

.kpi__label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.kpi__value {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.kpi__sub {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 4px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}

.quick-action:active {
  transform: scale(0.93);
  background: var(--surface-2);
}

.quick-action__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--grad-soft);
  color: var(--violet-2);
}

.chart-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-card__head > div {
  display: flex;
  flex-direction: column;
}

.chart-card__head .muted {
  font-size: 12.5px;
  font-weight: 700;
}

.chart-card__total {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  height: 150px;
  align-items: end;
}

.bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
}

.bar__value {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.bar__col {
  width: 100%;
  max-width: 34px;
  height: calc(var(--h) * 100px);
  min-height: 4px;
  border-radius: 9px 9px 5px 5px;
  background: linear-gradient(to top, rgba(139, 92, 246, 0.35), rgba(167, 139, 250, 0.7));
  transform-origin: bottom;
  animation: barGrow 700ms calc(var(--i, 0) * 60ms) var(--spring) both;
}

.bar--today .bar__col {
  background: var(--grad);
  box-shadow: 0 6px 20px -6px rgba(192, 38, 211, 0.8);
}

@keyframes barGrow {
  from {
    transform: scaleY(0);
  }
}

.bar__label {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
}

.bar--today .bar__label {
  color: var(--violet-2);
}

.split-bar {
  display: flex;
  gap: 3px;
  height: 12px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-2);
}

.split-bar__part {
  flex-basis: 0;
  min-width: 0;
  transform-origin: left;
  animation: fillIn 900ms var(--ease) both;
}

.split-bar__part--pending { background: var(--amber); }
.split-bar__part--progress { background: var(--cyan); }
.split-bar__part--completed { background: var(--green); }
.split-bar__part--cancelled { background: var(--red); }

.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 12px;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 13px;
  text-align: left;
}

.legend__item b {
  margin-left: auto;
}

.legend__item .muted {
  font-size: 11.5px;
  min-width: 30px;
  text-align: right;
}

.legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.legend__dot--pending { background: var(--amber); }
.legend__dot--progress { background: var(--cyan); }
.legend__dot--completed { background: var(--green); }
.legend__dot--cancelled { background: var(--red); }

.rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 800;
  font-size: 13px;
}

.rank--1 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #422006;
}

.rank--2 {
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
  color: #1f2937;
}

.rank--3 {
  background: linear-gradient(135deg, #fdba74, #c2410c);
  color: #431407;
}

.stock-num {
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 9px;
  background: var(--surface-2);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stock-num--low {
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
}

.stock-num--zero {
  background: rgba(248, 113, 113, 0.14);
  color: var(--red);
}

/* CRM */
.crm-head {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.crm-head .btn {
  flex: none;
  min-height: 44px;
}

.chips--crm {
  margin-bottom: 12px;
}

.threads {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 40px 10px 10px;
  border-radius: 18px;
  cursor: pointer;
  transition: background var(--t-fast);
  animation: rowIn 380ms calc(var(--i, 0) * 30ms) var(--ease) both;
}

.thread:active {
  background: var(--surface-2);
}

.thread--pinned {
  background: rgba(139, 92, 246, 0.05);
}

.thread--unread {
  background: rgba(236, 72, 153, 0.06);
}

.thread__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread__top,
.thread__bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.thread__name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.thread--unread .thread__name {
  font-weight: 800;
}

.thread__pin {
  color: var(--violet-2);
  display: grid;
}

.thread__time {
  margin-left: auto;
  flex: none;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}

.thread--unread .thread__time {
  color: var(--pink);
}

.thread__preview {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread--unread .thread__preview {
  color: var(--text-2);
}

.thread__badge {
  flex: none;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--grad);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  animation: badgeIn 300ms var(--spring);
}

.thread__ticks {
  display: grid;
  color: var(--faint);
}

.thread__ticks.is-read {
  color: var(--cyan);
}

.thread__tags {
  display: flex;
  gap: 4px;
  margin-top: 3px;
  overflow: hidden;
}

.thread__more {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  border-radius: 11px;
  color: var(--faint);
}

.thread__more:active {
  background: var(--surface-2);
}

.folder-badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: color-mix(in srgb, var(--a1, #8b5cf6) 18%, transparent);
  font-size: 18px;
}

/* Заказы админки */
.aorder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  text-align: left;
  animation: cardIn 420ms calc(var(--i, 0) * 40ms) var(--ease) both;
  transition: transform var(--t-fast) var(--ease);
}

.aorder:active {
  transform: scale(0.985);
}

.aorder--pending { border-left-color: var(--amber); }
.aorder--progress { border-left-color: var(--cyan); }
.aorder--completed { border-left-color: var(--green); }
.aorder--cancelled { border-left-color: var(--red); opacity: 0.75; }

.aorder__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aorder__who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.aorder__who b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aorder__who .muted {
  font-size: 12.5px;
}

.aorder__sum {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.aorder__items {
  color: var(--text-2);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aorder__comment {
  display: flex;
  gap: 6px;
  color: var(--amber);
  font-size: 13px;
}

.aorder__comment svg {
  flex: none;
  margin-top: 2px;
}

.customer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
}

.customer-card__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Товары админки */
.aproduct {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 8px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  animation: rowIn 380ms calc(var(--i, 0) * 30ms) var(--ease) both;
  transition: transform var(--t-fast) var(--ease);
}

.aproduct:active {
  transform: scale(0.985);
}

.aproduct__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aproduct__name {
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aproduct__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.aproduct__meta .price {
  font-size: 14px;
}

.mini-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}

.mini-stepper button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 30px;
  border-radius: 9px;
  transition: background var(--t-fast), transform var(--t-fast);
}

.mini-stepper button:active {
  background: var(--surface-3);
  transform: scale(0.85);
}

.mini-stepper .stock-num {
  background: none;
  padding: 0 2px;
}

/* Клиенты */
.urow {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  animation: rowIn 380ms calc(var(--i, 0) * 30ms) var(--ease) both;
  transition: transform var(--t-fast) var(--ease);
}

.urow:active {
  transform: scale(0.985);
}

.urow__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.urow__name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.urow__name b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.urow__text > .muted {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.urow__end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 13.5px;
}

.urow__end .muted {
  font-size: 12px;
}

.ucard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.ucard .avatar {
  box-shadow: 0 0 0 3px #161622, 0 0 0 5px rgba(167, 139, 250, 0.45);
  margin-bottom: 6px;
}

.ucard__name {
  font-size: 21px;
  font-weight: 800;
}

.ucard__id {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.ucard__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.action-tile {
  --t-c: var(--violet-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 6px;
  border-radius: 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 700;
  transition: transform var(--t-fast) var(--ease);
}

.action-tile:active {
  transform: scale(0.94);
}

.action-tile__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--t-c) 16%, transparent);
  color: var(--t-c);
}

.action-tile--amber { --t-c: var(--amber); }
.action-tile--red { --t-c: var(--red); }
.action-tile--green { --t-c: var(--green); }

/* Контент */
.content-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  border-radius: 18px;
  border: 1.5px dashed rgba(167, 139, 250, 0.35);
  background: rgba(139, 92, 246, 0.05);
  color: var(--violet-2);
  font-weight: 700;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}

.add-card:active {
  transform: scale(0.98);
  background: rgba(139, 92, 246, 0.12);
}

.add-card__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
}

.admin-promo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: cardIn 420ms var(--ease) both;
}

.admin-promo.is-off .promo {
  filter: grayscale(0.8) brightness(0.7);
}

.admin-promo__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.preview-box {
  margin-top: 6px !important;
}

.promo-row,
.auto-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  animation: rowIn 360ms var(--ease) both;
  transition: transform var(--t-fast) var(--ease);
}

.promo-row:active,
.auto-row:active {
  transform: scale(0.985);
}

.promo-row.is-off,
.auto-row.is-off {
  opacity: 0.5;
}

.promo-row__code {
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.5px dashed rgba(167, 139, 250, 0.5);
  background: rgba(139, 92, 246, 0.1);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 13.5px;
  color: #ddd6fe;
}

.promo-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.auto-row {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.auto-row__q {
  display: flex;
  align-items: center;
  gap: 7px;
}

.auto-row__q svg {
  color: var(--violet-2);
}

.auto-row__a {
  color: var(--muted);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.auto-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.auto-row__meta .muted {
  margin-left: auto;
}

/* Настройки */
.broadcast-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(140deg, rgba(139, 92, 246, 0.25), rgba(236, 72, 153, 0.18));
  border: 1px solid rgba(167, 139, 250, 0.3);
  text-align: left;
  transition: transform var(--t-fast) var(--ease);
}

.broadcast-card:active {
  transform: scale(0.98);
}

.broadcast-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  background: var(--grad);
  color: #fff;
  animation: float 3.5s ease-in-out infinite;
}

.broadcast-card__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  color: var(--text-2);
  font-size: 13px;
}

.broadcast-card__text b {
  color: var(--text);
  font-size: 15.5px;
}

.card--form + .btn,
.admin-body > .btn--lg {
  margin-top: 16px;
}

/* ==========================================================================
   Wide screens
   ========================================================================== */
@media (min-width: 760px) {
  :root {
    --gutter: 24px;
  }

  .sheet {
    align-items: center;
  }

  .sheet__panel {
    max-width: 560px;
    border-radius: 28px;
    border-bottom: 1px solid var(--border-2);
    max-height: 88dvh;
  }

  .sheet__panel--tall {
    height: 88dvh;
  }

  .sheet__foot {
    border-radius: 0 0 28px 28px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .bg-aurora {
    display: none;
  }
}
