.watch-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); border-radius: 5px;
  transition: color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.watch-btn:hover { color: #FF9500; transform: scale(1.15); }
.watch-btn.active { color: #FF9500; }
.watch-btn svg { width: 14px; height: 14px; }

/* Bell icon in header — база как Square / theme-trigger; Circle → themes.css, Glass → glass.css */
.bell-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: block;
  line-height: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text-secondary);
  position: relative;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-radius 0.2s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
}
.bell-btn::-moz-focus-inner {
  border: 0;
  padding: 0;
}
.bell-btn:hover { background: rgba(128,128,128,0.12); color: var(--text); }
.bell-btn svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  display: block;
  margin: 0;
  pointer-events: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.bell-badge {
  position: absolute; top: 3px; right: 3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #FF3B30; border: 1.5px solid var(--header-bg);
  display: none;
}
.bell-badge.show { display: block; }

/* Watchlist tab (legacy hook) */
.watch-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px; text-align: center;
}
.watch-empty svg { width: 36px; height: 36px; color: var(--text-tertiary); }
.watch-empty p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════
   Избранное — оболочка панели (шрифты = body / cabinet-header)
   ═══════════════════════════════════════════════════════════════════ */
.wl-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
#watchlist-panel .wl-shell {
  font-family: 'Segoe UI Variable', 'Segoe UI', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wl-shell__header {
  flex-shrink: 0;
}
.wl-shell__mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ff9500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 149, 0, 0.35);
}
.wl-shell__mark svg {
  width: 16px;
  height: 16px;
}
.wl-shell__titles {
  flex: 1;
  min-width: 0;
}
.wl-shell__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
  color: var(--text);
}
.wl-shell__subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.35;
}
.wl-shell__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px !important;
}
#watchlist-panel .wl-shell__scroll.cabinet-content {
  padding: 20px 24px 24px !important;
  gap: 0;
}

/* Square / Circle / Win11 по умолчанию: подложка под таблицей = --bg, чтобы .wl-v1 не сливался с панелью */
html[data-theme="light"][data-style="square"] #watchlist-panel .wl-shell__scroll.cabinet-content,
html[data-theme="light"][data-style="circle"] #watchlist-panel .wl-shell__scroll.cabinet-content,
html[data-theme="light"]:not([data-style]) #watchlist-panel .wl-shell__scroll.cabinet-content {
  background: var(--bg);
}
html[data-theme="dark"][data-style="square"] #watchlist-panel .wl-shell__scroll.cabinet-content,
html[data-theme="dark"][data-style="circle"] #watchlist-panel .wl-shell__scroll.cabinet-content,
html[data-theme="dark"]:not([data-style]) #watchlist-panel .wl-shell__scroll.cabinet-content {
  background: var(--bg);
}

.wl-root {
  min-width: 0;
}

/* ── Избранное: компактная таблица ── */
.wl-v1 {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg, var(--bg));
}
.wl-v1-table {
  display: block;
  width: 100%;
}
.wl-v1-row {
  display: grid;
  grid-template-columns:
    minmax(72px, 1.12fr)
    minmax(56px, 0.85fr)
    minmax(50px, 0.36fr)
    minmax(68px, 0.42fr)
    28px;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
  padding: 8px 10px 8px 12px;
  box-sizing: border-box;
  border-left: 3px solid rgba(142, 142, 147, 0.55);
  margin: 0;
}
.wl-v1-row--in {
  border-left-color: rgba(52, 167, 90, 0.85);
}
.wl-v1-row--out {
  border-left-color: rgba(224, 96, 80, 0.9);
}
.wl-v1-row--low {
  border-left-color: rgba(210, 140, 45, 0.9);
}
.wl-v1-row--unk {
  border-left-color: rgba(142, 142, 147, 0.55);
}
[data-theme="dark"] .wl-v1-row--in {
  border-left-color: rgba(90, 195, 120, 0.9);
}
[data-theme="dark"] .wl-v1-row--out {
  border-left-color: rgba(255, 120, 105, 0.85);
}
[data-theme="dark"] .wl-v1-row--low {
  border-left-color: rgba(230, 165, 70, 0.95);
}
[data-theme="dark"] .wl-v1-row--unk {
  border-left-color: rgba(120, 120, 128, 0.75);
}

