:root {
  color-scheme: light;
  --bg: #f5f5f4;
  --panel: #ffffff;
  --panel-rgb: 255, 255, 255;
  --panel-alt: #f0f0ef;
  --text: #19170f;
  --muted: #78715f;
  --line: #e3e3e1;
  --accent: #d7ff3f;
  --accent-ink: #14170a;
  --accent-text: #5c6b12;
  --accent-soft: rgba(215, 255, 63, 0.16);
  --green: #2f6f4e;
  --success: #2f6f4e;
  --success-bg: #eef7f1;
  --success-border: rgba(47, 111, 78, 0.28);
  --warning: #915611;
  --warning-bg: #fff6e7;
  --warning-border: rgba(145, 86, 17, 0.28);
  --danger: #a62f27;
  --danger-bg: #fcebea;
  --danger-border: rgba(166, 47, 39, 0.26);
  --shadow: 0 4px 16px rgba(25, 23, 19, 0.06);
  --shadow-sm: 0 2px 8px rgba(25, 23, 19, 0.05);
  --shadow-md: 0 10px 28px rgba(25, 23, 19, 0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --tap: 44px;
  --dur-fast: 180ms;
  --dur-slow: 300ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #141414;
  --panel-rgb: 20, 20, 20;
  --panel-alt: #1a1a1a;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #d7ff3f;
  --accent-ink: #0a0a0a;
  --accent-text: #d7ff3f;
  --accent-soft: rgba(215, 255, 63, 0.18);
  --green: #4caf7d;
  --success: #4caf7d;
  --success-bg: rgba(76, 175, 125, 0.14);
  --success-border: rgba(76, 175, 125, 0.32);
  --warning: #d99a4e;
  --warning-bg: rgba(217, 154, 78, 0.14);
  --warning-border: rgba(217, 154, 78, 0.32);
  --danger: #e2574a;
  --danger-bg: rgba(226, 87, 74, 0.16);
  --danger-border: rgba(226, 87, 74, 0.32);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Mirrors [data-theme="dark"] above for the pre-JS/no-choice-yet paint - dark is the
   default theme regardless of system preference, so this applies unconditionally
   (not gated behind prefers-color-scheme) until JS sets data-theme="light" for users
   who picked light explicitly. Keep in sync with [data-theme="dark"] above. */
:root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #141414;
  --panel-alt: #1a1a1a;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #d7ff3f;
  --accent-ink: #0a0a0a;
  --accent-text: #d7ff3f;
  --accent-soft: rgba(215, 255, 63, 0.18);
  --green: #4caf7d;
  --success: #4caf7d;
  --success-bg: rgba(76, 175, 125, 0.14);
  --warning: #d99a4e;
  --warning-bg: rgba(217, 154, 78, 0.14);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition: background var(--dur-slow) var(--ease), color var(--dur-slow) var(--ease);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

button,
a,
input,
textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-3)
    calc(76px + env(safe-area-inset-bottom));
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
}

.app.app-visible {
  opacity: 1;
}

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: var(--bg);
  transition: opacity var(--dur-slow) var(--ease);
}

.boot-loader-hide {
  opacity: 0;
  pointer-events: none;
}

.boot-loader-mark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.boot-loader-bar {
  position: relative;
  width: 120px;
  height: 2px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--line);
}

.boot-loader-bar-fill {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  animation: boot-loader-sweep 1.1s ease-in-out infinite;
}

@keyframes boot-loader-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

.event-banner {
  position: relative;
  z-index: 5;
  display: block;
  width: min(100%, 980px);
  margin: 0 auto var(--space-3);
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .event-banner:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
  }
}

.event-banner-image {
  display: block;
  width: 100%;
  aspect-ratio: 4.2 / 1;
  object-fit: cover;
}

.category-tabs {
  position: sticky;
  top: calc(var(--space-2) + env(safe-area-inset-top));
  z-index: 15;
  display: flex;
  width: min(100%, 980px);
  margin: 0 auto var(--space-4);
  gap: 2px;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.category-tab.active {
  color: var(--accent-text);
  font-weight: 700;
}

.category-tab:active {
  color: var(--accent-text);
}

.category-tab:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 980px);
  margin: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(var(--panel-rgb), 0.94);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  transition: background var(--dur-slow) var(--ease);
}

.bottom-nav[hidden] {
  display: none;
}

.checkout-bar {
  position: fixed;
  left: 50%;
  bottom: calc(66px + env(safe-area-inset-bottom));
  z-index: 19;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: min(calc(100% - 24px), 956px);
  margin: 0;
  padding: 12px var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
  animation: checkout-bar-in var(--dur-slow) var(--ease);
}

.checkout-bar[hidden] {
  display: none;
}

.checkout-bar-count {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
  white-space: nowrap;
}

.checkout-bar-total {
  font-size: 15px;
  font-weight: 800;
  margin-right: auto;
}

