/* App-specific layout patches on top of tokens.css.
 * Keep this file thin — anything reusable belongs in tokens.css.
 */

/* Active variant of .chip — used by media-provider filter, country tabs etc. */
.chip--active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-border);
}

/* Login page: mirrors the-call-analyzer Tailwind login card. */
.tca-login-page {
  min-height: 100vh;
  margin: 0;
  background: #f8fafc;
  color: #0f172a;
  font-family: "Plus Jakarta Sans", sans-serif;
}
.tca-login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 16px;
}
.tca-login-wrap {
  width: 100%;
  max-width: 384px;
}
.tca-login-card {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.10),
    0 2px 4px -2px rgba(0, 0, 0, 0.10);
}
.tca-login-heading {
  margin: 0 0 24px;
  color: #1e293b;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0;
}
.tca-login-form {
  margin: 0;
}
.tca-login-form > * + * {
  margin-top: 16px;
}
.tca-login-label {
  display: block;
  margin: 0 0 4px;
  color: #334155;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.tca-login-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.tca-login-input::placeholder {
  color: #94a3b8;
}
.tca-login-input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: #2f69ff;
  box-shadow:
    0 0 0 2px rgba(47, 105, 255, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.05);
}
.tca-login-primary {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  background: #2f69ff;
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: background-color 150ms ease;
}
.tca-login-primary:hover {
  background: #1a56e8;
  color: #fff;
  text-decoration: none;
}
.tca-login-primary:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px rgba(47, 105, 255, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.05);
}
.tca-login-primary--disabled,
.tca-login-primary--disabled:hover {
  background: #cbd5e1;
  color: #64748b;
  cursor: default;
}
.tca-login-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 14px;
  line-height: 20px;
}
.tca-login-flash--error {
  border-color: #f43f5e;
  background: #fff1f2;
  color: #9f1239;
}

/* Two-column app shell: fixed sidebar + flex-1 main. */
.app-shell {
  display: flex;
  height: 100vh;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}
.app-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* Sidebar specifics. */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--border);
  background: var(--bg);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.sidebar-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
  font-weight: 500;
  padding: 0 6px;
  margin-top: 4px;
}
.sidebar .nav-item.active {
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 500;
}
.sidebar .nav-item.active svg {
  color: var(--text-muted);
}

/* Topbar. */
.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-13);
}
.crumbs > span,
.crumbs > a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.crumbs > a:hover {
  color: var(--text);
}
.crumbs > .crumbs-sep {
  color: var(--text-faint);
  display: inline-flex;
}
.crumbs > .crumbs-last {
  color: var(--text);
  font-weight: 500;
}

/* Export modal: destination cards + email chips, copied from TCA behavior
   and restyled to PIM tokens. */
.export-action-wrap {
  display: inline-flex;
  align-items: center;
}
.export-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(5px);
}
.export-modal__panel {
  width: min(640px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-panel);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.22), var(--shadow-pop);
}
.export-modal__head {
  position: relative;
  padding: 22px 26px 14px;
}
.export-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.export-modal__dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
}
.export-modal__head h2 {
  margin: 8px 40px 2px 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}
.export-modal__head p {
  margin: 0;
  color: var(--text-subtle);
  font-size: 13px;
  line-height: 1.45;
}
.export-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
}
.export-modal__close:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.export-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 26px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.export-banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: var(--r-pill);
}
.export-banner__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}
.export-banner__body span {
  color: var(--text-muted);
}
.export-banner--success {
  border-color: var(--ok-border);
  background: var(--ok-soft);
  color: var(--ok-text);
}
.export-banner--success .export-banner__icon {
  background: var(--ok);
  color: #fff;
}
.export-banner--error {
  border-color: var(--err-border);
  background: var(--err-soft);
  color: var(--err-text);
}
.export-modal__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 26px 16px;
}
.export-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.export-field > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.export-field > label span {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.export-destination-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.export-destination-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.export-destination-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.export-destination-card.is-active {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.export-destination-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: var(--r-lg);
}
.export-destination-card__icon--xlsx {
  background: var(--ok-soft);
  color: var(--ok-text);
}
.export-destination-card__icon--sheets {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.export-destination-card__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.export-destination-card__text b {
  font-size: 13px;
  line-height: 1.2;
}
.export-destination-card__text small {
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.3;
}
.export-email-box {
  display: flex;
  min-height: 42px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  cursor: text;
}
.export-email-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.export-email-box.is-error {
  border-color: var(--err-border);
}
.export-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 23px;
  padding: 2px 4px 2px 8px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12px;
}
.export-email-chip.is-bad {
  background: var(--err-soft);
  color: var(--err-text);
}
.export-email-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: currentColor;
  cursor: pointer;
}
.export-email-chip button:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.export-email-box input {
  min-width: 170px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.export-email-box input::placeholder {
  color: var(--text-faint);
}
.export-email-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 18px);
  z-index: 3;
  max-height: 200px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-pop);
}
.export-email-suggestions__title {
  padding: 4px 7px 6px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.export-email-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.export-email-suggestion:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.export-field__hint {
  min-height: 16px;
  color: var(--text-faint);
  font-size: 11.5px;
}
.export-field__hint.is-error {
  color: var(--err-text);
}
.export-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px 18px;
  border-top: 1px solid var(--divider);
  background: var(--bg);
}
.export-modal__note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 11.5px;
}
.export-modal__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.export-modal .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.export-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: var(--r-pill);
  animation: export-spin 0.7s linear infinite;
}
@keyframes export-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 720px) {
  .export-modal {
    align-items: flex-end;
    padding: 10px;
  }
  .export-destination-grid {
    grid-template-columns: 1fr;
  }
  .export-modal__footer {
    align-items: stretch;
    flex-direction: column;
  }
  .export-modal__actions {
    justify-content: flex-end;
  }
}

/* Toolbar (under topbar) for product list. */
.products-list-form {
  flex: 1 1 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-panel);
}

.toolbar {
  height: 44px;
  flex: 0 0 44px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toolbar .btn {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}
.toolbar .btn:hover,
.toolbar .btn:focus-visible {
  background: var(--bg-hover);
  color: var(--text);
}
.toolbar .input {
  height: 28px;
  border-color: transparent;
  background: var(--bg-subtle);
}
.toolbar .input:hover,
.toolbar .input:focus {
  background: var(--bg-panel);
  border-color: var(--border);
}

/* Баннер активного gap-фильтра — показывается над таблицей продуктов,
   когда пользователь пришёл из /gaps по ссылке «Открыть в списке». */
.active-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}
.active-filter-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.active-filter-chip {
  height: 20px;
  font-size: 11px;
  padding: 0 7px;
}

