:root {
  --bg0: #070a10;
  --bg1: #0b1020;
  --surface: rgba(255, 255, 255, 0.04);
  --surface2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2ff;
  --muted: #9aa4bf;
  --accent: #6ea8ff;
  --accent2: #9b7bff;
  --danger: #ff6b6b;
  --ok: #5bd6a6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border) rgba(255, 255, 255, 0.04);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(110, 168, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(155, 123, 255, 0.14), transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

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

.small {
  font-size: 0.85rem;
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  position: relative;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 400px at 50% 20%, rgba(110, 168, 255, 0.12), transparent 60%);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: min(460px, 100%);
  padding: 2.25rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.login-title {
  margin: 0 0 0.5rem;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.login-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.55;
}

.login-steps {
  margin: 0 0 1.35rem;
  padding-left: 1.2rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.login-steps li {
  margin-bottom: 0.35rem;
}

.login-foot {
  margin: 1rem 0 0;
  line-height: 1.45;
}

.login-foot-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: #c7cfdf;
  text-decoration: underline;
  text-decoration-color: rgba(199, 207, 223, 0.65);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.login-foot-link:hover {
  color: #e3e8f4;
  text-decoration-color: rgba(227, 232, 244, 0.85);
}

.btn-tg-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

.vkid-one-tap-wrap {
  margin-top: 0.65rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tg-login-logo {
  display: flex;
  flex-shrink: 0;
  color: #fff;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.tg-login-label {
  font-weight: 600;
}

.login-progress {
  margin-top: 1rem;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.login-progress-bar {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), rgba(110, 168, 255, 0.35));
  animation: login-progress-slide 1.1s ease-in-out infinite;
}

@keyframes login-progress-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

.link-pill {
  display: inline-flex;
  margin-top: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.link-pill:hover {
  border-color: rgba(110, 168, 255, 0.55);
}

/* Shell */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(6, 9, 18, 0.72);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0.9rem;
}

.sidebar-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem 0.6rem 1.1rem;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(110, 168, 255, 0.18), rgba(155, 123, 255, 0.18)),
    url("/logo.png") center/contain no-repeat;
  box-shadow: 0 12px 40px rgba(110, 168, 255, 0.25);
}

.logo-text {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.nav-rail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.active {
  border-color: rgba(110, 168, 255, 0.35);
  background: rgba(110, 168, 255, 0.08);
  color: var(--text);
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.12);
}

.nav-item.active .nav-dot {
  background: linear-gradient(180deg, var(--accent), var(--accent2));
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.user-chip {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono);
}

.user-chip-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.user-chip-btn:hover {
  border-color: rgba(110, 168, 255, 0.45);
  background: rgba(110, 168, 255, 0.07);
  color: var(--text);
}

.user-chip-btn.active {
  border-color: rgba(110, 168, 255, 0.55);
  background: rgba(110, 168, 255, 0.14);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(110, 168, 255, 0.2) inset;
}

.user-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-gear {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
}

.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  max-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem 0.15rem;
  flex-shrink: 0;
}

.topbar-page-head {
  display: none;
}

.page-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  min-width: 0;
}

.topbar-admin-links {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.6rem;
}

.topbar-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.topbar-wb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-wb-pill {
  flex-shrink: 0;
}

.topbar-wb-select {
  min-height: 2.05rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  max-width: 18rem;
}

.topbar-future {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar-mini-pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  cursor: default;
  min-height: 2.05rem;
  white-space: nowrap;
}

.topbar-mini-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.topbar-mini-pill-active {
  border-color: rgba(91, 214, 166, 0.55);
  background: rgba(91, 214, 166, 0.18);
  color: #d8fff0;
}

.topbar-mini-pill-link {
  cursor: pointer;
}

.topbar-notifications {
  position: relative;
}

.topbar-notifications-btn {
  position: relative;
  min-width: 2.75rem;
  justify-content: center;
}

.notifications-unread-badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
}

.notifications-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  width: min(420px, 82vw);
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(7, 10, 16, 0.98);
  box-shadow: var(--shadow);
  z-index: 12300;
  padding: 0.35rem;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.notifications-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}

.notifications-item:hover {
  border-color: var(--border-strong);
}

.notifications-item.is-unread {
  border-color: rgba(110, 168, 255, 0.45);
  background: rgba(110, 168, 255, 0.08);
}

.notifications-item-title {
  font-size: 0.88rem;
}

.notifications-item-date {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.admin-shell .content {
  overflow: auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-page-topbar {
  justify-content: flex-start;
  align-items: center;
  min-height: 2.35rem;
}

.admin-page-topbar .topbar-admin-links {
  margin-right: 0;
}

.admin-sidebar-spacer {
  flex: 1;
  min-height: 0;
}

.admin-content {
  gap: 0.85rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.admin-users-panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-users-panel-head {
  align-items: baseline;
}

.admin-users-status-line {
  margin: 0;
}

.admin-toolbar-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.85rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: flex-end;
  justify-content: center;
  width: min(980px, 100%);
}

.admin-toolbar-field .input,
.admin-toolbar-field .select {
  min-width: 12rem;
}

.admin-toolbar-apply {
  align-self: flex-end;
}

.admin-table-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-table-scroll {
  overflow-x: auto;
  max-height: min(62vh, 720px);
  overscroll-behavior: contain;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: block;
}

.admin-users-table {
  width: 100%;
  max-width: none;
  table-layout: auto;
  border-collapse: collapse;
}

.admin-th-check,
.admin-td-check {
  width: 1%;
  min-width: 2.75rem;
  max-width: 3rem;
  text-align: center;
  vertical-align: middle;
}

.admin-th-act,
.admin-td-act {
  text-align: center;
  vertical-align: middle;
}

/* Три колонки действий — одинаковая ширина; кнопки на всю ячейку */
.admin-users-table thead th.admin-th-action-col,
.admin-users-table tbody td.admin-td-action-col {
  width: 12.5rem;
  min-width: 12.5rem;
  max-width: 12.5rem;
  box-sizing: border-box;
}

.admin-th-head-muted {
  font-weight: 600;
  color: var(--muted);
}

.admin-action-btn-full {
  width: 100%;
  max-width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.admin-modal-radio-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.admin-modal-error {
  color: #f87171;
}

.admin-users-table .input,
.admin-users-table .select {
  max-width: 100%;
  box-sizing: border-box;
}

.admin-users-table tbody td:nth-child(2),
.admin-users-table thead th:nth-child(2) {
  min-width: 9rem;
}

.admin-users-table tbody td:nth-child(8),
.admin-users-table thead th:nth-child(8) {
  min-width: 11rem;
}

.admin-sort-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.admin-sort-btn:hover {
  color: var(--accent);
}

.admin-sort-mark {
  font-family: var(--mono);
  font-size: 0.78rem;
  opacity: 0.55;
}

.admin-sort-mark.is-active {
  opacity: 1;
  color: var(--accent);
}

.admin-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--border);
  background: rgba(6, 9, 18, 0.35);
}

.admin-pagination-spacer {
  min-width: 0;
}

.admin-pagination-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.admin-page-info {
  white-space: nowrap;
}

.admin-page-size {
  justify-self: end;
  margin: 0;
}

@media (max-width: 900px) {
  .admin-toolbar-field .input,
  .admin-toolbar-field .select {
    min-width: 0;
    width: 100%;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar-apply {
    width: 100%;
  }

  .admin-pagination {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .admin-page-size {
    justify-self: stretch;
  }

  .admin-pagination-center {
    justify-content: center;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.pill-muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.content {
  padding: 0.65rem 1.25rem 0.75rem;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#tab-cards.tab-pane.active {
  gap: 0.5rem;
}

#sub-templates.subpane.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0.5rem;
}

#sub-templates .editor-grid {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  align-items: stretch;
}

#tab-cards > .subpane.active {
  flex: 1;
  min-height: 0;
}

#sub-generate.subpane.active,
#sub-queue.subpane.active {
  overflow: auto;
}

#sub-generate.subpane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#tab-help.tab-pane.active {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  gap: 0.5rem;
}

#tab-help .subpane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#tab-help .help-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#tab-help .help-panel .panel-title {
  flex-shrink: 0;
}

#tab-help .help-doc {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#tab-barcodes.tab-pane.active,
#tab-reviews.tab-pane.active,
#tab-ads.tab-pane.active,
#tab-orders.tab-pane.active,
#tab-stats.tab-pane.active {
  overflow: auto;
}

#tab-products.tab-pane.active {
  overflow: hidden;
}

.segmented {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 1rem;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.seg-btn.active {
  color: var(--text);
  background: rgba(110, 168, 255, 0.16);
  border: 1px solid rgba(110, 168, 255, 0.28);
}

.subpane {
  display: none;
}

.subpane.active {
  display: block;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 1.1rem 1.15rem;
}

.panel-tight {
  padding: 0.85rem;
}

.panel-grow {
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.panel-head-stack {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.panel-head-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.panel-head-actions-wide {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: stretch;
}

.panel-head-actions-wide .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  min-height: 2.35rem;
}

.panel-head-actions-wide label.btn {
  justify-content: center;
  text-align: center;
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
}

.templates-toolbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .templates-toolbar {
    grid-template-columns: 1fr;
  }
}

.panel-head-row {
  margin-bottom: 1rem;
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.head-template-save-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 0;
}

.head-template-save-group .btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.toolbar-card {
  margin-bottom: 0.85rem;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) minmax(260px, 320px);
  gap: 1rem;
  align-items: start;
}