/* Square / Circle / дефолт: полоска не теряется на фоне карточки (Glass — прежние мягкие rgba) */
html[data-theme="light"][data-style="square"] .wl-v1-row--in,
html[data-theme="light"][data-style="circle"] .wl-v1-row--in,
html[data-theme="light"]:not([data-style]) .wl-v1-row--in {
  border-left-color: #0d7a3d;
}
html[data-theme="light"][data-style="square"] .wl-v1-row--out,
html[data-theme="light"][data-style="circle"] .wl-v1-row--out,
html[data-theme="light"]:not([data-style]) .wl-v1-row--out {
  border-left-color: #c11f12;
}
html[data-theme="light"][data-style="square"] .wl-v1-row--low,
html[data-theme="light"][data-style="circle"] .wl-v1-row--low,
html[data-theme="light"]:not([data-style]) .wl-v1-row--low {
  border-left-color: #c27a1a;
}
html[data-theme="light"][data-style="square"] .wl-v1-row--unk,
html[data-theme="light"][data-style="circle"] .wl-v1-row--unk,
html[data-theme="light"]:not([data-style]) .wl-v1-row--unk {
  border-left-color: #5a5d63;
}
html[data-theme="dark"][data-style="square"] .wl-v1-row--in,
html[data-theme="dark"][data-style="circle"] .wl-v1-row--in,
html[data-theme="dark"]:not([data-style]) .wl-v1-row--in {
  border-left-color: #36d47a;
}
html[data-theme="dark"][data-style="square"] .wl-v1-row--out,
html[data-theme="dark"][data-style="circle"] .wl-v1-row--out,
html[data-theme="dark"]:not([data-style]) .wl-v1-row--out {
  border-left-color: #ff6b5e;
}
html[data-theme="dark"][data-style="square"] .wl-v1-row--low,
html[data-theme="dark"][data-style="circle"] .wl-v1-row--low,
html[data-theme="dark"]:not([data-style]) .wl-v1-row--low {
  border-left-color: #e8a84a;
}
html[data-theme="dark"][data-style="square"] .wl-v1-row--unk,
html[data-theme="dark"][data-style="circle"] .wl-v1-row--unk,
html[data-theme="dark"]:not([data-style]) .wl-v1-row--unk {
  border-left-color: #a1a1aa;
}
.wl-v1-tail {
  display: contents;
}
.wl-v1-row > .wl-v1-cell--name {
  grid-column: 1 / span 4;
  grid-row: 1;
  align-self: center;
  min-width: 0;
}
.wl-v1-row > .wl-v1-cell--sku {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  min-width: 0;
  display: flex;
  align-items: center;
}
.wl-v1-cell--sku .wl-v1-sku {
  min-width: 0;
  flex: 1 1 auto;
}
.wl-v1-row > .wl-v1-cell--dst {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  min-width: 0;
  justify-self: start;
}
.wl-v1-row > .wl-v1-cell--qty {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  justify-self: end;
}
.wl-v1-row > .wl-v1-cell--prc {
  grid-column: 4;
  grid-row: 2;
  align-self: center;
  justify-self: end;
}
.wl-v1-row > .wl-x {
  grid-column: 5;
  grid-row: 1;
  align-self: start;
  justify-self: end;
}
.wl-v1-body .wl-v1-row {
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}
.wl-v1-body .wl-v1-row:last-child {
  border-bottom: none;
}
.wl-v1-row:hover {
  background: rgba(128, 128, 128, 0.05);
}
.wl-v1-row--chg {
  background: rgba(255, 149, 0, 0.06);
}
.wl-v1-cell--qty {
  text-align: right;
  justify-self: end;
}