/* Product list split: table + right filter panel. */
.list-split {
  flex: 1 1 0;
  display: flex;
  width: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.list-table-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.products-table-shell {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.products-table-scroll {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--bg-panel);
}
.products-table {
  width: 100%;
  min-width: 1380px;
  table-layout: fixed;
}
.products-table th[data-sort-col="name"] {
  width: 42%;
  min-width: 320px;
}
.products-table thead th {
  height: 34px;
  background: var(--bg-panel);
  color: var(--text-subtle);
  border-bottom-color: var(--border);
}
.products-table thead th.sort-th:hover {
  background: var(--bg-hover);
}
.products-table thead th.is-sorted,
.products-table thead th.sort-th.is-sorted:hover {
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: inset 0 -1px 0 var(--border-strong);
}
.products-table tbody tr[data-slug] {
  cursor: pointer;
}
.products-table tbody td {
  height: 39px;
  padding: 0 10px;
}
.products-table tbody tr:hover {
  background: color-mix(in srgb, var(--bg-hover) 68%, transparent);
}
.products-table tbody tr.row-active {
  background: var(--bg-hover);
}
.products-table input[type="checkbox"],
.filter-panel input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--text-muted);
}
.product-thumb {
  width: 32px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
  background-color: var(--bg-subtle);
}
.product-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-meta {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.products-table .btn--icon {
  opacity: .72;
}
.products-table tr:hover .btn--icon,
.products-table .btn--icon:focus-visible {
  opacity: 1;
}
.products-table-chips {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.products-table-chip {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-panel {
  width: 320px;
  flex: 0 0 320px;
  border-left: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.filter-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filter-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filter-section:last-child { border-bottom: none; }

/* Wide products edit view. */
.products-edit-page {
  --products-edit-spec-row-h: 40px;
  --products-edit-spec-rows: 15;
  --products-edit-spec-grid-h: 670px;
  min-height: 100%;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
}
.products-edit-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 50px;
  background: var(--bg-panel);
  padding: 9px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.products-edit-search {
  position: relative;
  flex: 1 1 420px;
  min-width: 260px;
  max-width: 560px;
}
.products-edit-search > span {
  position: absolute;
  left: 9px;
  top: 8px;
  color: var(--text-faint);
  display: inline-flex;
}
.products-edit-search .input {
  height: 32px;
  padding-left: 30px;
  border-color: transparent;
  background: transparent;
  font-size: 12px;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.products-edit-search .input::placeholder {
  color: var(--text-faint);
}
.products-edit-search:hover .input,
.products-edit-search .input:focus {
  background: var(--bg-subtle);
}
.products-edit-toolbar .select {
  height: 32px;
  max-width: 210px;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.products-edit-toolbar .select:hover,
.products-edit-toolbar .select:focus {
  background: var(--bg-subtle);
  color: var(--text);
}
.products-edit-search .input:focus-visible,
.products-edit-toolbar .select:focus-visible {
  outline: none;
}
.products-edit-groups {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
}
.products-edit-group {
  border-bottom: 1px solid var(--divider);
  scroll-margin-top: 56px;
}
.products-edit-group__header {
  min-height: 38px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--divider);
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.products-edit-group__toggle {
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease);
}
.products-edit-group__toggle:hover,
.products-edit-group__toggle:focus-visible {
  background: var(--bg-subtle);
  outline: none;
}
.products-edit-group__chev {
  color: var(--text-faint);
  display: inline-flex;
  transition: transform var(--dur-fast) var(--ease);
}
.products-edit-group__chev.is-open {
  transform: rotate(90deg);
}
.products-edit-group__count {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}
.products-edit-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  background: var(--bg-panel);
}
.products-edit-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.products-edit-table th,
.products-edit-table td {
  border-right: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  padding: 5px 8px;
  vertical-align: top;
  background: var(--bg-panel);
}
.products-edit-table th {
  background: var(--bg-panel);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
  text-align: left;
  white-space: nowrap;
  border-bottom-color: var(--border);
}
.products-edit-table tbody tr:hover td {
  background: var(--bg-subtle);
}
.products-edit-table th:last-child,
.products-edit-table td:last-child {
  border-right: none;
}
.products-edit-table tbody tr:last-child td {
  border-bottom: none;
}
.products-edit-table__sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  box-shadow: 1px 0 0 var(--divider);
}
.products-edit-table th.products-edit-table__sticky {
  z-index: 6;
}
.products-edit-table__model-col {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
}
.products-edit-long-col {
  width: 500px;
  min-width: 500px;
}
.products-edit-specs-col {
  width: 980px;
  min-width: 980px;
}
.products-edit-table .is-col-hidden {
  display: none;
}
.products-edit-product {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 6px;
}
.products-edit-product__cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 168px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--text-faint);
  text-decoration: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur-fast) var(--ease);
}
.products-edit-product__cover:hover {
  border-color: var(--divider);
}
.products-edit-product__cover.is-empty {
  background: var(--bg-subtle);
}
.products-edit-product__cover-empty {
  color: var(--text-faint);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.2;
}
.products-edit-product__cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.products-edit-product__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.products-edit-identity-form {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 3px;
}
.products-edit-identity-input {
  min-width: 0;
  width: 100%;
  min-height: 26px;
  height: auto;
  padding: 4px 6px;
  border-color: transparent;
  background: transparent;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}
.products-edit-page .products-edit-identity-input {
  min-width: 0;
  width: 100%;
  min-height: 26px;
  height: auto;
  padding: 4px 6px;
  border-color: transparent;
  background: transparent;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}
