.product-import-section {
  gap: 12px;
  padding: 14px;
  border: 1px solid #e8e5f0;
  border-radius: 14px;
  background: #fbfaff;
}

.product-import-section[hidden] {
  display: none;
}

.product-import-form {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 8px;
}

.product-import-form select,
.product-import-form input {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #dcd9e7;
  border-radius: 10px;
  color: #252331;
  background: #fff;
  font: inherit;
  outline: none;
}

.product-import-form select:focus-visible,
.product-import-form input:focus-visible {
  border-color: #7567ec;
  box-shadow: 0 0 0 3px rgba(117, 103, 236, 0.12);
}

.product-import-fetch {
  min-width: 104px;
  min-height: 42px;
}

.product-import-privacy {
  margin: -4px 0 0;
  color: #777386;
  font-size: 12px;
  line-height: 1.5;
}

.product-import-status {
  padding: 9px 11px;
  border: 1px solid #e7d8ae;
  border-radius: 10px;
  color: #785c14;
  background: #fffaf0;
  font-size: 13px;
  line-height: 1.5;
}

.product-import-status.is-error {
  border-color: #efcbd0;
  color: #9d3545;
  background: #fff7f8;
}

.product-import-summary,
.product-import-result-actions,
.product-import-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-import-summary {
  padding: 10px 12px;
  border: 1px solid #e7e3f2;
  border-radius: 12px;
  background: #fff;
}

.product-import-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.product-import-summary strong,
.product-import-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-import-summary strong {
  color: #2d2938;
  font-size: 13px;
}

.product-import-summary small,
.product-import-group-head small,
.product-import-result-actions small {
  color: #7d788c;
  font-size: 12px;
}

.product-import-cache-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #5e50cc;
  background: #f0edff;
  font-size: 11px;
  font-weight: 500;
}

.product-import-results,
.product-import-group {
  display: grid;
  gap: 10px;
}

.product-import-group-head strong {
  color: #403b4e;
  font-size: 13px;
}

.product-import-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow-y: auto;
  padding: 1px;
  scrollbar-gutter: stable;
}

.product-import-image {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid #e1e5e9;
  border-radius: 10px;
  background: #f0eef5;
  cursor: pointer;
}

.product-import-image.is-selected {
  border-color: #1d8076;
  box-shadow: 0 1px 3px rgba(17, 73, 68, 0.12);
}

.product-import-image input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.product-import-select-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}

.product-import-image input:focus-visible ~ .product-import-select-hit {
  outline: 2px solid #1d8076;
  outline-offset: -2px;
}

.product-import-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-import-check {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 5px;
  color: transparent;
  background: rgba(32, 31, 38, 0.54);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  pointer-events: none;
}

.product-import-image.is-selected .product-import-check {
  color: #fff;
  border-color: #1d8076;
  background: #1d8076;
}