.editor-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  max-height: none;
  overflow: hidden;
}

#template-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#template-editor .canvas-section {
  flex: 1;
}

.slide-help {
  margin: 0 0 0.5rem;
  line-height: 1.45;
  font-size: 0.8rem;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.panel-generate {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* overflow здесь ломает растягивание textarea по высоте — скролл даёт внешний #sub-generate */
  overflow: hidden;
}

#sub-generate.subpane.active .panel-generate {
  max-width: none;
}

.panel-generate .panel-title {
  margin-bottom: 0.35rem;
}

.panel-generate .gen-lead {
  margin: 0 0 0.5rem;
  line-height: 1.55;
}

.panel-generate .field {
  margin: 0;
}

.panel-generate .field-label {
  margin-bottom: 0.2rem;
}

.panel-generate .form-stack {
  flex: 1;
  min-height: 0;
}

/* Поле «Названия товаров» — на всю оставшуюся высоту панели между шаблоном и остальными полями */
.panel-generate .field.field-gen-products-stretch {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  gap: 0.35rem;
}

.panel-generate .textarea-gen-products {
  flex: 1 1 auto;
  min-height: 8rem;
  resize: vertical;
}

.gen-actions {
  margin-top: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.gen-actions .btn {
  min-width: 200px;
}

.panel-inspector {
  position: relative;
  align-self: stretch;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
}

#inspector-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inspector-empty {
  padding: 1rem 0.25rem;
  line-height: 1.45;
}

.toolbar-row-spread {
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.toolbar-hint {
  margin: 0;
  text-align: right;
  max-width: 420px;
}

.mono-pill {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.head-actions-group {
  display: inline-flex;
  gap: 0.25rem;
  margin-right: 0.25rem;
  padding-right: 0.45rem;
  border-right: 1px solid var(--border);
}

.editor-shortcuts {
  margin: -0.35rem 0 1rem;
  line-height: 1.5;
}

.editor-shortcuts kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.28);
}

.slide-actions-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.align-toolbar {
  display: inline-flex;
  gap: 0.15rem;
  margin-right: 0.35rem;
  padding-right: 0.45rem;
  border-right: 1px solid var(--border);
}

.align-toolbar .btn {
  min-width: 2rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.toast-host {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  /* Выше .shop-modal (12000), ниже .lightbox (14000) */
  z-index: 13000;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 2rem));
  align-items: flex-end;
}

.toast {
  pointer-events: none;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(12, 16, 28, 0.94);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-info {
  border-color: rgba(110, 168, 255, 0.35);
}

.toast-err {
  border-color: rgba(255, 107, 107, 0.45);
  color: #ffd6d6;
}

.toast-ok {
  border-color: rgba(91, 214, 166, 0.45);
  color: #d8fff0;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-rail {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1 1 auto;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .panel-inspector {
    position: static;
    max-height: none;
    overflow: auto;
  }

  .toolbar-row-spread {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-hint {
    text-align: left;
    max-width: none;
  }
}

.template-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(38vh, 280px);
  overflow: auto;
}

.template-list li {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.template-list li:hover {
  border-color: var(--border);
  color: var(--text);
}

.template-list li.active {
  border-color: rgba(110, 168, 255, 0.35);
  background: rgba(110, 168, 255, 0.08);
  color: var(--text);
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.empty-title {
  margin: 0 0 0.35rem;
  color: var(--text);
}

.empty-text {
  margin: 0;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

.form-grid-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .form-grid-meta {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


.field-compact {
  margin-top: 0.35rem;
}

.custom-ph-table-wrap {
  margin-top: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.custom-ph-table-wrap:focus-within {
  border-color: rgba(110, 168, 255, 0.35);
}

.custom-ph-table-hint {
  margin: 0;
  padding: 0.45rem 0.65rem 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.custom-ph-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.custom-ph-table thead th {
  text-align: left;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(220, 226, 240, 0.92);
}

.custom-ph-th-key {
  width: 30%;
  min-width: 6.5rem;
}

.custom-ph-table thead th + th {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-ph-table tbody td {
  padding: 0;
  vertical-align: stretch;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.custom-ph-table tbody td + td {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-ph-table tbody td:focus-within {
  box-shadow: inset 0 0 0 2px rgba(110, 168, 255, 0.45);
  position: relative;
  z-index: 1;
}

.custom-ph-table tbody tr.custom-ph-tr-empty td {
  background: rgba(255, 255, 255, 0.03);
}

.custom-ph-table tbody tr.custom-ph-tr-ok td {
  background: rgba(117, 211, 124, 0.07);
}

.custom-ph-table tbody tr.custom-ph-tr-ok .custom-ph-key-input {
  color: #75d37c;
}

.custom-ph-table tbody tr.custom-ph-tr-ok .custom-ph-val-input {
  color: #e1bf6c;
}

.custom-ph-table tbody tr.custom-ph-tr-bad td {
  background: rgba(255, 75, 75, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 120, 120, 0.4);
}

/* Поля на всю ячейку: без «вложенной рамки» */
.custom-ph-table .custom-ph-key-input,
.custom-ph-table .custom-ph-val-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 0.55rem 0.65rem;
}

.custom-ph-table .custom-ph-key-input {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  min-height: 2.75rem;
}

.custom-ph-table .custom-ph-val-input {
  min-height: 5rem;
  resize: vertical;
  white-space: pre-wrap;
  word-break: break-word;
  field-sizing: content;
}

.custom-ph-table .custom-ph-key-input::placeholder,
.custom-ph-table .custom-ph-val-input::placeholder {
  color: rgba(154, 164, 191, 0.55);
}

.input,
.select,
.textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 0.55rem 0.65rem;
  outline: none;
  font-family: var(--font);
}

/* Select: единая синяя палитра (закрытое поле и выбранный пункт — темнее строк списка) */
.select,
select.select {
  color-scheme: dark;
  background-color: #070f24;
  background-image: linear-gradient(180deg, rgba(22, 48, 102, 0.5), rgba(7, 15, 36, 0.98));
  border-color: rgba(110, 168, 255, 0.38);
  color: var(--text);
}

select option,
select optgroup {
  background-color: #1a3f78;
  color: #f0f4ff;
}

select option:hover,
select option:focus {
  background-color: #244a8c;
  color: #fff;
}

select option:checked {
  background-color: #0a162e;
  color: var(--text);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(110, 168, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.12);
}

/* Числовые поля: тёмная тема нативных стрелок + те же границы, что у .input */
input[type="number"].input,
input[type="number"].input-num,
.element-props input[type="number"] {
  color-scheme: dark;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.55rem 0.5rem;
  min-height: 2.35rem;
  box-sizing: border-box;
}

input[type="number"].input-num::-webkit-inner-spin-button,
.element-props input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: inner-spin-button;
  cursor: pointer;
  opacity: 0.9;
  margin-right: 2px;
}

input[type="number"].input-num::-webkit-inner-spin-button:hover,
.element-props input[type="number"]::-webkit-inner-spin-button:hover {
  filter: brightness(1.15);
}

.input-color {
  width: 100%;
  height: 38px;
  padding: 0.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}

.textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.45;
}

.canvas-section {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex: 1;
  min-height: 0;
}

@media (max-width: 900px) {
  .canvas-section {
    grid-template-columns: 1fr;
  }
}

.block-title {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: var(--text);
}

.block-title-spaced {
  margin-top: 1rem;
}

.mini-list {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mini-list li {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.mini-list li:hover {
  border-color: var(--border);
  color: var(--text);
}

.mini-list li.active {
  border-color: rgba(110, 168, 255, 0.35);
  background: rgba(110, 168, 255, 0.08);
  color: var(--text);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.35rem 0;
}

.canvas-side {
  min-height: 0;
  overflow: auto;
  max-height: min(72vh, calc(100vh - 10rem));
  padding-right: 0.85rem;
  scrollbar-gutter: stable;
}

.canvas-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.preview-toolbar-left,
.preview-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.inline-range {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.canvas-preview-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  padding: 0.5rem;
  overflow: hidden;
  flex: 1;
  min-height: 160px;
  min-width: 0;
  position: relative;
  cursor: default;
}

.canvas-preview-wrap.canvas-panning {
  cursor: grabbing;
}

.canvas-grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  border-radius: 10px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 16px 16px;
}

.canvas-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.canvas-stage {
  box-sizing: border-box;
}

.canvas-inner {
  position: relative;
  flex-shrink: 0;
  transform-origin: top left;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  border-radius: 10px;
  overflow: visible;
  outline: 1px solid rgba(255, 255, 255, 0.12);
}

.canvas-preview-bg-clip {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}

.canvas-preview-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: filter;
}

.canvas-el {
  position: absolute;
  outline: 1px dashed rgba(110, 168, 255, 0);
  transition: outline-color 0.12s ease;
  box-sizing: border-box;
}

.canvas-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 2px;
  z-index: 9000;
  box-sizing: border-box;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.canvas-handle-se {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.canvas-handle-nw {
  left: -6px;
  top: -6px;
  cursor: nwse-resize;
}

.canvas-handle-e {
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.canvas-handle-s {
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.canvas-handle-p1 {
  left: -6px;
  top: -6px;
  cursor: nwse-resize;
}

.canvas-handle-p2 {
  right: -6px;
  bottom: -6px;
  cursor: nwse-resize;
}

.canvas-handle-radius {
  left: 50%;
  top: -14px;
  transform: translateX(-50%);
  border-radius: 50%;
  width: 13px;
  height: 13px;
  cursor: ew-resize;
  background: var(--accent2);
  border-color: #fff;
  z-index: 9001;
}

.canvas-handle-rotate {
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  cursor: grab;
  background: #fff;
  border-color: var(--accent);
  z-index: 9002;
}

.canvas-handle-rotate:active {
  cursor: grabbing;
}

.props-lock {
  margin-bottom: 0.15rem;
}

.canvas-el:hover {
  outline-color: rgba(110, 168, 255, 0.35);
}

.canvas-el.selected {
  outline: 2px solid rgba(110, 168, 255, 0.75);
}

.hint-foot {
  flex-shrink: 0;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.hint-foot strong {
  color: var(--text);
  font-weight: 600;
}

.props-panel {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.chip-list {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: min(28vh, 220px);
  overflow-y: auto;
  align-content: flex-start;
}

.chip-list li {
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
}

.chip-list li:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip-list li.active {
  border-color: rgba(110, 168, 255, 0.45);
  background: rgba(110, 168, 255, 0.1);
  color: var(--text);
}

.layer-stack-hint {
  margin: 0 0 0.55rem;
  line-height: 1.45;
  font-size: 0.8rem;
  max-width: 320px;
}

.layer-stack-hint strong {
  color: var(--text);
  font-weight: 600;
}

.chip-list-layers {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  align-content: stretch;
  max-height: min(36vh, 280px);
}

.chip-list-layers li.layer-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  box-sizing: border-box;
}

.chip-list-layers li.layer-chip .layer-chip-main {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.chip-list-layers li.layer-chip .layer-z {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  flex-shrink: 0;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(110, 168, 255, 0.35);
  background: rgba(110, 168, 255, 0.08);
}

.asset-upload-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.asset-upload-wrap .user-upload-hint {
  font-size: 0.78rem;
}

.asset-thumb-wrap {
  position: relative;
}

.asset-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(12, 16, 28, 0.88);
  color: var(--danger);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.asset-thumb-del:hover {
  background: rgba(255, 107, 107, 0.25);
}

.add-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.element-props {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  padding: 0.85rem;
  display: grid;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
}

.element-props label.props-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.element-props label.check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.3;
}

.element-props label.check-row input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.element-props input,
.element-props select {
  width: 100%;
}

.element-props .input-num {
  min-height: 2.35rem;
}

.element-props .input-color {
  min-height: 2.35rem;
  cursor: pointer;
}

.element-props .select {
  min-height: 2.35rem;
  cursor: pointer;
}

.element-props .props-textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.4;
}

.props-field {
  display: grid;
  gap: 0.35rem;
}

.props-hint {
  margin: 0 0 0.25rem;
  grid-column: 1 / -1;
}

.input-range {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  appearance: none;
  accent-color: var(--accent);
}

.input-range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  grid-auto-rows: 72px;
  gap: 0.45rem;
  /* Жестко держим окно 3x3, остальное скроллим */
  height: calc((72px * 3) + (0.45rem * 2) + 0.3rem);
  min-height: calc((72px * 3) + (0.45rem * 2) + 0.3rem);
  max-height: calc((72px * 3) + (0.45rem * 2) + 0.3rem);
  overflow-y: auto;
  padding: 0.15rem;
  align-content: start;
}

.asset-thumb {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.asset-thumb:hover {
  border-color: var(--border-strong);
}

.asset-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(110, 168, 255, 0.25);
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder-panel {
  max-width: 720px;
}

/* Settings */
.panel-settings {
  width: 100%;
  box-sizing: border-box;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: start;
}

.settings-card,
.settings-card-wide {
  width: 100%;
}

.settings-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  padding: 1rem;
}

.settings-card-wide {
  min-width: 0;
}

.settings-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--text);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.settings-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.wb-token-add {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.6fr) auto;
  gap: 0.75rem;
  align-items: end;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.wb-token-add .btn {
  min-height: 2.35rem;
}

@media (max-width: 980px) {
  .wb-token-add {
    grid-template-columns: 1fr;
  }
}

.wb-token-show {
  margin-top: 0.35rem;
}

.wb-token-recheck-all-center {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  min-width: 0;
  justify-self: center;
}

.wb-token-recheck-all-center .btn {
  flex-shrink: 0;
  max-width: min(100%, 320px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-token-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.85rem;
  margin-bottom: 0.65rem;
  min-height: 2.5rem;
}

#wb-token-count {
  justify-self: start;
  align-self: center;
  line-height: 1.25;
}

.wb-token-list-head .wb-token-pager {
  justify-self: end;
  align-self: center;
}

.wb-btn-spinner {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.4em;
  vertical-align: -0.1em;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  animation: wb-spin 0.7s linear infinite;
}

@keyframes wb-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.wb-token-add-loading {
  cursor: wait;
}

.wb-token-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 10, 18, 0.5);
}

.wb-token-limit {
  min-height: 2.1rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.wb-page-btn {
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text);
}

.wb-page-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

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

.wb-page-badge {
  min-width: 4.8rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text);
  padding: 0.3rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

/* token input with eye button */
.input-eye-wrap {
  position: relative;
}

.input-eye-wrap .input {
  padding-right: 2.4rem;
}

.btn-eye {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-eye:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.wb-token-list {
  display: grid;
  gap: 0.55rem;
}

.wb-token-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 0.85rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: stretch;
}

/* Колонка с названием + магазин + мета — без лишнего вертикального зазора между блоками */
.wb-token-item > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}

@media (max-width: 720px) {
  .wb-token-item {
    grid-template-columns: 1fr;
  }
}

.wb-token-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin-top: 0.4rem;
}

.wb-token-seller {
  margin-top: 0;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  max-width: 100%;
}

.wb-token-trade-mark {
  font-weight: 400;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--muted);
  word-break: break-word;
}

.wb-token-seller-legal {
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--muted);
  word-break: break-word;
}