.products-edit-identity-form .inline-input {
  padding-right: 6px;
}
.products-edit-identity-input:hover,
.products-edit-identity-input:focus {
  background: var(--bg-subtle);
}
.products-edit-identity-text {
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
}
.products-edit-page .products-edit-identity-text {
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
}
.products-edit-identity-input--name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.products-edit-page .products-edit-identity-input--name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.products-edit-identity-input--brand,
.products-edit-identity-input--slug {
  color: var(--text-muted);
  font-size: 11.5px;
}
.products-edit-page .products-edit-identity-input--brand,
.products-edit-page .products-edit-identity-input--slug {
  color: var(--text-muted);
  font-size: 11.5px;
}
.products-edit-identity-input--slug {
  font-family: var(--font-mono);
}
.products-edit-model__name {
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.3;
  font-weight: 500;
  overflow-wrap: anywhere;
  transition: color var(--dur-fast) var(--ease);
}
.products-edit-model__name:hover {
  color: var(--accent-text);
  text-decoration: none;
}
.products-edit-model__sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.products-edit-model__sub .chip {
  height: auto;
  max-width: none;
  min-height: 20px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.products-edit-product__meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.products-edit-product__meta .comp {
  max-width: none;
}
.products-edit-status-form {
  min-width: 0;
}
.products-edit-status-select {
  width: 100%;
  height: 28px;
  min-height: 28px;
  padding: 0 24px 0 7px;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.products-edit-status-select:hover,
.products-edit-status-select:focus {
  background: var(--bg-subtle);
  color: var(--text);
}
.products-edit-product__magnet {
  align-self: flex-start;
  width: fit-content;
}
.products-edit-product__short {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.products-edit-product__short-label {
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.1;
}
.products-edit-cell-form {
  margin: 0;
  position: relative;
}
.products-edit-cell-form .inline-input {
  padding-right: 22px;
}
.products-edit-input {
  height: 28px;
  min-width: 0;
  padding: 3px 6px;
  padding-right: 22px;
  border-radius: 4px;
  font-size: 12px;
  border-color: transparent;
  background: transparent;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.products-edit-input:hover {
  background: var(--bg-subtle);
  border-color: transparent;
}
.products-edit-input:focus,
.products-edit-inline-text:focus {
  box-shadow: none;
  border-color: var(--accent);
}
.products-edit-inline-text {
  min-height: 30px;
  height: auto;
  padding: 5px 7px;
  padding-right: 22px;
  border-radius: 4px;
  line-height: 1.42;
  font-size: 12px;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  border-color: transparent;
  background: transparent;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.products-edit-inline-text:hover {
  background: var(--bg-subtle);
  border-color: transparent;
}
.products-edit-inline-text:focus {
  background: var(--bg-panel);
}
.products-edit-long-cell {
  width: 500px;
  min-width: 500px;
  max-width: 500px;
}
.products-edit-long-cell .products-edit-inline-text {
  min-height: var(--products-edit-spec-grid-h);
}
.products-edit-inline-text--short {
  min-height: 44px;
}
.products-edit-cancel {
  position: absolute;
  top: 7px;
  right: 6px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.products-edit-cancel:hover,
.products-edit-cancel:focus-visible {
  background: var(--bg-hover);
  color: var(--text);
  outline: none;
}
.products-edit-cell-form.is-dirty .products-edit-cancel {
  opacity: 1;
  pointer-events: auto;
}
.products-edit-cell-form.is-saving .products-edit-cancel {
  opacity: 0;
  pointer-events: none;
}
.products-edit-cell-form.is-saving::after,
.products-edit-cell-form.is-saved::after,
.products-edit-cell-form.is-error::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--text-faint);
}
.products-edit-cell-form.is-saving::after {
  animation: products-edit-saving-pulse 900ms ease-in-out infinite;
}
.products-edit-cell-form.is-saved::after {
  background: var(--ok);
  animation: products-edit-saved-fade 900ms ease 250ms forwards;
}
.products-edit-cell-form.is-error::after {
  background: var(--err);
}
@keyframes products-edit-saving-pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}
@keyframes products-edit-saved-fade {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.6); }
}
.products-edit-json {
  display: block;
  max-width: 100%;
  color: var(--text-faint);
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.products-edit-readonly {
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-wrap;
}
.products-edit-readonly--long {
  position: relative;
  max-height: 120px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
}
.products-edit-specs-cell {
  width: 980px;
  min-width: 980px;
  max-width: 980px;
}
.products-edit-spec-grid {
  height: var(--products-edit-spec-grid-h);
  min-height: var(--products-edit-spec-grid-h);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-flow: column wrap;
  align-content: flex-start;
  gap: 5px 10px;
  padding: 1px 0 4px;
}
.products-edit-spec-tile {
  flex: 0 0 auto;
  width: 224px;
  min-width: 224px;
  max-width: 224px;
  min-height: var(--products-edit-spec-row-h);
  border-radius: 4px;
  display: grid;
  grid-template-columns: minmax(82px, .68fr) minmax(112px, 1fr);
  align-items: start;
  gap: 7px;
  padding: 3px 5px;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.products-edit-spec-tile[hidden] {
  display: none;
}
.products-edit-spec-tile:hover {
  background: var(--bg-hover);
}
.products-edit-spec-tile.is-empty {
  color: var(--text-faint);
}
.products-edit-spec-tile.is-empty .products-edit-readonly,
.products-edit-spec-tile.is-empty .products-edit-spec-tile__label {
  color: var(--text-faint);
}
.products-edit-spec-tile.is-empty:hover .products-edit-spec-tile__label,
.products-edit-spec-tile.is-empty:hover .products-edit-readonly {
  color: var(--text-muted);
}
.products-edit-spec-tile__label {
  min-width: 0;
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}
.products-edit-spec-tile__value {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.products-edit-spec-tile__value .products-edit-readonly {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.products-edit-spec-tile .products-edit-input {
  min-height: 28px;
  height: auto;
  padding-top: 3px;
  padding-bottom: 3px;
  font-size: 11.5px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: none;
  overflow: hidden;
}
.products-edit-spec-value-text {
  min-height: 28px;
}
.products-edit-spec-add {
  flex: 0 0 auto;
  width: 224px;
  min-width: 224px;
  max-width: 224px;
  min-height: var(--products-edit-spec-row-h);
  border-radius: 4px;
}
.products-edit-spec-add__toggle {
  width: 100%;
  min-height: var(--products-edit-spec-row-h);
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 5px;
  font-size: 11.5px;
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.products-edit-spec-add__toggle:hover,
.products-edit-spec-add__toggle:focus-visible {
  background: var(--bg-hover);
  color: var(--text-muted);
  outline: none;
}
.products-edit-spec-add__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  padding: 4px;
  border-radius: 4px;
  background: var(--bg-subtle);
}
.products-edit-spec-add__input {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  min-height: 26px;
  height: auto;
  padding: 4px 6px;
  border-color: transparent;
  background: var(--bg-panel);
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.35;
}
.products-edit-spec-add__value {
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
}
.products-edit-spec-add__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.products-edit-empty {
  padding: 80px 32px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.products-edit-empty > div {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
}
.products-edit-empty h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .products-edit-toolbar {
    flex-wrap: wrap;
    height: auto;
  }
  .products-edit-toolbar .select,
  .products-edit-search {
    flex: 1 1 100%;
    max-width: none;
  }
  .products-edit-table__model-col {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
  }
  .products-edit-long-col,
  .products-edit-long-cell {
    width: 420px;
    min-width: 420px;
    max-width: 420px;
  }
  .products-edit-specs-col,
  .products-edit-specs-cell {
    width: 720px;
    min-width: 720px;
    max-width: 720px;
  }
}

/* Tracker / sections / lineage / hero — generic spacing helpers. */
.section { margin-bottom: 36px; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 10px;
  margin-bottom: 14px;
  gap: 12px;
}
.section-title {
  margin: 0;
  font-size: var(--fs-16);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-sub {
  margin-top: 4px;
  font-size: var(--fs-12);
  color: var(--text-faint);
}

/* Stat tile (hero stats). */
.stat-tile {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-tile .label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
  font-weight: 500;
}
.stat-tile .value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-tile .unit {
  font-size: var(--fs-12);
  color: var(--text-muted);
  margin-left: 4px;
  font-family: var(--font-sans);
  font-weight: 400;
}

/* Lineage badge — small mono pill at the right of a spec field. */
.lineage {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.lineage .lineage-dot {
  width: 5px; height: 5px; border-radius: 50%;
}

/* Diagonal-stripe placeholder used for thumbnails / hero / media cards. */
.placeholder-stripes {
  background: repeating-linear-gradient(
    135deg,
    var(--bg-subtle) 0 6px,
    var(--bg-hover) 6px 12px
  );
}

/* Country tabs (Documents). */
.country-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}
.country-tabs > button {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  font-size: var(--fs-13);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.country-tabs > button:hover,
.country-tabs > button:focus-visible { color: var(--text); outline: none; }
.country-tabs > button.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--text);
}

/* Modal backdrop (for Cmd+K palette). */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(2px);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}
.palette-panel {
  width: 560px;
  max-width: 90vw;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.palette-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
}
.palette-header input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: var(--fs-14);
  color: var(--text);
}
.palette-results {
  max-height: 360px;
  overflow: auto;
  padding: 6px;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--fs-13);
  color: var(--text);
  transition: background-color var(--dur-fast) var(--ease);
}
.palette-item:hover,
.palette-item:focus-visible {
  background: var(--bg-subtle);
  outline: none;
}
.palette-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.palette-item.active .palette-sub {
  color: var(--accent-text);
  opacity: .75;
}
.palette-item .palette-sub {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}
.palette-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--divider);
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toast stack. */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
}
.toast {
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: 6px;
  font-size: var(--fs-13);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  min-width: 240px;
}

/* Scroll anchor offset so headings land below the topbar+banner. */
.section[id] { scroll-margin-top: 120px; }

/* ── Page-level helpers (Dashboard, Categories, Audit) ──────────────── */
.page-pad { padding: 24px 28px; max-width: 1200px; }
.page-intro { display: flex; flex-direction: column; gap: 4px; }
.page-title {
  margin: 0;
  font-size: var(--fs-20);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-13);
  max-width: 720px;
}
.muted-hint {
  font-size: var(--fs-12);
  color: var(--text-faint);
  margin-top: 2px;
}

/* Stat tile grids on Dashboard. */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.lifecycle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.slot-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slot-card-label {
  font-size: var(--fs-12);
  color: var(--text-muted);
  font-weight: 500;
}
.slot-card-pct {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.slot-card--linked,
.stat-tile--linked {
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.slot-card--linked:hover,
.stat-tile--linked:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border), var(--shadow-sm);
  transform: translateY(-1px);
}
.stat-tile--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border);
  background: var(--accent-soft);
}

/* Generic data table (Categories tree, Audit log). */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-13);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.data-table thead th {
  text-align: left;
  font-weight: 500;
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.data-table thead th.num,
.data-table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }

.crumbs-count {
  margin-left: 8px;
}