.product-import-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.product-import-preview-button {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 7px;
  color: #34424b;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.16);
  cursor: zoom-in;
  backdrop-filter: blur(6px);
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.product-import-preview-button:hover {
  color: #126f66;
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.product-import-preview-button:focus-visible {
  outline: 2px solid #1d8076;
  outline-offset: 2px;
}

.product-import-preview-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.product-import-result-actions {
  padding-top: 2px;
}

.product-import-result-actions .create-button {
  min-width: 150px;
}

html[data-theme="dark"] .product-import-section {
  border-color: #3b4052;
  background: #202431;
}

html[data-theme="dark"] .product-import-form select,
html[data-theme="dark"] .product-import-form input,
html[data-theme="dark"] .product-import-summary {
  border-color: #454b5d;
  color: #edf0f7;
  background: #272c3a;
}

html[data-theme="dark"] .product-import-summary strong,
html[data-theme="dark"] .product-import-group-head strong {
  color: #edf0f7;
}

html[data-theme="dark"] .product-import-privacy,
html[data-theme="dark"] .product-import-summary small,
html[data-theme="dark"] .product-import-group-head small,
html[data-theme="dark"] .product-import-result-actions small {
  color: #aeb5c6;
}

html[data-theme="dark"] .product-import-image {
  border-color: #414958;
  background: #303646;
}

html[data-theme="dark"] .product-import-image.is-selected {
  border-color: #54b9ad;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .product-import-image.is-selected .product-import-check {
  border-color: #278f84;
  background: #278f84;
}

html[data-theme="dark"] .product-import-preview-button {
  border-color: rgba(255, 255, 255, 0.14);
  color: #e7f5f3;
  background: rgba(27, 35, 46, 0.82);
}

@media (max-width: 900px) {
  .product-import-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .product-import-form {
    grid-template-columns: 1fr;
  }

  .product-import-fetch {
    width: 100%;
  }

  .product-import-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 280px;
  }

  .product-import-result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .product-import-result-actions .create-button {
    width: 100%;
  }
}

.product-link-workbench-panel {
  display: grid;
  gap: 12px;
}

.product-link-workbench-field {
  display: grid;
  gap: 8px;
}

.product-link-workbench-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.product-link-workbench-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.product-link-workbench-input-wrap > svg {
  position: absolute;
  left: 14px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: #7567ec;
  pointer-events: none;
}

.product-link-workbench-input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid #dedbe8;
  border-radius: 12px;
  color: #252331;
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.product-link-workbench-input::placeholder {
  color: #9a96a6;
}

.product-link-workbench-input:hover {
  border-color: #cbc6dc;
}

.product-link-workbench-input:focus-visible {
  border-color: #7567ec;
  box-shadow: 0 0 0 3px rgba(117, 103, 236, 0.12);
}

.product-link-workbench-field > small {
  color: #827d8f;
  font-size: 12px;
  line-height: 1.5;
}

.product-link-workbench-fetch {
  min-width: 92px;
  min-height: 48px;
  border-radius: 12px;
  white-space: nowrap;
}

.product-link-workbench-results {
  min-height: 186px;
  padding: 12px;
  border: 1px dashed #d9d5e4;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c3becf transparent;
  scrollbar-width: thin;
}

.product-link-workbench-results::-webkit-scrollbar {
  width: 6px;
}

.product-link-workbench-results::-webkit-scrollbar-track {
  background: transparent;
}

.product-link-workbench-results::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c3becf;
}

.product-link-workbench-results::-webkit-scrollbar-thumb:hover {
  background: #a9a3b7;
}

.product-link-workbench-results::-webkit-scrollbar-button,
.product-link-workbench-results::-webkit-scrollbar-corner {
  display: none;
}

.product-link-workbench-results .product-import-results {
  gap: 14px;
}

.product-link-workbench-results .product-import-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  max-height: none;
  overflow: visible;
}

.product-link-workbench-results .product-import-image {
  isolation: isolate;
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: auto;
  contain: layout paint;
}

.product-link-workbench-results .product-import-image::before {
  display: block;
  padding-top: 100%;
  content: "";
}

.product-link-workbench-results .product-import-image img {
  position: absolute;
  inset: 0;
  display: block;
}

.product-import-workbench-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 160px;
  padding: 20px 12px;
  color: #7f798c;
  text-align: center;
}

.product-import-workbench-empty strong {
  margin-top: 10px;
  color: #4d465f;
  font-size: 13px;
}

.product-import-workbench-empty small {
  margin-top: 4px;
  font-size: 12px;
}

.product-import-workbench-empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #7567ec;
  background: #f0edff;
}

.product-import-workbench-empty-icon svg {
  width: 20px;
  height: 20px;
}

.product-import-workbench-empty.is-loading .product-import-workbench-empty-icon svg {
  animation: product-import-spin 900ms linear infinite;
}

.product-import-workbench-selection {
  padding-top: 10px;
  color: #827d8f;
  font-size: 12px;
}