.wb-token-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  line-height: 1.3;
}

.wb-token-title-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.wb-token-name {
  word-break: break-word;
}

.wb-token-edit-btn {
  width: 1.9rem;
  height: 1.9rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.wb-token-edit-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.wb-token-edit-row {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: minmax(180px, 320px) max-content max-content;
  gap: 0.45rem;
  align-items: center;
  justify-content: start;
}

.wb-token-edit-row .btn {
  width: 7.5rem;
  min-width: 7.5rem;
  justify-content: center;
}

@media (max-width: 720px) {
  .wb-token-edit-row {
    grid-template-columns: 1fr;
  }

  .wb-token-edit-row .btn {
    width: auto;
    min-width: 0;
  }
}

.wb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.wb-chip strong {
  color: var(--text);
  font-weight: 700;
}

.wb-chip-ok {
  border-color: rgba(91, 214, 166, 0.35);
  background: rgba(91, 214, 166, 0.1);
  color: #d8fff0;
}

.wb-chip-warn {
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.08);
  color: #ffd6d6;
}

.wb-token-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
  justify-content: center;
  min-height: 100%;
  /* Фиксированная ширина: текст «Проверка…» и «Проверить заново» не сжимают колонку */
  flex: 0 0 auto;
  width: 13.75rem;
  max-width: 100%;
  box-sizing: border-box;
}

.wb-token-actions .btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.btn.wb-token-recheck-loading {
  cursor: wait;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  font-family: var(--font);
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: rgba(110, 168, 255, 0.45);
  background: linear-gradient(180deg, rgba(110, 168, 255, 0.35), rgba(110, 168, 255, 0.18));
}

.btn-primary:hover {
  border-color: rgba(110, 168, 255, 0.65);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.btn-danger {
  border-color: rgba(255, 107, 107, 0.35);
  color: #ffd6d6;
  background: rgba(255, 107, 107, 0.08);
}

.btn-sm {
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
}

.btn-xs {
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

.btn-lg {
  padding: 0.75rem 1.05rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Jobs */
.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.job-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  padding: 0.7rem;
  display: grid;
  gap: 0.5rem;
  align-content: start;
  cursor: pointer;
}

.job-card:hover {
  border-color: rgba(110, 168, 255, 0.45);
}

.job-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 0;
}

.job-viewer {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  padding: 0;
  aspect-ratio: 3 / 4;
}

.job-viewer-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.job-slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.job-slide-nav.prev {
  left: 0.35rem;
}

.job-slide-nav.next {
  right: 0.35rem;
}

.job-slide-nav svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.job-slide-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.job-slide-counter {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.22rem 0.42rem;
}

.job-actions {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
}

.queue-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
  color: #d9e5ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}

.queue-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.queue-icon-btn:hover {
  border-color: rgba(110, 168, 255, 0.65);
  background: rgba(110, 168, 255, 0.18);
}

.queue-icon-btn:disabled,
.queue-icon-btn.disabled {
  opacity: 0.38;
  pointer-events: none;
}

.queue-icon-btn.danger {
  color: #ffc2c2;
  border-color: rgba(255, 107, 107, 0.5);
}

.queue-icon-btn.danger:hover {
  border-color: rgba(255, 107, 107, 0.85);
  background: rgba(255, 107, 107, 0.2);
}

.status-done {
  color: var(--ok);
  font-weight: 700;
}

.status-err {
  color: var(--danger);
}

.job-warn-banner {
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 120, 120, 0.45);
  color: #ffb4b4;
  font-size: 0.82rem;
  line-height: 1.35;
}

.job-thumbs {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
  align-items: flex-start;
}