/* Storefronts reference page. */
.storefronts-add {
  margin-top: 18px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  overflow: hidden;
}
.storefronts-add__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-13);
  text-align: left;
  cursor: pointer;
  list-style: none;
}
.storefronts-add__toggle::-webkit-details-marker {
  display: none;
}
.storefronts-add__toggle:hover,
.storefronts-add__toggle:focus-visible,
.storefronts-add[open] > .storefronts-add__toggle {
  background: var(--bg-hover);
  color: var(--text);
  outline: none;
}
.storefronts-add__chev,
.storefronts-item__chev {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--text-faint);
  transition: transform var(--dur-fast) var(--ease);
}
.storefronts-add[open] .storefronts-add__chev,
.storefronts-item[open] .storefronts-item__chev {
  transform: rotate(90deg);
}
.storefronts-add__form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--divider);
  background: var(--bg-subtle);
}
.storefronts-derived {
  color: var(--text-muted);
}
.storefronts-derived > div {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  flex-wrap: wrap;
}
.storefronts-list {
  margin-top: 18px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  overflow: hidden;
}
.storefronts-item {
  border-bottom: 1px solid var(--divider);
}
.storefronts-item:last-of-type {
  border-bottom: 0;
}
.storefronts-item__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 9px 14px;
  cursor: pointer;
  list-style: none;
}
.storefronts-item__summary::-webkit-details-marker {
  display: none;
}
.storefronts-item__summary:hover,
.storefronts-item__summary:focus-visible,
.storefronts-item[open] > .storefronts-item__summary {
  background: var(--bg-hover);
  outline: none;
}
.storefronts-item__country {
  flex: 0 0 auto;
}
.storefronts-item__main {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.storefronts-item__title {
  color: var(--text);
  font-size: var(--fs-13);
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.storefronts-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--text-muted);
  font-size: var(--fs-11);
  line-height: 1.35;
}
.storefronts-item__usage {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--fs-11);
  line-height: 1.3;
  text-align: right;
}
.storefronts-item__link {
  color: var(--text-muted);
  text-decoration: none;
}
.storefronts-item__link:hover,
.storefronts-item__link:focus-visible {
  color: var(--text);
  text-decoration: underline;
  outline: none;
}
.storefronts-item__body {
  padding: 14px;
  border-top: 1px solid var(--divider);
  background: var(--bg-subtle);
}
.storefronts-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.storefronts-textarea {
  display: block;
  min-height: 30px;
  font-size: var(--fs-12);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  resize: none;
}
.storefronts-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}
.storefronts-form-actions--add {
  align-self: end;
  margin-top: 0;
}
.storefronts-status-toggle {
  display: inline-flex;
  align-items: center;
  width: max-content;
  font-size: var(--fs-12);
  cursor: pointer;
}
.storefronts-status-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.storefronts-status-toggle__on,
.storefronts-status-toggle__off {
  display: none;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-muted);
}
.storefronts-status-toggle input:checked ~ .storefronts-status-toggle__on,
.storefronts-status-toggle input:not(:checked) ~ .storefronts-status-toggle__off {
  display: inline-flex;
}
.storefronts-status-toggle:hover .storefronts-status-toggle__on,
.storefronts-status-toggle:hover .storefronts-status-toggle__off {
  background: var(--bg-hover);
  color: var(--text);
}
.storefronts-delete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.storefronts-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--text-muted);
  font-size: var(--fs-12);
}
.storefronts-empty {
  padding: 24px;
  background: var(--bg-panel);
  color: var(--text-muted);
  text-align: center;
}

.storefront-content-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.storefront-content-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  overflow: hidden;
}
.storefront-content-item.is-empty {
  border-style: dashed;
}
.storefront-content-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--divider);
}
.storefront-content-flag {
  display: flex;
  align-items: center;
}
.storefront-content-title {
  min-width: 0;
}
.storefront-content-title > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--text);
  font-size: var(--fs-13);
  font-weight: 500;
}
.storefront-content-filter {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--fs-11);
  font-weight: 400;
}
.storefront-content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: var(--fs-11);
}
.storefront-content-state {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  color: var(--text-muted);
  font-size: var(--fs-12);
}
.storefront-content-form {
  padding: 12px 14px 0;
}
.storefront-content-grid {
  display: grid;
  grid-template-columns: 130px 90px minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.storefront-content-link {
  min-width: 0;
}
.storefront-content-active {
  align-self: end;
  margin-bottom: 2px;
}
.storefront-content-description {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}
.storefront-content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px 12px;
}
.storefront-content-actions form {
  display: inline-flex;
}
.storefront-content-readonly {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  font-size: var(--fs-13);
}
.storefront-inline-grid {
  display: grid;
  grid-template-columns: 130px minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.storefront-inline-link {
  min-width: 0;
}
.storefront-inline-active {
  align-self: end;
  margin-bottom: 6px;
}
.storefront-inline-description {
  min-height: 34px;
  height: auto;
  resize: none;
  overflow: hidden;
}
.storefront-inline-delete {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.storefront-inline-delete form {
  display: inline-flex;
}

@media (max-width: 720px) {
  .storefront-content-head,
  .storefront-content-grid,
  .storefront-inline-grid {
    grid-template-columns: 1fr;
  }
  .storefront-content-state {
    justify-content: flex-start;
  }
  .storefront-content-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .storefront-content-actions .btn,
  .storefront-content-actions form {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .storefronts-item__summary {
    align-items: flex-start;
  }
  .storefronts-item__usage {
    display: none;
  }
  .storefronts-form-actions,
  .storefronts-form-actions--add {
    align-items: stretch;
    flex-direction: column;
  }
  .storefronts-form-actions .btn {
    justify-content: center;
    width: 100%;
  }
}

/* Audit action chip (color by tone). */
.audit-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: var(--fs-12);
  font-weight: 500;
  border: 1px solid transparent;
}
.audit-action--info  { background: var(--info-soft);  color: var(--info-text); }
.audit-action--ok    { background: var(--ok-soft);    color: var(--ok-text); }
.audit-action--warn  { background: var(--warn-soft);  color: var(--warn-text); }
.audit-action--err   { background: var(--err-soft);   color: var(--err-text); }
.audit-action--muted { background: var(--bg-subtle);  color: var(--text-muted); }

/* Audit section tabs: event log + field sources. */
.audit-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.audit-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: var(--fs-12);
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.audit-tab:hover,
.audit-tab:focus-visible { color: var(--text); background: var(--bg-hover); outline: none; }
.audit-tab.is-active {
  color: var(--accent-text);
  background: var(--accent-soft);
}

/* Media Library — tab bar (kind filter) + square-tile grid. */
.media-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.media-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: var(--fs-12);
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.media-tab:hover,
.media-tab:focus-visible { color: var(--text); background: var(--bg-hover); outline: none; }
.media-tab.is-active {
  color: var(--accent-text);
  background: var(--accent-soft);
}
.media-tab-count {
  font-size: 10.5px;
  color: inherit;
  opacity: 0.7;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.media-tile {
  aspect-ratio: 1 / 1;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  display: block;
}
.media-tile:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
}
.media-tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-tile-chips {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.media-tile-caption {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  background: var(--bg-panel);
  padding: 4px 6px;
  border-radius: var(--r-sm);
  font-size: 10.5px;
  line-height: 1.35;
}
.media-tile-product {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-tile-file {
  color: var(--text-faint);
  font-size: 9.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Документы: индикатор срока действия рядом с датой valid_until.
   Просроченный — красный (--err); истекает в ближайшие 90 дней — warn-tone. */
.doc-expiry--err  { color: var(--err); }
.doc-expiry--warn { color: var(--warn-text); }
.doc-expiry--ok,
.doc-expiry--muted { color: var(--text); }
.doc-expiry-hint {
  color: inherit;
  font-size: 10.5px;
  margin-left: 2px;
  opacity: 0.9;
}

/* Детальная страница: media-tile с hover-actions оверлеем (cover + trash) */
.detail-media-tile {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.detail-media-tile.is-cover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.detail-media-cover-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-size: 9.5px;
  z-index: 2;
}
.detail-media-make-cover {
  position: absolute;
  top: 6px;
  right: 6px;
  margin: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.detail-media-trash-wrap {
  position: absolute;
  bottom: 6px;
  right: 6px;
  margin: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.detail-media-tile:hover .detail-media-make-cover,
.detail-media-tile:hover .detail-media-trash-wrap {
  opacity: 1;
}
.detail-media-make-cover .btn {
  background: var(--bg-panel);
  font-size: 10px;
}
.detail-media-trash {
  background: var(--err);
  color: #fff;
  border-color: transparent;
}
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay[style*="display: none"],
.lightbox-overlay[style*="display:none"] {
  display: none !important;
}

/* Content Gaps dashboard — left slot-ranking + right detail pane. */
.gaps-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 1.15fr;
  gap: 20px;
  align-items: start;
}
.gaps-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.gaps-card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gaps-card-head--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gaps-slot-row {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  border-left: 3px solid transparent;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease);
}
.gaps-slot-row:hover { background: var(--bg-hover); }
.gaps-slot-row.is-selected {
  background: var(--bg-active, var(--bg-hover));
  border-left-color: var(--text);
}
.gaps-slot-row:last-child { border-bottom: none; }
.gaps-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gaps-slot-label { font-size: var(--fs-13); font-weight: 500; }
.gaps-slot-count {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
}
.gaps-slot-count--err   { color: var(--err); }
.gaps-slot-count--warn  { color: var(--warn-text); }
.gaps-slot-count--muted { color: var(--text-muted); }

.progress-fill--gap-err   { background: var(--err); }
.progress-fill--gap-warn  { background: var(--warn-text); }
.progress-fill--gap-muted { background: var(--accent-text, var(--info-text)); }

.gaps-detail { display: flex; flex-direction: column; }
.gaps-eyebrow {
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.gaps-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.gaps-summary { font-size: var(--fs-12); color: var(--text-muted); }

.gaps-cat-row,
.gaps-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-13);
  color: inherit;
  text-decoration: none;
}
.gaps-cat-row:last-child,
.gaps-model-row:last-child { border-bottom: none; }
.gaps-cat-row--linked,
.gaps-model-row { cursor: pointer; }
.gaps-cat-row--linked:hover,
.gaps-model-row:hover { background: var(--bg-hover); }
.gaps-cat-row--linked:hover > span:first-child {
  color: var(--accent-text);
  text-decoration: underline;
}
.gaps-model-name { font-weight: 500; font-size: var(--fs-13); }
.gaps-model-brand {
  font-size: var(--fs-11);
  color: var(--text-faint);
  margin-top: 2px;
}
.gaps-cat-more,
.gaps-empty {
  padding: 10px 16px;
  font-size: var(--fs-12);
  color: var(--text-faint);
  text-align: center;
}

.btn--sm { height: 24px; padding: 0 8px; font-size: var(--fs-12); }

/* Progress bar (Jobs pipelines, future: long-running tasks). */
.progress {
  flex: 1;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--text);
  transition: width 0.2s ease-out;
}
.progress-fill--running { background: var(--info-text); animation: pulse 1.5s ease-in-out infinite; }
.progress-fill--done    { background: var(--good-text); }
.progress-fill--failed  { background: var(--err); }
.progress-fill--queued  { background: var(--bg-hover); }

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.95; }
}

/* Read-only banner. */
/* Alpine x-cloak — скрывает элемент до инициализации Alpine. */
[x-cloak] { display: none !important; }

/* Specs rows hover — Notion-style подсветка. */
.spec-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2fr;
  gap: 14px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--divider);
  align-items: start;
  transition: background-color var(--dur-fast) var(--ease);
}
.spec-row:hover { background: var(--bg-hover); }
.spec-row:last-child { border-bottom: none !important; }
.spec-row__key {
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.35;
}
.spec-row__value {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  line-height: 1.4;
}
.spec-row__text {
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.spec-row__json {
  font-size: 11px;
  overflow-wrap: anywhere;
}

/* Specs accordion — Linear-inspired flat list. */
.specs-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-panel);
}
.specs-item { border-bottom: 1px solid var(--divider); background: var(--bg-panel); }
.specs-item:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.specs-item:last-child { border-bottom: none; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
.specs-item:first-child .specs-item__header { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.specs-item:last-child:not(.is-open) .specs-item__header { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }

.specs-item__header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: background-color var(--dur-fast) var(--ease);
}
.specs-item__header:hover,
.specs-item__header:focus-visible { background: var(--bg-hover); outline: none; }
.specs-item.is-open .specs-item__header { background: var(--bg-hover); }

.specs-item__chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  color: var(--text-faint);
  transition: transform var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.specs-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--dur-fast) var(--ease);
}
.specs-item.is-open .specs-item__icon { color: var(--accent); }