.product-link-workbench-panel :where(
  .product-link-workbench-input,
  .product-link-workbench-fetch,
  .product-link-workbench-field > small,
  .product-import-status,
  .product-import-group-head strong,
  .product-import-group-head small,
  .product-import-workbench-empty strong,
  .product-import-workbench-empty small,
  .product-import-workbench-selection,
  .product-import-workbench-selection small,
  .product-import-check
) {
  font-weight: 500;
}

body.product-import-preview-open {
  overflow: hidden;
}

.product-import-preview-dialog {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(8px);
}

.product-import-preview-dialog[hidden] {
  display: none;
}

.product-import-preview-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(92vw, 1080px);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  background: #f8fafb;
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.32);
}

.product-import-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  padding: 8px 10px 8px 18px;
  border-bottom: 1px solid #e6eaee;
}

.product-import-preview-head strong {
  overflow: hidden;
  color: #26313a;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-import-preview-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #dde3e8;
  border-radius: 10px;
  color: #52606b;
  background: #fff;
  cursor: pointer;
}

.product-import-preview-close:hover {
  color: #1d8076;
  border-color: #b8d8d4;
  background: #f4fbfa;
}

.product-import-preview-close:focus-visible {
  outline: 2px solid #1d8076;
  outline-offset: 2px;
}

.product-import-preview-close svg {
  width: 17px;
  height: 17px;
}

.product-import-preview-body {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  background: #eef1f3;
}

.product-import-preview-body img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 86px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}

html[data-theme="dark"] .product-import-preview-card {
  border-color: #434b5b;
  background: #252b38;
}

html[data-theme="dark"] .product-import-preview-head {
  border-color: #414958;
}

html[data-theme="dark"] .product-import-preview-head strong {
  color: #edf0f7;
}

html[data-theme="dark"] .product-import-preview-close {
  border-color: #495263;
  color: #dce3ed;
  background: #303746;
}

html[data-theme="dark"] .product-import-preview-body {
  background: #1e2430;
}

@media (max-width: 640px) {
  .product-import-preview-dialog {
    padding: 12px;
  }

  .product-import-preview-card {
    width: 100%;
    max-height: 94vh;
    border-radius: 14px;
  }

  .product-import-preview-body {
    padding: 10px;
  }
}

@media (min-width: 981px) {
  body.feature-focus-mode.workstation-feature-mode[data-active-feature="product-import"] .settings-scroll-area {
    grid-template-rows: minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  body.feature-focus-mode.workstation-feature-mode[data-active-feature="product-import"] .settings-scroll-area > .settings-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.feature-focus-mode.workstation-feature-mode[data-active-feature="product-import"] .dynamic-settings {
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.feature-focus-mode.workstation-feature-mode[data-active-feature="product-import"] .product-link-workbench-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  body.feature-focus-mode.workstation-feature-mode[data-active-feature="product-import"] .product-link-workbench-field {
    flex: 0 0 auto;
  }

  body.feature-focus-mode.workstation-feature-mode[data-active-feature="product-import"] .product-link-workbench-results {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 100%;
  }

}

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

html[data-theme="dark"] .product-link-workbench-input {
  border-color: #454b5d;
  color: #edf0f7;
  background: #272c3a;
}

html[data-theme="dark"] .product-link-workbench-results {
  border-color: #454b5d;
  background: rgba(39, 44, 58, 0.72);
}

html[data-theme="dark"] .product-import-workbench-empty strong {
  color: #edf0f7;
}

html[data-theme="dark"] .product-import-workbench-empty-icon {
  color: #b8afff;
  background: #34304c;
}

html[data-theme="dark"] .product-link-workbench-input::placeholder,
html[data-theme="dark"] .product-link-workbench-field > small {
  color: #aeb5c6;
}

@media (max-width: 520px) {
  .product-link-workbench-control {
    grid-template-columns: 1fr;
  }

  .product-link-workbench-fetch {
    width: 100%;
  }
}