.panel-queue .queue-title {
  margin-bottom: 0.5rem;
}

.panel-queue .queue-lead {
  margin: 0 0 1.25rem;
  line-height: 1.5;
  max-width: 720px;
}

.job-card-top {
  margin-bottom: 0;
  min-width: 0;
}

.job-card-title {
  margin-bottom: 0.25rem;
}

.job-card-products {
  line-height: 1.45;
  min-height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 1500px) {
  .job-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1220px) {
  .job-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .job-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .job-list {
    grid-template-columns: 1fr;
  }
}

.queue-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 14500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-preview-modal.hidden {
  display: none !important;
}

.queue-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.queue-preview-card {
  position: relative;
  width: min(1040px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #111827;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.queue-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.queue-preview-title {
  margin: 0;
  font-size: 1rem;
}

.queue-preview-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: #fff;
  font-size: 1.25rem;
}

.queue-preview-body {
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0.9rem;
  min-height: 0;
}

.queue-preview-image-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.38);
}

.queue-preview-img {
  width: 100%;
  height: min(70vh, 760px);
  object-fit: contain;
  display: block;
}

.queue-preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-size: 1.65rem;
  line-height: 1;
}

.queue-preview-nav.prev {
  left: 0.65rem;
}

.queue-preview-nav.next {
  right: 0.65rem;
}

.queue-preview-counter {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.58);
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
}

.queue-preview-meta {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.8rem;
  overflow: auto;
  display: grid;
  gap: 0.32rem;
  align-content: start;
}

.queue-preview-meta-row {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  word-break: break-word;
  line-height: 1.3;
  align-items: flex-start;
  justify-content: flex-start;
}

.queue-preview-meta-row .muted.small {
  line-height: 1.2;
}

.queue-preview-meta-row span:last-child {
  white-space: pre-wrap;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .queue-preview-body {
    grid-template-columns: 1fr;
  }
  .queue-preview-img {
    height: min(48vh, 460px);
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 14000;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.lightbox.hidden {
  display: none !important;
}

.lightbox-img {
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: default;
}

.lightbox-video {
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: default;
}

.lightbox-video.hidden {
  display: none !important;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(12, 16, 28, 0.92);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  border-color: var(--accent);
}

.shop-media-upload-wrap {
  position: relative;
  display: block;
  width: 100%;
}

/* Редактор карточки: подсказка по ширине контента модалки */
.shop-edit-photo-field {
  width: 100%;
  min-width: 0;
}

.shop-edit-photo-section {
  position: relative;
  width: 100%;
  min-width: 0;
}

.shop-edit-media-hint-wide {
  display: none;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-top: 0.65rem;
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  background: #0f1524;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 5;
}

.shop-edit-media-hint-wide p {
  margin: 0 0 0.55rem;
}

.shop-edit-media-hint-wide p:last-child {
  margin-bottom: 0;
}

.shop-edit-photo-section:has(.shop-edit-photo-add-tile:hover) .shop-edit-media-hint-wide,
.shop-edit-photo-section:has(.shop-edit-photo-add-tile:focus-visible) .shop-edit-media-hint-wide,
.shop-edit-photo-section:has(.shop-edit-photo-add-wrap:focus-within) .shop-edit-media-hint-wide {
  display: block;
}

/* Редактор карточки: сетка медиа как в превью товара */
.shop-edit-photos-grid.shop-card-preview-photos {
  align-items: start;
}

.shop-edit-photos-grid.shop-card-preview-photos:has(> .shop-edit-photo-add-wrap:only-child) > .shop-edit-photo-add-wrap {
  grid-column: 1 / -1;
  width: min(100%, 280px);
  margin-inline: auto;
}

.shop-edit-photo-cell {
  position: relative;
  width: 100%;
  min-width: 0;
  align-self: start;
}

.shop-edit-photo-reorder {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 4;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.shop-edit-photo-move {
  box-sizing: border-box;
  width: 2.1rem;
  height: 2.1rem;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.95rem;
  border-radius: 8px;
  color: var(--text);
  background: rgba(12, 16, 28, 0.92);
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.shop-edit-photo-move:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(18, 24, 38, 0.95);
}

.shop-edit-photo-move:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

.shop-edit-photo-move:disabled {
  opacity: 0.4;
}

.shop-edit-photo-cell--dragging {
  opacity: 0.55;
}

.shop-edit-photo-cell--drop-hover {
  outline: 2px solid rgba(96, 165, 250, 0.9);
  outline-offset: 2px;
  border-radius: 10px;
}

.shop-edit-photo-cell .shop-preview-photo {
  display: block;
  width: 100%;
  cursor: grab;
}

.shop-edit-photo-cell--dragging .shop-preview-photo {
  cursor: grabbing;
}

.shop-edit-photo-del {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 4;
  box-sizing: border-box;
  width: 2.1rem;
  height: 2.1rem;
  min-width: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  opacity: 1;
  color: #fff !important;
  background: #dc2626 !important;
  border: 1px solid #b91c1c !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.shop-edit-photo-del:hover:not(:disabled) {
  background: #b91c1c !important;
  border-color: #991b1b !important;
}

.shop-edit-photo-del:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

.shop-edit-photo-del svg {
  flex-shrink: 0;
}

.shop-edit-photo-add-wrap {
  width: 100%;
  min-width: 0;
  align-self: start;
}

.shop-edit-photo-add-tile {
  width: 100%;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.shop-edit-photo-add-tile:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.28);
}

.shop-edit-photo-add-tile:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

.shop-edit-photo-add-tile:disabled {
  cursor: wait;
  opacity: 0.92;
}

.shop-edit-photo-add-tile--busy {
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.5rem;
  border-style: solid;
}

.shop-edit-photo-add-plus {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.shop-edit-photo-add-plus::before,
.shop-edit-photo-add-plus::after {
  content: "";
  position: absolute;
  background: #6b7280;
  border-radius: 2px;
}

.shop-edit-photo-add-plus::before {
  width: 5px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.shop-edit-photo-add-plus::after {
  width: 100%;
  height: 5px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.shop-edit-photo-add-progress {
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--muted);
  text-align: center;
  max-width: 100%;
}

.shop-hint-pop,
.shop-media-hint-pop {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  width: 100%;
  max-width: none;
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  background: #0f1524;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 60;
}

.shop-hint-pop p,
.shop-media-hint-pop p {
  margin: 0 0 0.55rem;
}

.shop-hint-pop p:last-child,
.shop-media-hint-pop p:last-child {
  margin-bottom: 0;
}

.shop-hint-lead,
.shop-media-hint-lead {
  font-weight: 600;
}

.shop-media-upload-wrap:hover .shop-media-hint-pop,
.shop-media-upload-wrap:focus-within .shop-media-hint-pop {
  display: block;
}

.shop-action-hint-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.shop-action-hint-wrap:hover .shop-hint-pop,
.shop-action-hint-wrap:focus-within .shop-hint-pop {
  display: block;
}

.help-tabs-seg {
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.help-panel {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.help-doc {
  margin-top: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
}

.help-doc h3 {
  margin: 1.35rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.help-doc h3:first-child {
  margin-top: 0;
}

.help-doc p {
  margin: 0 0 0.65rem;
}

.help-doc ol,
.help-doc ul {
  margin: 0 0 0.75rem;
  padding-left: 1.35rem;
}

.help-doc li {
  margin-bottom: 0.35rem;
}

.help-doc strong {
  color: var(--text);
  font-weight: 600;
}

/* —— Мои товары (WB shop) —— */
.panel-products {
  max-width: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 0;
}

.panel-products > .panel-head {
  flex-shrink: 0;
}

.panel-products .shop-products-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.panel-products .shop-products-main > .products-toolbar {
  flex-shrink: 0;
}

.panel-products .shop-products-main > .shop-status-line {
  flex-shrink: 0;
  text-align: center;
}

.panel-products .shop-products-main > .shop-content-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.shop-table-actions-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.shop-table-actions-row > .shop-table-wrap,
.shop-table-actions-row > .shop-table-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.products-head {
  align-items: stretch;
  gap: 1rem;
}

.products-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  width: 100%;
}

.field-grow {
  flex: 1 1 180px;
  min-width: 140px;
}

.shop-select-wh {
  min-width: 220px;
  max-width: 320px;
}

.shop-status-line {
  margin: 0.35rem 0 0.75rem;
}

.shop-cache-health {
  color: var(--danger);
  font-weight: 600;
  margin-top: -0.35rem;
}

.shop-table-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shop-cache-health-box {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  line-height: 1.35;
}

.shop-actions-panel {
  --shop-action-gap: 0.5rem;
  flex: 0 0 224px;
  display: flex;
  flex-direction: column;
  gap: var(--shop-action-gap);
  padding: 0.65rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(6, 10, 18, 0.45);
  min-height: 0;
  box-sizing: border-box;
}

.shop-actions-panel .btn.shop-action-btn {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  height: 2.875rem;
  min-height: 2.875rem;
  max-height: 2.875rem;
  padding: 0 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  font-size: 0.78rem;
  white-space: normal;
  overflow-wrap: anywhere;
  border-radius: var(--radius-sm);
}

.shop-btn-wb-errors {
  border-color: rgba(251, 146, 60, 0.45) !important;
  background: rgba(249, 115, 22, 0.12) !important;
  color: #ffedd5 !important;
}

.shop-btn-wb-errors:hover {
  background: rgba(249, 115, 22, 0.2) !important;
}

.shop-actions-title {
  margin: 0;
  padding: 0 0.1rem 0.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.shop-content-inner {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.shop-btn-danger-soft {
  border-color: rgba(248, 113, 113, 0.45) !important;
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fecaca !important;
}

.shop-btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}

.shop-btn-danger-solid {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.95), rgba(220, 38, 38, 0.95)) !important;
  border: 1px solid rgba(127, 29, 29, 0.6) !important;
  color: #fff !important;
}

.shop-btn-danger-solid:hover {
  filter: brightness(1.06);
}

.shop-col-check {
  width: 48px;
}

.shop-th-check {
  width: 48px;
  text-align: center;
  vertical-align: middle;
}

.shop-check-cell {
  text-align: center;
  vertical-align: middle;
}

.shop-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  cursor: pointer;
}

.shop-check-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.shop-check-ui {
  width: 1.38rem;
  height: 1.38rem;
  border-radius: 7px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.shop-check-input:checked + .shop-check-ui {
  border-color: rgba(74, 222, 128, 0.95);
  background: rgba(34, 197, 94, 0.22);
  box-shadow: inset 0 0 0 2px rgba(6, 10, 18, 0.88);
}

.shop-check-input:focus-visible + .shop-check-ui {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

.shop-check-input:disabled + .shop-check-ui {
  opacity: 0.35;
}

.shop-modal-card-warn {
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.shop-warn-lead {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.shop-delete-summary {
  display: inline-block;
  margin-top: 0.35rem;
}

.shop-trash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 0.75rem;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding: 0.25rem;
}

.shop-trash-grid.shop-trash-grid--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 11rem;
  grid-template-columns: none;
  gap: 0;
}

.shop-trash-empty-msg {
  max-width: 26rem;
  width: 100%;
  margin: 0;
  padding: 0 1rem;
  text-align: center;
  line-height: 1.5;
}

#shop-modal-trash .shop-modal-card.shop-modal-card-wide {
  width: min(1180px, 98vw);
  max-width: 98vw;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#shop-modal-trash .shop-modal-body.shop-modal-body-spaced {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#shop-modal-trash .shop-trash-grid {
  max-height: min(72vh, 720px);
  flex: 1;
  min-height: 200px;
}

#shop-modal-trash .shop-trash-grid.shop-trash-grid--empty {
  flex: 1;
  min-height: 14rem;
  max-height: none;
}

.shop-trash-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
}

.shop-trash-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.shop-trash-card-title {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-trash-card-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.shop-trash-recover {
  margin-top: auto;
}

.shop-token-banner {
  margin-top: 0.45rem;
  margin-bottom: 0.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  line-height: 1.45;
}

.shop-token-banner-warn {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.32);
  color: var(--text);
}

.shop-token-banner-err {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.32);
  color: var(--text);
}

.shop-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}

.shop-table-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 16, 0.78);
  backdrop-filter: blur(4px);
}