.specs-item__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0;
}

.specs-item__meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.specs-item { position: relative; }
.specs-item.is-menu-open { z-index: 60; }
.specs-item__bar {
  display: inline-block;
  width: 56px;
  height: 4px;
  background: var(--divider);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.specs-item__bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 200ms ease-out;
}
.specs-item__count {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}
.specs-item__count-total { color: var(--text-faint); }
.specs-item__blank-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn, #d97706);
  opacity: 0.7;
}

.specs-item__body {
  border-top: 1px solid var(--divider);
  background: var(--bg);
}
.specs-item__body .spec-row:last-child { border-bottom: none !important; }
.spec-icon-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex-wrap: wrap;
}
.spec-icon-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.spec-icon-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.spec-icon-choice span {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 6px;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}
.spec-icon-choice:hover span {
  color: var(--text);
  background: var(--bg-hover);
}
.spec-icon-choice input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.spec-icon-choice input:checked + span {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg);
}

@media (max-width: 720px) {
  .spec-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* notion-row hover menu */
.spec-row { position: relative; display: grid; grid-template-columns: minmax(160px, 40%) 1fr; gap: 12px; padding: 6px 8px; border-radius: 6px; }
.spec-row:hover { background: var(--bg-subtle); }
.spec-row.is-menu-open { z-index: 50; }
.spec-row.is-editing .spec-row__menu { display: none; }
.spec-row__key { color: var(--text-muted); cursor: text; }
.spec-row__key.is-editing,
.spec-row__value.is-editing { cursor: text; }
.spec-row__value { color: var(--text); cursor: text; min-width: 0; }
.spec-row__value .faint { color: var(--text-faint); }
.spec-row__value code.mono { cursor: default; }

.spec-row__menu { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity 80ms; }
.spec-row:hover .spec-row__menu,
.spec-row__menu.is-open { opacity: 1; }
.spec-row__menu-button { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; background: transparent; color: var(--text-muted); border-radius: 4px; cursor: pointer; }
.spec-row__menu-button:hover { background: var(--bg-hover); color: var(--text); }

.spec-row__menu-popover { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; }
.spec-row__menu-popover button { width: 100%; text-align: left; padding: 6px 10px; background: transparent; border: 0; border-radius: 4px; color: var(--text); cursor: pointer; font-size: 13px; }
.spec-row__menu-popover button:hover { background: var(--bg-hover); }
.spec-row__menu-popover .submenu-label { color: var(--text-faint); padding: 6px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

/* + Добавить поле */
.spec-row__add { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--text-faint); cursor: pointer; border-radius: 6px; }
.spec-row__add:hover { background: var(--bg-subtle); color: var(--text-muted); }
.spec-row__add svg { color: inherit; }

/* + Новая группа (внизу секции) */
.specs-group__add { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 8px; color: var(--text-faint); cursor: pointer; border-radius: 6px; }
.specs-group__add:hover { background: var(--bg-subtle); color: var(--text-muted); }
.specs-group__add input.input { flex: 1; min-width: 0; }

/* icon popover (общий) */
.icon-popover { position: absolute; z-index: 40; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 8px; }
.icon-popover__grid { display: grid; grid-template-columns: repeat(5, 28px); gap: 4px; }
.icon-popover__grid button { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--text-muted); border-radius: 4px; cursor: pointer; }
.icon-popover__grid button:hover,
.icon-popover__grid button.is-active { background: var(--bg-hover); color: var(--text); }

/* group header — hover-menu кнопка */
.specs-item__menu-button { opacity: 0; margin-left: 6px; }
.specs-item__header:hover .specs-item__menu-button,
.specs-item__menu-button.is-open { opacity: 1; }

/* Inline-ссылка в контентных местах — подчёркивание on-hover. */
.a-link { color: var(--text); text-decoration: none; }
.a-link:hover { color: var(--accent); text-decoration: underline; }
.a-faint { color: inherit; text-decoration: none; }
.a-faint:hover { color: var(--accent); text-decoration: underline; }