.checkout-bar-cta {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

@keyframes checkout-bar-in {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkout-bar {
    animation: none;
  }
}

.bottom-nav.has-admin {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.nav-button {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  width: 100%;
  padding: 6px 4px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.nav-icon {
  width: 21px;
  height: 21px;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease);
}

.nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease);
}

.nav-button:active .nav-icon,
.nav-button:active .nav-label {
  color: var(--accent-text);
}

.nav-button-count {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.nav-button-bump .nav-icon {
  animation: nav-bump 0.4s var(--ease);
}

@keyframes nav-bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-button-bump .nav-icon {
    animation: none;
  }
}

.nav-button:active,
.icon-button:active {
  transform: scale(0.98);
  transition: transform var(--dur-fast) var(--ease);
}

.nav-button:active {
  background: var(--panel-alt);
}

.icon-button,
.primary-button,
.secondary-button,
.stepper button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s var(--ease), background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  flex: 0 0 var(--tap);
  padding: 0;
  border-radius: var(--radius-pill);
  font-size: 18px;
  line-height: 1;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.secondary-button {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}

.primary-button:active,
.secondary-button:active,
.icon-button:active {
  transform: scale(0.98);
}

@media (hover: hover) and (pointer: fine) {
  .primary-button:hover,
  .secondary-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }

  .primary-button:hover {
    box-shadow: 0 4px 20px rgba(215, 255, 63, 0.35);
  }

  .secondary-button:hover {
    border-color: var(--accent);
  }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-items: start;
  gap: 14px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto 18px;
}

.preorder-progress {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.preorder-progress-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  text-align: center;
}

.preorder-progress-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.preorder-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transition: width 0.4s ease;
  animation: preorder-progress-pulse 1.4s ease-in-out infinite;
}

@keyframes preorder-progress-pulse {
  0%,
  100% {
    filter: brightness(1) saturate(1) hue-rotate(0deg);
    box-shadow: 0 0 6px var(--accent);
  }
  50% {
    filter: brightness(1.5) saturate(1.6) hue-rotate(25deg);
    box-shadow: 0 0 18px var(--accent);
  }
}

.preorder-progress-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text);
  opacity: 0.45;
  mix-blend-mode: difference;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .preorder-progress-fill {
    animation: none;
  }
}

.preorder-progress-percent {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-text);
}

.preorder-progress-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.preorder-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease);
}

.preorder-stage-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 9px;
  font-weight: 700;
  color: var(--success);
}

.preorder-stage-done .preorder-stage-dot {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.preorder-stage-done .preorder-stage-text {
  color: var(--muted);
}

.preorder-stage-current {
  color: var(--text);
  font-weight: 700;
}

.preorder-stage-current .preorder-stage-dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  animation: preorder-stage-current-pulse 1.4s ease-in-out infinite;
}

@keyframes preorder-stage-current-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--accent-soft);
  }
  50% {
    box-shadow: 0 0 0 4px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preorder-stage-current .preorder-stage-dot {
    animation: none;
  }
}

.vk-review-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--panel-alt);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .vk-review-banner:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
  }
}