.shop-table-loading-overlay:not(.hidden) {
  display: flex;
}

.shop-table-wrap.shop-table-wrap--loading .shop-table {
  opacity: 0;
  pointer-events: none;
}

.shop-table-loading-overlay-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  width: 100%;
}

.shop-bulk-selected-only-row {
  margin-bottom: 0.85rem;
}

.shop-bulk-only-line {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.shop-bulk-only-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  flex: 1 1 12rem;
  min-width: 0;
}

.shop-bulk-only-check-label .shop-check {
  flex-shrink: 0;
}

.shop-bulk-only-label-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.35;
}

.shop-bulk-inline-hint {
  position: relative;
  flex-shrink: 0;
  align-self: center;
}

.shop-bulk-inline-hint:hover .shop-hint-pop,
.shop-bulk-inline-hint:focus-within .shop-hint-pop {
  display: block;
}

.shop-bulk-only-hint-wrap {
  position: relative;
}

.shop-bulk-hint-btn {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: help;
  line-height: 1;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
}

.shop-bulk-only-hint-wrap:hover .shop-hint-pop,
.shop-bulk-only-hint-wrap:focus-within .shop-hint-pop {
  display: block;
}

.shop-bulk-only-hint {
  left: 0;
  top: calc(100% + 0.35rem);
  min-width: 240px;
  max-width: min(400px, 92vw);
  z-index: 60;
}

.shop-bulk-title-field.bulk-filter-disabled .input:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.shop-bulk-field-hint {
  margin-left: 0.35rem;
  vertical-align: middle;
}

.field-label .shop-bulk-field-hint.shop-th-hint-wrap {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
}

.shop-bulk-field-hint .shop-bulk-hint-btn {
  margin-left: 0.15rem;
}

.shop-bulk-field-hint:hover .shop-hint-pop,
.shop-bulk-field-hint:focus-within .shop-hint-pop {
  display: block;
}


.shop-bulk-field-hint-pop {
  left: 0;
  top: calc(100% + 0.35rem);
  min-width: 260px;
  max-width: min(430px, 94vw);
  z-index: 60;
}


/* Bulk modals: скролл только у body; футер вне скролла */
#shop-bulk-price-modal .shop-modal-card,
#shop-bulk-stock-modal .shop-modal-card,
#shop-bulk-dim-modal .shop-modal-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#shop-bulk-price-modal .shop-modal-head,
#shop-bulk-stock-modal .shop-modal-head,
#shop-bulk-dim-modal .shop-modal-head {
  position: relative;
  z-index: 2;
  background: var(--bg1);
}

#shop-bulk-price-modal .shop-modal-body,
#shop-bulk-stock-modal .shop-modal-body,
#shop-bulk-dim-modal .shop-modal-body {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  padding-bottom: 2.25rem;
}

/* Вниз от кнопки «?» — не вверх под хедер (overflow у body обрезает и даёт артефакт «под шапкой») */
#shop-bulk-price-modal .shop-hint-pop,
#shop-bulk-stock-modal .shop-hint-pop,
#shop-bulk-dim-modal .shop-hint-pop {
  top: calc(100% + 0.4rem);
  bottom: auto;
  right: auto;
  width: auto;
  z-index: 20;
}

#shop-bulk-price-modal .shop-bulk-field-hint-pop,
#shop-bulk-stock-modal .shop-bulk-field-hint-pop,
#shop-bulk-dim-modal .shop-bulk-field-hint-pop {
  left: 0;
  min-width: 260px;
  max-width: min(430px, 94vw);
}

#shop-bulk-price-modal .shop-bulk-only-hint,
#shop-bulk-stock-modal .shop-bulk-only-hint,
#shop-bulk-dim-modal .shop-bulk-only-hint {
  left: auto;
  right: 0;
  min-width: 240px;
  max-width: min(400px, 92vw);
}

.shop-bulk-effect-line {
  line-height: 1.45;
}

.shop-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.88rem;
}

/* Админка: автоматическая раскладка колонок на всю ширину (перебивает table-layout выше). */
.shop-table.admin-users-table {
  table-layout: auto;
  width: 100%;
  max-width: none;
}

.shop-col-thumb {
  width: 56px;
}
.shop-col-nm {
  width: 92px;
}
.shop-th-group {
  vertical-align: middle;
  position: relative;
}

/* Подсказка якорится к низу ячейки заголовка, а не к кнопке — не залезает под соседние th */
.shop-th-group .shop-th-hint-wrap {
  position: static;
}

.shop-th-group:has(.shop-th-hint-wrap:hover),
.shop-th-group:has(.shop-th-hint-wrap:focus-within) {
  z-index: 15;
}

.shop-th-hint-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}

.shop-th-hint-wrap:hover .shop-hint-pop {
  display: block;
}

.shop-th-group .shop-th-group-hint {
  left: 0;
  right: auto;
  top: calc(100% + 0.35rem);
  min-width: 240px;
  max-width: min(380px, 94vw);
  z-index: 40;
}

.shop-col-price-td {
  position: relative;
  vertical-align: middle;
}

.shop-col-price-td:has(.shop-price-lock-hint-wrap:hover),
.shop-col-price-td:has(.shop-price-lock-hint-wrap:focus-within) {
  z-index: 15;
}

.shop-price-cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  min-width: 0;
}

.shop-price-lock-hint-wrap {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.shop-price-lock-hint-wrap:hover .shop-hint-pop,
.shop-price-lock-hint-wrap:focus-within .shop-hint-pop {
  display: block;
}

.shop-price-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  box-sizing: border-box;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
  align-self: center;
}

.shop-price-lock-btn .shop-price-lock-icon {
  display: block;
}

.shop-price-lock-btn.shop-price-lock-on {
  border-color: rgba(46, 204, 113, 0.45);
  background: rgba(46, 204, 113, 0.12);
  color: #2ecc71;
}

.shop-price-lock-btn.shop-price-lock-off {
  color: rgba(154, 164, 191, 0.9);
}

.shop-price-lock-hint {
  left: auto;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 240px;
  max-width: min(380px, 94vw);
  z-index: 40;
}

.shop-col-group {
  width: 100px;
}

.shop-col-group-td {
  text-align: center;
  vertical-align: middle;
  font-size: 0.82rem;
}

.shop-group-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
}

.shop-group-dash {
  color: rgba(154, 164, 191, 0.75);
  font-weight: 600;
  font-size: 1rem;
  user-select: none;
}

.shop-group-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.shop-group-badge {
  --gb-h: 28;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: #0b1020;
  background: hsl(var(--gb-h), 72%, 52%);
  border: 1px solid hsla(var(--gb-h), 78%, 34%, 0.5);
}