/* Column picker (Plytix Edit columns) + dynamic column hiding. */
.col-picker { position: relative; }
.col-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 240px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: 4px 0;
  z-index: 50;
}
.col-picker-header {
  padding: 8px 14px 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.col-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}
.col-picker-item:hover,
.col-picker-item:focus-visible { background: var(--bg-hover); outline: none; }
.col-picker-item input[type="checkbox"] { accent-color: var(--accent); }
.col-picker-footer {
  border-top: 1px solid var(--divider);
  padding: 6px 10px;
  margin-top: 4px;
}

/* Когда класс col-hide-X на table — скрываем все ячейки с data-col=X. */
.tbl.col-hide-completeness [data-col=completeness],
.tbl.col-hide-lifecycle [data-col=lifecycle],
.tbl.col-hide-brand [data-col=brand],
.tbl.col-hide-category [data-col=category],
.tbl.col-hide-country [data-col=country],
.tbl.col-hide-storefront [data-col=storefront],
.tbl.col-hide-updated [data-col=updated] { display: none; }

/* Saved views dropdown (Plytix selector слева от фильтров). */
.saved-view { position: relative; }
.saved-view-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 280px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: 4px 0;
  z-index: 50;
}
.saved-view-header {
  padding: 8px 14px 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.saved-view-item {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  transition: background-color var(--dur-fast) var(--ease);
}
.saved-view-item:hover,
.saved-view-item:focus-visible { background: var(--bg-hover); outline: none; }
.saved-view-item.is-active { background: var(--accent-soft); }
.saved-view-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.saved-view-hint {
  margin-left: 18px;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 1px;
}
.saved-view-footer {
  border-top: 1px solid var(--divider);
  padding: 6px 10px;
  margin-top: 4px;
}

/* Пустое состояние внутри секции — подсказка для контент-менеджера. */
.empty-hint {
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.empty-hint code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--bg-panel);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.readonly-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-border);
  color: var(--warn-text);
  padding: 8px 20px;
  font-size: var(--fs-12);
}
.readonly-banner b { font-weight: 600; }
.readonly-banner .btn { background: var(--bg-panel); }

/* Subnav banners (used by Magnet Catalog etc — sits under topbar, above content) */
.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: var(--fs-12);
  border-bottom: 1px solid transparent;
}
.banner--warn { background: var(--warn-soft); color: var(--warn-text); border-bottom-color: var(--warn-border); }
.banner--info { background: var(--info-soft); color: var(--info-text); border-bottom-color: var(--info-border); }
.banner--err  { background: var(--err-soft);  color: var(--err-text);  border-bottom-color: var(--err-border); }
.banner code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 3px;
}

/* Magnet section tabs (Catalog / Linker) — sits directly under topbar */
.magnets-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.magnets-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 10px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-size: var(--fs-13);
  font-weight: 500;
  margin-bottom: -1px;
}
.magnets-tab:hover { color: var(--text); }
.magnets-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--text);
}
.magnets-tab-count {
  font-size: 10.5px;
  color: var(--text-faint);
  padding: 1px 6px;
  background: var(--bg-subtle);
  border-radius: var(--r-pill);
}

/* Magnet catalog toolbar (search + brand + count) */
.magnets-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.magnets-search { position: relative; flex: 1; max-width: 480px; }
.magnets-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  display: inline-flex;
}
.magnets-search-input { padding-left: 30px; width: 100%; }
.magnets-toolbar-count {
  margin-left: auto;
  font-size: var(--fs-12);
  color: var(--text-muted);
}

/* ── Data Lineage ─────────────────────────────────────────────────── */
.lineage-shell {
  display: flex;
  height: 100%;
  min-height: 0;
}
.lineage-picker {
  width: 280px;
  flex: 0 0 280px;
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lineage-picker-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lineage-picker-list { overflow-y: auto; flex: 1; }
.lineage-picker-item {
  display: block;
  padding: 8px 14px;
  border-bottom: 1px solid var(--divider);
  border-left: 2px solid transparent;
  text-decoration: none;
  color: inherit;
}
.lineage-picker-item:hover,
.lineage-picker-item:focus-visible { background: var(--bg-hover); outline: none; }
.lineage-picker-item.is-selected {
  background: var(--bg-active);
  border-left-color: var(--text);
}
.lineage-picker-item.is-selected .lineage-picker-item-name { font-weight: 600; }
.lineage-picker-item-name { font-size: 12.5px; }
.lineage-picker-item-brand { font-size: 10.5px; color: var(--text-faint); margin-top: 1px; }

.lineage-body {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 24px 32px;
}
.lineage-sources {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.lineage-source {
  display: block;
  padding: 10px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  text-decoration: none;
  color: inherit;
}
.lineage-source:hover { background: var(--bg-hover); }
.lineage-source.is-active { border-color: transparent; }
.lineage-source-label {
  font-size: 9.5px;
  font-family: var(--font-mono);
  letter-spacing: .02em;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.lineage-source-count {
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text);
}
/* Tonal variants — `--ok/accent/warn/info/mint/muted` */
.lineage-source--ok     { --tone: var(--ok-text);    --tone-soft: var(--ok-soft); }
.lineage-source--accent { --tone: var(--accent-text); --tone-soft: var(--accent-soft); }
.lineage-source--warn   { --tone: var(--warn-text);  --tone-soft: var(--warn-soft); }
.lineage-source--info   { --tone: var(--info-text);  --tone-soft: var(--info-soft); }
.lineage-source--mint   { --tone: var(--mint);       --tone-soft: var(--bg-subtle); }
.lineage-source--muted  { --tone: var(--text-muted); --tone-soft: var(--bg-subtle); }
.lineage-source.is-active { background: var(--tone-soft); }
.lineage-source.is-active .lineage-source-count { color: var(--tone); }

.lineage-body-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.lineage-chip {
  height: 20px;
  font-size: 10.5px;
  border-color: transparent;
}
.lineage-chip--ok     { background: var(--ok-soft);    color: var(--ok-text); }
.lineage-chip--accent { background: var(--accent-soft); color: var(--accent-text); }
.lineage-chip--warn   { background: var(--warn-soft);  color: var(--warn-text); }
.lineage-chip--info   { background: var(--info-soft);  color: var(--info-text); }
.lineage-chip--mint   { background: var(--bg-subtle);  color: var(--mint); }
.lineage-chip--muted  { background: var(--bg-subtle);  color: var(--text-muted); }

.conf-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.conf-bar-track {
  flex: 1;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
  max-width: 80px;
}
.conf-bar-fill { height: 100%; }
.conf-bar-fill--ok   { background: var(--ok-text); }
.conf-bar-fill--warn { background: var(--warn-text); }
.conf-bar-fill--err  { background: var(--err); }
.conf-bar-pct {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* Import page. */
.import-page {
  padding: 30px 36px 44px;
}
.import-panel {
  max-width: 980px;
}
.import-page-head {
  margin-bottom: 26px;
}
.import-page-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.import-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0;
}
.import-subtitle {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}
.import-inline-action,
.import-row-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.import-inline-action:hover,
.import-row-action:hover:not([disabled]),
.import-inline-action:focus-visible,
.import-row-action:focus-visible {
  background: var(--bg-hover);
  color: var(--text);
  outline: none;
}
.import-row-action[disabled] {
  cursor: default;
  color: var(--text-faint);
}
.import-block {
  margin-bottom: 32px;
}
.import-page .section-header {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 10px;
  align-items: flex-start;
}
.import-page .section-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
}
.section-header--compact {
  margin-bottom: 8px;
}
.import-banner {
  max-width: 1080px;
  border: 0;
  border-radius: 6px;
  background: var(--bg-hover);
  margin-bottom: 16px;
  padding: 9px 10px;
  color: var(--text-muted);
}
.import-page .form-actions {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}
.import-page .form-actions form {
  margin: 0;
}
.import-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  color: var(--text-faint);
}
.import-step {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 3px 0;
  border-radius: 5px;
  color: var(--text-faint);
  font-size: 12px;
}
.import-step:not(:last-child)::after {
  content: "/";
  margin: 0 8px;
  color: var(--text-faint);
}
.import-step span {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: var(--text-faint);
  font-size: 10px;
  flex: 0 0 auto;
}
.import-step span svg {
  width: 10px;
  height: 10px;
}
.import-step strong {
  font-weight: 450;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-step.is-active {
  color: var(--text);
  background: transparent;
}
.import-step.is-active strong {
  font-weight: 600;
}
.import-step.is-active span,
.import-step.is-done span {
  color: var(--text);
  background: transparent;
}
.import-upload-form {
  display: grid;
  gap: 6px;
  max-width: 680px;
}
.import-file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--divider);
  border-radius: 7px;
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
}
.import-file-picker:hover {
  background: var(--bg-hover);
}
.import-file-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  flex: 0 0 auto;
}
.import-file-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.import-file-picker strong {
  font-size: 13px;
  font-weight: 500;
}
.import-file-picker small {
  color: var(--text-muted);
  font-size: 12px;
}
.import-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.import-file-meta {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 12px;
  flex: 0 0 auto;
  pointer-events: none;
}
.import-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
  max-width: 760px;
}
.import-map-grid .field {
  display: grid;
  gap: 6px;
}
.import-map-grid .label {
  color: var(--text-faint);
  font-size: 11px;
}
.import-map-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.import-map-card__index {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.import-map-card__body {
  min-width: 0;
}
.import-map-card__head {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}
.import-map-card__head strong {
  font-size: 14px;
  font-weight: 600;
}
.import-map-card__head span {
  color: var(--text-muted);
  font-size: 12px;
}
.import-map-example {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--text-muted);
  font-size: 12px;
}
.import-map-example code {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-product-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  max-width: 760px;
  color: var(--text-muted);
  font-size: 12px;
}
.import-product-columns strong {
  color: var(--text);
  font-weight: 450;
  overflow-wrap: anywhere;
}
.import-fields {
  margin-bottom: 24px;
}
.import-mapping-list {
  display: grid;
  max-width: 980px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}
