:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --bg: #eef1f4;
  --panel: #ffffff;
  --sidebar: #f4f6f8;
  --border: #d8dee4;
  --border-soft: #e8edf1;
  --text: #243447;
  --muted: #6b7c8a;
  --primary: #2c3e50;
  --wb: #cb11ab;
  --wb-hover: #a50e8f;
  --ozon: #005bff;
  --ozon-hover: #0047cc;
  --ai: #4d6bfe;
  --ai-hover: #3a56e0;
  --ok: #0e7a5f;
  --ok-bg: #e6f7f1;
  --warn: #9a6b00;
  --warn-bg: #fff4df;
  --err: #c0392b;
  --err-bg: #fdecea;
  --info: #1a6aa0;
  --info-bg: #eaf4fb;
  --seg: #e3e9ee;
  --row-hover: #f3f7fa;
  --row-sel: #e7f1f8;
  --mp: var(--wb);
  --mp-hover: var(--wb-hover);
  --header-h: 56px;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(36, 52, 71, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden; /* скролл только внутри панелей/таблиц, не у окна */
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #1f2a36;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
}

.app {
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.app[data-marketplace="ozon"] {
  --mp: var(--ozon);
  --mp-hover: var(--ozon-hover);
}

.app-header {
  height: var(--header-h);
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(240px, 2fr) minmax(220px, 1.05fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--mp);
  color: #fff;
  transition: background 0.2s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  white-space: nowrap;
}

.header-meta {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.mp-logo-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.mp-logo {
  display: block;
  height: 28px;
  width: auto;
  border-radius: 7px;
}

.pill {
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.withdraw-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.16);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.withdraw-chip:hover {
  background: rgba(0, 0, 0, 0.28);
}

.withdraw-chip.is-loading {
  opacity: 0.72;
}

.withdraw-chip[data-ok='0'] .withdraw-amount {
  opacity: 0.72;
}

.withdraw-label {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.84;
  text-transform: lowercase;
}

.withdraw-amount {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.header-center {
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 0 4px;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.header-ai {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-ai.is-loading {
  opacity: 0.72;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  padding: 4px 8px 4px 7px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.ai-chip:hover {
  background: rgba(0, 0, 0, 0.28);
}

.ai-chip-name {
  opacity: 0.86;
  letter-spacing: 0.02em;
}

.ai-chip-bal {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ai-lamp {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.ai-lamp[data-state='on'] {
  background: #3ddc84;
  box-shadow:
    0 0 0 1px rgba(61, 220, 132, 0.35),
    0 0 8px rgba(61, 220, 132, 0.85);
}

.ai-lamp[data-state='err'] {
  background: #ff5c5c;
  box-shadow:
    0 0 0 1px rgba(255, 92, 92, 0.3),
    0 0 6px rgba(255, 92, 92, 0.55);
}

.ai-lamp[data-state='off'] {
  background: rgba(255, 255, 255, 0.32);
}

.header-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.important-todos {
  position: relative;
  flex-shrink: 0;
}

.header-btn-alert {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  background: rgba(255, 196, 0, 0.92);
  color: #1a1200;
}

.header-btn-alert:hover {
  background: #ffd54a;
}

.header-btn-alert[data-open='0'] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.header-btn-alert[data-open='0']:hover {
  background: rgba(255, 255, 255, 0.26);
}

.important-todos-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(320px, calc(100vw - 24px));
  background: #fff;
  color: #1a1a1a;
  border-radius: 12px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.important-todos-panel[hidden] {
  display: none;
}

.important-todos-head {
  padding: 10px 12px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #444;
  border-bottom: 1px solid #eee;
}

.important-todos-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: min(360px, 50vh);
  overflow: auto;
}

.important-todos-list > li {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  padding-right: 4px;
}

.important-todos-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 8px 8px 8px 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  border-radius: 6px;
}

.important-todos-item:hover {
  background: #f5f5f7;
}

.important-todos-item input {
  margin-top: 2px;
  flex-shrink: 0;
}

.important-todos-item span {
  word-break: break-word;
}

.important-todos-item.is-done span {
  text-decoration: line-through;
  opacity: 0.55;
  font-weight: 400;
}

.important-todos-del {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #999;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.important-todos-del:hover {
  background: #f0f0f2;
  color: #c62828;
}

.important-todos-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: #666;
}

.important-todos-add {
  display: flex;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid #eee;
  background: #fafafa;
}

.important-todos-add input {
  flex: 1;
  min-width: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.important-todos-add input:focus {
  border-color: #888;
}

.important-todos-add button {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.important-todos-add button:hover {
  background: #333;
}

.proc-status {
  width: min(860px, 100%);
  min-height: 36px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 5px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.proc-status[data-idle='1'] {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.proc-status[data-idle='0'] {
  background: rgba(0, 0, 0, 0.32);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: proc-chip-pulse 1.6s ease-in-out infinite;
}

.proc-status-text {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  word-break: break-word;
  color: #fff;
}

.proc-status[data-idle='1'] .proc-status-text {
  font-weight: 500;
  opacity: 0.88;
}

.proc-status-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.proc-status-bar[hidden] {
  display: none !important;
}

.proc-status-fill {
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: #fff;
  transition: width 0.2s ease;
}

.proc-status-fill.is-indeterminate {
  width: 36% !important;
  animation: proc-bar-slide 1.1s ease-in-out infinite;
}

@keyframes proc-bar-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(280%);
  }
}

@keyframes proc-chip-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
}

/* совместимость со старым классом */
.proc-chip {
  display: none;
}

.mp-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  padding: 2px;
  gap: 1px;
}

.mp-switch button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  padding: 2px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  line-height: 0;
  opacity: 0.58;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.mp-switch button:hover {
  opacity: 0.82;
  background: rgba(0, 0, 0, 0.1);
}

.mp-switch button.on {
  background: rgba(0, 0, 0, 0.28);
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.mp-switch button .mp-logo {
  height: 26px;
  border-radius: 999px;
}

.app-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 10px 8px;
  overflow: auto;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav button {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
}

.side-nav button:hover {
  background: rgba(36, 52, 71, 0.05);
}

.side-nav button.on {
  background: #d9ebf8;
  color: #154864;
  font-weight: 650;
}

.side-nav button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.7;
}

.main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.placeholder-screen {
  margin: auto;
  text-align: center;
  color: var(--muted);
  padding: 40px;
}

.placeholder-screen h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 20px;
}

/* Products workbench */
.wb {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.wb-top {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px 8px;
  flex-shrink: 0;
}

.wb-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wb-title {
  font-size: 15px;
  font-weight: 750;
  min-width: 72px;
}

.seg {
  display: inline-flex;
  background: var(--seg);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.seg button:hover {
  background: rgba(255, 255, 255, 0.55);
}

.seg button.on {
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.seg.service {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
}

.seg.service button {
  color: var(--muted);
  font-size: 11.5px;
  padding: 5px 10px;
  font-weight: 500;
}

.seg.service button.on {
  background: #eef2f5;
  color: var(--text);
  box-shadow: none;
  font-weight: 650;
}

.wb-hint {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.wb-hint a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wb-hint a:hover {
  color: var(--text);
}

.wb-cmd {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  position: relative;
  z-index: 6;
  overflow: visible;
}

.scope {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-right: 8px;
  margin-right: 2px;
  border-right: 1px solid var(--border-soft);
  position: relative;
  z-index: 5;
}

.scope select,
.scope input:not([type='checkbox']) {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

#searchInput {
  width: 220px;
  min-width: 180px;
}

/* —— Панель фильтров —— */
.filters-wrap {
  position: relative;
}

.filters-toggle {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ozon);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.filters-toggle.has {
  background: #eef4ff;
}

.filters-toggle.on {
  border-color: var(--ozon);
  box-shadow: 0 0 0 1px rgba(0, 91, 255, 0.15);
}

.app[data-marketplace='wildberries'] .filters-toggle {
  border-color: var(--wb);
}

.app[data-marketplace='wildberries'] .filters-toggle.has {
  background: #fce8f7;
}

.filters-chevron {
  font-size: 12px;
  color: var(--muted);
}

.filters-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(860px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(36, 52, 71, 0.16);
  display: flex;
  flex-direction: column;
  max-height: min(560px, 72vh);
  overflow: hidden;
  z-index: 40;
}

.filters-body {
  display: grid;
  grid-template-columns: 200px minmax(420px, 1fr);
  min-height: 280px;
  flex: 1;
  overflow: hidden;
}

.filters-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-right: 1px solid var(--border-soft);
  background: #fafbfc;
  overflow: auto;
}

.filters-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.filters-nav button:hover {
  background: #f0f4f8;
}

.filters-nav button.on {
  border-left-color: var(--ozon);
  background: #fff;
  font-weight: 650;
}

.app[data-marketplace='wildberries'] .filters-nav button.on {
  border-left-color: var(--wb);
}

.filters-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 14px 10px 10px 16px;
}

.ft-search {
  position: relative;
  margin-bottom: 10px;
  flex-shrink: 0;
  width: 100%;
  align-self: stretch;
}

.ft-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ft-search-ico svg {
  width: 16px;
  height: 16px;
  display: block;
}

.scope .ft-search input,
.filters-panel .ft-search input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  /* Важнонее .scope input — иначе padding 8px и иконка наезжает на текст */
  padding: 0 16px 0 48px !important;
  font: inherit;
  font-size: 15px;
  line-height: 44px;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
}

.ft-search input::placeholder {
  color: var(--muted);
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Убрать наложение крестика/иконки нативного search в WebKit */
.ft-search input[type='search']::-webkit-search-decoration,
.ft-search input[type='search']::-webkit-search-cancel-button,
.ft-search input[type='search']::-webkit-search-results-button,
.ft-search input[type='search']::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.ft-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
  padding-right: 4px;
}

.ft-empty {
  color: var(--muted);
  font-size: 15px;
  padding: 16px 8px;
}

.ft-node {
  --d: 0;
}

.ft-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding-left: calc(var(--d) * 20px);
}

.ft-chevron,
.ft-chevron-spacer {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
}

.ft-chevron:hover {
  background: #eef2f6;
}

.ft-chevron svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ft-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
  font-size: 15px;
  color: var(--text);
  user-select: none;
}

.ft-check.ft-flat {
  display: flex;
  padding: 8px 4px;
}

.ft-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ft-box {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid #b7c4d4;
  background: #e8f0ff;
  flex-shrink: 0;
  position: relative;
}

.ft-box.round {
  border-radius: 50%;
}

.ft-check input:checked + .ft-box {
  background: var(--ozon);
  border-color: var(--ozon);
}

.ft-check input:checked + .ft-box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.ft-check input:checked + .ft-box.round::after {
  left: 5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: none;
}

.ft-check input[data-indeterminate='1'] + .ft-box,
.ft-check input:indeterminate + .ft-box {
  background: #c5d8ff;
  border-color: var(--ozon);
}

.ft-check input[data-indeterminate='1'] + .ft-box::after,
.ft-check input:indeterminate + .ft-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  width: 10px;
  height: 3px;
  background: var(--ozon);
  border: 0;
  transform: none;
}

.app[data-marketplace='wildberries'] .ft-box {
  background: #fce8f7;
}

.app[data-marketplace='wildberries'] .ft-check input:checked + .ft-box {
  background: var(--wb);
  border-color: var(--wb);
}

.app[data-marketplace='wildberries'] .ft-check input:indeterminate + .ft-box,
.app[data-marketplace='wildberries'] .ft-check input[data-indeterminate='1'] + .ft-box {
  background: #f5c6ea;
  border-color: var(--wb);
}

.app[data-marketplace='wildberries'] .ft-check input:indeterminate + .ft-box::after,
.app[data-marketplace='wildberries'] .ft-check input[data-indeterminate='1'] + .ft-box::after {
  background: var(--wb);
}

.ft-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filters-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-soft);
  background: #fff;
  flex-shrink: 0;
}

.filters-actions {
  display: flex;
  gap: 10px;
}

.filters-actions .btn {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.btn.filter-apply {
  background: var(--ozon);
  color: #fff;
  border-color: var(--ozon);
}

.btn.filter-apply:hover {
  background: var(--ozon-hover);
  border-color: var(--ozon-hover);
}

.app[data-marketplace='wildberries'] .btn.filter-apply {
  background: var(--wb);
  border-color: var(--wb);
}

.app[data-marketplace='wildberries'] .btn.filter-apply:hover {
  background: var(--wb-hover);
  border-color: var(--wb-hover);
}

.filters-found {
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
}

.filters-found b {
  font-weight: 700;
}

.scope label.chk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
  user-select: none;
  white-space: nowrap;
  cursor: pointer;
}