.wl-v1-cell--name {
  min-width: 0;
  display: block;
  line-height: 1.25;
  padding-right: 6px;
  box-sizing: border-box;
}
.wl-v1-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.wl-v1-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  min-height: 1.25em;
  max-height: 1.25em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-v1-title-wrap .wl-chg-mark {
  flex-shrink: 0;
}
.wl-v1-sku {
  font-size: 12px;
  font-weight: 650;
  font-family: ui-monospace, Menlo, 'SF Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  min-height: 1.25em;
  max-height: 1.25em;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wl-v1-sku.wl-v1-sku--copy:hover {
  color: var(--text);
}
.wl-v1-sku.wl-v1-sku--copy,
.wl-v1-meta-prc.wl-v1-prc--copy {
  cursor: pointer;
  user-select: none;
}
.wl-v1-meta-prc.wl-v1-prc--copy:hover {
  opacity: 0.88;
}
.wl-v1-sku.wl-v1-sku--copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.wl-v1-meta-prc.wl-v1-prc--copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Акценты нижнего ряда: количество · цена; дистрибьютор — как артикул */
.wl-v1-cell--qty {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.wl-qty {
  font-weight: inherit;
  font-variant-numeric: inherit;
}
.wl-qty--out {
  color: #c11f12;
}
[data-theme="dark"] .wl-qty--out {
  color: #ff6b5e;
}
.wl-qty--low {
  color: #a86828;
}
[data-theme="dark"] .wl-qty--low {
  color: #cf9b5a;
}
.wl-qty--in {
  color: #2f8f56;
}
[data-theme="dark"] .wl-qty--in {
  color: #6bbd86;
}
.wl-qty--na {
  color: var(--text-secondary);
}
.wl-v1-cell--prc {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.wl-v1-cell--dst {
  display: flex;
  align-items: center;
  min-width: 0;
}
.wl-v1-meta-prc {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  line-height: 1.2;
  color: #2f8f56;
}
.wl-v1-meta-prc.wl-v1-prc--dyn {
  color: var(--text-secondary);
  font-weight: 600;
}
.wl-v1-prc--dyn .wl-dyn {
  justify-content: flex-end;
}
.wl-dyn {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 5px;
  max-width: 100%;
  justify-content: flex-end;
}
.wl-v1-cell--qty .wl-dyn {
  justify-content: flex-end;
}
.wl-dyn-old {
  text-decoration: line-through;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.wl-dyn-sep {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 11px;
}
.wl-dyn-new--up {
  color: #34c759 !important;
  font-weight: 700 !important;
}
.wl-dyn-new--down {
  color: #ff3b30 !important;
  font-weight: 700 !important;
}
.wl-dyn-new--neu {
  color: var(--text) !important;
  font-weight: 700 !important;
}
.wl-v1-prc--dyn .wl-dyn-new--up {
  font-variant-numeric: tabular-nums;
}
.wl-v1-prc--dyn .wl-dyn-new--down,
.wl-v1-prc--dyn .wl-dyn-new--neu {
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .wl-dyn-new--up {
  color: #6bbd86 !important;
}
[data-theme="dark"] .wl-dyn-new--down {
  color: #ff6b5e !important;
}
[data-theme="dark"] .wl-v1-meta-prc {
  color: #6bbd86;
}
.wl-v1-meta-dst {
  display: block;
  max-width: 100%;
  font-size: 12px;
  font-weight: 650;
  font-family: ui-monospace, Menlo, 'SF Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  min-height: 1.25em;
  max-height: 1.25em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 520px) {
  .wl-v1-row {
    grid-template-columns: minmax(0, 1fr) 28px;
    grid-template-rows: auto auto;
    align-items: start;
  }
  .wl-v1-row > .wl-v1-cell--name {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  /* Строка 1: только наименование (до 2 строк) */
  .wl-v1-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 0;
    max-height: none;
    word-break: break-word;
  }
  /* Строка 2: партномер · количество · цена · дистрибьютор */
  .wl-v1-tail {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }
  .wl-v1-cell--sku {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
  }
  .wl-v1-cell--sku .wl-v1-sku {
    max-width: none;
  }
  .wl-v1-sku {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 1;
  }
  .wl-v1-cell--qty {
    justify-self: auto;
    text-align: left;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .wl-v1-cell--prc {
    flex: 0 0 auto;
    min-width: 0;
    justify-content: flex-start;
  }
  .wl-v1-meta-prc {
    white-space: nowrap;
  }
  .wl-v1-prc--dyn .wl-dyn,
  .wl-v1-cell--qty .wl-dyn {
    justify-content: flex-start;
  }
  .wl-v1-cell--dst {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
  }
  .wl-v1-meta-dst {
    min-width: 0;
    max-width: 100%;
  }
  .wl-v1-row > .wl-x {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }
}

/* Кнопка удаления */
.wl-x {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(128, 128, 128, 0.1);
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.wl-x:hover {
  background: rgba(255, 59, 48, 0.1);
  color: var(--text-secondary);
}
[data-theme="dark"] .wl-x:hover {
  background: rgba(255, 59, 48, 0.14);
  color: #ff9a94;
}
.wl-x svg {
  width: 10px;
  height: 10px;
}

.wl-chg-mark {
  text-decoration: none;
  color: #ff9500;
  font-weight: 700;
  cursor: help;
}

/* Пустое состояние (как макет: крупная тонкая звезда, два ряда подписи) */
.wl-zero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  min-height: 220px;
  padding: 32px 24px 40px;
  box-sizing: border-box;
}
.wl-zero__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin-bottom: 14px;
  color: var(--text-tertiary);
}
.wl-zero__h {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-secondary);
}
.wl-zero__p {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-secondary);
}
.wl-zero__p-line {
  display: block;
}
.wl-zero__p-line:first-child {
  white-space: nowrap;
}
@media (max-width: 380px) {
  .wl-zero__p-line:first-child {
    white-space: normal;
  }
}
.wl-zero__star {
  color: inherit;
  font-weight: inherit;
}

/* Legacy clear button */
.watch-clear-btn {
  width: 100%; height: 34px; border-radius: 6px;
  background: rgba(255,59,48,0.08); color: #FF3B30;
  border: 1px solid rgba(255,59,48,0.30);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, opacity 0.15s; font-family: inherit;
}
.watch-clear-btn:hover { background: rgba(255,59,48,0.14); }

/* Style packs */
[data-style="square"] .wl-v1 { border-radius: 8px; }
[data-style="square"] .wl-shell__mark { border-radius: 8px; }
[data-style="circle"] .wl-v1 { border-radius: 14px; }
[data-style="circle"] .wl-shell__mark { border-radius: 12px; }
[data-style="circle"] .watch-clear-btn { border-radius: 10px !important; font-size: 13px !important; }

/* Legacy hidden */
.watch-item { display: none; }
.watch-item__tag, .watch-item__changed, .watch-item__price, .watch-item__qty,
.watch-item__name, .watch-item__del, .watch-item__top, .watch-item__meta { display: none; }
