.product-cards-header-button {
  border-color: #f97316;
  color: #c2410c;
  background: #fff7ed;
}

.simple-modal-panel:has(.product-cards-modal),
.simple-modal-panel:has(.product-cards-loading) {
  width: min(1120px, calc(100vw - 40px));
  max-width: 1120px;
  max-height: min(920px, calc(100dvh - 32px));
}

.product-cards-modal {
  display: grid;
  gap: 18px;
  color: #172033;
}

.product-cards-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.product-cards-summary article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 14px 16px;
  border: 1px solid #b9e5d2;
  border-radius: 14px;
  background: #f1fbf6;
}

.product-cards-summary article.attention { border-color: #fed7aa; background: #fff7ed; }
.product-cards-summary article.neutral { border-color: #dbe3ef; background: #f8fafc; }
.product-cards-summary span { align-self: end; font-size: 12px; font-weight: 800; color: #526078; text-transform: uppercase; letter-spacing: .045em; }
.product-cards-summary strong { grid-row: span 2; align-self: center; font-size: 28px; color: #087f5b; }
.product-cards-summary .attention strong { color: #c2410c; }
.product-cards-summary .neutral strong { color: #64748b; }
.product-cards-summary small { color: #7a869a; }

.product-cards-selection {
  display: grid;
  grid-template-columns: minmax(230px, .75fr) minmax(280px, 1.25fr);
  gap: 12px 18px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid #cbd9ee;
  border-radius: 15px;
  background: linear-gradient(112deg, #f5f9ff, #fff);
}
.product-cards-selection > div > span { color: #245ea8; font-size: 11px; font-weight: 900; letter-spacing: .09em; }
.product-cards-selection h3 { margin: 3px 0 2px; font-size: 16px; }
.product-cards-selection p { margin: 0; color: #64748b; font-size: 12px; line-height: 1.45; }
.product-cards-selection textarea { min-height: 78px; resize: vertical; padding: 10px 12px; border: 1px solid #bdd0eb; border-radius: 10px; font: 700 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #173d6e; background: #fff; }
.product-cards-selection-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-cards-selection-actions small { color: #64748b; }
.product-cards-selection-actions .button { min-width: 128px; justify-content: center; }

.product-cards-main {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr);
  gap: 18px;
}

.product-cards-preview,
.product-cards-generator,
.product-cards-lists details {
  border: 1px solid #dce3ee;
  border-radius: 16px;
  background: #fff;
}

.product-cards-preview { padding: 16px; }
.product-cards-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.product-cards-section-title span,
.product-cards-generator > span { color: #ea580c; font-size: 11px; font-weight: 900; letter-spacing: .09em; }
.product-cards-section-title h3,
.product-cards-generator h3 { margin: 3px 0 0; font-size: 17px; }
.product-cards-section-title b { padding: 6px 9px; border-radius: 8px; background: #eef4ff; color: #245ea8; font-size: 12px; }
.product-cards-preview-frame { display: grid; place-items: center; padding: 14px; border-radius: 12px; background: #e9edf3; overflow: hidden; }
.product-cards-preview-frame img { display: block; width: 100%; max-width: 610px; aspect-ratio: 100 / 65; object-fit: contain; background: #fff; box-shadow: 0 9px 24px rgba(15, 23, 42, .14); }
.product-cards-preview p { margin: 10px 0 0; color: #64748b; font-size: 12px; }

.product-cards-generator { padding: 18px; background: linear-gradient(155deg, #0d2748, #102038); color: #fff; }
.product-cards-generator h3 { min-height: 42px; color: #fff; }
.product-cards-generator small { display: block; min-height: 34px; color: #cbd5e1; }
.product-cards-progress { height: 9px; margin: 14px 0 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.13); }
.product-cards-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff6b2c, #fbbf24, #22c55e); transition: width .25s ease; }
.product-cards-generator .wide { margin-top: 12px; width: 100%; justify-content: center; }
.product-cards-generator ul { margin: 14px 0 0; padding-left: 18px; color: #cbd5e1; font-size: 12px; line-height: 1.7; }
.product-cards-downloads { display: grid; gap: 8px; margin-top: 12px; }
.product-cards-downloads .button { justify-content: center; }
.product-cards-error { padding: 9px; border-radius: 8px; color: #fecaca; background: rgba(127,29,29,.35); font-size: 12px; }

.product-cards-lists { display: grid; gap: 9px; }
.product-cards-lists details { overflow: hidden; }
.product-cards-lists summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; cursor: pointer; font-weight: 800; }
.product-cards-lists summary b { display: grid; min-width: 28px; height: 24px; place-items: center; border-radius: 999px; background: #e9eff8; color: #31445f; font-size: 12px; }
.product-cards-relation { max-height: 285px; overflow: auto; border-top: 1px solid #e4e9f1; }
.product-cards-relation article { display: grid; grid-template-columns: 105px minmax(0, 1fr) minmax(130px, auto); align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid #eef1f5; }
.product-cards-relation article:last-child { border-bottom: 0; }
.product-cards-relation article > span { width: max-content; max-width: 105px; padding: 5px 7px; overflow: hidden; border-radius: 7px; background: #edf4ff; color: #215999; font-weight: 800; text-overflow: ellipsis; }
.product-cards-relation article strong { display: block; font-size: 12px; }
.product-cards-relation article small { display: block; margin-top: 2px; color: #728096; }
.product-cards-relation article > b { color: #66758a; font-size: 11px; text-align: right; }
.product-cards-relation.pending article > b { color: #b45309; }
.product-cards-relation.excluded article > b { color: #64748b; }
.product-cards-empty,
.product-cards-no-preview { display: grid; gap: 5px; place-items: center; min-height: 120px; padding: 22px; color: #6b7890; text-align: center; }
.product-cards-loading { display: grid; gap: 8px; place-items: center; min-height: 260px; color: #65738a; }
.product-cards-loading i { width: 34px; height: 34px; border: 3px solid #dce4ef; border-top-color: #f97316; border-radius: 50%; animation: product-cards-spin .75s linear infinite; }
@keyframes product-cards-spin { to { transform: rotate(360deg); } }

html[data-theme="black"] .product-cards-header-button { border-color: #9a4d1d; color: #ffb380; background: #26180f; }
html[data-theme="black"] .product-cards-modal { color: #eef4ff; }
html[data-theme="black"] .product-cards-summary article { border-color: #245947; background: #102a23; }
html[data-theme="black"] .product-cards-summary article.attention { border-color: #70401f; background: #2c1d13; }
html[data-theme="black"] .product-cards-summary article.neutral { border-color: #303d50; background: #172131; }
html[data-theme="black"] .product-cards-summary span,
html[data-theme="black"] .product-cards-summary small { color: #a9b5c7; }
html[data-theme="black"] .product-cards-selection { border-color: #2b4366; background: linear-gradient(112deg, #101d30, #111827); }
html[data-theme="black"] .product-cards-selection h3 { color: #f4f7fb; }
html[data-theme="black"] .product-cards-selection p,
html[data-theme="black"] .product-cards-selection-actions small { color: #a9b5c7; }
html[data-theme="black"] .product-cards-selection textarea { border-color: #35537a; color: #dceaff; background: #0b1422; }
html[data-theme="black"] .product-cards-preview,
html[data-theme="black"] .product-cards-lists details { border-color: #2a3a51; background: #101a2a; }
html[data-theme="black"] .product-cards-preview-frame { background: #07101d; }
html[data-theme="black"] .product-cards-section-title h3 { color: #f4f7fb; }
html[data-theme="black"] .product-cards-preview p { color: #9cabc0; }
html[data-theme="black"] .product-cards-relation,
html[data-theme="black"] .product-cards-relation article { border-color: #29384c; }
html[data-theme="black"] .product-cards-relation article > span { background: #172d4a; color: #8ec5ff; }
html[data-theme="black"] .product-cards-relation article > b { color: #a9b5c7; }
html[data-theme="black"] .product-cards-lists summary b { background: #233249; color: #dce8f7; }

@media (max-width: 760px) {
  .simple-modal-panel:has(.product-cards-modal),
  .simple-modal-panel:has(.product-cards-loading) { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .product-cards-summary { grid-template-columns: 1fr; }
  .product-cards-selection { grid-template-columns: 1fr; }
  .product-cards-selection-actions { grid-column: auto; flex-wrap: wrap; }
  .product-cards-main { grid-template-columns: 1fr; }
  .product-cards-preview-frame { padding: 8px; }
  .product-cards-relation article { grid-template-columns: 82px minmax(0, 1fr); }
  .product-cards-relation article > span { max-width: 82px; }
  .product-cards-relation article > b { grid-column: 2; text-align: left; }
}