.scope label.chk input {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1;
}

.wb-cmd.editing .cmds {
  justify-content: center;
}

.wb-cmd.editing .wb-cmd-end {
  margin-left: 0;
}

.focus-chips {
  display: none;
  gap: 4px;
  align-items: center;
}

.focus-chips.show {
  display: inline-flex;
  flex-shrink: 0;
  padding-right: 10px;
  margin-right: 2px;
  border-right: 1px solid var(--border-soft);
}

.focus-chips button {
  border: 0;
  background: #eef2f5;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.focus-chips button.on {
  background: var(--primary);
  color: #fff;
}

.kpi {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.kpi b {
  color: var(--text);
  font-weight: 700;
}

.wb-cmd-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.export-menu {
  position: relative;
}

.export-menu .export-caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  vertical-align: middle;
  opacity: 0.7;
}

.export-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 140px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 4px;
  z-index: 20;
}

.export-dropdown[hidden] {
  display: none;
}

.export-dropdown button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--text);
}

.export-dropdown button:hover {
  background: #eef2f5;
}

.export-dropdown a.export-dropdown-link,
.export-dropdown a[role='menuitem'] {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  box-sizing: border-box;
}

.export-dropdown a.export-dropdown-link:hover,
.export-dropdown a[role='menuitem']:hover {
  background: #eef2f5;
}

.export-dropdown button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 0 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn:hover {
  background: #f5f7f8;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.send {
  background: var(--mp);
  border-color: var(--mp);
  color: #fff;
}

.btn.send:hover {
  background: var(--mp-hover);
  border-color: var(--mp-hover);
}

.btn.send.ozon {
  background: #005bff;
  border-color: #005bff;
  color: #fff;
}

.btn.send.ozon:hover {
  filter: brightness(1.06);
}

#pricesPlannedCmds .prices-push-end {
  margin-left: auto;
}

.prices-cols-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.prices-cols-menu-wrap--end {
  margin-left: auto;
}

.prices-cols-gear {
  min-width: 34px;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 15px;
  line-height: 1;
}

.prices-cols-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: min(240px, calc(100vw - 24px));
  max-height: min(420px, 70vh);
  overflow: auto;
  background: var(--panel, #fff);
  border: 1px solid var(--border, #d8dee4);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(24, 36, 48, 0.18);
  padding: 8px;
}

.prices-cols-menu[hidden] {
  display: none !important;
}

.prices-cols-menu-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 6px 8px;
}

.prices-cols-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prices-cols-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text);
  user-select: none;
}

.prices-cols-item:hover {
  background: var(--row-hover, #f3f7fa);
}

.prices-cols-item input {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.prices-cols-menu-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft, #e8edf1);
}

.prices-cols-menu-actions .btn {
  flex: 1;
}

.prices-auto-action {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.prices-auto-action.is-on {
  color: var(--ok, #1a7f5a);
}

.prices-auto-action.is-off {
  color: var(--muted, #8a8f98);
}

.prices-timer-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
}

.prices-timer-ok {
  color: var(--ok, #1a7f5a);
}

.prices-timer-warn {
  color: var(--warn, #9a6b00);
}

.prices-timer-dead,
.prices-timer-off {
  color: var(--err, #c0392b);
}

.prices-timer-none {
  color: var(--muted, #8a8f98);
}

.btn.ai {
  background: var(--ai);
  border-color: var(--ai);
  color: #fff;
}

.btn.ai:hover {
  background: var(--ai-hover);
  border-color: var(--ai-hover);
}

.btn .btn-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}

.btn.soft {
  background: var(--ok-bg);
  border-color: #b7e5d5;
  color: var(--ok);
}

.btn.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.on:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-weight: 550;
}

.btn.ghost:hover {
  background: #eef2f5;
  color: var(--text);
}

.wb-work {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr 210px;
}

.wb-work.solo {
  grid-template-rows: 1fr;
}

.wb-work.solo.props-mode {
  grid-template-rows: 1fr;
}

.props-split {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(100px, 0.4fr) minmax(180px, 0.6fr) auto;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

/* Варианты: сверху товары (как свойства/названия), снизу состав */
.props-split.var-split {
  grid-template-rows: minmax(160px, 0.48fr) minmax(220px, 0.52fr);
}

.var-split .var-overview-head {
  flex-wrap: wrap;
  font-weight: 650;
  justify-content: flex-start;
  gap: 10px;
}

.var-split .var-overview-head .var-show-seg {
  margin-left: 0;
  order: 0;
}

.var-split .var-overview-head .props-pane-title {
  margin-right: 0;
  margin-left: 0;
  font-weight: 600;
  color: var(--muted);
}

.var-split .props-products.var-products {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-soft);
}

.var-split .props-products.var-products > .props-pane-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.var-split .var-workspace {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.var-split .var-workspace-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: color-mix(in srgb, var(--panel) 92%, #e8eef3);
}

.var-grid th.color,
.var-grid td.color,
.var-grid th.var-now,
.var-grid td.var-now,
.var-grid th.var-became,
.var-grid td.var-became {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Плавающая панель «Правила объединения» */
.var-float {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  min-width: 420px;
  min-height: 320px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.var-float-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-soft, var(--border));
  cursor: move;
  user-select: none;
}

.var-float-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.var-float-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.var-float-close:hover {
  background: #e2e8f0;
  color: var(--text);
}

.var-float-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 12px 14px;
  gap: 8px;
}

.var-float-top {
  flex-shrink: 0;
}

.var-float-bottom {
  flex-shrink: 0;
}

.var-float-section {
  margin-bottom: 10px;
}

.var-float-label {
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 4px;
  color: var(--text);
}

.var-float-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.var-float-kpi > div {
  padding: 6px 8px;
  border: 1px solid var(--border-soft, var(--border));
  border-radius: 4px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.var-float-kpi b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.var-float-kpi span {
  font-size: 10px;
  color: var(--muted);
}

.var-float-principle {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.35;
}

.var-float-scope {
  margin: 0 0 8px;
  font-size: 11px;
}

.var-float-bottom .var-rules-opts {
  margin-bottom: 0;
}

.var-float-actions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft, var(--border));
  display: flex;
  justify-content: flex-end;
}

.var-float-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 50%, #94a3b8 50%) no-repeat
    right 3px bottom 3px / 10px 10px;
}

.var-show-seg {
  display: inline-flex;
  gap: 2px;
  flex-wrap: wrap;
}

.var-show-seg button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.var-show-seg button.on {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
  font-weight: 600;
}

.var-rules-help {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.var-rules-help b {
  color: var(--text);
  font-weight: 650;
}

.var-rules-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  min-width: 0;
  margin-bottom: 0;
}

.var-rules-cols .var-rules-block {
  margin-bottom: 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.var-rules-cols .var-rules-label {
  flex-shrink: 0;
}

.var-rules-cols .var-chips {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}

.var-chip-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 2px 0 4px;
}

.var-chip-group-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.var-rules-cols .var-chip {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
}

.var-rules-cols .var-chip-label {
  flex: 1;
  min-width: 0;
}

.var-rules-cols .var-chip-count {
  flex-shrink: 0;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--muted);
  font-weight: 650;
}

.var-rules-cols .var-chip.on .var-chip-count {
  color: color-mix(in srgb, var(--primary, #2563eb) 70%, var(--muted));
}

.var-rules-cols .var-chip.is-empty .var-chip-count {
  opacity: 0.55;
}

.var-rules-cols .var-chip.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f1f5f9;
}

.var-rules-cols .var-chip.is-disabled input {
  cursor: not-allowed;
}

.var-rules-block {
  margin-bottom: 10px;
  min-width: 0;
}

.var-rules-label {
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 4px;
  color: var(--text);
}

.var-rules-label .meta {
  font-weight: 400;
  margin-left: 4px;
}

.var-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: none;
  overflow: visible;
}

.var-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 8px 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  color: var(--text);
}

.var-chip input {
  margin: 0;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  accent-color: var(--primary, #2563eb);
}

.var-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-chip-count {
  flex-shrink: 0;
}

.var-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-chip.on {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 45%, var(--border));
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, #fff);
}

.var-rules-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 4px;
}

.var-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.var-opt input {
  margin: 0;
  width: 13px;
  height: 13px;
  accent-color: var(--primary, #2563eb);
}

.var-opt.dim {
  opacity: 0.55;
  cursor: not-allowed;
}

#varFindCandidates {
  flex-shrink: 0;
  height: 30px;
  padding: 0 12px;
}

.var-split .var-groups {
  width: 100%;
  table-layout: fixed;
}

.var-split .var-groups thead th {
  text-align: left;
  padding: 7px 8px;
}

.var-split .var-groups tbody td {
  padding: 6px 8px;
}

.var-split .var-groups th,
.var-split .var-groups td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-split .var-groups th.num,
.var-split .var-groups td.num {
  width: 3rem;
  text-align: center;
}

.var-split .var-groups th.var-st,
.var-split .var-groups td.var-st {
  width: 11.5rem;
}

.var-split .var-groups th.color,
.var-split .var-groups td.color {
  width: 22%;
}

.var-split .var-groups th.sku,
.var-split .var-groups td.sku {
  width: 5.5rem;
}