.import-mapping-head,
.import-mapping-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(110px, .8fr) minmax(170px, 1fr) minmax(120px, .7fr);
  gap: 10px;
  align-items: center;
}
.import-mapping-head {
  padding: 7px 8px;
  color: var(--text-faint);
  font-size: 11px;
  border-bottom: 1px solid var(--divider);
}
.import-mapping-row {
  min-height: 42px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}
.import-mapping-row:last-child {
  border-bottom: none;
}
.import-mapping-row:hover {
  background: var(--bg-hover);
}
.import-mapping-row.is-identifier {
  background: var(--bg-subtle);
}
.import-mapping-source {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.import-mapping-source strong,
.import-mapping-source small,
.import-mapping-sample {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-mapping-source strong {
  font-weight: 500;
  color: var(--text);
}
.import-mapping-source small {
  color: var(--text-faint);
  font-size: 11px;
}
.import-mapping-sample {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}
.import-target-input {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 12px;
}
.import-target-input:disabled {
  opacity: .45;
}
.import-include-toggle,
.import-identifier-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 12px;
}
.import-include-toggle input {
  margin: 0;
}
.import-identifier-mark {
  color: var(--text);
}
.import-field-list {
  display: grid;
  gap: 2px;
  max-width: 900px;
}
.import-field-row {
  display: grid;
  grid-template-columns: 18px minmax(180px, 1fr) minmax(110px, 0.75fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.import-field-row:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.import-field-row input {
  margin: 0;
}
.import-field-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.import-field-main strong,
.import-field-main small,
.import-field-row code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-field-main strong {
  color: var(--text);
  font-weight: 450;
}
.import-field-main small {
  color: var(--text-faint);
  font-size: 11px;
}
.import-field-row code {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
}
.import-table-scroll {
  overflow: auto;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}
.import-source-table td {
  font-size: 12px;
}
.import-page .data-table {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.import-page .data-table thead th {
  background: transparent;
  border-bottom-color: var(--divider);
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
  font-weight: 450;
  padding: 8px 10px;
}
.import-page .data-table tbody td {
  padding: 9px 10px;
}
.import-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2px;
  margin-bottom: 18px;
}
.import-summary-grid > div {
  display: grid;
  gap: 4px;
  padding: 7px 8px;
  border-radius: 5px;
  background: transparent;
}
.import-summary-grid span {
  color: var(--text-faint);
  font-size: 11px;
}
.import-summary-grid strong {
  font-size: 15px;
  font-weight: 550;
}
.import-preview-table td {
  vertical-align: top;
  font-size: 12px;
}
.import-change-list {
  display: grid;
  gap: 5px;
}
.import-new-product {
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
}
.import-new-product strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.import-new-product span {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.import-row-error {
  margin-bottom: 6px;
  color: var(--err);
  overflow-wrap: anywhere;
}
.import-change-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(80px, 0.8fr) 18px minmax(80px, 0.8fr);
  gap: 8px;
  align-items: start;
  padding: 3px 0;
}
.import-change-row span:first-child,
.import-change-row em,
.import-change-row strong {
  overflow-wrap: anywhere;
}
.import-change-row em {
  color: var(--text-muted);
  font-style: normal;
}
.import-change-row strong {
  font-weight: 500;
}
.import-change-row small {
  grid-column: 1 / -1;
  color: var(--err);
}
.import-status--missing,
.import-status--ambiguous,
.import-status--error {
  color: var(--err);
}
.import-status--changed {
  color: var(--warn-text);
}
.import-status--new {
  color: var(--ok-text);
}
.import-status--unchanged {
  color: var(--text-muted);
}
.import-hidden-note {
  margin-top: 8px;
}
.import-error-list {
  display: grid;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  margin-bottom: 14px;
}
.import-error-list > div {
  display: grid;
  grid-template-columns: 48px minmax(140px, 1fr) minmax(120px, 1fr) minmax(0, 2fr);
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}
.import-error-list > div:last-child {
  border-bottom: none;
}
.import-error-list small {
  color: var(--err);
}
.import-muted-details,
.import-sample {
  max-width: 900px;
  margin-top: 8px;
  color: var(--text-muted);
}
.import-muted-details summary,
.import-sample summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.import-muted-details summary::-webkit-details-marker,
.import-sample summary::-webkit-details-marker {
  display: none;
}
.import-muted-details summary:hover,
.import-sample summary:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.import-muted-details summary span,
.import-sample summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.import-muted-details summary small,
.import-sample summary small {
  color: var(--text-faint);
  font-size: 12px;
}
.import-muted-details[open] summary,
.import-sample[open] summary {
  margin-bottom: 8px;
}
.import-skipped-list {
  display: grid;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}
.import-skipped-list > div {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 1fr);
  gap: 10px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}
.import-skipped-list > div:last-child {
  border-bottom: none;
}
.import-skipped-list code {
  color: var(--text-faint);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}
.import-sources-block {
  margin-top: 4px;
  color: var(--text-muted);
}
.import-sources-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.import-sources-block summary::-webkit-details-marker {
  display: none;
}
.import-sources-block summary:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.import-sources-block summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.import-sources-block summary small {
  color: var(--text-faint);
  font-size: 12px;
}
.import-sources-block[open] summary {
  margin-bottom: 8px;
}

@media (max-width: 720px) {
  .import-page {
    padding: 16px;
  }
  .import-page-titlebar,
  .import-map-grid,
  .import-map-card {
    grid-template-columns: 1fr;
    display: grid;
  }
  .import-map-card__index {
    display: none;
  }
  .import-field-row,
  .import-skipped-list > div {
    grid-template-columns: 1fr;
  }
  .import-mapping-head {
    display: none;
  }
  .import-mapping-row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
  }
  .import-field-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }
  .import-field-row code {
    grid-column: 2;
    text-align: left;
  }
  .import-skipped-list code {
    text-align: left;
  }
  .import-file-picker {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .import-change-row,
  .import-error-list > div {
    grid-template-columns: 1fr;
  }
}
/* ── State specs (Empty / Error / Loading) ────────────────────────── */
.state {
  max-width: 360px;
  margin: 64px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.state-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.state-icon--empty {
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-faint);
}
.state-icon--error {
  border-radius: 50%;
  background: var(--err-soft);
  color: var(--err);
}
.state-title { font-size: 16px; font-weight: 600; }
.state-hint  { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 6px; }
.state-meta  { font-size: 11px; color: var(--text-faint); margin-top: 14px; }

/* Skeleton rows (used by {% from _macros.html import skeleton_rows %}) */
.skel-row td { padding: 12px 14px; }
.skel-bar {
  height: 10px;
  border-radius: 3px;
  background: var(--bg-active);
  animation: skel-pulse 1.4s ease-in-out infinite;
}
@keyframes skel-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

/* ── Modal (overlay + panel) ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px 20px;
}
.modal-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  gap: 12px;
}
.modal-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  line-height: 0;
}
.modal-close:hover,
.modal-close:focus-visible { background: var(--bg-hover); color: var(--text); outline: none; }
.modal-body {
  padding: 16px 18px;
  overflow: auto;
  font-size: 13px;
  color: var(--text);
}
.modal-section + .modal-section { margin-top: 18px; }
.modal-section-label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 6px;
}
.modal-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 6px;
  column-gap: 14px;
  font-size: 12.5px;
}
.modal-kv dt { color: var(--text-muted); }
.modal-kv dd { margin: 0; color: var(--text); }
.modal-logs {
  background: #17161a;
  color: #cfccc6;
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}
.modal-logs .log-ts    { color: #6f6c65; }
.modal-logs .log-info  { color: #8fb6e5; }
.modal-logs .log-ok    { color: #86c28e; }
.modal-logs .log-warn  { color: #d8b46a; }
.modal-logs .log-err   { color: #e48c7c; }
.modal-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ─── Documents uploader (drag-n-drop, multi-file) ─────────────── */
.docs-uploader {
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.docs-uploader__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.docs-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 16px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  text-align: center;
}
.docs-dropzone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.docs-dropzone.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  border-style: solid;
}
.docs-dropzone__icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.docs-dropzone__title {
  font-size: var(--fs-13);
  color: var(--text);
  font-weight: 500;
}
.docs-dropzone__hint {
  font-size: var(--fs-11);
  color: var(--text-faint);
}
.docs-uploader__errors {
  margin: 0;
  padding: 10px 12px 10px 28px;
  background: var(--err-soft, #fdecec);
  border: 1px solid var(--err, #d33);
  border-radius: 6px;
  color: var(--err-text, var(--err));
  font-size: var(--fs-12);
  list-style: disc;
}
.docs-uploader__files {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--divider);
  border-radius: 6px;
  overflow: hidden;
}
.docs-uploader__row {
  display: grid;
  grid-template-columns: 1fr auto 28px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg);
}
.docs-uploader__row:last-child { border-bottom: none; }
.docs-uploader__file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.docs-uploader__file-icon { color: var(--text-muted); display: inline-flex; }
.docs-uploader__file-name {
  font-size: var(--fs-12);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-uploader__file-size {
  font-size: var(--fs-11);
  color: var(--text-faint);
}
.docs-uploader__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.form-field__label {
  font-size: var(--fs-11);
  color: var(--text-muted);
  font-weight: 500;
}
.form-field input,
.form-field select {
  height: 28px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: var(--r-md);
  padding: 0 8px;
  font-size: var(--fs-12);
  color: var(--text);
  font-family: inherit;
}
.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.docs-uploader__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--divider);
}
.docs-uploader__replace {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--text-muted);
  cursor: pointer;
}
.docs-uploader__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Documents table ──────────────────────────────────────────── */
.docs-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-panel);
  overflow: hidden;
}
.docs-table__head {
  display: grid;
  grid-template-columns: 160px 1fr 140px 1fr 80px;
  gap: 12px;
  padding: 9px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-11);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.docs-table__row {
  display: grid;
  grid-template-columns: 160px 1fr 140px 1fr 80px;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--divider);
  transition: background var(--dur-fast);
}
.docs-table__row:last-child { border-bottom: none; }
.docs-table__row:hover { background: var(--bg-hover); }
.docs-table__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}
.docs-table__empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-12);
}
.docs-table__add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--divider);
  color: var(--text-faint);
  font-size: var(--fs-12);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.docs-table__add:hover {
  background: var(--bg-hover);
  color: var(--text-muted);
}
.docs-table__add.is-open {
  color: var(--text);
}
.docs-table__add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: currentColor;
  opacity: 0.6;
}
.docs-table__add:hover .docs-table__add-icon { opacity: 1; }
.docs-table > .docs-uploader { display: contents; }
.docs-table .docs-uploader__form {
  border-top: 1px solid var(--divider);
  padding: 14px;
  background: var(--bg-subtle);
}
.doc-expiry { font-variant-numeric: tabular-nums; }
.doc-expiry--ok   { color: var(--text); }
.doc-expiry--warn { color: var(--warn-text, #c97a00); font-weight: 500; }
.doc-expiry--err  { color: var(--err); font-weight: 600; }
.doc-expiry-hint  { font-size: var(--fs-11); color: var(--text-faint); margin-left: 4px; }

/* ── Локали (Notion-style collapsibles) ─────────────────────────────── */
.locales-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-panel);
  overflow: hidden;
}
.locale-item { border-bottom: 1px solid var(--divider); }
.locale-item:last-child { border-bottom: none; }