.vk-review-banner-icon {
  display: inline-flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.vk-review-banner-icon .icon {
  width: 22px;
  height: 22px;
  fill: var(--accent-text);
  stroke: none;
}

.vk-review-banner-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vk-review-banner-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.vk-review-banner-text span {
  font-size: 12px;
  color: var(--muted);
}

.vk-review-banner-arrow {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.admin-preorder-field {
  display: grid;
  gap: 4px;
}

.admin-preorder-field span {
  color: var(--muted);
  font-size: 12px;
}

.admin-preorder-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.admin-preorder-form {
  grid-template-columns: 1fr;
  margin-bottom: 10px;
}

.admin-preorder-hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.overlay-panel,
.checkout-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  justify-items: center;
  background: rgba(25, 23, 19, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: calc(12px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
}

.overlay-panel[hidden],
.checkout-panel[hidden] {
  display: none;
}

.overlay-panel-stack {
  z-index: 50;
  background: rgba(25, 23, 19, 0.32);
}

.overlay-panel-full {
  align-items: stretch;
  justify-items: stretch;
  padding: 0;
  background: var(--panel);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.overlay-panel-full .checkout-window-full {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 100%;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-3)
    calc(var(--space-3) + env(safe-area-inset-bottom) + var(--keyboard-inset, 0px));
}

.overlay-panel-full .screen-header,
.overlay-panel-full .screen-title,
.overlay-panel-full .checkout-actions,
.overlay-panel-full .orders-toolbar,
.overlay-panel-full .order-message-composer {
  flex-shrink: 0;
}

.overlay-panel-full .order-detail-body.overlay-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.overlay-panel-full .order-thread-messages {
  max-height: none;
}

.overlay-panel-full .overlay-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

.overlay-panel-full .checkout-items.overlay-scroll-body {
  margin-bottom: 0;
  border-bottom: 0;
}

.checkout-window {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  height: min(760px, calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-height: min(760px, calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  height: min(760px, calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-height: min(760px, calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: var(--space-3);
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.screen-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.screen-header-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-2);
}

.text-back-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}

.order-screen-title,
.screen-title {
  margin: 0 0 var(--space-3);
  font-size: 22px;
  line-height: 1.2;
}

.checkout-items {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.checkout-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.checkout-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  font-size: 14px;
}

.checkout-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checkout-line > .checkout-line-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkout-line-stepper {
  grid-template-columns: 30px 32px 30px;
}

.checkout-line-stepper button {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.checkout-line-stepper .qty {
  height: 30px;
  font-size: 14px;
}

.checkout-line-price {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.checkout-line > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.checkout-line span {
  color: var(--muted);
}

.checkout-line-variant {
  font-size: 12px;
}

.checkout-line .checkout-line-bulk-badge {
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
}

.checkout-remove {
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(215, 255, 63, 0.1);
  color: var(--accent-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.checkout-remove::before,
.checkout-remove::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 8px;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.checkout-remove::before {
  transform: rotate(45deg);
}

.checkout-remove::after {
  transform: rotate(-45deg);
}

.checkout-remove:active {
  transform: scale(0.96);
}

.checkout-total {
  font-weight: 700;
}

.checkout-total-secondary {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.checkout-total-discount {
  color: var(--success);
}

.cart-promo {
  margin: 2px 0;
}

.cart-promo-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
}

.cart-promo-remove {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.cart-promo-form {
  display: flex;
  gap: 8px;
}

.cart-promo-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.cart-promo-hint a {
  color: var(--accent-text);
}

.cart-promo-suggestion {
  margin: 0 0 8px;
  line-height: 1.6;
}

.cart-promo-chip {
  display: inline-flex;
  align-items: center;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  padding: 1px 8px;
  margin: 0 1px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}

.cart-promo-chip-copied {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.cart-promo-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
}

.cart-promo-submit {
  flex-shrink: 0;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.checkout-form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.checkout-form-scroll {
  display: grid;
  gap: var(--space-3);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.checkout-form label {
  display: grid;
  gap: 6px;
}

.checkout-form label span,
.checkout-form legend {
  color: var(--muted);
  font-size: 12px;
}

.checkout-form input,
.checkout-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  padding: 10px;
  resize: vertical;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(215, 255, 63, 0.14);
}

.field-hint {
  display: block;
  min-height: 16px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field-hint:empty {
  display: none;
}

.field-hint.warning {
  color: var(--warning);
}

.checkout-form input.invalid,
.checkout-form textarea.invalid,
.delivery-option.invalid {
  border-color: var(--accent);
  background: var(--danger-bg);
}

.checkout-form fieldset {
  margin: 0;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.checkout-form fieldset legend {
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
}

.checkout-form .field-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  background: var(--panel-alt);
}

.delivery-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

.delivery-option {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
}

.delivery-option.active {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 700;
}

.yandex-pickup-control {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.delivery-options[hidden] + .yandex-pickup-control {
  margin-top: 0;
}

.yandex-pickup-summary {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  background: var(--success-bg);
}

.yandex-pickup-summary strong {
  color: var(--success);
  font-size: 13px;
}

.yandex-pickup-summary span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.yandex-delivery-quote {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  background: var(--success-bg);
}

.yandex-delivery-quote strong {
  color: var(--success);
  font-size: 14px;
}

.yandex-delivery-quote span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.yandex-delivery-quote.is-error {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.yandex-delivery-quote.is-error strong {
  color: var(--accent-text);
}

.yandex-pickup-button {
  width: 100%;
  min-height: 40px;
}

.yandex-pickup-control.invalid .yandex-pickup-button {
  border-color: var(--accent);
  background: var(--danger-bg);
}

.yandex-pickup-manual {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  overflow: hidden;
}

.yandex-pickup-manual-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.yandex-pickup-manual-toggle::after {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--muted);
  transform: rotate(45deg) translate(-1px, 1px);
  transition: transform 160ms ease;
}

.yandex-pickup-manual-toggle[aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-1px, 1px);
}

.yandex-pickup-manual-form {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.yandex-pickup-manual-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.yandex-pickup-manual-actions {
  display: flex;
  gap: 8px;
}

.yandex-pickup-manual-actions .secondary-button,
.yandex-pickup-manual-actions .primary-button {
  flex: 1;
  min-height: 40px;
}

.pickup-panel {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: var(--panel);
}

.pickup-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--panel);
}

.pickup-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  border-bottom: 1px solid var(--line);
}

.pickup-header .text-back-button {
  justify-self: start;
}

.pickup-header strong {
  text-align: center;
  white-space: nowrap;
}

.pickup-widget {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  overflow: hidden;
}

.stickers-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

.stickers-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.stickers-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.stickers-option:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(215, 255, 63, 0.08);
}

.stickers-option.invalid {
  border-color: var(--accent);
  background: var(--danger-bg);
}

.checkout-form .consent-panel {
  padding: var(--space-3);
}

.checkout-form .consent-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.consent-checkbox-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.consent-checkbox-box {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}

.consent-checkbox-box::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 13px;
  border: solid var(--accent-ink);
  border-width: 0 2.5px 2.5px 0;
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.consent-checkbox-input:checked ~ .consent-checkbox-box {
  background: var(--accent);
  border-color: var(--accent);
}

.consent-checkbox-input:checked ~ .consent-checkbox-box::after {
  opacity: 1;
}

.consent-checkbox-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

#checkoutConsentField.invalid .consent-panel {
  border-color: var(--accent);
  background: var(--danger-bg);
}

.inline-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--accent-text);
  text-decoration: underline;
  cursor: pointer;
}

.checkout-note,
.checkout-info,
.form-error {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.checkout-note {
  color: var(--muted);
}

.checkout-info {
  color: var(--muted);
  margin-bottom: var(--space-3);
  padding: 12px var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.form-error {
  color: var(--danger);
}

.checkout-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: var(--space-2);
  flex-shrink: 0;
  margin-top: 0;
  padding: 12px 0 calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.checkout-form > .form-error {
  flex-shrink: 0;
  min-height: 0;
  margin: 8px 0 0;
}

.checkout-actions .primary-button,
.checkout-actions .secondary-button {
  width: 100%;
  white-space: normal;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  animation: card-in var(--dur-slow) var(--ease);
}

.skeleton-card {
  animation: none;
}

.skeleton-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
}

.skeleton-block {
  position: relative;
  overflow: hidden;
  background: var(--panel-alt);
}

.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(var(--panel-rgb), 0.6), transparent);
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.skeleton-line {
  height: 12px;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block::after {
    animation: none;
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes overlay-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overlay-panel:not([hidden]),
.checkout-panel:not([hidden]) {
  animation: overlay-fade-in var(--dur-slow) var(--ease);
}

.overlay-panel:not([hidden]) > *,
.checkout-panel:not([hidden]) > * {
  animation: sheet-in var(--dur-slow) var(--ease);
}

.app-alert-overlay:not([hidden]) {
  animation: overlay-fade-in var(--dur-fast) var(--ease);
}

.app-alert-overlay:not([hidden]) .app-alert-box {
  animation: sheet-in var(--dur-fast) var(--ease);
}

.cover-gallery {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #1c1a17;
  overflow: hidden;
  touch-action: pan-y;
}

.cover-gallery:focus-visible {
  outline: 2px solid rgba(215, 255, 63, 0.55);
  outline-offset: -2px;
}

.cover {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  user-select: none;
  transition: transform 0.4s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .cover-gallery:hover .cover {
    transform: scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover {
    transition: none;
  }
}

.product-card[data-fulfillment="made_to_order"] .cover {
  object-fit: contain;
  background: var(--panel-alt);
}

.product-card[data-fulfillment="made_to_order"] .cover-gallery {
  background: var(--panel-alt);
}

.product-card[data-cover-aspect="wide"] .cover {
  aspect-ratio: 16 / 9;
}

.cover-nav {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  transform: translateY(-50%);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.cover-nav .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.cover-prev {
  left: 8px;
}

.cover-next {
  right: 8px;
}

.cover-nav:active {
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(0.92);
}

.cover-dots {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.cover-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cover-dot.active {
  width: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.cover-gallery-single .cover-nav,
.cover-gallery-single .cover-dots {
  display: none;
}

.product-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-4);
  border-top: 1px solid var(--line);
}

.product-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ozon-reviews-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.ozon-reviews-link .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

@media (hover: hover) and (pointer: fine) {
  .ozon-reviews-link:hover {
    text-decoration: underline;
  }
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.3;
}

.badges:empty {
  display: none;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-badge .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.product-badge-stock {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

.product-badge-low {
  border-color: var(--warning-border);
  background: var(--warning-bg);
  color: var(--warning);
}

.product-badge-new {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 700;
  animation: product-badge-new-blink 1.8s ease-in-out infinite;
}

@keyframes product-badge-new-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-badge-new {
    animation: none;
  }
}

.variants:empty {
  display: none;
}

.variants {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.variant-group {
  display: grid;
  gap: 4px;
}

.variant-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.variant-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-pill {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.variant-pill.selected {
  border-color: var(--accent);
  background: rgba(215, 255, 63, 0.1);
  color: var(--accent-text);
  font-weight: 700;
}

.variant-hint {
  margin: -2px 0 4px;
  font-size: 12px;
  color: var(--accent-text);
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.price-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: 0 0 auto;
}

.price {
  white-space: nowrap;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.price-note {
  max-width: 160px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--success);
  text-align: right;
}

.description {
  display: -webkit-box;
  margin: 10px 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.description.expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  white-space: pre-line;
}

.description-toggle {
  margin: -2px 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--line);
}

@media (hover: hover) and (pointer: fine) {
  .description-toggle:hover {
    color: var(--text);
    text-decoration-color: currentColor;
  }
}

.track-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.track-toggle .icon {
  flex-shrink: 0;
  color: var(--accent-text);
}

.track-toggle span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-toggle::after {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--muted);
  transform: rotate(45deg) translate(-1px, 1px);
  transition: transform 160ms ease;
}

.track-toggle.expanded::after {
  transform: rotate(225deg) translate(-1px, 1px);
}

.tracks {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

.track {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.track:first-child {
  border-top: 0;
  padding-top: 0;
}

.track-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.track-position {
  min-width: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.preview-player {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  padding: 5px 8px 5px 5px;
}

.preview-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.preview-toggle .icon {
  width: 16px;
  height: 16px;
}

.preview-toggle .icon-pause {
  display: none;
}

.preview-toggle.is-playing .icon-play {
  display: none;
}

.preview-toggle.is-playing .icon-pause {
  display: block;
}

.preview-toggle:active {
  transform: scale(0.96);
}

.preview-progress {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.preview-time {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.preview-audio {
  display: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: auto;
}

.event-link-button {
  width: 100%;
  text-align: center;
}

.video-example-button {
  width: 100%;
  text-align: center;
}

.stepper {
  display: grid;
  grid-template-columns: 38px 42px 38px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.stepper button {
  width: 38px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 20px;
}

.stepper .plus {
  color: var(--accent);
  font-weight: 800;
}

.stepper .plus:disabled {
  color: var(--text);
  opacity: 0.35;
  cursor: default;
}

.qty {
  width: 100%;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  -moz-appearance: textfield;
}

.qty::-webkit-outer-spin-button,
.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}

.muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  max-width: 980px;
  margin: 30px auto;
  color: var(--muted);
}

@media (max-width: 520px) {
  .app {
    padding-right: var(--space-2);
    padding-left: var(--space-2);
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .category-tabs {
    margin-bottom: var(--space-2);
    border-radius: var(--radius-md);
  }

  .category-tab {
    min-height: 34px;
    padding: 7px 4px;
    font-size: 12px;
  }

  .checkout-panel,
  .overlay-panel:not(.overlay-panel-full) {
    padding-right: var(--space-1);
    padding-left: var(--space-1);
  }

  .checkout-window:not(.checkout-window-full) {
    height: calc(100vh - 18px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100vh - 18px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    height: calc(100dvh - 18px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 18px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: var(--space-3);
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
    gap: var(--space-2);
  }

  .delivery-options {
    grid-template-columns: 1fr;
  }

  .stepper {
    width: 100%;
    grid-template-columns: 1fr 48px 1fr;
  }

  .stepper button {
    width: 100%;
  }

  .orders-toolbar {
    flex-direction: row;
    align-items: center;
  }

  .nav-button {
    font-size: 11px;
  }

  .nav-emoji {
    font-size: 17px;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-badge-wait {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-badge-progress {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge-craft {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-badge-done {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge-muted {
  background: var(--panel-alt);
  color: var(--muted);
}

.status-badge-cancelled {
  background: var(--danger-bg);
  color: var(--danger);
}

.order-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.order-status-date {
  color: var(--muted);
  font-size: 13px;
}

.order-detail-next-card {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.order-detail-next-card strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 28px 8px;
  text-align: center;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 0;
  align-content: flex-start;
  align-items: stretch;
  justify-content: flex-start;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr);
  gap: 10px;
  margin-bottom: 12px;
}

.admin-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 38px;
  flex: 0 0 auto;
  min-height: 88px;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.admin-tab {
  min-width: 0;
  min-height: 38px;
  padding: 7px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.admin-tab.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

@media (min-width: 520px) {
  .admin-tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    min-height: 46px;
  }
}

.admin-view {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.admin-add-button {
  width: 100%;
  margin-bottom: 10px;
}

.admin-products-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-product-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 70px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.admin-product-thumb {
  width: 54px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.admin-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-product-card-body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-product-card-body strong,
.admin-product-card-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-product-card-body span {
  color: var(--muted);
  font-size: 12px;
}

.admin-product-state {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.admin-product-state.is-active {
  background: var(--success-bg);
  color: var(--green);
}

.admin-product-state.is-hidden {
  background: var(--panel-alt);
  color: var(--muted);
}

.admin-product-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 18px;
}

.admin-product-form > label,
.admin-product-variants label,
.admin-product-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-product-variants {
  display: grid;
  gap: 12px;
}

.admin-product-form input,
.admin-product-form textarea,
.admin-product-form select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.admin-product-form textarea {
  resize: vertical;
}

.admin-product-form small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.admin-badge-field {
  position: relative;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-badge-picker {
  position: relative;
}

.admin-badge-picker summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}

.admin-badge-picker summary::-webkit-details-marker {
  display: none;
}

.admin-badge-picker summary::after {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--muted);
  transform: rotate(45deg) translate(-1px, 1px);
  transition: transform 160ms ease;
}

.admin-badge-picker[open] summary::after {
  transform: rotate(225deg) translate(-1px, 1px);
}

.admin-badge-options {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 20;
  display: grid;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-badge-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.admin-badge-option:active {
  background: var(--panel-alt);
}

.admin-product-form .admin-badge-option input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.admin-custom-badges {
  display: grid;
  gap: 5px;
}

.admin-custom-badges > span {
  font-size: 11px;
}

.admin-product-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-product-form .admin-switch,
.admin-promo-form .admin-switch {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.admin-switch input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}

.admin-product-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.danger-button,
.text-action-button {
  min-height: 42px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--danger);
  font-weight: 700;
}

.admin-media {
  display: grid;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.admin-media-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-media-heading h3 {
  margin: 0;
  font-size: 16px;
}

.admin-media-heading .text-action-button {
  min-height: 34px;
  padding: 4px 9px;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.admin-media-image {
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.admin-media-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-file-button {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.admin-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-track-list {
  display: grid;
  gap: 6px;
}

.admin-track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 5px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-inline-form input {
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.admin-categories-list {
  display: grid;
  gap: 8px;
}

.admin-promo-form {
  grid-template-columns: 1fr;
}

.admin-promo-list {
  display: grid;
  gap: 14px;
}

.admin-promo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.admin-promo-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 200px;
}

.admin-promo-row span {
  color: var(--muted);
  font-size: 12px;
}

.admin-promo-row .secondary-button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.admin-promo-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-promo-hidden-field {
  margin: 2px 0;
}

.admin-promo-requirement-field {
  display: grid;
  gap: 4px;
}

.admin-promo-requirement-field span {
  color: var(--muted);
  font-size: 12px;
}

.admin-promo-requirement-field select,
#adminPromoRepostUrl {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.admin-promo-form .admin-switch input {
  width: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--accent);
}

.admin-category-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 6px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.admin-category-move {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-category-move button {
  width: 30px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.admin-category-move button:disabled {
  opacity: 0.3;
  cursor: default;
}

.admin-category-row > div {
  display: grid;
  gap: 3px;
}

.admin-category-row span {
  color: var(--muted);
  font-size: 12px;
}

.admin-category-row .secondary-button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
}

.admin-settings-section {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-settings-section h3 {
  margin: 0;
  font-size: 16px;
}

.admin-settings-section label:not(.admin-switch) {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-settings-section .admin-reset-intro {
  justify-self: start;
  min-height: 34px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-size: 12px;
}

#adminSettingsView {
  overflow: hidden;
}

#adminSettingsForm {
  min-height: 0;
  max-height: none;
  flex: 1 1 0;
}

.admin-payment-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.admin-settings-section .admin-payment-mode label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.admin-payment-mode input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.admin-payment-mode span {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.admin-payment-mode input:checked + span {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
}

.admin-payment-mode input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.admin-payment-mode input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-payment-mode-note {
  min-height: 34px;
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-manual-payment-fields {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  transition: opacity 160ms ease;
}

.admin-manual-payment-fields h4 {
  margin: 0;
  font-size: 14px;
}

.admin-rules-form {
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.admin-documents-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  gap: var(--space-2);
  overflow-y: auto;
  padding-bottom: 12px;
}

.admin-document-textarea {
  width: 100%;
  min-width: 0;
  min-height: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.rules-document-section {
  flex-shrink: 0;
}

.admin-data-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-data-summary > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.admin-data-summary span {
  color: var(--muted);
  font-size: 11px;
}

.admin-data-summary strong {
  font-size: 22px;
}

.admin-export-button {
  display: flex;
  width: 100%;
  margin-bottom: 12px;
}

.admin-data-actions {
  display: grid;
  gap: 8px;
}

.admin-server-status {
  display: grid;
  gap: 12px;
  margin-bottom: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.admin-server-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-server-heading h3 {
  margin: 0;
  font-size: 16px;
}

.admin-server-online {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-server-online.is-online {
  background: var(--success-bg);
  color: var(--green);
}

.admin-resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.admin-resource-row {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.admin-resource-row > div:first-child {
  display: grid;
  gap: 2px;
}

.admin-resource-row span,
.admin-resource-row small {
  color: var(--muted);
  font-size: 11px;
}

.admin-resource-row strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.admin-resource-progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-alt);
}

.admin-resource-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.admin-resource-progress > span.is-warning {
  background: var(--accent);
}

.admin-data-actions > button {
  width: 100%;
}

.admin-private-note {
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 420px) {
  .admin-resource-list {
    grid-template-columns: 1fr;
  }
}

.admin-remove-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent-text);
  font-size: 24px;
  line-height: 1;
}

.admin-order-count,
.admin-filter {
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}

.admin-order-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-order-count span,
.admin-filter > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-order-count strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.admin-filter {
  display: grid;
  gap: 3px;
}

.admin-filter select {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

/* The closed <select> picks up --panel/--text from its own rule, but the
   native dropdown popup list ignores that unless <option> is styled directly -
   otherwise mobile browsers render it with their own default (white) background,
   which is unreadable against light text in dark mode. */
select option {
  background-color: var(--panel);
  color: var(--text);
}

/* Chrome ignores a plain background-color on the highlighted/checked option and
   paints its own blue highlight over it regardless - it does respect a
   background-image, so a flat gradient is the standard workaround to get a
   neutral gray highlight instead. */
select option:checked,
select option:hover {
  background-color: var(--panel-alt);
  background-image: linear-gradient(var(--panel-alt), var(--panel-alt));
  color: var(--text);
}

.admin-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-order-card {
  cursor: pointer;
}

.admin-orders-day-header {
  margin: 10px 0 -2px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-orders-day-header:first-child {
  margin-top: 0;
}

.admin-order-customer {
  font-size: 14px;
  font-weight: 700;
}

.admin-order-contact,
.admin-order-items {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.admin-order-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-order-contact-block {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  font-size: 14px;
}

.admin-order-contact-block a {
  color: var(--accent-text);
  text-decoration: none;
}

.admin-order-vk-link {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.admin-order-contact-block span {
  color: var(--muted);
}

.admin-yandex-delivery {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  font-size: 14px;
}

.admin-yandex-delivery a {
  width: fit-content;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.admin-yandex-status {
  color: var(--green);
  font-weight: 700;
}

.admin-yandex-expired {
  color: var(--warning);
}

.admin-payment-block {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  font-size: 14px;
}

.admin-payment-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.admin-payment-amount {
  color: var(--green);
  font-weight: 700;
}

.admin-payment-id {
  width: fit-content;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px dashed var(--success-border);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.admin-actions {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
}

.admin-actions h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.admin-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.admin-action-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.admin-action-form input,
.admin-action-form textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--tap);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.admin-action-form .primary-button,
.admin-action-form .secondary-button {
  min-width: 150px;
}

@media (max-width: 520px) {
  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-action-form {
    grid-template-columns: 1fr;
  }

  .admin-action-form .primary-button,
  .admin-action-form .secondary-button {
    width: 100%;
  }
}

.orders-group-title {
  margin: 10px 2px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.orders-group-title:first-child {
  margin-top: 2px;
}

.order-card {
  width: 100%;
  flex: 0 0 auto;
  height: auto;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: none;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: grid;
  gap: 6px;
  align-content: start;
  -webkit-appearance: none;
  appearance: none;
}

.order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.order-card-top .status-badge {
  min-width: 0;
}

.order-card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.order-card-id {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.screen-header .order-card-id {
  font-size: 14px;
}

.order-card-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.order-card-next {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.order-timeline {
  color: var(--muted);
  font-size: 13px;
  margin: -4px 0 12px;
  padding: 0 4px;
}

.order-detail-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.order-detail-timeline {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.order-stage-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 0;
  margin-top: 2px;
  padding-right: 4px;
  padding-left: 4px;
  color: var(--muted);
}

.order-card-next.order-stage-timeline {
  margin-top: 2px;
}

.order-stage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
}

.order-stage:not(:last-child)::after {
  content: "";
  width: 18px;
  height: 1px;
  margin: 0 6px 0 1px;
  background: var(--line);
}

.order-stage-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
}

.order-stage.is-done,
.order-stage.is-current {
  color: var(--text);
}

.order-stage.is-done .order-stage-dot {
  border-color: var(--green);
  background: var(--green);
}

.order-stage.is-current .order-stage-dot {
  border-color: var(--warning);
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(173, 105, 24, 0.13);
}

.order-stage-timeline[data-status="preparing"] .order-stage.is-current .order-stage-dot,
.order-stage-timeline[data-status="paid"] .order-stage.is-current .order-stage-dot {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.13);
}

.order-detail-items,
.order-detail-payment-body,
.order-detail-totals {
  margin-top: 10px;
}

.order-detail-item-strong {
  font-weight: 700;
}

.order-detail-item-highlight {
  color: var(--green);
  font-weight: 600;
}

.order-detail-item-discount {
  color: var(--success);
}

.order-detail-item {
  margin-top: 5px;
  line-height: 1.4;
}

.order-payment-lines {
  display: grid;
  gap: var(--space-2);
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  border: 1px solid var(--line);
}

.payment-line {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.payment-copy-line {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed rgba(47, 111, 78, 0.45);
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.payment-copy-line:active {
  transform: scale(0.99);
  background: var(--success-bg);
}

.payment-copy-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.payment-copy-value {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.payment-copy-hint {
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 80;
  transform: translateX(-50%);
  border-radius: var(--radius-pill);
  background: rgba(25, 23, 19, 0.88);
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(25, 23, 19, 0.24);
  pointer-events: none;
}

.app-toast[hidden] {
  display: none;
}

.app-toast-in {
  animation: toast-in var(--dur-slow) var(--ease);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

body.modal-open .app-toast {
  bottom: calc(24px + env(safe-area-inset-bottom));
}

.order-detail-actions {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.order-detail-actions .primary-button,
.order-detail-actions .secondary-button {
  flex: 1 1 140px;
}

.order-detail-actions .order-pay-button {
  flex-basis: 100%;
}

.order-detail-next,
.order-detail-delivery,
.order-detail-tracking {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.order-detail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--space-2) 0;
}

.order-detail-body > * {
  flex: 0 0 auto;
  min-height: auto;
}

.order-collapsible {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  overflow: hidden;
}

.order-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  text-align: left;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.order-collapsible-summary::after {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--muted);
  transform: rotate(45deg) translate(-1px, 1px);
  transition: transform 160ms ease;
}

.order-collapsible:not(.order-collapsible-collapsed) .order-collapsible-summary::after {
  transform: rotate(225deg) translate(-1px, 1px);
}

.order-collapsible-body {
  display: block;
  padding: 0 12px 12px;
  overflow: visible;
}

.order-collapsible-collapsed .order-collapsible-body {
  display: none;
}

.order-collapsible-collapsed .order-collapsible-summary {
  background: var(--panel-alt);
}

.order-detail-scroll {
  max-height: 52vh;
  overflow-y: auto;
}

.order-detail-summary {
  margin: 0;
  padding: 0 0 2px;
}

.order-detail-details {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  padding: 10px 12px;
}

.order-detail-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.order-detail-details-body {
  margin-top: 10px;
}

.order-thread {
  margin-top: 0;
}

.order-thread-messages {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-top: 12px;
}

.order-thread-text .payment-copy-line {
  margin-top: var(--space-1);
}

.order-thread-text .payment-copy-line:first-child {
  margin-top: 0;
}

.order-thread-text .payment-line + .payment-copy-line,
.order-thread-text .payment-copy-line + .payment-line {
  margin-top: var(--space-1);
}

.order-thread-entry {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
}

.order-thread-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: var(--space-1);
}

.order-thread-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
}

.order-message-composer {
  display: block;
  flex-shrink: 0;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
}

.order-message-form {
  display: grid;
  gap: 4px;
}

.order-message-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.order-message-field {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.order-message-form textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  max-height: 96px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  padding: 10px 14px;
  resize: none;
  overflow-y: auto;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  box-sizing: border-box;
  background: var(--panel);
}

.order-message-send {
  flex: 0 0 var(--tap);
  width: var(--tap);
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border-radius: var(--radius-pill);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.order-message-form .form-error:empty {
  display: none;
}

.order-thread-shop,
.order-thread-payment,
.order-thread-status,
.order-thread-system {
  border-color: rgba(47, 111, 78, 0.24);
  background: var(--success-bg);
}

.order-thread-user {
  border-color: rgba(215, 255, 63, 0.2);
  background: var(--accent-soft);
}

.order-thread-payment .order-thread-text {
  font-family: inherit;
  white-space: pre-wrap;
  font-weight: 600;
}

.order-thread-link {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--success);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.order-thread-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-2);
}

.order-thread-links .order-thread-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(47, 111, 78, 0.3);
  border-radius: var(--radius-pill);
  background: rgba(var(--panel-rgb), 0.72);
  text-decoration: none;
}

.product-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  background: #121212;
  color: #ffffff;
}

.product-viewer[hidden] {
  display: none;
}

.product-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0 2px 10px;
}

.product-viewer-heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.product-viewer-header strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-viewer-header span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.product-viewer-close {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0;
}

.product-viewer-close::before,
.product-viewer-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform-origin: center;
}

.product-viewer-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.product-viewer-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.product-viewer-stage {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.product-viewer-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
  user-select: none;
  will-change: transform;
}

.product-viewer-stage.is-zoomed img {
  cursor: grab;
}

.product-viewer-stage.is-panning img {
  cursor: grabbing;
}

.product-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-50%);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.7));
}

.product-viewer-nav::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.product-viewer-prev {
  left: 0;
}

.product-viewer-prev::before {
  transform: translate(-50%, -50%) rotate(225deg);
}

.product-viewer-next {
  right: 0;
}

.product-viewer-dots {
  display: flex;
  min-height: 24px;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
}

.product-viewer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
}

.product-viewer-dot.active {
  width: 18px;
  border-radius: 999px;
  background: var(--panel);
}

.order-payment-pending {
  color: var(--muted);
}

.order-thread-empty {
  color: var(--muted);
  font-size: 14px;
}

.rules-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
  padding: 0 2px;
}

.rules-heading {
  margin: 0 0 12px;
  font-size: 18px;
}

.orders-toolbar .secondary-button {
  min-width: 108px;
}

.rules-line {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.rules-line-heading {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.rules-line-heading:first-child {
  margin-top: 0;
}

.rules-copy-line {
  margin: 0 0 10px;
}

.product-card.product-highlight {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(215, 255, 63, 0.15);
}

.app-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(25, 23, 19, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-alert-overlay[hidden] {
  display: none;
}

.app-alert-box {
  width: min(92vw, 340px);
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: center;
}

.app-alert-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-line;
}

.app-alert-box .primary-button {
  width: 100%;
}

.app-confirm-input {
  width: 100%;
  min-height: var(--tap);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  color: var(--text);
  font-size: 14px;
  text-align: left;
}

.app-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.app-confirm-actions .primary-button,
.app-confirm-actions .secondary-button {
  width: 100%;
}