.shop-group-imt {
  font-size: 0.65rem;
  line-height: 1.1;
  color: var(--muted);
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-col-vendor {
  width: 110px;
}
.shop-col-sku {
  width: 120px;
}
.shop-col-title {
  width: 22%;
  min-width: 120px;
}
.shop-col-box {
  width: 118px;
}
.shop-col-pack {
  width: 108px;
}
.shop-col-box-td,
.shop-col-pack-td {
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-word;
}
.shop-col-created {
  width: 128px;
}
.shop-col-stock {
  width: 148px;
}

.shop-th-stock {
  text-align: center;
  vertical-align: middle;
}

.shop-save-stocks-th {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  white-space: nowrap;
  line-height: 1.25;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.shop-bulk-buyer-line {
  margin: 0.15rem 0 0.5rem;
  font-weight: 600;
  color: var(--text);
}
.shop-col-price {
  min-width: 5.5rem;
  width: auto;
}
.shop-col-actions {
  width: 168px;
}

.shop-table .shop-row-edit {
  width: 100%;
  white-space: nowrap;
  line-height: 1.25;
  justify-content: center;
  text-align: center;
}

.shop-table th,
.shop-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  vertical-align: middle;
  text-align: left;
}

.shop-table td.shop-col-title-td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.shop-table th {
  color: var(--muted);
  font-weight: 600;
  background: #0b1020;
  position: sticky;
  top: 0;
  z-index: 1;
}

.shop-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.shop-sort-btn:hover {
  color: var(--text);
}

.shop-sort-icon {
  font-size: 0.82rem;
  opacity: 0.72;
}

.shop-sort-btn.active .shop-sort-icon {
  color: var(--accent);
  opacity: 1;
}

.th-thumb {
  width: 56px;
}

.shop-thumb {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.shop-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.shop-sku-hint {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-pagination {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 1rem;
  flex-shrink: 0;
  position: relative;
}

.shop-pagination-btns {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
  max-width: 520px;
  position: relative;
  margin: 0 auto;
}

.shop-page-nav-btn {
  flex: 1 1 200px;
  width: min(260px, 44vw);
  max-width: 260px;
  justify-content: center;
  text-align: center;
}

.shop-cache-health-inline {
  position: absolute;
  left: 0;
  top: 0;
  transform: none;
  width: min(460px, 42vw);
  margin: 0;
  z-index: 1;
}

@media (max-width: 1100px) {
  .shop-cache-health-inline {
    position: static;
    transform: none;
    width: 100%;
    margin-bottom: 0.45rem;
  }
  .shop-pagination-btns {
    max-width: 640px;
    flex-wrap: wrap;
  }
}

.shop-page-meta {
  text-align: center;
  width: 100%;
}

.shop-stock-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.shop-stock-input-row {
  margin-bottom: 0.35rem;
}

.shop-stock-input-row:last-child {
  margin-bottom: 0;
}

.shop-stock-input-sm {
  padding: 0.28rem 0.45rem;
  font-size: 0.8rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.shop-bulk-actions {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  flex-shrink: 0;
}

.shop-bulk-action-btn {
  flex: 1 1 220px;
  max-width: 340px;
  min-width: min(280px, 100%);
  justify-content: center;
  text-align: center;
}

.shop-stock-cell {
  vertical-align: middle;
  min-width: 92px;
}

.shop-table tbody tr.shop-table-data-row {
  cursor: pointer;
}

.shop-table tbody tr.shop-table-data-row:hover {
  background: rgba(110, 168, 255, 0.06);
}

.shop-table-spinner {
  display: inline-block;
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(110, 168, 255, 0.95);
  border-radius: 50%;
  animation: wb-spin 0.75s linear infinite;
}

/* Компактный спиннер для использования внутри кнопок: совпадает по высоте
   с обычным текстом, не разрывает layout кнопки. */
.btn-spinner {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.45rem;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: wb-spin 0.75s linear infinite;
  vertical-align: -0.15em;
}

/* Состояние «занята» для кнопок-действий: блокируем pointer events,
   приглушаем, чтобы пользователь видел, что идёт обработка. */
.btn.is-busy {
  pointer-events: none;
  opacity: 0.78;
  cursor: progress;
}

.shop-price-btn {
  box-sizing: border-box;
  width: auto;
  max-width: none;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  line-height: 1.25;
  padding: 0.45rem 0.5rem;
}

/* Ширина выставляется JS (shopEqualizePriceButtonWidths) одинаково для всех строк */
.shop-price-cell-inner .shop-price-btn {
  flex: 0 0 auto;
  min-width: 0;
}

.shop-modal-card-narrow {
  width: min(440px, 100%);
}

.shop-modal-card-wide {
  width: min(720px, 100%);
  max-width: 98vw;
}

.shop-modal-card-xl {
  width: min(1040px, 100%);
  max-width: 98vw;
}

.shop-modal-card.shop-create-wizard-card {
  width: 560px;
  max-width: min(560px, 96vw);
  min-height: 520px;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.shop-create-wizard-card .shop-modal-head {
  flex-shrink: 0;
}

.shop-create-wizard-card .shop-modal-foot {
  flex-shrink: 0;
}

.shop-create-wizard-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem 1.2rem 1.15rem;
  box-sizing: border-box;
}

.shop-create-lead {
  line-height: 1.45;
  margin: 0 0 1rem;
}

.shop-create-stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.shop-create-field-hint {
  display: block;
  margin-top: 0.4rem;
}

.shop-create-field .field-label {
  margin-bottom: 0.35rem;
}

.shop-create-tabs {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  margin: 0 0 1rem;
}

.shop-create-tab {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  border: 1px solid transparent;
  box-sizing: border-box;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  font-family: inherit;
}

.shop-create-tab:hover {
  color: var(--text);
}

.shop-create-tab--active {
  color: var(--text);
  background: rgba(110, 168, 255, 0.16);
  border-color: rgba(110, 168, 255, 0.28);
}

.shop-create-tab-panel {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shop-create-tab-panel:not(.hidden) .shop-create-stack {
  flex: 1 1 auto;
}

.shop-create-tab-panel.hidden {
  display: none !important;
}

.shop-create-panel--flush {
  margin-bottom: 0;
}

.shop-create-manual-desc-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.85rem;
  margin-top: 0.15rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.shop-create-generated-ai-hint {
  margin: 0;
  line-height: 1.45;
}

.shop-create-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.shop-create-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shop-create-file-btn {
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.shop-create-file-names {
  flex: 1 1 12rem;
  min-width: 0;
  line-height: 1.35;
}

.shop-create-gen-desc-wrap {
  display: flex;
  justify-content: center;
  padding-top: 0.25rem;
  margin-bottom: 0.85rem;
}

.shop-create-gen-desc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 15rem;
  box-sizing: border-box;
}

.shop-create-gen-desc-btn.shop-create-gen-desc-btn--loading {
  pointer-events: none;
  opacity: 0.92;
}

.shop-create-inline-spinner {
  display: inline-block;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(110, 168, 255, 0.95);
  border-radius: 50%;
  animation: wb-spin 0.75s linear infinite;
  vertical-align: middle;
}

.shop-create-dropdown {
  margin-top: 0.35rem;
}

.shop-create-dropdown-inner {
  position: relative;
}

.shop-create-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  box-sizing: border-box;
}

.shop-create-dropdown-chevron::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-bottom: 0.2rem;
  opacity: 0.75;
}

.shop-create-dropdown-menu {
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  max-height: min(52vh, 420px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(110, 168, 255, 0.28);
  background: rgba(10, 16, 30, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.shop-create-queue-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.shop-create-queue-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.shop-create-queue-group-title {
  font-weight: 600;
  font-size: 0.88rem;
}

.shop-create-queue-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.25rem 0.15rem;
  cursor: pointer;
  border-radius: 8px;
}

.shop-create-queue-checkbox-row:hover {
  background: rgba(110, 168, 255, 0.08);
}

.shop-create-queue-checkbox-row input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.shop-create-queue-checkbox-text {
  font-size: 0.84rem;
  line-height: 1.35;
}

.shop-create-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
  min-height: 1.25rem;
}

.shop-create-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 168, 255, 0.25);
  background: rgba(110, 168, 255, 0.08);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select.shop-create-select {
  max-width: 100%;
}

.shop-create-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 0.75rem;
}

.shop-create-grid-2col {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.shop-create-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.shop-create-panel-title {
  font-weight: 600;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.shop-create-subpanel {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.shop-create-inline-hint {
  display: inline-block;
  margin-left: 0.35rem;
}

.textarea-min {
  min-height: 2.75rem;
  resize: vertical;
}

.shop-create-queue-panel {
  margin-top: 0.85rem;
}

.shop-create-queue-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.shop-create-queue-hint {
  margin: 0.35rem 0 0.5rem;
}

.shop-create-queue-picker {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.shop-create-queue-job {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.55rem;
  background: rgba(0, 0, 0, 0.18);
}

.shop-create-queue-job-head {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}

.shop-create-queue-cards {
  display: grid;
  gap: 0.35rem;
}

.shop-create-queue-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.35rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.shop-create-queue-thumb {
  width: 72px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.shop-create-queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-create-queue-meta {
  min-width: 0;
}

.shop-create-queue-title {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-create-queue-slides {
  margin-top: 0.15rem;
  font-size: 0.74rem;
  opacity: 0.85;
}

.shop-create-pc-panel {
  margin-top: 0.75rem;
}

.shop-create-row-inline {
  margin-top: 0.35rem;
}

.shop-create-table-wrap {
  margin-top: 0.85rem;
}

.shop-create-table-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.shop-create-table-title {
  font-weight: 600;
}

.shop-create-table-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.shop-create-count {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.input-tiny {
  width: 4rem;
}

.shop-create-table-scroll {
  overflow: auto;
  max-height: min(52vh, 620px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.shop-create-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.shop-create-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(22, 26, 32, 0.96);
  backdrop-filter: blur(6px);
  text-align: left;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--border);
}

.shop-create-table tbody td {
  vertical-align: top;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.shop-create-table tbody tr:last-child td {
  border-bottom: none;
}

.shop-create-mini-input {
  width: 100%;
  min-width: 140px;
}

.shop-create-desc-cell textarea {
  min-height: 4rem;
}

.shop-create-media-preview {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.shop-create-media-thumb {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.shop-create-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-create-media-file {
  font-size: 0.78rem;
  width: min(220px, 38vw);
}

/* Строка статуса под формой (#shop-create-status): отступ от чипов / содержимого вкладки */
.shop-create-status {
  margin-top: 1.15rem;
  padding-top: 0;
  min-height: 1.15rem;
}

.shop-create-wizard-foot {
  gap: 0.5rem;
}

.shop-modal-card-preview {
  max-height: calc(100vh - 2rem);
}

.shop-card-preview-body {
  max-height: min(82vh, 880px);
}

/* Иначе средний блок (таблица) с overflow:hidden схлопывается в flex-колонке до «полоски». */
.shop-card-preview-body > * {
  flex-shrink: 0;
}

.shop-card-preview-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  align-items: start;
}

.shop-preview-photo {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  aspect-ratio: 3 / 4;
  cursor: zoom-in;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  line-height: 0;
}

.shop-preview-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-preview-photo:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}

.shop-card-preview-photos:has(> .shop-preview-photo:only-child) > .shop-preview-photo {
  grid-column: 1 / -1;
  width: min(100%, 280px);
  margin-inline: auto;
}

.shop-card-preview-meta {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: none;
}

.shop-card-preview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.shop-card-preview-table tbody tr:not(:last-child) th,
.shop-card-preview-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

.shop-card-preview-table th,
.shop-card-preview-table td {
  padding: 0.45rem 0.65rem;
  vertical-align: top;
  text-align: left;
}

.shop-card-preview-table th {
  width: 38%;
  max-width: 12rem;
  color: var(--muted);
  font-weight: 500;
}

.shop-preview-v {
  word-break: break-word;
}

.shop-card-preview-desc-block {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.shop-preview-section-label {
  margin-bottom: 0.35rem;
  text-align: center;
}

.shop-card-preview-desc {
  white-space: pre-wrap;
  max-height: min(38vh, 320px);
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}

.shop-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.shop-modal.hidden {
  display: none;
}

.shop-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.shop-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 3rem);
  overflow: auto;
  background: var(--bg1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.shop-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.shop-modal-title {
  margin: 0;
  font-size: 1.1rem;
}

.shop-modal-x {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
}

.shop-modal-x:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.shop-modal-body {
  padding: 1rem 1.1rem 0.5rem;
  max-height: min(72vh, 720px);
  overflow-y: auto;
}

.shop-modal-body-spaced {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.2rem 1.25rem 1rem;
}

.shop-modal-body-spaced > p,
.shop-modal-body-spaced > .shop-modal-lead {
  margin: 0;
}

.shop-modal-body-spaced > .field {
  margin: 0;
}

.shop-modal-body-spaced .form-grid,
.shop-modal-body-spaced .shop-dim-grid {
  margin: 0;
}

.shop-modal-body-spaced .shop-bulk-buyer-line {
  margin: 0;
}

.shop-modal-lead {
  margin: 0 0 0.75rem;
}

.shop-dim-grid {
  margin-top: 0.35rem;
}

.textarea-mono {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.shop-edit-subject-grid {
  grid-template-columns: 1fr 1fr;
}

.shop-edit-tag-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.shop-edit-tag-controls .select {
  flex: 1 1 240px;
}

.shop-tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.shop-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

.shop-tag-chip button {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.shop-charcs-grid {
  display: grid;
  gap: 0.7rem;
}

.shop-edit-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.86rem;
}

.shop-spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent);
  animation: shop-spin 0.8s linear infinite;
}

@keyframes shop-spin {
  to {
    transform: rotate(360deg);
  }
}

.shop-charc-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 0.4rem;
}

.shop-charc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.shop-charc-title {
  font-size: 0.87rem;
}

.shop-charc-required {
  color: #ffb3b3;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shop-charc-hint {
  font-size: 0.78rem;
}

/* shop-edit-photos-list: классы сетки — .shop-card-preview-photos + .shop-edit-photos-grid (см. выше) */

.shop-deep-check {
  align-self: center;
  margin-bottom: 0.15rem;
  white-space: nowrap;
}

.shop-errors-list {
  max-height: min(60vh, 520px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.shop-errors-batch {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: rgba(6, 10, 18, 0.35);
}

.shop-errors-batch-head {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  word-break: break-all;
}

.shop-errors-batch-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.shop-errors-batch-lines {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

.shop-modal-foot {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--border);
}

.public-templates-modal-card {
  width: min(960px, 100%);
  max-width: 98vw;
}

.public-templates-modal-body {
  max-height: min(78vh, 820px);
}

.public-templates-lead {
  margin: 0;
}

.public-templates-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 1.5rem 0.5rem;
  min-height: 8rem;
}

.public-templates-state-loading {
  flex-direction: row;
  flex-wrap: wrap;
}

.public-templates-state-error {
  color: var(--danger);
  align-items: stretch;
  text-align: left;
}

.public-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  padding-bottom: 0.25rem;
}

.public-templates-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.public-templates-carousel {
  position: relative;
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  max-height: 320px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.public-templates-carousel-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.public-templates-carousel--empty .public-templates-carousel-img {
  display: none;
}

.public-templates-no-preview {
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.public-templates-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(7, 10, 16, 0.82);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.public-templates-nav:hover {
  background: rgba(110, 168, 255, 0.18);
  border-color: rgba(110, 168, 255, 0.45);
}

.public-templates-nav-prev {
  left: 0.4rem;
}

.public-templates-nav-next {
  right: 0.4rem;
}

.public-templates-carousel-counter {
  position: absolute;
  bottom: 0.45rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(7, 10, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  z-index: 2;
  pointer-events: none;
}

.public-templates-card-meta {
  padding: 0.75rem 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.public-templates-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.public-templates-card-dim {
  margin: 0;
}

.public-templates-card-desc {
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-modal-foot .btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  text-align: center;
  min-height: 2.5rem;
  box-sizing: border-box;
}

.support-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.nav-item-support {
  margin-top: auto;
  margin-bottom: 0.65rem;
}

.support-user-panel,
.support-console {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-console {
  flex: 1;
  min-height: 0;
}

.admin-content .support-console {
  min-height: calc(100vh - 165px);
}

.support-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-chat-actions {
  display: flex;
  gap: 8px;
}

.support-chat-messages {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  min-height: 420px;
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.support-chat-compose .textarea {
  min-height: 72px;
  resize: vertical;
}

.support-chat-compose .btn {
  height: 100%;
  min-height: 72px;
}

.support-loading-wrap {
  height: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.support-msg {
  max-width: min(80%, 740px);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f4f8ff;
}

.support-msg-user {
  background: linear-gradient(135deg, #2f6bff, #4f8dff);
  align-self: flex-start;
}

.support-msg-agent {
  background: linear-gradient(135deg, #2246b8, #2f63da);
  align-self: flex-end;
}

.support-msg-system {
  align-self: center;
  background: rgba(255, 255, 255, 0.08);
  border-style: dashed;
  color: #d8e4ff;
  max-width: 100%;
  text-align: center;
}

.support-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.support-msg-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #d8e4ff;
}

.support-console-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  min-height: 72vh;
  flex: 1;
}

.support-chat-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.support-ticket-list-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.support-ticket-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.support-ticket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding: 0 2px;
}

.support-ticket-list-shell {
  flex: 1;
  min-height: 0;
  border: 1px solid rgba(113, 158, 255, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 17, 31, 0.96), rgba(8, 14, 24, 0.96));
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.support-ticket-list-col,
.support-chat-col {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 88%, #ffffff 12%);
  padding: 12px;
  height: 100%;
  min-height: 0;
}

.support-ticket-list-col {
  background:
    linear-gradient(180deg, rgba(19, 31, 55, 0.96), rgba(14, 24, 43, 0.96)),
    color-mix(in srgb, var(--panel) 85%, #000 15%);
  border-color: rgba(113, 158, 255, 0.22);
}

.support-ticket-item {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

#tab-support .support-user-panel {
  height: 100%;
  min-height: 0;
}

#tab-support .support-chat-head {
  flex-shrink: 0;
}

#tab-support .support-chat-messages {
  min-height: 0;
}

#tab-support .support-msg-user {
  align-self: flex-end;
}

#tab-support .support-msg-agent {
  align-self: flex-start;
  background: linear-gradient(135deg, #193b8f, #2550b8);
}

.support-chat-col .support-msg-user {
  align-self: flex-start;
  background: linear-gradient(135deg, #193b8f, #2550b8);
}

.support-chat-col .support-msg-agent {
  align-self: flex-end;
  background: linear-gradient(135deg, #2f6bff, #4f8dff);
}

.support-chat-col .support-msg-system {
  align-self: center;
}

.reviews-toolbar {
  display: flex;
  width: 100%;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}

.reviews-toolbar > .input {
  flex: 1 1 auto;
  min-width: 0;
}

.reviews-toolbar > .select {
  flex: 0 0 auto;
}

.reviews-toolbar #reviews-page-size,
.reviews-toolbar #reviews-f-page-size {
  width: 4.5rem;
  min-width: 4.5rem;
  padding-right: 1.6rem;
}

.reviews-toolbar #reviews-answered-filter,
.reviews-toolbar #reviews-f-answered-filter {
  width: 8.5rem;
  min-width: 8.5rem;
}

.reviews-toolbar #reviews-f-valuation-filter {
  width: 9.5rem;
  min-width: 9.5rem;
}

.reviews-summary {
  margin: 0.2rem 0 0.8rem;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.review-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  padding: 0.85rem;
}

.review-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.review-item-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.review-pill {
  font-size: 0.77rem;
  border: 1px solid rgba(120, 160, 255, 0.36);
  background: rgba(88, 120, 255, 0.16);
  border-radius: 999px;
  padding: 0.15rem 0.48rem;
}

.review-item-body {
  white-space: pre-wrap;
  color: var(--text);
}

.review-item-answer {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(64, 135, 255, 0.12);
  border: 1px solid rgba(88, 142, 255, 0.28);
}

.review-item-actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.reviews-ai-settings {
  margin-bottom: 0.7rem;
}

.reviews-ai-settings-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.reviews-bulk-actions {
  display: flex;
  gap: 0.5rem;
  margin: 0.25rem 0 0.7rem;
  flex-wrap: wrap;
}

.reviews-table-shell {
  overflow: auto;
}

.reviews-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.reviews-table--questions .reviews-col-check {
  width: 4%;
}
.reviews-table--questions .reviews-col-date {
  width: 11%;
}
.reviews-table--questions .reviews-col-product {
  width: 17%;
}
.reviews-table--questions .reviews-col-text {
  width: 31%;
}
.reviews-table--questions .reviews-col-answer {
  width: 27%;
}
.reviews-table--questions .reviews-col-actions {
  width: 10%;
}
.reviews-table--feedbacks .reviews-col-check {
  width: 4%;
}
.reviews-table--feedbacks .reviews-col-date {
  width: 9%;
}
.reviews-table--feedbacks .reviews-col-product {
  width: 14%;
}
.reviews-table--feedbacks .reviews-col-buyer {
  width: 8%;
}
.reviews-table--feedbacks .reviews-col-order {
  width: 6%;
}
.reviews-table--feedbacks .reviews-col-text {
  width: 24%;
}
.reviews-table--feedbacks .reviews-col-answer {
  width: 22%;
}
.reviews-table--feedbacks .reviews-col-val {
  width: 5%;
}
.reviews-table--feedbacks .reviews-col-actions {
  width: 8%;
}

.reviews-table th,
.reviews-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.45rem;
  vertical-align: middle;
  text-align: left;
}

.reviews-table th.reviews-th-check,
.reviews-table td.reviews-check-cell {
  padding-left: 0;
  padding-right: 0;
  text-align: center;
  vertical-align: middle;
}

.reviews-table th.reviews-th-check .shop-check,
.reviews-table td.reviews-check-cell .shop-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.reviews-table th.reviews-sortable {
  white-space: nowrap;
}

.reviews-cell-text {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

.reviews-row-actions {
  display: grid;
  gap: 0.35rem;
}

.reviews-btn-regenerate {
  border-color: rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.18);
  color: #ffe9ad;
}

.reviews-btn-regenerate:hover {
  border-color: rgba(255, 209, 102, 0.8);
  background: rgba(255, 209, 102, 0.24);
}

/* ИИ-черновик в столбце «Ответ» — приглушённый цвет, чтобы визуально отличить
   от уже опубликованных ответов. После публикации класс снимается. */
.reviews-cell-draft {
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
  position: relative;
}

.reviews-draft-badge {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 196, 0, 0.18);
  color: rgba(255, 196, 0, 0.95);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 0.05em;
}

.reviews-sortable {
  cursor: pointer;
  user-select: none;
}

.reviews-pagination {
  margin-top: 0.55rem;
}

.reviews-actions-panel {
  flex-basis: 240px;
}

.reviews-settings-grid {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.reviews-settings-left {
  flex: 1;
  min-width: 0;
}

.reviews-settings-actions {
  flex-basis: 280px;
  gap: 0.95rem;
}

.reviews-setting-check {
  width: 100%;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.2rem;
}

.reviews-setting-check .shop-check-ui {
  flex: 0 0 auto;
}

.reviews-ai-save-row {
  justify-content: center;
  margin-top: 0.8rem;
}

.reviews-order-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  font-weight: 700;
}

.reviews-order-buyout {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.reviews-order-return {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.reviews-order-unspecified {
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.reviews-order-other {
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.reviews-rating-low {
  color: #fca5a5;
}
.reviews-rating-mid {
  color: #facc15;
}
.reviews-rating-high {
  color: #86efac;
}

#reviews-refresh-btn,
#reviews-f-refresh-btn {
  white-space: nowrap;
}

#tab-reviews.tab-pane.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#reviews-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#reviews-sub-questions.subpane.active,
#reviews-sub-feedbacks.subpane.active,
#reviews-sub-settings.subpane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#reviews-sub-questions.subpane.active > .panel,
#reviews-sub-feedbacks.subpane.active > .panel,
#reviews-sub-settings.subpane.active > .panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#reviews-sub-questions .shop-table-actions-row {
  flex: 1;
  min-height: 0;
}

#reviews-sub-questions .reviews-table-shell {
  flex: 1;
  min-height: 0;
}

#reviews-reply-modal .shop-modal-close {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#reviews-reply-modal .shop-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem 1.1rem 1rem;
}

#reviews-reply-modal .shop-modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  padding-top: 0.2rem;
}

#reviews-reply-modal .shop-modal-actions .btn {
  width: 170px;
}

.reviews-table .is-hidden {
  display: none;
}

.support-ticket-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
  background: linear-gradient(180deg, rgba(79, 141, 255, 0.18), rgba(79, 141, 255, 0.07));
}

.support-ticket-item:hover {
  transform: translateY(-1px);
  border-color: rgba(112, 162, 255, 0.5);
  background: linear-gradient(180deg, rgba(79, 141, 255, 0.14), rgba(79, 141, 255, 0.06));
}

.support-ticket-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

@media (max-width: 1100px) {
  .support-console-grid {
    grid-template-columns: 1fr;
  }
}

/* Landing */
.landing-body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(84, 126, 255, 0.22), transparent 65%),
    radial-gradient(800px 400px at 10% 10%, rgba(146, 100, 255, 0.18), transparent 60%),
    #070b16;
  color: var(--text);
}

.landing-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(7, 11, 22, 0.72);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
}

.landing-logo {
  color: var(--text);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}

.landing-nav {
  display: flex;
  gap: 1rem;
}

.landing-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.landing-main {
  display: flex;
  flex-direction: column;
  gap: 2.6rem;
  padding-bottom: 3rem;
}

.landing-hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: center;
  padding: 2rem 1.2rem 1.2rem;
}

.landing-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(79, 111, 255, 0.22), transparent 40%),
    linear-gradient(320deg, rgba(133, 92, 255, 0.25), transparent 36%);
  pointer-events: none;
}

.landing-hero-content {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.landing-chip {
  display: inline-flex;
  width: fit-content;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.landing-hero p {
  margin: 0;
  color: #cdd9f6;
  max-width: 840px;
  font-size: 1.08rem;
  line-height: 1.5;
}

.landing-hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.landing-metrics {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 0.8rem;
}

.landing-metric {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.8rem;
}

.landing-metric strong {
  display: block;
  font-size: 1.6rem;
}

.landing-metric span {
  color: var(--muted);
  font-size: 0.88rem;
}

.landing-section {
  padding: 0 1.2rem;
}

.landing-section-head {
  max-width: 900px;
  margin: 0 auto 1rem;
}

.landing-section-head h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.landing-section-head p {
  margin: 0;
  color: var(--muted);
}

.landing-section-alt {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-top: 1.6rem;
  padding-bottom: 1.6rem;
}

.landing-cards-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 0.85rem;
}

.landing-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.landing-card h3 {
  margin: 0 0 0.45rem;
}

.landing-card p {
  margin: 0;
  color: var(--muted);
}

.landing-steps {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 0.7rem;
  padding-left: 1.2rem;
}

.landing-steps li {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 0.35rem;
}

.landing-screens-grid {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 0.9rem;
}

.landing-screen {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.landing-screen img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.landing-screen figcaption {
  padding: 0.75rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.landing-pricing-grid {
  max-width: 1020px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 0.9rem;
}

.landing-price-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.landing-price-card-featured {
  border-color: rgba(111, 168, 255, 0.5);
  box-shadow: 0 18px 60px rgba(67, 98, 255, 0.2);
}

.landing-price {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0.35rem 0 0.6rem;
}

.landing-price-card ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  display: grid;
  gap: 0.32rem;
}

.landing-cta {
  margin-top: 1.1rem;
  display: flex;
  justify-content: center;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .landing-nav {
    display: none;
  }
  .landing-metrics,
  .landing-cards-grid,
  .landing-screens-grid,
  .landing-pricing-grid {
    grid-template-columns: 1fr;
  }
}