.locale-item__header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: background-color var(--dur-fast) var(--ease);
}
.locale-item__header:hover,
.locale-item__header:focus-visible { background: var(--bg-hover); outline: none; }
.locale-item.is-open .locale-item__header { background: var(--bg-hover); }

.locale-item__chev {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; color: var(--text-faint);
  transition: transform var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.locale-item__code { height: 20px; font-weight: 600; font-size: 10.5px; }
.locale-item__name { font-size: 13px; font-weight: 500; }
.locale-item__req {
  font-size: 10.5px; color: var(--text-faint); font-weight: 400;
}
.locale-item__meta {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
}
.locale-item__empty {
  font-size: 11px; color: var(--text-faint); font-style: italic;
}

.locale-item__body {
  padding: 14px 16px 16px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--divider);
}
.locale-form {
  display: flex; flex-direction: column; gap: 10px;
}
.locale-form__actions {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
}
.locale-form__actions form { display: inline-flex; }

/* Notion-like inline-edit инпуты (как summary в note-taker-ext).
   Без видимой рамки до hover/focus, фон subtle при наведении, accent при фокусе. */
.inline-doc {
  display: flex; flex-direction: column; gap: 6px;
}
.inline-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  outline: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 0;
  resize: vertical;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), outline-color var(--dur-fast) var(--ease);
}
.inline-input::placeholder { color: var(--text-faint); }
.inline-input:hover {
  background: var(--bg-hover);
  border-color: var(--divider);
}
.inline-input:focus {
  background: var(--bg);
  border-color: var(--accent-border, var(--brand));
  outline: 1px solid var(--accent-border, var(--brand));
}
.inline-input--title {
  font-size: 15px;
  font-weight: 600;
}
/* Auto-grow textarea: высота подгоняется под содержимое, без скролла.
   field-sizing: content поддерживается всеми текущими браузерами (2024+). */
.inline-input--auto {
  field-sizing: content;
  resize: none;
  overflow: hidden;
}

.inline-doc__footer {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px;
  min-height: 26px;
}
.inline-doc__delete {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--divider);
}

.locale-readonly {
  display: flex; flex-direction: column; gap: 10px;
  font-size: 13px;
}
.locale-readonly__long {
  white-space: pre-wrap; font-family: var(--font-sans);
  font-size: 13px; margin: 0; color: var(--text);
}