.var-groups tr.var-st-cand {
  background: color-mix(in srgb, #f5a623 12%, #fff);
}

.var-groups tr.var-st-warn {
  background: color-mix(in srgb, #e8a317 8%, #fff);
}

.var-groups tr.sel {
  outline: 1px solid color-mix(in srgb, var(--primary, #2563eb) 55%, transparent);
  outline-offset: -1px;
  background: color-mix(in srgb, var(--primary, #2563eb) 8%, #fff);
}

.var-work-head {
  flex-shrink: 0;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border-soft, var(--border));
  background: var(--panel);
}

.var-work-title {
  font-weight: 650;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-work-legend {
  margin-top: 4px;
  font-size: 11px;
}

.var-cards-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px 10px;
}

.var-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1200px) {
  .var-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .var-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.var-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #f8f9fa;
  cursor: pointer;
  min-width: 0;
  user-select: none;
}

.var-card.off {
  background: #f1f3f5;
  opacity: 0.72;
}

.var-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.var-card-head input {
  margin: 0;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: var(--primary, #2563eb);
}

.var-card-brand {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.var-card-star {
  color: #856404;
}

.var-card-color {
  flex-shrink: 0;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: #e9ecef;
  color: var(--text);
}

.var-card-body {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.var-card-thumb {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  overflow: hidden;
  background: #e9ecef;
  border: 1px solid #dee2e6;
}

.var-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.var-card-thumb.empty {
  background: repeating-linear-gradient(
    -45deg,
    #eef1f4,
    #eef1f4 4px,
    #e5e9ed 4px,
    #e5e9ed 8px
  );
}

.var-card-title {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.var-card-art {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  cursor: copy;
}

.var-card-art:hover {
  color: var(--primary, #2563eb);
  text-decoration: underline;
}

.var-card-pg {
  margin-top: 4px;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #0d47a1;
  background: #e3f2fd;
  padding: 1px 5px;
  border-radius: 3px;
}

.var-card-inv {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
}

.var-work-ozon {
  flex-shrink: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--border-soft, var(--border));
  background: var(--panel);
}

.var-merge-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}

.var-merge-label input {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  flex: 1;
  min-width: 0;
}

.var-detail-empty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 13px;
}

.props-tech-bar {
  flex-shrink: 0;
  min-height: 22px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  background: #eef1f4;
  border-top: 1px solid var(--border-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: text;
}

.props-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-soft);
}

.props-pane:last-child {
  border-bottom: 0;
}

.props-pane-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  background: #f4f6f8;
  border-bottom: 1px solid var(--border-soft);
}

.props-pane-title {
  font-weight: 650;
}

.props-fetch-btn,
.props-edit-btn {
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.props-edit-btn.soft {
  background: #1a9f6b;
  border-color: #1a9f6b;
  color: #fff;
  font-weight: 650;
}

.props-edit-btn.soft:hover:not(:disabled) {
  background: #158a5c;
  border-color: #158a5c;
  filter: none;
}

.tnved-pane-head {
  flex-wrap: wrap;
}

.tnved-pane-head #tnvedSearch {
  min-width: 160px;
  flex: 1 1 140px;
  max-width: 280px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.tnved-pane-head .tnved-only-assigned {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted, #5c6570);
  user-select: none;
  white-space: nowrap;
  cursor: pointer;
  margin: 0 4px 0 2px;
}

.tnved-pane-head .tnved-only-assigned input {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary, #2563eb);
}

.wb-cmd .tnved-only-without {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #5c6570);
  user-select: none;
  white-space: nowrap;
  cursor: pointer;
  margin: 0 2px;
}

.wb-cmd .tnved-only-without input {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary, #2563eb);
}

.tnved-split .props-products table.grid,
.props-split .props-products table.grid {
  table-layout: fixed;
  width: 100%;
}

.tnved-split .props-products table.grid thead th,
.props-split .props-products table.grid thead th {
  text-align: center;
}

.tnved-split .props-products table.grid th.sku,
.tnved-split .props-products table.grid td.sku,
.props-split .props-products table.grid th.sku,
.props-split .props-products table.grid td.sku {
  width: 1%;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
  font-variant-numeric: tabular-nums;
}

.tnved-split .props-products table.grid th.num,
.tnved-split .props-products table.grid td.num {
  width: 1%;
  min-width: 2.2rem;
  padding-left: 6px;
  padding-right: 6px;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #6a7a88);
  font-weight: 600;
  font-size: 11px;
}

.tnved-split .props-products table.grid th.thumb,
.tnved-split .props-products table.grid td.thumb-cell,
.tnved-split .props-products table.grid th.check,
.tnved-split .props-products table.grid td.check,
.props-split .props-products table.grid th.thumb,
.props-split .props-products table.grid td.check {
  width: 1%;
  white-space: nowrap;
  padding-left: 8px;
  padding-right: 8px;
}

.tnved-split .props-products table.grid td.ozon-type,
.tnved-split .props-products table.grid td.ozon-cat,
.tnved-split .props-products table.grid td.ozon-sub,
.props-split .props-products table.grid td.name,
.props-split .props-products table.grid td.ozon-type,
.props-split .props-products table.grid td.ozon-cat,
.props-split .props-products table.grid td.ozon-sub {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.grid td.name-open-card {
  cursor: pointer;
}

/* Название ТН ВЭД — с переносом внутри ячейки, без наезда на «Код» */
.tnved-split .props-products table.grid th.name,
.tnved-split .props-products table.grid td.name,
.tnved-grid th.name,
.tnved-grid td.name {
  max-width: none !important;
  min-width: 12rem;
  width: auto;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
  vertical-align: top;
}

.tnved-grid thead th {
  text-align: center;
}

/* 10 цифр + padding не влезают в 88px col-resize — код вылезал на название */
table.grid.tnved-grid th.code,
table.grid.tnved-grid td.code {
  width: 8.5rem;
  min-width: 8.5rem;
  max-width: 11rem;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  padding-left: 8px;
  padding-right: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #154864;
}

.tnved-grid th.kiz,
.tnved-grid td.kiz {
  white-space: nowrap;
  padding-left: 6px;
  padding-right: 8px;
}

.tnved-grid td.ozon-type,
.tnved-grid td.ozon-cat,
.tnved-grid td.ozon-sub {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tnved-grid tbody tr {
  cursor: pointer;
}

/* Ресайз столбцов мышью */
table.grid.col-resizable {
  table-layout: fixed;
  width: 100%;
}

table.grid.col-resizable thead th {
  position: sticky;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.grid.col-resizable tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--panel, #fff);
}

table.grid.col-resizable tbody tr:hover td {
  background: var(--row-hover, #f3f7fa);
}

table.grid.col-resizable tbody tr.sel td {
  background: var(--row-sel, #e7f1f8);
}

table.grid.col-resizable thead th .col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
  user-select: none;
  touch-action: none;
}

table.grid.col-resizable thead th .col-resizer::after {
  content: '';
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
}

table.grid.col-resizable thead th:hover .col-resizer::after,
body.col-resizing table.grid.col-resizable thead th .col-resizer::after {
  background: rgba(21, 72, 100, 0.35);
}

body.col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.tnved-grid tbody tr.sel {
  background: #eef6ff;
  outline: 2px solid #5b9fd4;
  outline-offset: -2px;
}

.app[data-marketplace='wildberries'] .tnved-grid tbody tr.sel {
  background: #fce9f7;
  outline-color: #CB11AB;
}

.props-products tr.tnved-fill-active {
  background: #fff6d6 !important;
  box-shadow: inset 3px 0 0 #e6a800;
  animation: props-row-fill-active 0.55s ease;
}

.props-products tr.tnved-fill-done {
  background: #eaf8ef !important;
  box-shadow: inset 3px 0 0 #2f9e64;
  animation: props-row-fill-done 0.35s ease;
}

.app[data-marketplace='wildberries'] .props-products tr.tnved-fill-active {
  background: #fce9f7 !important;
  box-shadow: inset 3px 0 0 #CB11AB;
  animation: props-row-fill-active-wb 0.55s ease;
}

.app[data-marketplace='wildberries'] .props-products tr.tnved-fill-done {
  background: #f3e9f7 !important;
  box-shadow: inset 3px 0 0 #8b2a9b;
}

@keyframes props-row-fill-active {
  0% {
    background: #ffffff;
  }
  35% {
    background: #ffe08a;
  }
  100% {
    background: #fff6d6;
  }
}

@keyframes props-row-fill-active-wb {
  0% {
    background: #ffffff;
  }
  35% {
    background: #f5c6ea;
  }
  100% {
    background: #fce9f7;
  }
}

@keyframes props-row-fill-done {
  from {
    filter: brightness(1.06);
  }
  to {
    filter: none;
  }
}

/* Фокус «Название»: этапы ИИ + SEO */
.title-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  background: #eef1f6;
  color: #445;
}

.title-stage-chip.title-stage-facts {
  background: #eef2ff;
  color: #3a4a8a;
}

.title-stage-chip.title-stage-seo {
  background: #e8f4ff;
  color: #0b5cab;
  animation: title-stage-pulse 1.1s ease-in-out infinite;
}

.title-stage-chip.title-stage-ai {
  background: color-mix(in srgb, var(--ai) 18%, #fff);
  color: var(--ai);
  animation: title-stage-pulse 0.9s ease-in-out infinite;
}

.title-stage-chip.title-stage-check {
  background: #fff6d6;
  color: #8a6a00;
}

.title-stage-chip.title-stage-done {
  background: #eaf8ef;
  color: #1f7a45;
}

.title-stage-chip.title-stage-skip,
.title-stage-chip.title-stage-error {
  background: #fdecec;
  color: #a12828;
}

@keyframes title-stage-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.title-detail-grid {
  display: grid;
  gap: 12px;
  padding: 10px 12px 16px;
}

.title-detail-block {
  min-width: 0;
}

.title-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.title-detail-text {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.title-detail-desc {
  max-height: 140px;
  overflow: auto;
  color: #334;
}

.title-detail-draft .title-draft-hl {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.title-seo-hit {
  background: color-mix(in srgb, var(--ai) 22%, #fff);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.title-seo-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-seo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.title-seo-cap {
  font-size: 11px;
  color: var(--muted);
  min-width: 72px;
}

.title-seo-chip {
  display: inline-block;
  font-size: 12px;
  line-height: 1.3;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f0f3f8;
  color: #223;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-seo-chip.must {
  background: color-mix(in srgb, var(--ai) 14%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ai) 35%, transparent);
}

.title-seo-chip.want {
  background: #f4f6fa;
}

.title-seo-chip.seo-in-text {
  background: color-mix(in srgb, #1a7f4b 12%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #1a7f4b 40%, transparent);
}

.title-seo-chip.seo-miss {
  opacity: 0.55;
}

.desc-seo-hit-cap {
  font-weight: 500;
  margin-left: 4px;
}

.title-detail-empty,
.title-split .props-empty {
  padding: 24px 16px;
  color: var(--muted);
}

.title-products tr[data-title-stage='ai'] td.became,
.title-products tr[data-title-stage='seo'] td.became,
.desc-products tr[data-title-stage='ai'] td.became,
.desc-products tr[data-title-stage='seo'] td.became {
  position: relative;
}

.desc-products tr[data-title-stage='ai'] td.became::after,
.desc-products tr[data-title-stage='seo'] td.became::after,
.title-products tr[data-title-stage='ai'] td.became::after,
.title-products tr[data-title-stage='seo'] td.became::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    color-mix(in srgb, var(--ai) 14%, transparent) 50%,
    transparent 80%
  );
  background-size: 200% 100%;
  animation: desc-became-shimmer 1.1s ease-in-out infinite;
  pointer-events: none;
}

@keyframes desc-became-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Описание: скелетон / появление абзацев / подпись */
.desc-skel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 4px;
}

.desc-skel-line {
  height: 11px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    #e8ecf3 0%,
    #f5f7fb 45%,
    #e8ecf3 90%
  );
  background-size: 200% 100%;
  animation: desc-skel-shine 1.15s ease-in-out infinite;
}

.desc-skel-line:nth-child(1) {
  width: 92%;
  animation-delay: 0s;
}
.desc-skel-line:nth-child(2) {
  width: 78%;
  animation-delay: 0.08s;
}
.desc-skel-line:nth-child(3) {
  width: 88%;
  animation-delay: 0.16s;
}
.desc-skel-line:nth-child(4) {
  width: 64%;
  animation-delay: 0.24s;
}
.desc-skel-line:nth-child(5) {
  width: 72%;
  animation-delay: 0.32s;
}

@keyframes desc-skel-shine {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.desc-detail-draft-body {
  max-height: 320px;
  overflow: auto;
}

.desc-reveal {
  display: flex;
  flex-direction: column;
  gap: 0.85em;
}

.desc-para {
  margin: 0;
  opacity: 1;
  transform: none;
  white-space: pre-wrap;
  line-height: 1.45;
}

.desc-para.desc-para-pending {
  opacity: 0;
  transform: translateY(8px);
}

.desc-para.desc-para-in {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.desc-sign {
  margin-top: 0.15em;
  font-weight: 600;
  color: var(--ai);
}

.desc-sign.desc-para-in {
  animation: desc-sign-pop 0.45s ease;
}

@keyframes desc-sign-pop {
  0% {
    filter: brightness(1);
  }
  40% {
    filter: brightness(1.15);
    text-shadow: 0 0 0 color-mix(in srgb, var(--ai) 0%, transparent);
  }
  100% {
    filter: none;
  }
}

.desc-len-tick {
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

.desc-len-tick.is-ticking {
  color: var(--ai);
}

.title-seo-chip.desc-seo-pending {
  opacity: 0;
  transform: translateY(4px);
}

.title-seo-chip.desc-seo-in {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.desc-split .title-detail-desc.desc-detail-draft-body {
  max-height: 320px;
}

.title-grid td.title-len,
.title-grid td.title-seo,
.title-grid td.title-stage-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.props-edit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.props-grid tr.props-no-rule td.name,
.props-grid tr.props-no-rule td {
  color: var(--muted);
}

.props-grid tr.props-no-rule input[type='checkbox']:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.props-dict-cell {
  white-space: nowrap;
  width: 1%;
  text-align: center;
}

.props-group-row td,
.props-group-cell {
  background: #eef2f6;
  color: #3a4a5a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 7px 10px !important;
  border-top: 1px solid var(--border-soft, #e5e8ec);
  border-bottom: 1px solid var(--border-soft, #e5e8ec);
}

.props-fields {
  min-height: 0;
}

.props-dict-status {
  font-variant-numeric: tabular-nums;
}

.props-became {
  min-width: 160px;
  max-width: 280px;
}

.props-became-ai-vision {
  min-width: 280px;
  max-width: 520px;
  vertical-align: top;
}

.props-ai-vision-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
  font-size: 12px;
  max-height: 160px;
  overflow: auto;
  padding: 4px 0;
  cursor: pointer;
}

.props-ai-vision-row .name {
  white-space: nowrap;
}

.props-ai-vision-row {
  cursor: pointer;
}

.props-vision-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(24, 36, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.props-vision-view-card {
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel, #fff);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  padding: 18px 18px 14px;
}

.props-vision-view-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.props-vision-view-head .hint {
  margin: 0;
  color: var(--muted, #667);
  font-size: 12px;
}

.props-vision-view-text {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: 58vh;
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border-soft, #d5dbe3);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  color: inherit;
  background: #fff;
}

.props-vision-view-text:focus {
  outline: 2px solid color-mix(in srgb, #4d6bfe 35%, transparent);
  outline-offset: 1px;
}

.props-vision-view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.props-vision-view-spacer {
  flex: 1 1 auto;
}

.props-dict-select {
  display: block;
  width: 100%;
  max-width: 260px;
  height: 28px;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--border-soft, #d5dbe3);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.props-dict-select:disabled {
  opacity: 0.7;
  background: #f3f5f7;
}

.props-dict-select:focus {
  outline: 2px solid color-mix(in srgb, #005bff 35%, transparent);
  outline-offset: 1px;
}

.props-marking-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
}

.props-marking-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: #005bff;
  cursor: pointer;
}

.props-marking-val {
  font-variant-numeric: tabular-nums;
  color: #154864;
  font-weight: 650;
}

.props-became-marking {
  min-width: 110px;
}

.props-pick-group {
  margin-bottom: 12px;
  border: 1px solid var(--border-soft, #e5e8ec);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.props-pick-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #eef2f6;
  border-bottom: 1px solid var(--border-soft, #e5e8ec);
}

.props-pick-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #3a4a5a;
  margin: 0;
}

.props-pick-group-body {
  padding: 4px 0;
}

.props-pick-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(24, 36, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ai-photo-mode-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(24, 36, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ai-photo-mode-card {
  width: min(420px, 100%);
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  padding: 18px 18px 16px;
}

.ai-photo-mode-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}

.ai-photo-mode-hint {
  margin: 0 0 14px;
  color: var(--muted, #667);
  font-size: 13px;
}

.ai-photo-mode-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-photo-mode-actions .btn.is-current {
  outline: 2px solid var(--accent, #4d6bfe);
  outline-offset: 1px;
}

.ozon-send-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(24, 36, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ozon-send-card {
  width: min(480px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
}

.ozon-send-head {
  padding: 16px 18px 8px;
  border-bottom: 1px solid var(--border-soft, #e6e8ec);
}

.ozon-send-head h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.ozon-send-head .hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #667);
  line-height: 1.4;
}

.ozon-send-body {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ozon-send-check {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
}

.ozon-send-check em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted, #667);
  text-align: right;
}

.ozon-send-media-modes {
  margin: 0 0 4px 26px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ozon-send-media-modes.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.ozon-send-radio {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted, #556);
  cursor: pointer;
}

.ozon-send-hint {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted, #667);
}

.ozon-send-warn {
  margin: 4px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: #7a4a00;
  background: #fff6e8;
  border-radius: 8px;
}

.ozon-send-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border-soft, #e6e8ec);
}

.ozon-send-actions .btn.send {
  background: #005bff;
  color: #fff;
  border-color: #005bff;
}

.prices-params-card {
  width: min(420px, 100%);
}

.prices-params-body {
  gap: 6px;
}

.prices-params-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text, #222);
}

.prices-params-field .niches-num {
  width: 100%;
  max-width: 12rem;
}

.media-gen-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(24, 36, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.media-gen-confirm-card {
  width: min(440px, 100%);
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  padding: 18px 18px 16px;
}

.media-gen-confirm-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}

.media-gen-confirm-hint {
  margin: 0 0 14px;
  color: var(--muted, #667);
  font-size: 13px;
  line-height: 1.4;
}

.media-gen-confirm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 16px;
}

.media-gen-confirm-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted, #667);
}

.media-gen-confirm-grid select {
  font: inherit;
  font-size: 13px;
  color: inherit;
  padding: 6px 8px;
  border: 1px solid var(--border-soft, #dde3ea);
  border-radius: 8px;
  background: var(--panel, #fff);
}

.media-gen-confirm-span2 {
  grid-column: 1 / -1;
}

.media-gen-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.media-gen-confirm-actions a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.media-cost-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft, #dde3ea);
  border-radius: 10px;
  background: var(--bg-soft, rgba(0, 0, 0, 0.02));
}

.media-cost-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted, #667);
}

.media-cost-row strong {
  color: inherit;
  font-weight: 600;
  text-align: right;
}

.media-cost-total {
  font-size: 14px;
  color: inherit;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft, #dde3ea);
}

.media-cost-ok strong {
  color: #1a7f4b;
}

.media-cost-bad strong {
  color: #c62828;
}

.props-pick-window {
  width: min(520px, 100%);
  max-height: min(640px, 92vh);
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.props-pick-head {
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--border-soft);
}

.props-pick-head h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.props-pick-head .hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.props-pick-actions {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.props-pick-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
}

.props-pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.props-pick-row:hover {
  background: #f0f3f6;
}

.props-pick-row.disabled {
  color: var(--muted);
  cursor: default;
}

.props-pick-row.disabled:hover {
  background: transparent;
}

.props-pick-row.disabled .props-pick-name {
  color: var(--muted);
}

.props-pick-name {
  flex: 1;
  min-width: 0;
}

.props-pick-rule {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.props-pick-row:not(.disabled) .props-pick-rule {
  color: #198754;
  font-weight: 600;
}

.props-pick-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-soft);
  background: #f7f9fb;
}

.props-pane-body.table-wrap {
  /* переопределяем общий table-wrap, если он фиксирован */
  max-height: none;
}

.became-cell {
  color: var(--primary, #005bff);
  font-weight: 600;
}

.props-grid td:nth-child(2) {
  text-align: center;
  width: 40px;
  color: var(--muted);
}

.sup-status {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border-top: 1px solid var(--border-soft);
}

.suppliers-wb .wb-top-row {
  justify-content: space-between;
}

.suppliers-wb .ff-main.sup-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  background: var(--bg);
}

.sup-sima {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sup-cmd {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-wrap: wrap;
  align-items: flex-start;
}

.sup-filter-row {
  flex-basis: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
  position: relative;
  z-index: 6;
}

.sup-filter-row #supSearch {
  width: min(320px, 100%);
  min-width: 180px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: #fff;
  font: inherit;
  font-size: 13px;
}

.sup-discount {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sup-discount-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.sup-discount select {
  max-width: min(420px, 48vw);
  min-width: 200px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
}

.sup-exclude-owned {
  white-space: nowrap;
  font-size: 13px;
}

.sup-prices-grid th.sup-owned-th,
.sup-prices-grid td.sup-owned-td {
  white-space: nowrap;
  width: 1%;
}

.sup-row.in-owned {
  opacity: 0.55;
}

.suppliers-wb .filters-wrap {
  z-index: 8;
}

.suppliers-wb .ft-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
  font-size: 13px;
}

/* В Товарах чекбокс скрыт + .ft-box; здесь — нативные input */
.suppliers-wb .ft-check input {
  position: static;
  opacity: 1;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--ozon, #005bff);
}

.suppliers-wb .ft-check-label {
  line-height: 1.35;
}

.suppliers-wb .ft-check-label em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

/* Карточка товара (двойной клик в таблице Поставщики) */
.sup-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(24, 36, 48, 0.28);
}

.sup-card-window {
  position: fixed;
  min-width: 420px;
  min-height: 320px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  background: var(--panel, #fff);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sup-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-soft, #e5e8ec);
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.sup-card-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.3;
}

.sup-card-head .hint {
  margin: 0;
  font-size: 12px;
}

.sup-card-head .btn {
  cursor: pointer;
}

.sup-card-body {
  display: grid;
  grid-template-columns: minmax(180px, 34%) 1fr;
  gap: 16px;
  padding: 14px 16px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

.sup-card-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.sup-card-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f4f6f8;
  border-radius: 8px;
  border: 1px solid var(--border-soft, #e5e8ec);
}

.sup-card-photo-empty {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #f4f6f8;
  border-radius: 8px;
  color: var(--muted, #6b7785);
  font-size: 13px;
}

.sup-card-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sup-card-thumb {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.sup-card-thumb.on {
  border-color: var(--ozon, #005bff);
}

.sup-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sup-card-info {
  min-width: 0;
}

.sup-card-desc {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text, #1c2430);
}

.sup-card-link {
  margin: 0 0 12px;
  font-size: 13px;
}

.sup-card-fields {
  margin: 0;
  display: grid;
  gap: 0;
}

.sup-card-field {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 8px 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft, #eef1f4);
  font-size: 13px;
}

.sup-card-field dt {
  margin: 0;
  color: var(--muted, #6b7785);
  font-weight: 500;
}

.sup-card-field dd {
  margin: 0;
  word-break: break-word;
}

.sup-card-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border-soft, #e5e8ec);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.sup-card-resize {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 55%, #9aa5b1 55%, #9aa5b1 65%, transparent 65%),
    linear-gradient(135deg, transparent 70%, #9aa5b1 70%, #9aa5b1 80%, transparent 80%);
}

.sup-row {
  cursor: pointer;
}

@media (max-width: 720px) {
  .sup-card-body {
    grid-template-columns: 1fr;
  }
}

.suppliers-wb .ft-radio-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}

.suppliers-wb .ft-price {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 8px;
}

.suppliers-wb .ft-price-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.suppliers-wb .ft-price-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.suppliers-wb .ft-price-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.suppliers-wb .ft-price-field input {
  width: 100%;
  box-sizing: border-box;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.suppliers-wb .ft-price-field input:focus {
  outline: none;
  border-color: var(--ozon, #005bff);
}

.sup-mode-hint {
  flex-shrink: 0;
  margin: 0;
  padding: 6px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border-soft);
}

.sup-progress {
  flex-shrink: 0;
  padding: 10px 14px;
  background: var(--info-bg);
  border-bottom: 1px solid var(--border);
}

.sup-progress-text {
  font-size: 12.5px;
  color: var(--info);
  margin-bottom: 6px;
}

.sup-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(26, 106, 160, 0.15);
  overflow: hidden;
}

.sup-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--info);
  transition: width 0.25s ease;
}

.sup-progress-fill.indeterminate {
  width: 40%;
  animation: sup-progress-slide 1.1s ease-in-out infinite;
}

.wb-ensure-progress {
  margin: 0 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

@keyframes sup-progress-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(280%);
  }
}

.sup-table {
  flex: 1;
  min-height: 0;
  border-bottom: 0;
}

.sup-placeholder {
  padding: 20px 16px;
  max-width: 560px;
}

.sup-placeholder h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.kpi-file {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  min-width: 0;
  overflow: auto;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.props-pane-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* Тонкие полосы прокрутки — только когда контент не лезет */
.table-wrap,
.props-pane-body,
.wb-work,
.cp-table-wrap,
.sup-table,
.niches-table-panel .table-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 72, 100, 0.28) transparent;
}

.table-wrap::-webkit-scrollbar,
.props-pane-body::-webkit-scrollbar,
.wb-work::-webkit-scrollbar,
.cp-table-wrap::-webkit-scrollbar,
.sup-table::-webkit-scrollbar,
.niches-table-panel .table-wrap::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.table-wrap::-webkit-scrollbar-track,
.props-pane-body::-webkit-scrollbar-track,
.wb-work::-webkit-scrollbar-track,
.cp-table-wrap::-webkit-scrollbar-track,
.sup-table::-webkit-scrollbar-track,
.niches-table-panel .table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrap::-webkit-scrollbar-thumb,
.props-pane-body::-webkit-scrollbar-thumb,
.wb-work::-webkit-scrollbar-thumb,
.cp-table-wrap::-webkit-scrollbar-thumb,
.sup-table::-webkit-scrollbar-thumb,
.niches-table-panel .table-wrap::-webkit-scrollbar-thumb {
  background: rgba(21, 72, 100, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.table-wrap::-webkit-scrollbar-thumb:hover,
.props-pane-body::-webkit-scrollbar-thumb:hover,
.wb-work::-webkit-scrollbar-thumb:hover,
.cp-table-wrap::-webkit-scrollbar-thumb:hover,
.sup-table::-webkit-scrollbar-thumb:hover,
.niches-table-panel .table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(21, 72, 100, 0.4);
  background-clip: content-box;
}

.table-wrap::-webkit-scrollbar-corner,
.props-pane-body::-webkit-scrollbar-corner,
.wb-work::-webkit-scrollbar-corner,
.cp-table-wrap::-webkit-scrollbar-corner,
.sup-table::-webkit-scrollbar-corner,
.niches-table-panel .table-wrap::-webkit-scrollbar-corner {
  background: transparent;
}

table.grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.grid thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6f8;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.grid tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

table.grid tbody tr {
  cursor: pointer;
}

table.grid tbody tr:hover {
  background: var(--row-hover);
}

table.grid tbody tr.sel {
  background: var(--row-sel);
}

.sup-cat-grid mark.cat-match,
.cat-focus-grid mark.cat-match {
  background: #ffe08a;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.sup-cat-grid thead th,
.cat-focus-grid thead th,
.create-cat-grid thead th {
  text-align: center;
}

table.grid .check {
  width: 34px;
  text-align: center;
}

.sku {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #154864;
}

.name {
  max-width: none;
  min-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, #e8eef3, #d5dee6);
  overflow: hidden;
  flex-shrink: 0;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge.err {
  background: var(--err-bg);
  color: var(--err);
}
.badge.info {
  background: var(--info-bg);
  color: var(--info);
}
.badge.mute {
  background: #eef1f3;
  color: var(--muted);
}

.detail {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 0;
  background: #fbfcfd;
}

.detail > div {
  padding: 12px 14px;
  overflow: auto;
}

.detail-left {
  border-right: 1px solid var(--border);
}

.detail-head {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 0;
}

.detail-photo {
  width: 72px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, #e8eef3, #d5dee6);
  overflow: hidden;
}

.detail-photo.empty {
  opacity: 0.55;
}

.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-head-text {
  min-width: 0;
  flex: 1;
}

.detail-head-text .title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-head-text .meta {
  margin-bottom: 8px;
}

.detail-head-text .kv {
  grid-template-columns: 96px 1fr;
}

.detail h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail .title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail .meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0;
}

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 10px;
  font-size: 12px;
}

.kv dt {
  color: var(--muted);
  margin: 0;
}

.kv dd {
  margin: 0;
  font-weight: 600;
}

.boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  min-height: 70px;
}

.box label {
  display: block;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.box.became {
  border-color: #b7e5d5;
  background: #f3fbf8;
}

.draft-remarks-banner {
  margin: 0 12px 8px;
  padding: 8px 10px;
  border: 1px solid #f0d0d0;
  background: #fff8f8;
  border-radius: var(--radius-sm);
}

.draft-remarks-banner-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
}

.draft-remarks-banner-head strong {
  font-weight: 750;
}

.draft-remarks-banner-head span {
  color: var(--muted);
  font-size: 11px;
}

.draft-remarks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.draft-remark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid #f0c2c2;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  box-sizing: border-box;
}

.draft-remark.is-openable {
  cursor: pointer;
}

.draft-remark.is-openable:hover {
  border-color: #d98a8a;
  background: #fff5f5;
}

button.draft-remark:hover {
  border-color: #d98a8a;
  background: #fff5f5;
}

.draft-remark-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.draft-remark-fix {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.3;
  min-height: 0;
}

.draft-remark.warn {
  border-color: #e6d7a8;
  background: #fffdf6;
}

.draft-remark.info {
  border-color: #cfd8e6;
  background: #f7f9fc;
}

.draft-remark-tag-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.draft-remark-tag {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.draft-remark-count {
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.draft-remark-msg {
  color: var(--text);
  line-height: 1.35;
}

.draft-remark-extra {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.empty-table {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #1f2a36;
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: 360px;
  animation: toast-in 0.18s ease;
}

.toast.ok {
  background: #0e7a5f;
}
.toast.warn {
  background: #9a6b00;
}
.toast.err {
  background: #c0392b;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Settings window (modal) */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(24, 36, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.settings-window {
  width: min(980px, 100%);
  height: min(760px, 100%);
  min-width: 560px;
  min-height: 420px;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-window-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Settings */
.settings {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.settings-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.settings-top h1 {
  margin: 0;
  font-size: 18px;
}

.settings-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.settings-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.settings-tabs button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 550;
  user-select: none;
}

.settings-tabs button:hover {
  background: var(--row-hover);
}

.settings-tabs button.on {
  background: #d9ebf8;
  color: #154864;
  font-weight: 650;
}

.settings-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  max-width: 960px;
}

.settings-body label {
  display: block;
  margin: 12px 0 4px;
  font-size: 12.5px;
  font-weight: 600;
}

.settings-body label:first-child {
  margin-top: 0;
}

.settings-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.settings-input.mono,
.mono {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
}

.secret-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.secret-row .settings-input {
  flex: 1;
}

.path-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.path-row .settings-input {
  flex: 1;
  min-width: 0;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hint code {
  font-size: 11px;
  word-break: break-all;
}

.settings-layout-list {
  margin: 8px 0 12px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.settings-layout-list code {
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
}

.muted {
  color: var(--muted);
}

.settings-hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 18px 0;
}

.settings-subhead {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 550 !important;
}

.settings-split {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  min-height: 360px;
}

.settings-shop-list,
.settings-shop-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.settings-shop-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-shop-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-item {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shop-item small {
  color: var(--muted);
  font-size: 11px;
}

.shop-item:hover {
  background: var(--row-hover);
}

.shop-item.on {
  background: var(--row-sel);
  font-weight: 650;
}

.settings-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

.settings-check input {
  width: 16px;
  height: 16px;
}

/* Справочники WB / Ozon */
.dir-platform {
  margin-top: 14px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dir-platform-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dir-platform-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.dir-platform-head .hint {
  margin: 4px 0 0;
}

.dir-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.dir-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg);
  min-height: 96px;
}

.dir-card.ok {
  border-color: color-mix(in srgb, var(--ok, #2e7d32) 45%, var(--border));
}

.dir-card-actions {
  margin-top: 10px;
}

.tnved-probe {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.tnved-probe-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.tnved-probe-input {
  min-width: 140px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}

.dir-cards-catalog {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.dir-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.dir-card-status {
  font-size: 12px;
  white-space: nowrap;
}

.dir-card-meta {
  margin: 4px 0 0;
  font-size: 11px;
}

.dir-card-preview {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.35;
  max-height: 3.9em;
  overflow: hidden;
}

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}

.btn.primary {
  background: var(--mp);
  color: #fff;
}

.btn.primary:hover {
  background: var(--mp-hover);
}

.btn.secondary {
  background: #e8eef3;
  color: var(--text);
}

.btn.secondary:hover {
  background: #dbe4ec;
}

.btn.ghost {
  background: #f0f3f6;
  color: var(--text);
  padding: 7px 9px;
}

.btn.danger {
  background: var(--err-bg);
  color: var(--err);
}

/* Фулфилмент — партнёры */
.ff-wb .wb-top-row {
  justify-content: space-between;
}

.ff-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
}

.ff-layout.side-collapsed {
  grid-template-columns: 28px 1fr;
}

.ff-side {
  border-right: 1px solid var(--border);
  background: var(--panel);
  overflow: auto;
  padding: 10px;
  min-width: 0;
}

.ff-layout.side-collapsed .ff-side {
  display: none;
}

.ff-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ff-side-toggle {
  flex-shrink: 0;
  min-width: 28px;
  padding: 2px 6px !important;
  font-size: 16px;
  line-height: 1.2;
  color: var(--muted);
}

.ff-side-expand {
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
}

.ff-side-expand:hover {
  background: var(--row-hover);
  color: var(--text);
}

.ff-partner-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ff-partner-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
}

.ff-partner-item:hover {
  background: var(--row-hover);
}

.ff-partner-item.on {
  background: var(--row-sel);
  border-color: #c5d9e8;
}

.ff-partner-item .muted {
  font-size: 11px;
  color: var(--muted);
}

.ff-side-new {
  width: 100%;
  margin-top: 8px;
}

.ff-main {
  overflow: auto;
  padding: 12px 14px 20px;
  background: var(--bg);
}

.ff-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 960px;
}

.ff-form-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ff-form label,
.ff-returns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.ff-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.ff-file-row .hint {
  margin: 2px 0 0;
}

.ff-file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ff-file-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.ff-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ff-mp-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.ff-mp-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.ff-rate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}

.ff-discounts {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.ff-discounts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ff-discount-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ff-discount-table th,
.ff-discount-table td {
  padding: 4px 4px 4px 0;
  text-align: left;
}

.ff-discount-table th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.ff-returns {
  max-width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.ff-status {
  margin: 0;
  padding: 6px 14px 10px;
  font-size: 12px;
}

@media (max-width: 960px) {
  .ff-layout {
    grid-template-columns: 1fr;
  }
  .ff-rates,
  .ff-form-top,
  .ff-rate-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  /* Узкое окно (вкл. встроенный браузер): не прячем разделы — полоска сверху */
  .sidebar {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .side-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    width: max-content;
    min-width: 100%;
  }
  .side-nav button {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .detail {
    grid-template-columns: 1fr;
  }
  .wb-work {
    grid-template-rows: 1fr 260px;
  }
  .settings-split {
    grid-template-columns: 1fr;
  }
  .settings-window {
    min-width: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .settings-overlay {
    padding: 0;
  }
}

/* —— Анализ ниш (каркас) —— */
.niches-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  user-select: none;
}

.niches-check input {
  margin: 0;
}

.prices-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  user-select: none;
}

.prices-check input {
  margin: 0;
}

.scope label.prices-scheme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.scope label.prices-scheme select {
  min-width: 72px;
}

.prices-planned-grid .prices-thumb-cell {
  width: 40px;
  padding: 4px 6px;
  vertical-align: middle;
  text-align: center;
}

.prices-planned-grid .prices-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--border-soft);
  display: block;
  margin: 0 auto;
}

.prices-planned-grid thead th {
  text-align: center !important;
  vertical-align: middle;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #f3f6f8;
}

.prices-planned-grid thead th .prices-th-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  max-width: 100%;
}

.prices-planned-grid thead th.prices-th-center,
.prices-planned-grid thead th[data-col="index_forecast"],
.prices-planned-grid thead th[data-col="price_index"],
.prices-planned-grid thead th[data-col="index_ozon_min"] {
  text-align: center !important;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.prices-planned-grid thead th[data-col="index_forecast"] .prices-th-text,
.prices-planned-grid thead th[data-col="price_index"] .prices-th-text,
.prices-planned-grid thead th[data-col="index_ozon_min"] .prices-th-text {
  font-weight: 700;
  color: var(--text, #222);
}

.prices-planned-grid tbody td {
  background: var(--panel, #fff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
  vertical-align: middle;
}

.prices-planned-grid tbody tr:hover td {
  background: var(--row-hover, #f3f7fa);
}

.prices-planned-grid tbody tr.sel td {
  background: var(--row-sel, #e7f1f8);
}

.prices-planned-grid td.col-txt {
  text-align: left;
}

.prices-planned-grid td.prices-select-cell {
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.prices-planned-grid td.prices-name-cell {
  cursor: pointer;
}

.prices-planned-grid td.prices-thumb-cell,
.prices-planned-grid td.check {
  max-width: none;
  overflow: hidden;
}

.prices-row-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(24, 36, 48, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.prices-row-card {
  width: min(720px, 100%);
  max-height: min(860px, calc(100vh - 32px));
  background: var(--panel, #fff);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.prices-row-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-soft, #e5e8ec);
  flex-shrink: 0;
}

.prices-row-card-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.3;
}

.prices-row-card-head .hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #6b7785);
}

.prices-row-card-body {
  display: grid;
  grid-template-columns: minmax(140px, 28%) 1fr;
  gap: 16px;
  padding: 14px 16px;
  overflow: auto;
  min-height: 0;
  flex: 1;
}

.prices-row-card-media {
  min-width: 0;
}

.prices-row-card-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f4f6f8;
  border-radius: 8px;
  display: block;
}

.prices-row-card-photo-empty {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6f8;
  border-radius: 8px;
  color: var(--muted, #6b7785);
  font-size: 13px;
}

.prices-row-card-fields {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.prices-row-card-field {
  display: grid;
  grid-template-columns: minmax(7rem, 38%) 1fr;
  gap: 8px 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft, #eef1f4);
  font-size: 13px;
}

.prices-row-card-field dt {
  margin: 0;
  color: var(--muted, #6b7785);
  font-weight: 500;
}

.prices-row-card-field dd,
.prices-select-text {
  margin: 0;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.prices-row-card-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border-soft, #e5e8ec);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .prices-row-card-body {
    grid-template-columns: 1fr;
  }
}

.prices-planned-grid td.prices-index-cell {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  min-width: 0;
  overflow: hidden;
}

.prices-planned-grid td.prices-index-cell--forecast {
  border-right: 1px dashed var(--border-soft, #dde1e6);
}

.prices-planned-grid tbody tr td.prices-index-cell--now {
  background: #f7f8fa;
}

.prices-planned-grid tbody tr:hover td.prices-index-cell--now {
  background: #eef2f5;
}

.prices-planned-grid tbody tr.sel td.prices-index-cell--now {
  background: #e1ebf3;
}

.prices-index-badge {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  border: 1px solid transparent;
  text-align: center;
  box-sizing: border-box;
}

.prices-index-badge--super {
  color: #0b6e4f;
  background: #e8f7ef;
  border-color: #b7e4c7;
}

.prices-index-badge--green {
  color: #1a7f37;
  background: #eef8f0;
  border-color: #c6e6cc;
}

.prices-index-badge--yellow {
  color: #9a6700;
  background: #fff8e8;
  border-color: #f0d9a0;
}

.prices-index-badge--red {
  color: #cf222e;
  background: #fff0f0;
  border-color: #f0c0c4;
}

.prices-index-badge--none {
  color: var(--muted, #667);
  background: #f4f5f7;
  border-color: #e4e6ea;
  font-weight: 500;
}

.prices-planned-grid td.prices-bench-ok {
  color: #1a7f37;
}

.prices-planned-grid td.prices-bench-over {
  color: #9a6700;
}

.prices-planned-grid td.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.prices-planned-grid td.col-pct {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.prices-planned-grid td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Цены → Цены в кабинете */
.prices-cab-search {
  min-width: 220px;
  flex: 1 1 220px;
}
.prices-cab-search input {
  width: 100%;
  min-width: 180px;
}
.prices-cab-wrap {
  overflow: auto;
  width: 100%;
  max-height: calc(100vh - 220px);
  background: var(--panel, #fff);
  /* современная нижняя полоса прокрутки */
  scrollbar-width: thin;
  scrollbar-color: rgba(21, 72, 100, 0.42) rgba(15, 40, 60, 0.06);
}
.prices-cab-wrap::-webkit-scrollbar {
  height: 11px;
  width: 11px;
}
.prices-cab-wrap::-webkit-scrollbar-track {
  background: rgba(15, 40, 60, 0.05);
  border-radius: 999px;
  margin: 0 6px;
}
.prices-cab-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(
    90deg,
    rgba(21, 72, 100, 0.35),
    rgba(0, 91, 255, 0.45)
  );
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-width: 48px;
}
.prices-cab-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    90deg,
    rgba(21, 72, 100, 0.55),
    rgba(0, 91, 255, 0.65)
  );
  background-clip: padding-box;
  border: 2px solid transparent;
}
.prices-cab-wrap::-webkit-scrollbar-corner {
  background: transparent;
}
.prices-cabinet-grid {
  width: max-content !important;
  min-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: separate;
  border-spacing: 0;
}
.prices-cabinet-grid col.cab-col-name {
  width: 260px;
}
.prices-cabinet-grid col.cab-col-photo {
  width: 56px;
}
.prices-cabinet-grid col.cab-col-flex {
  width: 108px;
}
.prices-cabinet-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f6f8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
  vertical-align: bottom;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--muted, #5a6b78);
}
.prices-cabinet-grid thead tr.prices-cab-group th {
  top: 0;
  z-index: 3;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #667);
  border-bottom: 0;
  white-space: nowrap;
  padding: 8px 10px 4px;
  text-align: center;
  background: #eef2f5;
}
.prices-cabinet-grid thead tr:nth-child(2) th {
  top: 28px;
  box-shadow: 0 1px 0 var(--border, #dde3e8);
}
.prices-cabinet-grid tbody td {
  font-size: 13px;
  line-height: 1.35;
  vertical-align: top;
  padding: 10px;
  overflow: hidden;
  word-break: break-word;
  background: var(--panel, #fff);
}
.prices-cabinet-grid tbody tr:hover td {
  background: #f7fafc;
}
.prices-cabinet-grid .prices-cab-name {
  max-width: none;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text, #1a2430);
}
.prices-cabinet-grid .prices-cab-sku {
  font-size: 12px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted, #667);
}
.prices-cab-sub {
  font-size: 12px;
  color: var(--muted, #667);
  margin-top: 3px;
}
.prices-cab-dyn {
  font-size: 12px;
  margin-top: 3px;
  color: var(--muted, #667);
}
.prices-cab-dyn.up {
  color: #1a7f37;
}
.prices-cab-dyn.down {
  color: #c62828;
}
.prices-cabinet-grid td.col-num,
.prices-cabinet-grid td.col-pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: normal;
  font-size: 13px;
}
.prices-cabinet-grid td.col-txt {
  white-space: normal;
  font-size: 13px;
}
.prices-cabinet-grid td.prices-thumb-cell {
  width: 56px;
  text-align: center;
}
.prices-cabinet-grid .prices-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  display: inline-block;
}
.prices-cabinet-grid .prices-thumb--empty {
  width: 44px;
  height: 44px;
  background: var(--soft, #f0f2f5);
  border-radius: 6px;
  display: inline-block;
}
.prices-cabinet-grid .prices-index-badge {
  font-size: 12px;
  padding: 2px 7px;
  font-weight: 650;
}

/* Закреплённое наименование (+ фото) при горизонтальном скролле */
.prices-cabinet-grid thead tr.prices-cab-group th.prices-cab-sticky,
.prices-cabinet-grid thead tr:last-child th.prices-cab-sticky,
.prices-cabinet-grid tbody td.prices-name-cell {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
}
.prices-cabinet-grid thead tr:last-child th.prices-cab-sticky-photo,
.prices-cabinet-grid tbody td.prices-thumb-cell {
  position: sticky;
  left: 260px;
  z-index: 5;
  background: #fff;
  box-shadow: 6px 0 10px -6px rgba(15, 40, 60, 0.22);
}
.prices-cabinet-grid thead tr.prices-cab-group th.prices-cab-sticky {
  z-index: 8;
  background: #eef2f5;
  box-shadow: 6px 0 10px -6px rgba(15, 40, 60, 0.22);
}
.prices-cabinet-grid thead tr:last-child th.prices-cab-sticky {
  z-index: 7;
  background: #f3f6f8;
}
.prices-cabinet-grid thead tr:last-child th.prices-cab-sticky-photo {
  z-index: 7;
  background: #f3f6f8;
}
.prices-cabinet-grid tbody td.prices-name-cell {
  background: #fff;
}
.prices-cabinet-grid tbody tr:hover td.prices-name-cell,
.prices-cabinet-grid tbody tr:hover td.prices-thumb-cell {
  background: #f7fafc;
}

.niches-empty-row td {
  border: 0;
  padding: 48px 24px;
  text-align: center;
  vertical-align: middle;
}

.niches-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 420px;
  margin: 0 auto;
}

.niches-empty p {
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 550;
}

.niches-empty-sub {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: var(--muted) !important;
}

.niches-grid thead th {
  white-space: nowrap;
}

.niches-grid thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.niches-grid thead th.sorted {
  color: var(--text);
  font-weight: 700;
}

.niches-num {
  width: 88px;
  min-width: 72px;
}

.niches-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.niches-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.niches-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.niches-legend .tag-hot,
.tag-cell.tag-hot {
  background: #c3e6cb;
}

.niches-legend i.tag-hot {
  background: #c3e6cb;
}

.niches-legend i.tag-grow {
  background: #cfe2ff;
}

.niches-legend i.tag-open {
  background: #d1e7dd;
}

.tag-cell.tag-grow {
  background: #cfe2ff;
}

.tag-cell.tag-open,
.tag-cell.tag-buy {
  background: #d1e7dd;
}

.tag-cell.tag-buy {
  background: #e2f0d9;
}

.niches-grid tr.row-grow td:first-child,
.niches-grid tr.row-grow .tag-cell {
  box-shadow: inset 3px 0 0 #0d6efd;
}

.niches-grid tr.row-open td:first-child,
.niches-grid tr.row-open .tag-cell {
  box-shadow: inset 3px 0 0 #198754;
}

.niches-table-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex: 1;
  overflow: hidden; /* широкая таблица скроллится только в .table-wrap */
}

.niches-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.niches-filter-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.niches-filter-btn.has,
.niches-filter-btn.on {
  border-color: #005bff;
  color: #005bff;
  background: #eef4ff;
}

.app[data-marketplace='wildberries'] .niches-filter-btn.has,
.app[data-marketplace='wildberries'] .niches-filter-btn.on {
  border-color: var(--wb);
  color: var(--wb);
  background: #fce8f7;
}

.niches-table-toolbar input[type='search'],
.niches-table-toolbar #ozCatSearch,
.niches-table-toolbar #ozBsSearch {
  width: 220px;
  min-width: 160px;
  max-width: 320px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  box-sizing: border-box;
  outline: none;
}

.niches-table-toolbar input[type='search']:focus,
.niches-table-toolbar #ozCatSearch:focus,
.niches-table-toolbar #ozBsSearch:focus {
  border-color: #005bff;
  box-shadow: 0 0 0 2px rgba(0, 91, 255, 0.12);
}

.niches-table-toolbar > .oz-inline {
  height: 30px;
  gap: 6px;
}

.niches-table-toolbar > .oz-inline > span {
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

.niches-table-toolbar > .oz-inline input,
.niches-table-toolbar > .oz-inline .niches-num {
  width: 88px;
  min-width: 72px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  box-sizing: border-box;
}

.niches-table-toolbar .oz-more-panel {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.oz-more-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.oz-metric-panel {
  align-items: stretch;
  flex-direction: column;
}

.oz-metric-signal {
  margin-bottom: 2px;
}

.oz-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  width: 100%;
}

.oz-metric-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
}

.oz-metric-card.is-on {
  border-color: #94a3b8;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.oz-metric-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.oz-metric-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.oz-metric-card-bounds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.oz-metric-bound {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.oz-metric-bound:hover:not(:disabled) {
  color: var(--text);
}

.oz-metric-bound:disabled {
  cursor: default;
  text-decoration: none;
  opacity: 0.7;
}

.oz-metric-card-inputs {
  display: flex;
  gap: 6px;
}

.oz-metric-card-inputs .niches-num {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  box-sizing: border-box;
}

.oz-metric-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
}

.oz-more-panel .oz-inline {
  gap: 6px;
}

.oz-more-panel .oz-inline select,
.oz-more-panel .oz-inline input,
.oz-more-panel .niches-num,
.oz-more-panel #ozCatTag {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.oz-more-panel #ozCatTag {
  min-width: 140px;
}

.oz-group-picker {
  margin: 8px 0 4px;
  max-width: 720px;
}

.oz-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px 10px;
  max-height: 220px;
  overflow: auto;
  margin-top: 8px;
  padding-right: 4px;
}

.oz-group-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
}

.oz-group-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.oz-group-item.on {
  background: rgba(0, 91, 255, 0.08);
}

.oz-group-item input {
  margin: 0;
}

.niches-table-panel .table-wrap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.niches-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--text);
}

.niches-footer b {
  font-weight: 700;
}

.table-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-pager .table-page-btn {
  min-width: 28px;
  padding: 2px 8px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
}

.table-pager .table-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.kpi .table-pager {
  gap: 4px;
}

.niches-grid thead th[title] {
  cursor: help;
}

.tag-cell.tag-risk {
  background: #f8d7da;
}

.tag-cell {
  font-size: 11px;
  white-space: nowrap;
}

.niches-grid tr.row-hot td:first-child,
.niches-grid tr.row-hot .tag-cell {
  box-shadow: inset 3px 0 0 #28a745;
}

.niches-grid tr.row-pick td:first-child,
.niches-grid tr.row-pick .tag-cell {
  box-shadow: inset 3px 0 0 #005bff;
}

.niches-grid tr.row-risk td:first-child,
.niches-grid tr.row-risk .tag-cell {
  box-shadow: inset 3px 0 0 #dc3545;
}

.scope .niches-num,
.scope #ozCatSearch,
.scope #ozBsSearch,
.scope #ozCatTag {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  box-sizing: border-box;
}

.scope #ozCatSearch,
.scope #ozBsSearch {
  width: 180px;
  min-width: 140px;
}

/* Фильтры Ozon «Категории» (как data.ozon.ru) */
.oz-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.oz-filters-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.oz-top-row {
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.oz-session-row {
  flex: 0 1 auto;
  min-width: 0;
}

.oz-params-row {
  flex: 0 1 auto;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.oz-algo-seg {
  flex-wrap: wrap;
}

.oz-algo-seg button {
  font-size: 11px;
  padding: 0 8px;
}

.oz-chip-row {
  gap: 6px;
}

.oz-period {
  margin-left: 0;
}

.oz-chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.oz-chip:hover:not(:disabled) {
  border-color: #005bff;
  color: #005bff;
}

.oz-chip.on,
.oz-chip.has {
  border-color: #005bff;
  color: #005bff;
  background: #eef4ff;
}

.oz-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.oz-scenario-bar {
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.oz-scenario-wrap {
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.oz-scenario-caption {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.oz-scenario-row {
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
}

.oz-cat-level {
  margin: 0;
}

.oz-actions-row {
  flex: 0 0 auto;
  margin-left: auto;
  gap: 6px;
  flex-wrap: nowrap;
}

.oz-scenario {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.oz-scenario:hover {
  border-color: #005bff;
  color: #005bff;
}

.oz-scenario.on {
  border-color: #005bff;
  background: #eef4ff;
  color: #005bff;
}

.oz-prem {
  font-size: 10px;
  font-weight: 700;
  color: #8a6d3b;
  background: #fff3cd;
  border-radius: 999px;
  padding: 1px 6px;
}

.oz-scenario-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  max-width: 1100px;
}

.niches-grid {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

table.grid.col-resizable.niches-grid {
  table-layout: fixed;
}

/* Цены в кабинете: читаемая ширина + горизонтальный скролл */
.prices-cabinet-grid.niches-grid {
  width: max-content !important;
  min-width: 100% !important;
  table-layout: fixed !important;
}
.prices-cabinet-grid.niches-grid thead th,
.prices-cabinet-grid.niches-grid tbody td {
  white-space: normal;
  vertical-align: top;
}

.niches-grid thead th,
.niches-grid tbody td {
  white-space: nowrap;
  vertical-align: middle;
}

.niches-grid th.focus-col,
.niches-grid td.focus-col {
  background: #f0f6ff;
}

.niches-grid th.focus-col {
  box-shadow: inset 0 -2px 0 #005bff;
}

.niches-grid th.niches-num-cell,
.niches-grid td.niches-num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 10px;
  min-width: 5.5rem;
}

/* Недостающие товары — фото и длинные подписи столбцов */
.miss-grid th.miss-photo-cell,
.miss-grid td.miss-photo-cell {
  width: 52px;
  min-width: 52px;
  padding: 4px;
  text-align: center;
}
.miss-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
  background: #f0f2f5;
}
.miss-grid td.miss-text-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.miss-grid th[data-sort='price'],
.miss-grid th[data-sort='sales_day_rub'],
.miss-grid th[data-sort='sales_day_qty'],
.miss-grid th[data-sort='revenue_dyn'] {
  min-width: 7.5rem;
}

/* Оборот — самые длинные суммы, не сжимать */
.niches-grid th.niches-num-cell[data-sort='revenue'],
.niches-grid td.niches-num-cell.col-revenue {
  min-width: 9.5rem;
  padding-left: 12px;
  padding-right: 12px;
}

.niches-grid td.niches-name-cell {
  max-width: 200px;
  min-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 550;
}

.score-cell {
  width: 4.5rem;
  min-width: 4.5rem;
  max-width: 4.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.niches-grid td.niches-text-cell {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oz-cat-name-cell {
  min-width: 7rem;
  max-width: 11rem;
}

.niches-grid td.niches-name-cell a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}

.oz-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.oz-inline select,
.oz-inline input {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.oz-session-on {
  border-color: #1b7f3a !important;
  color: #1b7f3a !important;
  background: #eaf7ee !important;
}

.oz-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text);
}

.oz-progress-bar {
  width: 140px;
  height: 6px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
  flex-shrink: 0;
}

.oz-progress-bar i {
  display: block;
  height: 100%;
  background: #005bff;
  border-radius: 999px;
}

.wb-cmd .scope:has(.oz-filters) {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
  flex: 1 1 100%;
  width: 100%;
}

.wb-cmd:has(.oz-filters) {
  align-items: flex-start;
}

/* Popup дерева категорий */
.oz-cat-picker-pop {
  position: fixed;
  z-index: 80;
  background: #fff;
  border: 1px solid #98a2b3;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(24, 39, 75, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.oz-cat-layout {
  display: grid;
  grid-template-columns: 168px 1fr;
  height: 100%;
  min-height: 0;
}

.oz-cat-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-right: 1px solid var(--border);
  background: #fafbfc;
}

.oz-cat-side-btn {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.oz-cat-side-btn.on {
  background: #eef4ff;
  border-left-color: #005bff;
  color: #005bff;
}

.oz-cat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 10px 12px 12px;
}

.oz-cat-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  margin-bottom: 8px;
}

.oz-cat-search-ico {
  font-size: 13px;
  opacity: 0.7;
}

.oz-cat-search {
  flex: 1;
  border: 0;
  height: 34px;
  font: inherit;
  font-size: 13px;
  outline: none;
  background: transparent;
}

.oz-cat-crumb {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  min-height: 28px;
}

.oz-cat-crumb-btn,
.oz-cat-crumb-link {
  border: 0;
  background: transparent;
  color: #005bff;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 2px 4px;
}

.oz-cat-crumb-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.oz-cat-crumb-sep {
  color: var(--muted);
  padding: 0 2px;
}

.oz-cat-list {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 4px 0;
  min-height: 0;
}

.oz-cat-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.oz-cat-node {
  --d: 0;
}

.oz-cat-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px 3px calc(8px + var(--d) * 16px);
  min-height: 28px;
}

.oz-cat-row:hover {
  background: #f3f6fb;
}

.oz-cat-row.target-level {
  background: #eef6ff;
}

.oz-cat-row.target-level .oz-cat-name {
  font-weight: 600;
}

.oz-schema-hint {
  margin: 0 0 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted, #5b6573);
  background: #f3f6fb;
  border-radius: 6px;
}

.niches-grid.oz-schema-grid td.scheme-share-hi {
  font-weight: 650;
  color: #0b5cab;
}

.niches-grid tr.row-scheme-fbo td:first-child {
  box-shadow: inset 3px 0 0 #0b5cab;
}

.niches-grid tr.row-scheme-fbs td:first-child {
  box-shadow: inset 3px 0 0 #c45c1a;
}

.niches-legend i.tag-scheme-fbo,
.niches-legend i.tag-scheme-fbs {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.niches-legend i.tag-scheme-fbo {
  background: #0b5cab;
}

.niches-legend i.tag-scheme-fbs {
  background: #c45c1a;
}

.oz-cat-chevron,
.oz-cat-check,
.oz-cat-name {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}

.oz-cat-chevron {
  width: 22px;
  height: 22px;
  color: var(--muted);
  flex-shrink: 0;
}

.oz-cat-chevron.empty {
  cursor: default;
}

.oz-cat-check {
  width: 28px;
  font-size: 14px;
  flex-shrink: 0;
}

.oz-cat-name {
  flex: 1;
  text-align: left;
  font-size: 13px;
  padding: 2px 4px;
}

.oz-cat-footer {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
}

.oz-cat-footer .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.app[data-marketplace='wildberries'] .oz-chip:hover:not(:disabled),
.app[data-marketplace='wildberries'] .oz-chip.on,
.app[data-marketplace='wildberries'] .oz-chip.has {
  border-color: var(--wb);
  color: var(--wb);
}

.app[data-marketplace='wildberries'] .oz-chip.on,
.app[data-marketplace='wildberries'] .oz-chip.has {
  background: #fce8f7;
}

/* —— Отбор (Ozon) —— */
.oz-pick-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.oz-pick-scope-hint {
  margin: 6px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.oz-pick-check.ok {
  color: #1a7a3a;
}

.oz-pick-check.bad {
  color: #b42318;
}

.oz-pick-check.warn {
  color: #9a6700;
}

.oz-pick-verdict {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.oz-pick-verdict.tag-open {
  background: #e8f7ee;
  color: #1a7a3a;
}

.oz-pick-verdict.tag-grow {
  background: #fff6e0;
  color: #9a6700;
}

.oz-pick-verdict.tag-risk {
  background: #fdecea;
  color: #b42318;
}

.oz-pick-settings {
  flex-basis: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel, #fafafa);
}

.oz-pick-filter-panel {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  max-height: min(28vh, 240px);
  overflow: auto;
  margin: 0;
  align-items: stretch;
  flex-direction: column;
}

.oz-pick-table-panel .table-wrap {
  flex: 1 1 auto;
  min-height: 160px;
}

.oz-pick-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 8px;
}

.oz-pick-filter-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
}

.oz-pick-filter-field input,
.oz-pick-filter-field select {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 0 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.oz-pick-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.oz-pick-settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.oz-pick-settings-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 52rem;
}

.oz-pick-hint {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}

.oz-pick-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 24, 32, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.oz-pick-detail-window {
  width: min(1100px, 96vw);
  max-height: min(90vh, 860px);
  display: flex;
  flex-direction: column;
  background: var(--bg, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.oz-pick-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: default;
}

.oz-pick-detail-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.oz-pick-detail-head .hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.oz-pick-detail-tabs {
  margin: 8px 16px 0;
  align-self: flex-start;
}

.oz-pick-detail-body {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 16px;
}

.oz-pick-detail-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.oz-pick-detail-foot .hint {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
}

.oz-pick-detail-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.oz-pick-detail-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.oz-pick-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--muted);
}

.oz-pick-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.oz-pick-chip {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f3f4f6;
  border: 1px solid var(--border);
}

.oz-pick-why {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.45;
  font-size: 13px;
}

.oz-pick-detail-h {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 650;
}

.oz-pick-queries {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 13px;
  line-height: 1.4;
}

.oz-pick-alts-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 8px;
}

.oz-pick-detail-table {
  max-height: 48vh;
}

.oz-pick-json {
  margin: 0;
  padding: 12px;
  font-size: 12px;
  line-height: 1.35;
  background: #f6f7f9;
  border-radius: 8px;
  overflow: auto;
  max-height: 55vh;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Товары → Создать: диалог отбора от поставщика / из ниш */
.create-pick-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  background: rgba(24, 36, 48, 0.45);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
}

.create-pick-window {
  width: min(1280px, 100%);
  height: min(860px, 100%);
  background: var(--panel, #fff);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.create-pick-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border-soft, #e5e8ec);
  flex-shrink: 0;
}

.create-pick-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.create-pick-head .hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.create-pick-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft, #e5e8ec);
  flex-shrink: 0;
}

.create-pick-toolbar #cpSearch {
  min-width: 180px;
  flex: 1 1 160px;
  max-width: 280px;
}

.create-pick-toolbar .kpi {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.create-pick-body {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 0;
  min-height: 0;
  flex: 1;
}

.create-pick-filters {
  border-right: 1px solid var(--border-soft, #e5e8ec);
  overflow: auto;
  padding: 10px 12px 16px;
  background: #f7f8fa;
}

.cp-filter-block {
  margin-bottom: 14px;
}

.cp-filter-block select {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

.cp-filter-block .chk {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  font-size: 13px;
}

.cp-filter-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 6px;
}

.cp-filter-scroll {
  max-height: 160px;
  overflow: auto;
  padding-right: 4px;
}

.create-pick-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.cp-table-wrap {
  max-height: 100%;
}

.cp-row.in-create {
  opacity: 0.55;
}

.cp-row.in-create td {
  color: var(--muted);
}

.create-pick-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-soft, #e5e8ec);
  flex-shrink: 0;
}

.create-pick-foot .muted {
  font-size: 12px;
  color: var(--muted);
}

.create-pick-foot-end {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

@media (max-width: 860px) {
  .create-pick-body {
    grid-template-columns: 1fr;
  }

  .create-pick-filters {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft, #e5e8ec);
    max-height: 220px;
  }
}


/* ── Медиа (Aidentika) ─────────────────────────────────────────── */

.media-split .props-pane-body#mediaDetailBody,
.media-fields .props-pane-body {
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.media-split .props-pane-body#mediaDetailBody:has(.media-board-gallery) {
  overflow: hidden;
}

.media-board {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 1fr) minmax(200px, 0.9fr);
  gap: 0;
  min-height: 280px;
  height: 100%;
}

.media-col {
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border-soft);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-col:last-child {
  border-right: 0;
}

.media-col-head {
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
}

.media-content-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.media-mode-chip {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.media-mode-chip:hover {
  border-color: #9aa3ad;
}

.media-mode-chip.on {
  background: #1c2430;
  border-color: #1c2430;
  color: #fff;
}

.media-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.media-prompt {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  background: #fff;
}

.media-prompt-sm {
  min-height: 64px;
}

.media-row-between {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.media-muted {
  font-size: 11px;
  color: var(--muted);
}

.media-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.media-controls label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.media-controls select {
  height: 28px;
  min-width: 88px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  background: #fff;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-status {
  min-height: 16px;
  font-size: 11.5px;
  color: var(--muted);
}

.media-stub {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f6f8;
  border: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.media-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-ref-wrap {
  position: relative;
  width: 56px;
}

.media-ref-wrap .media-send-sw {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 30px;
  height: 17px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.media-ref-wrap .media-send-sw-knob {
  width: 13px;
  height: 13px;
}

.media-ref-wrap .media-send-sw.on .media-send-sw-knob {
  transform: translateX(13px);
}

.media-ref-wrap.send-off .media-ref {
  opacity: 0.55;
}

.media-ref {
  position: relative;
  display: block;
  width: 56px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #eef1f4;
  margin: 0;
}

.media-ref.on {
  border-color: #4d6bfe;
}

.media-ref input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.media-ref img,
.media-ref video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-ref span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.media-ref-ctx {
  position: fixed;
  z-index: 1300;
  min-width: 140px;
  padding: 4px;
  background: var(--panel, #fff);
  border: 1px solid var(--border-soft, #dde3ea);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.media-ref-ctx-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: #b42318;
}

.media-ref-ctx-item:hover {
  background: #fef3f2;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.media-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: #eef1f4;
  cursor: pointer;
}

.media-tile.gen {
  box-shadow: inset 0 0 0 1px rgba(77, 107, 254, 0.25);
}

.media-tile.on {
  border-color: #4d6bfe;
}

.media-tile img,
.media-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-tile-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 5px;
  font-size: 10px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  text-align: left;
}

.media-frame {
  flex: 1;
  min-height: 160px;
  border-radius: 10px;
  overflow: hidden;
  background: #eef1f4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-frame img,
.media-frame video {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.media-empty {
  padding: 16px 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.media-check-cell {
  white-space: nowrap;
}

.media-check {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 650;
  background: #e8ebef;
  color: var(--muted);
}

.media-check.on {
  background: #e7f6ee;
  color: #1a9f6b;
}

@media (max-width: 1100px) {
  .media-board {
    grid-template-columns: 1fr;
  }

  .media-col {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }
}
/* Gallery viewer + lightbox overrides */
.media-board-gallery {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 320px;
}

.media-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: #f7f8fa;
}

.media-board-gen {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 1fr);
  gap: 0;
  min-height: 280px;
  height: 100%;
}

.media-board-utp {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 1fr);
  gap: 0;
  min-height: 280px;
  flex: 1;
  min-width: 0;
}

.media-board-utp .media-col {
  border-right: 1px solid var(--border-soft);
}

.media-board-utp .media-col:last-child {
  border-right: 0;
}

.media-input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
  background: #fff;
}

.media-utp-preview {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f4f6f8;
  border: 1px solid var(--border-soft);
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
  min-height: 160px;
}

.media-utp-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(26, 159, 107, 0.12);
  color: #0f7a52;
  font-size: 12px;
  font-weight: 650;
}

.media-viewer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
  min-height: 0;
  flex: 1;
}

.media-viewer.media-viewer-3 {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.25fr) minmax(220px, 1fr);
  gap: 0;
  padding: 0;
  height: auto;
  min-height: 0;
  flex: 1;
  align-self: stretch;
}

.media-viewer-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-col-thumbs,
.media-col-stage,
.media-col-edit {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
}

.media-col-edit {
  border-right: 0;
  padding: 0 0 10px;
}

.media-col-thumbs {
  background: #f4f6f8;
}

.media-col-thumbs .media-col-head,
.media-col-edit .media-col-head {
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 650;
  border-bottom: 1px solid var(--border-soft);
  background: #eef1f4;
}

.media-col-thumbs .media-gallery-actions {
  flex-shrink: 0;
  padding: 8px;
  border-top: 1px solid var(--border-soft);
}

.media-col-stage {
  border-right: 1px solid var(--border-soft);
  background: #f7f8fa;
  align-items: center;
}

.media-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  max-height: none;
  width: 100%;
  margin: 0;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  padding: 10px 12px;
}

.media-stage-media {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.media-stage-foot {
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: #f7f8fa;
  border-top: 1px solid var(--border-soft);
}

.media-send-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.media-send-row-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
}

.media-send-row-studio {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 1px solid var(--border-soft, #dde3ea);
  border-radius: 8px;
  background: #f7f8fa;
  box-sizing: border-box;
}

.media-studio-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.media-studio-result .media-frame {
  min-height: 180px;
}

.media-send-sw {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #c5cad3;
  cursor: pointer;
  transition: background 0.15s ease;
}

.media-send-sw.on {
  background: #1a9f6b;
}

.media-send-sw:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.media-send-sw-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}

.media-send-sw.on .media-send-sw-knob {
  transform: translateX(16px);
}

.media-film-wrap {
  position: relative;
  min-width: 0;
  cursor: grab;
}

.media-film-wrap.dragging {
  opacity: 0.45;
}

.media-film-wrap.drag-over .media-film {
  border-color: #1a9f6b;
}

.media-film-wrap .media-send-sw {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 32px;
  height: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.media-film-wrap .media-send-sw-knob {
  width: 14px;
  height: 14px;
}

.media-film-wrap .media-send-sw.on .media-send-sw-knob {
  transform: translateX(14px);
}

.media-film.send-off,
.media-film-wrap.send-off .media-film {
  opacity: 0.42;
  filter: grayscale(0.35);
}

.media-stage-meta {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.media-stage-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.media-stage .media-muted {
  color: #5b6572;
  text-shadow: none;
  background: rgba(255, 255, 255, 0.88);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #1f2937;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.media-nav:hover {
  background: #fff;
}

.media-nav-prev { left: 8px; }
.media-nav-next { right: 8px; }

.media-filmstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
}

.media-filmstrip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  flex: 1;
  gap: 8px;
  padding: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  scroll-snap-type: none;
}

.media-filmstrip-grid .media-film-wrap {
  width: 100%;
}

.media-filmstrip-grid .media-film {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
}

.media-film {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  height: 112px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: #eef1f4;
  cursor: grab;
  scroll-snap-align: start;
}

.media-film:active { cursor: grabbing; }
.media-film.on { border-color: #4d6bfe; }
.media-film.main { box-shadow: inset 0 0 0 1px rgba(26, 159, 107, 0.55); }
.media-film.dragging { opacity: 0.45; }
.media-film.drag-over { border-color: #1a9f6b; }

.media-film img,
.media-film video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.media-film-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  text-align: center;
}

.media-col-edit .media-edit-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-top: 0;
  margin-top: 0;
  min-height: 0;
}

.media-prompt-edit {
  flex: 1;
  min-height: 140px;
  resize: none;
}

.media-edit-hint {
  line-height: 1.35;
}

.media-col-edit #mediaEditBtn {
  align-self: stretch;
  height: 36px;
}

@media (max-width: 1100px) {
  .media-viewer.media-viewer-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(240px, 1fr) auto;
  }

  .media-col-thumbs {
    grid-column: 1;
  }

  .media-col-stage {
    grid-column: 2;
    border-right: 0;
  }

  .media-col-edit {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-soft);
  }
}

.media-gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 12, 18, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px 64px;
}

.media-lb-body {
  max-width: min(1100px, 100%);
  max-height: 100%;
}

.media-lb-body img,
.media-lb-body video {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

.media-lb-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.media-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 34px;
  cursor: pointer;
}

.media-lb-prev { left: 16px; }
.media-lb-next { right: 16px; }

.media-lb-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .media-board-gen {
    grid-template-columns: 1fr;
  }
}
.media-board-gen .media-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--border-soft);
  margin-top: 4px;
}

.media-film.gen {
  box-shadow: inset 0 0 0 1px rgba(77, 107, 254, 0.45);
}

/* Продажи — таблица отправлений Ozon */
.sales-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 0 16px 8px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel);
}

.sales-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 8px 2px 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.sales-tab b {
  font-weight: 700;
  color: var(--text);
  margin-left: 4px;
}

.sales-tab:hover {
  color: var(--text);
}

.sales-tab.on {
  color: var(--text);
  border-bottom-color: var(--mp);
  font-weight: 600;
}

.sales-grid-ozon td {
  vertical-align: top;
  white-space: normal;
}

.sales-grid-ozon .sales-posting {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.sales-grid-ozon .thumb-cell {
  width: 44px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.sales-thumb {
  width: 40px;
  height: 40px;
}

.sales-thumb.empty {
  background: linear-gradient(145deg, #e8eef3, #d5dee6);
}

.sales-prod {
  min-width: 180px;
  max-width: 320px;
}

.sales-prod-meta {
  font-size: 12.5px;
  font-weight: 600;
  color: #154864;
}

.sales-prod-name {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sales-tariff {
  font-size: 12px;
  color: var(--muted);
  max-width: 140px;
}

.sales-deliv {
  min-width: 140px;
  max-width: 220px;
  font-size: 12.5px;
  line-height: 1.35;
}

.sales-deliv .muted {
  margin-top: 2px;
  font-size: 12px;
}

/* Закупки — поставщики, окна отгрузки */
.purch-wb .purch-main {
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.purch-supplier-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.purch-supplier-title strong {
  font-size: 15px;
}

.purch-schedule {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.purch-schedule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.purch-tz {
  margin-top: 2px;
  font-size: 12px;
}

.purch-schedule-now {
  font-size: 12.5px;
}

.purch-schedule-now b {
  font-weight: 650;
  color: var(--text);
}

.purch-cutoff {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.purch-cutoff.ok {
  color: var(--ok, #1a7f37);
}

.purch-cutoff.warn {
  color: var(--warn, #9a6700);
}

.purch-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}

.purch-badge.ok {
  color: var(--ok, #1a7f37);
  border-color: color-mix(in srgb, var(--ok, #1a7f37) 35%, var(--border));
  background: color-mix(in srgb, var(--ok, #1a7f37) 10%, var(--panel));
}

.purch-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.purch-schedule-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg);
}

.purch-schedule-days {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 8px;
}

.purch-schedule-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.purch-schedule-block li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.35;
}

.purch-until {
  font-weight: 650;
}

.purch-placeholder h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.purch-placeholder .hint {
  margin: 0;
}

.purch-grid td {
  vertical-align: top;
}

.purch-sale-id {
  font-weight: 650;
  font-size: 12.5px;
}

.purch-sale-name {
  font-size: 12px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.purch-arts {
  font-size: 12.5px;
  max-width: 200px;
  word-break: break-word;
}

.purch-st {
  font-size: 12px;
  font-weight: 650;
}

.purch-st.ok {
  color: var(--ok, #1a7f37);
}

.purch-st.info {
  color: var(--accent, #005bff);
}

.purch-st.err {
  color: var(--err, #c62828);
}

.purch-st.skip {
  color: var(--muted, #6b7280);
}

.purch-err {
  color: var(--err, #c62828);
  font-size: 12px;
  margin-top: 4px;
}

/* Auth / login */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8ecf2;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

.login-gate[hidden] {
  display: none !important;
}

.login-card {
  width: min(400px, calc(100vw - 32px));
  padding: 28px 28px 22px;
  background: #fff;
  border: 1px solid #d0d7e2;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(20, 30, 50, 0.08);
}

.login-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4d6bfe;
  margin-bottom: 8px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 650;
  color: #1a1f2c;
}

.login-hint {
  margin: 0 0 18px;
  font-size: 13px;
  color: #5c6578;
  line-height: 1.4;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #3a4254;
}

.login-field input {
  padding: 9px 11px;
  border: 1px solid #c5cdd9;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.login-error {
  margin: 0;
  color: #c62828;
  font-size: 13px;
}

.login-submit {
  margin-top: 4px;
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  background: #4d6bfe;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.login-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.login-legal {
  margin: 16px 0 0;
  font-size: 12px;
  text-align: center;
  color: #6b7280;
}

.login-legal a {
  color: #4d6bfe;
  text-decoration: none;
}

.secret-set {
  font-size: 11px;
  font-weight: 650;
  color: #1a7f37;
  white-space: nowrap;
  padding: 0 4px;
}

