:root {
  --ink: #151923;
  --ink-soft: #2b3340;
  --muted: #647083;
  --quiet: #8a94a5;
  --line: #dde4ec;
  --line-strong: #c8d2df;
  --paper: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f9fbfd;
  --nav: #111823;
  --nav-2: #1d2634;
  --teal: #0f9f8f;
  --teal-dark: #0b766b;
  --amber: #d98b21;
  --indigo: #4856c7;
  --red: #c34453;
  --blue: #2563a8;
  --shadow: 0 18px 44px rgba(21, 25, 35, 0.1);
  --shadow-soft: 0 10px 24px rgba(21, 25, 35, 0.07);
  --radius: 8px;
  --font-sans: "HarmonyOS Sans SC", "MiSans", "Alibaba PuHuiTi", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-number: "DIN Alternate", "Bahnschrift", "Aptos", "Segoe UI", sans-serif;
  --workflow-rail-left: max(14px, calc((100vw - 1840px) / 2 + 14px));
  --workflow-rail-width: 220px;
  --workflow-rail-gap: 14px;
  --workflow-content-left: max(
    calc(14px + var(--workflow-rail-width) + var(--workflow-rail-gap)),
    calc((100vw - 1840px) / 2 + 14px + var(--workflow-rail-width) + var(--workflow-rail-gap))
  );
}

/* 1688 商品详情：在图搜卡片内查看 SKU、库存与商品属性。 */
.same-products-card-actions .same-products-open-product {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  place-items: center;
  padding: 0;
  color: #173a63;
  background: #edf3f8;
  border: 0;
  border-radius: 4px;
}

.same-products-card-actions .same-products-open-product::before {
  content: "≡";
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.same-products-card-actions .same-products-open-product:hover,
.same-products-card-actions .same-products-open-product:focus-visible {
  color: #fff;
  background: #245d91;
}

.same-products-detail-text-button {
  min-height: 28px;
  padding: 4px 9px;
  color: #245d91;
  background: #edf3f8;
  border: 1px solid #d5e1ec;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.alibaba-product-detail-panel {
  display: flex;
  width: min(1120px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  flex-direction: column;
  border-radius: 8px;
}

.alibaba-product-detail-head { flex: 0 0 auto; }
.alibaba-product-detail-heading { min-width: 0; }
.alibaba-product-detail-heading h2 {
  overflow: hidden;
  max-width: 760px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alibaba-product-detail-heading > p:last-child {
  overflow: hidden;
  margin: 5px 0 0;
  color: #697689;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alibaba-product-detail-head-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}
.alibaba-detail-external {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 6px 11px;
  color: #245d91;
  background: #fff;
  border: 1px solid #cfdae7;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.alibaba-product-detail-body { overflow: auto; padding: 0; }
.alibaba-detail-loading,
.alibaba-detail-error {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #697689;
  text-align: center;
}
.alibaba-detail-loading strong,
.alibaba-detail-error strong { color: #26364a; font-size: 16px; }
.alibaba-detail-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #dce7f1;
  border-top-color: #245d91;
  border-radius: 50%;
  animation: alibaba-detail-spin 0.8s linear infinite;
}
@keyframes alibaba-detail-spin { to { transform: rotate(360deg); } }
.alibaba-detail-error button {
  min-height: 34px;
  padding: 6px 14px;
  color: #fff;
  background: #173a63;
  border-color: #173a63;
  border-radius: 4px;
}
.alibaba-detail-summary {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e3e9f0;
}
.alibaba-detail-gallery { display: grid; gap: 8px; }
.alibaba-detail-hero-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid #dfe6ee;
  border-radius: 6px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.alibaba-detail-thumbnails {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.alibaba-detail-thumbnails img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #fff;
  border: 1px solid #dfe6ee;
  border-radius: 3px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.alibaba-detail-hero-image[data-image-preview]:hover,
.alibaba-detail-thumbnails img[data-image-preview]:hover,
.alibaba-detail-sku-spec img[data-image-preview]:hover {
  border-color: #7ea5cc;
  box-shadow: 0 0 0 2px rgba(36, 93, 145, 0.12);
}
.alibaba-detail-overview { display: grid; min-width: 0; align-content: start; gap: 18px; }
.alibaba-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border: 1px solid #dfe6ee;
}
.alibaba-detail-metrics > div {
  display: grid;
  min-height: 86px;
  align-content: center;
  gap: 6px;
  padding: 12px 14px;
  border-right: 1px solid #dfe6ee;
}
.alibaba-detail-metrics > div:last-child { border-right: 0; }
.alibaba-detail-metrics span { color: #697689; font-size: 11px; }
.alibaba-detail-metrics strong { color: #173a63; font-size: 20px; }
.alibaba-detail-seller {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  background: #fff;
  border: 1px solid #dfe6ee;
}
.alibaba-detail-seller > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 10px 12px;
  border-right: 1px solid #dfe6ee;
}
.alibaba-detail-seller > div:last-child { border-right: 0; }
.alibaba-detail-seller dt { color: #7a8797; font-size: 10px; }
.alibaba-detail-seller dd {
  overflow: hidden;
  margin: 0;
  color: #2c3c50;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alibaba-detail-logistics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  gap: 14px;
}
.alibaba-detail-logistics > div { min-width: 0; }
.alibaba-detail-logistics dt { margin-bottom: 5px; color: #7a8797; font-size: 11px; }
.alibaba-detail-logistics dd { overflow-wrap: anywhere; margin: 0; color: #2c3c50; font-size: 13px; font-weight: 750; }
.alibaba-detail-tabs {
  display: flex;
  position: sticky;
  z-index: 2;
  top: 0;
  gap: 4px;
  padding: 12px 20px 0;
  background: #fff;
  border-bottom: 1px solid #dfe6ee;
}
.alibaba-detail-tabs button {
  min-height: 38px;
  padding: 7px 12px;
  color: #637186;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  font-size: 12px;
  font-weight: 850;
}
.alibaba-detail-tabs button.is-active { color: #173a63; border-bottom-color: #e43e34; }
.alibaba-detail-tabs button span { margin-left: 4px; color: #8995a5; font-size: 10px; }
.alibaba-detail-tab-panel { padding: 16px 20px 22px; }
.alibaba-detail-tab-panel[hidden] { display: none; }
.alibaba-detail-sku-table-wrap { overflow: auto; border: 1px solid #dfe6ee; border-radius: 5px; }
.alibaba-detail-sku-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.alibaba-detail-sku-table th { padding: 9px 12px; color: #657285; background: #f4f7fa; font-size: 11px; text-align: left; white-space: nowrap; }
.alibaba-detail-sku-table td { padding: 9px 12px; color: #344357; border-top: 1px solid #e7ecf2; font-size: 12px; vertical-align: middle; }
.alibaba-detail-sku-spec { display: grid; grid-template-columns: 42px minmax(180px, 1fr); align-items: center; gap: 10px; }
.alibaba-detail-sku-spec img { width: 42px; height: 42px; object-fit: cover; background: #f5f7fa; border: 1px solid #dfe6ee; border-radius: 4px; transition: border-color 0.16s ease, box-shadow 0.16s ease; }
.alibaba-detail-sku-spec strong { color: #26364a; font-size: 12px; overflow-wrap: anywhere; }
.alibaba-detail-price { color: #d93228; font-size: 13px; white-space: nowrap; }
.alibaba-detail-stock-share,
.alibaba-detail-price-gap { color: #30445c; font-family: var(--font-number); font-size: 12px; font-weight: 800; white-space: nowrap; }
.alibaba-detail-price-gap { color: #9b5a12; }
.alibaba-detail-attributes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid #dfe6ee;
  border-right: 0;
  border-bottom: 0;
}
.alibaba-detail-attribute {
  display: grid;
  grid-template-columns: minmax(100px, 34%) minmax(0, 1fr);
  min-height: 46px;
  border-right: 1px solid #dfe6ee;
  border-bottom: 1px solid #dfe6ee;
}
.alibaba-detail-attribute dt,
.alibaba-detail-attribute dd { overflow-wrap: anywhere; margin: 0; padding: 11px 12px; font-size: 12px; }
.alibaba-detail-attribute dt { color: #68768a; background: #f5f7fa; font-weight: 750; }
.alibaba-detail-attribute dd { color: #2c3c50; }
.alibaba-detail-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #718096;
  border: 1px dashed #ccd7e3;
  text-align: center;
}
html[data-theme="dark"] .alibaba-product-detail-panel,
html[data-theme="dark"] .alibaba-detail-tabs { background: #151f2a; border-color: #344357; }
html[data-theme="dark"] .alibaba-detail-summary { background: #101923; border-color: #344357; }
html[data-theme="dark"] .alibaba-detail-metrics,
html[data-theme="dark"] .alibaba-detail-seller,
html[data-theme="dark"] .alibaba-detail-hero-image,
html[data-theme="dark"] .alibaba-detail-thumbnails img { background: #172330; border-color: #344357; }
html[data-theme="dark"] .alibaba-detail-metrics > div,
html[data-theme="dark"] .alibaba-detail-seller > div,
html[data-theme="dark"] .alibaba-detail-sku-table-wrap,
html[data-theme="dark"] .alibaba-detail-sku-table td,
html[data-theme="dark"] .alibaba-detail-attributes,
html[data-theme="dark"] .alibaba-detail-attribute { border-color: #344357; }
html[data-theme="dark"] .alibaba-detail-sku-table th,
html[data-theme="dark"] .alibaba-detail-attribute dt { color: #aebdcd; background: #1d2a38; }
html[data-theme="dark"] .alibaba-detail-sku-table td,
html[data-theme="dark"] .alibaba-detail-sku-spec strong,
html[data-theme="dark"] .alibaba-detail-attribute dd,
html[data-theme="dark"] .alibaba-detail-seller dd,
html[data-theme="dark"] .alibaba-detail-logistics dd,
html[data-theme="dark"] .alibaba-detail-loading strong { color: #d0def0; }

@media (max-width: 760px) {
  .alibaba-product-detail-dialog { padding: 8px; }
  .alibaba-product-detail-panel { max-height: calc(100vh - 16px); }
  .alibaba-product-detail-head { align-items: flex-start; padding: 14px; }
  .alibaba-product-detail-heading h2 { max-width: calc(100vw - 150px); font-size: 15px; }
  .alibaba-detail-external { width: 34px; padding: 0; justify-content: center; font-size: 0; }
  .alibaba-detail-external::before { content: "↗"; font-size: 18px; }
  .alibaba-detail-summary { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .alibaba-detail-thumbnails { display: none; }
  .alibaba-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alibaba-detail-metrics > div { min-height: 62px; padding: 8px; border-bottom: 1px solid #dfe6ee; }
  .alibaba-detail-metrics > div:nth-child(2) { border-right: 0; }
  .alibaba-detail-metrics > div:nth-child(n+3) { border-bottom: 0; }
  .alibaba-detail-metrics strong { font-size: 15px; }
  .alibaba-detail-seller { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alibaba-detail-seller > div:nth-child(2) { border-right: 0; }
  .alibaba-detail-seller > div:nth-child(-n + 2) { border-bottom: 1px solid #dfe6ee; }
  .alibaba-detail-logistics { grid-template-columns: 1fr; gap: 8px; }
  .alibaba-detail-tabs { padding-inline: 14px; }
  .alibaba-detail-tab-panel { padding: 12px 14px 16px; }
  .alibaba-detail-attributes { grid-template-columns: 1fr; }
}

/* Global floating workflow and appearance controls. */
.selection-workflow-restore,
.theme-toggle {
  position: fixed;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #173451;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #cbd9e7;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 10px 28px rgba(18, 40, 68, 0.16);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.selection-workflow-restore {
  top: 132px;
  left: 0;
  padding: 10px 12px 10px 8px;
}

.selection-workflow-restore[hidden] {
  display: none !important;
}

.selection-workflow-restore span {
  font-size: 22px;
  line-height: 1;
}

.selection-workflow-restore strong,
.theme-toggle-label {
  font-size: 13px;
  letter-spacing: 0;
}

.theme-toggle {
  bottom: 20px;
  left: 0;
  padding: 10px 14px 10px 12px;
}

.theme-toggle-icon {
  font-size: 18px;
}

.selection-workflow-hide:hover,
.selection-workflow-restore:hover,
.theme-toggle:hover {
  color: #0b766b;
  border-color: #6ab6ad;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7edf5;
  --ink-soft: #cbd5e1;
  --muted: #9eacbd;
  --quiet: #7f8da0;
  --line: #344357;
  --line-strong: #46576c;
  --paper: #111821;
  --panel: #19232f;
  --panel-soft: #202c39;
  --nav: #e7edf5;
  --nav-2: #b7c5d6;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.26);
}

html[data-theme="dark"] body {
  background: #101720;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .primary-nav,
html[data-theme="dark"] .panel,
html[data-theme="dark"] [class*="-panel"],
html[data-theme="dark"] [class*="-card"],
html[data-theme="dark"] dialog {
  color: var(--ink);
  background-color: var(--panel);
  border-color: var(--line);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
  color: var(--ink);
  background-color: #151f2a;
  border-color: var(--line);
}

html[data-theme="dark"] .selection-workflow {
  background: rgba(24, 34, 46, 0.97);
  border-color: #3b4c60;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .selection-workflow-title {
  border-color: #3b4c60;
}

html[data-theme="dark"] .selection-workflow-title span,
html[data-theme="dark"] .selection-workflow-step.is-pending {
  color: #9eacbd;
}

html[data-theme="dark"] .selection-workflow-title strong,
html[data-theme="dark"] .selection-workflow-step,
html[data-theme="dark"] .selection-workflow-step:hover,
html[data-theme="dark"] .selection-workflow-step:focus-visible,
html[data-theme="dark"] .selection-workflow-step.is-active {
  color: #e7edf5;
}

html[data-theme="dark"] .selection-workflow-step {
  background: #202c39;
  border-color: #3b4c60;
}

html[data-theme="dark"] .selection-workflow-step:hover,
html[data-theme="dark"] .selection-workflow-step:focus-visible,
html[data-theme="dark"] .selection-workflow-step.is-active {
  background: #263649;
  border-color: #5689c3;
}

html[data-theme="dark"] .workflow-index,
html[data-theme="dark"] .selection-workflow-hide {
  color: #afbdd0;
  background: #151f2a;
  border-color: #3b4c60;
}

html[data-theme="dark"] .selection-workflow-restore,
html[data-theme="dark"] .theme-toggle {
  color: #e7edf5;
  background: rgba(24, 34, 46, 0.97);
  border-color: #3b4c60;
}

html[data-theme="dark"] .market-layout,
html[data-theme="dark"] .secondary-workspace,
html[data-theme="dark"] main,
html[data-theme="dark"] main section,
html[data-theme="dark"] main article,
html[data-theme="dark"] main form,
html[data-theme="dark"] main header,
html[data-theme="dark"] main footer,
html[data-theme="dark"] main div {
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] [class*="-panel"],
html[data-theme="dark"] [class*="-card"],
html[data-theme="dark"] [class*="-bar"],
html[data-theme="dark"] [class*="-suite"],
html[data-theme="dark"] [class*="-summary"] {
  background-color: var(--panel) !important;
  background-image: none !important;
}

html[data-theme="dark"] main h1,
html[data-theme="dark"] main h2,
html[data-theme="dark"] main h3,
html[data-theme="dark"] main h4,
html[data-theme="dark"] main strong,
html[data-theme="dark"] main label,
html[data-theme="dark"] main p,
html[data-theme="dark"] main span,
html[data-theme="dark"] main small {
  color: inherit;
}

html[data-theme="dark"] main button:not(.primary-button),
html[data-theme="dark"] .text-button {
  color: #dce6f2;
  background-color: #243244;
  border-color: #465a70;
}

@media (max-width: 1180px) {
  .selection-workflow {
    position: fixed;
    top: 116px;
    left: 12px;
    width: min(220px, calc(100vw - 24px));
    max-height: calc(100vh - 134px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #d8e3ef;
    border-radius: 12px;
  }

  .selection-workflow-inner {
    width: 100%;
    min-width: 0;
    padding: 16px 14px;
  }

  .selection-workflow-title {
    display: flex;
  }

  .selection-workflow-steps {
    display: grid;
    grid-template-columns: 1fr;
  }

  .selection-workflow-step {
    flex: none;
  }

  .selection-workflow-step:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -11px;
    left: 27px;
    width: 1px;
    height: 10px;
  }
}

@media (max-width: 760px) {
  .selection-workflow {
    top: 134px;
  }

  .selection-workflow-restore {
    top: 142px;
  }

  .theme-toggle {
    bottom: 12px;
  }
}

/* 2026-07-15 same-products hierarchy and density polish. */
.same-products-service-options {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(190px, 0.75fr) minmax(230px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.same-products-service-group {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.same-products-service-group + .same-products-service-group {
  padding-left: 14px;
  border-left: 1px solid #e2e8ef;
}

.same-products-service-group-label {
  color: #718096;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.same-products-service-group-controls {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.same-products-service-options label {
  min-height: 27px;
  gap: 6px;
  padding: 2px 7px;
  background: #ffffff;
  border-color: #dce4ed;
  font-size: 11px;
}

.same-products-service-options label:has(input:checked) {
  box-shadow: inset 0 0 0 1px currentColor;
}

.same-products-card-grid {
  max-height: calc(100vh - 405px);
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 10px;
  padding: 12px 18px 20px;
  background: #f4f7fa;
}

.same-products-card {
  border-color: #dfe6ee;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(23, 42, 66, 0.05);
}

.same-products-card:hover {
  border-color: #b9c8d7;
  box-shadow: 0 4px 12px rgba(23, 42, 66, 0.08);
}

.same-products-card.is-preferred {
  border-color: #dfe6ee;
  box-shadow: 0 1px 3px rgba(23, 42, 66, 0.05);
}

.same-products-card-media {
  background: #f7f9fb;
  border-bottom: 0;
}

.same-products-card-body {
  gap: 8px;
  padding: 11px 12px 10px;
}

.same-products-card-title {
  min-height: 48px;
  gap: 4px;
}

.same-products-card-title a,
.same-products-card-title > strong {
  min-height: 40px;
  color: #15263a;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
}

.same-products-card-title span {
  color: #8995a4;
  font-size: 9.5px;
  font-weight: 700;
}

.same-products-card-commerce {
  min-height: 28px;
  grid-template-columns: minmax(68px, 1.2fr) repeat(2, minmax(0, 1fr));
}

.same-products-card-commerce strong {
  color: #c73942;
  font-size: 17px;
  font-weight: 900;
}

.same-products-card-commerce span {
  color: #667589;
  font-size: 10.5px;
  font-weight: 750;
}

.same-products-card-supplier {
  min-height: 64px;
  gap: 6px;
  padding-top: 2px;
  border-top: 0;
}

.same-products-card-supplier > a,
.same-products-card-supplier > strong {
  color: #29445f;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
}

.same-products-card-tags {
  min-height: 20px;
  align-content: flex-start;
}

.same-products-card-category,
.same-products-card-tags span {
  min-height: 19px;
  padding: 1px 5px;
  color: #667487;
  background: #f1f4f7;
  border: 0;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 750;
}

.same-products-card-category {
  color: #75530e;
  background: #fff4d8;
}

.same-products-shop-years {
  min-height: 20px;
  padding: 1px 6px;
  color: #226657;
  background: #edf7f4;
  border: 0;
  border-radius: 3px;
  font-size: 10px;
}

.same-products-shop-identities span {
  min-height: 20px;
  padding: 2px 6px;
  border: 0;
  border-radius: 3px;
  font-size: 9.5px;
}

.same-products-card-actions {
  grid-template-columns: auto minmax(84px, 1fr);
  gap: 8px;
  padding: 9px 12px;
  background: #ffffff;
  border-top-color: #edf1f5;
}

.same-products-card-actions:has(.same-products-open-product) {
  grid-template-columns: auto minmax(84px, 1fr) 32px;
}

.same-products-card-actions label {
  min-height: 32px;
  color: #647286;
  font-size: 10.5px;
}

.same-products-card-actions button[data-add-supplier-to-selection] {
  min-height: 32px;
  color: #ffffff;
  background: #173a63;
  border-color: #173a63;
  font-size: 10.5px;
}

.same-products-card-actions button[data-add-supplier-to-selection]:hover,
.same-products-card-actions button[data-add-supplier-to-selection]:focus-visible {
  background: #102f52;
  border-color: #102f52;
}

.same-products-card-actions button[data-add-supplier-to-selection].is-preferred {
  color: #684600;
  background: #f8df9a;
  border-color: #d4a841;
}

.same-products-card-actions .same-products-open-product {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  color: #173a63;
  background: #edf3f8;
  border: 0;
  border-radius: 4px;
}

.same-products-card-actions .same-products-open-product::before {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  content: "≡";
}

html[data-theme="dark"] .same-products-service-group + .same-products-service-group {
  border-left-color: #344357;
}

html[data-theme="dark"] .same-products-service-options label,
html[data-theme="dark"] .same-products-card-actions {
  background: #151f2a;
}

html[data-theme="dark"] .same-products-card-grid {
  background: #101923;
}

@media (max-width: 1180px) {
  .same-products-service-options {
    grid-template-columns: 1fr 1fr;
  }

  .same-products-service-group.is-fulfillment {
    grid-column: 1 / -1;
  }

  .same-products-service-group.is-verification {
    padding-left: 0;
    border-left: 0;
  }

  .same-products-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  }
}

@media (max-width: 760px) {
  .same-products-service-options {
    display: grid;
    grid-template-columns: 1fr;
  }

  .same-products-service-group,
  .same-products-service-group.is-fulfillment {
    grid-column: 1;
    padding-left: 0;
    border-left: 0;
  }

  .same-products-service-group-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .same-products-card-grid {
    max-height: calc(100vh - 180px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 14px 20px;
  }
}

@media (max-width: 480px) {
  .same-products-service-group-controls,
  .same-products-card-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    linear-gradient(90deg, rgba(17, 24, 35, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 24, 35, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #eef2f6 0, var(--paper) 320px);
  background-size: 44px 44px, 44px 44px, auto;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.16;
}

h2 {
  font-size: 17px;
  line-height: 1.25;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 28px;
  color: #f8fbff;
  background:
    linear-gradient(90deg, rgba(15, 159, 143, 0.22), transparent 38%),
    linear-gradient(180deg, var(--nav-2), var(--nav));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 34px rgba(17, 24, 35, 0.22);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 48%),
    linear-gradient(135deg, var(--teal), var(--indigo));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(15, 159, 143, 0.22);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.topbar .eyebrow {
  color: #8fe4d9;
}

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #dce6f0;
  font-size: 13px;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(217, 139, 33, 0.2);
}

.dot.ready {
  background: #33d1a9;
  box-shadow: 0 0 0 4px rgba(51, 209, 169, 0.18);
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 24px 28px 34px;
}

.workspace,
.control-rail {
  display: grid;
  gap: 16px;
  align-content: start;
}

.module-page {
  display: grid;
  gap: 16px;
  align-content: start;
}

.module-page[hidden] {
  display: none;
}

.control-rail {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.control-rail .panel-head {
  align-items: stretch;
  flex-direction: column;
}

.control-rail .panel-head .text-button,
.control-rail .panel-head .icon-button {
  justify-self: start;
  width: fit-content;
}

.control-rail .table-wrap {
  max-height: 260px;
}

.control-rail .keyword-table {
  min-width: 560px;
}

.rail-menu {
  position: relative;
  z-index: 2;
}

.rail-menu-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 16px;
  gap: 9px;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  color: var(--ink);
  background: #f2f2f2;
  border: 1px solid #eeeeee;
  box-shadow: none;
  text-align: left;
}

.rail-menu-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
}

.rail-menu-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.rail-menu-toggle b {
  font-size: 13px;
  font-weight: 900;
}

.rail-menu-toggle i {
  display: block;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.rail-menu-toggle[aria-expanded="true"] {
  color: #ff6a00;
  background: #fff;
  border-color: #f2f2f2;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: none;
}

.rail-menu-toggle[aria-expanded="true"] i {
  transform: rotate(225deg);
}

.rail-menu-options {
  display: grid;
  gap: 0;
  margin-top: 0;
  padding: 9px 4px 12px;
  background: #fff;
  border: 1px solid #f2f2f2;
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: none;
}

.rail-menu-options button {
  height: 40px;
  padding: 0 14px 0 36px;
  color: #111827;
  background: transparent;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  text-align: left;
}

.rail-menu-options button:hover,
.rail-menu-options button.active {
  color: #ff6a00;
  background: #fff4df;
  box-shadow: none;
  transform: none;
}

.command-strip {
  display: block;
  overflow: hidden;
  padding: 18px;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(15, 159, 143, 0.08), transparent 62%),
    #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.command-strip .eyebrow {
  color: var(--teal-dark);
}

.command-strip h2 {
  max-width: 620px;
  color: #fff;
  font-size: 26px;
  font-weight: 850;
}

.searchbar {
  display: grid;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.searchbar label {
  color: var(--muted);
}

.search-main {
  display: grid;
  gap: 8px;
}

.search-control {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 132px;
  gap: 10px;
}

.search-status {
  --search-status-progress: 0%;
  display: grid;
  gap: 9px;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: linear-gradient(180deg, #fff, #f7fafc);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.search-status-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.search-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--quiet);
  box-shadow: 0 0 0 4px rgba(138, 148, 165, 0.16);
}

.search-status-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.search-status-copy strong {
  color: var(--nav);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.search-status-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.search-status-progress {
  position: relative;
  height: 6px;
  overflow: hidden;
  background: rgba(100, 112, 131, 0.16);
  border-radius: 999px;
}

.search-status-progress-fill {
  position: relative;
  display: block;
  width: var(--search-status-progress);
  min-width: 0;
  height: 100%;
  background: linear-gradient(90deg, #6c8aad, #3f6d9c);
  border-radius: inherit;
  transition: width 0.28s ease, background 0.2s ease, opacity 0.2s ease;
}

.search-status-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 24%,
    rgba(255, 255, 255, 0.78) 50%,
    rgba(255, 255, 255, 0.14) 76%,
    transparent 100%
  );
}

/* AI 模式开关 */
.ai-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.ai-mode-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ai-mode-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #cdd6e1;
  transition: background 0.2s ease;
  flex: 0 0 auto;
}

.ai-mode-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 46, 74, 0.28);
  transition: transform 0.2s ease;
}

.ai-mode-switch input:checked + .ai-mode-track {
  background: linear-gradient(90deg, #4d7cae, #2f6f9e);
}

.ai-mode-switch input:checked + .ai-mode-track .ai-mode-thumb {
  transform: translateX(16px);
}

.ai-mode-switch input:checked ~ .ai-mode-label {
  color: #2f6f9e;
}

/* AI 模式流水线进度 */
.ai-mode-pipeline {
  margin-top: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fbfdff, #f3f8fc);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.ai-mode-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-step-item {
  display: flex;
  flex: 1 1 auto;
  min-width: max-content;
}

.ai-step {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: max-content;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #e3eaf1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ai-step:disabled {
  cursor: default;
  opacity: 1;
}

.ai-step:not(:disabled):hover {
  border-color: #75b7a0;
  box-shadow: 0 2px 7px rgba(22, 133, 99, 0.12);
}

.ai-step-open {
  margin-left: 6px;
  color: #c2ccd8;
  font-weight: 900;
}

.ai-step:disabled .ai-step-open {
  visibility: hidden;
}

.ai-step-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #cdd6e1;
  flex: 0 0 auto;
}

.ai-step-meta {
  color: #8a96a8;
  font-weight: 800;
  font-size: 11px;
}

.ai-step.is-running {
  border-color: #cfe0f0;
  color: #2f6f9e;
  background: #eef6fc;
}

.ai-step.is-running .ai-step-dot {
  background: #2f8fd6;
  box-shadow: 0 0 0 4px rgba(47, 143, 214, 0.18);
  animation: ai-step-pulse 1s ease-in-out infinite;
}

.ai-step.is-done {
  border-color: #bfe3cf;
  color: #1f7a4d;
  background: #ecfaf2;
}

.ai-step.is-done .ai-step-dot {
  background: #21a368;
}

.ai-step.is-selected {
  border-color: #168563;
  box-shadow: 0 0 0 2px rgba(22, 133, 99, 0.14);
}

.ai-step.is-selected .ai-step-open {
  color: #168563;
}

.ai-step.is-failed {
  border-color: #f3c6c6;
  color: var(--red);
  background: #fdeeee;
}

.ai-step.is-failed .ai-step-dot {
  background: var(--red);
}

@keyframes ai-step-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

html[data-theme="dark"] .ai-mode-pipeline {
  background: linear-gradient(180deg, #16202c, #121a24);
  border-color: var(--line);
}

html[data-theme="dark"] .ai-step {
  background: #1a2531;
  border-color: #2a3848;
  color: #9fb0c4;
}

html[data-theme="dark"] .ai-step:not(:disabled):hover,
html[data-theme="dark"] .ai-step.is-selected {
  border-color: #4fae8e;
  box-shadow: 0 0 0 2px rgba(79, 174, 142, 0.15);
}

html[data-theme="dark"] .ai-mode-switch input:checked ~ .ai-mode-label {
  color: #6cb6e8;
}

.search-status[data-state="running"] {
  border-color: rgba(37, 99, 168, 0.22);
  background: linear-gradient(180deg, rgba(37, 99, 168, 0.08), #fff);
}

.search-status[data-state="running"] .search-status-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 168, 0.14);
  animation: search-status-pulse 1.3s ease-in-out infinite;
}

.search-status[data-state="running"] .search-status-progress {
  background: rgba(37, 99, 168, 0.14);
}

.search-status[data-state="running"] .search-status-progress-fill {
  background: linear-gradient(90deg, #6f8eb0, #2f6fb7 56%, #0f63d8);
}

.search-status[data-state="running"] .search-status-progress-fill::after {
  opacity: 1;
  animation: search-status-progress-sweep 1.4s linear infinite;
}

.search-status[data-state="success"] {
  border-color: rgba(15, 159, 143, 0.24);
  background: linear-gradient(180deg, rgba(15, 159, 143, 0.1), #fff);
}

.search-status[data-state="success"] .search-status-dot {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.16);
}

.search-status[data-state="success"] .search-status-progress {
  background: rgba(15, 159, 143, 0.15);
}

.search-status[data-state="success"] .search-status-progress-fill {
  background: linear-gradient(90deg, #2dc0a8, #0f9f8f);
}

.search-status[data-state="error"] {
  border-color: rgba(195, 68, 83, 0.26);
  background: linear-gradient(180deg, rgba(195, 68, 83, 0.09), #fff);
}

.search-status[data-state="error"] .search-status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(195, 68, 83, 0.14);
}

.search-status[data-state="error"] .search-status-progress {
  background: rgba(195, 68, 83, 0.14);
}

.search-status[data-state="error"] .search-status-progress-fill {
  background: linear-gradient(90deg, #d36c79, #c34453);
}

.search-status[data-state="cancelled"] {
  border-color: rgba(138, 148, 165, 0.3);
  background: linear-gradient(180deg, rgba(138, 148, 165, 0.1), #fff);
}

.search-status[data-state="cancelled"] .search-status-dot {
  background: #7d8797;
  box-shadow: 0 0 0 4px rgba(138, 148, 165, 0.14);
}

.search-status[data-state="cancelled"] .search-status-progress-fill {
  background: linear-gradient(90deg, #98a3b2, #687587);
}

@keyframes search-status-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.14);
  }
}

@keyframes search-status-progress-sweep {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(130%);
  }
}

.product-image-search {
  display: grid;
  grid-template-columns: minmax(210px, 0.78fr) minmax(250px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.product-image-search[hidden] {
  display: none;
}

.product-image-trigger {
  display: grid;
  min-height: 72px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px 12px;
  align-content: center;
  padding: 12px 14px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.08), rgba(245, 166, 35, 0.09)),
    #fff;
  border: 1px dashed rgba(22, 119, 255, 0.24);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.product-image-trigger:hover {
  border-color: rgba(22, 119, 255, 0.48);
  box-shadow: 0 12px 24px rgba(22, 119, 255, 0.12);
  transform: translateY(-1px);
}

.product-image-trigger span {
  grid-row: span 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #0f63d8);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 950;
}

.product-image-trigger strong {
  align-self: end;
  color: var(--nav);
  font-size: 14px;
  font-weight: 950;
}

.product-image-trigger small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.product-image-preview {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.product-image-preview[data-empty="true"] {
  color: var(--quiet);
  background:
    repeating-linear-gradient(135deg, rgba(22, 119, 255, 0.04) 0 8px, transparent 8px 16px),
    #fbfcfe;
}

.product-image-preview img {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.product-image-preview .upload-preview-button,
.image-search-preview .upload-preview-button {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  cursor: zoom-in;
}

.product-image-preview .upload-preview-button {
  width: 56px;
  height: 56px;
}

.product-image-preview .upload-preview-button[hidden],
.image-search-preview .upload-preview-button[hidden] {
  display: none;
}

.product-image-preview .upload-preview-button img,
.image-search-preview .upload-preview-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.upload-preview-button::after {
  position: absolute;
  inset: auto 5px 5px;
  padding: 3px 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  content: "放大";
  background: rgba(15, 23, 42, 0.72);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.upload-preview-button:hover::after,
.upload-preview-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.product-image-preview div {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.product-image-preview span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-image-actions .text-button {
  height: 28px;
  padding: 0 10px;
}

.product-image-result-button[hidden] {
  display: none;
}

.keyword-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.keyword-examples span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.keyword-examples button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 12px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(26, 58, 92, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.keyword-examples button:hover {
  color: var(--nav);
  background: #fffaf1;
  border-color: rgba(245, 166, 35, 0.42);
  box-shadow: 0 10px 22px rgba(245, 166, 35, 0.12);
  transform: translateY(-1px);
}

.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
  color: var(--ink);
}

.filter-toolbar span {
  font-size: 13px;
  font-weight: 900;
}

.filter-toolbar small {
  color: var(--muted);
  font-size: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.search-filter {
  display: grid;
  grid-column: span 2;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 88px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(9, 16, 26, 0.13);
}

.rating-filter {
  align-items: start;
}

.own-rating-filter {
  border-color: rgba(217, 139, 33, 0.32);
}

.competitor-rating-filter {
  border-color: rgba(37, 99, 168, 0.3);
}

.rule-filter {
  grid-column: 1 / -1;
}

.search-filter:nth-child(2) .filter-icon,
.search-filter:nth-child(3) .filter-icon,
.search-filter:nth-child(4) .filter-icon {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, #2563a8, var(--teal));
  box-shadow: 0 8px 16px rgba(37, 99, 168, 0.18);
}

.search-filter label {
  margin-bottom: 5px;
  color: var(--muted);
}

.rating-filter label {
  color: var(--ink-soft);
  font-weight: 900;
}

.filter-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(135deg, var(--amber), var(--teal-dark));
  border-radius: 9px;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(217, 139, 33, 0.2);
}

.rating-filter .filter-icon {
  margin-top: 17px;
}

.filter-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.filter-caption {
  margin: 6px 0 0;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.rule-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}

.rule-copy strong {
  color: var(--teal-dark);
  font-weight: 900;
}

label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

input {
  width: 100%;
  height: 44px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  padding: 0 12px;
}

select {
  width: 100%;
  height: 38px;
  color: var(--ink);
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 17px) 16px / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 12px) 16px / 5px 5px no-repeat,
    #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  padding: 0 32px 0 10px;
}

input::placeholder {
  color: var(--quiet);
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.15);
}

button {
  min-width: 0;
  height: 44px;
  color: #fff;
  background: var(--teal-dark);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 850;
}

button:hover {
  background: #095d55;
  box-shadow: 0 8px 18px rgba(11, 118, 107, 0.18);
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 159, 143, 0.32);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  box-shadow: none;
  transform: none;
}

.text-button,
.icon-button {
  width: auto;
  height: 34px;
  padding: 0 11px;
  color: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.panel .text-button,
.icon-button {
  color: var(--teal-dark);
  background: #eef8f7;
  border-color: #cde8e5;
}

.text-button:hover,
.panel .text-button:hover,
.icon-button:hover {
  color: var(--teal-dark);
  background: #dff2f0;
  border-color: #b8ded9;
  box-shadow: none;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.metric-row article {
  min-height: 100px;
  padding: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.metric-row article:nth-child(1) {
  border-top: 3px solid var(--teal);
}

.metric-row article:nth-child(2) {
  border-top: 3px solid var(--indigo);
}

.metric-row article:nth-child(3) {
  border-top: 3px solid var(--amber);
}

.metric-row article:nth-child(4) {
  border-top: 3px solid var(--red);
}

.metric-row article:nth-child(5) {
  border-top: 3px solid var(--blue);
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-row strong {
  display: block;
  margin-top: 11px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.panel {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel.compact {
  box-shadow: 0 8px 20px rgba(21, 25, 35, 0.06);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.result-head {
  align-items: center;
  flex-direction: row;
  gap: 16px;
}

.result-title-block {
  display: grid;
  gap: 3px;
}

.result-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profit-product-list-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profit-product-list-tools button {
  min-height: 34px;
  white-space: nowrap;
}

.profit-product-list-tools button[hidden] {
  display: none !important;
}

body.profit-analysis-active .result-head {
  align-items: stretch;
  flex-direction: column;
}

body.profit-analysis-active .result-actions-bar {
  width: 100%;
  flex-wrap: wrap;
  justify-content: space-between;
}

.result-sort-control {
  display: inline-flex;
  align-items: center;
  height: 40px;
  gap: 0;
  padding: 3px;
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(26, 58, 92, 0.05);
  overflow: hidden;
  white-space: nowrap;
}

.result-sort-label {
  display: inline-flex;
  height: 32px;
  align-items: center;
  padding: 0 10px 0 11px;
  color: #5d6676;
  border-right: 1px solid #e5ecf4;
  font-size: 12px;
  font-weight: 850;
}

.result-sort-control select {
  height: 32px;
  min-width: 108px;
  padding: 0 28px 0 10px;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 850;
  outline: none;
}

.result-sort-control select + select {
  border-left: 1px solid #e5ecf4;
  border-radius: 0 7px 7px 0;
}

#resultSortField {
  min-width: 154px;
}

#resultSortDirection {
  min-width: 104px;
}

.result-sort-control select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.result-sort-control select:disabled {
  cursor: not-allowed;
  color: #9aa4b2;
  background: #f5f7fa;
}

.compare-products-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: #fff;
  background: #1677ff;
  border: 1px solid #1677ff;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.22);
  font-size: 13px;
  font-weight: 900;
}

.compare-products-button strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  color: #1677ff;
  background: #fff;
  border-radius: 999px;
  font-size: 12px;
}

.compare-products-button:disabled {
  cursor: not-allowed;
  color: #8a94a5;
  background: #eef2f7;
  border-color: #dfe6ef;
  box-shadow: none;
}

.compare-products-button:disabled strong {
  color: #7d8796;
  background: #fff;
}

.continue-collect-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  color: #0f4d75;
  background: #eef8ff;
  border: 1px solid #b9ddf6;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(15, 77, 117, 0.08);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.continue-collect-button:hover:not(:disabled) {
  background: #e1f2ff;
  border-color: #7fc0ee;
}

.continue-collect-button strong {
  display: inline-flex;
  align-items: center;
  min-width: 50px;
  height: 22px;
  justify-content: center;
  padding: 0 8px;
  color: #fff;
  background: #0f6fb3;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.continue-collect-button:disabled {
  cursor: not-allowed;
  color: #8a94a5;
  background: #f3f6fa;
  border-color: #dfe6ef;
  box-shadow: none;
}

.continue-collect-button:disabled strong {
  color: #7d8796;
  background: #fff;
}

.continue-collect-button.is-loading strong {
  color: #0f6fb3;
  background: #fff;
}

.bulk-review-query-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  color: #ffffff;
  background: #176b61;
  border: 1px solid #176b61;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: none;
}

.bulk-review-query-button:hover:not(:disabled) {
  background: #12564e;
  border-color: #12564e;
  box-shadow: none;
  transform: none;
}

.bulk-review-query-button strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  color: #176b61;
  background: #ffffff;
  border-radius: 50%;
  font-size: 11px;
}

.bulk-review-query-button:disabled {
  color: #8793a2;
  background: #eef2f5;
  border-color: #d8e0e8;
  cursor: not-allowed;
}

.bulk-review-query-button:disabled strong {
  color: #7d8997;
}

.sort-caption,
.sort-option {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-right: 1px solid var(--line);
}

.sort-caption {
  color: var(--muted);
  background: #f6f9fd;
  font-size: 12px;
  font-weight: 900;
}

.sort-option {
  justify-content: space-between;
  gap: 8px;
  min-width: 82px;
  height: auto;
  color: var(--ink);
  background: #fff;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.sort-option:last-child {
  border-right: 0;
}

.sort-option:hover {
  color: var(--nav);
  background: #fff8ed;
  box-shadow: inset 0 -2px 0 rgba(245, 166, 35, 0.38);
  transform: none;
}

.sort-option.active {
  color: var(--nav);
  background: #fff4df;
  box-shadow: inset 0 -3px 0 var(--amber);
}

.watch-auto-refresh-status {
  margin: 5px 0 0;
  color: #28775f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.watch-auto-refresh-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: #238a68;
  border-radius: 50%;
  vertical-align: 1px;
}

.watch-auto-refresh-status.is-disabled {
  color: #7a8796;
}

.watch-auto-refresh-status.is-disabled::before {
  background: #98a3b1;
}

.sort-option i {
  position: relative;
  display: grid;
  width: 10px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.5;
}

.sort-option i::before,
.sort-option i::after {
  content: "";
  position: absolute;
  left: 2px;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.sort-option i::before {
  top: 1px;
  border-bottom: 5px solid var(--quiet);
}

.sort-option i::after {
  bottom: 1px;
  border-top: 5px solid var(--quiet);
}

.sort-option[data-direction="asc"] i::before,
.sort-option[data-direction="desc"] i::after {
  border-top-color: var(--amber);
  border-bottom-color: var(--amber);
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.profile-page {
  display: grid;
  gap: 18px;
  align-content: start;
}

.profile-panel {
  overflow: hidden;
  border-color: rgba(26, 58, 92, 0.18);
}

.profile-head {
  background:
    radial-gradient(circle at 90% 20%, rgba(245, 166, 35, 0.13), transparent 28%),
    linear-gradient(90deg, rgba(26, 58, 92, 0.12), transparent 58%),
    linear-gradient(180deg, #fbfdff, #f7fafc);
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.profile-summary article {
  min-height: 92px;
  padding: 18px;
  background: #fff;
}

.profile-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.profile-summary strong {
  display: block;
  margin-top: 10px;
  color: var(--nav);
  font-size: 24px;
  line-height: 1;
}

.admin-panel {
  border-color: #b8d9d5;
}

.admin-head {
  background:
    linear-gradient(90deg, rgba(15, 159, 143, 0.12), transparent 56%),
    #fbfdfd;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-metrics article {
  min-height: 82px;
  padding: 14px 16px;
  background: #fff;
}

.admin-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.admin-metrics strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.admin-create-form {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(120px, 0.8fr) minmax(120px, 0.7fr) minmax(150px, 1fr) 116px minmax(200px, 0.8fr);
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-create-form input,
.admin-create-form select,
.admin-create-form button {
  height: 38px;
}

.admin-create-form p {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.seasonality-panel {
  border-color: #bfd7ef;
  box-shadow: 0 18px 42px rgba(26, 58, 92, 0.1);
}

.seasonality-head {
  align-items: center;
  background:
    radial-gradient(circle at 92% 18%, rgba(245, 166, 35, 0.12), transparent 28%),
    linear-gradient(90deg, rgba(37, 99, 168, 0.14), transparent 58%),
    linear-gradient(180deg, #fbfdff, #f7fafc);
}

.seasonality-head h2 {
  max-width: 880px;
  color: var(--nav);
  font-size: 28px;
  line-height: 1.15;
}

.source-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px 10px;
  color: #174a83;
  background: #eaf4ff;
  border: 1px solid #c5def5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.product-dashboard-summary {
  display: grid;
  gap: 12px;
  padding: 14px 18px 18px;
  background:
    linear-gradient(135deg, rgba(245, 166, 35, 0.1), transparent 44%),
    linear-gradient(180deg, #fff, #f8fbff);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-dashboard-summary[hidden] {
  display: none !important;
}

.product-dashboard-hero {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(202, 213, 225, 0.72);
  border-radius: 16px;
}

.product-dashboard-hero img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  background: #eef4fb;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.product-dashboard-hero h3 {
  max-width: 980px;
  color: var(--nav);
  font-size: 17px;
  line-height: 1.35;
}

.product-dashboard-hero h3 a {
  color: inherit;
  text-decoration: none;
}

.product-dashboard-hero h3 a:hover {
  color: #d97706;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.product-dashboard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.product-dashboard-tags span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 9px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.dashboard-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.dashboard-section-title h4 {
  color: var(--nav);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.dashboard-section-title p {
  color: var(--muted);
  font-size: 12px;
}

.product-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.product-dashboard-metrics article {
  min-height: 74px;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(26, 58, 92, 0.045);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.product-dashboard-metrics article:hover {
  border-color: rgba(46, 124, 195, 0.28);
  box-shadow: 0 14px 26px rgba(26, 58, 92, 0.08);
  transform: translateY(-1px);
}

.product-dashboard-metrics article:nth-child(odd) {
  background: #f8fbff;
}

.keyword-metrics article {
  border-top: 3px solid #7dd3fc;
}

.category-metrics article {
  border-top: 3px solid #2e7cc3;
}

.product-dashboard-metrics .wide-metric {
  grid-column: span 2;
}

.category-extension-metric strong {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  white-space: normal;
}

.product-detail-metrics article {
  border-top: 3px solid var(--amber);
}

.product-dashboard-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.product-dashboard-metrics strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.same-products-card-ranking {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 3px;
}

.same-products-card-score {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  padding: 1px 6px;
  border: 1px solid #cbd8e7;
  border-radius: 3px;
  font-family: var(--font-number);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.same-products-card-score.is-combined {
  color: #1c568b;
  background: #edf5fc;
}

.same-products-card-score.is-keyword {
  color: #17613c;
  background: #eaf7ee;
  border-color: #b9ddc7;
}

.same-products-card-score.is-image,
.same-products-image-score {
  color: #725100 !important;
  background: #fff5d8 !important;
  border-color: #e8cf82 !important;
}

.same-products-combined-score {
  color: #1c568b !important;
  background: #edf5fc;
  border-color: #c5d9eb;
}

.product-dashboard-metrics small {
  display: inline-flex;
  margin-top: 7px;
  padding: 2px 7px;
  color: #80520d;
  background: #fff6e8;
  border: 1px solid #f0d4a5;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.competitor-page-panel {
  overflow: visible;
}

.competitor-page-head {
  position: sticky;
  top: 106px;
  z-index: 18;
  align-items: flex-start;
  background:
    linear-gradient(180deg, rgba(249, 252, 255, 0.98), rgba(237, 245, 252, 0.96));
  border-bottom: 1px solid #cbd9e8;
  box-shadow: 0 14px 28px rgba(18, 40, 68, 0.09);
  backdrop-filter: blur(10px);
}

.competitor-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.competitor-compare-button {
  gap: 8px;
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.18);
}

.competitor-compare-button strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  color: #1677ff;
  background: #fff;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
}

.competitor-compare-button:disabled {
  color: #8a94a5;
  background: #eef2f7;
  border-color: #dfe6ef;
  box-shadow: none;
}

.competitor-compare-button:disabled strong {
  color: #7d8796;
}

.image-similarity-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 18px;
  color: #1f2329;
  background: #f8fbff;
  border-top: 1px solid var(--line);
}

.image-similarity-summary strong,
.image-similarity-summary span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #dfe8f5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.image-similarity-summary strong {
  color: #0f5fd7;
  background: #eef6ff;
  border-color: #cfe4ff;
}

.competitor-product-summary {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.08), transparent 48%),
    linear-gradient(180deg, #fff, #f8fbff);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.competitor-product-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 0;
  background: #f8fbff;
  border-top: 1px solid var(--line);
}

.competitor-product-groups[hidden] {
  display: none;
}

.competitor-product-group {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce8f5;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(18, 40, 68, 0.055);
}

.competitor-product-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border-bottom: 1px solid #e5eef7;
}

.competitor-product-group-head strong {
  color: #10243f;
  font-size: 14px;
  font-weight: 950;
}

.competitor-product-group-head span {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: #0f5ca8;
  background: #eef7ff;
  border: 1px solid #cfe7ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.competitor-product-group-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  background: #f8fbff;
}

.competitor-group-product {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 82px;
  gap: 10px;
  align-items: center;
  min-height: 82px;
  padding: 9px;
  background: #fff;
  border: 1px solid #e2eaf4;
  border-radius: 11px;
}

.competitor-group-product img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  background: #eef4fa;
  border: 1px solid #dce6f1;
  border-radius: 9px;
}

.competitor-group-product div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.competitor-group-product strong,
.competitor-group-product span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competitor-group-product strong {
  color: #17233a;
  font-size: 13px;
  font-weight: 950;
}

.competitor-group-product span {
  color: #708096;
  font-size: 11px;
  font-weight: 800;
}

.competitor-group-product small {
  width: fit-content;
  padding: 3px 7px;
  color: #10605a;
  background: #ecfbf7;
  border: 1px solid #c7eee5;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.competitor-group-product button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  color: #fff;
  background: #17365a;
  border: 1px solid #17365a;
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.competitor-group-product button:hover {
  background: #0e2745;
  border-color: #0e2745;
}

.competitor-product-group-empty {
  display: grid;
  min-height: 140px;
  place-items: center;
  color: #718096;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.competitor-metric-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 4px;
}

.competitor-metric-cards article {
  min-height: 82px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid #2e7cc3;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(26, 58, 92, 0.05);
}

.competitor-metric-cards span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.competitor-metric-cards strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 16px;
  line-height: 1.25;
}

.competitor-metric-cards .metric-success {
  border-top-color: #52c41a;
}

.competitor-metric-cards .metric-success strong,
.price-lower {
  color: #17834f;
}

.competitor-metric-cards .metric-warning {
  border-top-color: var(--amber);
}

.competitor-metric-cards .metric-warning strong,
.price-higher {
  color: #d97706;
}

.competitor-table-wrap {
  padding: 12px 18px 18px;
}

.competitor-select-cell {
  width: 54px;
}

.competitor-compare-check {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  cursor: pointer;
}

.competitor-compare-check input {
  position: absolute;
  opacity: 0;
}

.competitor-compare-check span {
  display: block;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 1px solid #cfd8e6;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #fff;
}

.competitor-compare-check input:checked + span {
  background: #1677ff;
  border-color: #1677ff;
}

.competitor-compare-check input:checked + span::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  margin: 5px auto 0;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(-45deg);
}

.competitor-name {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.competitor-name strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.summary-title-cn,
.competitor-title-cn {
  display: -webkit-box;
  overflow: hidden;
  color: #516174;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
}

.summary-title-cn {
  max-width: 760px;
  margin-top: -2px;
  -webkit-line-clamp: 2;
}

.competitor-title-cn {
  -webkit-line-clamp: 1;
}

.competitor-title-link {
  color: var(--ink);
  text-decoration: none;
}

.competitor-title-link:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.competitor-name small {
  color: var(--muted);
  font-size: 11px;
}

.competitor-rank {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #174a83;
  background: #eaf4ff;
  border: 1px solid #c5def5;
  border-radius: 999px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  font-weight: 900;
}

.competitor-photo {
  display: inline-grid;
  width: 58px;
  height: 58px;
  overflow: hidden;
  place-items: center;
  background: #fff;
  border: 1px solid #dbe5f0;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(21, 35, 56, 0.08);
}

.competitor-photo:hover {
  border-color: #9dc9ff;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.16);
  transform: translateY(-1px);
}

.competitor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.22s ease;
}

.competitor-photo:hover img {
  transform: scale(1.06);
}

.competitor-photo-placeholder {
  display: inline-grid;
  min-width: 72px;
  height: 34px;
  place-items: center;
  color: #8a94a5;
  background: #f5f7fa;
  border: 1px dashed #d5dde8;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
}

.competitor-table th,
.competitor-table td {
  padding-right: 9px;
  padding-left: 9px;
  vertical-align: middle;
}

.competitor-table th:nth-child(1),
.competitor-table td:nth-child(1),
.competitor-table th:nth-child(2),
.competitor-table td:nth-child(2),
.competitor-table th:nth-child(4),
.competitor-table td:nth-child(4),
.competitor-table th:nth-child(5),
.competitor-table td:nth-child(5),
.competitor-table th:nth-child(8),
.competitor-table td:nth-child(8),
.competitor-table th:nth-child(9),
.competitor-table td:nth-child(9),
.competitor-table th:nth-child(12),
.competitor-table td:nth-child(12) {
  text-align: center;
}

.competitor-table th:nth-child(6),
.competitor-table td:nth-child(6),
.competitor-table th:nth-child(7),
.competitor-table td:nth-child(7),
.competitor-table th:nth-child(11),
.competitor-table td:nth-child(11) {
  text-align: right;
}

.competitor-table td:nth-child(6),
.competitor-table td:nth-child(7),
.competitor-table td:nth-child(8),
.competitor-table td:nth-child(9),
.competitor-table td:nth-child(11) {
  color: #10243d;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.competitor-table td:nth-child(10) {
  color: #24364b;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.competitor-table td:nth-child(12) a {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Merged media cell: photo + search button */
.competitor-media-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 4px;
}

.competitor-media-cell .competitor-photo {
  width: 48px;
  height: 48px;
}

/* Price diff cell with background color */
.competitor-diff-cell {
  position: relative;
  overflow: hidden;
}

.competitor-diff-cell .diff-bar {
  position: absolute;
  top: 0;
  height: 100%;
  width: var(--diff-pct, 0%);
  opacity: var(--diff-opacity, 0.18);
  pointer-events: none;
}

.competitor-diff-cell .diff-bar.is-lower {
  right: 0;
  background: #16a34a;
}

.competitor-diff-cell .diff-bar.is-higher {
  left: 0;
  background: #dc2626;
}

.competitor-diff-cell .diff-value {
  position: relative;
  z-index: 1;
  display: block;
  padding: 2px 6px;
  font-weight: 800;
}

.competitor-diff-cell.diff-much-lower .diff-value { color: #15803d; }
.competitor-diff-cell.diff-lower .diff-value { color: #16a34a; }
.competitor-diff-cell.diff-much-higher .diff-value { color: #dc2626; }
.competitor-diff-cell.diff-higher .diff-value { color: #ef4444; }

.same-product-badge {
  display: inline-flex;
  min-width: 62px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.same-product-badge.high {
  color: #17834f;
  background: #ecfdf3;
  border: 1px solid #b7ebc6;
}

.same-product-badge.medium {
  color: #9a5b00;
  background: #fff7e6;
  border: 1px solid #ffd591;
}

.same-product-badge.low {
  color: #d94d45;
  background: #fff1f0;
  border: 1px solid #ffccc7;
}

.same-product-badge.pending {
  color: var(--muted);
  background: #f5f7fa;
  border: 1px solid var(--line);
}

.seasonality-form {
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(220px, 0.7fr) 132px 128px;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.trend-search-form {
  grid-template-columns: minmax(420px, 1fr) 180px;
  gap: 12px;
  align-items: end;
  padding: 18px 20px;
}

.trend-keyword-field input,
.trend-keyword-field select,
.trend-page-field input,
.trend-page-field select {
  height: 42px;
  font-weight: 850;
}

.seasonality-form input,
.seasonality-form select,
.seasonality-form button {
  height: 38px;
}

.period-strip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0;
  overflow: hidden;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.period-strip span,
.period-strip button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.period-strip span {
  min-width: 82px;
  color: var(--ink);
  background: #fff;
}

.period-strip button {
  min-width: 80px;
  padding: 0 16px;
  color: var(--ink-soft);
  background: transparent;
}

.period-strip button:last-child {
  border-right: 0;
}

.period-strip button.active {
  color: #174a83;
  background: #fff;
  box-shadow: inset 0 0 0 1px #4586e8;
}

.period-strip button:disabled {
  cursor: default;
  opacity: 1;
  transform: none;
}

.seasonality-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  background:
    linear-gradient(180deg, #fff, #fbfcfe);
}

.seasonality-chart-card {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.seasonality-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.seasonality-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-weight: 900;
}

.seasonality-legend i {
  width: 10px;
  height: 10px;
  background: #628cfb;
  border-radius: 2px;
  box-shadow: 0 0 0 4px rgba(98, 140, 251, 0.13);
}

.seasonality-legend small {
  color: var(--quiet);
  font-size: 12px;
}

.seasonality-chart {
  min-height: 430px;
  overflow-x: auto;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(234, 244, 255, 0.45), transparent 42%),
    #fff;
  border: 1px solid #edf2f7;
  border-radius: 7px;
}

.seasonality-chart.empty {
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
}

.seasonality-chart svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.category-hot-keyword-chart {
  min-height: 360px;
  padding: 12px;
  overflow: auto;
  background: #ffffff;
}

.category-hot-keyword-board {
  display: grid;
  min-width: 860px;
  gap: 10px;
}

.category-hot-keyword-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  color: #26364c;
  border: 1px solid #dfeaf6;
  border-radius: 8px;
  background: #fff;
}

.category-hot-keyword-table th,
.category-hot-keyword-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e7eef7;
  text-align: left;
  vertical-align: middle;
}

.category-hot-keyword-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7faff;
  color: #42536a;
  font-size: 12px;
  font-weight: 950;
}

.category-hot-keyword-table th span,
.category-hot-keyword-table th small {
  display: block;
}

.category-hot-keyword-table th span {
  color: #12243d;
  font-family: var(--font-number);
  font-size: 12px;
}

.category-hot-keyword-table th small,
.category-hot-keyword-table td small {
  margin-top: 3px;
  color: #7b8798;
  font-size: 11px;
  font-weight: 800;
}

.category-hot-keyword-table tbody tr:last-child td {
  border-bottom: 0;
}

.category-hot-keyword-table tbody tr:hover {
  background: #fbfdff;
}

.category-hot-keyword-table strong {
  color: #061a33;
  font-size: 14px;
  font-weight: 950;
}

.category-hot-keyword-table td:nth-child(4),
.category-hot-keyword-table td:nth-child(5) {
  white-space: nowrap;
}

.rank-pill,
.change-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 950;
}

.rank-pill {
  color: #174a83;
  background: #eef6ff;
  border: 1px solid #d5e8ff;
  font-family: var(--font-number);
}

.change-pill,
.type-pill {
  color: #647083;
  background: #f6f8fb;
  border: 1px solid #e5edf6;
}

.change-pill.up,
.type-pill.up {
  color: #0f7a56;
  background: #ecfdf5;
  border-color: #bfecd7;
}

.change-pill.down,
.type-pill.down {
  color: #b42318;
  background: #fff1f0;
  border-color: #ffd1cc;
}

.muted-cell {
  color: #98a3b3;
  font-weight: 800;
}

.category-hot-keyword-empty {
  display: grid;
  min-height: 330px;
  align-content: center;
  gap: 14px;
  place-items: center;
  padding: 24px;
  color: #53637a;
  font-size: 13px;
  font-weight: 800;
}

.category-hot-keyword-status {
  width: min(100%, 560px);
  padding: 18px 20px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.category-hot-keyword-empty.is-error .category-hot-keyword-status {
  border-color: #fed7aa;
  background: #fff8ed;
}

.category-hot-keyword-status strong {
  display: block;
  color: #1e2b3c;
  font-size: 16px;
  font-weight: 950;
}

.category-hot-keyword-status p {
  margin: 8px 0 12px;
  color: #53637a;
  font-size: 13px;
  line-height: 1.7;
}

.category-hot-keyword-status div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.category-hot-keyword-status span {
  padding: 5px 8px;
  border: 1px solid #e1e8f0;
  border-radius: 999px;
  background: #fff;
  color: #38465a;
  font-size: 12px;
  font-weight: 850;
}

.category-hot-keyword-status small {
  display: block;
  color: #7b8798;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.6;
}

.category-hot-keyword-schema {
  width: min(100%, 760px);
  padding: 14px;
  border: 1px solid #dfeaf6;
  border-radius: 8px;
  background: #fff;
}

.category-hot-keyword-schema-title {
  margin-bottom: 10px;
  color: #1e2b3c;
  font-size: 13px;
  font-weight: 950;
}

.category-hot-keyword-schema-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.category-hot-keyword-schema-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e5edf6;
  border-radius: 8px;
  background: #f8fbff;
}

.category-hot-keyword-schema-grid code {
  display: block;
  overflow: hidden;
  color: #12243d;
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-hot-keyword-schema-grid span {
  display: block;
  margin-top: 5px;
  color: #54708f;
  font-size: 11px;
  font-weight: 900;
}

.category-hot-keyword-schema-grid p {
  margin: 8px 0 0;
  color: #677589;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.season-grid {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.season-axis {
  fill: #53637a;
  font-size: 12px;
  font-weight: 800;
}

.season-frame {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.season-area {
  fill: url("#seasonArea");
}

.season-line {
  fill: none;
  stroke: #628cfb;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.season-marker {
  fill: #fff;
  stroke: #628cfb;
  stroke-width: 2;
}

.season-marker.peak {
  fill: #fff6e8;
  stroke: var(--amber);
}

.season-marker.off {
  fill: #eef8f7;
  stroke: var(--teal-dark);
}

.seasonality-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
}

.seasonality-insights article {
  min-height: 92px;
}

.seasonality-insights article,
.seasonality-insights p {
  padding: 13px 14px;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-left: 3px solid #628cfb;
  border-radius: var(--radius);
}

.seasonality-insights article:nth-child(1) {
  border-left-color: var(--amber);
}

.seasonality-insights article:nth-child(2) {
  border-left-color: var(--teal-dark);
}

.seasonality-insights span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.seasonality-insights strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.seasonality-insights p {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.seasonality-hot-keywords {
  grid-column: 1 / -1;
}

.trend-hot-keywords {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
}

.trend-hot-keywords > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trend-hot-keywords strong {
  color: var(--nav);
  font-size: 13px;
  font-weight: 950;
}

.trend-hot-keywords > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trend-hot-keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.trend-hot-keyword-list span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  color: #17365a;
  background: #fff;
  border: 1px solid #d7e4f1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.trend-hot-keyword-list i {
  color: #0f9f8f;
  font-style: normal;
  font-weight: 950;
}

.reverse-panel {
  border-color: #d7c28c;
}

.reverse-panel .panel-head {
  background:
    linear-gradient(90deg, rgba(217, 139, 33, 0.13), transparent 54%),
    #fffdf8;
}

.reverse-form {
  display: grid;
  grid-template-columns: minmax(200px, 0.75fr) minmax(320px, 1.2fr) minmax(250px, 0.9fr) minmax(140px, 0.45fr);
  gap: 12px;
  align-items: end;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.86), #fff 72%),
    #fff;
  border-bottom: 1px solid var(--line);
}

.reverse-form > div {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.reverse-form label {
  color: var(--nav);
  font-size: 12px;
  font-weight: 900;
}

.reverse-form button,
.reverse-form input,
.reverse-form select {
  height: 42px;
  border-radius: 12px;
}

.category-cascade {
  position: relative;
  min-width: 0;
}

.category-cascade.is-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 119;
  background: rgba(15, 23, 42, 0.16);
}

.reverse-form .category-cascade-trigger {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  text-align: left;
}

.category-cascade-trigger:hover,
.category-cascade-trigger:focus-visible,
.category-cascade.is-open .category-cascade-trigger {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 139, 33, 0.12);
}

.category-cascade-trigger > span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-cascade-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.16s ease;
}

.category-cascade.is-open .category-cascade-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.category-cascade-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 120;
  display: grid;
  width: min(1260px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 32px));
  grid-template-columns: minmax(220px, 250px) minmax(210px, 240px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--amber);
  border-radius: 6px;
  box-shadow: 0 20px 46px rgba(21, 25, 35, 0.18);
  transform: translate(-50%, -50%);
}

.category-cascade-menu[hidden] {
  display: none;
}

.category-cascade-menu.is-two-level {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
}

.category-cascade-menu.is-two-level .category-cascade-middles-panel {
  display: none;
}

.category-cascade-menu.is-two-level .category-cascade-children-panel {
  grid-column: 2;
}

.category-cascade-parents-panel,
.category-cascade-middles-panel {
  display: flex;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #f4f7fa;
  border-right: 1px solid var(--line);
}

.category-cascade-middles-panel {
  background: #fafbfd;
}

.category-cascade-level-label {
  display: flex;
  min-height: 48px;
  align-items: center;
  padding: 10px 14px;
  color: var(--nav);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
}

.category-cascade-parents {
  display: grid;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 2px;
  overflow: auto;
  padding: 8px;
}

.category-cascade-parent-row,
.category-cascade-middle-row {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 2px;
}

.reverse-form .category-cascade-parent {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 4px;
  text-align: left;
}

.reverse-form .category-cascade-drill {
  display: grid;
  width: 30px;
  min-width: 30px;
  height: auto;
  min-height: 100%;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 20px;
  font-weight: 700;
}

.reverse-form .category-cascade-drill:hover,
.reverse-form .category-cascade-drill:focus-visible,
.reverse-form .category-cascade-drill.is-active {
  color: #245d91;
  background: #dce8f4;
}

.category-cascade-parent span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.category-cascade-parent small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.category-cascade-parent:hover,
.category-cascade-parent.is-active {
  color: #173f67;
  background: #e7eef6;
}

.category-cascade-parent.is-selected,
.category-cascade-middle.is-selected {
  color: #173f67;
  background: #edf4fa;
  box-shadow: inset 3px 0 0 #245d91;
}

.category-cascade-parent.is-active small {
  color: #245d91;
}

.category-cascade-middles {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  overflow: auto;
  padding: 8px;
}

.reverse-form .category-cascade-middle {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 54px;
  align-content: center;
  gap: 3px;
  padding: 9px 10px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 4px;
  text-align: left;
}

.category-cascade-middle strong {
  font-size: 12px;
  line-height: 1.3;
}

.category-cascade-middle small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
}

.category-cascade-middle:hover,
.category-cascade-middle:focus-visible,
.category-cascade-middle.is-active {
  color: #173f67;
  background: #e7eef6;
}

.category-cascade-middle.is-active {
  box-shadow: inset 3px 0 0 #245d91;
}

.category-cascade-middle.is-active small {
  color: #245d91;
}

.category-cascade-children-panel {
  display: flex;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.category-cascade-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.category-cascade-head strong {
  color: var(--nav);
  font-size: 14px;
}

.category-cascade-heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.category-cascade-heading small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.category-cascade-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reverse-form .category-cascade-clear {
  width: 34px;
  height: 28px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.category-cascade-clear:hover,
.category-cascade-clear:focus-visible {
  color: var(--blue);
  background: #eef4fa;
}

.category-cascade-children {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 14px;
}

.reverse-form .category-cascade-child {
  display: grid;
  width: 100%;
  height: auto;
  min-height: 62px;
  align-content: center;
  gap: 4px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: left;
}

.category-cascade-child strong {
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.category-cascade-child small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.category-cascade-child:hover,
.category-cascade-child:focus-visible {
  background: #fffaf1;
  border-color: #d9a34f;
}

.category-cascade-child.is-selected {
  color: #173f67;
  background: #edf4fa;
  border-color: #4f7fa8;
  box-shadow: inset 3px 0 0 #245d91;
}

.category-cascade-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 680px) {
  .category-cascade-menu {
    position: fixed;
    top: auto;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 32px);
    height: min(500px, calc(100vh - 150px));
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: minmax(150px, 42%) minmax(0, 1fr);
    transform: none;
  }

  .category-cascade-parents-panel {
    grid-row: 1 / 3;
  }

  .category-cascade-middles-panel {
    grid-column: 2;
    grid-row: 1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .category-cascade-children-panel {
    grid-column: 2;
    grid-row: 2;
  }

  .category-cascade-menu.is-two-level .category-cascade-children-panel {
    grid-row: 1 / 3;
  }

  .category-cascade-level-label {
    min-height: 36px;
    padding: 7px 9px;
  }

  .category-cascade-parents,
  .category-cascade-middles {
    padding: 5px;
  }

  .category-cascade-parent small {
    display: none;
  }

  .category-cascade-children {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 5px;
    padding: 7px;
  }

  .reverse-form .category-cascade-middle {
    min-height: 44px;
    padding: 6px 8px;
  }

  .category-cascade-middle small {
    display: none;
  }
}

@media (max-height: 620px) and (min-width: 681px) {
  .category-cascade-menu {
    grid-template-columns: minmax(190px, 220px) minmax(180px, 210px) minmax(0, 1fr);
  }

  .category-cascade-parents {
    gap: 1px;
    padding: 6px;
  }

  .reverse-form .category-cascade-parent {
    min-height: 36px;
    padding: 6px 8px;
  }

  .category-cascade-parent span {
    font-size: 11px;
  }

  .category-cascade-parent small {
    display: none;
  }

  .category-cascade-head {
    min-height: 42px;
    padding: 7px 10px;
  }

  .category-cascade-level-label {
    min-height: 42px;
    padding: 7px 10px;
  }

  .category-cascade-middles {
    padding: 6px;
  }

  .reverse-form .category-cascade-middle {
    min-height: 43px;
    padding: 6px 8px;
  }

  .category-cascade-children {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .reverse-form .category-cascade-child {
    min-height: 52px;
    padding: 7px 9px;
  }
}

.image-search-upload {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(210px, 0.85fr) minmax(260px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.image-search-upload[hidden],
.image-search-preview img[hidden] {
  display: none;
}

.image-search-trigger {
  display: grid;
  min-height: 76px;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px 12px;
  align-content: center;
  padding: 12px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(245, 166, 35, 0.16), rgba(15, 159, 143, 0.09)),
    #fffdf8;
  border: 1px dashed #d9a852;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.image-search-trigger:hover {
  border-color: var(--amber);
  box-shadow: 0 12px 24px rgba(217, 139, 33, 0.13);
  transform: translateY(-1px);
}

.image-search-trigger .upload-icon {
  grid-row: span 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: var(--amber);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 950;
}

.image-search-trigger strong {
  align-self: end;
  color: var(--nav);
  font-size: 14px;
  font-weight: 950;
}

.image-search-trigger small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.image-search-preview {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.image-search-preview[data-empty="true"] {
  color: var(--quiet);
  background:
    repeating-linear-gradient(135deg, rgba(26, 58, 92, 0.04) 0 8px, transparent 8px 16px),
    #fbfcfe;
}

.image-search-preview img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.image-search-preview div {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.image-search-preview span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.image-preview-dialog {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 32px;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 32, 0.72);
  backdrop-filter: blur(3px);
}

.image-preview-panel {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: min(92vw, 980px);
  max-height: 90vh;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(218, 226, 238, 0.92);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

.image-preview-panel img {
  display: block;
  max-width: min(88vw, 940px);
  max-height: 76vh;
  object-fit: contain;
  background: #f8fbfd;
  border-radius: 8px;
}

.image-preview-panel footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
}

.image-preview-panel footer span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-close {
  position: absolute;
  top: -12px;
  right: -12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #0f2742;
  font-size: 20px;
  font-weight: 950;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.image-preview-close:hover,
.image-preview-close:focus-visible {
  color: #fff;
  background: var(--primary);
}

.image-search-preview .text-button {
  width: max-content;
  height: 28px;
  padding: 0 9px;
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.admin-table {
  min-width: 1580px;
}

.sku-table {
  min-width: 1140px;
}

.sku-table th {
  white-space: nowrap;
}

.sku-table th[data-field="title"],
.sku-table td[data-field="title"] {
  min-width: 360px;
  max-width: 560px;
  white-space: normal;
  line-height: 1.45;
}

.sku-table th[data-field="url"],
.sku-table td[data-field="url"] {
  width: 92px;
  min-width: 92px;
  max-width: 110px;
}

.competitor-table {
  min-width: 1710px;
  table-layout: fixed;
}

.competitor-table .competitor-col-select {
  width: 62px;
}

.competitor-table .competitor-col-rank {
  width: 58px;
}

.competitor-table .competitor-col-name {
  width: 610px;
}

.competitor-table .competitor-col-media {
  width: 128px;
}

.competitor-table .competitor-col-brand {
  width: 74px;
}

.competitor-table .competitor-col-price {
  width: 120px;
}

.competitor-table .competitor-col-sales {
  width: 108px;
}

.competitor-table .competitor-col-rating {
  width: 82px;
}

.competitor-table .competitor-col-reviews {
  width: 96px;
}

.competitor-table .competitor-col-delivery {
  width: 128px;
}

.competitor-table .competitor-col-diff {
  width: 104px;
}

.competitor-table .competitor-col-link {
  width: 96px;
}

.keyword-table {
  min-width: 1180px;
}

.keyword-library-category-cell {
  min-width: 170px;
}

.keyword-library-category-cell strong,
.keyword-library-category-cell small {
  display: block;
}

.keyword-library-category-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.keyword-library-source-cell {
  min-width: 150px;
}

.keyword-quality-badge {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.keyword-quality-badge {
  width: max-content;
  padding: 2px 6px;
  border: 1px solid #f2c58d;
  border-radius: 999px;
  color: #8a4b08;
  background: #fff7ed;
  font-weight: 650;
}

.keyword-source-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #334155;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 650;
}

.keyword-source-platform_hot_search {
  border-color: #b8d8f3;
  color: #14558a;
  background: #eef7ff;
}

.keyword-source-ai_generated {
  border-color: #d8c9f2;
  color: #6841a5;
  background: #f7f2ff;
}

.keyword-source-manual {
  border-color: #bfe4d2;
  color: #17633c;
  background: #effbf4;
}

.keyword-library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 250px;
}

.sku-cell {
  display: grid;
  width: max-content;
  min-width: 150px;
  gap: 6px;
}

.sku-cell strong {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.role-pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  color: var(--teal-dark);
  background: #eef8f7;
  border: 1px solid #cde8e5;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.role-pill.admin {
  color: #80520d;
  background: #fff6e8;
  border-color: #f0d4a5;
}

.password-note,
.admin-note {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.department-cell {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 6px;
}

.department-input {
  width: 154px;
  height: 28px;
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 12px;
}

.admin-usage-button {
  color: #0f4e91;
  background: #f6fbff;
  border-color: #d6e9ff;
}

.admin-usage-panel {
  display: flex;
  max-height: calc(100vh - 44px);
  flex-direction: column;
  width: min(980px, calc(100vw - 36px));
}

.admin-usage-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding-bottom: 18px;
}

.admin-usage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-usage-summary article {
  min-height: 74px;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #dce9f7;
  border-radius: 8px;
}

.admin-usage-summary span,
.admin-usage-section-head span,
.admin-usage-list article span,
.admin-usage-event p {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.admin-usage-summary strong {
  display: block;
  margin-top: 8px;
  color: #0f2f52;
  font-size: 22px;
  line-height: 1;
}

.admin-usage-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-usage-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-usage-section-head strong {
  color: #0f2f52;
  font-size: 13px;
  font-weight: 950;
}

.admin-usage-list,
.admin-usage-timeline {
  display: grid;
  gap: 8px;
}

.admin-usage-date-tabs {
  display: grid;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}

.admin-usage-date-tabs.empty {
  padding: 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #d6e2f0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.admin-usage-date-tabs button {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  color: #16385c;
  background: #fff;
  border: 1px solid #dbe7f4;
  border-radius: 9px;
  box-shadow: none;
  text-align: left;
}

.admin-usage-date-tabs button:hover,
.admin-usage-date-tabs button.active {
  background: #eef7ff;
  border-color: #9dccff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.1);
  transform: none;
}

.admin-usage-date-tabs button.active {
  border-left: 4px solid #1677ff;
}

.admin-usage-date-tabs button span {
  grid-row: span 2;
  color: #0f2f52;
  font-size: 14px;
  font-weight: 950;
}

.admin-usage-date-tabs button strong {
  overflow: hidden;
  color: #0f5ca8;
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-usage-date-tabs button small {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-usage-list.empty,
.admin-usage-timeline.empty {
  padding: 14px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #d6e2f0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.admin-usage-list article,
.admin-usage-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2ebf5;
  border-radius: 8px;
}

.admin-usage-list article strong,
.admin-usage-event strong {
  display: block;
  color: #0f2f52;
  font-size: 13px;
  font-weight: 950;
}

.admin-usage-list article b {
  color: #0f5ca8;
  font-size: 12px;
  white-space: nowrap;
}

.admin-usage-event {
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: start;
}

.admin-usage-event > span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  color: #0f5ca8;
  background: #eef7ff;
  border: 1px solid #d6e9ff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.admin-usage-event[data-usage-type="login"] > span {
  color: #047857;
  background: #ecfdf5;
  border-color: #c8f3df;
}

.admin-usage-event[data-usage-type="logout"] > span {
  color: #9f1239;
  background: #fff1f2;
  border-color: #ffd5dc;
}

.admin-usage-event[data-usage-type="search"] > span {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.admin-usage-event p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.department-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.14);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  min-width: 210px;
  gap: 6px;
}

.mini-button {
  width: auto;
  height: 28px;
  padding: 0 8px;
  color: var(--teal-dark);
  background: #eef8f7;
  border: 1px solid #cde8e5;
  font-size: 12px;
  font-weight: 850;
}

.mini-button:hover {
  background: #dff2f0;
  box-shadow: none;
}

.competitor-image-search-button {
  white-space: nowrap;
}

.competitor-image-search-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.danger-mini {
  color: var(--red);
  background: #fff0f2;
  border-color: #f0c9cf;
}

.danger-mini:hover {
  background: #f8dfe3;
}

.product-list,
.watch-list,
.signal-list {
  display: grid;
}

.empty {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

.product {
  display: grid;
  grid-template-columns: 108px minmax(220px, 1fr) minmax(360px, 0.95fr);
  gap: 16px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.product:hover {
  background: #fbfcfe;
}

.product:last-child,
.watch-item:last-child,
.signal:last-child {
  border-bottom: 0;
}

.thumb {
  width: 108px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #edf1f5;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.product h3,
.watch-item h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.36;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  color: var(--teal-dark);
  background: #eef8f7;
  border: 1px solid #cde8e5;
  border-radius: 999px;
  font-weight: 850;
}

.seller-type {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 850;
  color: var(--muted);
  background: #f5f7f4;
  border: 1px solid var(--line);
}

.seller-type.local {
  color: var(--teal-dark);
  background: #eef8f7;
  border-color: #cde8e5;
}

.seller-type.cross-border {
  color: #7a4b12;
  background: #fff5df;
  border-color: #ecd08b;
}

.rocket-type {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 850;
  color: var(--muted);
  background: #f5f7f4;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.rocket-type.orange {
  color: #9a4f07;
  background: #fff1df;
  border-color: #f0c888;
}

.rocket-type.blue {
  color: #155f9a;
  background: #eaf4ff;
  border-color: #b9daf8;
}

.rocket-type.green {
  color: #12843b;
  background: #ecfdf3;
  border-color: #b7efc5;
}

.rocket-type.purple {
  color: #5f3ea6;
  background: #f1ecff;
  border-color: #d8c8ff;
}

.rocket-type.none {
  color: #596579;
  background: #f4f6f8;
  border-color: #dce3ea;
}

.delivery-type {
  display: inline-flex;
  min-height: 22px;
  max-width: 100%;
  align-items: center;
  padding: 2px 7px;
  color: #2d5163;
  background: #eef7fb;
  border: 1px solid #c8e2ec;
  border-radius: 999px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.delivery-type.local_orange_rocket {
  color: #9a4f07;
  background: #fff1df;
  border-color: #f0c888;
}

.delivery-type.local_blue_rocket {
  color: #155f9a;
  background: #eaf4ff;
  border-color: #b9daf8;
}

.delivery-type.local_self_ship {
  color: var(--teal-dark);
  background: #eef8f7;
  border-color: #cde8e5;
}

.delivery-type.cross_border_purple_rocket {
  color: #5f3ea6;
  background: #f1ecff;
  border-color: #d8c8ff;
}

.delivery-type.cross_border_dropship {
  color: #7a4b12;
  background: #fff5df;
  border-color: #ecd08b;
}

/* 火箭徽章图标：橙火/蓝火/绿火/紫火（rocket-type）与监控页配送徽章（橙火/蓝火）统一显示小火箭，
   颜色通过 currentColor 自动跟随徽章文字色，深浅色主题与灰化场景均保持协调；"非火箭/自发货"不显示。 */
.rocket-type.orange::before,
.rocket-type.blue::before,
.rocket-type.green::before,
.rocket-type.purple::before,
.delivery-type.local_orange_rocket::before,
.delivery-type.local_blue_rocket::before {
  content: "";
  display: block;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin-right: 3px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='rotate(45 12 12)'%3E%3Cpath d='M12 1.5L15.2 7H8.8Z'/%3E%3Crect x='8.8' y='7' width='6.4' height='10' rx='1.2'/%3E%3Cpath d='M8.8 12.5L5.6 17H8.8Z'/%3E%3Cpath d='M15.2 12.5L18.4 17H15.2Z'/%3E%3Cpath d='M10.4 17.5L12 21.5L13.6 17.5Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='rotate(45 12 12)'%3E%3Cpath d='M12 1.5L15.2 7H8.8Z'/%3E%3Crect x='8.8' y='7' width='6.4' height='10' rx='1.2'/%3E%3Cpath d='M8.8 12.5L5.6 17H8.8Z'/%3E%3Cpath d='M15.2 12.5L18.4 17H15.2Z'/%3E%3Cpath d='M10.4 17.5L12 21.5L13.6 17.5Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 8px;
  align-content: start;
}

.number {
  min-height: 64px;
  padding: 10px 11px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.number span {
  display: block;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
}

.number strong {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  grid-column: 2 / 4;
  gap: 8px;
}

.secondary {
  color: var(--teal-dark);
  background: #eef8f7;
  border: 1px solid #cde8e5;
}

.secondary:hover {
  background: #dff2f0;
  box-shadow: none;
}

.danger {
  color: var(--red);
  background: #fff0f2;
  border: 1px solid #f0c9cf;
}

.danger:hover {
  background: #f8dfe3;
  box-shadow: none;
}

.watch-item,
.signal {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.watch-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.watch-item .danger {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.signal strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.signal .signal-title-cn {
  color: #516174;
  font-size: 12px;
  font-weight: 800;
  -webkit-line-clamp: 1;
}

.signal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.signal-type {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 9px;
  color: #174a83;
  background: #eaf4ff;
  border: 1px solid #c5def5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.signal-open {
  color: #174a83;
  background: #f8fbff;
  border-color: #d8e9ff;
}

.signal-open:hover {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
}

.signal p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.signal-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.signal-metrics span {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.signal-metrics small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.signal-metrics b {
  color: var(--nav);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
}

.signal .signal-action {
  padding: 9px 10px;
  color: #80520d;
  background: #fff8eb;
  border: 1px solid #f4d396;
  border-radius: 10px;
  font-weight: 850;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--ink-soft);
  background: #f0f4f8;
  font-weight: 900;
}

.competitor-sort-button {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  font: inherit;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.competitor-table th:nth-child(6) .competitor-sort-button,
.competitor-table th:nth-child(7) .competitor-sort-button {
  justify-content: flex-end;
}

.competitor-sort-button:hover {
  color: var(--blue);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.competitor-sort-button:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.32);
  outline-offset: 3px;
}

.competitor-sort-button.active {
  color: #174a83;
}

.competitor-sort-button i {
  position: relative;
  display: inline-grid;
  width: 10px;
  height: 14px;
  flex: 0 0 10px;
  opacity: 0.45;
}

.competitor-sort-button i::before,
.competitor-sort-button i::after {
  content: "";
  position: absolute;
  left: 2px;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.competitor-sort-button i::before {
  top: 1px;
  border-bottom: 5px solid #9aa8b6;
}

.competitor-sort-button i::after {
  bottom: 1px;
  border-top: 5px solid #9aa8b6;
}

.competitor-sort-button.active i {
  opacity: 1;
}

.competitor-sort-button.active[data-direction="asc"] i::before {
  border-bottom-color: var(--amber);
}

.competitor-sort-button.active[data-direction="desc"] i::after {
  border-top-color: var(--amber);
}

td {
  color: var(--ink);
  background: #fff;
}

tr:nth-child(even) td {
  background: #fbfcfe;
}

tr:hover td {
  background: #f6faf9;
}

td:nth-child(3) {
  min-width: 280px;
}

.competitor-table td:nth-child(4) {
  min-width: 150px;
}

td a,
.link-button {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.link-button {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  color: var(--blue);
  background: #f5f8fc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.link-button:hover {
  color: #174a83;
  background: #eaf2fb;
  box-shadow: none;
}

.keyword-search-btn {
  color: #1f5f95;
  background: #e8f1f8;
  border-color: #c4d6e8;
}
.keyword-search-btn:hover {
  color: #fff;
  background: #1f5f95;
}
.keyword-watch-btn {
  color: #75530e;
  background: #fff8e8;
  border-color: #e8d5a0;
}
.keyword-watch-btn:hover {
  color: #fff;
  background: #8b6914;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  max-width: 360px;
  padding: 12px 14px;
  color: #fff;
  background: var(--nav);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.completion-notification-stack {
  position: fixed;
  right: 24px;
  bottom: 76px;
  z-index: 10020;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  pointer-events: none;
}

.completion-notification {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: start;
  padding: 14px 12px 14px 14px;
  color: #173044;
  background: #fff;
  border: 1px solid #b9d8ca;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(23, 48, 68, 0.2);
  pointer-events: auto;
  animation: completion-notification-enter 180ms ease-out both;
}

.completion-notification.is-leaving {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.completion-notification-icon {
  display: grid;
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  background: #168568;
  border-radius: 50%;
  place-items: center;
}

.completion-notification-content,
.completion-notification-close {
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.completion-notification-content {
  display: grid;
  gap: 5px;
  min-width: 0;
  cursor: pointer;
}

.completion-notification-content strong {
  font-size: 14px;
  line-height: 1.4;
}

.completion-notification-content span {
  color: #526b7d;
  font-size: 13px;
  line-height: 1.55;
}

.completion-notification-close {
  width: 30px;
  height: 30px;
  color: #6b7f8d;
  font-size: 22px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
}

.completion-notification-close:hover,
.completion-notification-close:focus-visible {
  color: #173044;
  background: #edf3f6;
  border-radius: 6px;
}

html[data-theme="dark"] .completion-notification {
  color: #f1f7fa;
  background: #182936;
  border-color: #36745f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .completion-notification-content span,
html[data-theme="dark"] .completion-notification-close {
  color: #b7c9d3;
}

@keyframes completion-notification-enter {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 600px) {
  .completion-notification-stack {
    right: 16px;
    bottom: 72px;
  }
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 36px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(150deg, rgba(15, 159, 143, 0.2) 0, transparent 30%),
    linear-gradient(135deg, #0d1622 0, #162338 50%, #edf2f7 50%, #f7f9fc 100%);
  background-size: 40px 40px, 40px 40px, auto, auto;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(430px, 0.82fr);
  width: min(1120px, calc(100vw - 72px));
  min-height: min(680px, calc(100vh - 72px));
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  box-shadow: 0 34px 95px rgba(13, 21, 31, 0.34);
}

.login-head {
  display: grid;
  align-content: space-between;
  min-height: 620px;
  padding: 42px;
  color: #f8fbff;
  background:
    linear-gradient(145deg, rgba(15, 159, 143, 0.28), transparent 40%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #223244, #121a26);
  background-size: auto, 36px 36px, auto;
}

.login-head .brand-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 26px;
  color: #ffe4a8;
  background:
    linear-gradient(135deg, rgba(217, 139, 33, 0.32), transparent 54%),
    linear-gradient(135deg, #124f66, #1b4c89);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.login-head .eyebrow {
  color: #8fe4d9;
  font-size: 13px;
}

.login-head h1 {
  max-width: 520px;
  font-size: 46px;
  letter-spacing: 0;
}

.login-head p:not(.eyebrow) {
  max-width: 430px;
  margin-top: 10px;
  color: #cbd7e4;
  font-size: 14px;
  line-height: 1.65;
}

.login-preview {
  display: grid;
  gap: 18px;
  min-height: 250px;
  margin-top: 42px;
  padding: 20px;
  background:
    linear-gradient(145deg, rgba(143, 228, 217, 0.18), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 24px 55px rgba(0, 0, 0, 0.22);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dbe7f2;
  font-size: 12px;
  font-weight: 850;
}

.preview-toolbar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.preview-toolbar span:nth-child(1) {
  background: #8fe4d9;
}

.preview-toolbar span:nth-child(2) {
  background: #d98b21;
}

.preview-toolbar span:nth-child(3) {
  background: #4856c7;
}

.preview-toolbar strong {
  margin-left: auto;
  color: #9fb2c4;
  letter-spacing: 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.8fr;
  gap: 12px;
}

.preview-metric {
  min-width: 0;
  padding: 16px;
  background: rgba(11, 18, 29, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
}

.preview-metric span {
  display: block;
  color: #93a9bd;
  font-size: 11px;
  font-weight: 850;
}

.preview-metric strong {
  display: block;
  margin-top: 8px;
  color: #f8fbff;
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}

.preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.preview-row span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  color: #ccefe9;
  background: rgba(143, 228, 217, 0.12);
  border: 1px solid rgba(143, 228, 217, 0.22);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.preview-row span:nth-child(2) {
  color: #f8d9aa;
  background: rgba(217, 139, 33, 0.13);
  border-color: rgba(217, 139, 33, 0.24);
}

.preview-row span:nth-child(3) {
  color: #d6d9ff;
  background: rgba(72, 86, 199, 0.16);
  border-color: rgba(72, 86, 199, 0.28);
}

.preview-chart {
  display: grid;
  height: 74px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(11, 18, 29, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
}

.preview-chart i {
  display: block;
  height: 42%;
  background: linear-gradient(180deg, #8fe4d9, #0f9f8f);
  border-radius: 5px 5px 2px 2px;
}

.preview-chart i:nth-child(2) {
  height: 64%;
  background: linear-gradient(180deg, #d98b21, #a9610d);
}

.preview-chart i:nth-child(3) {
  height: 50%;
}

.preview-chart i:nth-child(4) {
  height: 82%;
  background: linear-gradient(180deg, #6f7cff, #4856c7);
}

.preview-chart i:nth-child(5) {
  height: 58%;
}

.login-form {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 620px;
  padding: 56px 46px;
  background:
    linear-gradient(180deg, #ffffff, #fbfdff);
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
}

.login-form input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  color: var(--ink);
  background: #f7fafd;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 54px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  box-shadow: none;
  line-height: 1;
  transform: translateY(-50%);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-visible {
  color: var(--blue);
  background: rgba(37, 99, 168, 0.1);
  box-shadow: none;
  transform: translateY(-50%);
}

.login-form input:focus {
  outline: 0;
  border-color: rgba(37, 99, 168, 0.72);
  box-shadow:
    0 0 0 4px rgba(37, 99, 168, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-form > button[type="submit"] {
  height: 52px;
  margin-top: 8px;
  color: #fff;
  background: linear-gradient(135deg, #174267, #1d5f8f);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 16px 34px rgba(37, 99, 168, 0.22);
  font-weight: 900;
}

.login-form > button[type="submit"]:hover {
  background: linear-gradient(135deg, #0f766b, #2563a8);
  box-shadow: 0 18px 38px rgba(15, 118, 107, 0.22);
  transform: translateY(-1px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
  padding: 5px;
  background: #eef3f8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-tab {
  height: 40px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 850;
}

.auth-tab:hover {
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  transform: none;
}

.auth-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 10px 22px rgba(21, 25, 35, 0.09);
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.remember-me[hidden] {
  display: none;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .control-rail {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .layout {
    padding: 14px;
  }

  .command-strip,
  .admin-metrics,
  .admin-create-form,
  .seasonality-form,
  .seasonality-body,
  .image-search-upload,
  .reverse-form {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-strip {
    padding: 18px;
  }

  .command-strip h2 {
    font-size: 22px;
  }

  .search-control {
    grid-template-columns: 1fr;
  }

  .filter-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .search-filter,
  .rule-filter {
    grid-column: auto;
  }

  .product {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .thumb {
    width: 88px;
  }

  .numbers,
  .actions {
    grid-column: 1 / -1;
  }

  .actions {
    flex-wrap: wrap;
  }

  .panel-head {
    flex-direction: column;
  }

  .result-head {
    align-items: stretch;
  }

  .result-sort-control {
    min-width: 0;
    width: 100%;
  }

  .sort-caption {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .seasonality-legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .seasonality-insights {
    grid-template-columns: 1fr;
  }

  .category-hot-keyword-schema-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .period-strip {
    overflow-x: auto;
  }

  .login-page {
    padding: 16px;
    place-items: stretch;
  }

  .login-shell {
    grid-template-columns: 1fr;
    width: 100%;
    min-height: auto;
  }

  .login-head,
  .login-form {
    min-height: auto;
  }

  .login-head {
    padding: 24px;
  }

  .login-head h1 {
    font-size: 25px;
  }

  .login-preview {
    min-height: auto;
    margin-top: 20px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .login-form {
    padding: 28px 24px 30px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 20px;
  }

  .status {
    flex-wrap: wrap;
    white-space: normal;
  }

  .metric-row strong {
    font-size: 24px;
  }

  .product {
    grid-template-columns: 1fr;
  }

  .thumb {
    width: 100%;
    max-height: 220px;
  }

  .numbers,
  .actions {
    grid-column: auto;
  }

  .actions > * {
    flex: 1 1 140px;
    justify-content: center;
  }

  .seasonality-form {
    padding: 12px;
  }

  .period-strip span,
  .period-strip button {
    min-width: 72px;
    padding: 0 12px;
  }

  .seasonality-body {
    padding: 12px;
  }

  .seasonality-chart-card {
    padding: 10px;
  }

  .seasonality-chart {
    min-height: 300px;
  }

  .category-hot-keyword-empty {
    padding: 16px;
  }

  .category-hot-keyword-schema-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    max-width: none;
  }
}

/* Secondary pages keep the workflow collapsed until the user opens it as an overlay. */
body.workflow-overlay-page .selection-workflow {
  position: fixed;
  top: 116px;
  right: auto;
  bottom: auto;
  left: var(--workflow-rail-left);
  z-index: 60;
  width: var(--workflow-rail-width);
  max-height: calc(100vh - 134px);
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(246, 250, 254, 0.98);
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(18, 40, 68, 0.2);
}

body.workflow-overlay-page .selection-workflow-inner {
  width: 100%;
  min-width: 0;
  padding: 16px 14px;
}

body.workflow-overlay-page .selection-workflow-title {
  display: flex;
}

body.workflow-overlay-page .selection-workflow-steps {
  display: grid;
  width: auto;
  min-width: 0;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.workflow-overlay-page .selection-workflow-step {
  width: 100%;
  min-height: 60px;
  padding: 12px;
}

body.workflow-overlay-page .selection-workflow-step:not(:last-child)::after {
  display: block;
  top: auto;
  right: auto;
  bottom: -11px;
  left: 27px;
  width: 1px;
  height: 10px;
}

body.workflow-overlay-page .workflow-index {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

body.workflow-overlay-page .workflow-copy strong {
  font-size: 14px;
}

html[data-theme="dark"] body.workflow-overlay-page .selection-workflow {
  background: rgba(25, 35, 47, 0.98);
  border-color: #3b4c60;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

@media (max-width: 760px) {
  body.workflow-overlay-page .selection-workflow {
    top: 134px;
    left: 12px;
    width: min(var(--workflow-rail-width), calc(100vw - 24px));
    max-height: calc(100vh - 152px);
  }
}

/* MarketPicks business dashboard layout */
:root {
  --ink: #172435;
  --ink-soft: #314156;
  --muted: #6a7788;
  --quiet: #94a0ad;
  --line: #dfe6ef;
  --line-strong: #c8d3df;
  --paper: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --nav: #1a3a5c;
  --nav-2: #244b73;
  --teal: #2e7cc3;
  --teal-dark: #1a3a5c;
  --amber: #f5a623;
  --indigo: #34699f;
  --red: #d94d45;
  --blue: #1a3a5c;
  --shadow: 0 20px 45px rgba(26, 58, 92, 0.15);
  --shadow-soft: 0 12px 28px rgba(26, 58, 92, 0.09);
  --radius: 12px;
}

body {
  background: var(--paper);
  background-image:
    radial-gradient(circle at 12% 10%, rgba(245, 166, 35, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(26, 58, 92, 0.04), transparent 320px);
  font-size: 15px;
  line-height: 1.52;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 72px;
  padding: 13px 36px 13px 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(26, 58, 92, 0.08);
}

.topbar h1 {
  color: var(--nav);
  font-size: 21px;
}

.topbar .eyebrow {
  color: var(--amber);
}

.brand-mark {
  color: var(--amber);
  background: linear-gradient(135deg, var(--nav), var(--nav-2));
  border: 0;
  border-radius: 14px;
  box-shadow: 0 12px 22px rgba(26, 58, 92, 0.2);
  font-family: Consolas, "SFMono-Regular", monospace;
}

.status {
  color: var(--muted);
  gap: 10px;
  padding-right: 4px;
}

.notification-button,
.avatar-button {
  position: relative;
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: var(--nav);
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid #d8e4f2;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(26, 58, 92, 0.07);
  font-size: 13px;
  font-weight: 900;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.notification-button {
  gap: 7px;
  min-width: 76px;
  padding: 0 13px;
}

.notification-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(217, 77, 69, 0.12);
}

.notification-label {
  line-height: 1;
}

.avatar-button {
  width: 46px;
  min-width: 46px;
  padding: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--nav), var(--nav-2));
  font-weight: 900;
}

.notification-button:hover,
.notification-button:focus-visible {
  color: #0f63d8;
  background: #f3f8ff;
  border-color: #9cc8ff;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.13);
  transform: translateY(-1px);
}

.avatar-button:hover,
.avatar-button:focus-visible {
  background: linear-gradient(135deg, #0f2f4d, var(--nav));
  border-color: rgba(26, 58, 92, 0.18);
  box-shadow: 0 12px 24px rgba(26, 58, 92, 0.18);
  transform: translateY(-1px);
}

.user-menu {
  position: relative;
  margin-left: 2px;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  display: grid;
  min-width: 150px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transform-origin: top right;
  will-change: opacity, transform;
  animation: dropdownIn 0.24s ease both;
}

.user-menu-panel[hidden] {
  display: none !important;
}

.user-menu-panel.open {
  animation: dropdownIn 0.24s ease both;
}

.user-menu-panel.closing {
  display: grid;
  pointer-events: none;
  animation: dropdownOut 0.2s ease both;
}

.user-menu-panel button {
  height: 36px;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}

.user-menu-panel button:hover {
  color: var(--nav);
  background: #eef4fb;
  box-shadow: none;
  transform: none;
}

.primary-nav {
  position: sticky;
  top: 72px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.primary-nav-inner {
  display: flex;
  width: min(1840px, 100%);
  margin: 0 auto;
  padding: 0 20px;
  gap: 8px;
}

.nav-item {
  position: relative;
}

.nav-link {
  position: relative;
  height: 52px;
  padding: 0 18px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.nav-link::after {
  display: none;
  content: none;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--panel-soft);
  box-shadow: none;
  transform: none;
}

.nav-link.active,
.nav-link.agent-open,
.nav-link[aria-expanded="true"] {
  color: var(--nav);
  background: rgba(15, 159, 143, .08);
  border-bottom: 0;
  padding-bottom: 0;
  box-shadow: none;
  transform: none;
}

.nav-link.active::after,
.nav-link.agent-open::after,
.nav-link[aria-expanded="true"]::after {
  background: var(--nav);
}

.nav-link span {
  display: inline-block;
  margin-left: 6px;
  color: var(--amber);
  font-size: 10px;
  transform-origin: center;
  transition:
    color 0.25s ease,
    transform 0.25s ease;
}

.nav-link.agent-open span,
.nav-link[aria-expanded="true"] span {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 120;
  display: grid;
  width: 300px;
  gap: 9px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(205, 216, 229, 0.86);
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(26, 58, 92, 0.16);
  backdrop-filter: blur(14px);
  transform-origin: top left;
  will-change: opacity, transform;
  animation: dropdownIn 0.24s ease both;
}

.nav-dropdown[hidden] {
  display: none !important;
}

.nav-dropdown.open {
  animation: dropdownIn 0.24s ease both;
}

.nav-dropdown.closing {
  display: grid;
  pointer-events: none;
  animation: dropdownOut 0.2s ease both;
}

.nav-dropdown.wide {
  width: 390px;
}

.nav-dropdown strong {
  color: var(--nav);
  font-size: 15px;
}

.nav-dropdown p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.nav-dropdown button {
  justify-self: start;
  height: 34px;
  padding: 0 12px;
  background: var(--nav);
}

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.dropdown-grid span,
.dropdown-grid button {
  padding: 8px 10px;
  color: var(--ink-soft);
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}

.dropdown-grid button {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  box-shadow: none;
}

.dropdown-grid button:hover,
.dropdown-grid button:focus-visible {
  color: var(--nav);
  background: #fff8eb;
  border-color: rgba(245, 166, 35, 0.45);
  box-shadow: 0 8px 18px rgba(245, 166, 35, 0.12);
  transform: translateY(-1px);
}

.selection-workflow {
  position: fixed;
  top: 116px;
  left: var(--workflow-rail-left);
  z-index: 28;
  width: var(--workflow-rail-width);
  max-height: calc(100vh - 134px);
  overflow-y: auto;
  background: rgba(246, 250, 254, 0.96);
  border: 1px solid #d8e3ef;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(18, 40, 68, 0.09);
  backdrop-filter: blur(12px);
  scrollbar-color: rgba(26, 58, 92, 0.28) transparent;
  scrollbar-width: thin;
}

.selection-workflow[hidden] {
  display: none !important;
}

.selection-workflow-inner {
  display: grid;
  width: 100%;
  margin: 0;
  padding: 16px 14px;
  align-items: stretch;
  align-content: start;
  gap: 14px;
}

.selection-workflow-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  gap: 3px;
  padding: 0 0 12px;
  border-bottom: 1px solid #d9e5f0;
}

.selection-workflow-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.selection-workflow-return-latest {
  min-height: 28px;
  padding: 0 8px;
  color: #075c50;
  background: #edfbf7;
  border: 1px solid #79c8b8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.selection-workflow-return-latest[hidden] {
  display: none !important;
}

.selection-workflow-title > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.selection-workflow-hide {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: #52657b;
  background: #fff;
  border: 1px solid #d2deea;
  border-radius: 6px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.selection-workflow-title span {
  color: #6c7788;
  font-size: 12px;
  font-weight: 800;
}

.selection-workflow-title strong {
  color: #10243f;
  font-size: 13px;
  font-weight: 950;
}

.selection-workflow-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.selection-workflow-step {
  position: relative;
  display: flex;
  min-width: 0;
  width: 100%;
  min-height: 60px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: #2b3340;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  box-shadow: none;
  text-align: left;
}

.selection-workflow-filter-wrap {
  position: relative;
  display: grid;
  min-width: 0;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.selection-workflow-filter-wrap .selection-workflow-step {
  min-width: 0;
  width: auto;
}

.workflow-filter-toggle {
  min-width: 48px;
  padding: 0 9px;
  color: #9a5b00;
  background: #fffaf0;
  border: 1px solid #e3b766;
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.workflow-filter-toggle:hover,
.workflow-filter-toggle:focus-visible {
  color: #7c4300;
  background: #fff4d9;
  border-color: #d79222;
  box-shadow: 0 5px 12px rgba(155, 100, 16, 0.12);
}

.workflow-filter-toggle[aria-expanded="true"] {
  color: #075c50;
  background: #edfbf7;
  border-color: #79c8b8;
}

.selection-workflow-step:not(:last-child)::after {
  position: absolute;
  bottom: -11px;
  left: 27px;
  width: 1px;
  height: 10px;
  content: "";
  background: #cfdbe8;
}

.selection-workflow-branch {
  position: relative;
  margin: -3px 0 0 18px;
  padding: 0 0 0 18px;
}

.filter-workflow-branch {
  margin-top: -3px;
}

.selection-workflow-branch[hidden] {
  display: none !important;
}

.selection-workflow-branch::before {
  position: absolute;
  top: -8px;
  bottom: 50%;
  left: 0;
  width: 13px;
  border-bottom: 1px solid #73a7dd;
  border-left: 1px solid #73a7dd;
  content: "";
}

.selection-workflow-branch-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: #0f3a67;
  background: #f1f7ff;
  border: 1px solid #9fc3e8;
  border-radius: 7px;
  box-shadow: none;
  text-align: left;
}

.selection-workflow-branch-button:hover:not(:disabled),
.selection-workflow-branch-button:focus-visible {
  background: #e7f2ff;
  border-color: #4e91d6;
  box-shadow: 0 6px 14px rgba(37, 99, 168, 0.1);
}

.selection-workflow-branch-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.selection-workflow-branch-button.is-complete {
  color: #075c50;
  background: #edfbf7;
  border-color: #79c8b8;
}

.selection-workflow-branch-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: #2563a8;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.selection-workflow-branch-button.is-running .selection-workflow-branch-icon {
  animation: workflowBranchPulse 1s ease-in-out infinite;
}

.selection-workflow-branch-button.is-complete .selection-workflow-branch-icon {
  background: #0f9f8f;
}

.selection-workflow-branch-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.selection-workflow-branch-copy strong {
  color: inherit;
  font-size: 13px;
  font-weight: 950;
}

.selection-workflow-branch-copy small {
  overflow-wrap: anywhere;
  color: #64758a;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
}

@keyframes workflowBranchPulse {
  50% { opacity: 0.55; }
}

.selection-workflow-step:hover,
.selection-workflow-step:focus-visible {
  color: #0f2f4d;
  background: #f6fbff;
  border-color: #a9c7e8;
  box-shadow: 0 8px 18px rgba(37, 99, 168, 0.09);
  transform: translateY(-1px);
}

.selection-workflow-step.is-active {
  color: #0f2f4d;
  background: linear-gradient(180deg, #eef7ff, #ffffff);
  border-color: #73a7dd;
  box-shadow:
    inset 0 0 0 1px rgba(37, 99, 168, 0.12),
    0 10px 22px rgba(37, 99, 168, 0.11);
}

.selection-workflow-step.is-done {
  border-color: rgba(15, 159, 143, 0.36);
}

.selection-workflow-step.is-pending {
  color: #5e6a7b;
}

.selection-workflow-step.is-next {
  color: #153d66;
  background: #fffaf0;
  border-color: #e3a63a;
  box-shadow: 0 0 0 2px rgba(227, 166, 58, 0.14), 0 8px 18px rgba(123, 83, 18, 0.08);
}

.selection-workflow-step.is-next .workflow-index {
  color: #ffffff;
  background: #d97706;
  border-color: #d97706;
}

.selection-workflow-step:disabled {
  cursor: progress;
  opacity: 1;
}

.selection-workflow-step.is-running {
  cursor: pointer;
  color: #0f2f4d;
  background: #eef7ff;
  border-color: #73a7dd;
}

.selection-workflow-step.is-running .workflow-index {
  color: #fff;
  background: #2563a8;
  border-color: #2563a8;
}

.workflow-index {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: #687487;
  background: #eef3f8;
  border: 1px solid #d8e3ef;
  border-radius: 999px;
  font-family: var(--font-number);
  font-size: 14px;
  font-weight: 900;
}

.selection-workflow-step.is-active .workflow-index {
  color: #fff;
  background: #2563a8;
  border-color: #2563a8;
}

.selection-workflow-step.is-done:not(.is-active) .workflow-index {
  color: #fff;
  background: #0f9f8f;
  border-color: #0f9f8f;
}

.workflow-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.workflow-step-status {
  width: fit-content;
  color: #2563a8;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.workflow-step-status[hidden] {
  display: none !important;
}

.selection-workflow-step.is-next .workflow-step-status {
  color: #b45f05;
}

.selection-workflow-step.is-history-view {
  background: #fffaf0;
  border-color: #d9a441;
  box-shadow: inset 0 0 0 1px rgba(217, 164, 65, 0.12);
}

.selection-workflow-step.is-history-view .workflow-index {
  color: #fff;
  background: #b56a13;
  border-color: #b56a13;
}

.selection-workflow-step.is-history-view .workflow-step-status {
  color: #9a570d;
}

.selection-workflow-step.is-latest-return {
  background: #edfbf7;
  border-color: #45a997;
  box-shadow: 0 0 0 2px rgba(15, 159, 143, 0.1);
}

.selection-workflow-step.is-latest-return .workflow-step-status {
  color: #087569;
}

html[data-theme="dark"] .selection-workflow-step.is-next {
  color: #ffe0a6;
  background: #382a18;
  border-color: #d79a33;
}

html[data-theme="dark"] .selection-workflow-step.is-next .workflow-step-status {
  color: #ffd08a;
}

.workflow-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.workflow-copy strong {
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdownOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.7fr) minmax(360px, 0.8fr);
  width: auto;
  max-width: calc(1840px - 248px);
  margin: 0 14px 0 var(--workflow-content-left);
  padding: 24px 0;
  gap: 20px;
}

.product-column,
.dashboard-column,
.secondary-workspace {
  display: grid;
  gap: 18px;
  align-content: start;
}

.dashboard-column {
  position: sticky;
  top: 116px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: rgba(26, 58, 92, 0.28) transparent;
  scrollbar-width: thin;
}

.dashboard-column::-webkit-scrollbar {
  width: 6px;
}

.dashboard-column::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-column::-webkit-scrollbar-thumb {
  background: rgba(26, 58, 92, 0.22);
  border-radius: 999px;
}

.dashboard-column:hover::-webkit-scrollbar-thumb {
  background: rgba(26, 58, 92, 0.36);
}

.secondary-workspace {
  width: min(1840px, calc(100% - 28px));
  max-width: none;
  margin: 0 auto 38px;
}

[data-app-page][hidden] {
  display: none !important;
}

.watchlist-page-panel {
  overflow: hidden;
  background: #f5f8fc;
  border-color: #dbe7f4;
  box-shadow: 0 18px 42px rgba(26, 58, 92, 0.08);
}

.watchlist-page-head {
  align-items: center;
  padding: 14px 18px 10px;
  background: linear-gradient(180deg, #fff, #f9fcff);
  border-bottom: 0;
}

.watchlist-page-head > div {
  display: grid;
  gap: 2px;
}

.watchlist-page-head .eyebrow {
  margin: 0;
  color: #5c7089;
}

.watchlist-page-head h2 {
  color: var(--nav);
  font-size: 21px;
  line-height: 1.2;
}

.watchlist-page-head .text-button {
  height: 34px;
  color: #0f5ca8;
  background: #eef7ff;
  border-color: #cfe7ff;
  border-radius: 8px;
}

.watchlist-page-head-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px !important;
}

.watchlist-page-head-actions .primary-button,
.watchlist-page-head-actions .text-button {
  min-height: 34px;
  height: 34px;
  padding: 0 13px;
  border-radius: 7px;
}

.watch-refresh-progress {
  display: grid;
  gap: 8px;
  margin: 0 18px 10px;
  padding: 11px 14px;
  color: #24405d;
  background: #f7fbff;
  border: 1px solid #cfe0f3;
  border-radius: 7px;
}

.watch-refresh-progress[hidden] {
  display: none;
}

.watch-refresh-progress.is-complete {
  background: #f4fbf8;
  border-color: #bfe2d3;
}

.watch-refresh-progress.has-failures {
  background: #fffaf2;
  border-color: #ecd2a2;
}

.watch-refresh-progress.is-busy {
  border-color: #4d8df5;
  box-shadow: 0 12px 28px rgba(22, 119, 255, 0.18);
}

.watch-refresh-progress.is-busy .watch-refresh-progress-track {
  background: #cddcf3;
}

.watch-refresh-progress-head,
.watch-refresh-progress-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.watch-refresh-progress-head strong {
  min-width: 0;
  overflow: hidden;
  color: #173b61;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-refresh-progress-head span,
.watch-refresh-progress-meta {
  color: #61748a;
  font-size: 12px;
  font-weight: 750;
}

.watch-refresh-progress-meta span:last-child {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-refresh-progress-track {
  position: relative;
  overflow: hidden;
  height: 7px;
  background: #dfeaf5;
  border-radius: 4px;
}

.watch-refresh-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #1677ff;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.watch-refresh-progress-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.watch-refresh-stop-button {
  padding: 5px 14px;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  border: 1px solid #f0b9b0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.watch-refresh-stop-button:hover {
  background: #fff1ee;
  border-color: #e08c7d;
}

.watch-refresh-stop-button:active {
  background: #ffe2dc;
}

.watch-refresh-stop-button[hidden] {
  display: none;
}

.watch-refresh-progress.is-complete .watch-refresh-progress-track span {
  background: #168466;
}

.watch-refresh-progress.has-failures .watch-refresh-progress-track span {
  background: #c98516;
}

.watch-add-progress.is-busy .watch-refresh-progress-track span {
  background: #1677ff;
}

.watch-add-progress.is-complete .watch-refresh-progress-track span {
  background: #168466;
}

.watch-add-progress.has-failures .watch-refresh-progress-track span {
  background: #c04b3f;
}

.watch-classify-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  margin: 0 18px;
  padding: 12px 14px;
  background: #f8fbff;
  border: 1px solid #dbe7f4;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

.watch-classify-field {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.watch-classify-field span,
.watch-classify-summary span {
  color: #5e6b7f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.watch-classify-field select {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 10px;
  color: var(--nav);
  background: #fff;
  border: 1px solid #d7e3f1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  outline: none;
}

.watch-classify-field select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.watch-classify-summary {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #d7e3f1;
  border-radius: 8px;
}

.watch-classify-summary strong {
  overflow: hidden;
  color: var(--nav);
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-latest-button {
  min-width: 88px;
  min-height: 28px;
  height: 28px;
  padding: 0 8px;
  color: #214260;
  background: #f5f9fd;
  border: 1px solid #cadbeb;
  border-radius: 6px;
  box-shadow: none;
}

.watch-classify-summary .watch-latest-button span {
  color: inherit;
  font-size: 12px;
  font-weight: 900;
}

.watch-latest-button:hover,
.watch-latest-button.active {
  color: #0b5fb3;
  background: #eaf4ff;
  border-color: #9dc9f5;
  box-shadow: none;
}

.watch-latest-button i {
  height: 14px;
}

.watch-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) minmax(240px, auto);
  gap: 10px;
  align-items: center;
  margin: 0 18px;
  padding: 10px 14px;
  background: #f8fbff;
  border: 1px solid #dbe7f4;
  border-bottom: 0;
}

.watch-filter-bar label {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--nav);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.watch-filter-bar input,
.watch-filter-bar select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: var(--nav);
  background: #fff;
  border: 1px solid #d7e3f1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  outline: none;
}

.watch-filter-bar input:focus,
.watch-filter-bar select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.watch-filter-bar input.is-invalid {
  border-color: #ff4d4f;
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.1);
}

.watch-filter-status {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 0 10px;
  background: #fff;
  border: 1px solid #d7e3f1;
  border-radius: 8px;
}

.watch-filter-status strong {
  color: #1d4f7a;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.watch-filter-reset {
  height: 26px;
  padding: 0 9px;
  color: #0f5ca8;
  background: #edf5ff;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.watch-filter-reset:hover {
  color: #094a88;
  background: #dfeeff;
  box-shadow: none;
}

.watch-sort-bar {
  margin: 0 18px;
  padding: 8px 14px 10px;
  background: #fff;
  border: 1px solid #dbe7f4;
  border-radius: 0 0 10px 10px;
}

.watch-sort-control {
  display: flex;
  width: 100%;
  max-width: none;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  scrollbar-width: thin;
}

.watch-sort-control .sort-caption,
.watch-sort-control .sort-option {
  flex: 0 0 auto;
  min-height: 30px;
  border-right: 0;
}

.watch-sort-control .sort-caption {
  padding-right: 8px;
  padding-left: 0;
  background: transparent;
}

.watch-sort-option {
  min-width: auto;
  padding: 0 10px;
  border-radius: 7px;
  white-space: nowrap;
}

.watch-sort-reset {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #516174;
  background: #f7fafc;
  border: 1px solid #dbe7f4;
  border-radius: 7px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.watch-sort-reset:not(:disabled):hover {
  color: #0f4e91;
  background: #eef7ff;
  border-color: #c7e2ff;
  box-shadow: none;
}

.watch-sort-reset:disabled {
  color: #9aa8b8;
  cursor: not-allowed;
  opacity: 0.58;
}

.watch-sort-control .sort-option:hover {
  color: var(--nav);
  background: #f4f8fd;
  box-shadow: none;
}

.watch-sort-control .sort-option.active {
  color: #0f5ca8;
  background: #edf5ff;
  box-shadow: none;
}

.watch-change-segments {
  display: inline-grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, max-content);
  min-height: 30px;
  margin-left: auto;
  overflow: hidden;
  background: #f4f7fa;
  border: 1px solid #d4e0ec;
  border-radius: 6px;
}

.watch-change-segment {
  min-height: 28px;
  padding: 0 10px;
  color: #526477;
  background: transparent;
  border: 0;
  border-right: 1px solid #d4e0ec;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.watch-change-segment:last-child {
  border-right: 0;
}

.watch-change-segment:hover {
  color: #174f82;
  background: #eaf3fb;
}

.watch-change-segment.active {
  color: #fff;
  background: #245f92;
}

.watch-change-segment span {
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
  opacity: 0.82;
}

.selection-classify-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.selection-sort-bar {
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.watchlist-page-panel .watch-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px 18px 18px;
  background: #f5f8fc;
}

.watchlist-page-panel .watch-list.empty {
  grid-template-columns: 1fr;
  min-height: 220px;
  place-items: center;
  text-align: center;
}

.watch-pagination-shell {
  display: grid;
  gap: 10px;
  padding: 12px 14px 4px;
  border-top: 0;
  background: #f5f8fc;
}

.watch-pagination-info {
  color: #5e6b7f;
  font-size: 13px;
  font-weight: 700;
}

.watch-pagination {
  justify-content: center;
  padding-top: 0;
}

.watchlist-page-panel .watch-item {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  padding: 15px;
  background: #fff;
  border: 1px solid rgba(26, 58, 92, 0.08);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(26, 58, 92, 0.04);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.watchlist-page-panel .watch-item:hover {
  border-color: rgba(22, 119, 255, 0.26);
  box-shadow: 0 14px 28px rgba(26, 58, 92, 0.08);
  transform: translateY(-2px);
}

.watchlist-page-panel .watch-item.is-refreshing {
  border-color: #4d8df5;
  background: linear-gradient(180deg, #f4faff, #ffffff 80%);
  box-shadow: 0 16px 32px rgba(22, 119, 255, 0.16);
}

.watch-thumb {
  display: block;
  width: 100%;
  height: 148px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  background: #edf3f8;
  border: 0;
  border-radius: 8px;
}

.watch-media {
  display: block;
  width: 100%;
  height: 148px;
  overflow: hidden;
  background: #edf3f8;
  border-radius: 8px;
}

.watch-media-button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.watch-media-button:focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}

.watch-media:hover .watch-thumb {
  transform: scale(1.04);
}

.watch-thumb {
  transition: transform 0.22s ease;
}

.watch-main {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.watch-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: flex-start;
  gap: 12px;
}

.watch-title-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.watch-title-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 6px;
}

.watch-title-heading[hidden],
.watch-title-edit-form[hidden] {
  display: none;
}

.watch-title-heading h3 {
  flex: 1 1 auto;
}

.watch-title-edit-button {
  flex: 0 0 auto;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.watch-title-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: 4px;
}

.watch-title-edit-form input.watch-title-edit-input {
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  color: var(--nav);
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  box-shadow: none;
  font: inherit;
}

.watch-title-edit-form button {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.watch-title-edit-form button:hover,
.watch-title-edit-form button:focus-visible {
  box-shadow: 0 8px 18px rgba(21, 35, 56, 0.08);
  transform: translateY(-1px);
}

.watch-title-edit-form input:disabled,
.watch-title-edit-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.watch-title-edit-form input.watch-title-edit-input:focus {
  border-color: #a9cbe7;
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.12);
}

.watch-title-row h3 {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--nav);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.watch-title-link {
  color: inherit;
  text-decoration: none;
}

.watch-title-link:hover,
.watch-title-link:focus-visible {
  color: #0f64b3;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.watch-title-row .watch-title-cn {
  color: #516174;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  -webkit-line-clamp: 1;
}

.watch-badges,
.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.watch-review-status {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  color: #526276;
  background: #f6f8fb;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.watch-review-status.pending,
.watch-review-status.processing {
  color: #8a5a00;
  background: #fff8e6;
  border-color: #ecd28b;
}

.watch-review-status.processing {
  color: #145fa8;
  background: #eef6ff;
  border-color: #b9d7f5;
}

.watch-review-status.updated {
  color: #087443;
  background: #ecfdf3;
  border-color: #b9e6ca;
}

.watch-review-status.empty {
  color: #64748b;
  background: #f8fafc;
  border-color: #d9e1eb;
}

.watch-review-status.failed {
  color: #b42318;
  background: #fff2f1;
  border-color: #e7b4ae;
}

.watch-review-status time {
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.78;
}

.watch-review-retry {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font-size: inherit;
  font-weight: 950;
  text-decoration: underline;
  cursor: pointer;
}

html[data-theme="dark"] .watch-review-status {
  color: #c4cfdd;
  background: #1a2430;
  border-color: #344357;
}

html[data-theme="dark"] .watch-review-status.pending,
html[data-theme="dark"] .watch-review-status.processing {
  color: #f5cf77;
  background: #2b281c;
  border-color: #65572d;
}

html[data-theme="dark"] .watch-review-status.updated {
  color: #8be0ae;
  background: #172b24;
  border-color: #315e49;
}

html[data-theme="dark"] .watch-review-status.failed {
  color: #ffaaa2;
  background: #321f20;
  border-color: #6e3937;
}

.watch-smart-tags {
  display: flex;
  min-height: 24px;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-smart-tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.watch-smart-tag.hot,
.watch-smart-tag.rise {
  color: #087443;
  background: #ecfdf3;
  border: 0;
}

.watch-smart-tag.premium {
  color: #8a4b00;
  background: #fff7e6;
  border: 0;
}

.watch-smart-tag.gap,
.watch-smart-tag.entry {
  color: #174a83;
  background: #eaf4ff;
  border: 0;
}

.watch-smart-tag.neutral {
  color: #64748b;
  background: #f5f7fa;
  border: 0;
}

.watch-change-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.watch-change-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
  border: 0;
}

.watch-change-badge.is-up {
  color: #14804a;
  background: #e7f6ee;
}

.watch-change-badge.is-down {
  color: #d33f32;
  background: #fdecea;
}

.watch-change-badge.is-same {
  color: #5c6876;
  background: #e9edf1;
}

.watch-category-chip {
  display: inline-flex;
  min-height: 22px;
  max-width: 100%;
  align-items: center;
  padding: 2px 8px;
  overflow: hidden;
  color: #1d4f7a;
  background: #eef6ff;
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-sku-mini {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  color: #64748b;
  background: #f8fafc;
  border: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.watch-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
  padding-top: 3px;
}

.watch-stat {
  min-width: 0;
  min-height: 0;
  padding: 2px 0 7px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(26, 58, 92, 0.08);
  border-radius: 0;
}

.watch-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.watch-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--nav);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.watchlist-page-panel .meta {
  margin-top: 0;
  padding-top: 2px;
  color: #5e6b7f;
  font-size: 12px;
  line-height: 1.45;
}

.watch-stat-trend strong {
  display: inline-block;
  margin-right: 5px;
}

.watch-price-stat,
.watch-sales-stat {
  position: relative;
}

.watch-price-stat-heading,
.watch-sales-stat-heading {
  display: block !important;
}

.watch-price-stat-heading > span,
.watch-sales-stat-heading > span {
  min-width: 0;
}

.watch-price-trend-button,
.watch-sales-trend-button {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-grid;
  width: 26px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0;
  color: #1d5d90;
  background: #eef6ff;
  border: 1px solid #cfe0f3;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.watch-price-trend-button > span,
.watch-sales-trend-button > span {
  display: block;
  color: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.watch-price-trend-button:hover,
.watch-price-trend-button:focus-visible,
.watch-sales-trend-button:hover,
.watch-sales-trend-button:focus-visible {
  color: #ffffff;
  background: #2563a8;
  border-color: #2563a8;
}

.watch-price-stat-value,
.watch-sales-stat-value {
  display: flex !important;
  min-height: 24px;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 3px;
}

.watch-price-sparkline,
.watch-sales-sparkline {
  display: flex !important;
  min-height: 22px;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.watch-price-sparkline .vk-spark,
.watch-sales-sparkline .vk-spark {
  display: block;
  width: 72px;
  height: 22px;
  flex: 0 0 auto;
}

.watch-price-sparkline small,
.watch-sales-sparkline small,
.watch-price-snapshot-count,
.watch-sales-snapshot-count {
  color: #718096;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.watch-price-snapshot-count,
.watch-sales-snapshot-count {
  display: block;
  min-height: 22px;
  padding-top: 5px;
}

.watch-delta {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.watch-delta.positive {
  color: #14804a;
}

.watch-delta.negative {
  color: #d33f32;
}

.watch-delta.neutral {
  color: #7a8797;
}

.watch-surge-stat {
  border-color: #cfe0f3;
  background: linear-gradient(180deg, #f8fbff, #f3f7fb);
}

.watch-surge-stat strong {
  font-size: 14px;
}

.watch-surge-stat.is-hot {
  border-color: #9fdab8;
  background: linear-gradient(180deg, #ecfdf3, #f8fffb);
}

.watch-surge-stat.is-hot strong,
.watch-surge-stat.is-up strong {
  color: #14804a;
}

.watch-surge-stat.is-down {
  border-color: #ffd3cc;
  background: linear-gradient(180deg, #fff6f4, #fffafa);
}

.watch-surge-stat.is-down strong {
  color: #d33f32;
}

.watch-surge-stat.is-flat strong,
.watch-surge-stat.is-empty strong {
  color: #7a8797;
}

.watch-actions {
  min-width: max-content;
  justify-self: end;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  padding: 4px;
  background: rgba(248, 251, 255, 0.9);
  border: 1px solid #dce8f6;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(21, 35, 56, 0.06);
}

.watch-action-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  color: #1d4f7a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.watch-action-button:hover {
  color: #0f3760;
  background: #fff;
  border-color: #cfe0f3;
  box-shadow: 0 8px 18px rgba(21, 35, 56, 0.08);
  transform: translateY(-1px);
}

.watch-refresh-button {
  gap: 5px;
}

.watch-refresh-button > span:first-child {
  font-size: 15px;
  line-height: 1;
}

.watch-refresh-button.is-loading > span:first-child {
  animation: watch-refresh-spin 0.8s linear infinite;
}

.watch-refresh-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

@keyframes watch-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.watch-link {
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #0f5ec8);
  border-color: rgba(22, 119, 255, 0.15);
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
}

.watch-link:hover {
  color: #fff;
  background: linear-gradient(135deg, #0f6be8, #0c53b0);
  border-color: rgba(22, 119, 255, 0.22);
  box-shadow: 0 10px 24px rgba(22, 119, 255, 0.28);
}

.watch-action-remove {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #e5484d;
  background: #fff;
  border: 1px solid #ffd4d6;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(229, 72, 77, 0.08);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.watch-action-remove:hover {
  color: #fff;
  background: #e5484d;
  border-color: #e5484d;
  box-shadow: 0 12px 24px rgba(229, 72, 77, 0.24);
  transform: translateY(-1px);
}

.panel,
.dashboard-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.search-panel {
  overflow: visible;
  background:
    radial-gradient(circle at 92% 8%, rgba(245, 166, 35, 0.13), transparent 30%),
    linear-gradient(135deg, rgba(26, 58, 92, 0.06), transparent 42%),
    #fff;
  border-color: rgba(26, 58, 92, 0.14);
  box-shadow: 0 22px 48px rgba(26, 58, 92, 0.12);
}

.search-panel .searchbar {
  gap: 22px;
  padding: 28px;
}

.search-copy {
  display: grid;
  gap: 6px;
  max-width: 760px;
}

.search-copy .eyebrow {
  margin: 0;
  color: var(--nav);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 950;
  line-height: 1.15;
}

.search-copy h2 {
  color: var(--nav);
  font-size: 29px;
  line-height: 1.2;
}

.search-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.search-panel .search-main {
  gap: 10px;
}

.search-page-description {
  max-width: 680px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

body[data-search-channel="pid"] .search-panel {
  border-top: 3px solid #2563a8;
}

body[data-search-channel="keyword"] .search-panel {
  border-top: 3px solid #d97706;
}

.search-panel .search-main label {
  color: var(--nav);
  font-size: 14px;
}

.search-panel .search-main .search-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-panel .search-main .search-label-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.search-panel .search-main.mode-image .search-control {
  opacity: 0.82;
}

.search-panel .search-main.mode-image .search-control input {
  background: #f4f7fb;
  color: #8b97a6;
  cursor: not-allowed;
}

.search-panel .search-main.mode-image .keyword-examples button {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

.search-panel .search-control {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 20px;
  align-items: center;
}

.search-panel .search-control input {
  height: 62px;
  padding: 0 20px;
  color: var(--nav);
  background: #fff;
  border-radius: 16px;
  font-size: 19px;
  font-weight: 850;
}

.search-panel .search-control button {
  height: 62px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 42%),
    linear-gradient(135deg, var(--nav), #244b73);
  font-size: 17px;
  box-shadow: 0 14px 24px rgba(26, 58, 92, 0.18);
}

.search-panel .search-control button:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, #244b73, var(--nav));
}

.search-panel .search-control .search-history-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, #f59f00, #e67700);
  box-shadow: 0 14px 24px rgba(230, 119, 0, 0.18);
}

.pid-workspace-nav {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px 13px;
  background: #f7f9fc;
  border: 1px solid #e1e7f0;
  border-radius: 9px;
}

.pid-workspace-nav-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pid-workspace-nav-head > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 9px;
}

.pid-workspace-nav-head strong {
  color: #233044;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.pid-workspace-nav-head span:not(.pid-workspace-count) {
  overflow: hidden;
  color: #6b7586;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pid-workspace-count {
  flex: 0 0 auto;
  color: #52677f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pid-workspace-list {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 3px;
  scrollbar-width: thin;
}

.pid-workspace-tab {
  display: grid;
  min-width: 154px;
  flex: 0 0 auto;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 9px 12px;
  color: #314154;
  text-align: left;
  background: #ffffff;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.pid-workspace-tab:hover {
  border-color: #8eb9e5;
  background: #f7fbff;
}

.pid-workspace-tab.is-active {
  color: #123d63;
  background: #eaf4ff;
  border-color: #2f81c7;
  box-shadow: inset 0 0 0 1px rgba(47, 129, 199, 0.14);
}

.pid-workspace-tab:disabled {
  cursor: wait;
  opacity: 0.7;
}

.pid-workspace-tab-label {
  grid-row: 1 / span 2;
  padding: 3px 6px;
  color: #23638d;
  background: #e8f2fb;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
}

.pid-workspace-tab strong {
  overflow: hidden;
  font-family: var(--font-number);
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pid-workspace-tab small {
  color: #6b7586;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.pid-workspace-empty {
  padding: 7px 2px;
  color: #7b8798;
  font-size: 12px;
}

.search-panel .search-control .search-history-button::before {
  content: none;
}

.search-panel .search-control .search-history-button:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(135deg, #e67700, #d9480f);
}

@media (max-width: 1180px) {
  .search-panel .search-control {
    grid-template-columns: minmax(0, 1fr) 156px 132px;
  }
}

@media (max-width: 760px) {
  .admin-usage-summary,
  .admin-usage-sections {
    grid-template-columns: 1fr;
  }

  .admin-usage-section-head {
    display: grid;
    justify-content: stretch;
  }

  .search-panel .search-control {
    grid-template-columns: 1fr;
  }

  .similarity-threshold-hint {
    white-space: normal;
  }
}

/* Selection decision workflow */
.search-status-header {
  gap: 12px;
}

.search-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.search-background-button,
.search-resume-button,
.search-stop-button {
  min-height: 30px;
  padding: 4px 10px;
  background: #ffffff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.search-resume-button {
  color: #ffffff;
  background: #163f68;
  border: 1px solid #163f68;
  box-shadow: 0 2px 5px rgba(22, 63, 104, 0.18);
}

.search-resume-button:hover {
  background: #0f3255;
  border-color: #0f3255;
}

.search-background-button {
  color: #315b72;
  border: 1px solid #c8d6e5;
}

.search-stop-button {
  color: #b42335;
  border: 1px solid rgba(195, 68, 83, 0.42);
}

.search-stop-button:hover {
  background: rgba(195, 68, 83, 0.07);
}

.validation-workspace-tabs {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #c8d6e5;
  border-radius: 5px;
}

.validation-workspace-tabs button {
  min-height: 34px;
  padding: 5px 10px;
  color: #53667c;
  background: #ffffff;
  border: 0;
  border-right: 1px solid #d7e1eb;
  border-radius: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.validation-workspace-tabs button:last-child {
  border-right: 0;
}

.validation-workspace-tabs button.is-active {
  color: #ffffff;
  background: #1f5b8f;
}

.selection-candidate-button {
  min-height: 34px;
  color: #ffffff;
  background: #176f63;
  border: 1px solid #176f63;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 850;
}

.selection-candidate-button.is-added {
  color: #176f63;
  background: #e9f7f3;
  border-color: #8bc9ba;
}

.selection-decision-page {
  display: grid;
  min-height: calc(100vh - 150px);
  align-content: start;
  overflow: hidden;
  background: #f3f7fb;
  border: 1px solid #d7e2ee;
  border-radius: 6px;
}

.selection-decision-head {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  background: #ffffff;
  border-bottom: 1px solid #d9e4ef;
}

.selection-decision-head h2 {
  margin: 3px 0 4px;
  color: #152b43;
  font-size: 22px;
}

.selection-decision-head p:last-child {
  color: #66788d;
  font-size: 13px;
}

.selection-decision-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selection-workspace-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #ffffff;
  border-bottom: 1px solid #d9e4ef;
}

.selection-workspace-metrics article {
  display: grid;
  min-height: 76px;
  align-content: center;
  gap: 5px;
  padding: 12px 16px;
  border-right: 1px solid #e2e9f1;
}

.selection-workspace-metrics article:last-child {
  border-right: 0;
}

.selection-workspace-metrics span,
.selection-workspace-toolbar > span {
  color: #718096;
  font-size: 12px;
  font-weight: 750;
}

.selection-workspace-metrics strong {
  color: #172d45;
  font-family: var(--font-number);
  font-size: 20px;
}

.selection-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #d9e4ef;
}

.selection-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.selection-status-filters button {
  min-height: 31px;
  padding: 4px 10px;
  color: #4f6075;
  background: #ffffff;
  border: 1px solid #d2dde9;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.selection-status-filters button.is-active {
  color: #164f85;
  background: #eaf4ff;
  border-color: #83b3df;
}

.review-data-workspace {
  padding: 18px;
  background: #ffffff;
  border-bottom: 1px solid #d9e4ef;
}

.review-data-head,
.review-data-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.review-data-head h3,
.review-data-section-title h4 {
  margin: 0;
  color: #182f47;
  letter-spacing: 0;
}

.review-data-head h3 {
  font-size: 16px;
}

.review-data-section-title h4 {
  font-size: 13px;
}

.review-data-head > div:first-child {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.review-data-head-actions,
.review-data-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.review-data-task-status,
.review-data-section-title > span {
  overflow-wrap: anywhere;
  color: #6a7c90;
  font-size: 11px;
  font-weight: 750;
}

.review-data-task-status.completed {
  color: #146b5d;
}

.review-data-task-status.failed {
  color: #9a3c46;
}

.review-data-task-status.dispatching,
.review-data-task-status.processing,
.review-data-task-status.queued {
  color: #175d9e;
}

.review-data-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  background: #f7f9fc;
  border: 1px solid #d9e3ed;
}

.review-data-form label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: #607187;
  font-size: 11px;
  font-weight: 800;
}

.review-data-form input,
.review-data-form select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  color: #213950;
  background: #ffffff;
  border: 1px solid #c8d5e2;
  border-radius: 4px;
  font-size: 12px;
}

.review-data-form select,
.product-review-query-inputs select {
  cursor: pointer;
}

.review-data-form.is-push-mode {
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1fr) minmax(220px, 1fr) auto;
}

.review-data-form .primary-button {
  min-height: 38px;
  white-space: nowrap;
}

.review-data-import-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 8px 12px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #fffdf7;
  border: 1px solid #eadfbe;
}

/* Role-gated controls must remain absent even when their component sets display. */
[data-review-admin-only][hidden] {
  display: none !important;
}

.review-data-import-form label {
  display: grid;
  gap: 5px;
  color: #6b5f43;
  font-size: 11px;
  font-weight: 800;
}

.review-data-import-form input[type="file"] {
  min-width: 0;
  color: #405369;
  font-size: 11px;
}

.review-data-import-form small {
  grid-column: 1 / -1;
  color: #81765e;
  font-size: 10px;
}

.review-data-import-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  color: #315347;
  background: #f2faf6;
  border: 1px solid #b9ddca;
  font-size: 11px;
}

.review-data-import-summary[hidden] {
  display: none;
}

.review-data-import-summary details summary {
  cursor: pointer;
  color: #7b4d18;
  font-weight: 800;
}

.review-data-import-summary ul {
  max-height: 150px;
  margin: 7px 0 0;
  padding-left: 18px;
  overflow: auto;
}

.review-data-import-preview {
  margin: 12px 20px 0;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d9e3ed;
  border-radius: 6px;
}

.review-data-import-preview[hidden] {
  display: none;
}

.review-data-import-preview-wrap {
  max-height: 420px;
  margin-top: 8px;
  overflow: auto;
  border: 1px solid #dce5ee;
  border-radius: 5px;
}

.review-data-import-preview-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.review-data-import-preview-table th,
.review-data-import-preview-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e4eaf1;
  color: #405369;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

.review-data-import-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #51667d;
  background: #f2f6fa;
}

.review-data-import-preview-table th:nth-child(1) { width: 24%; }
.review-data-import-preview-table th:nth-child(2) { width: 14%; }
.review-data-import-preview-table th:nth-child(3) { width: 52%; }
.review-data-import-preview-table th:nth-child(4) { width: 10%; }

.review-import-link a {
  display: block;
  overflow: hidden;
  color: #246699;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-import-time,
.review-import-rating {
  white-space: nowrap;
}

.review-import-content {
  color: #253b52;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-data-result-block,
.review-data-history-block {
  margin-top: 16px;
}

.review-data-table-wrap {
  margin-top: 8px;
  border: 1px solid #dce5ee;
}

.review-data-history-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.review-data-history-pager .text-button {
  min-width: 56px;
  padding: 4px 12px;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  background: #fff;
  color: #405369;
  font-size: 11px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.review-data-history-pager .text-button:hover:not(:disabled) {
  border-color: #7aa7e0;
  box-shadow: 0 0 0 3px rgba(58, 124, 217, 0.12);
}

.review-data-history-pager .text-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.review-data-history-page-info {
  min-width: 48px;
  text-align: center;
  color: #62748a;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .review-data-history-pager .text-button {
  background: #1d2733;
  border-color: #33415a;
  color: #c8d4e2;
}

html[data-theme="dark"] .review-data-history-page-info {
  color: #8fa2b8;
}

.review-data-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  table-layout: fixed;
}

.review-data-table th,
.review-data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e6edf4;
  color: #405369;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
  vertical-align: middle;
}

.review-data-table th {
  color: #62748a;
  background: #f5f8fb;
  font-weight: 850;
}

.review-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.review-data-table tbody tr.is-active td {
  background: #eef6fd;
}

.review-data-table td > a,
.review-data-table td > strong {
  color: #183c5e;
  font-weight: 850;
}

.review-data-table td > a:hover {
  color: #175d9e;
  text-decoration: underline;
}

.review-data-product-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.review-data-product-thumb {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f3f6f9;
  border: 1px solid #d5e0ea;
  border-radius: 4px;
}

.review-data-product-thumb[data-image-preview] {
  cursor: zoom-in;
}

.review-data-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-data-product-thumb.is-empty {
  opacity: 0.7;
}

.review-data-product-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-data-history-table td:nth-child(3) strong,
.review-data-history-table td:nth-child(3) small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-data-history-table td:nth-child(3) small {
  margin-top: 3px;
  color: #8190a3;
  font-family: var(--font-number);
  font-size: 9px;
}

.review-data-check-col {
  width: 40px;
  text-align: center;
}

.review-data-check-cell {
  text-align: center;
  vertical-align: middle;
}

.review-task-check {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--line, #c9d8f0);
  border-radius: 6px;
  background: var(--panel, #fff);
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.review-task-check:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.12);
}

.review-task-check:checked,
.review-task-check:indeterminate {
  border-color: var(--blue);
  background-color: var(--blue);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.review-task-check:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.review-task-check:indeterminate {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}

.review-task-check:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.review-data-mono,
.review-data-endpoint {
  font-family: var(--font-number);
}

.review-data-endpoint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-data-status {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  color: #53677c;
  background: #f3f6f9;
  border: 1px solid #d3dde7;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.review-data-status.completed {
  color: #146b5d;
  background: #eaf8f4;
  border-color: #9bd4c8;
}

.review-data-status.failed {
  color: #953741;
  background: #fff0f1;
  border-color: #e6adb2;
}

.review-data-status.processing,
.review-data-status.dispatching,
.review-data-status.queued {
  color: #315b88;
  background: #edf5fc;
  border-color: #bdd3e8;
}

.review-data-row-actions button {
  min-height: 27px;
  padding: 3px 7px;
  color: #315b88;
  background: #ffffff;
  border: 1px solid #bdccdb;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.review-product-check {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  color: #315b88;
  background: #f5f9fd;
  border: 1px solid #bdd3e8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.review-product-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #1769aa;
}

.review-product-check:has(input:disabled) {
  cursor: default;
  opacity: 0.55;
}

.selection-candidate-list {
  display: grid;
  gap: 10px;
  padding: 14px 18px 20px;
}

.selection-candidate-list.empty {
  min-height: 240px;
  place-items: center;
  color: #718096;
}

.selection-candidate-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #d8e3ee;
  border-left: 4px solid #7aa6cf;
  border-radius: 6px;
}

.selection-candidate-card.status-approved,
.selection-candidate-card.status-sampling {
  border-left-color: #1d8d77;
}

.selection-candidate-card.status-rejected {
  border-left-color: #c75b64;
}

.selection-candidate-image {
  width: 108px;
  height: 108px;
  overflow: hidden;
  padding: 4px;
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  border-radius: 5px;
}

.selection-candidate-image img,
.supplier-compare-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.selection-candidate-main {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.selection-candidate-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.selection-candidate-title-row > div {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.selection-candidate-title-row a,
.selection-candidate-title-row > div > strong {
  width: 100%;
  overflow: hidden;
  color: #172f49;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-candidate-title-row a:hover {
  color: #175d9e;
  text-decoration: underline;
}

.selection-candidate-title-row small {
  color: #8190a3;
  font-family: var(--font-number);
  font-size: 11px;
}

.selection-status-badge,
.selection-risk-badge,
.selection-ok-badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
}

.selection-status-badge {
  color: #315b88;
  background: #edf5fc;
  border-color: #bdd3e8;
}

.selection-status-badge.approved,
.selection-status-badge.sampling,
.selection-ok-badge {
  color: #146b5d;
  background: #eaf8f4;
  border-color: #9bd4c8;
}

.selection-status-badge.rejected,
.selection-risk-badge {
  color: #953741;
  background: #fff0f1;
  border-color: #e6adb2;
}

.selection-status-select {
  display: grid;
  flex: 0 0 132px;
  gap: 4px;
  color: #718096;
  font-size: 11px;
  font-weight: 800;
}

.selection-status-select select,
.selection-candidate-decision-grid input,
.profit-input-grid input {
  width: 100%;
  min-height: 34px;
  padding: 5px 9px;
  color: #273b52;
  background: #ffffff;
  border: 1px solid #cbd8e6;
  border-radius: 4px;
}

.selection-candidate-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.selection-candidate-details {
  margin-top: 6px;
}

.selection-candidate-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  color: #4f6f91;
  background: #edf3f8;
  border: 1px solid #d0dce8;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  list-style: none;
}

.selection-candidate-toggle::-webkit-details-marker { display: none; }

.selection-candidate-toggle::after {
  content: "▸";
  font-size: 10px;
  transition: transform 0.18s ease;
}

.selection-candidate-details[open] .selection-candidate-toggle::after {
  transform: rotate(90deg);
}

/* AI typing animation */
.agent-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
}

.agent-typing span {
  width: 6px;
  height: 6px;
  background: #8899b0;
  border-radius: 50%;
  animation: agent-typing-bounce 1.2s infinite ease-in-out;
}

.agent-typing span:nth-child(2) { animation-delay: 0.2s; }
.agent-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes agent-typing-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.selection-candidate-metrics > span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  color: #63748a;
  background: #f4f7fa;
  border: 1px solid #e0e7ef;
  border-radius: 4px;
  font-size: 11px;
}

.selection-candidate-metrics strong {
  color: #253b53;
}

.selection-candidate-decision-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(180px, 0.9fr) minmax(260px, 1.7fr);
  gap: 8px;
}

.selection-candidate-decision-grid section,
.selection-candidate-decision-grid label {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e0e7ef;
  border-radius: 5px;
}

.selection-candidate-decision-grid span {
  color: #718096;
  font-size: 11px;
  font-weight: 750;
}

.selection-candidate-decision-grid div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.selection-empty-value {
  color: #8a97a8;
}

.selection-candidate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.selection-candidate-actions button,
.same-products-supplier-actions button,
.supplier-compare-card button {
  min-height: 30px;
  padding: 4px 9px;
  color: #315b72;
  background: #ffffff;
  border: 1px solid #c8d6e5;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.selection-candidate-actions button.danger {
  margin-left: auto;
  color: #a33b43;
  border-color: #e3b3b7;
}

.selection-candidate-actions button.selection-monitor-button {
  color: #ffffff;
  background: #2563a8;
  border-color: #2563a8;
}

.selection-candidate-actions button.selection-monitor-button:hover,
.selection-candidate-actions button.selection-monitor-button:focus-visible {
  color: #ffffff;
  background: #174f8f;
  border-color: #174f8f;
}

.selection-candidate-actions button[data-candidate-source].is-complete {
  color: #ffffff;
  background: #0f8a78;
  border-color: #0f8a78;
}

.selection-candidate-actions button[data-candidate-source].is-complete:hover,
.selection-candidate-actions button[data-candidate-source].is-complete:focus-visible {
  color: #ffffff;
  background: #087263;
  border-color: #087263;
}

.watch-product-dialog-panel {
  width: min(920px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  overflow: hidden;
}

.watch-product-dialog-head {
  padding: 14px 18px;
}

.watch-product-dialog-head .eyebrow {
  margin: 0 0 3px;
}

.watch-product-dialog-head h2 {
  font-size: 18px;
}

.watch-product-dialog-body {
  padding: 16px;
  overflow: auto;
  background: #eef4fa;
}

.watch-product-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d7e4f1;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 40, 68, 0.1);
}

.watch-product-media {
  display: grid;
  min-height: 230px;
  padding: 14px;
  place-items: center;
  background: #f7fafc;
  border-right: 1px solid #e1e9f2;
}

.watch-product-media img {
  width: 100%;
  max-height: 210px;
  object-fit: contain;
}

.watch-product-main {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 16px 18px 13px;
}

.watch-product-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 12px;
}

.watch-product-title-row h3 {
  margin: 0;
  color: #173451;
  font-size: 16px;
  line-height: 1.4;
}

.watch-product-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 16px;
}

.watch-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 2px;
  color: #65758a;
  font-size: 11px;
  font-weight: 750;
}

.watch-price-trend-view {
  min-width: 0;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #d7e4f1;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 40, 68, 0.1);
}

.watch-price-trend-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.watch-price-trend-heading p,
.watch-price-trend-heading h3 {
  margin: 0;
}

.watch-price-trend-heading p {
  color: #65758a;
  font-size: 11px;
  font-weight: 850;
}

.watch-price-trend-heading h3 {
  max-width: 620px;
  margin-top: 4px;
  color: #173451;
  font-size: 15px;
  line-height: 1.4;
}

.watch-price-trend-heading > strong {
  flex: 0 0 auto;
  color: #173451;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.watch-price-trend-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 24px;
  margin-top: 16px;
  padding: 10px 0;
  color: #65758a;
  border-top: 1px solid #e3ebf3;
  border-bottom: 1px solid #e3ebf3;
  font-size: 11px;
  font-weight: 750;
}

.watch-price-trend-summary strong {
  margin-left: 5px;
  color: #173451;
  font-variant-numeric: tabular-nums;
}

.watch-price-chart-scroll {
  width: 100%;
  margin-top: 12px;
  overflow-x: auto;
}

.watch-price-chart {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
  aspect-ratio: 820 / 360;
  overflow: visible;
}

.watch-price-axis-tick line {
  stroke: #e3ebf3;
  stroke-width: 1;
}

.watch-price-axis-tick text,
.watch-price-axis-title {
  fill: #65758a;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.watch-price-axis {
  stroke: #8ba0b5;
  stroke-width: 1.25;
}

.watch-price-chart-line {
  fill: none;
  stroke: #1677a8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.watch-sales-chart-line {
  stroke: #16815d;
}

.watch-price-chart-point circle {
  fill: #ffffff;
  stroke: #1677a8;
  stroke-width: 3;
  transition: fill 0.15s ease, stroke-width 0.15s ease;
  vector-effect: non-scaling-stroke;
}

.watch-sales-chart-point circle {
  stroke: #16815d;
}

.watch-price-chart-point:hover circle,
.watch-price-chart-point:focus circle {
  fill: #1677a8;
  stroke-width: 5;
  outline: none;
}

.watch-sales-chart-point:hover circle,
.watch-sales-chart-point:focus circle {
  fill: #16815d;
}

.watch-price-chart-empty {
  display: grid;
  min-height: 280px;
  margin-top: 16px;
  place-items: center;
  color: #65758a;
  border-top: 1px solid #e3ebf3;
  font-size: 13px;
  font-weight: 800;
}

html[data-theme="dark"] .watch-product-dialog-body,
html[data-theme="dark"] .watch-product-media {
  background: #151f2a;
}

html[data-theme="dark"] .watch-product-card {
  background: #19232f;
  border-color: #344357;
}

html[data-theme="dark"] .watch-price-trend-view {
  background: #19232f;
  border-color: #344357;
}

html[data-theme="dark"] .watch-price-trend-heading h3,
html[data-theme="dark"] .watch-price-trend-heading > strong,
html[data-theme="dark"] .watch-price-trend-summary strong {
  color: #e7edf5;
}

html[data-theme="dark"] .watch-price-trend-summary,
html[data-theme="dark"] .watch-price-chart-empty {
  border-color: #344357;
}

html[data-theme="dark"] .watch-price-axis-tick line {
  stroke: #344357;
}

html[data-theme="dark"] .watch-price-chart-point circle {
  fill: #19232f;
}

html[data-theme="dark"] .watch-product-media {
  border-right-color: #344357;
}

html[data-theme="dark"] .watch-product-title-row h3 {
  color: #e7edf5;
}

@media (max-width: 680px) {
  .watch-product-dialog-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .watch-product-card {
    grid-template-columns: 1fr;
  }

  .watch-product-media {
    min-height: 180px;
    border-right: 0;
    border-bottom: 1px solid #e1e9f2;
  }

  .watch-product-media img {
    max-height: 180px;
  }

  .watch-product-title-row {
    grid-template-columns: 1fr;
  }

  .watch-price-trend-heading {
    display: grid;
    gap: 8px;
  }

  .watch-product-title-row .watch-actions {
    justify-self: start;
  }

  .watch-product-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.same-products-supplier-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.same-products-supplier-actions label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #5b6c80;
  font-size: 10px;
  font-weight: 800;
}

.same-products-supplier-actions input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #176f63;
}

.same-products-supplier-actions button.is-preferred {
  color: #76520f;
  background: #fff6d9;
  border-color: #dfbc60;
}

.selected-supplier-count {
  color: #486177;
  font-size: 12px;
  font-weight: 800;
}

.profit-dialog-panel,
.supplier-compare-panel {
  width: min(1080px, calc(100vw - 32px));
  max-width: none;
}

.profit-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.profit-input-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.profit-input-grid label {
  display: grid;
  gap: 5px;
  color: #526278;
  font-size: 12px;
  font-weight: 800;
}

.profit-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(160px, 1.1fr);
  border: 1px solid #d8e3ee;
  border-radius: 6px;
  overflow: hidden;
}

.profit-result article,
.profit-verdict {
  display: grid;
  min-height: 78px;
  align-content: center;
  gap: 5px;
  padding: 12px;
  background: #f8fafc;
  border-right: 1px solid #dfe7ef;
}

.profit-result span {
  color: #718096;
  font-size: 11px;
  font-weight: 750;
}

.profit-result strong {
  color: #1d334b;
  font-family: var(--font-number);
}

.profit-verdict.good {
  background: #eaf8f4;
}

.profit-verdict.warning {
  background: #fff6d9;
}

.profit-verdict.danger {
  background: #fff0f1;
}

.profit-form-actions {
  display: flex;
  justify-content: flex-end;
}

.supplier-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.supplier-compare-card {
  display: grid;
  min-width: 0;
  gap: 9px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d7e2ed;
  border-radius: 6px;
}

.supplier-compare-card.is-preferred {
  border-color: #d5aa43;
  box-shadow: inset 0 3px 0 #d5aa43;
}

.supplier-compare-image {
  height: 130px;
  padding: 4px;
  background: #f7f9fb;
  border: 1px solid #e0e7ef;
  border-radius: 5px;
}

.supplier-compare-card > span {
  color: #8b6418;
  font-size: 11px;
  font-weight: 850;
}

.supplier-compare-card > strong {
  min-height: 38px;
  color: #1c344d;
  line-height: 1.4;
}

.supplier-compare-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid #e5ebf1;
  border-left: 1px solid #e5ebf1;
}

.supplier-compare-card dl div {
  display: grid;
  gap: 3px;
  padding: 7px;
  border-right: 1px solid #e5ebf1;
  border-bottom: 1px solid #e5ebf1;
}

.supplier-compare-card dt {
  color: #718096;
  font-size: 10px;
}

.supplier-compare-card dd {
  margin: 0;
  color: #263d55;
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 850;
}

.supplier-compare-card p {
  min-height: 34px;
  color: #63748a;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .selection-workflow-steps {
    grid-template-columns: repeat(6, minmax(118px, 1fr));
  }

  .selection-workspace-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profit-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profit-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .selection-decision-head,
  .selection-workspace-toolbar,
  .selection-candidate-title-row,
  .review-data-head {
    align-items: stretch;
    flex-direction: column;
  }

  .review-data-form {
    grid-template-columns: 1fr;
  }

  .review-data-form.is-push-mode {
    grid-template-columns: 1fr;
  }

  .review-data-import-form {
    grid-template-columns: 1fr;
  }

  .review-data-head-actions {
    flex-wrap: wrap;
  }

  .selection-candidate-decision-grid,
  .profit-input-grid,
  .profit-result {
    grid-template-columns: 1fr;
  }

  .selection-workspace-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-candidate-card {
    grid-template-columns: 1fr;
  }

  .selection-candidate-image {
    width: 100%;
    height: 180px;
  }

  .selection-status-select {
    flex-basis: auto;
  }
}

.search-panel .filter-toolbar {
  padding: 4px 2px 0;
}

.search-panel .filter-toolbar span {
  color: var(--nav);
  font-size: 15px;
}

.search-panel .filter-toolbar small {
  max-width: 620px;
  text-align: right;
}

.range-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(176px, 1fr));
  gap: 12px;
}

.range-filter-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
  min-height: 106px;
  padding: 13px;
  background:
    linear-gradient(135deg, rgba(245, 166, 35, 0.08), transparent 62%),
    rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(200, 211, 223, 0.86);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(26, 58, 92, 0.06);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.range-filter-group:hover,
.range-filter-group:focus-within {
  border-color: rgba(245, 166, 35, 0.48);
  box-shadow: 0 16px 30px rgba(26, 58, 92, 0.1);
  transform: translateY(-1px);
}

.range-filter-group span {
  grid-column: 1 / -1;
  color: var(--nav);
  font-size: 13px;
  font-weight: 900;
}

.range-filter-group input {
  height: 38px;
  border-color: rgba(200, 211, 223, 0.95);
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}

.compact-filter-grid {
  grid-template-columns: repeat(2, minmax(260px, 420px));
  gap: 12px;
}

.compact-filter-grid .search-filter {
  grid-column: auto;
  min-height: 116px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(200, 211, 223, 0.82);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(26, 58, 92, 0.06);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.compact-filter-grid .search-filter:hover {
  border-color: rgba(245, 166, 35, 0.42);
  box-shadow: 0 16px 28px rgba(26, 58, 92, 0.1);
  transform: translateY(-1px);
}

.compact-filter-grid .search-filter select {
  height: 38px;
  border-radius: 12px;
}

.smart-filter-card {
  border-color: rgba(245, 166, 35, 0.36);
}

.smart-filter-toggle {
  width: 100%;
  height: 38px;
  justify-content: center;
  color: var(--nav);
  background: #fff8eb;
  border: 1px solid rgba(245, 166, 35, 0.56);
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(245, 166, 35, 0.12);
}

.smart-filter-toggle:hover {
  color: #fff;
  background: #d98b21;
  border-color: #d98b21;
}

.smart-filter-toggle.active,
.smart-filter-toggle[aria-pressed="true"] {
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, var(--amber), #d98b21);
  border-color: #d98b21;
}

.smart-filter-toggle.active:hover,
.smart-filter-toggle[aria-pressed="true"]:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(135deg, #bf7415, #a7600f);
}

.filter-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

input:focus,
select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.16);
}

button {
  background: var(--nav);
  border-radius: 10px;
}

button:hover {
  background: #244b73;
  box-shadow: 0 10px 20px rgba(26, 58, 92, 0.16);
  transform: translateY(-1px);
}

.search-panel {
  background: #f5f7fa;
  border-color: #e5eaf3;
  box-shadow: 0 18px 42px rgba(31, 35, 41, 0.07);
}

.search-panel .searchbar {
  gap: 22px;
}

.filter-suite {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #f5f7fa;
  border: 1px solid #e5eaf3;
  border-radius: 16px;
}

.basic-filter-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e5eaf3;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(31, 35, 41, 0.04);
}

.filter-suite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-suite-head h3 {
  margin: 0;
  color: #1f2329;
  font-size: 16px;
  font-weight: 950;
}

.filter-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-collapse-button {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #1677ff;
  background: #fff;
  border: 1px solid #c9dcff;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.filter-collapse-button:hover {
  background: #eef6ff;
  border-color: #8fbdff;
  box-shadow: none;
  transform: none;
}

.filter-suite-head p:not(.eyebrow) {
  margin-top: 5px;
  color: #86909c;
  font-size: 12px;
  line-height: 1.45;
}

.filter-stats {
  display: grid;
  min-width: 220px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filter-stats article {
  min-height: 46px;
  padding: 8px 10px;
  background: #f8fafd;
  border: 1px solid #e5eaf3;
  border-radius: 9px;
  box-shadow: none;
}

.filter-stats span {
  display: block;
  color: #86909c;
  font-size: 11px;
  font-weight: 800;
}

.filter-stats strong {
  display: block;
  margin-top: 3px;
  color: #1677ff;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 16px;
  line-height: 1;
}

.filter-suite.is-collapsed {
  gap: 0;
  padding: 12px 16px;
}

.filter-suite.is-collapsed .basic-filter-panel {
  gap: 0;
  padding: 12px 16px;
}

.filter-suite.is-collapsed .range-filter-row,
.filter-suite.is-collapsed .advanced-filter-section,
.filter-suite.is-collapsed .filter-actions {
  display: none;
}

.filter-suite .range-filter-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.filter-suite .range-filter-group {
  display: grid;
  min-height: 92px;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 6px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  box-shadow: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.filter-suite .range-filter-group:hover,
.filter-suite .range-filter-group:focus-within {
  border-color: #1677ff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.08);
  transform: none;
}

.filter-suite .range-filter-group.invalid {
  border-color: #ff4d4f;
  box-shadow: 0 12px 26px rgba(255, 77, 79, 0.1);
}

.filter-suite .range-filter-group label,
.advanced-label {
  color: #1f2329;
  font-size: 12px;
  font-weight: 900;
}

.filter-suite .range-filter-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.filter-suite .range-filter-group label i {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  color: #86909c;
  border: 1px solid #b8c2d3;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.range-input-pair {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.range-input-pair span {
  grid-column: auto;
  color: #c9cdd4;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.filter-suite .range-filter-group input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  color: #1f2329;
  background: #f8fafd;
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.filter-suite .range-filter-group input::placeholder {
  color: #a8b1c2;
}

.filter-suite .range-filter-group input:hover {
  border-color: #c9d7ee;
}

.filter-suite .range-filter-group input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14);
}

.range-support {
  color: #86909c;
  font-size: 11px;
  line-height: 1.25;
}

.range-error {
  min-height: 12px;
  color: #ff4d4f;
  font-size: 11px;
  line-height: 1.25;
}

.advanced-filter-section {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(360px, 1.12fr);
  gap: 12px;
  align-items: stretch;
}

.advanced-filter-section .seller-type-filter,
.advanced-filter-section .smart-filter-card {
  min-height: 124px;
  padding: 14px 16px;
  border-radius: 14px;
}

.advanced-filter-section .seller-type-filter {
  background: #fff;
  border: 1px solid #e5eaf3;
}

.seller-type-segment {
  display: inline-grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 10px;
  padding: 4px;
  background: #f2f4f7;
  border: 1px solid #e5eaf3;
  border-radius: 10px;
}

.seller-type-option {
  height: 30px;
  color: #4e5969;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 850;
}

.seller-type-option:hover {
  color: #1677ff;
  background: rgba(22, 119, 255, 0.08);
  box-shadow: none;
  transform: none;
}

.seller-type-option.active {
  color: #1677ff;
  background: #fff;
  box-shadow: 0 4px 12px rgba(31, 35, 41, 0.08);
}

.advanced-filter-section .smart-filter-card {
  background: #f8fbff;
  border: 1px solid #d8e9ff;
  box-shadow: none;
}

.smart-filter-card.active {
  border-color: #1677ff;
  box-shadow: 0 14px 30px rgba(22, 119, 255, 0.1);
}

.smart-filter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.smart-filter-top p {
  margin-top: 3px;
  color: #4e5969;
  font-size: 12px;
  font-weight: 800;
}

.smart-filter-select-all {
  min-width: 86px;
  height: 30px;
  flex: 0 0 auto;
  padding: 0 12px;
  color: #1677ff;
  background: #fff;
  border: 1px solid #bfdbff;
  border-radius: 999px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
}

.smart-filter-select-all:hover {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.16);
  transform: none;
}

.smart-filter-select-all.active,
.smart-filter-select-all[aria-pressed="true"] {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
}

.smart-filter-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  background: #c9cdd4;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  transition:
    background 0.22s ease,
    box-shadow 0.22s ease;
}

.smart-filter-toggle span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(31, 35, 41, 0.18);
  transition: transform 0.22s ease;
}

.smart-filter-toggle:hover {
  background: #b7bdc7;
  box-shadow: none;
  transform: none;
}

.smart-filter-toggle.active,
.smart-filter-toggle[aria-pressed="true"] {
  background: #1677ff;
  border-color: transparent;
}

.smart-filter-toggle.active span,
.smart-filter-toggle[aria-pressed="true"] span {
  transform: translateX(20px);
}

.smart-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.smart-filter-option {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  color: #1677ff;
  background: #fff;
  border: 1px solid #d8e9ff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  user-select: none;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.smart-filter-option:hover,
.smart-filter-option:focus-within {
  border-color: #9dccff;
  box-shadow: 0 6px 16px rgba(22, 119, 255, 0.1);
}

.smart-filter-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.smart-filter-option span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.smart-filter-option span::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border: 1px solid #9dccff;
  border-radius: 3px;
  box-sizing: border-box;
}

.smart-filter-option.active {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.16);
}

.smart-filter-option.active span::before {
  content: "✓";
  color: #1677ff;
  background: #fff;
  border-color: #fff;
  font-size: 10px;
  font-weight: 950;
  line-height: 10px;
  text-align: center;
}

.filter-suite .filter-hint {
  margin-top: 7px;
  color: #86909c;
  font-size: 11px;
  line-height: 1.38;
}

.smart-filter-help-summary,
.smart-filter-help-rules {
  display: block;
}

.smart-filter-help-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.smart-filter-help-rule {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  color: #42526b;
  background: #f7fbff;
  border: 1px solid #d8e9ff;
  border-radius: 8px;
  line-height: 1.35;
}

.smart-filter-help-rule b {
  flex: 0 0 auto;
  color: #1677ff;
  font-weight: 900;
}

.smart-filter-help-rule span {
  overflow-wrap: anywhere;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 0;
}

.filter-reset-button,
.filter-apply-button {
  width: auto;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.filter-reset-button {
  color: #4e5969;
  background: #fff;
  border: 1px solid #e5eaf3;
  box-shadow: none;
}

.filter-reset-button:hover {
  color: #1f2329;
  background: #f7f8fa;
  border-color: #c9cdd4;
  box-shadow: none;
  transform: none;
}

.filter-apply-button {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.22);
}

.filter-apply-button:hover {
  background: #0f63d8;
  border-color: #0f63d8;
  box-shadow: 0 12px 26px rgba(22, 119, 255, 0.28);
}

.filter-apply-button.is-loading {
  cursor: wait;
  opacity: 0.82;
}

.search-panel input:focus,
.search-panel select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14);
}

@media (max-width: 1180px) {
  .filter-suite .range-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advanced-filter-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .filter-suite {
    padding: 14px;
  }

  .filter-suite-head {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-stats,
  .filter-suite .range-filter-row,
  .advanced-filter-section,
  .seller-type-segment {
    grid-template-columns: 1fr;
  }

  .filter-collapse-button {
    width: 100%;
  }

  .smart-filter-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .smart-filter-select-all {
    width: 100%;
  }

  .smart-filter-option {
    width: 100%;
    justify-content: center;
  }

  .filter-actions {
    flex-direction: column-reverse;
  }

  .filter-reset-button,
  .filter-apply-button {
    width: 100%;
  }

  .midplatform-can-do-panel {
    grid-template-columns: 1fr;
  }

  .midplatform-can-do-list {
    justify-content: flex-start;
  }
}

.product-list {
  gap: 12px;
  padding: 14px;
  overflow-x: auto;
}

.product {
  grid-template-columns: 132px minmax(0, 1fr) minmax(260px, 0.65fr) 148px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(26, 58, 92, 0.06);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.product:hover {
  background: #fff;
  border-color: rgba(245, 166, 35, 0.45);
  box-shadow: 0 18px 36px rgba(26, 58, 92, 0.13);
  transform: translateY(-2px);
}

.thumb {
  width: 132px;
  border-radius: 12px;
}

.product h3 {
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.product-title-link {
  color: var(--nav);
  text-decoration: none;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

a.product-title-link {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

a.product-title-link:hover {
  color: #d97706;
  text-decoration-color: rgba(217, 119, 6, 0.45);
}

.product .meta {
  gap: 8px;
  margin-top: 10px;
  color: #6f7b8d;
  font-size: 12px;
  line-height: 1.7;
  align-items: center;
}

.product .pill,
.product .seller-type,
.product .rocket-type {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 750;
}

.product-classification-summary {
  display: grid;
  gap: 10px;
  padding: 12px 18px 18px;
  background: #eaf1f8;
}

.product-classification-summary:has(.filter-status-summary[hidden]):has(.competitor-classify-summary[hidden]) {
  display: none;
}

.filter-status-summary[hidden] {
  display: none;
}

.filter-status-panel {
  display: grid;
  grid-template-columns: minmax(170px, 0.28fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d6e4f2;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(18, 40, 68, 0.045);
}

.filter-status-head {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
  padding: 2px 4px;
}

.filter-status-head span {
  color: #0b756c;
  font-size: 12px;
  font-weight: 950;
}

.filter-status-head strong {
  color: #0f1f35;
  font-size: 16px;
  font-weight: 950;
}

.compare-view-switch {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 6px;
  width: fit-content;
}

.compare-view-switch .same-products-view-switch {
  flex: 0 0 auto;
  margin: 0;
}

.compare-view-switch-divider {
  width: 1px;
  height: 22px;
  flex: 0 0 1px;
  background: #d7e1eb;
}

.compare-view-sort-control {
  display: inline-flex;
  min-width: 0;
  align-items: center;
}

.compare-view-sort-control select {
  height: 34px;
  min-width: 112px;
  padding: 0 28px 0 10px;
  color: #314b68;
  background: #ffffff;
  border: 1px solid #c5d2df;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
}

.compare-view-sort-direction select {
  min-width: 96px;
}

.compare-view-sort-control select:hover:not(:disabled),
.compare-view-sort-control select:focus-visible {
  border-color: #6d91b7;
  outline: 2px solid rgba(37, 99, 168, 0.14);
  outline-offset: 1px;
}

.compare-view-sort-control select:disabled {
  color: #8a9aae;
  background: #f1f4f7;
  cursor: not-allowed;
}

.filter-status-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.filter-status-tab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 46px;
  align-content: center;
  padding: 8px 11px;
  color: #17365a;
  background: #f9fbfd;
  border: 1px solid #dce7f4;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.filter-status-tab:hover {
  background: #f2f8fd;
  border-color: #abc9e5;
}

.filter-status-tab span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-status-tab strong {
  color: inherit;
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 950;
}

.filter-status-tab.is-active {
  color: #ffffff;
  background: #0b756c;
  border-color: #0b756c;
  box-shadow: 0 8px 16px rgba(11, 117, 108, 0.18);
}

.filter-status-tab.is-filtering:not(.is-active) {
  background: #fffbf2;
  border-color: #f2c878;
}

.filter-status-tab.is-rejected:not(.is-active) {
  background: #fff7f7;
  border-color: #efcaca;
}

.sales-enrichment-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 9px 11px;
  background: #f5faf9;
  border: 1px solid #c9e4df;
  border-radius: 6px;
}

.sales-enrichment-progress.is-complete {
  background: #f3faf6;
  border-color: #bfe0ca;
}

.sales-enrichment-progress.is-cooldown {
  background: #fffaf0;
  border-color: #e8c77f;
}

.sales-enrichment-progress.is-cooldown .sales-enrichment-result-mark {
  background: #b7791f;
}

.sales-enrichment-progress.is-cooldown .sales-enrichment-result-mark::after {
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  background: #ffffff;
  border: 0;
  transform: none;
}

.sales-enrichment-progress.is-cooldown .sales-enrichment-progress-line strong,
.sales-enrichment-progress.is-cooldown .sales-enrichment-progress-line em {
  color: #8a5a11;
}

.sales-enrichment-progress.is-error,
.sales-enrichment-progress.is-stopped {
  background: #fff8f6;
  border-color: #eccbc4;
}

.sales-enrichment-progress-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: #315267;
  font-size: 12px;
}

.sales-enrichment-progress-line strong {
  color: #0b756c;
  font-size: 13px;
  font-weight: 950;
}

.sales-enrichment-progress-line b {
  color: #10243a;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 950;
}

.sales-enrichment-progress-line span,
.sales-enrichment-progress-line em {
  font-style: normal;
  font-weight: 800;
}

.sales-enrichment-progress-success {
  color: #16794c;
}

.sales-enrichment-progress-failed {
  color: #b54c3d;
}

.sales-enrichment-progress-missing {
  color: #8b6a35;
}

.sales-enrichment-progress-line em {
  margin-left: auto;
  color: #66778b;
}

.sales-enrichment-progress-error-detail {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
  color: #9a3e31;
  background: #fff7f5;
  border: 1px solid #f0d0ca;
  border-radius: 4px;
  font-size: 11px;
}

.sales-enrichment-progress-error-detail strong {
  flex: 0 0 auto;
  font-weight: 900;
}

.sales-enrichment-progress-error-detail span {
  overflow: hidden;
  min-width: 0;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-enrichment-result-mark {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background: #16845e;
  border-radius: 50%;
}

.sales-enrichment-result-mark::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 3px;
  height: 6px;
  content: "";
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
}

.sales-enrichment-progress.is-error .sales-enrichment-result-mark {
  background: #b54c3d;
}

.sales-enrichment-progress.is-error .sales-enrichment-result-mark::after {
  top: -1px;
  left: 0;
  width: 14px;
  height: 14px;
  content: "!";
  color: #ffffff;
  border: 0;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 15px;
  text-align: center;
  transform: none;
}

.sales-enrichment-progress.is-stopped .sales-enrichment-result-mark {
  background: #8b6a35;
}

.sales-enrichment-progress.is-stopped .sales-enrichment-result-mark::after {
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  background: #ffffff;
  border: 0;
  transform: none;
}

.sales-enrichment-stop-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  margin-left: 2px;
  padding: 3px 8px;
  color: #a33a2d;
  background: #fff6f3;
  border: 1px solid #e8b8ae;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.sales-enrichment-stop-button::before {
  width: 7px;
  height: 7px;
  content: "";
  background: currentColor;
  border-radius: 1px;
}

.sales-enrichment-stop-button:hover {
  color: #ffffff;
  background: #b54c3d;
  border-color: #b54c3d;
}

html[data-theme="dark"] .sales-enrichment-stop-button {
  color: #ff9b89;
  background: #3a2425;
  border-color: #6f3c3c;
}

html[data-theme="dark"] .sales-enrichment-stop-button:hover {
  color: #ffffff;
  background: #a94b42;
  border-color: #a94b42;
}

html[data-theme="dark"] .sales-enrichment-progress-success {
  color: #67d39a;
}

html[data-theme="dark"] .sales-enrichment-progress-failed {
  color: #ff9b89;
}

html[data-theme="dark"] .sales-enrichment-progress-missing {
  color: #e8bf70;
}

html[data-theme="dark"] .sales-enrichment-progress.is-complete {
  background: #172d28;
  border-color: #315d50;
}

html[data-theme="dark"] .sales-enrichment-progress.is-error,
html[data-theme="dark"] .sales-enrichment-progress.is-stopped {
  background: #352525;
  border-color: #68413d;
}

html[data-theme="dark"] .sales-enrichment-progress-error-detail {
  color: #ffab9d;
  background: #3a2526;
  border-color: #70403f;
}

.sales-enrichment-spinner,
.sales-value-loading i {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid #abd8d1;
  border-top-color: #0b756c;
  border-radius: 50%;
  animation: sales-enrichment-spin 0.8s linear infinite;
}

.sales-enrichment-progress-track {
  height: 5px;
  overflow: hidden;
  background: #dceae8;
  border-radius: 3px;
}

.sales-enrichment-progress-track i {
  display: block;
  width: var(--sales-enrichment-progress, 0%);
  height: 100%;
  background: #0b8f82;
  border-radius: inherit;
  transition: width 180ms ease;
}

.sales-value-loading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #0b756c;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.sales-value-missing {
  color: #8b6a35;
  font-size: 11px;
  font-weight: 900;
}

.sales-value-error {
  color: #b42318;
  font-size: 11px;
  font-weight: 900;
  cursor: help;
}

@keyframes sales-enrichment-spin {
  to { transform: rotate(360deg); }
}

.screening-status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  color: #0b6f67;
  background: #eef9f7;
  border: 1px solid #b8ded8;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 850;
}

.screening-status-badge.is-filtering {
  color: #8a5708;
  background: #fff8e8;
  border-color: #edca82;
}

.screening-status-badge.is-rejected {
  color: #a13f3f;
  background: #fff3f3;
  border-color: #ecc8c8;
}

.competitor-classify-summary {
  padding: 0;
  background: transparent;
}

.competitor-classify-summary[hidden] {
  display: none;
}

.competitor-classify-panel {
  display: grid;
  grid-template-columns: minmax(156px, 0.24fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96));
  border: 1px solid #d6e4f2;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(18, 40, 68, 0.055);
}

.competitor-classify-panel.is-empty {
  grid-template-columns: minmax(156px, 0.24fr) minmax(0, 1fr);
}

.competitor-classify-empty-state {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 68px;
  padding: 10px 14px;
  color: #53657b;
  background: #f7fafd;
  border: 1px dashed #cddbea;
  border-radius: 8px;
}

.competitor-classify-empty-state strong {
  color: #243a54;
  font-size: 13px;
}

.competitor-classify-empty-state small {
  color: #77889b;
  font-size: 11px;
  font-weight: 700;
}

.competitor-classify-head {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 4px;
}

.competitor-classify-head span {
  color: #0f5ca8;
  font-size: 12px;
  font-weight: 950;
}

.competitor-classify-head strong {
  color: #0f1f35;
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
}

.competitor-classify-head small {
  color: #66768b;
  font-size: 11px;
  font-weight: 850;
}

.image-candidate-similarity-status {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
  min-width: 0;
  padding: 9px 10px;
  background: #f7fbff;
  border: 1px solid #d8e6f4;
  border-radius: 7px;
}

.image-candidate-similarity-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.image-candidate-similarity-copy span {
  min-width: 0;
  overflow: hidden;
  color: #173b5f;
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-candidate-similarity-copy small {
  min-width: 0;
  color: #5e7288;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.image-candidate-similarity-actions {
  display: flex;
  justify-content: flex-end;
  min-height: 26px;
}

.image-candidate-similarity-actions button {
  min-width: 64px;
  min-height: 26px;
  padding: 4px 12px;
  border: 1px solid #c8d7e6;
  border-radius: 4px;
  color: #24435f;
  background: #ffffff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.image-candidate-similarity-actions button:hover {
  border-color: #2f6fb7;
  color: #0f63d8;
}

.image-candidate-similarity-stop-button {
  border-color: #e4b7b7 !important;
  color: #a53c3c !important;
}

.image-candidate-similarity-stop-button:hover {
  border-color: #c85d5d !important;
  color: #8f2929 !important;
}

.image-candidate-similarity-start-button {
  color: #ffffff !important;
  background: #1f6fb2 !important;
  border-color: #1f6fb2 !important;
}

.image-candidate-similarity-start-button:hover {
  color: #ffffff !important;
  background: #185b93 !important;
  border-color: #185b93 !important;
}

.image-candidate-similarity-meter {
  overflow: hidden;
  height: 5px;
  background: #dfe9f3;
  border-radius: 999px;
}

.image-candidate-similarity-meter i {
  display: block;
  width: var(--image-candidate-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, #2f6fb7, #15a28f);
  border-radius: inherit;
  transition: width 240ms ease;
}

.image-candidate-similarity-status[data-state="running"] .image-candidate-similarity-meter i {
  background: linear-gradient(90deg, #6f8eb0, #2f6fb7 56%, #0f63d8);
}

.image-candidate-similarity-status[data-state="ready"] {
  background: #f2fbf7;
  border-color: #c5e4d4;
}

.image-candidate-similarity-status[data-state="ready"] .image-candidate-similarity-meter i {
  background: linear-gradient(90deg, #25b086, #0f9f8f);
}

.image-candidate-similarity-status[data-state="stopped"] {
  background: #fffaf2;
  border-color: #efd49c;
}

.image-candidate-similarity-status[data-state="stopped"] .image-candidate-similarity-meter i {
  background: #d69a2d;
}

.competitor-classify-head-actions {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 0;
}

.competitor-classify-head-actions > button {
  margin-top: 0;
}

.mid-image-similarity-batch-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 11px;
  color: #ffffff;
  background: #8a5b12;
  border: 1px solid #8a5b12;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.mid-image-similarity-batch-button:hover:not(:disabled) {
  background: #714708;
  border-color: #714708;
}

.mid-image-similarity-batch-button:disabled {
  color: #718096;
  background: #edf2f7;
  border-color: #d5dfeb;
  cursor: default;
}

.sales-backfill-combined-control {
  display: inline-flex;
  min-height: 30px;
  align-items: stretch;
  flex: 0 0 auto;
}

.sales-backfill-page-control {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0;
  color: #38516d;
  background: #f7fafc;
  border: 1px solid #d5e1ec;
  border-right: 0;
  border-radius: 6px 0 0 6px;
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  white-space: nowrap;
}

.sales-backfill-page-control select {
  min-width: 104px;
  height: 100%;
  padding: 3px 22px 3px 8px;
  color: #17365a;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  font: inherit;
}

.sales-backfill-page-control select:focus-visible {
  outline: 2px solid #0f6fbd;
  outline-offset: 1px;
}

html[data-theme="dark"] .sales-backfill-page-control {
  color: #b8c7d9;
  background: #202b39;
  border-color: #3c4d63;
}

html[data-theme="dark"] .sales-backfill-page-control select {
  color: #e6edf5;
  background: #17212d;
  border-color: #4a5b70;
}

.sales-backfill-all-button {
  width: max-content;
  min-height: 30px;
  padding: 5px 10px;
  color: #ffffff;
  background: #d87916;
  border: 1px solid #d87916;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.sales-backfill-combined-control .sales-backfill-all-button {
  margin: 0;
  border-radius: 0 6px 6px 0;
  white-space: nowrap;
}

.sales-backfill-all-button:hover:not(:disabled) {
  background: #b9650d;
  border-color: #b9650d;
}

.sales-backfill-all-button:disabled {
  color: #718096;
  background: #edf2f7;
  border-color: #d5dfeb;
  cursor: default;
}

.competitor-classify-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.competitor-classify-tab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-content: center;
  min-height: 54px;
  padding: 8px 10px;
  color: #17365a;
  background: #ffffff;
  border: 1px solid #dce7f4;
  border-radius: 9px;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.competitor-classify-tab:hover {
  border-color: #adcdec;
  background: #f5faff;
  transform: translateY(-1px);
}

.competitor-classify-tab span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competitor-classify-tab strong {
  color: inherit;
  font-family: var(--font-number);
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
}

.competitor-classify-tab small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #748197;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competitor-classify-tab.is-active {
  color: #ffffff;
  background: #17365a;
  border-color: #17365a;
  box-shadow: 0 10px 18px rgba(23, 54, 90, 0.18);
}

.competitor-classify-tab.is-active small {
  color: rgba(255, 255, 255, 0.72);
}

.competitor-classify-tab.is-pending:not(.is-active) {
  border-color: #f4c77a;
  background: #fffbf2;
}

.competitor-classify-tab.is-midplatform:not(.is-active) {
  color: #0b6f67;
  background: #f3fbf9;
  border-color: #b9ded7;
}

.competitor-classify-tab.is-midplatform.is-active {
  color: #ffffff;
  background: #0b7d73;
  border-color: #0b7d73;
  box-shadow: 0 10px 18px rgba(11, 125, 115, 0.2);
}

.competitor-classify-tab:disabled {
  color: #8996a8;
  background: #f4f7fa;
  border-color: #dce4ec;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.competitor-classify-progress {
  overflow: hidden;
  grid-column: 1 / -1;
  height: 5px;
  background: #dfe8f3;
  border-radius: 999px;
}

.competitor-classify-progress i {
  display: block;
  width: var(--competitor-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, #1677ff, #15a28f, #f59e0b);
  border-radius: inherit;
  transition: width 0.24s ease;
}

.midplatform-can-do-summary {
  padding: 0;
  background: transparent;
}

.midplatform-can-do-summary[hidden] {
  display: none;
}

.midplatform-can-do-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(126px, 0.2fr) minmax(240px, 1fr) minmax(220px, 0.74fr);
  gap: 14px;
  align-items: center;
  min-height: 62px;
  padding: 11px 172px 11px 14px;
  background:
    linear-gradient(90deg, rgba(15, 159, 143, 0.08), rgba(22, 119, 255, 0.04)),
    #f9fcff;
  border: 1px solid #d5e5f0;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  box-shadow:
    0 8px 18px rgba(18, 40, 68, 0.05),
    inset 3px 0 0 #0f9f8f;
}

.midplatform-can-do-panel.is-empty {
  background:
    linear-gradient(90deg, rgba(100, 116, 139, 0.08), rgba(22, 119, 255, 0.03)),
    #f9fcff;
  box-shadow:
    0 8px 18px rgba(18, 40, 68, 0.045),
    inset 3px 0 0 #94a3b8;
}

.midplatform-can-do-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.midplatform-can-do-copy span {
  color: #0b6f67;
  font-size: 11px;
  font-weight: 900;
}

.midplatform-can-do-copy strong {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #071a33;
  font-family: var(--font-number);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.05;
}

.midplatform-can-do-copy strong small {
  color: #607086;
  font-size: 11px;
  font-weight: 850;
}

.midplatform-can-do-note {
  min-width: 0;
}

.midplatform-can-do-note p {
  margin: 0;
  color: #536174;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.midplatform-can-do-progress {
  overflow: hidden;
  height: 6px;
  margin-top: 7px;
  background: #dce8f4;
  border-radius: 999px;
}

.midplatform-can-do-progress i {
  display: block;
  width: var(--match-rate, 0%);
  height: 100%;
  background: linear-gradient(90deg, #0f9f8f, #1677ff);
  border-radius: inherit;
}

.midplatform-can-do-panel.is-empty .midplatform-can-do-progress i {
  background: #94a3b8;
}

.midplatform-can-do-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.midplatform-can-do-list span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  color: #0b6f67;
  background: #ffffff;
  border: 1px solid #c8e3dc;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.midplatform-can-do-list span b {
  color: #17365a;
  font-family: var(--font-number);
  font-size: 10px;
}

.midplatform-can-do-list.empty {
  justify-content: flex-end;
}

.midplatform-can-do-list.empty span {
  color: #526579;
  border-color: #d8e4f1;
}

.midplatform-can-do-actions {
  display: flex;
  position: absolute;
  right: 14px;
  top: 50%;
  bottom: auto;
  z-index: 2;
  align-items: center;
  justify-content: flex-end;
  transform: translateY(-50%);
}

.midplatform-group-toggle {
  position: relative;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  color: #0f4e91;
  background:
    linear-gradient(180deg, #ffffff, #eef7ff);
  border: 1px solid #b9daf8;
  border-radius: 999px;
  box-shadow:
    0 8px 18px rgba(22, 119, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.midplatform-group-toggle span {
  position: relative;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 5px;
}

.midplatform-group-toggle span::before,
.midplatform-group-toggle span::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 999px;
}

.midplatform-group-toggle span::before {
  top: 3px;
  left: 3px;
  width: 6px;
  height: 2px;
}

.midplatform-group-toggle span::after {
  right: 3px;
  bottom: 3px;
  width: 6px;
  height: 2px;
}

.midplatform-group-toggle:hover {
  color: #ffffff;
  background:
    linear-gradient(180deg, #1677ff, #0f62d7);
  border-color: #1677ff;
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.22);
}

.midplatform-group-toggle.is-active {
  color: #ffffff;
  background:
    linear-gradient(180deg, #0f9f8f, #0b7d73);
  border-color: #0f9f8f;
  box-shadow: 0 10px 22px rgba(15, 159, 143, 0.22);
}

.midplatform-group-toggle:disabled {
  color: #94a3b8;
  background: #f4f7fb;
  border-color: #d8e4f1;
  box-shadow: none;
  cursor: not-allowed;
}

.midplatform-can-do-pill {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  color: #ffffff;
  background: #0f9f8f;
  border: 1px solid #0f9f8f;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

@media (max-width: 980px) {
  .filter-status-panel,
  .competitor-classify-panel {
    grid-template-columns: 1fr;
  }

  .competitor-classify-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .competitor-classify-head-actions {
    flex-wrap: wrap;
  }

  .midplatform-can-do-panel {
    grid-template-columns: minmax(116px, 0.28fr) minmax(0, 1fr);
    padding-right: 14px;
  }

  .midplatform-can-do-list {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .midplatform-can-do-actions {
    position: static;
    grid-column: 1 / -1;
    justify-content: flex-start;
    transform: none;
  }
}

@media (max-width: 640px) {
  .product-classification-summary {
    padding: 10px 12px 14px;
  }

  .competitor-classify-summary {
    padding: 0;
  }

  .compare-view-switch {
    width: 100%;
    flex-wrap: wrap;
  }

  .compare-view-switch .same-products-view-switch {
    max-width: 100%;
  }

  .compare-view-sort-control {
    flex: 1 1 120px;
  }

  .compare-view-sort-control select {
    width: 100%;
  }

  .filter-status-tabs {
    grid-template-columns: 1fr;
  }

  .sales-enrichment-progress-line {
    flex-wrap: wrap;
  }

  .sales-enrichment-progress-line em {
    width: 100%;
    margin-left: 20px;
  }

  .competitor-classify-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-candidate-similarity-copy {
    display: grid;
    gap: 3px;
  }

  .image-candidate-similarity-copy small {
    text-align: left;
  }

  .midplatform-can-do-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .midplatform-can-do-list.empty,
  .midplatform-can-do-list {
    justify-content: flex-start;
  }
}

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

.product-stats div {
  padding: 9px 11px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.product-stats .listed-time {
  grid-column: 1 / -1;
}

.product-stats span {
  display: block;
  color: #7b8798;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.product-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-family: var(--font-number);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.price-block strong {
  color: #e26d00;
  font-size: 17px;
}

.growth.up {
  color: #17834f;
}

.growth.down {
  color: var(--red);
}

.actions {
  grid-column: auto;
  display: grid;
  width: 148px;
  gap: 8px;
  align-self: center;
}

.actions button,
.actions .link-button {
  display: inline-flex;
  width: 100%;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: none;
}

.actions button::before,
.actions .link-button::before {
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.add-cart-button {
  color: #fff;
  height: 42px;
  background: #f59f18;
  border-color: #f59f18;
  box-shadow: 0 9px 18px rgba(245, 159, 24, 0.22);
}

.add-cart-button::before {
  content: "+";
  color: #b86500;
  background: rgba(255, 255, 255, 0.86);
}

.add-cart-button:hover {
  background: #e88d08;
  border-color: #e88d08;
  box-shadow: 0 11px 22px rgba(245, 159, 24, 0.28);
}

.dashboard-button {
  color: #15395d;
  background: #f3f7fb;
  border-color: #cfddec;
}

.dashboard-button::before {
  content: "";
  background:
    linear-gradient(to top, currentColor 0 72%, transparent 72%) 3px 9px / 2px 6px no-repeat,
    linear-gradient(to top, currentColor 0 100%, transparent 100%) 7px 5px / 2px 10px no-repeat,
    linear-gradient(to top, currentColor 0 54%, transparent 54%) 11px 11px / 2px 4px no-repeat,
    #e8f0f8;
  border: 1px solid #c8d8e8;
}

.dashboard-button:hover {
  color: #0f2f4f;
  background: #e8f1fa;
  border-color: #a9c2db;
  box-shadow: 0 8px 16px rgba(21, 57, 93, 0.1);
}

.competitor-button {
  color: #17606b;
  background: #f6fbfb;
  border-color: #cfe7e8;
}

.competitor-button::before {
  content: "";
  background:
    radial-gradient(circle at 7px 7px, transparent 0 4px, currentColor 4px 5px, transparent 5px),
    linear-gradient(45deg, transparent 0 60%, currentColor 60% 72%, transparent 72%),
    #eaf7f8;
  border: 1px solid #c4e0e2;
}

.competitor-button:hover {
  color: #0f5963;
  background: #e9f8f9;
  border-color: #a9d7db;
  box-shadow: 0 8px 16px rgba(23, 96, 107, 0.1);
}

.dashboard-card {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dashboard-title {
  display: grid;
  gap: 4px;
}

.dashboard-title.with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-title h2 {
  color: var(--nav);
  font-size: 19px;
}

.dashboard-title p {
  color: var(--muted);
  font-size: 13px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.overview-grid article,
.overview-grid .overview-action-card {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 94px;
  padding: 15px 15px 14px 17px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(21, 35, 56, 0.055);
}

.overview-grid article::before,
.overview-grid .overview-action-card::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 4px;
  border-radius: 999px;
  background: var(--teal);
}

.overview-grid .overview-action-card {
  width: 100%;
  padding-right: 44px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(37, 99, 168, 0.1), transparent 66%),
    #fff;
  border-color: rgba(37, 99, 168, 0.28);
}

.overview-grid .overview-action-card::before {
  background: var(--blue);
}

.overview-grid .overview-action-card::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(-45deg);
  opacity: 0.72;
}

.overview-grid .overview-action-card:hover,
.overview-grid .overview-action-card:focus-visible {
  border-color: rgba(37, 99, 168, 0.52);
  background:
    linear-gradient(135deg, rgba(37, 99, 168, 0.15), transparent 64%),
    #fff;
  box-shadow: 0 14px 28px rgba(37, 99, 168, 0.13);
  transform: translateY(-1px);
}

.overview-grid .overview-action-card:focus-visible {
  outline: 3px solid rgba(37, 99, 168, 0.18);
  outline-offset: 3px;
}

.overview-grid span,
.market-snapshot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.overview-grid strong,
.market-snapshot strong {
  display: block;
  color: var(--nav);
  font-family: var(--font-number);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

.market-snapshot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.market-snapshot span {
  position: relative;
  display: grid;
  grid-template-columns: minmax(108px, 0.95fr) minmax(0, 1.35fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 13px 15px 13px 18px;
  color: #6b7280;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(21, 35, 56, 0.04);
}

.market-snapshot span::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 999px;
  background: var(--amber);
}

.market-snapshot span:nth-child(2)::before {
  background: var(--teal);
}

.market-snapshot span:nth-child(3)::before {
  background: var(--indigo);
}

.market-snapshot span strong {
  color: #17395f;
  font-size: clamp(19px, 1.7vw, 24px);
  text-align: right;
}

.market-snapshot small {
  display: inline-flex;
  justify-content: flex-end;
  margin-top: 0;
  color: #9a6a1f;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.price-watch-card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.price-watch-card::after {
  content: "";
  position: absolute;
  inset: auto 12px 10px 12px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(245, 166, 35, 0), rgba(245, 166, 35, 0.7), rgba(245, 166, 35, 0));
  opacity: 0;
  transform: translateX(-40%);
}

.price-watch-card.is-active {
  border-color: #f5a623;
  box-shadow: 0 10px 24px rgba(245, 166, 35, 0.18);
  transform: translateY(-1px);
}

.price-watch-card.is-active::after {
  opacity: 1;
  animation: price-watch-scan 1.8s ease-in-out infinite;
}

@keyframes price-watch-scan {
  0% {
    transform: translateX(-55%);
  }
  50% {
    transform: translateX(55%);
  }
  100% {
    transform: translateX(-55%);
  }
}

.rising-list,
.recommend-list,
.supplier-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rising-list li,
.recommend-list article,
.supplier-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.rising-list li > span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--nav);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.rising-list li button {
  display: grid;
  min-width: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: left;
}

.rising-list li button:hover {
  color: var(--nav);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.rising-list li strong {
  display: block;
  color: var(--nav);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rising-list .rising-title-cn {
  margin-top: 3px;
  color: #516174;
  font-size: 12px;
  font-weight: 800;
  -webkit-line-clamp: 1;
}

.rising-list li small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rising-list em {
  color: #17834f;
  font-style: normal;
  font-weight: 900;
}

.rising-list.empty li {
  display: block;
  color: var(--muted);
  background: #f8fafc;
  border-style: dashed;
  font-size: 12px;
  line-height: 1.55;
}

.recommend-list article,
.supplier-list article {
  grid-template-columns: minmax(0, 1fr) auto;
}

.recommend-list article {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
}

.recommend-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.recommend-main strong {
  color: var(--nav);
  font-size: 13px;
  line-height: 1.35;
}

.recommend-main .recommend-title-cn {
  margin-top: -2px;
  color: #516174;
  font-size: 12px;
  font-weight: 800;
  -webkit-line-clamp: 1;
}

.recommend-main small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.recommend-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recommend-tags span {
  padding: 4px 8px;
  color: #8a5200;
  background: #fff2d9;
  border: 1px solid #f4d396;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.recommend-list em {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #174a83;
  background: #eaf4ff;
  border: 1px solid #c5def5;
  border-radius: 999px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.recommend-open {
  color: #174a83;
  background: #f8fbff;
  border-color: #d8e9ff;
}

.recommend-open:hover {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
}

.recommend-list.empty p {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.55;
}

.supplier-list span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .selection-workflow {
    position: sticky;
    top: 106px;
    bottom: auto;
    left: auto;
    width: auto;
    overflow-y: visible;
    background: rgba(246, 250, 254, 0.96);
    border: 0;
    border-bottom: 1px solid #d8e3ef;
    border-radius: 0;
    box-shadow: 0 10px 22px rgba(18, 40, 68, 0.05);
  }

  .selection-workflow-inner {
    display: grid;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 10px 20px;
    align-items: stretch;
  }

  .selection-workflow-title {
    min-width: 0;
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid #d9e5f0;
  }

  .selection-workflow-steps {
    grid-template-columns: repeat(6, minmax(118px, 1fr));
  }

  .selection-workflow-step:not(:last-child)::after {
    top: 50%;
    right: -8px;
    bottom: auto;
    left: auto;
    width: 8px;
    height: 1px;
  }

  .workflow-copy strong {
    white-space: nowrap;
  }

  .market-layout {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 1120px);
    margin: 0 auto;
    padding-top: 18px;
  }

  .secondary-workspace {
    width: min(100% - 28px, 1120px);
    margin: 0 auto 38px;
  }

  .reverse-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .range-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watchlist-page-panel .watch-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watchlist-page-panel .watch-item {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .watch-thumb,
  .watch-media {
    height: 132px;
  }

  .watch-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watch-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watch-filter-status {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .product-dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .competitor-metric-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .competitor-product-groups {
    grid-template-columns: 1fr;
  }

  .dashboard-column {
    position: static;
    max-height: none;
  }

  .product {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .product-stats,
  .actions {
    grid-column: 1 / -1;
  }

  .actions {
    width: 100%;
    grid-template-columns: minmax(160px, 1.1fr) repeat(2, minmax(136px, 0.85fr));
  }
}

@media (max-width: 980px) {
  .watchlist-page-panel .watch-list {
    grid-template-columns: 1fr;
  }

  .watchlist-page-panel .watch-item {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .watch-thumb,
  .watch-media {
    height: 132px;
  }

  .watch-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .primary-nav-inner,
  .selection-workflow-inner,
  .market-layout {
    padding-right: 16px;
    padding-left: 16px;
  }

  .primary-nav {
    top: 72px;
    overflow-x: auto;
  }

  .primary-nav-inner {
    width: max-content;
  }

  .selection-workflow {
    top: 106px;
    overflow-x: auto;
  }

  .selection-workflow-inner {
    width: max-content;
    min-width: 100%;
  }

  .selection-workflow-title {
    display: none;
  }

  .selection-workflow-steps {
    display: flex;
    width: max-content;
    min-width: 100%;
  }

  .selection-workflow-step {
    flex: 0 0 166px;
  }

  .compact-filter-grid,
  .range-filter-row,
  .reverse-form,
  .overview-grid,
  .market-snapshot,
  .product-dashboard-metrics,
  .competitor-metric-cards,
  .product-stats,
  .watch-stats {
    grid-template-columns: 1fr;
  }

  .competitor-group-product {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .competitor-group-product button {
    grid-column: 1 / -1;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .watchlist-page-panel .watch-item {
    grid-template-columns: 1fr;
  }

  .watch-thumb,
  .watch-media {
    width: 100%;
    height: 180px;
  }

  .watch-classify-bar {
    grid-template-columns: 1fr;
  }

  .watch-classify-field,
  .watch-classify-summary,
  .watch-filter-bar label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .watch-latest-button {
    justify-self: start;
  }

  .watch-filter-bar {
    grid-template-columns: 1fr;
  }

  .watch-title-row {
    display: grid;
  }

  .watch-actions {
    min-width: 0;
    justify-self: start;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: max-content;
    max-width: 100%;
  }

  .watch-filter-bar {
    grid-template-columns: 1fr;
  }

  .watch-filter-status {
    align-items: stretch;
    flex-direction: column;
  }

  .watch-filter-status strong {
    white-space: normal;
  }

  .product-dashboard-hero {
    grid-template-columns: 1fr;
  }

  .product-dashboard-hero img {
    width: 100%;
    max-height: 220px;
  }

  .search-panel .searchbar {
    padding: 16px;
  }

  .search-copy h2 {
    font-size: 20px;
  }

  .search-panel .search-control {
    grid-template-columns: 1fr;
  }

  .product-image-search {
    grid-template-columns: 1fr;
  }

  .search-panel .filter-toolbar small {
    text-align: left;
  }

  .secondary-workspace {
    width: calc(100% - 32px);
    margin: 0 auto 38px;
  }

  .nav-dropdown,
  .nav-dropdown.wide {
    position: fixed;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

/* 商品货架列表：一行五张商品图，指标进入数据看板展示。 */
.product-list-panel {
  border-color: #dfe6ef;
  box-shadow: 0 18px 44px rgba(18, 31, 52, 0.08);
}

body.no-product-results .product-list-panel,
body.no-product-results .sku-panel,
body.no-product-results .dashboard-column {
  display: none;
}

body.no-product-results.batch-keyword-search-active .product-list-panel {
  display: block;
}

.global-analysis-summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  color: var(--ink-soft);
  background: #fbfcfe;
  border: 1px solid #e2e9f2;
  border-radius: 12px;
}

.global-analysis-summary strong {
  color: var(--nav);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.35;
}

.global-analysis-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.global-analysis-summary .global-summary-title-cn {
  margin-top: -4px;
  color: #516174;
  font-size: 12px;
  font-weight: 800;
  -webkit-line-clamp: 1;
}

.global-analysis-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.global-analysis-mini article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e6edf6;
  border-radius: 12px;
}

.global-analysis-mini span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.global-analysis-mini strong {
  color: var(--nav);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.global-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.global-analysis-grid article {
  display: grid;
  min-height: 0;
  gap: 12px;
  align-content: start;
  padding: 16px;
  background: #fbfcfe;
  border: 1px solid #e2e9f2;
  border-radius: 14px;
}

.global-analysis-grid article > span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 950;
}

.analysis-list {
  display: grid;
  gap: 10px;
}

.analysis-list.empty {
  color: var(--quiet);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.analysis-list p,
.analysis-product-row {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 0;
  padding: 12px 14px;
  color: var(--ink-soft);
  background: #ffffff;
  border: 1px solid #e6edf6;
  border-radius: 10px;
  text-align: left;
}

.analysis-product-row {
  cursor: pointer;
}

.analysis-product-row:hover {
  background: #f2f8ff;
  border-color: rgba(37, 99, 168, 0.24);
  transform: translateY(-1px);
}

.analysis-list p strong,
.analysis-product-row strong {
  color: var(--nav);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.45;
}

.analysis-product-row .analysis-row-title-cn {
  color: #516174;
  font-size: 12px;
  font-weight: 800;
  -webkit-line-clamp: 1;
}

.analysis-list p small,
.analysis-product-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.analysis-product-row em {
  justify-self: start;
  padding: 3px 8px;
  color: #0b766b;
  background: #e9fbf6;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}

.global-analysis-ai {
  display: grid;
  gap: 9px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #e2e9f2;
  border-radius: 14px;
}

.global-analysis-ai strong {
  color: var(--nav);
  font-size: 14px;
  font-weight: 950;
}

.global-analysis-ai p {
  max-height: 170px;
  overflow: auto;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.7;
  white-space: pre-wrap;
}

.global-analysis-modal[hidden] {
  display: none;
}

.global-analysis-modal {
  position: fixed;
  z-index: 82;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.global-analysis-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.global-analysis-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1180px, calc(100vw - 48px));
  max-height: min(92vh, 860px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dce6f0;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(18, 31, 52, 0.3);
}

.global-analysis-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  background: linear-gradient(180deg, #fbfdff, #f6f9fd);
  border-bottom: 1px solid #e5edf6;
}

.global-analysis-modal-head h2 {
  margin: 4px 0 4px;
  color: var(--nav);
  font-size: 24px;
}

.global-analysis-modal-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.global-analysis-modal-body {
  display: grid;
  gap: 18px;
  align-content: start;
  min-height: 0;
  padding: 24px;
  overflow: auto;
  background: #f8fafc;
}

.global-analysis-modal-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.global-analysis-toolbox {
  display: flex;
  justify-content: flex-end;
  padding: 0;
  background: #ffffff;
  border: 0;
  border-radius: 0;
}

.global-analysis-regenerate {
  min-height: 44px;
  padding: 0 22px;
  color: #ffffff;
  background: #1677ff;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 950;
}

.global-analysis-modal-overview .global-analysis-mini {
  grid-column: 1 / -1;
}

.global-analysis-regenerate:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.analysis-card-top {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.analysis-card-risk {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff1f2, #ffffff);
}

.analysis-card-opportunity {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4, #ffffff);
}

.analysis-card-steps {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb, #ffffff);
}

.analysis-card-risk .analysis-product-row em {
  color: #b42318;
  background: #fee4e2;
}

.analysis-card-opportunity .analysis-product-row em,
.analysis-card-top .analysis-product-row em {
  color: #067647;
  background: #dcfae6;
}

@media (max-width: 1180px) {
  .global-analysis-modal-overview {
    grid-template-columns: 1fr;
  }

  .global-analysis-toolbox {
    justify-content: stretch;
  }

  .global-analysis-regenerate {
    width: 100%;
  }

  .global-analysis-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .global-analysis-mini {
    grid-template-columns: repeat(3, minmax(64px, 1fr));
    overflow-x: auto;
  }

  .global-analysis-grid {
    grid-template-columns: 1fr;
  }

  .global-analysis-modal {
    padding: 0;
  }

  .global-analysis-modal-panel {
    width: 100vw;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .global-analysis-modal-body {
    padding: 12px;
  }

  .global-analysis-toolbox {
    justify-content: stretch;
  }

  .global-analysis-regenerate {
    width: 100%;
  }
}

.product-list-panel .product-list:not(.empty) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  padding: 18px;
  overflow-x: visible;
}

.decision-product {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
  gap: 10px;
  align-items: start;
  padding: 0;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.decision-product::before {
  display: none;
}

.decision-product:hover {
  background: #fff;
  box-shadow: none;
  transform: translateY(-2px);
}

.compare-check {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 8px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  cursor: pointer;
}

.compare-check input {
  position: absolute;
  opacity: 0;
}

.compare-check span {
  display: block;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 1px solid #cfd8e6;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px #fff;
}

.compare-check input:checked + span {
  background: #1677ff;
  border-color: #1677ff;
}

.compare-check input:checked + span::after {
  content: "";
  display: block;
  width: 8px;
  height: 4px;
  margin: 5px auto 0;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(-45deg);
}

.thumb-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 180px;
  padding: 0;
  background: #f4f6f8;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
}

.thumb-frame .thumb {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  pointer-events: none;
  transition: transform 0.25s ease;
}

[data-image-preview] {
  cursor: zoom-in;
}

[data-image-preview]:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.58);
  outline-offset: 3px;
}

img[data-product-image] {
  pointer-events: none;
}

.product-dashboard-hero img[data-image-preview] {
  pointer-events: auto;
}

.thumb-frame.is-missing-image {
  background: #f8fafc;
  border-style: dashed;
}

.thumb-frame.is-missing-image .thumb {
  object-fit: contain;
  opacity: 0.9;
}

.image-missing-note {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 7px;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  pointer-events: none;
}

.image-backfill-button {
  cursor: pointer;
  pointer-events: auto;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.image-backfill-button:hover {
  color: #0f5fb8;
  background: #eef6ff;
  border-color: #a9d1ff;
  transform: translateY(-1px);
}

.image-backfill-button:disabled {
  cursor: wait;
  color: #8a5a00;
  background: #fff8e6;
  border-color: #f0d598;
  transform: none;
}

.thumb-frame.is-image-backfilling .thumb {
  opacity: 0.55;
}

.decision-product:hover .thumb {
  transform: scale(1.04);
}

.decision-product .product-copy {
  min-width: 0;
}

.decision-product h3 {
  max-width: 100%;
  margin: 0;
  overflow: visible;
  color: #0f2747;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
  text-overflow: clip;
  white-space: normal;
}

.decision-product .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
  overflow: visible;
  color: #7b8798;
  font-size: 11px;
  line-height: 1.4;
}

.decision-product .meta > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-product .pill,
.decision-product .seller-type,
.decision-product .rocket-type {
  min-height: 20px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}

.decision-metrics {
  display: none;
}

.decision-metrics div,
.decision-metrics .delivery-metric {
  min-width: 0;
  padding: 10px 11px;
  background: #f8fafc;
  border: 0;
  border-radius: 0;
}

.decision-metrics span {
  color: #86909c;
  font-size: 11px;
  font-weight: 800;
}

.decision-metrics strong {
  margin-top: 4px;
  color: #1f2329;
  font-family: var(--font-number);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.decision-metrics .metric-primary strong {
  font-size: 16px;
}

.decision-metrics .sales-metric strong {
  color: #0f5fd7;
}

.decision-metrics .price-block strong {
  color: #f26a00;
}

.decision-metrics .delivery-metric {
  grid-column: auto;
}

.decision-metrics .delivery-metric strong {
  display: inline-block;
  min-width: 52px;
  margin-left: 10px;
  text-align: center;
}

.decision-product .actions {
  display: grid;
  width: 100%;
  gap: 8px;
}

.decision-product .add-cart-button {
  height: 34px;
  border-radius: 999px;
  font-size: 12px;
}

.compact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.decision-product .compact-actions .link-button {
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
}

.product-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 10px 4px;
  color: #1f2329;
  font-size: 13px;
}

.pagination-arrow,
.pagination-page {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #4e5969;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 850;
}

.pagination-arrow {
  color: #8a94a5;
  font-size: 20px;
}

.pagination-arrow:hover:not(:disabled),
.pagination-page:hover {
  color: #1677ff;
  background: #f8fbff;
  border-color: #bad9ff;
  transform: none;
}

.pagination-page.active {
  color: #1677ff;
  background: #fff;
  border-color: #1677ff;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.13);
}

.pagination-arrow:disabled {
  color: #c2c9d3;
  cursor: not-allowed;
}

.pagination-ellipsis {
  display: inline-grid;
  height: 30px;
  min-width: 28px;
  place-items: center;
  color: #8a94a5;
  font-weight: 900;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  color: #1f2329;
  font-size: 13px;
  font-weight: 850;
}

.pagination-jump input {
  width: 56px;
  height: 30px;
  padding: 0 8px;
  color: #1f2329;
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  font-family: var(--font-number);
  font-weight: 850;
  text-align: center;
}

.pagination-jump input:focus {
  border-color: #1677ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.dialog-open {
  overflow: hidden;
}

.compare-dialog[hidden] {
  display: none;
}

.compare-dialog {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

.compare-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 31, 0.42);
  backdrop-filter: blur(4px);
}

.compare-dialog-panel {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(10, 22, 40, 0.28);
}

.compare-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #fbfdff, #f6f9fd);
  border-bottom: 1px solid #e5eaf3;
}

.compare-dialog-head h2 {
  margin: 0;
  color: #1f2329;
  font-size: 18px;
}

.compare-close-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #6b7586;
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  box-shadow: none;
}

.compare-close-button:hover {
  color: #1f2329;
  background: #f5f7fa;
  transform: none;
}

.product-review-query-panel {
  width: min(720px, 100%);
  overflow: auto;
}

.product-review-query-form {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5eaf3;
}

.product-review-query-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.product-review-query-inputs label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: #556274;
  font-size: 12px;
  font-weight: 800;
}

.product-review-query-inputs input,
.product-review-query-inputs select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 7px 10px;
  color: #1f2937;
  background: #fff;
  border: 1px solid #cfd9e6;
  border-radius: 6px;
  outline: none;
}

.product-review-query-inputs input:focus,
.product-review-query-inputs select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.product-review-query-form.is-push-mode .product-review-query-inputs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-review-query-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-review-query-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 20px 0;
  padding: 10px 12px;
  color: #546173;
  background: #f6f8fb;
  border: 1px solid #dfe6ef;
  border-radius: 6px;
  font-size: 12px;
}

.product-review-query-status strong {
  color: #253246;
}

.product-review-query-status.processing,
.product-review-query-status.dispatching,
.product-review-query-status.queued {
  background: #fff9e8;
  border-color: #ead48d;
}

.product-review-query-status.completed {
  background: #eef9f5;
  border-color: #a8daca;
}

.product-review-query-status.failed {
  background: #fff2f1;
  border-color: #e9b2ae;
}

.product-review-query-result {
  margin: 12px 20px 20px;
}

.product-review-query-result.empty {
  display: grid;
  min-height: 88px;
  place-items: center;
  color: #718096;
  background: #fafbfd;
  border: 1px dashed #d7e0eb;
  border-radius: 6px;
  text-align: center;
}

.product-review-query-result > p {
  margin: 10px 0 0;
  color: #718096;
  font-size: 12px;
}

.product-review-result-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #dfe6ef;
  border-radius: 6px;
  overflow: hidden;
}

.product-review-result-metrics article {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 5px;
  padding: 14px 12px;
  background: #fbfcfe;
  border-right: 1px solid #dfe6ef;
}

.product-review-result-metrics article:last-child {
  border-right: 0;
}

.product-review-result-metrics span {
  color: #718096;
  font-size: 11px;
  font-weight: 750;
}

.product-review-result-metrics strong {
  overflow-wrap: anywhere;
  color: #1e2d42;
  font-family: var(--font-number);
  font-size: 14px;
}

html[data-theme="dark"] .product-review-query-panel,
html[data-theme="dark"] .product-review-query-inputs input,
html[data-theme="dark"] .product-review-query-inputs select {
  color: #e5edf7;
  background: #131c27;
  border-color: #344357;
}

html[data-theme="dark"] .product-review-query-form {
  border-color: #344357;
}

html[data-theme="dark"] .product-review-query-inputs label,
html[data-theme="dark"] .product-review-query-result > p {
  color: #9eacbd;
}

html[data-theme="dark"] .product-review-query-status,
html[data-theme="dark"] .product-review-query-result.empty,
html[data-theme="dark"] .product-review-result-metrics,
html[data-theme="dark"] .product-review-result-metrics article {
  color: #aebaca;
  background: #17212d;
  border-color: #344357;
}

html[data-theme="dark"] .product-review-query-status strong,
html[data-theme="dark"] .product-review-result-metrics strong {
  color: #edf3fa;
}

@media (max-width: 680px) {
  .product-review-query-inputs,
  .product-review-query-form.is-push-mode .product-review-query-inputs,
  .product-review-result-metrics {
    grid-template-columns: 1fr;
  }

  .product-review-result-metrics article {
    border-right: 0;
    border-bottom: 1px solid #dfe6ef;
  }

  .product-review-result-metrics article:last-child {
    border-bottom: 0;
  }

  .product-review-query-status {
    align-items: flex-start;
    flex-direction: column;
  }
}

.mid-image-similarity-panel {
  width: min(1040px, 100%);
}

.mid-image-similarity-body {
  max-height: min(680px, calc(100vh - 152px));
}

.mid-image-similarity-source {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 0 0 16px;
  border-bottom: 1px solid #e3e9f1;
}

.mid-image-similarity-source > div:last-child {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.mid-image-similarity-source span,
.mid-image-similarity-source small {
  color: #718096;
  font-size: 11px;
  font-weight: 800;
}

.mid-image-similarity-source strong {
  overflow: hidden;
  color: #1d2d42;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mid-image-similarity-image {
  display: grid;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  color: #8693a5;
  background: #f2f5f8;
  border: 1px solid #dfe6ef;
  border-radius: 6px;
  font-size: 11px;
}

.mid-image-similarity-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mid-image-similarity-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.mid-image-similarity-result-head strong {
  color: #1f2e43;
  font-size: 14px;
}

.mid-image-similarity-result-head span {
  color: #66768b;
  font-size: 12px;
  font-weight: 800;
}

.mid-image-similarity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mid-image-similarity-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #dfe6ef;
  border-radius: 6px;
}

.mid-image-similarity-item-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.mid-image-similarity-item-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: #718096;
  font-size: 10px;
  font-weight: 850;
}

.mid-image-similarity-item-head strong {
  color: #8a5b12;
  font-family: var(--font-number);
}

.mid-image-similarity-item h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #1f2e43;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mid-image-similarity-item dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.mid-image-similarity-item dl > div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
}

.mid-image-similarity-item dt,
.mid-image-similarity-item dd {
  overflow: hidden;
  margin: 0;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mid-image-similarity-item dt {
  color: #7a8798;
}

.mid-image-similarity-item dd {
  color: #33445a;
  font-weight: 750;
}

.mid-image-similarity-status {
  display: grid;
  min-height: 132px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #68778b;
  text-align: center;
}

.mid-image-similarity-status strong {
  color: #27384f;
  font-size: 14px;
}

.mid-image-similarity-status.is-running strong {
  color: #8a5b12;
}

.mid-image-similarity-status.is-failed strong {
  color: #a43b35;
}

.mid-image-similarity-status button {
  min-height: 32px;
  padding: 5px 12px;
  color: #ffffff;
  background: #8a5b12;
  border: 1px solid #8a5b12;
  border-radius: 5px;
  font-weight: 850;
}

html[data-theme="dark"] .mid-image-similarity-source {
  border-color: #344357;
}

html[data-theme="dark"] .mid-image-similarity-source strong,
html[data-theme="dark"] .mid-image-similarity-result-head strong,
html[data-theme="dark"] .mid-image-similarity-item h3,
html[data-theme="dark"] .mid-image-similarity-status strong {
  color: #edf3fa;
}

html[data-theme="dark"] .mid-image-similarity-item,
html[data-theme="dark"] .mid-image-similarity-image {
  background: #17212d;
  border-color: #344357;
}

html[data-theme="dark"] .mid-image-similarity-item dd {
  color: #c5d0dd;
}

@media (max-width: 860px) {
  .mid-image-similarity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .mid-image-similarity-grid {
    grid-template-columns: 1fr;
  }

  .mid-image-similarity-item {
    grid-template-columns: 92px minmax(0, 1fr);
  }
}

.compare-dialog-body {
  overflow: auto;
  padding: 18px 20px 20px;
}

.compare-table-wrap {
  overflow: auto;
  border: 1px solid #e5eaf3;
  border-radius: 14px;
}

.search-history-panel {
  width: min(860px, 100%);
}

.search-history-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: #f7f9fc;
  border-bottom: 1px solid #e5eaf3;
}

.search-history-toolbar input {
  width: min(340px, 100%);
  height: 38px;
  padding: 0 12px;
  color: #1f2329;
  background: #ffffff;
  border: 1px solid #cfd7e4;
  border-radius: 7px;
  outline: none;
}

.search-history-toolbar input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.search-history-toolbar input:disabled {
  color: #8a94a4;
  background: #eef2f7;
}

.search-history-count {
  margin-left: auto;
  color: #596579;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.search-history-body {
  max-height: min(620px, calc(100vh - 168px));
}

.search-history-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: #6b7586;
  text-align: center;
}

.search-history-list {
  display: grid;
  gap: 10px;
}

.search-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px 236px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #fbfdff;
  border: 1px solid #e5eaf3;
  border-radius: 14px;
}

.pid-search-history-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 11px 13px;
  text-align: left;
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e5eaf3);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.pid-search-history-item:hover {
  border-color: var(--teal, #0B766B);
}
.pid-search-history-item.is-active {
  border-color: var(--teal, #0B766B);
  box-shadow: 0 0 0 2px rgba(11, 118, 107, .14);
}
.pid-search-history-item strong {
  color: var(--ink, #1f2329);
  font-size: 15px;
  font-weight: 700;
}
.pid-search-history-item > span {
  color: var(--muted, #6b7280);
  font-size: 12px;
}
.pid-history-keywords {
  display: block;
  margin-top: 2px;
  color: var(--teal, #0B766B);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-history-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.search-history-type {
  width: fit-content;
  padding: 3px 8px;
  color: #1d5f8f;
  background: #e8f1fb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.search-history-main strong {
  overflow: hidden;
  color: #1f2329;
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-history-main p {
  overflow: hidden;
  margin: 0;
  color: #6b7586;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-history-meta {
  display: grid;
  gap: 4px;
  color: #6b7586;
  font-size: 12px;
}

.search-history-meta span:last-child {
  color: #1f2329;
  font-weight: 900;
}

.search-history-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.search-history-actions .text-button {
  height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.search-history-delete {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #9f1239;
  background: #fff5f6;
  border: 1px solid #ffd4dc;
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.search-history-delete svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.search-history-delete:hover {
  color: #ffffff;
  background: #e11d48;
  border-color: #e11d48;
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.18);
}

.compare-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

.compare-table th,
.compare-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: middle;
}

.compare-table th {
  color: #4e5969;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.compare-table td {
  color: #1f2329;
  font-family: var(--font-number);
  font-size: 14px;
  font-weight: 850;
}

.compare-product-head {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 150px;
}

.compare-product-head img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 10px;
}

.compare-product-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.compare-product-copy > span {
  overflow: hidden;
  color: #1f2329;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-product-copy .compare-title-cn {
  color: #657287;
  font-size: 11px;
  font-weight: 800;
  -webkit-line-clamp: 1;
}

@media (max-width: 1180px) {
  .result-head {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions-bar {
    justify-content: space-between;
  }

  .decision-product {
    grid-template-columns: 28px max-content minmax(0, 1fr);
  }

  .decision-product .product-stats,
  .decision-product .actions {
    grid-column: 1 / -1;
  }

  .decision-product .actions {
    width: 100%;
    grid-template-columns: minmax(180px, 1fr) 180px;
  }
}

@media (max-width: 760px) {
  .result-actions-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .result-sort-control,
  .continue-collect-button,
  .bulk-review-query-button,
  .compare-products-button {
    width: 100%;
  }

  .result-sort-control select {
    flex: 1;
    min-width: 0;
  }

  #resultSortField,
  #resultSortDirection {
    min-width: 0;
  }

  .decision-product {
    grid-template-columns: 28px max-content minmax(0, 1fr);
    min-height: auto;
    padding: 12px;
  }

  .decision-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .decision-product .actions {
    grid-template-columns: 1fr;
  }

  .competitor-head-actions,
  .competitor-head-actions .text-button {
    width: 100%;
  }

  .product-pagination {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .pagination-jump {
    width: 100%;
    margin-left: 0;
  }

  .compare-dialog {
    padding: 14px;
  }

  .search-history-item {
    grid-template-columns: 1fr;
  }

  .search-history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pid-workspace-nav-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .pid-workspace-nav-head > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .pid-workspace-nav-head span:not(.pid-workspace-count) {
    white-space: normal;
  }

  .pid-workspace-list {
    margin-right: -2px;
  }

  .pid-workspace-tab {
    min-width: 142px;
  }

  .search-history-toolbar input {
    width: 100%;
  }

  .search-history-count {
    margin-left: 0;
  }

  .search-history-actions {
    justify-content: stretch;
  }

  .search-history-actions .text-button {
    flex: 1;
  }
}

/* 商品数据看板重构：从数据堆叠转为选品决策分析报告。 */
.product-dashboard-summary {
  gap: 16px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.07), transparent 38%),
    linear-gradient(180deg, #f7f9fc, #f2f5f9);
  border-top: 1px solid #e5eaf3;
  border-bottom: 1px solid #e5eaf3;
}

.analysis-dashboard {
  display: grid;
  gap: 16px;
}

.analysis-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 16px;
  align-items: stretch;
  overflow: hidden;
  padding: 18px;
  background:
    radial-gradient(circle at 12% 10%, rgba(22, 119, 255, 0.13), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eef6ff 100%);
  border: 1px solid #dfe8f5;
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(21, 35, 56, 0.1);
}

.analysis-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(22, 119, 255, 0.08), transparent 46%);
}

.analysis-hero.strong {
  border-color: rgba(22, 119, 255, 0.28);
}

.analysis-hero.watch {
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 166, 35, 0.16), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #fffaf2 58%, #fff4df 100%);
  border-color: rgba(245, 166, 35, 0.28);
}

.analysis-hero.risk {
  background:
    radial-gradient(circle at 12% 10%, rgba(195, 68, 83, 0.12), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #fff7f8 58%, #fff0f2 100%);
  border-color: rgba(195, 68, 83, 0.24);
}

.analysis-product-brief,
.analysis-score-card {
  position: relative;
  z-index: 1;
}

.analysis-product-brief {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.analysis-cover {
  position: relative;
  overflow: hidden;
  width: 116px;
  height: 116px;
  background: #eef4fb;
  border: 1px solid #dfe8f5;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(18, 31, 52, 0.09);
}

.analysis-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.analysis-cover:hover img {
  transform: scale(1.06);
}

.analysis-cover span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  color: #174a83;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(197, 222, 245, 0.9);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.analysis-title-block h3 {
  max-width: 760px;
  color: #1f2329;
  font-size: 20px;
  line-height: 1.35;
}

.analysis-title-block h3 a {
  color: inherit;
  text-decoration: none;
}

.analysis-title-block h3 a:hover {
  color: #1677ff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.analysis-score-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(216, 228, 243, 0.9);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(21, 35, 56, 0.08);
  backdrop-filter: blur(10px);
}

.score-ring {
  position: relative;
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle, #fff 0 58%, transparent 59%),
    conic-gradient(#1677ff var(--score), #e8eef6 0);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #dbe6f3;
}

.score-ring strong,
.score-ring span {
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
}

.score-ring strong {
  margin-top: -10px;
  color: #1f2329;
  font-family: var(--font-number);
  font-size: 28px;
  font-weight: 900;
}

.score-ring span {
  align-self: end;
  margin-bottom: 22px;
  color: #86909c;
  font-size: 11px;
  font-weight: 900;
}

.analysis-score-card h4 {
  margin: 8px 0 6px;
  color: #1f2329;
  font-size: 18px;
}

.analysis-score-card p {
  color: #4e5969;
  font-size: 13px;
  line-height: 1.6;
}

.analysis-opportunity {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.analysis-opportunity.blue-ocean {
  color: #0b63ce;
  background: #eaf4ff;
  border: 1px solid #bad9ff;
}

.analysis-opportunity.orange-ocean {
  color: #9a5b00;
  background: #fff7e6;
  border: 1px solid #f5d49a;
}

.analysis-opportunity.red-ocean {
  color: #b42335;
  background: #fff1f3;
  border: 1px solid #f0bbc4;
}

.analysis-section {
  padding: 18px;
  background: #fff;
  border: 1px solid #e5eaf3;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(21, 35, 56, 0.06);
}

.core-metrics-section {
  padding: 12px 16px 16px;
  border-radius: 14px;
}

.analysis-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.analysis-section-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analysis-section-head span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #1677ff;
  background: #eef6ff;
  border: 1px solid #cfe4ff;
  border-radius: 10px;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 900;
}

.analysis-section-head h4 {
  margin: 0;
  color: #1f2329;
  font-size: 18px;
  font-weight: 900;
}

.analysis-section-head p {
  max-width: 560px;
  color: #86909c;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.conclusion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.ai-conclusion-card,
.risk-card {
  padding: 16px;
  border-radius: 16px;
}

.ai-conclusion-card {
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
  border: 1px solid #d8e9ff;
}

.ai-conclusion-card.watch {
  background: linear-gradient(135deg, #fffdf7, #fff7e8);
  border-color: #f4d7a6;
}

.ai-conclusion-card.risk {
  background: linear-gradient(135deg, #fffafa, #fff1f3);
  border-color: #f0c0c8;
}

.ai-conclusion-card > strong,
.risk-card > strong {
  display: block;
  color: #1f2329;
  font-size: 18px;
  font-weight: 900;
}

.ai-conclusion-card > p {
  margin-top: 6px;
  color: #4e5969;
  font-size: 13px;
  line-height: 1.65;
}

.decision-proof-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.decision-proof-list span {
  position: relative;
  padding: 9px 10px 9px 30px;
  color: #263142;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(216, 228, 243, 0.88);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.decision-proof-list span::before {
  content: "✓";
  position: absolute;
  top: 9px;
  left: 10px;
  color: #52c41a;
  font-weight: 900;
}

.risk-card {
  background: #fbfcfe;
  border: 1px solid #e7edf5;
}

.risk-card ul {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.risk-card li {
  position: relative;
  padding-left: 16px;
  color: #4e5969;
  font-size: 13px;
  line-height: 1.55;
}

.risk-card li::before {
  content: "";
  position: absolute;
  top: 0.68em;
  left: 0;
  width: 6px;
  height: 6px;
  background: #f5a623;
  border-radius: 50%;
}

.analysis-metric-grid,
.competitor-insight-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.competitor-insight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analysis-metric {
  min-height: 92px;
  padding: 13px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid #e5eaf3;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(21, 35, 56, 0.045);
}

.analysis-metric span {
  display: block;
  color: #86909c;
  font-size: 12px;
  font-weight: 850;
}

.analysis-metric strong {
  display: block;
  margin-top: 8px;
  color: #1f2329;
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.analysis-metric small {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 8px;
  color: #4e5969;
  background: #f4f7fb;
  border: 1px solid #e5eaf3;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.trend-analysis-card {
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.06), transparent 48%),
    #fff;
}

.trend-analysis-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.trend-analysis-layout article {
  padding: 16px;
  background: #f8fbff;
  border: 1px solid #d8e9ff;
  border-radius: 16px;
}

.trend-analysis-layout article span {
  color: #1677ff;
  font-size: 12px;
  font-weight: 900;
}

.trend-analysis-layout article strong {
  display: block;
  margin-top: 8px;
  color: #1f2329;
  font-size: 24px;
  font-weight: 950;
}

.trend-analysis-layout article small {
  display: block;
  margin-top: 6px;
  color: #4e5969;
  font-size: 12px;
  font-weight: 850;
}

.trend-analysis-layout article p {
  margin-top: 12px;
  color: #4e5969;
  font-size: 13px;
  line-height: 1.65;
}

.trend-mini-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 176px;
  padding: 14px 12px 10px;
  background:
    linear-gradient(180deg, rgba(22, 119, 255, 0.045) 0 1px, transparent 1px),
    #fbfdff;
  background-size: 100% 36px, auto;
  border: 1px solid #e5eaf3;
  border-radius: 16px;
}

.trend-mini-chart.empty {
  display: grid;
  place-items: center;
  color: #86909c;
  font-size: 13px;
}

.trend-mini-bar {
  display: grid;
  align-items: end;
  height: 148px;
  min-width: 0;
}

.trend-mini-bar i {
  display: block;
  height: var(--bar-height);
  min-height: 12px;
  background: linear-gradient(180deg, #8bbdff, #1677ff);
  border-radius: 999px 999px 6px 6px;
  box-shadow: 0 8px 16px rgba(22, 119, 255, 0.16);
}

.trend-mini-bar.peak i {
  background: linear-gradient(180deg, #ffca72, #f5a623);
  box-shadow: 0 8px 16px rgba(245, 166, 35, 0.2);
}

.trend-mini-bar.off i {
  background: linear-gradient(180deg, #d7e2ee, #9aa7b8);
  box-shadow: none;
}

.trend-mini-bar em {
  margin-top: 7px;
  color: #86909c;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.competitor-price-trend {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.07), transparent 46%),
    #fbfdff;
  border: 1px solid #e5eaf3;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(21, 35, 56, 0.045);
}

.competitor-price-trend.empty {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 118px;
}

.competitor-price-trend.empty p {
  max-width: 420px;
  margin: 0;
  color: #86909c;
  font-size: 13px;
  line-height: 1.6;
}

.competitor-price-trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.competitor-price-trend span,
.competitor-price-trend-head span {
  display: block;
  color: #86909c;
  font-size: 12px;
  font-weight: 900;
}

.competitor-price-trend strong,
.competitor-price-trend-head strong {
  display: block;
  margin-top: 5px;
  color: #1f2329;
  font-size: 18px;
  font-weight: 950;
}

.competitor-price-trend-head em {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  color: #1677ff;
  background: #eef6ff;
  border: 1px solid #d8e9ff;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

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

.price-trend-summary article {
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5eaf3;
  border-radius: 13px;
}

.price-trend-summary article strong {
  font-family: var(--font-number);
  font-size: 16px;
}

.price-trend-chart {
  display: grid;
  gap: 10px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(22, 119, 255, 0.045) 0 1px, transparent 1px),
    #fff;
  background-size: 25% 100%, auto;
  border: 1px solid #e5eaf3;
  border-radius: 14px;
}

.price-trend-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 116px;
  gap: 10px;
  align-items: center;
}

.price-trend-rank {
  color: #86909c;
  font-size: 11px;
  font-weight: 950;
}

.price-trend-track {
  height: 12px;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 999px;
}

.price-trend-track i {
  display: block;
  width: var(--price-width);
  height: 100%;
  background: linear-gradient(90deg, #71b5ff, #1677ff 64%, #f5a623);
  border-radius: inherit;
  box-shadow: 0 6px 14px rgba(22, 119, 255, 0.18);
}

.price-trend-row > strong {
  margin: 0;
  color: #1f2329;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 950;
  text-align: right;
  white-space: nowrap;
}

.competitor-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 13px 14px;
  background: #f8fbff;
  border: 1px solid #d8e9ff;
  border-radius: 14px;
}

.competitor-action-row p {
  color: #4e5969;
  font-size: 13px;
  line-height: 1.55;
}

.analysis-action-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 15px;
  color: #fff;
  background: #1677ff;
  border: 1px solid #1677ff;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(22, 119, 255, 0.2);
  font-size: 13px;
  font-weight: 900;
}

.analysis-action-button:hover {
  background: #0f63d8;
  border-color: #0f63d8;
  transform: translateY(-1px);
}

.category-analysis-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  gap: 12px;
}

.category-analysis-grid article {
  min-height: 132px;
  padding: 15px;
  background: #fbfdff;
  border: 1px solid #e5eaf3;
  border-radius: 15px;
}

.category-analysis-grid article > span {
  display: block;
  color: #86909c;
  font-size: 12px;
  font-weight: 900;
}

.category-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 12px;
}

.category-trail span,
.category-extension-card em {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  color: #1f2329;
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.category-trail i {
  color: #b5beca;
  font-style: normal;
  font-weight: 900;
}

.category-path-card p {
  margin-top: 12px;
  color: #4e5969;
  font-size: 12px;
  line-height: 1.6;
}

.keyword-summary-row {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.keyword-summary-row strong {
  color: #1f2329;
  font-size: 18px;
  font-weight: 900;
}

.keyword-summary-row em {
  color: #1677ff;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.keyword-mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.keyword-mini-metrics small {
  padding: 4px 8px;
  color: #4e5969;
  background: #f4f7fb;
  border: 1px solid #e5eaf3;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.category-extension-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.advice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.advice-grid article {
  padding: 14px;
  background:
    linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid #e5eaf3;
  border-radius: 14px;
}

.advice-grid strong {
  display: block;
  color: #1f2329;
  font-size: 14px;
  font-weight: 950;
}

.advice-grid p {
  margin-top: 8px;
  color: #4e5969;
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  .analysis-hero,
  .trend-analysis-layout,
  .conclusion-grid,
  .category-analysis-grid {
    grid-template-columns: 1fr;
  }

  .analysis-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .competitor-insight-grid,
  .advice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .product-dashboard-summary {
    padding: 12px;
  }

  .analysis-hero,
  .analysis-section {
    padding: 14px;
    border-radius: 16px;
  }

  .analysis-product-brief,
  .analysis-score-card {
    grid-template-columns: 1fr;
  }

  .analysis-cover {
    width: 100%;
    height: 188px;
  }

  .analysis-section-head {
    display: grid;
  }

  .analysis-section-head p {
    max-width: none;
    text-align: left;
  }

  .analysis-metric-grid,
  .competitor-insight-grid,
  .advice-grid {
    grid-template-columns: 1fr;
  }

  .trend-mini-chart {
    overflow-x: auto;
    grid-template-columns: repeat(12, 34px);
  }

  .competitor-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .analysis-action-button {
    width: 100%;
  }
}

/* Final product shelf layout. Keep the result page image-first, and move dense metrics into the dashboard. */
.product-list-panel .product-list:not(.empty) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-items: start;
  gap: 10px;
  padding: 10px;
  overflow-x: visible;
}

.product-list-panel .decision-product {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  align-items: start;
  padding: 0 0 10px !important;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.product-list-panel .decision-product:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: translateY(-2px);
}

.product-list-panel .decision-product.is-midplatform-match {
  background:
    linear-gradient(180deg, #ffffff, #f6fffc) !important;
  border-color: rgba(15, 159, 143, 0.28);
  box-shadow:
    0 12px 24px rgba(15, 159, 143, 0.08),
    inset 0 0 0 1px rgba(15, 159, 143, 0.04);
}

.product-list-panel .decision-product.is-midplatform-match .thumb-frame {
  border-color: rgba(15, 159, 143, 0.34);
}

.product-list-panel .decision-product .thumb-frame {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0;
  background:
    linear-gradient(180deg, #ffffff, #f7f9fc);
  border: 1px solid #edf1f6;
  border-radius: 3px;
  box-shadow: none;
}

.product-list-panel .decision-product .thumb-frame.is-missing-image {
  background: #f8fafc;
  border-style: dashed;
}

.product-list-panel .decision-product .thumb-frame .thumb {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #fff;
  border: 0;
  border-radius: 0;
}

.product-list-panel .decision-product .product-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.product-list-panel .decision-product h3 {
  display: grid;
  gap: 3px;
  min-height: 58px;
  margin: 0;
  overflow: visible;
  color: #10243f;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.product-list-panel .product-title-link {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-title-cn {
  display: -webkit-box;
  overflow: hidden;
  color: #516174;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.product-list-panel .decision-product .meta {
  gap: 6px;
  min-height: 22px;
  margin: 0;
}

.product-list-panel .decision-product .pill,
.product-list-panel .decision-product .seller-type,
.product-list-panel .decision-product .rocket-type {
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.product-list-panel .decision-product .decision-metrics {
  display: none !important;
}

.product-list-panel .decision-product .actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-column: auto !important;
  gap: 7px;
  width: 100%;
  margin-top: 1px;
}

.product-list-panel .decision-product .product-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.product-list-panel .decision-product .product-monitor-button,
.product-list-panel .decision-product .product-card-image-search-button,
.product-list-panel .decision-product .product-card-mid-similarity-button {
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.product-list-panel .decision-product .product-monitor-button {
  background: #176f63;
  border-color: #176f63;
}

.product-list-panel .decision-product .product-monitor-button:hover {
  background: #105d54;
  border-color: #105d54;
}

.product-list-panel .decision-product .product-monitor-button.is-watched {
  color: #176f63;
  background: #e9f7f3;
  border-color: #8bc9ba;
}

.product-list-panel .decision-product .product-card-image-search-button {
  background: #2563a8;
  border-color: #2563a8;
}

.product-list-panel .decision-product .product-card-image-search-button:hover:not(:disabled) {
  background: #194f8c;
  border-color: #194f8c;
}

.product-list-panel .decision-product .product-card-image-search-button.is-complete {
  color: #176f63;
  background: #e9f7f3;
  border-color: #8bc9ba;
}

.product-list-panel .decision-product .product-card-image-search-button.is-failed {
  color: #a43b35;
  background: #fff1f0;
  border-color: #e7aaa6;
}

.product-list-panel .decision-product .product-card-image-search-button.is-failed:hover:not(:disabled) {
  color: #8d2924;
  background: #ffe4e2;
  border-color: #d98882;
}

.product-list-panel .decision-product .product-card-image-search-button.is-busy,
.product-list-panel .decision-product .product-card-image-search-button:disabled {
  color: #66758a;
  background: #eef3f8;
  border-color: #ced9e6;
  cursor: default;
}

.product-list-panel .decision-product .product-mid-match-notice {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  color: #6d4a0d;
  background: #fff7e6;
  border: 1px solid #d9b66f;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  text-align: left;
}

.product-list-panel .decision-product .product-mid-match-notice:hover {
  color: #533704;
  background: #ffefc8;
  border-color: #c99b42;
}

.product-list-panel .decision-product .product-mid-match-notice strong {
  flex: 0 0 auto;
  color: #8a5b12;
  font-size: 10px;
}

.product-list-panel .decision-product .product-card-mid-similarity-button {
  background: #8a5b12;
  border-color: #8a5b12;
}

.product-list-panel .decision-product .product-card-mid-similarity-button:hover:not(:disabled) {
  background: #714708;
  border-color: #714708;
}

.product-list-panel .decision-product .product-card-mid-similarity-button.is-complete {
  color: #6d4a0d;
  background: #fff7e6;
  border-color: #d9b66f;
}

.product-list-panel .decision-product .product-card-mid-similarity-button.is-failed {
  color: #a43b35;
  background: #fff1f0;
  border-color: #e7aaa6;
}

.product-list-panel .decision-product .product-card-mid-similarity-button.is-busy,
.product-list-panel .decision-product .product-card-mid-similarity-button:disabled {
  color: #66758a;
  background: #eef3f8;
  border-color: #ced9e6;
  cursor: default;
}

.product-list-panel .decision-product .add-cart-button {
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  color: #fff;
  background: #f59e0b;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(245, 158, 11, 0.18);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.product-list-panel .decision-product .add-cart-button:hover {
  color: #fff;
  background: #e58e00;
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.24);
}

.product-list-panel .decision-product .compact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.product-list-panel .decision-product .compact-actions .link-button {
  height: 30px;
  min-height: 30px;
  padding: 0 8px;
  color: #0f4e91;
  background: #f6fbff;
  border: 1px solid #d6e9ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.product-list-panel .decision-product .compact-actions .link-button:hover {
  color: #1677ff;
  background: #eef7ff;
  border-color: #acd4ff;
}

.product-list-panel .midplatform-product-group-divider {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 12px;
  background: #f8fbff;
  border: 1px solid #d8e4f1;
  border-left: 4px solid #94a3b8;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(18, 40, 68, 0.045);
}

.product-list-panel .midplatform-product-group-divider span {
  color: #17365a;
  font-size: 13px;
  font-weight: 950;
}

.product-list-panel .midplatform-product-group-divider strong {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  color: #526579;
  background: #ffffff;
  border: 1px solid #d8e4f1;
  border-radius: 999px;
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 900;
}

.product-list-panel .midplatform-product-group-divider.is-matched {
  background:
    linear-gradient(90deg, rgba(15, 159, 143, 0.1), rgba(255, 255, 255, 0.92));
  border-color: #c8e3dc;
  border-left-color: #0f9f8f;
}

.product-list-panel .midplatform-product-group-divider.is-matched span {
  color: #0b6f67;
}

.product-list-panel .midplatform-product-group-divider.is-matched strong {
  color: #0b6f67;
  border-color: #c8e3dc;
}

.product-list-panel .product-pagination {
  grid-column: 1 / -1;
}

.dashboard-product-data-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  margin: 2px 0 14px;
  background: #f8fbff;
  border: 1px solid #dce8f7;
  border-radius: 14px;
}

.dashboard-product-data-strip article {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid #dce8f7;
}

.dashboard-product-data-strip article:last-child {
  border-right: 0;
}

.dashboard-product-data-strip span {
  display: block;
  color: #6b7586;
  font-size: 12px;
  font-weight: 850;
}

.dashboard-product-data-strip strong {
  display: block;
  margin-top: 5px;
  color: #101828;
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dashboard-product-data-strip article:nth-child(1) strong,
.dashboard-product-data-strip article:nth-child(3) strong {
  color: #1677ff;
}

.dashboard-product-data-strip article:nth-child(2) strong {
  color: #f26a00;
}

@media (max-width: 1180px) {
  .product-list-panel .product-list:not(.empty) {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .product-list-panel .decision-product {
    grid-template-columns: 1fr !important;
  }

  .product-list-panel .decision-product .actions {
    grid-template-columns: 1fr !important;
  }

  .dashboard-product-data-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-product-data-strip article:nth-child(3) {
    border-right: 0;
  }
}

@media (max-width: 900px) {
  .product-list-panel .product-list:not(.empty) {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

@media (max-width: 640px) {
  .product-list-panel .product-list:not(.empty) {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .product-list-panel .decision-product .actions {
    grid-template-columns: 1fr !important;
  }

  .dashboard-product-data-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-product-data-strip article {
    border-right: 0;
    border-bottom: 1px solid #dce8f7;
  }

  .dashboard-product-data-strip article:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 420px) {
  .product-list-panel .product-list:not(.empty) {
    grid-template-columns: 1fr;
  }
}

/* Keep the workflow out of document flow at every viewport size. */
@media (max-width: 1180px) {
  body .selection-workflow {
    position: fixed;
    top: 116px;
    bottom: auto;
    left: 12px;
    width: min(220px, calc(100vw - 24px));
    max-height: calc(100vh - 134px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #d8e3ef;
    border-radius: 12px;
  }

  body .selection-workflow-inner {
    width: 100%;
    min-width: 0;
    padding: 16px 14px;
  }

  body .selection-workflow-title { display: flex; }
  body .selection-workflow-steps { display: grid; grid-template-columns: 1fr; width: auto; min-width: 0; }
  body .selection-workflow-step { flex: none; width: 100%; }
  body .selection-workflow-step:not(:last-child)::after {
    display: block;
    top: auto;
    right: auto;
    bottom: -11px;
    left: 27px;
    width: 1px;
    height: 10px;
  }
}

@media (max-width: 760px) {
  body .selection-workflow { top: 134px; }
  body .selection-workflow-title { display: flex; }
}

.quick-filter-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e3ebf5;
  border-radius: 12px;
}

.quick-filter-templates > span {
  color: #5f6f84;
  font-size: 12px;
  font-weight: 900;
}

.quick-filter-templates button {
  height: 30px;
  padding: 0 12px;
  color: #17365a;
  background: #f6f9fd;
  border: 1px solid #dbe6f2;
  border-radius: 999px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
}

.quick-filter-templates button:hover,
.quick-filter-templates button.active {
  color: #fff;
  background: #1a3a5c;
  border-color: #1a3a5c;
  box-shadow: 0 8px 18px rgba(26, 58, 92, 0.16);
  transform: translateY(-1px);
}

.image-search-explain {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid #d7e5f4;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(26, 58, 92, 0.07);
}

.image-search-explain[hidden] {
  display: none !important;
}

.image-search-explain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-search-explain-head strong {
  color: #17365a;
  font-size: 13px;
  font-weight: 950;
}

.image-search-explain-head span {
  color: #6a7688;
  font-size: 11px;
  font-weight: 800;
}

.image-search-explain-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.image-search-explain-grid article {
  min-height: 54px;
  padding: 9px 10px;
  background: #f7f9fc;
  border: 1px solid #e2e9f2;
  border-radius: 10px;
}

.image-search-explain-grid span {
  display: block;
  color: #7b8797;
  font-size: 11px;
  font-weight: 850;
}

.image-search-explain-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #17233a;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-search-keyword-chips,
.image-search-attempts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-search-keyword-chips span,
.image-search-attempts span {
  padding: 4px 8px;
  color: #1a3a5c;
  background: #eef6ff;
  border: 1px solid #d3e8ff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.image-search-attempts span {
  color: #6a4a0d;
  background: #fff8e8;
  border-color: #f4dfb5;
}

.image-search-explain p {
  color: #9a5b0b;
  font-size: 12px;
  line-height: 1.45;
}

.admin-metrics {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

@media (max-width: 980px) {
  .image-search-explain-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .quick-filter-templates {
    align-items: stretch;
  }

  .quick-filter-templates > span,
  .quick-filter-templates button {
    width: 100%;
  }

  .image-search-explain-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Workbench hierarchy polish: make navigation lighter and the result surface clearer. */
.topbar {
  flex-direction: row;
  align-items: center;
  min-height: 62px;
  padding: 9px 26px;
  box-shadow: 0 6px 18px rgba(26, 58, 92, 0.07);
}

.topbar .status {
  margin-left: auto;
  flex-wrap: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.brand-title-inline {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.brand-title-inline .brand-word {
  color: var(--amber);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.brand-title-inline h1 {
  color: var(--nav);
  font-size: 22px;
  font-weight: 950;
  line-height: 1.08;
}

.topbar .eyebrow {
  margin-bottom: 2px;
  font-size: 11px;
}

.notification-button,
.avatar-button {
  height: 34px;
}

.avatar-button {
  width: 42px;
  min-width: 42px;
}

@media (max-width: 560px) {
  .brand-title-inline {
    gap: 7px;
  }

  .brand-title-inline .brand-word {
    font-size: 13px;
  }

  .brand-title-inline h1 {
    font-size: 18px;
  }
}

.primary-nav {
  top: 62px;
}

.nav-link {
  height: 44px;
  padding: 0 15px;
}

.product-list-panel {
  border-color: #d7e0ec;
  box-shadow: 0 18px 44px rgba(18, 31, 52, 0.09);
}

.product-list-panel .result-head {
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
}

.product-list-panel .result-title-block h2 {
  color: #10243f;
  font-size: 18px;
  font-weight: 950;
}

.product-list-panel .result-title-block p {
  color: #6b7788;
  font-size: 12px;
}

.product-list-panel .result-sort-control {
  min-height: 34px;
  box-shadow: none;
}

.product-list-panel .sort-caption,
.product-list-panel .sort-option {
  min-height: 34px;
  padding: 0 11px;
}

.product-list-panel .compare-products-button {
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.17);
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    padding: 9px 16px;
  }

  .topbar .status {
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .topbar .status > span:not(.dot) {
    display: none;
  }
}

/* Polished core metric panel: make the dashboard read like a decision surface, not a table. */
.analysis-section:has(.dashboard-product-data-strip) {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(22, 119, 255, 0.11), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  border-color: #dbe8f8;
  box-shadow: 0 18px 42px rgba(30, 64, 116, 0.09);
}

.analysis-section:has(.dashboard-product-data-strip)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #1677ff, #36cfc9 48%, #ff9f1a);
}

.analysis-section:has(.dashboard-product-data-strip) .analysis-section-head {
  position: relative;
  z-index: 1;
  align-items: center;
  margin-bottom: 16px;
}

.analysis-section:has(.dashboard-product-data-strip) .analysis-section-head span {
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #0f62d6);
  border-color: rgba(22, 119, 255, 0.2);
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
}

.dashboard-product-data-strip {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  margin: 0 0 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.dashboard-product-data-strip article {
  position: relative;
  overflow: hidden;
  min-height: 88px;
  padding: 14px 15px 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
  border: 1px solid #dbe7f6;
  border-radius: 16px;
  box-shadow:
    0 10px 24px rgba(21, 35, 56, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.dashboard-product-data-strip article:hover {
  border-color: #b7d7ff;
  box-shadow: 0 16px 34px rgba(22, 119, 255, 0.12);
  transform: translateY(-2px);
}

.dashboard-product-data-strip article::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 34px;
  height: 34px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.16), rgba(22, 119, 255, 0.03));
  border-radius: 12px;
}

.dashboard-product-data-strip article::after {
  content: "";
  position: absolute;
  top: 23px;
  right: 23px;
  width: 12px;
  height: 12px;
  background: #1677ff;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(22, 119, 255, 0.12);
}

.dashboard-product-data-strip article:nth-child(2)::before {
  background: linear-gradient(135deg, rgba(242, 106, 0, 0.18), rgba(242, 106, 0, 0.04));
}

.dashboard-product-data-strip article:nth-child(2)::after {
  background: #f26a00;
  box-shadow: 0 0 0 5px rgba(242, 106, 0, 0.12);
}

.dashboard-product-data-strip article:nth-child(3)::before {
  background: linear-gradient(135deg, rgba(15, 159, 143, 0.18), rgba(15, 159, 143, 0.04));
}

.dashboard-product-data-strip article:nth-child(3)::after {
  background: #0f9f8f;
  box-shadow: 0 0 0 5px rgba(15, 159, 143, 0.12);
}

.dashboard-product-data-strip article:nth-child(4)::before {
  background: linear-gradient(135deg, rgba(82, 196, 26, 0.18), rgba(82, 196, 26, 0.04));
}

.dashboard-product-data-strip article:nth-child(4)::after {
  background: #52c41a;
  box-shadow: 0 0 0 5px rgba(82, 196, 26, 0.12);
}

.dashboard-product-data-strip article:nth-child(5)::before {
  background: linear-gradient(135deg, rgba(72, 86, 199, 0.18), rgba(72, 86, 199, 0.04));
}

.dashboard-product-data-strip article:nth-child(5)::after {
  background: #4856c7;
  box-shadow: 0 0 0 5px rgba(72, 86, 199, 0.12);
}

.dashboard-product-data-strip article:last-child {
  border-right: 1px solid #dbe7f6;
}

.dashboard-product-data-strip span {
  position: relative;
  z-index: 1;
  color: #667085;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-product-data-strip strong {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: #101828;
  font-size: clamp(20px, 1.48vw, 26px);
  letter-spacing: -0.02em;
}

.dashboard-product-data-strip + .analysis-metric-grid {
  position: relative;
  z-index: 1;
  gap: 12px;
}

.dashboard-product-data-strip + .analysis-metric-grid .analysis-metric {
  display: grid;
  min-height: 88px;
  align-content: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.76);
  border-color: #e3ebf6;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(21, 35, 56, 0.04);
}

.dashboard-product-data-strip + .analysis-metric-grid .analysis-metric:hover {
  border-color: #cadbf0;
  box-shadow: 0 12px 26px rgba(21, 35, 56, 0.075);
}

.dashboard-product-data-strip + .analysis-metric-grid .analysis-metric span {
  color: #7a8699;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-product-data-strip + .analysis-metric-grid .analysis-metric strong {
  margin-top: 7px;
  color: #111827;
  font-size: 20px;
  letter-spacing: -0.01em;
}

@media (max-width: 1180px) {
  .dashboard-product-data-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-product-data-strip article,
  .dashboard-product-data-strip article:nth-child(3),
  .dashboard-product-data-strip article:last-child {
    border-right: 1px solid #dbe7f6;
  }
}

@media (max-width: 760px) {
  .analysis-section:has(.dashboard-product-data-strip) .analysis-section-head {
    align-items: start;
  }
}

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

  .dashboard-product-data-strip article,
  .dashboard-product-data-strip article:last-child {
    border-right: 1px solid #dbe7f6;
    border-bottom: 1px solid #dbe7f6;
  }
}

.core-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 8px;
}

.core-metric {
  position: relative;
  overflow: hidden;
  min-height: 60px;
  padding: 10px 12px 9px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #dbe7f6;
  border-radius: 8px;
  box-shadow: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.core-metric:hover {
  border-color: #b3d7ff;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.08);
}

.core-metric::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1677ff, #36cfc9);
}

.core-metric:nth-child(4n + 2)::before {
  background: linear-gradient(90deg, #f26a00, #ffc53d);
}

.core-metric:nth-child(4n + 3)::before {
  background: linear-gradient(90deg, #0f9f8f, #36cfc9);
}

.core-metric:nth-child(4n)::before {
  background: linear-gradient(90deg, #52c41a, #73d13d);
}

.core-metric span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.32;
}

.core-metric strong {
  display: block;
  margin-top: 5px;
  color: #101828;
  font-family: var(--font-number);
  font-size: clamp(15px, 1vw, 19px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.22;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.core-metric-field-category,
.core-metric-field-rocket_badge {
  grid-column: span 2;
}

.core-metric-field-delivery_time {
  grid-column: span 1;
}

.core-metric-field-category strong,
.core-metric-field-rocket_badge strong {
  font-size: clamp(14px, 0.95vw, 18px);
  line-height: 1.25;
}

.core-metric-group-attributes .core-metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.core-metric-group-attributes .core-metric {
  grid-column: span 1;
  min-height: 68px;
}

.core-metric-group-attributes .core-metric-field-category,
.core-metric-group-attributes .core-metric-field-delivery_time {
  grid-column: span 2;
}

.core-metric-rocket {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.core-metric-rocket .rocket-type {
  display: inline-flex;
  width: fit-content;
  max-width: max-content;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 20px;
  padding: 3px 8px 3px 7px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.core-metric-rocket .rocket-type::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin-right: 0;
  border-radius: 999px;
  background: currentColor;
  -webkit-mask: none;
  mask: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.core-metric-rocket-text {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-metric.highlight {
  background:
    linear-gradient(135deg, rgba(114, 46, 209, 0.08), rgba(179, 127, 235, 0.04)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
  border-color: rgba(114, 46, 209, 0.2);
}

.core-metric.highlight strong {
  color: #722ed1;
}

@media (max-width: 1280px) {
  .core-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .core-metric-field-category,
  .core-metric-field-rocket_badge {
    grid-column: span 1;
  }
}

@media (max-width: 960px) {
  .core-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .core-metric-group-attributes .core-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .core-metric-group-attributes .core-metric,
  .core-metric-group-attributes .core-metric-field-rocket_badge {
    grid-column: span 1;
  }

  .core-metric-group-attributes .core-metric-field-category,
  .core-metric-group-attributes .core-metric-field-delivery_time {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .core-metrics-grid {
    grid-template-columns: 1fr;
  }

  .core-metric-group-attributes .core-metrics-grid {
    grid-template-columns: 1fr;
  }

  .core-metric-group-attributes .core-metric,
  .core-metric-group-attributes .core-metric-field-category,
  .core-metric-group-attributes .core-metric-field-rocket_badge,
  .core-metric-group-attributes .core-metric-field-delivery_time {
    grid-column: span 1;
  }
}

.agent-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: grid;
  justify-items: end;
  gap: 10px;
  font-family: var(--font-ui);
}

.agent-assistant.is-custom-position {
  right: auto;
  bottom: auto;
  justify-items: end;
}

.agent-toggle {
  justify-self: end;
  width: max-content;
  max-width: calc(100vw - 24px);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 14px 8px 8px;
  color: #0b213f;
  background: #ffffff;
  border: 1px solid #d7e4f2;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(16, 34, 58, 0.16);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.agent-toggle:active,
.agent-assistant.is-dragging .agent-toggle {
  cursor: grabbing;
}

.agent-toggle span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  background: linear-gradient(135deg, #1677ff, #0f9f8f);
  border-radius: 50%;
}

.agent-toggle strong {
  font-size: 13px;
  font-weight: 900;
}

.agent-assistant[data-open="true"] .agent-toggle {
  display: none;
}

.agent-panel {
  width: min(390px, calc(100vw - 32px));
  min-width: 320px;
  max-width: calc(100vw - 24px);
  height: min(540px, calc(100vh - 88px));
  min-height: 330px;
  max-height: calc(100vh - 24px);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dbe7f4;
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(16, 34, 58, 0.2);
}

.agent-panel[hidden] {
  display: none;
}

.agent-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f8;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  cursor: move;
  user-select: none;
  touch-action: none;
}

.agent-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  color: #0b213f;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: move;
}

.agent-title-icon {
  flex: 0 0 auto;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  background: linear-gradient(135deg, #1677ff, #0f9f8f);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(22, 119, 255, 0.22);
}

.agent-title-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agent-title-copy .eyebrow {
  margin: 0;
}

.agent-title-copy strong {
  color: #0b213f;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.agent-head h2 {
  margin: 2px 0 0;
  color: #0b213f;
  font-size: 16px;
  line-height: 1.2;
}

.agent-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #667085;
  background: #ffffff;
  border: 1px solid #dce6f2;
  border-radius: 50%;
  cursor: pointer;
}

.agent-messages {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  align-items: start;
  gap: 10px;
  max-height: none;
  min-height: 170px;
  padding: 14px;
  overflow: auto;
  background: #f6f9fd;
}

.agent-message {
  align-self: start;
  justify-self: start;
  width: fit-content;
  max-width: min(76%, 300px);
  height: auto;
  padding: 8px 10px;
  color: #102033;
  background: #ffffff;
  border: 1px solid #e0e8f2;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(16, 34, 58, 0.05);
}

.agent-message.user {
  justify-self: end;
  max-width: min(58%, 210px);
  padding: 7px 10px;
  color: #ffffff;
  background: #1677ff;
  border-color: #1677ff;
}

.agent-message.pending {
  color: #667085;
}

.agent-message p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.48;
  font-size: 13px;
}

.agent-message small {
  display: block;
  margin-top: 5px;
  color: #7a8699;
  font-size: 11px;
}

.agent-workbench .agent-message {
  max-width: min(82%, 720px);
}

.agent-workbench .agent-message.user {
  max-width: min(70%, 520px);
}

.agent-message.user small {
  color: rgba(255, 255, 255, 0.82);
}

.agent-prompts {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px 0;
  overflow-x: auto;
  background: #ffffff;
}

.agent-prompts button {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #0b5cab;
  background: #eef6ff;
  border: 1px solid #d6eaff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.agent-form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
}

.agent-form input {
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  color: #102033;
  background: #f8fbff;
  border: 1px solid #dbe7f4;
  border-radius: 10px;
  outline: none;
}

.agent-form input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.agent-form button {
  height: 38px;
  padding: 0 14px;
  color: #ffffff;
  background: #0f9f8f;
  border: 0;
  border-radius: 10px;
  font-weight: 900;
  cursor: pointer;
}

.agent-form button:disabled,
.agent-prompts button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.agent-resize-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  opacity: 0.7;
  touch-action: none;
  z-index: 4;
}

.agent-resize-handle-nw {
  top: 4px;
  left: 4px;
}

.agent-resize-handle-se {
  right: 4px;
  bottom: 4px;
}

.agent-resize-handle::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
}

.agent-resize-handle-se::before {
  right: 3px;
  bottom: 3px;
  border-right: 2px solid #9aabc2;
  border-bottom: 2px solid #9aabc2;
  border-radius: 0 0 3px 0;
}

.agent-resize-handle-nw::before {
  left: 3px;
  top: 3px;
  border-left: 2px solid #9aabc2;
  border-top: 2px solid #9aabc2;
  border-radius: 3px 0 0 0;
}

.agent-resize-handle:hover {
  opacity: 1;
}

.agent-assistant.is-dragging .agent-panel,
.agent-assistant.is-resizing .agent-panel {
  user-select: none;
}

@media (max-width: 640px) {
  .agent-assistant {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .agent-panel {
    width: 100%;
    min-width: 0;
    height: min(560px, calc(100vh - 40px));
  }

  .agent-assistant.is-custom-position {
    top: auto !important;
    right: 12px !important;
    bottom: 12px !important;
    left: 12px !important;
    justify-items: end;
  }

  .agent-toggle {
    justify-self: end;
  }

  .agent-messages {
    max-height: 48vh;
  }

  .agent-head {
    cursor: default;
  }

  .agent-resize-handle {
    display: none;
  }
}

.agent-workbench {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 170px);
  overflow: hidden;
}

.agent-workbench-head {
  align-items: flex-start;
}

.agent-workbench-status {
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 10px 12px;
  color: #0b213f;
  background: #f7fbff;
  border: 1px solid #dbe7f4;
  border-radius: 8px;
  text-align: right;
}

.agent-workbench-status span {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
}

.agent-workbench-status strong {
  font-size: 14px;
  font-weight: 950;
}

.agent-workbench-messages {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 420px;
  max-height: calc(100vh - 340px);
  padding: 14px;
  overflow: auto;
  background: #f6f9fd;
  border-top: 1px solid #edf2f8;
  border-bottom: 1px solid #edf2f8;
}

.agent-workbench-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 0;
  background: #ffffff;
}

.agent-workbench-prompts button {
  padding: 8px 11px;
  color: #0b5cab;
  background: #eef6ff;
  border: 1px solid #d6eaff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.agent-workbench-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  background: #ffffff;
}

.agent-workbench-form input {
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  color: #102033;
  background: #f8fbff;
  border: 1px solid #dbe7f4;
  border-radius: 8px;
  outline: none;
}

.agent-workbench-form input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.agent-workbench-form button {
  height: 42px;
  padding: 0 18px;
  color: #ffffff;
  background: #0f9f8f;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.agent-workbench-form button:disabled,
.agent-workbench-prompts button:disabled {
  cursor: wait;
  opacity: 0.62;
}

@media (max-width: 640px) {
  .agent-workbench {
    min-height: calc(100vh - 120px);
  }

  .agent-workbench-head {
    gap: 12px;
  }

  .agent-workbench-status {
    width: 100%;
    text-align: left;
  }

  .agent-workbench-messages {
    min-height: 300px;
    max-height: 56vh;
  }

  .agent-workbench-form {
    grid-template-columns: 1fr;
  }
}

/* Layered workspace theme */
:root {
  --paper: #eef4fa;
  --panel: #ffffff;
  --panel-soft: #f3f8fd;
  --line: #d5e1ee;
  --line-strong: #b9c9dc;
  --shadow: 0 22px 50px rgba(18, 40, 68, 0.13);
  --shadow-soft: 0 12px 28px rgba(18, 40, 68, 0.075);
}

body {
  background:
    linear-gradient(180deg, rgba(214, 226, 240, 0.92) 0, rgba(239, 245, 251, 0.96) 260px, #eef4fa 100%),
    var(--paper);
}

.topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
  border-bottom-color: #ccd9e8;
  box-shadow: 0 10px 28px rgba(18, 40, 68, 0.09);
}

.primary-nav {
  background: rgba(238, 244, 250, 0.92);
  border-bottom-color: #d6e2ef;
  box-shadow: 0 8px 22px rgba(18, 40, 68, 0.045);
  backdrop-filter: blur(10px);
}

.panel,
.dashboard-card,
.search-panel,
.filter-suite,
.product-list-panel,
.sku-panel,
.reverse-panel,
.seasonality-panel,
.agent-workbench,
.watchlist-page-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.96));
  border-color: #d4e0ee;
  box-shadow: 0 16px 36px rgba(18, 40, 68, 0.075);
}

.panel-head,
.product-list-panel .result-head,
.watchlist-page-head,
.agent-workbench-head {
  background:
    linear-gradient(180deg, #f9fcff, #edf5fc);
  border-bottom-color: #d7e4f1;
}

.command-strip,
.basic-filter-panel,
.watch-classify-bar,
.watch-sort-bar,
.product-dashboard-summary,
.global-analysis-summary,
.analysis-section,
.seasonality-chart-card,
.seasonality-insights,
.agent-workbench-status {
  background:
    linear-gradient(180deg, #f8fbff, #f1f7fd);
  border-color: #d7e4f1;
}

.filter-suite {
  background:
    linear-gradient(180deg, #eaf2fa, #f3f8fd);
}

.filter-suite .range-filter-group,
.filter-stats article,
.global-analysis-mini article,
.global-analysis-grid article,
.analysis-list p,
.analysis-product-row {
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  border-color: #dce7f3;
}

.product-list-panel .product-list:not(.empty),
.watchlist-page-panel .watch-list,
.watch-pagination-shell,
.agent-workbench-messages {
  background: #eaf1f8;
}

.product-list-panel .decision-product {
  padding: 10px !important;
  background:
    linear-gradient(180deg, #ffffff, #f9fcff) !important;
  border: 1px solid #d9e5f2;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(18, 40, 68, 0.055);
}

.product-list-panel .decision-product:hover {
  border-color: rgba(37, 99, 168, 0.26);
  box-shadow: 0 16px 30px rgba(18, 40, 68, 0.09);
}

.product-list-panel .decision-product .thumb-frame,
.watchlist-page-panel .watch-item,
.core-metric,
.dashboard-product-data-strip + .analysis-metric-grid .analysis-metric {
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  border-color: #dce7f3;
  box-shadow: 0 10px 22px rgba(18, 40, 68, 0.055);
}

.watchlist-page-panel {
  background: #eaf1f8;
}

.watchlist-page-panel .watch-item:hover,
.core-metric:hover,
.dashboard-product-data-strip + .analysis-metric-grid .analysis-metric:hover {
  border-color: rgba(37, 99, 168, 0.28);
  box-shadow: 0 16px 30px rgba(18, 40, 68, 0.09);
}

.result-sort-control,
.watch-sort-control .sort-option.active,
.source-pill,
.watch-filter-reset {
  box-shadow: 0 8px 18px rgba(18, 40, 68, 0.06);
}

/* Data dashboard polish */
#trend.seasonality-panel {
  overflow: hidden;
  background: #edf3f9;
  border-color: #cad8e8;
  box-shadow: 0 22px 54px rgba(18, 40, 68, 0.12);
}

#trend .seasonality-head {
  padding: 20px 24px;
  color: #ffffff;
  background:
    linear-gradient(135deg, #123052 0%, #1b4c76 58%, #246b83 100%);
  border-bottom: 0;
}

#trend .seasonality-head h2 {
  color: #ffffff;
  font-size: 30px;
  font-weight: 950;
}

#trend .source-pill {
  color: #123052;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.72);
}

#trend .product-dashboard-summary {
  padding: 20px;
  background:
    linear-gradient(180deg, #edf4fb, #e8f0f8);
  border-top: 1px solid #cbd9ea;
  border-bottom: 1px solid #d6e2ef;
}

#trend .analysis-dashboard {
  width: min(100%, 1720px);
  margin: 0 auto;
  gap: 18px;
}

#trend .analysis-hero {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
  background:
    linear-gradient(90deg, #ffffff 0%, #f8fbff 62%, #eef5fc 100%);
  border: 1px solid #cfddeb;
  border-left: 5px solid #1a3a5c;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(18, 40, 68, 0.08);
}

#trend .analysis-hero::before {
  display: none;
}

#trend .analysis-hero.watch {
  background:
    linear-gradient(90deg, #ffffff 0%, #fffcf5 62%, #fff3df 100%);
  border-color: #ead1a6;
  border-left-color: #f5a623;
}

#trend .analysis-hero.risk {
  background:
    linear-gradient(90deg, #ffffff 0%, #fff8f8 62%, #fff0f1 100%);
  border-color: #e9c7cf;
  border-left-color: #d94d45;
}

#trend .analysis-product-brief {
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
}

#trend .analysis-cover {
  width: 128px;
  height: 128px;
  background: #f2f6fa;
  border-color: #d8e4f1;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(18, 40, 68, 0.08);
}

#trend .analysis-title-block .eyebrow {
  color: #1a3a5c;
}

#trend .analysis-title-block h3 {
  max-width: 900px;
  color: #142033;
  font-size: 23px;
  font-weight: 950;
  line-height: 1.32;
}

#trend .analysis-title-cn {
  max-width: 900px;
  margin-top: 6px;
  color: #4a5b70;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  -webkit-line-clamp: 2;
}

#trend .product-dashboard-tags {
  gap: 8px;
  margin-top: 12px;
}

#trend .product-dashboard-tags span,
#trend .category-trail span,
#trend .category-extension-card em,
#trend .keyword-mini-metrics small {
  color: #17365a;
  background: #ffffff;
  border-color: #d6e2ef;
  box-shadow: 0 4px 10px rgba(18, 40, 68, 0.045);
}

#trend .analysis-score-card {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  background: #ffffff;
  border-color: #d9e5f2;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(18, 40, 68, 0.08);
  backdrop-filter: none;
}

#trend .score-ring {
  width: 88px;
  height: 88px;
  background:
    radial-gradient(circle, #ffffff 0 58%, transparent 59%),
    conic-gradient(#1d75f0 var(--score), #e3eaf3 0);
  box-shadow:
    inset 0 0 0 1px #d9e5f2,
    0 8px 18px rgba(29, 117, 240, 0.12);
}

#trend .score-ring strong {
  color: #142033;
  font-size: 26px;
}

#trend .analysis-score-card h4 {
  color: #142033;
  font-size: 18px;
}

#trend .analysis-section {
  padding: 18px;
  background: #ffffff;
  border: 1px solid #d5e1ee;
  border-left: 4px solid #1a3a5c;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(18, 40, 68, 0.065);
}

#trend .analysis-section:nth-of-type(3) {
  border-left-color: #0f9f8f;
}

#trend .analysis-section:nth-of-type(4) {
  border-left-color: #f5a623;
}

#trend .analysis-section:nth-of-type(5) {
  border-left-color: #34699f;
}

#trend .analysis-section:nth-of-type(6) {
  border-left-color: #2f7d5b;
}

#trend .analysis-section-head {
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4ecf5;
}

#trend .analysis-section-head span {
  width: 32px;
  height: 32px;
  color: #ffffff;
  background: #1a3a5c;
  border-color: #1a3a5c;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(26, 58, 92, 0.16);
}

#trend .analysis-section-head h4 {
  color: #142033;
  font-size: 19px;
  font-weight: 950;
}

#trend .analysis-section-head p {
  color: #6a7788;
  font-size: 13px;
}

#trend .core-metrics-section {
  padding: 12px;
}

#trend .core-metrics-grid {
  gap: 8px;
}

#trend .core-metric {
  min-height: 60px;
  padding: 10px 12px 9px;
  background: #ffffff;
  border-color: #dbe7f6;
  border-radius: 8px;
  box-shadow: none;
}

#trend .core-metric::before {
  height: 3px;
  background: #1d75f0;
}

#trend .core-metric:nth-child(4n + 2)::before {
  background: #f5a623;
}

#trend .core-metric:nth-child(4n + 3)::before {
  background: #0f9f8f;
}

#trend .core-metric:nth-child(4n)::before {
  background: #2f7d5b;
}

#trend .core-metric span {
  color: #647083;
  font-size: 12px;
}

#trend .core-metric strong {
  color: #071a33;
  font-size: clamp(15px, 1vw, 19px);
}

#trend .core-metric-field-brand strong,
#trend .core-metric-field-manufacturer strong,
#trend .core-metric-field-is_ad strong,
#trend .core-metric-field-category strong,
#trend .core-metric-field-rocket_badge strong,
#trend .core-metric-field-delivery_time strong {
  font-family: var(--font);
  font-size: clamp(14px, 0.95vw, 18px);
  font-weight: 780;
  line-height: 1.25;
}

#trend .core-metric-field-category strong {
  font-size: clamp(14px, 0.9vw, 17px);
  font-weight: 800;
}

#trend .core-metric-field-delivery_time {
  grid-column: span 1;
}

#trend .category-analysis-grid {
  grid-template-columns: 1.05fr 1fr 0.95fr;
  gap: 14px;
}

#trend .category-analysis-grid article,
#trend .trend-analysis-layout article,
#trend .trend-mini-chart,
#trend .ai-conclusion-card,
#trend .risk-card,
#trend .advice-grid article {
  background:
    linear-gradient(180deg, #ffffff, #f9fbfe);
  border: 1px solid #dce7f3;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(18, 40, 68, 0.045);
}

#trend .category-analysis-grid article {
  min-height: 124px;
  padding: 16px;
}

#trend .category-analysis-grid article > span,
#trend .trend-analysis-layout article span {
  color: #59687b;
}

#trend .keyword-summary-row strong {
  color: #142033;
  font-size: 22px;
}

#trend .trend-analysis-layout {
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
}

#trend .trend-mini-chart {
  padding: 16px;
}

#trend .trend-hot-keywords {
  margin-top: 14px;
  background:
    linear-gradient(180deg, #ffffff, #f9fbfe);
  border-color: #dce7f3;
  border-left-color: #f5a623;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(18, 40, 68, 0.045);
}

#trend .trend-hot-keyword-list span {
  border-color: #d6e2ef;
  box-shadow: none;
}

#trend .conclusion-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

#trend .advice-grid {
  gap: 12px;
}

@media (max-width: 1180px) {
  #trend .analysis-hero,
  #trend .trend-analysis-layout,
  #trend .conclusion-grid,
  #trend .category-analysis-grid {
    grid-template-columns: 1fr;
  }

  #trend .analysis-section-head {
    align-items: flex-start;
  }

  #trend .analysis-section-head p {
    text-align: left;
  }
}

@media (max-width: 640px) {
  #trend .product-dashboard-summary {
    padding: 12px;
  }

  #trend .analysis-hero,
  #trend .analysis-section {
    padding: 14px;
  }

  #trend .analysis-product-brief,
  #trend .analysis-score-card {
    grid-template-columns: 1fr;
  }
}

/* Collapsible product analysis panels */
#trend .analysis-collapse {
  overflow: hidden;
}

#trend .analysis-collapse[data-analysis-section="category"] {
  border-left-color: #0f9f8f;
}

#trend .analysis-collapse[data-analysis-section="trend"] {
  border-left-color: #f5a623;
}

#trend .analysis-collapse[data-analysis-section="conclusion"] {
  border-left-color: #34699f;
}

#trend .analysis-collapse[data-analysis-section="advice"] {
  border-left-color: #2f7d5b;
}

#trend .analysis-collapse > .analysis-section-head {
  display: grid;
  grid-template-columns: minmax(180px, max-content) minmax(0, 1fr) 34px;
  align-items: center;
  margin: 0;
  padding: 0 0 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

#trend .analysis-collapse > .analysis-section-head::-webkit-details-marker {
  display: none;
}

#trend .analysis-collapse:not([open]) > .analysis-section-head {
  padding-bottom: 0;
  border-bottom: 0;
}

#trend .analysis-collapse > .analysis-section-head p {
  justify-self: end;
  margin: 0;
}

#trend .collapse-indicator {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  justify-self: end;
  color: #17365a;
  background: #f5f8fc;
  border: 1px solid #d8e4f1;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(18, 40, 68, 0.06);
}

#trend .collapse-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.18s ease;
}

#trend .analysis-collapse[open] > .analysis-section-head .collapse-indicator::before {
  transform: rotate(225deg) translate(-1px, -1px);
}

#trend .analysis-section-body {
  margin-top: 14px;
}

#trend .analysis-collapse:not([open]) {
  background: #fbfdff;
  box-shadow: 0 8px 18px rgba(18, 40, 68, 0.045);
}

.core-metric-groups {
  display: grid;
  gap: 8px;
}

.core-metric-group {
  overflow: hidden;
  background: #f8fbff;
  border: 1px solid #cfe0f5;
  border-radius: 12px;
  box-shadow: none;
}

.core-metric-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
}

.core-metric-group-head::-webkit-details-marker {
  display: none;
}

.core-metric-group-head div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.core-metric-group-head span {
  color: #001529;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
}

.core-metric-group-head small {
  overflow: hidden;
  color: #36506f;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-metric-group-head b {
  display: inline-flex;
  min-width: 34px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  color: #0f5ec7;
  background: #ffffff;
  border: 1px solid #d6e6ff;
  border-radius: 999px;
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 900;
}

.core-metric-group-head i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #2f5f99;
  background: #ffffff;
  border: 1px solid #d6e6ff;
  border-radius: 999px;
}

.core-metric-group-head i::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.18s ease;
}

.core-metric-group[open] > .core-metric-group-head i::before {
  transform: rotate(225deg) translate(-1px, -1px);
}

.core-metric-group > .core-metrics-grid {
  padding: 0 8px 8px;
}

.core-metric-group:not([open]) {
  background: #ffffff;
}

.core-metric-group:not([open]) > .core-metric-group-head {
  min-height: 48px;
}

@media (max-width: 1180px) {
  #trend .analysis-collapse > .analysis-section-head {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  #trend .analysis-collapse > .analysis-section-head p {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    text-align: left;
  }

  #trend .collapse-indicator {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .core-metric-group-head {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .core-metric-group-head b {
    display: none;
  }
}

/* Hot keyword board redesign */
#trend.seasonality-panel {
  overflow: hidden;
  background: #f3f6fa;
  border-color: #dbe4ee;
  box-shadow: 0 12px 30px rgba(18, 40, 68, 0.06);
}

#trend .seasonality-head {
  padding: 18px 24px 8px;
  color: #071a33;
  background: transparent;
  border-bottom: 0;
}

#trend .seasonality-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #071a33;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

#trend .source-pill {
  color: #174a83;
  background: #ffffff;
  border-color: #dbe5f0;
  box-shadow: none;
}

#trend .trend-search-form {
  grid-template-columns: minmax(260px, 1fr) 142px 142px minmax(260px, 420px) 220px 136px;
  align-items: end;
  gap: 12px;
  justify-content: start;
  margin: 0 20px 12px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #dbe5f0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 6px 16px rgba(18, 40, 68, 0.035);
}

#trend .trend-form-title {
  display: grid;
  min-width: 0;
  align-self: stretch;
  align-content: center;
  gap: 5px;
  padding-right: 10px;
  border-right: 0;
}

#trend .trend-form-title h2 {
  margin: 0;
  color: #071a33;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
}

#trend .trend-form-title p {
  margin: 0;
  overflow: visible;
  color: #60718a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  text-overflow: clip;
  white-space: normal;
}

#trend .trend-form-title .source-pill {
  width: fit-content;
  min-height: 24px;
  padding: 2px 8px;
  font-size: 12px;
}

#trend .trend-date-field,
#trend .trend-keyword-field,
#trend .trend-page-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

#trend .trend-date-field label,
#trend .trend-keyword-field label,
#trend .trend-page-field label {
  color: #233b59;
  font-size: 13px;
  font-weight: 900;
}

#trend .trend-date-field input,
#trend .trend-keyword-field select,
#trend .trend-page-field input,
#trend .trend-page-field select {
  width: 100%;
  height: 40px;
  color: #071a33;
  background: #fbfdff;
  border: 1px solid #d6e1ed;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
}

#trend .trend-page-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

#trend .trend-page-controls > button {
  flex: 0 0 34px;
  width: 34px;
  height: 40px;
  color: #183b62;
  background: #f6f9fc;
  border: 1px solid #d6e1ed;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 950;
  box-shadow: none;
}

#trend .trend-page-controls button:disabled {
  cursor: not-allowed;
  color: #9aa8ba;
  background: #f1f5f9;
}

#trend .trend-page-controls input[type="hidden"] {
  display: none;
}

#trend .trend-page-controls > select {
  flex: 0 0 78px;
  width: 78px;
}

#trend .trend-hot-keyword-export-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 66px;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  color: #0f5ca8;
  background: #eef7ff;
  border: 1px solid #cfe7ff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
}

#trend .trend-hot-keyword-export-button:hover:not(:disabled) {
  color: #084a8c;
  background: #e1f1ff;
  border-color: #9dd0f8;
}

#trend .trend-hot-keyword-export-button:disabled {
  cursor: not-allowed;
  color: #9aa8ba;
  background: #f1f5f9;
  border-color: #dce5ee;
}

#trend .trend-hot-keyword-export-button.is-loading span:first-child {
  animation: seasonality-export-spin 0.8s linear infinite;
}

@keyframes seasonality-export-spin {
  to { transform: rotate(360deg); }
}

#trend .trend-page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

#trend .trend-page-number,
#trend .trend-page-ellipsis {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 6px;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 850;
  line-height: 30px;
  text-align: center;
}

#trend .trend-page-number {
  color: #183b62;
  background: #ffffff;
  border: 1px solid #d6e1ed;
  cursor: pointer;
}

#trend .trend-page-number:hover:not(:disabled) {
  color: #9a5c00;
  border-color: #f5a623;
  background: #fffaf0;
}

#trend .trend-page-controls .trend-page-number.is-active,
#trend .trend-page-controls .trend-page-number.is-active:disabled {
  color: #ffffff;
  background: #f5a623;
  border-color: #f5a623;
  cursor: default;
}

#trend .trend-page-ellipsis {
  color: #718096;
  border: 1px solid transparent;
}

#trend .trend-keyword-field select:focus,
#trend .trend-page-field input:focus,
#trend .trend-page-field select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

#trend .trend-search-form > button {
  height: 40px;
  color: #ffffff;
  background: #183b62;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(24, 59, 98, 0.12);
}

#trend .seasonality-insights {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0 20px 12px;
  padding: 10px 8px;
  background:
    linear-gradient(90deg, rgba(79, 124, 255, 0.055), rgba(21, 184, 166, 0.045) 52%, rgba(245, 158, 11, 0.055)),
    #ffffff;
  border: 1px solid #dbe5f0;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 18px rgba(18, 40, 68, 0.035);
}

#trend .seasonality-insights article {
  position: relative;
  --metric-accent: #4f7cff;
  min-height: 58px;
  padding: 6px 18px 7px 24px;
  background: transparent;
  border: 0;
  border-left: 1px solid #e5edf5;
  border-radius: 0;
  box-shadow: none;
}

#trend .seasonality-insights article::before {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 10px;
  width: 4px;
  background: var(--metric-accent);
  border-radius: 999px;
}

#trend .seasonality-insights article:first-child {
  border-left: 0;
}

#trend .seasonality-insights article:nth-child(2) {
  --metric-accent: #16a34a;
}

#trend .seasonality-insights article:nth-child(3) {
  --metric-accent: #f59e0b;
}

#trend .seasonality-insights article:nth-child(4) {
  --metric-accent: #ef4444;
}

#trend .seasonality-insights article:nth-child(5) {
  --metric-accent: #8b5cf6;
}

#trend .seasonality-insights span {
  color: #60718a;
  font-size: 12px;
  font-weight: 850;
}

#trend .seasonality-insights strong {
  margin-top: 4px;
  color: #071a33;
  font-family: var(--font-number);
  font-size: 22px;
  font-weight: 950;
}

#trend .seasonality-insights p,
#trend .seasonality-hot-keywords {
  display: none;
}

#trend .seasonality-body {
  display: block;
  padding: 0 20px 22px;
  background: transparent;
}

#trend .seasonality-chart-card {
  padding: 14px;
  background:
    linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid #dbe5f0;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(18, 40, 68, 0.035);
}

#trend .seasonality-legend {
  min-height: 24px;
  margin-bottom: 10px;
}

#trend .seasonality-legend span {
  color: #071a33;
  font-size: 13px;
}

#trend .seasonality-legend i {
  background:
    linear-gradient(180deg, #4f7cff, #15b8a6);
}

#trend .seasonality-chart {
  min-height: 312px;
  padding: 0;
  background: #ffffff;
  border: 0;
  border-radius: 0;
}

#trend .category-hot-keyword-chart {
  overflow: auto;
}

#trend .category-hot-keyword-board {
  min-width: 760px;
  gap: 0;
}

#trend .category-hot-keyword-range-trend {
  display: grid;
  gap: 4px;
  padding: 12px 14px 6px;
  background:
    linear-gradient(135deg, rgba(79, 124, 255, 0.08), rgba(21, 184, 166, 0.04) 58%, rgba(245, 158, 11, 0.045)),
    #ffffff;
  border-bottom: 1px solid #e8eef6;
}

#trend .category-hot-keyword-range-trend > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#trend .category-hot-keyword-range-trend strong {
  color: #071a33;
  font-size: 13px;
  font-weight: 950;
}

#trend .category-hot-keyword-range-trend span {
  color: #60718a;
  font-size: 12px;
  font-weight: 800;
}

#trend .category-hot-keyword-range-trend svg {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
}

#trend .category-hot-keyword-range-trend polygon {
  fill: url("#hotKeywordRangeArea");
}

#trend .category-hot-keyword-range-trend polyline {
  fill: none;
  stroke: url("#hotKeywordRangeLine");
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
}

#trend .category-hot-keyword-range-trend .range-dot {
  fill: #5967ff;
  stroke: #ffffff;
  stroke-width: 2.4;
  transition: r 0.16s ease, fill 0.16s ease, stroke-width 0.16s ease;
}

#trend .category-hot-keyword-range-trend .range-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

#trend .category-hot-keyword-range-trend .range-point {
  cursor: default;
  outline: none;
}

#trend .category-hot-keyword-range-trend .range-point-guide {
  opacity: 0;
  stroke: rgba(79, 124, 255, 0.38);
  stroke-dasharray: 4 4;
  stroke-width: 1.2;
  transition: opacity 0.16s ease;
}

#trend .category-hot-keyword-range-trend .range-point-label {
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 12px 24px rgba(29, 43, 68, 0.14));
  transition: opacity 0.16s ease;
}

#trend .category-hot-keyword-range-trend .range-point-label-card {
  fill: rgba(255, 255, 255, 0.96);
  stroke: #d8e5f6;
  stroke-width: 1;
}

#trend .category-hot-keyword-range-trend .range-point-label-accent {
  fill: url("#hotKeywordRangeLine");
}

#trend .category-hot-keyword-range-trend .range-point-label-dot {
  fill: #15b8a6;
  stroke: #ffffff;
  stroke-width: 1.4;
}

#trend .category-hot-keyword-range-trend .range-point-label text {
  font-family: var(--font);
  letter-spacing: 0;
}

#trend .category-hot-keyword-range-trend .range-point-date {
  fill: #1f3656;
  font-size: 10.5px;
  font-weight: 950;
}

#trend .category-hot-keyword-range-trend .range-point-title {
  fill: #7a8a9f;
  font-size: 8.4px;
  font-weight: 800;
}

#trend .category-hot-keyword-range-trend .range-point-value {
  fill: #0f2747;
  font-size: 16px;
  font-weight: 950;
}

#trend .category-hot-keyword-range-trend .range-point:hover .range-point-guide,
#trend .category-hot-keyword-range-trend .range-point:focus .range-point-guide,
#trend .category-hot-keyword-range-trend .range-point:hover .range-point-label,
#trend .category-hot-keyword-range-trend .range-point:focus .range-point-label {
  opacity: 1;
}

#trend .category-hot-keyword-range-trend .range-point:hover .range-dot,
#trend .category-hot-keyword-range-trend .range-point:focus .range-dot {
  r: 5.6px;
  fill: #15b8a6;
  stroke-width: 3;
}

#trend .category-hot-keyword-range-trend .range-grid-line {
  stroke: #e8eef6;
  stroke-width: 1;
}

#trend .category-hot-keyword-range-trend .range-axis-line,
#trend .category-hot-keyword-range-trend .range-axis-tick {
  stroke: #cbd8e8;
  stroke-width: 1.2;
}

#trend .category-hot-keyword-range-trend .range-axis-label {
  fill: #7b8ba3;
  font-size: 11px;
  font-weight: 800;
}

#trend .category-hot-keyword-range-trend .range-axis-title {
  fill: #30435f;
  font-size: 12px;
  font-weight: 900;
}

#trend .category-hot-keyword-table {
  table-layout: fixed;
  background: #ffffff;
}

#trend .category-hot-keyword-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: #1f3656;
  background: #ffffff;
  border: 1px solid #dce8f5;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}

#trend .category-hot-keyword-board-head strong {
  font-size: 13px;
  font-weight: 950;
}

#trend .category-hot-keyword-board-head span {
  color: #60718a;
  font-size: 12px;
  font-weight: 850;
}

#trend .category-hot-keyword-table-scroll {
  max-height: min(62vh, 720px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dce8f5;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 22px rgba(20, 44, 78, 0.04);
}

#trend .category-hot-keyword-table th {
  top: 0;
  padding: 10px 12px;
  background: #f5f8fc;
  font-size: 12px;
}

#trend .category-hot-keyword-table td {
  height: 42px;
  padding: 9px 12px;
  color: #1f3148;
  font-size: 14px;
}

#trend .category-hot-keyword-table th:nth-child(1),
#trend .category-hot-keyword-table td:nth-child(1) {
  width: 96px;
}

#trend .category-hot-keyword-table th:nth-child(2),
#trend .category-hot-keyword-table td:nth-child(2) {
  width: 24%;
}

#trend .category-hot-keyword-table th:nth-child(3),
#trend .category-hot-keyword-table td:nth-child(3) {
  width: 34%;
}

#trend .category-hot-keyword-table th:nth-child(4),
#trend .category-hot-keyword-table td:nth-child(4),
#trend .category-hot-keyword-table th:nth-child(5),
#trend .category-hot-keyword-table td:nth-child(5) {
  width: 150px;
}

#trend .category-hot-keyword-table th span {
  font-size: 12px;
}

#trend .category-hot-keyword-table th small,
#trend .category-hot-keyword-table td small {
  font-size: 11.5px;
}

#trend .category-hot-keyword-table strong {
  font-size: 15px;
}

#trend .category-hot-keyword-table .rank-pill,
#trend .category-hot-keyword-table .change-pill,
#trend .category-hot-keyword-table .type-pill {
  min-width: 38px;
  min-height: 24px;
  padding: 0 9px;
  font-size: 12px;
}

#trend .category-hot-keyword-table tbody tr:nth-child(2n) {
  background: #fbfdff;
}

#trend .category-hot-keyword-table tbody tr:hover {
  background: #f1f7ff;
}

#trend .category-hot-keyword-empty {
  min-height: 356px;
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(248, 250, 253, 0.72), rgba(255, 255, 255, 0.95)),
    #ffffff;
}

#trend .category-hot-keyword-status {
  max-width: 520px;
  margin: auto;
  background: #fffaf2;
  border-color: #fed7aa;
  border-radius: 8px;
}

@media (max-width: 1020px) {
  #trend .trend-search-form {
    grid-template-columns: 1fr 1fr;
  }

  #trend .trend-form-title {
    grid-column: 1 / -1;
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid #dce7f2;
  }

  #trend .trend-search-form > button {
    grid-column: 1 / -1;
  }

  #trend .seasonality-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #trend .seasonality-insights article:nth-child(odd) {
    border-left: 0;
  }
}

@media (max-width: 640px) {
  #trend .seasonality-head {
    padding: 18px 16px 12px;
  }

  #trend .trend-search-form,
  #trend .seasonality-insights,
  #trend .seasonality-body {
    margin-right: 12px;
    margin-left: 12px;
  }

  #trend .trend-search-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  #trend .trend-form-title p {
    white-space: normal;
  }

  #trend .seasonality-insights {
    grid-template-columns: 1fr;
  }

  #trend .seasonality-insights article {
    border-top: 1px solid #e5edf5;
    border-left: 0;
  }

  #trend .seasonality-insights article:first-child {
    border-top: 0;
  }

  #trend .seasonality-body {
    padding-right: 0;
    padding-left: 0;
  }
}

/* Product dashboard trend insight polish */
#trend .trend-analysis-card {
  background:
    linear-gradient(180deg, #ffffff, #f7fbff);
  border-color: #d7e4f1;
  border-left: 3px solid #f5a623;
}

#trend .trend-analysis-card > .analysis-section-head {
  min-height: 58px;
}

#trend .trend-analysis-layout {
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 16px;
}

#trend .trend-insight-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 20px 22px;
  background:
    linear-gradient(135deg, rgba(245, 166, 35, 0.1), transparent 42%),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  border: 1px solid #d8e4f1 !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 26px rgba(18, 40, 68, 0.07) !important;
}

#trend .trend-insight-card span {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 3px 9px;
  color: #174a83 !important;
  background: #edf6ff;
  border: 1px solid #cfe3fa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

#trend .trend-insight-card strong {
  margin-top: 12px;
  color: #071a33;
  font-family: var(--font-number);
  font-size: 32px;
  font-weight: 950;
  line-height: 1.1;
}

#trend .trend-insight-card small {
  display: block;
  margin-top: 10px;
  color: #233b59;
  font-size: 12px;
  font-weight: 900;
}

#trend .trend-insight-card p {
  max-width: 640px;
  margin-top: 14px;
  color: #526172;
  font-size: 13px;
  line-height: 1.72;
}

#trend .trend-change-chart {
  display: block;
  min-height: 168px;
  padding: 20px 22px;
  background:
    linear-gradient(180deg, rgba(67, 136, 255, 0.08), rgba(255, 255, 255, 0) 60%),
    #ffffff !important;
  border: 1px solid #d8e4f1 !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 26px rgba(18, 40, 68, 0.07) !important;
}

#trend .trend-change-meter-list {
  display: grid;
  height: 100%;
  min-height: 128px;
  align-content: center;
  gap: 14px;
}

#trend .trend-change-meter {
  display: grid;
  gap: 7px;
}

#trend .trend-change-meter > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#trend .trend-change-meter span {
  color: #526172;
  font-size: 12px;
  font-weight: 900;
}

#trend .trend-change-meter strong {
  color: #071a33;
  font-family: var(--font-number);
  font-size: 14px;
  font-weight: 950;
}

#trend .trend-change-meter i {
  display: block;
  height: 9px;
  overflow: hidden;
  background: #edf2f7;
  border-radius: 999px;
}

#trend .trend-change-meter i::before {
  display: block;
  width: var(--meter-width);
  height: 100%;
  background: linear-gradient(90deg, #ffc36a, #f59e0b);
  border-radius: inherit;
  content: "";
}

#trend .trend-change-meter.up i::before {
  background: linear-gradient(90deg, #5ee0ad, #13b981);
}

#trend .trend-change-meter.down i::before {
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
}

#trend .trend-change-meter.same i::before {
  background: linear-gradient(90deg, #94a3b8, #64748b);
}

#trend .trend-hot-keywords {
  margin-top: 16px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #d8e4f1;
  border-top: 2px solid #f5a623;
  border-left: 1px solid #d8e4f1;
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(18, 40, 68, 0.06);
}

#trend .trend-hot-keywords > div:first-child {
  padding-bottom: 4px;
}

#trend .trend-hot-keywords strong {
  color: #071a33;
  font-size: 14px;
}

#trend .trend-hot-keyword-list {
  gap: 8px;
}

#trend .trend-hot-keyword-list span {
  min-height: 30px;
  padding: 5px 10px;
  color: #123052;
  background: #f7fbff;
  border-color: #d6e5f5;
  border-radius: 999px;
  font-size: 12px;
}

#trend .trend-hot-keyword-list i {
  display: inline-flex;
  min-width: 34px;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  color: #087f73;
  background: #e8fbf7;
  border-radius: 999px;
}

@media (max-width: 1040px) {
  #trend .trend-analysis-layout {
    grid-template-columns: 1fr;
  }
}

/* Product dashboard AI conclusion and action advice polish */
#trend .conclusion-section {
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  border-color: #d7e4f1;
  border-left: 3px solid #2563eb;
}

#trend .ai-source-status {
  display: inline-flex;
  width: auto;
  height: auto;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  margin-left: auto;
  padding: 3px 10px;
  color: #2457c5;
  background: #eef5ff;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.4;
  white-space: nowrap;
}

#trend .ai-source-status[hidden] {
  display: none;
}

#trend .ai-source-status[data-tone="ready"] {
  color: #0f766e;
  background: #e9fbf6;
  border-color: #bdeee4;
}

#trend .ai-source-status[data-tone="loading"] {
  color: #8a5a00;
  background: #fff8e6;
  border-color: #f5ddb0;
}

#trend .ai-source-status[data-tone="loading"]::before {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  background: currentColor;
  border-radius: 999px;
  content: "";
  animation: aiStatusPulse 1s ease-in-out infinite;
}

#trend .ai-source-status[data-tone="error"] {
  color: #b42318;
  background: #fff1f0;
  border-color: #ffd0cc;
}

#trend .conclusion-grid.is-loading .ai-conclusion-card {
  opacity: 0.82;
}

@keyframes aiStatusPulse {
  0%,
  100% {
    transform: scale(0.75);
    opacity: 0.45;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

#trend .advice-section {
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  border-color: #d7e4f1;
  border-left: 3px solid #13b981;
}

#trend .conclusion-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
  gap: 16px;
}

#trend .ai-conclusion-card,
#trend .risk-card {
  position: relative;
  overflow: hidden;
  min-height: 176px;
  padding: 22px 24px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(18, 40, 68, 0.07);
}

#trend .ai-conclusion-card {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  border: 1px solid #d7e5fb !important;
}

#trend .ai-conclusion-card::before,
#trend .risk-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  content: "";
}

#trend .ai-conclusion-card::before {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

#trend .risk-card {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, #ffffff, #fffaf2) !important;
  border: 1px solid #f2dfbf !important;
}

#trend .risk-card::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

#trend .ai-conclusion-card > strong,
#trend .risk-card > strong {
  display: block;
  color: #071a33;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

#trend .ai-conclusion-card > p {
  max-width: 860px;
  margin-top: 10px;
  color: #344761;
  font-size: 13px;
  line-height: 1.75;
}

#trend .decision-proof-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

#trend .decision-proof-list span {
  position: static;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 8px 11px;
  color: #17365a;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #dce9f8;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

#trend .decision-proof-list span::before {
  position: static;
  top: auto;
  left: auto;
  flex: 0 0 17px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: #0f9f61;
  background: #e8f9f0;
  border-radius: 999px;
  content: "✓";
  font-size: 11px;
  font-weight: 950;
}

#trend .risk-card ul {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

#trend .risk-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #5a3d0a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
}

#trend .risk-card li::before {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  background: #f59e0b;
  border-radius: 999px;
  content: "";
}

#trend .advice-grid {
  counter-reset: advice-step;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

#trend .advice-grid article {
  position: relative;
  min-height: 156px;
  padding: 18px 16px 16px;
  background:
    linear-gradient(135deg, rgba(19, 185, 129, 0.08), transparent 46%),
    linear-gradient(180deg, #ffffff, #f8fbff) !important;
  border: 1px solid #d8e7f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 26px rgba(18, 40, 68, 0.06) !important;
}

#trend .advice-grid article::before {
  counter-increment: advice-step;
  display: inline-flex;
  min-width: 34px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: #0f766e;
  background: #e8fbf7;
  border: 1px solid #bdeee4;
  border-radius: 999px;
  content: "0" counter(advice-step);
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 950;
}

#trend .advice-grid strong {
  display: block;
  color: #071a33;
  font-size: 15px;
  font-weight: 950;
}

#trend .advice-grid p {
  margin-top: 8px;
  color: #526172;
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 1280px) {
  #trend .advice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  #trend .conclusion-grid,
  #trend .advice-grid {
    grid-template-columns: 1fr;
  }
}
/* Workflow image-search product rows */
.product-list-panel .product-list.product-search-table-view,
.same-search-results.product-search-table-view {
  display: block !important;
  overflow: hidden;
  padding: 0 !important;
  background: #ffffff !important;
}

.same-search-page {
  overflow: hidden;
}

.same-search-head {
  align-items: center;
  gap: 18px;
}

.same-search-head > div:first-child {
  min-width: 0;
}

.same-search-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.same-search-limit-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.same-search-number-field {
  display: grid;
  width: 88px;
  gap: 4px;
  margin: 0;
}

.same-search-number-field > span {
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.same-search-number-field input[type="number"] {
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 6px 8px;
  color: #17365a;
  background: #ffffff;
  border: 1px solid #c9d8e8;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.same-search-number-field input[type="number"]:focus {
  border-color: #1677ff;
  outline: 2px solid rgba(22, 119, 255, 0.18);
  outline-offset: 1px;
}

.same-search-results {
  overflow: hidden;
  border-top: 1px solid #d9e5f2;
}

.same-search-results.empty {
  padding: 24px;
  color: #64748b;
  font-size: 13px;
}

.same-search-results.same-search-card-view {
  display: block !important;
  padding: 0 !important;
  background: #f4f7fb;
}

.same-search-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.same-search-source-card {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 9px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #d9e4ef;
  border-radius: 7px;
  box-shadow: 0 5px 14px rgba(21, 49, 78, 0.05);
}

.same-search-source-card.is-selected {
  border-color: #2d7fd3;
  box-shadow: 0 0 0 2px rgba(45, 127, 211, 0.12), 0 7px 18px rgba(21, 49, 78, 0.08);
}

.same-search-source-check {
  top: 14px;
  left: 14px;
  z-index: 2;
}

.same-search-source-image {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #dbe5ef;
}

.same-search-source-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.same-search-source-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.same-search-source-copy strong,
.same-search-source-copy small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.same-search-source-copy strong {
  min-height: 38px;
  color: #17365a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

.same-search-source-copy small {
  min-height: 17px;
  color: #67768a;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
  -webkit-line-clamp: 1;
}

.same-search-source-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.same-search-source-meta .pill {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 7px;
  color: #19548d;
  background: #edf6ff;
  border: 1px solid #c9e2f7;
  border-radius: 999px;
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
}

.same-search-source-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  border-top: 1px solid #e6edf5;
  border-bottom: 1px solid #e6edf5;
}

.same-search-source-stats > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 8px 6px;
  border-right: 1px solid #e6edf5;
}

.same-search-source-stats > span:last-child {
  border-right: 0;
}

.same-search-source-stats small {
  color: #718096;
  font-size: 10px;
  font-weight: 800;
}

.same-search-source-stats strong {
  overflow: hidden;
  color: #17365a;
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.same-search-source-actions {
  display: grid;
  min-height: 34px;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 7px;
  align-items: stretch;
}

.same-search-source-actions .product-row-image-search-button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
}

.same-search-source-actions .product-row-same-result-wrap {
  width: 58px;
  min-width: 58px;
  height: 34px;
  align-items: center;
}

.same-search-source-actions .product-row-same-result,
.same-search-source-actions .same-result-show-button {
  max-height: 34px;
}

html[data-theme="dark"] .same-search-results.same-search-card-view {
  background: #101821;
}

html[data-theme="dark"] .same-search-source-card {
  background: #17212c;
  border-color: #334354;
}

html[data-theme="dark"] .same-search-source-copy strong,
html[data-theme="dark"] .same-search-source-stats strong {
  color: #e7eef7;
}

html[data-theme="dark"] .same-search-source-copy small,
html[data-theme="dark"] .same-search-source-stats small {
  color: #9eacbc;
}

@media (max-width: 1280px) {
  .same-search-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .same-search-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .same-search-card-grid {
    grid-template-columns: 1fr;
  }
}

.product-search-table-summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  color: #526579;
  background: #f8fbff;
  border-bottom: 1px solid #d9e5f2;
  font-size: 12px;
}

.product-search-table-summary strong {
  color: #17365a;
  font-size: 13px;
  font-weight: 950;
}

.product-search-table-summary-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.same-search-batch-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.same-search-batch-actions > span {
  min-width: 72px;
  color: #526579;
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.same-search-batch-actions .text-button,
.same-search-batch-actions .primary-button {
  min-width: 88px;
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.product-search-table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.product-search-row-table {
  width: 100%;
  min-width: 1350px;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: separate;
  color: #172a43;
  font-size: 12px;
}

.product-search-row-table .row-col-select { width: 48px; }
.product-search-row-table .row-col-rank { width: 48px; }
.product-search-row-table .row-col-image { width: 64px; }
.product-search-row-table .row-col-pid { width: 112px; }
.product-search-row-table .row-col-title { width: 310px; }
.product-search-row-table .row-col-price { width: 104px; }
.product-search-row-table .row-col-rating { width: 72px; }
.product-search-row-table .row-col-reviews { width: 82px; }
.product-search-row-table .row-col-brand { width: 106px; }
.product-search-row-table .row-col-sales { width: 86px; }
.product-search-row-table .row-col-clicks { width: 88px; }
.product-search-row-table .row-col-conversion { width: 82px; }
.product-search-row-table .row-col-delivery { width: 120px; }
.product-search-row-table .row-col-search { width: 98px; }
.product-search-row-table .row-col-same-results { width: 92px; }

.product-search-row-table th,
.product-search-row-table td {
  height: 58px;
  padding: 7px 9px;
  overflow: hidden;
  vertical-align: middle;
  background: #ffffff;
  border-bottom: 1px solid #e4ebf3;
  text-overflow: ellipsis;
}

.product-search-row-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 40px;
  color: #44566c;
  background: #eef3f8;
  font-size: 12px;
  font-weight: 950;
  text-align: left;
  white-space: nowrap;
}

.product-search-row-table th:first-child,
.product-search-row-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  box-shadow: 6px 0 10px rgba(31, 50, 72, 0.05);
}

.product-search-row-table th:last-child,
.product-search-row-table tbody tr:not(.product-search-match-row) td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  box-shadow: -7px 0 12px rgba(31, 50, 72, 0.09);
}

.product-search-row-table th:first-child,
.product-search-row-table th:last-child {
  z-index: 5;
  background: #e6edf5;
}

.product-search-row-table tbody tr.is-selected td {
  background: #f1f7ff;
}

.product-search-row-table tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 #2d7fd3;
}

html[data-theme="dark"] .product-search-row-table tbody tr.is-selected td {
  background: #17283a;
}

.product-table-sort-button {
  display: inline-flex;
  width: 100%;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  font: inherit;
  font-weight: 950;
  line-height: 1.2;
  text-align: inherit;
  white-space: nowrap;
}

.product-search-row-table th:nth-child(2) .product-table-sort-button,
.product-search-row-table th:nth-child(7) .product-table-sort-button,
.product-search-row-table th:nth-child(15) .product-table-sort-button {
  justify-content: center;
}

.product-search-row-table th:nth-child(6) .product-table-sort-button,
.product-search-row-table th:nth-child(8) .product-table-sort-button,
.product-search-row-table th:nth-child(10) .product-table-sort-button,
.product-search-row-table th:nth-child(11) .product-table-sort-button,
.product-search-row-table th:nth-child(12) .product-table-sort-button {
  justify-content: flex-end;
}

.product-table-sort-button:hover {
  color: #1677ff;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.product-table-sort-button:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.32);
  outline-offset: 3px;
}

.product-table-sort-button.is-active {
  color: #174a83;
}

.product-table-sort-button i {
  position: relative;
  display: inline-grid;
  width: 10px;
  height: 14px;
  flex: 0 0 10px;
  opacity: 0.42;
}

.product-table-sort-button i::before,
.product-table-sort-button i::after {
  position: absolute;
  left: 2px;
  content: "";
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.product-table-sort-button i::before {
  top: 1px;
  border-bottom: 5px solid #9aa8b6;
}

.product-table-sort-button i::after {
  bottom: 1px;
  border-top: 5px solid #9aa8b6;
}

.product-table-sort-button.is-active i {
  opacity: 1;
}

.product-table-sort-button.is-active[data-direction="asc"] i::before {
  border-bottom-color: #f5a623;
}

.product-table-sort-button.is-active[data-direction="desc"] i::after {
  border-top-color: #f5a623;
}

.product-search-row-table th:nth-child(1),
.product-search-row-table th:nth-child(2),
.product-search-row-table th:nth-child(3),
.product-search-row-table th:nth-child(7),
.product-search-row-table th:nth-child(14),
.product-search-row-table th:nth-child(15),
.product-search-row-table td:nth-child(1),
.product-search-row-table td:nth-child(2),
.product-search-row-table td:nth-child(3),
.product-search-row-table td:nth-child(7),
.product-search-row-table td:nth-child(14),
.product-search-row-table td:nth-child(15) {
  text-align: center;
}

.product-search-row-table th:nth-child(6),
.product-search-row-table th:nth-child(8),
.product-search-row-table th:nth-child(10),
.product-search-row-table th:nth-child(11),
.product-search-row-table th:nth-child(12),
.product-search-row-table td:nth-child(6),
.product-search-row-table td:nth-child(8),
.product-search-row-table td:nth-child(10),
.product-search-row-table td:nth-child(11),
.product-search-row-table td:nth-child(12) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}


.product-search-row-table tbody tr:hover td {
  background: #f7fbff;
}

.product-search-row-table tbody tr:last-child td {
  border-bottom: 0;
}

.product-search-row-table .product-search-match-row td {
  height: auto;
  padding-top: 6px;
  padding-bottom: 6px;
  background: #effaf6;
  border-bottom-color: #b9dfd1;
  text-align: left;
}

.product-search-row-table .product-search-match-row:hover td {
  background: #e6f6f0;
}

.product-search-row-table .product-search-match-row.is-selected td {
  background: #e2f7ef;
}

.product-search-match-check {
  display: grid;
  width: 100%;
  place-items: center;
  cursor: pointer;
}

.product-search-match-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #1677ff;
}

.product-search-match-check span {
  display: none;
}

.product-search-match-indent {
  position: relative;
  text-align: center !important;
}

.product-search-match-indent::before {
  position: absolute;
  top: -7px;
  right: 10px;
  bottom: 50%;
  left: 50%;
  border-bottom: 1px solid #8fc7b5;
  border-left: 1px solid #8fc7b5;
  content: "";
}

.product-search-match-rank {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #176f63;
  background: #ffffff;
  border: 1px solid #8fc7b5;
  border-radius: 50%;
  font-family: var(--font-number);
  font-size: 10px;
  font-weight: 900;
}

.product-search-match-image {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  overflow: hidden;
  place-items: center;
  cursor: zoom-in;
  background: #ffffff;
  border: 1px solid #cfe3dc;
  border-radius: 4px;
}

.product-search-match-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-search-match-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-search-match-copy a,
.product-search-match-copy strong {
  overflow: hidden;
  color: #183b34;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-search-match-copy small {
  overflow: hidden;
  color: #5e756e;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-search-match-price {
  display: block;
  color: #b54422;
  font-family: var(--font-number);
  font-size: 13px;
  white-space: nowrap;
}

.product-search-match-metrics {
  display: grid;
  width: 100%;
  justify-items: end;
  gap: 4px;
}

.product-search-match-score {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 6px;
  color: #ffffff;
  background: #176f63;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.watch-review-query-button {
  color: #176f63;
  background: #e9f7f3;
  border-color: #8bc9ba;
}

.watch-review-query-button:hover:not(:disabled) {
  color: #ffffff;
  background: #176f63;
  border-color: #176f63;
}

.watch-review-query-button.is-busy {
  color: #7a540d;
  background: #fff7e6;
  border-color: #d9b66f;
}

.watch-review-query-button.is-complete {
  color: #174a83;
  background: #edf6ff;
  border-color: #b8d3ef;
}

.product-row-check {
  display: grid;
  width: 100%;
  place-items: center;
  cursor: pointer;
}

.product-row-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #1677ff;
}

.product-row-check span {
  display: none;
}

.product-row-rank {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #295c93;
  background: #edf6ff;
  border: 1px solid #cfe4f8;
  border-radius: 50%;
  font-family: var(--font-number);
  font-weight: 900;
}

.product-row-image {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  overflow: hidden;
  place-items: center;
  background: #ffffff;
  border: 1px solid #dce6f1;
  border-radius: 5px;
}

.product-row-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-row-pid {
  color: #315bd8;
  font-family: var(--font-number);
  font-weight: 850;
  white-space: nowrap;
}

.product-search-row-table .row-col-similarity {
  width: 78px;
}

.row-compare-similarity {
  font-family: var(--font-number);
  font-weight: 850;
  white-space: nowrap;
}

.row-compare-similarity.is-pass {
  color: #1f7a3d;
}

.row-compare-similarity.is-filtered {
  color: #b45309;
}

.row-compare-similarity.is-pending {
  color: #8a94a6;
  font-weight: 500;
}

.row-compare-delta {
  display: block;
  margin-top: 3px;
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.row-compare-delta.is-up {
  color: #d93026;
}

.row-compare-delta.is-down {
  color: #1f7a3d;
}

.row-compare-delta.is-flat {
  color: #8a94a6;
}

.product-row-compare-source {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2f8ff;
  box-shadow: inset 0 -2px 0 #1677ff, 0 2px 6px rgba(15, 42, 82, 0.08);
}

.product-row-compare-source td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.compare-source-rank {
  width: auto;
  min-width: 44px;
  padding: 0 8px;
  border-radius: 13px;
  color: #0b4bb2;
  background: #dcecff;
  border-color: #b7d7f8;
  font-size: 12px;
  white-space: nowrap;
}

.compare-source-badge {
  padding: 2px 8px;
  border-radius: 9px;
  color: #0b4bb2;
  background: #dcecff;
}

.compare-source-title-hint {
  color: #5f7392;
}

.product-row-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-row-title a,
.product-row-title strong,
.product-row-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-row-title a,
.product-row-title strong {
  color: #10243f;
  font-weight: 900;
}

.product-row-title small {
  color: #68778a;
  font-size: 11px;
  font-weight: 750;
}

.product-row-delivery {
  display: grid;
  justify-items: start;
  gap: 3px;
}

.product-row-delivery .delivery-type {
  display: inline-flex;
  max-width: 100%;
  min-height: 22px;
  align-items: center;
  overflow: hidden;
  padding: 2px 7px;
  color: #087d67;
  background: #e8fbf5;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-row-image-search-button {
  min-width: 72px;
  height: 30px;
  color: #ffffff;
  background: #1677ff;
  border-color: #1677ff;
  border-radius: 5px;
  white-space: nowrap;
}

.product-row-image-search-button:hover {
  color: #ffffff;
  background: #0f65dc;
}

.product-row-image-search-button:disabled {
  cursor: not-allowed;
  color: #8290a3;
  background: #eef2f6;
  border-color: #d9e1eb;
  opacity: 1;
}

.product-row-image-search-button.is-failed {
  color: #a43b35;
  background: #fff1f0;
  border-color: #e7aaa6;
}

.product-row-image-search-button.is-failed:hover:not(:disabled) {
  color: #8d2924;
  background: #ffe4e2;
  border-color: #d98882;
}

.selection-candidate-actions button.is-failed {
  color: #a43b35;
  background: #fff1f0;
  border-color: #e7aaa6;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-card-image-search-button.is-failed,
html[data-theme="dark"] .product-row-image-search-button.is-failed,
html[data-theme="dark"] .selection-candidate-actions button.is-failed {
  color: #f3aaa5;
  background: #351e20;
  border-color: #784044;
}

.product-row-same-result-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.same-result-collapse-button {
  display: inline-grid;
  width: 24px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  color: #176f63;
  background: #e9f7f3;
  border: 1px solid #9bcfbd;
  border-radius: 5px;
  cursor: pointer;
}

.same-result-collapse-button span {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
}

.same-result-collapse-button.is-collapsed span {
  transform: rotate(-135deg) translate(-1px, -1px);
}

.same-result-collapse-button:hover {
  color: #ffffff;
  background: #176f63;
  border-color: #176f63;
}

.product-row-same-result {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: #52627a;
  font-size: 11px;
  line-height: 1.35;
}

.product-row-same-result strong {
  color: #10243f;
  font-size: 12px;
  font-weight: 900;
}

.product-row-same-result.is-empty,
.product-row-same-result.is-pending,
.product-row-same-result.is-loading,
.product-row-same-result.is-error {
  padding: 6px 8px;
  background: #f6f9fc;
  border: 1px solid #e0e8f1;
  border-radius: 5px;
}

.product-row-same-result.is-loading {
  color: #1b64c8;
  background: #edf6ff;
  border-color: #cfe3ff;
}

.product-row-same-result.is-error {
  color: #a03d3d;
  background: #fff5f5;
  border-color: #ffd6d6;
}

.product-row-same-result.is-icon-only {
  display: flex;
  justify-content: center;
  padding: 0;
  color: #1677ff;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.product-row-same-result.is-backfill {
  display: flex;
  width: 100%;
  justify-content: center;
}

.same-result-backfill-button {
  display: inline-flex;
  width: 54px;
  max-width: 100%;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  color: #8a4b08;
  background: #fff4d6;
  border: 1px solid #f2bd55;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.same-result-backfill-button:hover {
  color: #6f3900;
  background: #ffe7ad;
  border-color: #e5a62d;
}

.same-result-backfill-button:focus-visible {
  outline: 2px solid #f6c96b;
  outline-offset: 2px;
}

.same-result-backfill-button:disabled {
  cursor: wait;
  color: #8a6c42;
  background: #f7f0e4;
  border-color: #dfd0b7;
}

.same-result-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.same-result-head > span {
  color: #607089;
  font-size: 10px;
  font-weight: 800;
}

.same-result-head a {
  margin-left: auto;
  color: #1677ff;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.same-result-actions {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.same-result-actions a {
  margin-left: 0;
}

.same-result-show-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #ffffff;
  background: #1677ff;
  border: 1px solid #1677ff;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.same-result-show-button:hover {
  background: #0f65dc;
  border-color: #0f65dc;
}

.same-result-show-button:focus-visible {
  outline: 2px solid #8fbeff;
  outline-offset: 2px;
}

.same-result-show-button:disabled {
  cursor: default;
  color: #8ba0b8;
  background: #f2f6fa;
  border-color: #dce6f1;
}

.product-row-same-result.is-loading .same-result-show-button {
  color: #ffffff;
  background: #4096ff;
  border-color: #4096ff;
  animation: same-result-pulse 1s ease-in-out infinite;
}

@keyframes same-result-pulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

.same-result-show-icon {
  position: relative;
  width: 13px;
  height: 8px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.same-result-show-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  background: currentColor;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.same-result-list {
  display: grid;
  gap: 4px;
}

.same-result-item {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 5px 7px;
  background: #f8fbff;
  border: 1px solid #e3edf8;
  border-radius: 5px;
}

.same-result-item a,
.same-result-item strong {
  display: block;
  overflow: hidden;
  color: #133355;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.same-result-item small {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
  color: #63738a;
  font-size: 10px;
  font-weight: 760;
}

@media (max-width: 760px) {
  .same-search-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .same-search-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .product-search-table-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .same-search-batch-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .same-search-batch-actions > span {
    margin-right: auto;
    text-align: left;
  }
}

body.image-search-table-active .market-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.image-search-table-active .dashboard-column,
body.image-search-table-active #skuSection,
body.image-search-table-active #filterStatusSummary,
body.image-search-table-active #competitorClassifySummary {
  display: none !important;
}

body.image-search-table-active .product-column,
body.image-search-table-active .product-list-panel {
  width: 100%;
  min-width: 0;
}
.model-settings-panel {
  width: min(520px, calc(100vw - 28px));
}

.model-settings-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.model-settings-form label {
  display: grid;
  gap: 7px;
  color: #25354a;
  font-size: 13px;
  font-weight: 800;
}

.model-settings-form input,
.model-settings-form select {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  color: #172438;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
}

.model-settings-form input:focus,
.model-settings-form select:focus {
  border-color: #1677ff;
  outline: 2px solid rgba(22, 119, 255, 0.14);
}

.model-api-key-field {
  width: 100%;
}

.model-api-key-field .password-toggle {
  top: 50%;
}

.model-settings-status {
  min-height: 20px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.model-settings-actions {
  display: flex;
  justify-content: flex-end;
}

/* Dedicated same-product results workspace */
.same-products-page {
  min-height: calc(100vh - 96px);
  overflow: visible;
  color: #1d2b3d;
  background: #ffffff;
  border: 0;
  border-radius: 0;
}

.same-products-head {
  position: static;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #dce5ef;
}

.same-products-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.same-products-heading > div {
  min-width: 0;
}

.same-products-heading h2 {
  margin: 1px 0 0;
  color: #14263d;
  font-size: 19px;
  line-height: 1.25;
}

.same-products-heading > div > p:last-child {
  margin-top: 5px;
  color: #65758a;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.same-products-back-button {
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #244866;
  background: #ffffff;
  border: 1px solid #cbd9e7;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 850;
}

.same-products-back-button:hover,
.same-products-back-button:focus-visible {
  color: #123f70;
  background: #eef5fc;
  border-color: #9fbddd;
}

.same-products-back-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 12px;
  flex: 0 0 auto;
}

.same-products-back-icon::before,
.same-products-back-icon::after {
  position: absolute;
  content: "";
}

.same-products-back-icon::before {
  top: 5px;
  right: 0;
  left: 1px;
  height: 2px;
  background: currentColor;
}

.same-products-back-icon::after {
  top: 2px;
  left: 1px;
  width: 7px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.same-products-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.same-products-limit-controls {
  margin-right: 2px;
}

.same-products-head-actions .text-button,
.same-products-head-actions .primary-button {
  min-height: 38px;
  padding-inline: 14px;
}

.same-products-overview {
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(600px, 1.65fr);
  background: #ffffff;
  border-bottom: 1px solid #dce5ef;
}

.same-products-base-product {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 9px 16px;
  background: #fbfcfe;
  border-right: 1px solid #dce5ef;
}

.same-products-base-image {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  overflow: hidden;
  padding: 4px;
  background: #ffffff;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  cursor: zoom-in;
  appearance: none;
}

.same-products-base-image:hover {
  border-color: #6aa6d8;
  box-shadow: 0 0 0 2px rgba(23, 105, 170, 0.12);
}

.same-products-base-image:focus-visible {
  outline: 3px solid rgba(23, 105, 170, 0.28);
  outline-offset: 2px;
  border-color: #1769aa;
}

.same-products-base-image img {
  transition: transform 160ms ease;
}

.same-products-base-image:hover img,
.same-products-base-image:focus-visible img {
  transform: scale(1.04);
}

.same-products-base-image img,
.same-products-row-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.same-products-base-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.same-products-base-copy > span {
  color: #9a6516;
  font-size: 12px;
  font-weight: 900;
}

.same-products-base-copy > .same-products-base-title {
  display: -webkit-box;
  overflow: hidden;
  color: #172435;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

a.same-products-base-title {
  text-decoration: none;
}

a.same-products-base-title:hover,
a.same-products-base-title:focus-visible {
  color: #1769aa;
  text-decoration: underline;
}

.same-products-base-copy > div {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.same-products-base-copy > div span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  color: #526278;
  background: #f4f7fa;
  border: 1px solid #dfe6ee;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.same-products-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  min-width: 0;
}

.same-products-metrics article {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
}

.same-products-metrics article:first-child {
  border-left: 0;
}

.same-products-metrics article:nth-child(1) {
  border-top: 3px solid #2563a8;
}

.same-products-metrics article:nth-child(2) {
  border-top: 3px solid #0f8a78;
}

.same-products-metrics article:nth-child(3) {
  border-top: 3px solid #d98b21;
}

.same-products-metrics article:nth-child(4) {
  border-top: 3px solid #64748b;
}

.same-products-metrics span {
  color: #6b788a;
  font-size: 12px;
  font-weight: 800;
}

.same-products-metrics strong {
  min-width: 0;
  color: #172435;
  font-family: var(--font-number);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.same-products-service-filter {
  display: grid;
  gap: 10px;
  padding: 12px 20px;
  background: #ffffff;
  border-bottom: 1px solid #dce5ef;
}

.same-products-service-filter[hidden] {
  display: none;
}

.same-products-service-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.same-products-service-filter-head > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.same-products-service-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.same-products-service-filter-head strong {
  color: #172435;
  font-size: 14px;
  font-weight: 900;
}

.same-products-service-filter-head span {
  color: #718096;
  font-size: 12px;
  font-weight: 750;
}

.same-products-service-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
}

.same-products-service-options label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 3px 8px;
  color: #42536a;
  background: #f8fafc;
  border: 1px solid #d7e0ea;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.same-products-service-options label:has(input:checked) {
  color: #174f87;
  background: #eef6ff;
  border-color: #8fbae4;
}

.same-products-service-options label.same-products-shop-years-filter {
  color: #176456;
  background: #eef9f5;
  border-color: #a8d8cc;
}

.same-products-service-options label.same-products-shop-years-filter:has(input:checked) {
  color: #ffffff;
  background: #16816f;
  border-color: #16816f;
}

.same-products-service-options label.same-products-shop-years-filter input {
  accent-color: #16816f;
}

.same-products-service-options label.same-products-shop-years-filter:has(input:checked) input {
  accent-color: #ffffff;
}

.same-products-service-options label.is-super-factory {
  color: #76520f;
  background: #fff6d9;
  border-color: #e4c46f;
}

.same-products-service-options label.is-super-factory:has(input:checked) {
  color: #5f3d00;
  background: #f8e4a4;
  border-color: #c79324;
}

.same-products-service-options label.is-powerful-seller,
.same-products-service-options label.is-powerful-merchant {
  color: #96353c;
  background: #fff0f1;
  border-color: #e9abb0;
}

.same-products-service-options label.is-powerful-seller:has(input:checked),
.same-products-service-options label.is-powerful-merchant:has(input:checked) {
  color: #7f2028;
  background: #ffdadd;
  border-color: #d7626c;
}

.same-products-service-options label.is-super-factory input {
  accent-color: #bd8116;
}

.same-products-service-options label.is-powerful-seller input,
.same-products-service-options label.is-powerful-merchant input {
  accent-color: #c9404d;
}

.same-products-service-options input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #2563a8;
}

.same-products-supplier-match {
  display: flex;
  min-height: 54px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 20px;
  background: #f8fbfa;
  border-bottom: 1px solid #dce5ef;
}

.same-products-supplier-match[hidden] {
  display: none;
}

.same-products-supplier-match-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 360px;
  align-items: baseline;
  gap: 10px;
}

.same-products-supplier-match-copy strong {
  color: #173b35;
  font-size: 14px;
  font-weight: 900;
}

.same-products-supplier-match-copy span {
  overflow: hidden;
  color: #627a76;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.same-products-supplier-match-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.same-products-supplier-segments {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #b9d3cd;
  border-radius: 5px;
}

.same-products-supplier-segments button {
  min-width: 78px;
  height: 30px;
  padding: 0 10px;
  color: #46645f;
  background: #ffffff;
  border: 0;
  border-right: 1px solid #d5e4e0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.same-products-supplier-segments button:last-child {
  border-right: 0;
}

.same-products-supplier-segments button.is-active {
  color: #ffffff;
  background: #16816f;
}

.same-products-supplier-segments button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.same-products-supplier-category-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 20px;
  align-items: center;
  padding: 1px 6px;
  color: #176456;
  background: #e7f6f1;
  border: 1px solid #a8d8cc;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
}

.same-products-supplier-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.same-products-shop-years {
  display: inline-flex;
  width: fit-content;
  min-height: 20px;
  align-items: center;
  padding: 1px 6px;
  color: #31584f;
  background: #f0f7f5;
  border: 1px solid #c7ddd7;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
}

.same-products-shop-tenure {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 3px;
}

.same-products-seller-tag-logo {
  display: block;
  width: 68px;
  height: 16px;
  flex: 0 0 auto;
  object-fit: contain;
}

.same-products-seller-tag {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  padding: 1px 5px;
  color: #ffffff;
  background: #d72f3f;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.same-products-seller-tag.is-powerful-merchant {
  color: #ffffff;
  background: #d72f3f;
}

.same-products-seller-tag.is-super-factory {
  color: #4b3100;
  background: #f4bd26;
}

.same-products-shop-tenure-separator {
  color: rgba(215, 47, 63, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.same-products-shop-tenure.has-seller-tag .same-products-shop-years {
  min-height: 18px;
  padding: 0;
  color: #c92f3d;
  background: transparent;
  border: 0;
}

.same-products-supplier-category {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  color: #46645f;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.same-products-supplier-category select {
  width: clamp(150px, 15vw, 220px);
  height: 30px;
  padding: 0 30px 0 9px;
  color: #173b35;
  background: #ffffff;
  border: 1px solid #b9d3cd;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
}

.same-products-supplier-category select:focus {
  border-color: #16816f;
  outline: 2px solid rgba(22, 129, 111, 0.14);
}

.same-products-supplier-category select:disabled {
  cursor: wait;
  opacity: 0.62;
}

.same-products-table-head {
  display: none;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #dce5ef;
}

.same-products-results-toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #dce5ef;
}

.same-products-results-toolbar > div:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.same-products-results-toolbar strong {
  color: #172435;
  font-size: 15px;
  font-weight: 900;
}

.same-products-results-toolbar > div:first-child span {
  color: #718096;
  font-size: 12px;
  font-weight: 750;
}

.same-products-results-toolbar > div:first-child .same-products-rank-status {
  color: #1f6fba;
}

.same-products-results-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.same-products-results-controls > .same-products-sort-control {
  gap: 6px;
}

.same-products-results-controls > .same-products-sort-control select {
  width: 92px;
  min-width: 92px;
}

.same-products-keyword-rank-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.same-products-keyword-rank-controls .text-button {
  min-height: 36px;
  white-space: nowrap;
}

.same-products-keyword-rank-controls .same-products-sort-control {
  gap: 5px;
}

.same-products-keyword-rank-controls .same-products-sort-control select {
  min-width: 76px;
  width: 76px;
}

.same-products-view-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #c5d2df;
  border-radius: 5px;
}

.same-products-view-switch button {
  min-width: 58px;
  height: 34px;
  padding: 0 10px;
  color: #526278;
  background: #ffffff;
  border: 0;
  border-right: 1px solid #d7e1eb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.same-products-view-switch button:last-child {
  border-right: 0;
}

.same-products-view-switch button.is-active {
  color: #ffffff;
  background: #173a63;
}

.same-products-card-grid {
  display: grid;
  max-height: none;
  min-height: 280px;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
  overflow: visible;
  padding: 14px 20px 22px;
  background: #f3f6f9;
  scrollbar-color: #aebdcd #eef2f6;
  scrollbar-width: thin;
}

.same-products-card-grid[hidden] {
  display: none;
}

.same-products-card {
  display: grid;
  min-width: 0;
  align-content: start;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d5dfe9;
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(23, 42, 66, 0.06);
}

.same-products-card:hover {
  border-color: #9db7d0;
  box-shadow: 0 5px 14px rgba(23, 42, 66, 0.1);
}

.same-products-card.is-preferred {
  border-color: #d5aa45;
  box-shadow: 0 0 0 2px rgba(213, 170, 69, 0.16);
}

.same-products-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f7f9fb;
  border-bottom: 1px solid #e1e8ef;
}

.same-products-card-media > a {
  display: block;
  width: 100%;
  height: 100%;
}

.same-products-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 160ms ease;
}

.same-products-card-media img[data-image-preview],
.same-products-row-image img[data-image-preview] {
  cursor: zoom-in;
  pointer-events: auto;
}

.same-products-card:hover .same-products-card-media img {
  transform: scale(1.025);
}

.same-products-card-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  color: #ffffff;
  background: rgba(23, 58, 99, 0.9);
  border-radius: 4px;
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 900;
}

.same-products-shop-identities {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
}

.same-products-supplier-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.same-products-shop-identities span {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 2px 6px;
  color: #ffffff;
  background: #ca3644;
  border: 1px solid #b82838;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
}

.same-products-shop-identities img {
  display: block;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  object-fit: contain;
}

.same-products-shop-identities span img {
  margin-right: 4px;
}

.same-products-shop-identities span.is-super-factory {
  color: #4b3100;
  background: #f4bd26;
  border-color: #d59a00;
}

.same-products-shop-identities span.is-source-flagship {
  color: #ffffff;
  background: #6250a8;
  border-color: #4d3d8d;
}

.same-products-shop-identities span.is-powerful-merchant {
  color: #ffffff;
  background: #c93643;
  border-color: #aa2733;
}

.same-products-card-body {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.same-products-card-title {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.same-products-card-title a,
.same-products-card-title > strong {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  color: #111111;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.same-products-card-title a:hover,
.same-products-card-title a:focus-visible {
  color: #111111;
  text-decoration: underline;
}

.same-products-card-title span {
  overflow: hidden;
  color: #7a8797;
  font-family: var(--font-number);
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.same-products-card-commerce {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.same-products-card-commerce strong {
  min-width: 0;
  color: #c43b3f;
  font-family: var(--font-number);
  font-size: 16px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.same-products-card-commerce span {
  color: #4f6074;
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.same-products-card-supplier {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid #edf1f5;
}

.same-products-card-supplier-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.same-products-card-supplier-heading > a,
.same-products-card-supplier-heading > strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: #263c54;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.same-products-card-supplier-heading > a:hover,
.same-products-card-supplier-heading > a:focus-visible {
  color: #175d9e;
  text-decoration: underline;
}

.same-products-card-tenure {
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: auto;
}

.same-products-card-tenure:empty {
  display: none;
}

.same-products-card-supplier > div,
.same-products-card-tags {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.same-products-card-category,
.same-products-card-tags span {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 1px 6px;
  color: #59697b;
  background: #f5f7f9;
  border: 1px solid #dce3ea;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.same-products-card-category {
  color: #76520f;
  background: #fff8e8;
  border-color: #ead49d;
}

.same-products-card-actions {
  display: grid;
  grid-template-columns: auto minmax(76px, 1fr) minmax(72px, 1fr);
  gap: 6px;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-top: 1px solid #e1e8ef;
}

.same-products-card-actions label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 4px;
  color: #526278;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.same-products-card-actions input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #16816f;
}

.same-products-card-actions button,
.same-products-card-actions a {
  display: inline-flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  color: #174f87;
  background: #ffffff;
  border: 1px solid #c8d9e9;
  border-radius: 5px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.same-products-card-actions button:hover,
.same-products-card-actions button:focus-visible,
.same-products-card-actions a:hover,
.same-products-card-actions a:focus-visible {
  color: #ffffff;
  background: #2563a8;
  border-color: #2563a8;
}

.same-products-card-actions button.is-preferred {
  color: #76520f;
  background: #fff6d9;
  border-color: #dfbc60;
}

.same-products-cards-empty {
  display: grid;
  min-height: 250px;
  grid-column: 1 / -1;
  align-content: center;
  justify-items: center;
  gap: 14px;
  padding: 32px;
  color: #738196;
  text-align: center;
}

.same-products-cards-empty strong {
  max-width: 720px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.6;
}

.same-products-table-head > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.same-products-table-head strong {
  color: #172435;
  font-size: 16px;
  font-weight: 900;
}

.same-products-table-head > div span {
  color: #718096;
  font-size: 12px;
  font-weight: 750;
}

.same-products-sort-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: #536276;
  font-size: 12px;
  font-weight: 850;
}

.same-products-sort-control select {
  min-width: 170px;
  height: 36px;
  padding: 0 32px 0 10px;
  color: #24364d;
  background: #ffffff;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  font-weight: 800;
}

.same-products-sort-control select:focus {
  border-color: #2563a8;
  outline: 2px solid rgba(37, 99, 168, 0.14);
}

.same-products-table-wrap {
  max-height: none;
  overflow: auto;
  background: #ffffff;
  scrollbar-color: #aebdcd #eef2f6;
  scrollbar-width: thin;
}

.same-products-table {
  width: 100%;
  min-width: 1760px;
  table-layout: fixed;
}

.same-products-table .same-products-col-image {
  width: 84px;
}

.same-products-table .same-products-col-product {
  width: auto;
}

.same-products-table .same-products-col-province {
  width: 86px;
}

.same-products-table .same-products-col-company {
  width: 220px;
}

.same-products-table .same-products-col-shop-tag {
  width: 240px;
}

.same-products-table .same-products-col-position-labels {
  width: 230px;
}

.same-products-table .same-products-col-quantity {
  width: 120px;
}

.same-products-table .same-products-col-price,
.same-products-table .same-products-col-sales {
  width: 125px;
}

.same-products-table .same-products-col-scores {
  width: 190px;
}

.same-products-table th {
  top: 0;
  z-index: 3;
  height: 42px;
  padding: 9px 12px;
  color: #354960;
  background: #edf2f7;
  border-bottom: 1px solid #cfd9e4;
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.same-products-table th:nth-child(7),
.same-products-table th:nth-child(8),
.same-products-table th:nth-child(9),
.same-products-table th:nth-child(10) {
  text-align: center;
}

.same-products-table .same-products-sort-button {
  display: inline-flex;
  width: 100%;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  font: inherit;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.same-products-table .same-products-sort-button:hover {
  color: #1677ff;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.same-products-table .same-products-sort-button:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.32);
  outline-offset: 3px;
}

.same-products-table .same-products-sort-button.is-active {
  color: #183f6d;
}

.same-products-table .same-products-sort-button i {
  position: relative;
  display: inline-grid;
  width: 10px;
  height: 14px;
  flex: 0 0 10px;
  opacity: 0.42;
}

.same-products-table .same-products-sort-button i::before,
.same-products-table .same-products-sort-button i::after {
  position: absolute;
  left: 2px;
  content: "";
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.same-products-table .same-products-sort-button i::before {
  top: 1px;
  border-bottom: 5px solid #9aa8b6;
}

.same-products-table .same-products-sort-button i::after {
  bottom: 1px;
  border-top: 5px solid #9aa8b6;
}

.same-products-table .same-products-sort-button.is-active i {
  opacity: 1;
}

.same-products-table .same-products-sort-button.is-active[data-direction="asc"] i::before {
  border-bottom-color: var(--amber);
}

.same-products-table .same-products-sort-button.is-active[data-direction="desc"] i::after {
  border-top-color: var(--amber);
}

.same-products-table td,
.same-products-table td:nth-child(3) {
  min-width: 0;
  padding: 10px 12px;
  vertical-align: middle;
}

.same-products-table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.same-products-table tbody tr:hover td {
  background: #f5f9fd;
}

.same-products-row-image {
  position: relative;
  width: 60px;
  height: 60px;
  overflow: hidden;
  padding: 3px;
  background: #ffffff;
  border: 1px solid #d8e1eb;
  border-radius: 6px;
}

.same-products-image-badges {
  position: absolute;
  right: 2px;
  bottom: 2px;
  left: 2px;
  display: grid;
  gap: 1px;
  justify-items: start;
  pointer-events: none;
}

.same-products-image-badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 13px;
  align-items: center;
  overflow: hidden;
  padding: 1px 3px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(15, 35, 56, 0.24);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.same-products-image-badge.is-super-factory {
  color: #4b3100;
  background: #f4bd26;
}

.same-products-image-badge.is-source-flagship,
.same-products-image-badge.is-powerful-merchant {
  color: #ffffff;
  background: #d72f3f;
}

.same-products-row-title {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.same-products-row-title strong,
.same-products-row-title .same-products-title-link {
  display: -webkit-box;
  overflow: hidden;
  color: #111111;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.same-products-row-title .same-products-title-link:hover,
.same-products-row-title .same-products-title-link:focus-visible {
  color: #111111;
  text-decoration: underline;
}

.same-products-row-title span {
  color: #77869a;
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 750;
}

.same-products-keyword-score {
  display: inline-flex;
  width: fit-content;
  min-height: 20px;
  align-items: center;
  padding: 1px 6px;
  color: #17613c !important;
  background: #eaf7ee;
  border: 1px solid #b9ddc7;
  border-radius: 4px;
  font-family: var(--font-number) !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  line-height: 1.2;
}

html[data-theme="dark"] .same-products-keyword-score {
  color: #8ce4ae !important;
  background: #173526;
  border-color: #356d4c;
}

html[data-theme="dark"] .same-products-combined-score,
html[data-theme="dark"] .same-products-card-score.is-combined {
  color: #9bcfff !important;
  background: #17334d;
  border-color: #2f5d82;
}

html[data-theme="dark"] .same-products-card-score.is-keyword {
  color: #8ce4ae;
  background: #173526;
  border-color: #356d4c;
}

html[data-theme="dark"] .same-products-card-score.is-image,
html[data-theme="dark"] .same-products-image-score {
  color: #f5d77d !important;
  background: #3c3217 !important;
  border-color: #75622c !important;
}

.same-products-province {
  color: #4a5b70;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.same-products-company,
.same-products-shop-tag,
.same-products-position-labels {
  display: -webkit-box;
  overflow: hidden;
  color: #30445c;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

a.same-products-company:hover,
a.same-products-company:focus-visible {
  color: #175d9e;
  text-decoration: underline;
}

.same-products-company-cell {
  display: grid;
  min-width: 0;
  gap: 5px;
  justify-items: start;
}

.same-products-supplier-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 2px 6px;
  color: #0d695b;
  background: #e8f7f3;
  border: 1px solid #a9d9cf;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.same-products-shop-tag {
  padding-left: 8px;
  color: #6d4f16;
  border-left: 2px solid #d7a33d;
}

.same-products-position-labels {
  color: #315b72;
}

.same-products-quantity {
  display: block;
  color: #334b65;
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.same-products-scores {
  display: grid;
  gap: 3px;
  justify-items: center;
  color: #315b72;
  text-align: center;
}

.same-products-scores strong {
  color: #174f87;
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 900;
}

.same-products-scores span {
  color: #65758a;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.same-products-number {
  color: #26384e;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.same-products-similarity,
.same-products-search-rank,
.same-products-source {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.same-products-search-rank {
  min-width: 34px;
  color: #315b88;
  background: #f0f6fb;
  border-color: #cadff3;
  font-family: var(--font-number);
}

.same-products-similarity.high {
  color: #087163;
  background: #edf9f6;
  border-color: #a9ddd3;
}

.same-products-similarity.medium {
  color: #8a5a12;
  background: #fff8e9;
  border-color: #eed39b;
}

.same-products-similarity.low {
  color: #657386;
  background: #f4f6f8;
  border-color: #dbe2e9;
}

.same-products-source {
  max-width: 130px;
  overflow: hidden;
  color: #315b88;
  background: #eef5fc;
  border-color: #cadff3;
  text-overflow: ellipsis;
}

.same-products-link {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 9px;
  color: #174f87;
  background: #ffffff;
  border: 1px solid #ccdeef;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.same-products-link:hover,
.same-products-link:focus-visible {
  color: #ffffff;
  background: #2563a8;
  border-color: #2563a8;
}

.same-products-no-link {
  color: #9aa5b2;
}

.same-products-empty {
  height: 180px;
  color: #738196;
  font-weight: 800;
  text-align: center;
  vertical-align: middle !important;
}

@media (max-width: 1180px) {
  .same-products-overview {
    grid-template-columns: 1fr;
  }

  .same-products-base-product {
    border-right: 0;
    border-bottom: 1px solid #dce5ef;
  }
}

@media (max-width: 760px) {
  .same-products-supplier-match-actions,
  .same-products-supplier-segments {
    width: 100%;
  }

  .same-products-supplier-segments button {
    min-width: 0;
    flex: 1 1 0;
  }
}

@media (max-width: 760px) {
  .same-products-head {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .same-products-heading {
    width: 100%;
    align-items: flex-start;
  }

  .same-products-heading h2 {
    font-size: 18px;
  }

  .same-products-head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .same-products-limit-controls {
    width: 100%;
    margin-right: 0;
  }

  .same-products-limit-controls .same-search-number-field {
    width: calc(50% - 4px);
  }

  .same-products-head-actions > button {
    flex: 1 1 140px;
  }

  .same-products-base-product {
    grid-template-columns: 88px minmax(0, 1fr);
    padding: 14px;
  }

  .same-products-base-image {
    width: 88px;
    height: 88px;
  }

  .same-products-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .same-products-metrics article:nth-child(3) {
    border-left: 0;
  }

  .same-products-table-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .same-products-service-filter {
    padding: 12px 14px;
  }

  .same-products-service-filter-head {
    align-items: flex-start;
  }

  .same-products-service-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .same-products-service-options label {
    min-width: 0;
    white-space: normal;
  }

  .same-products-sort-control,
  .same-products-sort-control select {
    width: 100%;
  }

  .same-products-table-wrap {
    max-height: none;
  }

  .same-products-results-toolbar,
  .same-products-results-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .same-products-keyword-rank-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .same-products-results-toolbar {
    padding: 12px 14px;
  }

  .same-products-sort-control,
  .same-products-sort-control select,
  .same-products-view-switch {
    width: 100%;
  }

  .same-products-view-switch button {
    flex: 1 1 0;
  }

  .same-products-card-grid {
    max-height: calc(100vh - 180px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 14px 20px;
  }
}

@media (max-width: 480px) {
  .same-products-heading {
    flex-direction: column;
  }

  .same-products-back-button {
    min-height: 34px;
  }

  .same-products-base-product {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  .same-products-base-image {
    width: 72px;
    height: 72px;
  }

  .same-products-metrics {
    grid-template-columns: 1fr;
  }

  .same-products-metrics article {
    border-top: 1px solid #e2e8f0 !important;
    border-left: 0;
  }

  .same-products-metrics article:first-child {
    border-top: 3px solid #2563a8 !important;
  }

  .same-products-card-grid {
    grid-template-columns: 1fr;
  }
}

/* 2026-07-11 visual polish: quieter hierarchy and consistent workbench controls. */
:root {
  --ui-primary: #173a63;
  --ui-primary-hover: #102f52;
  --ui-primary-soft: #edf4fb;
  --ui-accent: #e99517;
  --ui-success: #168b78;
  --ui-danger: #cf4650;
  --ui-surface-line: #d7e1ec;
}

body {
  background:
    linear-gradient(180deg, #edf3f9 0, #f5f8fb 260px, #f1f5f9 100%),
    #f1f5f9;
}

.topbar {
  background: #ffffff;
  border-bottom: 0;
  box-shadow: none;
}

.primary-nav {
  background: rgba(247, 250, 253, 0.97);
  border-bottom: 1px solid var(--ui-surface-line);
  box-shadow: 0 5px 14px rgba(18, 40, 68, 0.055);
}

.primary-nav-inner {
  gap: 4px;
}

.nav-link {
  min-width: 104px;
  padding: 0 16px;
  color: #405168;
  font-size: 14px;
  font-weight: 650;
}

.nav-link::after {
  display: none;
  content: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ui-primary);
  background: #f1f6fb;
}

.nav-link.active,
.nav-link.agent-open,
.nav-link[aria-expanded="true"] {
  color: #ffffff;
  background: var(--ui-primary);
  font-weight: 800;
  border-bottom: 0;
  padding-bottom: 0;
  border-radius: 8px;
}

@keyframes nav-link-flash {
  from {
    background: #bfd9f2;
  }
  to {
    background: transparent;
  }
}

.nav-link.nav-flash {
  animation: nav-link-flash 0.5s ease-out;
}

@keyframes nav-link-spin {
  to {
    transform: rotate(360deg);
  }
}

.nav-link.is-loading {
  color: var(--ui-primary);
}

.nav-link.active.is-loading {
  color: #ffffff;
}

.nav-link.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid rgba(23, 58, 99, 0.22);
  border-top-color: var(--ui-primary);
  border-radius: 50%;
  animation: nav-link-spin 0.7s linear infinite;
}

.nav-link.active.is-loading::before {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

.nav-link span {
  color: var(--ui-accent);
}

.topbar .status {
  gap: 8px;
}

.connection-status,
.theme-toggle,
.notification-button,
.avatar-button {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e2ed;
  box-shadow: none;
}

.theme-toggle {
  position: relative;
  inset: auto;
  z-index: auto;
  display: inline-flex;
  width: 36px;
  min-width: 36px;
  gap: 0;
  padding: 0;
  color: var(--ui-primary);
  background: #ffffff;
  border-radius: 7px;
  font-size: 18px;
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.theme-toggle[aria-pressed="true"] {
  color: var(--ui-primary-hover);
  background: var(--ui-primary-soft);
  border-color: #b8cee5;
  box-shadow: none;
  transform: none;
}

.theme-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.connection-status {
  gap: 8px;
  padding: 0 11px;
  color: #5f6f82;
  background: #f8fafc;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
}

.connection-status .dot {
  width: 8px;
  height: 8px;
  background: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(233, 149, 23, 0.14);
}

.connection-status .dot.ready {
  background: var(--ui-success);
  box-shadow: 0 0 0 3px rgba(22, 139, 120, 0.14);
}

.notification-button {
  min-width: 70px;
  padding: 0 12px;
  color: var(--ui-primary);
  background: #ffffff;
  border-radius: 7px;
}

.notification-button:hover,
.notification-button:focus-visible {
  color: var(--ui-primary-hover);
  background: var(--ui-primary-soft);
  border-color: #b8cee5;
  box-shadow: none;
  transform: none;
}

.notification-dot {
  background: var(--ui-danger);
  box-shadow: 0 0 0 3px rgba(207, 70, 80, 0.1);
}

.avatar-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  color: #ffffff;
  background: var(--ui-primary);
  border-color: var(--ui-primary);
  border-radius: 50%;
}

.avatar-button:hover,
.avatar-button:focus-visible {
  background: var(--ui-primary-hover);
  border-color: var(--ui-primary-hover);
  box-shadow: none;
  transform: none;
}

.agent-toggle {
  min-height: 42px;
  color: var(--ui-primary);
  border-color: #cddbe9;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(18, 40, 68, 0.13);
}

.agent-toggle span {
  background: var(--ui-primary);
}

.agent-toggle strong {
  font-weight: 750;
}

.secondary-workspace {
  padding-top: 14px;
}

.market-layout {
  padding-top: 18px;
}

body.no-product-results .market-layout {
  grid-template-columns: minmax(0, 1fr);
}


.panel,
.dashboard-card,
.search-panel,
.filter-suite,
.product-list-panel,
.sku-panel,
.reverse-panel,
.seasonality-panel,
.agent-workbench,
.watchlist-page-panel {
  border-color: var(--ui-surface-line);
  border-radius: 8px;
  box-shadow: 0 7px 20px rgba(18, 40, 68, 0.065);
}

@media (max-width: 760px) {
  .topbar {
    min-height: 58px;
    padding: 8px 12px;
  }

  .brand-lockup {
    gap: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-title-inline {
    gap: 7px;
  }

  .brand-title-inline .brand-word {
    font-size: 12px;
  }

  .brand-title-inline h1 {
    font-size: 18px;
  }

  .connection-status {
    width: auto;
    padding: 0 9px;
    background: #f8fafc;
    border-color: #d8e2ed;
  }

  .connection-status #modeText {
    display: inline;
  }

  .notification-button {
    width: auto;
    min-width: 62px;
    padding: 0 10px;
    font-size: 13px;
  }

  .notification-dot {
    width: 8px;
    height: 8px;
  }

  .avatar-button {
    width: 36px;
    min-width: 36px;
  }

  .primary-nav {
    top: 58px;
    overflow: visible;
  }

  .primary-nav-inner {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 0 8px;
  }

  .nav-item {
    min-width: 0;
  }

  .nav-link {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 5px;
    font-size: 12px;
    white-space: nowrap;
  }

  .nav-link::after {
    right: 8px;
    left: 8px;
  }

  .nav-link span {
    margin-left: 3px;
    font-size: 8px;
  }

  body .selection-workflow {
    position: sticky;
    top: 172px;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    max-height: none;
    overflow-x: visible;
    overflow-y: visible;
    border: 0;
    border-bottom: 1px solid var(--ui-surface-line);
    border-radius: 0;
    box-shadow: 0 5px 14px rgba(18, 40, 68, 0.045);
  }

  body .selection-workflow-inner {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
  }

  body .selection-workflow-title {
    display: none;
  }

  body .selection-workflow-steps {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }

  body .selection-workflow-step {
    flex: none;
    width: auto;
    min-width: 0;
    min-height: 56px;
    gap: 6px;
    padding: 8px 6px;
  }

  body .selection-workflow-step:not(:last-child)::after {
    display: none;
  }

  .workflow-index {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .workflow-copy strong {
    font-size: 12px;
    white-space: normal;
  }

  .secondary-workspace {
    width: calc(100% - 20px);
    padding-top: 12px;
  }

  .market-layout {
    width: calc(100% - 20px);
    padding-top: 14px;
  }
}

@media (max-width: 520px) {
  .connection-status {
    width: 34px;
    padding: 0;
    background: transparent;
    border-color: transparent;
  }

  .connection-status #modeText,
  .notification-label {
    display: none;
  }

  .notification-button {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  body .selection-workflow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body .selection-workflow-step:not(:last-child)::after {
    display: none;
  }

  .agent-toggle {
    width: 44px;
    min-width: 44px;
    padding: 6px;
  }

  .agent-toggle strong {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .brand-title-inline .brand-word {
    display: none;
  }

  .topbar .status {
    gap: 4px;
  }

  .nav-link {
    font-size: 11px;
  }
}

html[data-theme="dark"] body {
  background: #101720;
}

html[data-theme="dark"] .topbar {
  background: #19232f;
}

html[data-theme="dark"] .primary-nav {
  background: rgba(21, 31, 42, 0.98);
  border-bottom-color: #344357;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .nav-link {
  color: #b7c5d6;
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link:focus-visible {
  color: #f1f5f9;
  background: #202c39;
}

html[data-theme="dark"] .nav-link.active,
html[data-theme="dark"] .nav-link.agent-open,
html[data-theme="dark"] .nav-link[aria-expanded="true"] {
  color: #ffffff;
  background: var(--ui-primary);
}

html[data-theme="dark"] .nav-link.active::after,
html[data-theme="dark"] .nav-link.agent-open::after,
html[data-theme="dark"] .nav-link[aria-expanded="true"]::after {
  background: #73a7dd;
}

/* Keep the location marker tied to navigation, not hover or dropdown state. */
.primary-nav .nav-link:not(.active)::after {
  display: none;
  content: none;
}

.primary-nav .nav-link.active::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  display: block;
  height: 3px;
  content: "";
  background: var(--ui-primary);
  border-radius: 3px 3px 0 0;
}

html[data-theme="dark"] .primary-nav .nav-link.active::after {
  background: #73a7dd;
}

.nav-link.active::after,
.nav-link.agent-open::after,
.nav-link[aria-expanded="true"]::after,
html[data-theme="dark"] .nav-link.active::after,
html[data-theme="dark"] .nav-link.agent-open::after,
html[data-theme="dark"] .nav-link[aria-expanded="true"]::after,
.primary-nav .nav-link.active::after,
.primary-nav .nav-link.agent-open::after,
.primary-nav .nav-link[aria-expanded="true"]::after,
html[data-theme="dark"] .primary-nav .nav-link.active::after,
html[data-theme="dark"] .primary-nav .nav-link.agent-open::after,
html[data-theme="dark"] .primary-nav .nav-link[aria-expanded="true"]::after {
  display: none;
  content: none;
}

html[data-theme="dark"] .connection-status,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .notification-button {
  color: #d8e2ed;
  background: #151f2a;
  border-color: #3b4c60;
}

html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .theme-toggle:focus-visible,
html[data-theme="dark"] .theme-toggle[aria-pressed="true"],
html[data-theme="dark"] .notification-button:hover,
html[data-theme="dark"] .notification-button:focus-visible {
  color: #ffffff;
  background: #263649;
  border-color: #5689c3;
}

html[data-theme="dark"] .avatar-button {
  color: #ffffff;
  background: #315f8f;
  border-color: #315f8f;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .search-panel,
html[data-theme="dark"] .filter-suite,
html[data-theme="dark"] .product-list-panel,
html[data-theme="dark"] .sku-panel,
html[data-theme="dark"] .reverse-panel,
html[data-theme="dark"] .seasonality-panel,
html[data-theme="dark"] .agent-workbench,
html[data-theme="dark"] .watchlist-page-panel {
  color: var(--ink);
  background: #19232f;
  border-color: #344357;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .product-list-panel .result-head,
html[data-theme="dark"] .watchlist-page-head,
html[data-theme="dark"] .agent-workbench-head {
  background: #202c39;
  border-bottom-color: #344357;
}

/* Data dashboard: unframed page shell with three clear working surfaces. */
#trend.seasonality-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.secondary-workspace:has(#trend:not([hidden])) {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

#trend .seasonality-head {
  padding: 0 4px 12px;
}

#trend .seasonality-head h2 {
  font-size: 22px;
  font-weight: 850;
}

#trend .source-pill {
  min-height: 30px;
  padding: 4px 10px;
  color: var(--ui-primary);
  background: #f8fafc;
  border-color: var(--ui-surface-line);
  border-radius: 7px;
  font-weight: 750;
}

#trend .trend-search-form {
  margin: 0 0 12px;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(18, 40, 68, 0.045);
}

#trend .seasonality-insights {
  margin: 0 0 12px;
  border-top: 1px solid #dbe5f0;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(18, 40, 68, 0.045);
}

#trend .seasonality-body {
  padding: 0 0 22px;
}

#trend .seasonality-chart-card {
  box-shadow: 0 5px 16px rgba(18, 40, 68, 0.045);
}

@media (max-width: 1020px) {
  #trend .seasonality-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #trend .seasonality-insights article,
  #trend .seasonality-insights article:nth-child(odd) {
    border-left: 1px solid #e5edf5;
  }

  #trend .seasonality-insights article:nth-child(3n + 1) {
    border-left: 0;
  }
}

@media (max-width: 640px) {
  #trend .seasonality-head {
    padding: 0 2px 10px;
  }

  #trend .trend-search-form,
  #trend .seasonality-insights,
  #trend .seasonality-body {
    margin-right: 0;
    margin-left: 0;
  }

  #trend .seasonality-insights {
    grid-template-columns: 1fr;
  }

  #trend .seasonality-insights article,
  #trend .seasonality-insights article:nth-child(odd),
  #trend .seasonality-insights article:nth-child(3n + 1) {
    border-top: 1px solid #e5edf5;
    border-left: 0;
  }

  #trend .seasonality-insights article:first-child {
    border-top: 0;
  }

  #trend .seasonality-body {
    padding-bottom: 12px;
  }
}

html[data-theme="dark"] #trend.seasonality-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
}

html[data-theme="dark"] #trend .source-pill {
  color: #d8e2ed;
  background: #151f2a;
  border-color: #3b4c60;
}

html[data-theme="dark"] #trend .trend-search-form,
html[data-theme="dark"] #trend .seasonality-insights,
html[data-theme="dark"] #trend .seasonality-chart-card {
  background: #19232f;
  border-color: #344357;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
}

/* Narrow workspace audit fixes. */
@media (max-width: 760px) {
  .search-panel .search-control {
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
  }

  .search-panel .search-control input,
  .search-panel .search-control button {
    height: 46px;
    border-radius: 7px;
    font-size: 14px;
  }

  .search-panel .search-control input {
    padding: 0 14px;
  }

  .competitor-page-head {
    position: static;
  }

  .competitor-page-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .competitor-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  .competitor-head-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .competitor-head-actions .validation-workspace-tabs {
    display: grid;
    width: 100%;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .competitor-head-actions .validation-workspace-tabs button,
  .competitor-head-actions .text-button {
    width: auto;
    min-width: 0;
  }

  .competitor-head-actions .text-button {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .selection-candidate-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .selection-candidate-image {
    width: 112px;
    height: 112px;
  }

  .watchlist-page-panel .watch-item {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .watch-thumb,
  .watch-media {
    width: 120px;
    height: 120px;
    object-fit: contain;
  }

  .watch-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .competitor-head-actions {
    grid-template-columns: 1fr;
  }

  .competitor-head-actions .validation-workspace-tabs {
    grid-column: 1;
  }

  .selection-candidate-card,
  .watchlist-page-panel .watch-item {
    grid-template-columns: 1fr;
  }

  .selection-candidate-image,
  .watch-thumb,
  .watch-media {
    width: 100%;
    height: 160px;
  }

  .watch-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html[data-theme="dark"] .reverse-form {
  color: #e7edf5;
  background: #151f2a;
  border-color: #344357;
}

html[data-theme="dark"] .reverse-form label {
  color: #cbd5e1;
}

html[data-theme="dark"] .reverse-form input,
html[data-theme="dark"] .reverse-form select {
  color: #e7edf5;
  background: #101923;
  border-color: #46576c;
}

html[data-theme="dark"] .category-cascade-trigger,
html[data-theme="dark"] .category-cascade-menu,
html[data-theme="dark"] .category-cascade-child {
  color: #e7edf5;
  background: #101923;
  border-color: #46576c;
}

html[data-theme="dark"] .category-cascade-parents-panel,
html[data-theme="dark"] .category-cascade-middles-panel {
  background: #151f2a;
  border-color: #344357;
}

html[data-theme="dark"] .category-cascade-parent,
html[data-theme="dark"] .category-cascade-middle {
  color: #cbd5e1;
}

html[data-theme="dark"] .category-cascade-parent:hover,
html[data-theme="dark"] .category-cascade-parent.is-active,
html[data-theme="dark"] .category-cascade-parent.is-selected,
html[data-theme="dark"] .category-cascade-middle:hover,
html[data-theme="dark"] .category-cascade-middle:focus-visible,
html[data-theme="dark"] .category-cascade-middle.is-active,
html[data-theme="dark"] .category-cascade-middle.is-selected,
html[data-theme="dark"] .category-cascade-child.is-selected {
  color: #eef6ff;
  background: #23364a;
}

html[data-theme="dark"] .reverse-form .category-cascade-drill:hover,
html[data-theme="dark"] .reverse-form .category-cascade-drill:focus-visible,
html[data-theme="dark"] .reverse-form .category-cascade-drill.is-active {
  color: #d8eaff;
  background: #29425b;
}

html[data-theme="dark"] .category-cascade-head,
html[data-theme="dark"] .category-cascade-head strong,
html[data-theme="dark"] .category-cascade-level-label {
  color: #eef6ff;
  border-color: #344357;
}

html[data-theme="dark"] .category-cascade-child:hover,
html[data-theme="dark"] .category-cascade-child:focus-visible {
  background: #28251f;
  border-color: #b98639;
}

html[data-theme="dark"] .reverse-form input::placeholder {
  color: #8797aa;
}

html[data-theme="dark"] .reverse-form > button {
  color: #ffffff;
  background: #315f8f;
  border-color: #315f8f;
}

html[data-theme="dark"] .reverse-form > button:hover,
html[data-theme="dark"] .reverse-form > button:focus-visible {
  color: #ffffff;
  background: #3d73aa;
  border-color: #5689c3;
}

.competitor-product-summary:empty,
.competitor-metric-cards:empty {
  display: none;
}

/* Keep the two primary product metrics visible on shelf cards. */
.product-list-panel .decision-product .decision-metrics {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.product-list-panel .decision-product .decision-metrics > div {
  display: none;
}

.product-list-panel .decision-product .decision-metrics > .metric-primary {
  display: grid;
  min-width: 0;
  min-height: 44px;
  align-content: center;
  gap: 2px;
  padding: 6px 8px;
  background: #f5f8fc;
  border: 1px solid #dce6f1;
  border-radius: 6px;
}

.product-list-panel .decision-product .decision-metrics > .metric-primary span {
  color: #718096;
  font-size: 10px;
  font-weight: 750;
}

.product-list-panel .decision-product .decision-metrics > .metric-primary strong {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-number);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="dark"] .product-list-panel .decision-product .decision-metrics > .metric-primary {
  background: #151f2a;
  border-color: #344357;
}

html[data-theme="dark"] .product-list-panel .decision-product .decision-metrics > .metric-primary span {
  color: #9eacbd;
}

/* Product shelf commerce block: price first, then comparable sales metrics. */
.product-list-panel .decision-product .product-commerce-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 52px;
  align-items: center;
  column-gap: 10px;
  row-gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

.product-list-panel .decision-product .product-card-price {
  flex: 0 0 auto;
  color: #f05223;
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.25;
}

.product-list-panel .decision-product .product-card-sales,
.product-list-panel .decision-product .product-card-reviews {
  min-width: 0;
  overflow: hidden;
  color: #66758a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-overflow: ellipsis;
}

.product-list-panel .decision-product .product-card-sales-control {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 5px;
}

.product-list-panel .decision-product .product-card-reviews {
  text-align: left;
}

.product-list-panel .decision-product .product-card-review-control {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 2;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
}

.product-list-panel .decision-product .product-review-summary {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.product-list-panel .decision-product .product-review-batch-check {
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  place-items: center;
  cursor: pointer;
}

.product-list-panel .decision-product .product-review-batch-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.product-list-panel .decision-product .product-review-batch-check span {
  display: block;
  position: relative;
  width: 15px;
  height: 15px;
  background: #ffffff;
  border: 1px solid #aebdcc;
  border-radius: 4px;
}

.product-list-panel .decision-product .product-review-batch-check input:checked + span {
  background: #176b61;
  border-color: #176b61;
}

.product-list-panel .decision-product .product-review-batch-check input:checked + span::after {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 4px;
  height: 7px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.product-list-panel .decision-product .product-review-batch-check input:disabled + span {
  background: #edf1f4;
  border-color: #d5dde5;
  cursor: default;
}

.product-list-panel .decision-product .product-review-query-button {
  display: inline-flex;
  width: max-content;
  min-width: 64px;
  min-height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  color: #176b61;
  background: #edf9f7;
  border: 1px solid #9ed8d0;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  cursor: pointer;
}

.product-list-panel .decision-product .product-review-query-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.product-list-panel .decision-product .product-review-query-button:hover {
  color: #fff;
  background: #147d70;
  border-color: #147d70;
}

.product-list-panel .decision-product .product-review-query-button.is-busy {
  color: #6a5412;
  background: #fff8df;
  border-color: #e5cf7a;
}

.product-list-panel .decision-product .product-review-query-button.is-complete {
  color: #175a93;
  background: #edf6ff;
  border-color: #a8ccec;
}

.product-list-panel .decision-product .product-review-query-button.is-failed {
  color: #a43b35;
  background: #fff1f0;
  border-color: #e7aaa6;
}

.product-list-panel .decision-product .product-sales-backfill-button {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 1px 7px;
  color: #a95a0d;
  background: #fff7e9;
  border: 1px solid #f0c88b;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
}

.product-list-panel .decision-product .product-sales-backfill-button:hover:not(:disabled) {
  color: #ffffff;
  background: #d87916;
  border-color: #d87916;
}

.product-list-panel .decision-product .product-sales-backfill-button:disabled {
  color: #7d8999;
  background: #f1f4f7;
  border-color: #d6dee8;
  cursor: default;
}

@media (max-width: 760px) {
  .product-list-panel .decision-product .product-commerce-line {
    min-height: 52px;
  }

  .product-list-panel .decision-product .product-card-sales {
    max-width: 120px;
  }

  .competitor-classify-head-actions .sales-backfill-combined-control {
    display: none;
  }
}

.product-list-panel .decision-product .product-card-sales .sales-value-loading,
.product-list-panel .decision-product .product-card-sales .sales-value-missing {
  font-size: inherit;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-card-price {
  color: #ff8257;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-card-sales {
  color: #9eacbd;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-card-reviews {
  color: #9eacbd;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-review-batch-check span {
  background: #17212d;
  border-color: #526477;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-review-batch-check input:checked + span {
  background: #2b9a8d;
  border-color: #2b9a8d;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-review-query-button {
  color: #80d8cc;
  background: #122e2b;
  border-color: #28655e;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-review-query-button.is-busy {
  color: #ead17b;
  background: #312b16;
  border-color: #71622b;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-review-query-button.is-complete {
  color: #8fc7f5;
  background: #172b3d;
  border-color: #345f83;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-review-query-button.is-failed {
  color: #f3aaa5;
  background: #351e20;
  border-color: #784044;
}

.search-mode-tabs {
  display: inline-flex;
  gap: 0;
  padding: 3px;
  background: linear-gradient(180deg, #f0f4f8, #e8edf4);
  border: 1px solid #d4dde8;
  border-radius: 9px;
}

.search-mode-tab {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 5px 15px;
  color: #667589;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.search-mode-tab:hover:not(.is-active) {
  color: #3b4f6b;
  background: rgba(255, 255, 255, 0.55);
}

.search-mode-tab.is-active {
  color: #163c63;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(20, 46, 74, 0.15);
}

.search-mode-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  background: rgba(22, 60, 99, 0.08);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.search-mode-tab.is-active .search-mode-icon {
  color: #ffffff;
  background: #2563a8;
}

.search-control-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.search-submit-btn {
  min-height: 44px;
  padding: 0 20px;
  color: #ffffff;
  background: linear-gradient(180deg, #1f5f95, #174578);
  border: 1px solid #174578;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(23, 69, 120, 0.22);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.search-submit-btn:hover {
  background: linear-gradient(180deg, #256ba3, #1a5186);
  box-shadow: 0 3px 10px rgba(23, 69, 120, 0.3);
}

/* Keep old classes for backward compatibility, they map to new tabs */
.keyword-search-mode {
  display: none;
}

.search-panel .search-control textarea {
  min-height: 62px;
  max-height: 148px;
  padding: 17px 20px;
  resize: vertical;
  color: var(--nav);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font: 850 17px/1.45 var(--font-sans);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.search-panel .search-control textarea:focus {
  background: #fff;
  border-color: #1677ff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.16);
}

.search-panel .search-main.mode-image .search-control textarea {
  color: #8b97a6;
  background: #f4f7fb;
  cursor: not-allowed;
}

.batch-keyword-nav {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px 14px;
  background: #f8fbfe;
  border: 1px solid #dbe6f0;
  border-radius: 7px;
}

.batch-keyword-nav[hidden] {
  display: none;
}

.product-image-candidate-source {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding: 8px 4px 12px;
  border-bottom: 1px solid #dbe6f0;
}

.product-image-candidate-source > img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  background: #fff;
  border: 1px solid #d7e1ec;
  border-radius: 6px;
}

.product-image-candidate-source-image[data-image-preview] {
  cursor: zoom-in;
  border: 2px solid #0f9f8f;
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
}

.product-image-candidate-source-image[data-image-preview]:hover,
.product-image-candidate-source-image[data-image-preview]:focus-visible {
  border-color: #087569;
  box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.2);
}

.product-image-candidate-source > div:not(.product-image-candidate-products) {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
}

.product-image-candidate-source-info {
  align-content: center;
  gap: 5px;
}

.product-image-candidate-source-title {
  overflow: hidden;
  color: #162d46;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-image-candidate-source-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.product-image-candidate-source-meta > span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.product-image-candidate-source-meta small {
  color: #718196;
  font-size: 10px;
  font-weight: 700;
}

.product-image-candidate-source-meta b {
  overflow: hidden;
  color: #253f5a;
  font-family: var(--font-number);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-candidate-source span,
.product-image-candidate-source small {
  color: #617286;
  font-size: 11px;
}

.product-image-candidate-source strong {
  overflow: hidden;
  color: #162d46;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-candidate-products {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  min-width: 0;
}

.product-image-candidate-group {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  background: #f3f7fc;
  border: 1px solid #dde6f0;
  border-radius: 6px;
}

.product-image-candidate-group.is-failed {
  background: #fbf1f1;
  border-color: #f0cdcd;
}

.product-image-candidate-group.is-ready {
  background: #edf8f2;
  border-color: #b9ddc8;
}

.product-image-candidate-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}

.product-image-candidate-group-keyword {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: #162d46;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-candidate-group-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 11px;
}

.product-image-candidate-group-status b {
  color: #4b6378;
}

.product-image-candidate-group-status small {
  color: #617286;
  font-weight: 600;
}

.product-image-candidate-group-status.is-ready {
  background: #ffffff;
  border: 1px solid #b9ddc8;
}

.product-image-candidate-group-status.is-ready b {
  color: #185c40;
}

.product-image-candidate-group-status.is-failed {
  background: #ffffff;
  border: 1px solid #f0cdcd;
}

.product-image-candidate-group-status.is-failed b {
  color: #8a1f1f;
}

.product-image-candidate-group-status.is-running {
  background: #ffffff;
  border: 1px solid #c9def0;
}

.product-image-candidate-group-status.is-running b {
  color: #1a4f7c;
}

.product-image-candidate-group-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-image-candidate-product {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: #ffffff;
  border: 1px solid #e3ebf3;
  border-radius: 5px;
}

.product-image-candidate-product-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f3f6fa;
  border-radius: 4px;
  overflow: hidden;
}

.product-image-candidate-product-image img {
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.product-image-candidate-similarity {
  position: absolute;
  right: 2px;
  bottom: 2px;
  max-width: calc(100% - 4px);
  padding: 1px 3px;
  overflow: hidden;
  color: #fff;
  border-radius: 3px;
  font: 800 9px/1.35 var(--font-number);
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.product-image-candidate-similarity.is-pass {
  background: rgba(20, 132, 78, 0.92);
}

.product-image-candidate-similarity.is-filtered {
  background: rgba(183, 59, 48, 0.92);
}

.product-image-candidate-similarity.is-pending {
  color: #536579;
  background: rgba(235, 241, 247, 0.94);
}

.product-image-candidate-similarity.is-failed {
  background: rgba(105, 112, 122, 0.94);
}

.thumb-frame {
  position: relative;
}

.product-card-image-similarity {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 3px 6px;
  color: #fff;
  border-radius: 4px;
  font: 850 11px/1.25 var(--font-number);
  pointer-events: none;
}

.product-card-image-similarity.is-pass {
  background: rgba(20, 132, 78, 0.94);
}

.product-card-image-similarity.is-filtered {
  background: rgba(183, 59, 48, 0.94);
}

.product-card-image-similarity.is-pending {
  color: #526276;
  background: rgba(235, 241, 247, 0.96);
}

.product-card-image-similarity.is-failed {
  background: rgba(105, 112, 122, 0.94);
}

.product-image-candidate-product-image .image-missing {
  font-size: 10px;
  color: #94a4b8;
}

.product-image-candidate-product-body {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.product-image-candidate-product-title {
  overflow: hidden;
  color: #162d46;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-candidate-product-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: #4b6378;
}

.product-image-candidate-product-price {
  color: #b13c2c;
  font-size: 12px;
  font-weight: 700;
}

.product-image-candidate-product-sales {
  color: #4b6378;
}

.product-image-candidate-product-reviews {
  color: #617286;
}

.product-image-candidate-product-empty {
  padding: 6px;
  background: #ffffff;
  border: 1px dashed #dde6f0;
  border-radius: 5px;
  color: #94a4b8;
  font-size: 11px;
  text-align: center;
}

.product-image-candidate-group.is-failed .product-image-candidate-product-empty {
  color: #a85a5a;
}

.product-image-keyword-similarity-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 10px;
  color: #6b4b12;
  background: #fff8e8;
  border: 1px solid #f0d28b;
  border-radius: 5px;
  font-size: 12px;
}

.product-image-keyword-similarity-progress strong {
  color: #8a5a00;
}

.product-image-keyword-similarity-progress.is-complete {
  color: #185c40;
  background: #edf8f2;
  border-color: #b9ddc8;
}

.product-image-keyword-similarity-progress.is-complete strong {
  color: #174f38;
}

.batch-keyword-current {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: #174f38;
  background: #eefaf3;
  border: 1px solid #b9e2ca;
  border-radius: 6px;
}

.batch-keyword-current > span {
  padding: 3px 7px;
  color: #fff;
  background: #168254;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.batch-keyword-current > strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-keyword-current > small {
  min-width: 0;
  overflow: hidden;
  color: #4e7160;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-keyword-current.is-failed {
  color: #8f2927;
  background: #fff3f2;
  border-color: #efb9b5;
}

.batch-keyword-current.is-failed > span {
  background: #c83f3a;
}

.batch-keyword-current.is-failed > small {
  color: #9a4743;
}

.batch-keyword-current.is-partial {
  color: #79530a;
  background: #fff8e8;
  border-color: #e6ce92;
}

.batch-keyword-current.is-partial > span {
  background: #a66d08;
}

.batch-keyword-current.is-partial > small {
  color: #80611f;
}

.product-list-panel .product-list.batch-keyword-product-loading {
  display: block;
  grid-template-columns: none;
  padding: 10px;
}

.product-list-panel .product-list.batch-keyword-empty-product-list {
  display: block;
  grid-template-columns: none;
  padding: 10px;
}

.batch-keyword-empty-result {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px 18px;
  text-align: center;
  background: #f8fbfe;
  border: 1px dashed #b9c9d8;
  border-radius: 6px;
}

.batch-keyword-empty-result > span {
  padding: 3px 8px;
  color: #176b4d;
  background: #e4f5ed;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
}

.batch-keyword-empty-result > strong {
  color: #173b5f;
  font-size: 17px;
  font-weight: 900;
}

.batch-keyword-empty-result > p {
  margin: 0;
  color: #687b8f;
  font-size: 13px;
}

.batch-keyword-loading-shelf {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #fbfdff;
  border: 1px solid #dbe6f0;
  border-radius: 6px;
}

.batch-keyword-loading-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.batch-keyword-loading-copy > span {
  color: #56708a;
  font-size: 11px;
  font-weight: 850;
}

.batch-keyword-loading-copy > strong {
  overflow: hidden;
  color: #173b5f;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-keyword-loading-copy > small {
  color: #6f8092;
  font-size: 11px;
  white-space: nowrap;
}

.batch-keyword-loading-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.batch-keyword-loading-grid > i {
  display: grid;
  gap: 7px;
}

.batch-keyword-loading-grid b,
.batch-keyword-loading-grid span {
  display: block;
  overflow: hidden;
  background: #e8eef5;
  border-radius: 3px;
  position: relative;
}

.batch-keyword-loading-grid b {
  aspect-ratio: 1 / 1;
}

.batch-keyword-loading-grid span {
  width: 88%;
  height: 9px;
}

.batch-keyword-loading-grid span:last-child {
  width: 58%;
}

.batch-keyword-loading-grid b::after,
.batch-keyword-loading-grid span::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  content: "";
  transform: translateX(-100%);
  animation: batch-keyword-loading 1.3s ease-in-out infinite;
}

@keyframes batch-keyword-loading {
  to { transform: translateX(100%); }
}

.batch-keyword-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px 16px;
  color: var(--muted);
  font-size: 12px;
}

.batch-keyword-summary-copy {
  display: grid;
  gap: 1px;
}

.batch-keyword-eyebrow {
  color: #56708a;
  font-size: 10px;
  font-weight: 800;
}

.batch-keyword-summary-copy strong {
  color: var(--nav);
  font-size: 14px;
}

.batch-keyword-summary-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.batch-keyword-summary-stats span {
  color: #62758a;
}

.batch-keyword-summary-stats b {
  color: #173b5f;
  font-family: var(--font-number);
  font-size: 13px;
}

.batch-keyword-progress {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  background: #dfe9f3;
  border-radius: 2px;
}

.batch-keyword-progress span {
  display: block;
  height: 100%;
  background: #1d73b7;
  border-radius: inherit;
  transition: width 220ms ease;
}

.batch-keyword-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  padding-bottom: 2px;
}

.batch-keyword-tabs button {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  color: #526276;
  background: #fff;
  border: 1px solid #d9e1ea;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  box-shadow: 0 1px 2px rgba(24, 54, 84, 0.04);
}

.batch-keyword-status-mark {
  width: 8px;
  height: 8px;
  background: #a9b6c4;
  border-radius: 50%;
}

.batch-keyword-tabs button > span {
  display: grid;
  min-width: 0;
  gap: 1px;
  text-align: left;
}

.batch-keyword-tabs button b {
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-keyword-tabs button small {
  color: #7b8796;
  font-size: 10px;
  font-weight: 650;
}

.batch-keyword-tabs button.active small {
  color: rgba(255, 255, 255, 0.74);
}

.batch-keyword-tabs button strong {
  min-width: 24px;
  padding: 1px 6px;
  color: #64748b;
  background: #edf2f7;
  border-radius: 4px;
  font: 800 11px/1.5 var(--font-number);
}

.batch-keyword-tabs button.product-image-candidate-all {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  color: #214d76;
  background: #eef6ff;
  border-color: #b9d4ed;
}

.batch-keyword-tabs button.product-image-candidate-all:hover:not(:disabled) {
  background: #e4f0fc;
  border-color: #8fb8dc;
}

.product-image-candidate-all-label {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-keyword-tabs button.product-image-candidate-all strong {
  min-width: auto;
  color: #315e87;
  background: #dcecfb;
  white-space: nowrap;
}

.batch-keyword-tabs button.product-image-candidate-all.active {
  color: #fff;
  background: #214d76;
  border-color: #214d76;
}

.batch-keyword-tabs button.product-image-candidate-all.active strong {
  color: #214d76;
  background: #fff;
}

.batch-keyword-tabs button.is-pending,
.batch-keyword-tabs button.is-running {
  cursor: default;
  opacity: 1;
  transform: none;
}

.batch-keyword-tabs button.is-running .batch-keyword-status-mark {
  background: #22a35a;
  box-shadow: 0 0 0 4px rgba(34, 163, 90, 0.13);
  animation: batch-keyword-pulse 1.4s ease-in-out infinite;
}

.batch-keyword-tabs button.is-sales-enriching .batch-keyword-status-mark {
  background: #d08a16;
  box-shadow: 0 0 0 4px rgba(208, 138, 22, 0.13);
  animation: batch-keyword-pulse 1.4s ease-in-out infinite;
}

.batch-keyword-tabs button.is-ready .batch-keyword-status-mark,
.batch-keyword-tabs button.active .batch-keyword-status-mark {
  background: #2f80c1;
}

.batch-keyword-tabs button.is-sales-running .batch-keyword-status-mark {
  background: #d08a16;
  box-shadow: 0 0 0 4px rgba(208, 138, 22, 0.13);
  animation: batch-keyword-pulse 1.4s ease-in-out infinite;
}

.batch-keyword-tabs button.is-sales-queued .batch-keyword-status-mark {
  background: #a9b6c4;
  box-shadow: none;
  animation: none;
}

.batch-keyword-tabs button.is-sales-cooldown .batch-keyword-status-mark {
  background: #c7871b;
  box-shadow: 0 0 0 4px rgba(199, 135, 27, 0.13);
  animation: none;
}

.batch-keyword-tabs button.is-failed .batch-keyword-status-mark {
  background: #d24b4b;
}

@keyframes batch-keyword-pulse {
  50% { box-shadow: 0 0 0 1px rgba(34, 163, 90, 0.08); }
}

.batch-keyword-tabs button.is-pending {
  color: #6b7280;
  background: #f8fafc;
  border-color: #d9e1ea;
}

.batch-keyword-tabs button.is-running {
  color: #14532d;
  background: #f0fdf4;
  border-color: #86cfa0;
}

.batch-keyword-tabs button.is-pending strong,
.batch-keyword-tabs button.is-running strong {
  min-width: 42px;
  font-family: var(--font-sans);
}

.batch-keyword-tabs button.is-running strong {
  color: #166534;
  background: #dcfce7;
}

.batch-keyword-tabs button.active {
  color: #fff;
  background: #214d76;
  border-color: #214d76;
}

.batch-keyword-tabs button.active strong {
  color: #163c63;
  background: #fff;
}

.batch-keyword-tabs button.is-failed:not(.active) {
  color: #9b2c2c;
  background: #fff7f7;
  border-color: #f0b8b8;
}

.batch-keyword-tabs button.is-failed strong {
  color: #9b2c2c;
  background: #fee2e2;
}

html[data-theme="dark"] .search-mode-tabs {
  background: linear-gradient(180deg, #1d2a38, #172330);
  border-color: #344357;
}
html[data-theme="dark"] .search-mode-tab {
  color: #889eb5;
}
html[data-theme="dark"] .search-mode-tab:hover:not(.is-active) {
  color: #b7cce0;
  background: rgba(255,255,255,0.06);
}
html[data-theme="dark"] .search-mode-tab.is-active {
  color: #d0def0;
  background: #263649;
}
html[data-theme="dark"] .search-mode-tab .search-mode-icon {
  background: rgba(208,222,240,0.1);
}
html[data-theme="dark"] .search-mode-tab.is-active .search-mode-icon {
  color: #fff;
  background: #4680b8;
}
html[data-theme="dark"] .search-submit-btn {
  background: linear-gradient(180deg, #2d6fa5, #1f5080);
  border-color: #1f5080;
}

html[data-theme="dark"] .keyword-search-mode,
html[data-theme="dark"] .batch-keyword-tabs button {
  background: #151f2a;
  border-color: #344357;
}

html[data-theme="dark"] .batch-keyword-tabs button.is-pending {
  color: #aab6c5;
  background: #131c26;
}

html[data-theme="dark"] .batch-keyword-tabs button.is-running {
  color: #b8efc8;
  background: #14271d;
  border-color: #3a7650;
}

html[data-theme="dark"] .batch-keyword-nav {
  background: #101923;
  border-color: #344357;
}

html[data-theme="dark"] .product-image-candidate-source {
  border-color: #344357;
}

html[data-theme="dark"] .product-image-candidate-source > img {
  background: #151f2a;
  border-color: #344357;
}

html[data-theme="dark"] .product-image-candidate-source strong {
  color: #e7edf5;
}

html[data-theme="dark"] .product-image-candidate-source-meta small {
  color: #9eacbd;
}

html[data-theme="dark"] .product-image-candidate-source-meta b {
  color: #d7e4f2;
}

html[data-theme="dark"] .product-image-candidate-keywords span {
  color: #b8efc8;
  background: #14271d;
  border-color: #3a7650;
}

html[data-theme="dark"] .batch-keyword-current,
html[data-theme="dark"] .batch-keyword-loading-shelf {
  color: #c7efda;
  background: #12241b;
  border-color: #315d45;
}

html[data-theme="dark"] .batch-keyword-empty-result {
  background: #101923;
  border-color: #405166;
}

html[data-theme="dark"] .batch-keyword-empty-result > span {
  color: #bcebd3;
  background: #17392b;
}

html[data-theme="dark"] .batch-keyword-empty-result > strong {
  color: #e7edf5;
}

html[data-theme="dark"] .batch-keyword-empty-result > p {
  color: #aab6c5;
}

html[data-theme="dark"] .batch-keyword-current.is-failed {
  color: #f3b5b0;
  background: #321c1d;
  border-color: #70403f;
}

html[data-theme="dark"] .batch-keyword-current.is-partial {
  color: #efd291;
  background: #302819;
  border-color: #665633;
}

html[data-theme="dark"] .batch-keyword-loading-copy > strong {
  color: #e7edf5;
}

html[data-theme="dark"] .batch-keyword-summary-copy strong,
html[data-theme="dark"] .batch-keyword-summary-stats b {
  color: #e7edf5;
}

html[data-theme="dark"] .keyword-search-mode button.active {
  color: #e7edf5;
  background: #263547;
}

html[data-theme="dark"] .search-panel .search-control textarea {
  color: #e7edf5;
  background: #101923;
  border-color: #46576c;
}

html[data-theme="dark"] .search-panel .search-control textarea:focus {
  background: #101923;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.22);
}

@media (max-width: 760px) {
  .search-panel .search-control textarea {
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 7px;
    font-size: 14px;
  }

  .batch-keyword-summary {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .product-image-candidate-source {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .product-image-candidate-source > img {
    width: 46px;
    height: 46px;
  }

  .product-image-candidate-keywords {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .batch-keyword-summary-stats,
  .batch-keyword-progress {
    grid-column: 1;
  }

  .batch-keyword-summary-stats {
    flex-wrap: wrap;
    white-space: normal;
  }

  .batch-keyword-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .batch-keyword-tabs button {
    flex: 0 0 164px;
  }

  .batch-keyword-current,
  .batch-keyword-loading-copy {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .batch-keyword-current > span {
    width: fit-content;
  }

  .batch-keyword-current > small,
  .batch-keyword-loading-copy > small {
    white-space: normal;
  }

  .batch-keyword-loading-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final same-products card polish. Keep after legacy rules so the compact hierarchy wins. */
.same-products-service-options {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(190px, 0.75fr) minmax(230px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.same-products-service-group {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.same-products-service-group + .same-products-service-group {
  padding-left: 14px;
  border-left: 1px solid #e2e8ef;
}

.same-products-service-group-label {
  color: #718096;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.same-products-service-group-controls {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.same-products-service-options label {
  min-height: 27px;
  gap: 6px;
  padding: 2px 7px;
  background: #ffffff;
  border-color: #dce4ed;
  font-size: 11px;
}

.same-products-service-options label:has(input:checked) {
  box-shadow: inset 0 0 0 1px currentColor;
}

.same-products-card-grid {
  max-height: calc(100vh - 405px);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  padding: 12px 18px 20px;
  background: #f4f7fa;
}

.same-products-card {
  border-color: #dfe6ee;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(23, 42, 66, 0.05);
}

.same-products-card:hover {
  border-color: #b9c8d7;
  box-shadow: 0 4px 12px rgba(23, 42, 66, 0.08);
}

.same-products-card.is-preferred {
  border-color: #dfe6ee;
  box-shadow: 0 1px 3px rgba(23, 42, 66, 0.05);
}

.same-products-card-media {
  background: #f7f9fb;
  border-bottom: 0;
}

.same-products-card-body {
  gap: 8px;
  padding: 11px 12px 10px;
}

.same-products-card-title {
  min-height: 48px;
  gap: 4px;
}

.same-products-card-title a,
.same-products-card-title > strong {
  min-height: 40px;
  color: #111111;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
}

.same-products-card-title span {
  color: #8995a4;
  font-size: 9.5px;
  font-weight: 700;
}

.same-products-card-commerce {
  min-height: 28px;
  grid-template-columns: minmax(68px, 1.2fr) repeat(2, minmax(0, 1fr));
}

.same-products-card-commerce strong {
  color: #c73942;
  font-size: 17px;
  font-weight: 900;
}

.same-products-card-commerce span {
  color: #667589;
  font-size: 10.5px;
  font-weight: 750;
}

.same-products-card-supplier {
  min-height: 64px;
  gap: 6px;
  padding-top: 2px;
  border-top: 0;
}

.same-products-card-supplier > a,
.same-products-card-supplier > strong {
  color: #29445f;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
}

.same-products-card-tags {
  min-height: 20px;
  align-content: flex-start;
}

.same-products-card-category,
.same-products-card-tags span {
  min-height: 19px;
  padding: 1px 5px;
  color: #667487;
  background: #f1f4f7;
  border: 0;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 750;
}

.same-products-card-category {
  color: #75530e;
  background: #fff4d8;
}

.same-products-shop-years {
  min-height: 20px;
  padding: 1px 6px;
  color: #226657;
  background: #edf7f4;
  border: 0;
  border-radius: 3px;
  font-size: 10px;
}

.same-products-shop-identities span {
  min-height: 20px;
  padding: 2px 6px;
  border: 0;
  border-radius: 3px;
  font-size: 9.5px;
}

.same-products-card-actions {
  grid-template-columns: auto minmax(84px, 1fr);
  gap: 8px;
  padding: 9px 12px;
  background: #ffffff;
  border-top-color: #edf1f5;
}

.same-products-card-actions:has(.same-products-open-product) {
  grid-template-columns: auto minmax(84px, 1fr) 32px;
}

.same-products-card-actions label {
  min-height: 32px;
  color: #647286;
  font-size: 10.5px;
}

.same-products-card-actions button[data-add-supplier-to-selection] {
  min-height: 32px;
  color: #ffffff;
  background: #173a63;
  border-color: #173a63;
  font-size: 10.5px;
}

.same-products-card-actions button[data-add-supplier-to-selection]:hover,
.same-products-card-actions button[data-add-supplier-to-selection]:focus-visible {
  background: #102f52;
  border-color: #102f52;
}

.same-products-card-actions button[data-add-supplier-to-selection].is-preferred {
  color: #684600;
  background: #f8df9a;
  border-color: #d4a841;
}

.same-products-card-actions .same-products-open-product {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  color: #173a63;
  background: #edf3f8;
  border: 0;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1;
}

.same-products-card-actions .same-products-open-product::before {
  content: "≡";
}

html[data-theme="dark"] .same-products-service-group + .same-products-service-group {
  border-left-color: #344357;
}

html[data-theme="dark"] .same-products-service-options label,
html[data-theme="dark"] .same-products-card-actions {
  background: #151f2a;
}

html[data-theme="dark"] .same-products-card-grid {
  background: #101923;
}

@media (max-width: 1180px) {
  .same-products-service-options {
    grid-template-columns: 1fr 1fr;
  }

  .same-products-service-group.is-fulfillment {
    grid-column: 1 / -1;
  }

  .same-products-service-group.is-verification {
    padding-left: 0;
    border-left: 0;
  }

  .same-products-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  }
}

@media (max-width: 760px) {
  .same-products-service-options {
    grid-template-columns: 1fr;
  }

  .same-products-service-group,
  .same-products-service-group.is-fulfillment {
    grid-column: 1;
    padding-left: 0;
    border-left: 0;
  }

  .same-products-service-group-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .same-products-card-grid {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 14px 20px;
  }
}

@media (max-width: 480px) {
  .same-products-service-group-controls,
  .same-products-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Restore the compact same-products layout used before the grouped filter experiment. */
.same-products-service-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
}

.same-products-service-group,
.same-products-service-group-controls {
  display: contents;
}

.same-products-service-group-label {
  display: none;
}

.same-products-service-options label {
  min-height: 30px;
  gap: 7px;
  padding: 3px 8px;
  background: #f8fafc;
  font-size: 12px;
}

.same-products-card-grid {
  max-height: calc(100vh - 180px);
  min-height: 280px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
  gap: 8px;
  padding: 14px 20px 22px;
  background: #f3f6f9;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-color: #8ea2b8 #e8eef4;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.same-products-table-wrap {
  max-height: calc(100vh - 180px);
  overflow-x: auto;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-color: #8ea2b8 #e8eef4;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.same-products-card-grid::-webkit-scrollbar,
.same-products-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.same-products-card-grid::-webkit-scrollbar-track,
.same-products-table-wrap::-webkit-scrollbar-track {
  background: #e8eef4;
}

.same-products-card-grid::-webkit-scrollbar-thumb,
.same-products-table-wrap::-webkit-scrollbar-thumb {
  background: #8ea2b8;
  border: 3px solid #e8eef4;
  border-radius: 6px;
}

.same-products-card-grid::-webkit-scrollbar-thumb:hover,
.same-products-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #6f879f;
}

.same-products-card {
  align-self: start;
  grid-template-rows: auto auto auto;
}

.same-products-card-supplier {
  min-height: 0;
}

.same-products-card-supplier-heading {
  min-width: 0;
}

.same-products-card-tenure .same-products-shop-years {
  min-height: 19px;
  padding: 1px 5px;
  font-size: 10px;
  white-space: nowrap;
}

.same-products-supplier-meta:empty,
.same-products-card-tags:empty {
  display: none;
}

.same-products-card-tags {
  min-height: 0;
}

.same-products-card-tags span.is-free-shipping {
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffc9c5;
}

.same-products-supplier-meta > span.is-free-shipping {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  padding: 1px 5px;
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffc9c5;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.same-products-card-tags span.is-pay-later {
  color: #116149;
  background: #edf8f3;
  border: 1px solid #b8e2d2;
}

.same-products-supplier-meta > span.is-pay-later {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  padding: 1px 5px;
  color: #116149;
  background: #edf8f3;
  border: 1px solid #b8e2d2;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.same-products-card-actions {
  grid-template-columns: auto minmax(76px, 1fr);
  gap: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border-top-color: #e1e8ef;
}

.same-products-card-actions:has(.same-products-open-product) {
  grid-template-columns: auto minmax(76px, 1fr) minmax(44px, auto);
}

.same-products-card-actions .same-products-open-product {
  display: inline-flex;
  width: auto;
  min-width: 44px;
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 850;
}

.same-products-card-actions .same-products-open-product::before {
  display: none;
  content: none;
}

html[data-theme="dark"] .same-products-service-options label,
html[data-theme="dark"] .same-products-card-actions {
  background: #151f2a;
}

@media (min-width: 1181px) and (max-width: 1439px) {
  .same-products-card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .same-products-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .same-products-service-options {
    display: flex;
  }

  .same-products-card-grid {
    max-height: calc(100vh - 180px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .same-products-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact 1688 result wall: dense scan-first cards with the native marketplace rhythm. */
.same-products-card-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  padding: 10px 12px 18px;
  background: #ffffff;
}

.same-products-card {
  border-color: #e2e7ec;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(31, 45, 61, 0.06);
}

.same-products-card:hover {
  border-color: #c6d1dc;
  box-shadow: 0 4px 12px rgba(31, 45, 61, 0.1);
}

.same-products-card-media {
  height: clamp(176px, 11vw, 196px);
  aspect-ratio: auto;
  background: #f5f6f7;
  border-bottom-color: #edf0f3;
}

.same-products-card-rank {
  top: 5px;
  left: 5px;
  min-height: 20px;
  padding: 2px 6px;
  color: #ffffff;
  background: #244c73;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.2;
}

.same-products-card-rank.is-condition {
  color: #d45112;
  background: rgba(255, 248, 241, 0.94);
  border: 1px solid #ffb37e;
}

.same-products-card-body {
  gap: 6px;
  padding: 8px 9px 7px;
}

.same-products-card-title {
  min-height: 36px;
  gap: 3px;
}

.same-products-card-title a,
.same-products-card-title > strong {
  min-height: 34px;
  font-size: 12px;
  line-height: 1.4;
}

.same-products-card-title span {
  font-size: 9px;
}

.same-products-card-commerce {
  min-height: 24px;
  grid-template-columns: minmax(58px, 1.2fr) repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.same-products-card-commerce strong {
  color: #d94c18;
  font-size: 15px;
}

.same-products-card-commerce span {
  color: #697586;
  font-size: 9px;
  line-height: 1.25;
}

.same-products-card-supplier {
  min-height: 0;
  gap: 4px;
  padding-top: 6px;
  border-top-color: #f0f2f4;
}

.same-products-card-supplier-heading > a,
.same-products-card-supplier-heading > strong {
  font-size: 10.5px;
}

.same-products-card-supplier > div,
.same-products-supplier-meta,
.same-products-card-tags {
  max-height: 20px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.same-products-card-category,
.same-products-card-tags span,
.same-products-shop-years,
.same-products-shop-identities span {
  min-height: 18px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  white-space: nowrap;
}

.same-products-card-actions {
  grid-template-columns: auto minmax(72px, 0.8fr) minmax(92px, 1fr);
  gap: 6px;
  padding: 6px 8px;
  background: #fbfcfd;
}

.same-products-card-actions:not(:has(.same-products-open-product)) {
  grid-template-columns: auto minmax(92px, 1fr);
}

.same-products-card-actions label {
  min-height: 28px;
  font-size: 9px;
}

.same-products-card-actions button,
.same-products-card-actions a,
.same-products-card-actions button[data-add-supplier-to-selection] {
  min-height: 28px;
  padding: 3px 6px;
  font-size: 9px;
}

.same-products-card-actions .same-products-open-product {
  width: 100%;
  min-width: 72px;
  height: 32px;
  min-height: 32px;
  padding: 4px 12px;
  color: #173a63;
  background: #edf3f8;
  border: 1px solid #d5e1ec;
  font-size: 10.5px;
  font-weight: 850;
}

.same-products-card-actions button[data-add-supplier-to-selection] {
  width: 100%;
  min-width: 92px;
  height: 32px;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 10px;
}

html[data-theme="dark"] .same-products-card-grid {
  background: #101923;
}

@media (max-width: 1180px) {
  .same-products-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1181px) and (max-width: 1439px) {
  .same-products-card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .same-products-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .same-products-card-media {
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 480px) {
  .same-products-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Selection workflow usability: bounded batch actions, collapsible exports, and split-view layouts. */
.sku-panel-actions,
.same-search-selection-limit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sku-table-wrap[hidden] {
  display: none !important;
}

.sku-toggle-button::before {
  content: "+";
  display: inline-grid;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  place-items: center;
  color: #ffffff;
  background: #2563a8;
  border-radius: 3px;
  line-height: 1;
}

.sku-toggle-button[aria-expanded="true"]::before {
  content: "−";
}

.same-search-selection-limit {
  min-height: 32px;
  padding: 0 7px;
  color: #526579;
  background: #ffffff;
  border: 1px solid #d1deeb;
  border-radius: 5px;
}

.same-search-selection-limit > span {
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.same-search-selection-limit select {
  width: 82px;
  height: 26px;
  padding: 0 22px 0 6px;
  color: #17365a;
  background: #ffffff;
  border: 0;
  font-size: 11px;
  font-weight: 850;
}

.product-search-table-scroll,
.competitor-table-wrap {
  scrollbar-gutter: stable;
  overscroll-behavior-inline: contain;
}

@media (min-width: 761px) and (max-width: 1180px) {
  body .selection-workflow {
    position: sticky;
    top: 106px;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: 24;
    width: calc(100% - 24px);
    max-height: none;
    margin: 12px auto 0;
    overflow: visible;
    border: 1px solid #d4e0ee;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(18, 40, 68, 0.08);
  }

  body .selection-workflow-inner {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 10px;
  }

  body .selection-workflow-title {
    display: flex;
    min-width: 0;
  }

  body .selection-workflow-title strong {
    font-size: 12px;
    white-space: normal;
  }

  body .selection-workflow-steps {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }

  body .selection-workflow-step {
    width: auto;
    min-width: 0;
    min-height: 54px;
    gap: 5px;
    padding: 6px;
  }

  body .selection-workflow-filter-wrap {
    width: auto;
    min-width: 0;
  }

  body .selection-workflow-filter-wrap .selection-workflow-step {
    width: auto;
  }

  body .workflow-filter-toggle {
    min-width: 42px;
    padding: 0 6px;
    font-size: 10px;
  }

  body .selection-workflow-step[data-workflow-step="collect"] { grid-column: 1; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="keywords"] { grid-column: 2; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="competitors"] { grid-column: 3; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="filter"] { grid-column: 4; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="imageSearch"] { grid-column: 5; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="decision"] { grid-column: 6; grid-row: 1; }

  body .selection-workflow-branch {
    grid-column: 5 / 7;
    grid-row: 2;
    margin: 0;
    padding: 0;
  }

  body .selection-workflow-branch::before {
    display: none;
  }

  body .selection-workflow-step:not(:last-child)::after {
    display: none;
  }

  body .selection-workflow-step .workflow-copy strong {
    font-size: 11px;
    white-space: normal;
  }
}

@media (max-width: 760px) {
  body .selection-workflow-branch {
    grid-column: 5 / 7;
    grid-row: 2;
    margin: 0;
    padding: 0;
  }

  body .selection-workflow-branch::before {
    display: none;
  }
}

@media (max-width: 520px) {
  body .selection-workflow-step[data-workflow-step="collect"] { grid-column: 1; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="keywords"] { grid-column: 2; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="competitors"] { grid-column: 3; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="filter"] { grid-column: 1; grid-row: 2; }
  body .selection-workflow-step[data-workflow-step="imageSearch"] { grid-column: 2; grid-row: 2; }
  body .selection-workflow-step[data-workflow-step="decision"] { grid-column: 3; grid-row: 2; }

  body .selection-workflow-branch {
    grid-column: 1 / 4;
    grid-row: 3;
  }
}

@media (max-width: 1180px) {
  .competitor-page-head,
  .same-search-head {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .competitor-head-actions,
  .same-search-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .competitor-table-wrap {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    overflow-x: auto;
  }

  .competitor-table {
    min-width: 1360px;
  }

  .competitor-table .competitor-col-name { width: 360px; }
  .competitor-table .competitor-col-media { width: 110px; }
  .competitor-table .competitor-col-brand { width: 90px; }

  .product-search-table-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .same-search-batch-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .selection-candidate-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-status-select {
    width: min(240px, 100%);
    flex-basis: auto;
  }

  .selection-candidate-decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-candidate-decision-grid > label {
    grid-column: 1 / -1;
  }

  .selection-candidate-actions button.danger {
    margin-left: 0;
  }
}

@media (max-width: 1000px) {
  .result-head,
  .result-actions-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions-bar,
  .result-sort-control {
    width: 100%;
  }

  .result-sort-control select {
    min-width: 0;
    flex: 1;
  }

  .product-search-row-table {
    min-width: 1080px;
  }

  .product-search-row-table col:nth-child(9),
  .product-search-row-table th:nth-child(9),
  .product-search-row-table td:nth-child(9),
  .product-search-row-table col:nth-child(11),
  .product-search-row-table th:nth-child(11),
  .product-search-row-table td:nth-child(11),
  .product-search-row-table col:nth-child(12),
  .product-search-row-table th:nth-child(12),
  .product-search-row-table td:nth-child(12) {
    display: none;
  }
}

@media (max-width: 760px) {
  .sku-panel .panel-head,
  .sku-panel-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sku-panel-actions button {
    width: 100%;
  }

  .same-search-batch-actions {
    justify-content: flex-start;
  }

  .selection-candidate-decision-grid {
    grid-template-columns: 1fr;
  }

  .selection-candidate-decision-grid > label {
    grid-column: 1;
  }
}

/* Shared desktop page frame for every application page. Keep last so it wins over legacy layout rules. */
@media (min-width: 1181px) {
  :root {
    --app-page-max-width: 1760px;
    --app-page-gutter: clamp(32px, 3vw, 56px);
    --app-page-edge: max(var(--app-page-gutter), calc((100vw - var(--app-page-max-width)) / 2));
    --app-workflow-gap: 20px;
  }

  body .selection-workflow,
  body.workflow-overlay-page .selection-workflow {
    left: var(--app-page-edge);
  }

  .market-layout {
    width: auto;
    max-width: none;
    margin-right: var(--app-page-edge);
    margin-left: calc(var(--app-page-edge) + var(--workflow-rail-width) + var(--app-workflow-gap));
  }

  .secondary-workspace {
    width: auto;
    max-width: var(--app-page-max-width);
    margin-right: var(--app-page-edge);
    margin-left: var(--app-page-edge);
  }
}

@media (max-width: 640px) {
  .market-layout .search-panel .search-control {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .market-layout .search-panel .search-control textarea {
    width: 100%;
    min-height: 74px;
    resize: none;
  }

  .market-layout .search-control-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-layout .search-control-actions button {
    width: 100%;
    min-width: 0;
  }
}

/* Review query workspace: compact hierarchy for asynchronous review tasks. */
.review-query-page {
  min-width: 0;
  overflow: hidden;
  color: #26384c;
  background: #f5f7fa;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
}

.review-query-page-head {
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  background: #ffffff;
  border-bottom: 1px solid #e0e7ef;
}

.review-query-page-heading {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 14px;
  row-gap: 5px;
}

.review-query-page-head .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  color: #4f6f91;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.review-query-page-head h2 {
  margin: 0;
  color: #172b41;
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: 0;
}

.review-query-page-head p:last-child {
  min-width: 0;
  margin: 0;
  color: #718096;
  font-size: 12px;
  font-weight: 650;
}

.review-query-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.review-query-add {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  color: #ffffff;
  background: #1f5f95;
  border-color: #1f5f95;
  border-radius: 5px;
  box-shadow: none;
}

.review-query-add span {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.review-query-add:hover:not(:disabled) {
  background: #174c79;
  border-color: #174c79;
  box-shadow: none;
  transform: none;
}

.review-query-refresh {
  display: inline-flex;
  min-width: 78px;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #315b88;
  background: #ffffff;
  border-color: #c6d4e2;
  border-radius: 5px;
}

.review-query-refresh span {
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

.review-query-refresh:hover:not(:disabled) {
  color: #164f85;
  background: #f2f7fc;
  border-color: #8fb2d3;
}

.review-request-panel {
  width: min(560px, 100%);
  border-radius: 8px;
}

.review-request-panel .compare-dialog-head p:last-child {
  margin: 5px 0 0;
  color: #6c7a8b;
  font-size: 12px;
  line-height: 1.6;
}

.review-rating-panel {
  width: min(1040px, 100%);
  border-radius: 8px;
}

.review-rating-panel .compare-dialog-head p:last-child {
  margin: 5px 0 0;
  color: #6c7a8b;
  font-size: 12px;
  line-height: 1.6;
}

.review-rating-dialog-body {
  display: grid;
  gap: 16px;
}

.review-rating-count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.review-rating-count-card {
  display: grid;
  width: 100%;
  min-height: 92px;
  align-content: center;
  gap: 8px;
  padding: 12px 8px;
  font: inherit;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  border: 1px solid #dfe6ef;
  border-top: 3px solid #9aa7b8;
  border-radius: 6px;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.review-rating-count-card:hover {
  background: #f2f7fc;
}

.review-rating-count-card.is-active {
  background: #edf5fc;
  border-color: #7faed2;
  box-shadow: 0 0 0 2px rgb(47 120 183 / 12%);
}

.review-rating-count-card:focus-visible {
  outline: 2px solid #2f78b7;
  outline-offset: 2px;
}

.review-rating-count-card span {
  color: #637286;
  font-size: 12px;
  font-weight: 700;
}

.review-rating-count-card strong {
  color: #1f4269;
  font-size: 24px;
  line-height: 1;
}

.review-rating-count-card.is-1 { border-top-color: #dc5668; }
.review-rating-count-card.is-2 { border-top-color: #e5864c; }
.review-rating-count-card.is-3 { border-top-color: #d3a136; }
.review-rating-count-card.is-4 { border-top-color: #63a36c; }
.review-rating-count-card.is-5 { border-top-color: #2f78b7; }

.review-rating-detail-note {
  margin: 0;
  color: #718096;
  font-size: 12px;
  line-height: 1.6;
}

.review-rating-detail-button {
  min-width: 46px;
  padding: 5px 9px;
  white-space: nowrap;
}

.review-detail-section {
  display: grid;
  gap: 8px;
}

.review-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #243b53;
}

.review-detail-section-head span {
  color: #718096;
  font-size: 11px;
}

.review-detail-table-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid #dce5ee;
  border-radius: 5px;
}

.review-detail-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
}

.review-detail-table th,
.review-detail-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e5ebf2;
  color: #405369;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

.review-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #51667d;
  background: #f2f6fa;
}

.review-detail-table th:nth-child(1) { width: 23%; }
.review-detail-table th:nth-child(2) { width: 13%; }
.review-detail-table th:nth-child(3) { width: 54%; }
.review-detail-table th:nth-child(4) { width: 10%; }

.review-detail-link a {
  display: block;
  overflow: hidden;
  color: #246699;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-detail-time,
.review-detail-rating {
  white-space: nowrap;
}

.review-detail-content {
  color: #253b52;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-detail-table td.review-detail-empty {
  padding: 28px 12px;
  color: #718096;
  text-align: center;
}

@media (max-width: 680px) {
  .review-rating-count-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.review-request-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.review-request-field {
  display: grid;
  gap: 7px;
  color: #33475b;
  font-size: 12px;
  font-weight: 800;
}

.review-request-field input,
.review-request-field select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 8px 11px;
  color: #22374c;
  background: #ffffff;
  border: 1px solid #cbd7e3;
  border-radius: 6px;
  outline: none;
}

.review-request-field input:focus,
.review-request-field select:focus {
  border-color: #2d78b7;
  box-shadow: 0 0 0 3px rgba(45, 120, 183, 0.14);
}

.keyword-library-panel {
  width: min(720px, 100%);
}

.keyword-library-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 680px) {
  .panel-head-actions {
    justify-content: flex-start;
  }

  .keyword-library-form-grid {
    grid-template-columns: 1fr;
  }
}

.review-request-status {
  min-height: 34px;
  margin: 0;
  padding: 8px 10px;
  color: #586b7e;
  background: #f3f7fa;
  border: 1px solid #dde6ef;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.review-request-status.is-error {
  color: #a23d45;
  background: #fff3f3;
  border-color: #e4b2b6;
}

.review-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.review-request-actions button {
  min-width: 88px;
  min-height: 36px;
}

.review-query-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #ffffff;
  border-bottom: 1px solid #dce5ee;
}

.review-query-metrics > div {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 82px;
  align-content: center;
  gap: 5px;
  padding: 13px 20px 12px 24px;
  border-right: 1px solid #e3eaf1;
}

.review-query-metrics > div::before {
  position: absolute;
  top: 21px;
  bottom: 21px;
  left: 13px;
  width: 3px;
  background: #7a9fc3;
  border-radius: 3px;
  content: "";
}

.review-query-metrics > div:nth-child(2)::before { background: #d1963c; }
.review-query-metrics > div:nth-child(3)::before { background: #2d927d; }
.review-query-metrics > div:nth-child(4)::before { background: #7d86a3; }

.review-query-metrics > div:last-child {
  border-right: 0;
}

.review-query-metrics span {
  overflow: hidden;
  color: #748397;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-query-metrics strong {
  color: #172d45;
  font-family: var(--font-number);
  font-size: 23px;
  line-height: 1;
}

.review-query-filter-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  background: #f7f9fc;
  border-bottom: 1px solid #dce5ee;
}

.review-query-owner-field {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding-right: 18px;
  border-right: 1px solid #d9e2ec;
}

.review-query-owner-field[hidden] {
  display: none !important;
}

.review-query-owner-field span,
.review-query-filter-label {
  color: #607187;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.review-query-owner-field select {
  width: 250px;
  min-height: 34px;
  padding: 5px 30px 5px 10px;
  color: #253c54;
  background-color: #ffffff;
  border: 1px solid #c8d5e2;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.review-query-status-filters {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.review-query-filter-label {
  margin-right: 3px;
}

.review-query-status-filters button {
  min-width: 70px;
  min-height: 32px;
  padding: 4px 11px;
  color: #596b80;
  background: #ffffff;
  border: 1px solid #ced9e4;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.review-query-status-filters button:hover {
  color: #245988;
  border-color: #9bb9d5;
}

.review-query-status-filters button.is-active {
  color: #ffffff;
  background: #245b8e;
  border-color: #245b8e;
  box-shadow: none;
}

.review-query-page .review-data-workspace {
  padding: 0;
  background: #ffffff;
  border-bottom: 0;
}

.review-query-page .review-data-head {
  min-height: 64px;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e2e9f1;
}

.review-query-page .review-data-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-query-page .review-data-head h3 {
  font-size: 15px;
}

.review-query-page .review-data-task-status,
.review-query-page #reviewDataTaskStatus {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  color: #607187;
  background: #f3f6f9;
  border: 1px solid #d6e0ea;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 850;
}

.review-query-page .review-data-task-status::before,
.review-query-page #reviewDataTaskStatus::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  background: #8b99aa;
  border-radius: 50%;
  content: "";
}

.review-query-page .review-data-task-status.completed {
  color: #146b5d;
  background: #eef9f5;
  border-color: #b4ddd3;
}

.review-query-page .review-data-task-status.completed::before { background: #1b8c76; }

.review-query-page .review-data-task-status.failed {
  color: #953741;
  background: #fff3f3;
  border-color: #e7bec2;
}

.review-query-page .review-data-task-status.failed::before { background: #c04e58; }

.review-query-page .review-data-task-status.dispatching,
.review-query-page .review-data-task-status.processing,
.review-query-page .review-data-task-status.queued {
  color: #315b88;
  background: #edf5fc;
  border-color: #bdd3e8;
}

.review-query-page .review-data-task-status.dispatching::before,
.review-query-page .review-data-task-status.processing::before,
.review-query-page .review-data-task-status.queued::before { background: #367db7; }

.review-data-admin-create {
  margin: 12px 20px 0;
  background: #f8fafc;
  border: 1px solid #dce5ee;
  border-radius: 6px;
}

.review-data-admin-create summary {
  padding: 10px 12px;
  color: #3c536b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.review-data-admin-create .review-data-head-actions {
  padding: 0 12px;
}

.review-data-admin-create .review-data-form {
  margin: 10px 12px 12px;
  background: #ffffff;
}

.review-query-page .review-data-import-form {
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 7px 12px;
  margin: 12px 20px 0;
  padding: 11px 12px;
  background: #f7f9fc;
  border: 1px solid #d9e3ed;
  border-radius: 6px;
}

.review-query-page .review-data-import-form label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #53677d;
}

.review-query-page .review-data-import-form label > span {
  white-space: nowrap;
}

.review-query-page .review-data-import-form input[type="file"] {
  width: 100%;
  min-height: 36px;
  padding: 3px;
  color: #56697d;
  background: #ffffff;
  border: 1px solid #cbd7e3;
  border-radius: 5px;
}

.review-query-page .review-data-import-form input[type="file"]::file-selector-button {
  height: 28px;
  margin-right: 9px;
  padding: 0 10px;
  color: #315b88;
  background: #eef4fa;
  border: 0;
  border-right: 1px solid #d4dee9;
  border-radius: 3px 0 0 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.review-query-page .review-data-import-form button {
  min-width: 102px;
  min-height: 36px;
  color: #ffffff;
  background: #245b8e;
  border-color: #245b8e;
  border-radius: 5px;
}

.review-query-page .review-data-import-form button:disabled {
  color: #8795a6;
  background: #e8edf2;
  border-color: #d8e0e8;
}

.review-query-page .review-data-import-form small {
  color: #7b8999;
  line-height: 1.5;
}

.review-query-page .review-data-result-block,
.review-query-page .review-data-history-block {
  margin-top: 0;
  padding: 18px 20px 20px;
  background: #ffffff;
}

.review-query-page .review-data-import-form + .review-data-result-block,
.review-query-page .review-data-admin-create + .review-data-import-form + .review-data-result-block,
.review-query-page .review-data-head + .review-data-result-block {
  margin-top: 14px;
}

.review-query-page .review-data-history-block {
  background: #f9fbfd;
  border-top: 1px solid #dce5ee;
}

.review-query-page .review-data-section-title {
  min-height: 30px;
}

.review-query-page .review-data-section-title h4 {
  position: relative;
  padding-left: 11px;
  color: #20384f;
  font-size: 14px;
}

.review-query-page .review-data-section-title h4::before {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 3px;
  background: #397aa9;
  border-radius: 2px;
  content: "";
}

.review-data-history-tools,
.review-data-date-range {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.review-data-history-tools {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.review-data-history-tools > span,
.review-data-date-range > span {
  color: #6f7f92;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.review-data-date-range {
  padding-left: 10px;
  border-left: 1px solid #d7e1eb;
}

.review-data-date-range input {
  width: 134px;
  min-height: 32px;
  padding: 4px 7px;
  color: #2c4259;
  background: #ffffff;
  border: 1px solid #c8d5e2;
  border-radius: 4px;
  font-family: var(--font-number);
  font-size: 10px;
}

.review-data-date-range button {
  min-height: 32px;
  padding: 4px 9px;
  color: #315b88;
  background: #ffffff;
  border: 1px solid #c7d5e3;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
}

.review-data-date-range button:disabled {
  cursor: default;
  opacity: 0.45;
}

.review-data-section-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.review-data-section-actions > span {
  overflow: hidden;
  color: #6f7f92;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-query-page .review-data-section-actions .text-button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  color: #315b88;
  background: #ffffff;
  border: 1px solid #c7d5e3;
  border-radius: 4px;
  font-size: 11px;
}

.review-data-result-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.review-data-result-highlights[hidden] {
  display: none;
}

.review-data-result-highlights article {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 92px;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  overflow: hidden;
  color: #51667d;
  background: #f7fafc;
  border: 1px solid #d9e4ee;
  border-radius: 6px;
}

.review-data-result-highlights article::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: #7c91a8;
  content: "";
}

.review-data-result-highlights article.is-primary {
  color: #174a73;
  background: #edf6fd;
  border-color: #b9d6eb;
}

.review-data-result-highlights article.is-primary::before { background: #2879ad; }

.review-data-result-highlights article.is-recent {
  color: #176454;
  background: #edf9f5;
  border-color: #b9dfd2;
}

.review-data-result-highlights article.is-recent::before { background: #22947a; }

.review-data-result-highlights span {
  font-size: 11px;
  font-weight: 850;
}

.review-data-result-highlights strong {
  overflow-wrap: anywhere;
  color: #18344f;
  font-family: var(--font-number);
  font-size: 24px;
  line-height: 1.1;
}

.review-data-result-highlights .is-primary strong { color: #175b8a; }
.review-data-result-highlights .is-recent strong { color: #13735f; }

.review-data-result-highlights small {
  color: #7a8a9c;
  font-size: 9px;
  font-weight: 700;
}

.review-query-page .review-data-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  background: #ffffff;
  border-color: #d8e2ec;
  border-radius: 6px;
}

.review-query-page .review-data-table {
  min-width: 980px;
}

.review-query-page .review-data-table th,
.review-query-page .review-data-table td {
  height: 43px;
  padding: 9px 11px;
  border-bottom-color: #e5ecf3;
  font-size: 11px;
}

.review-query-page .review-data-table th {
  color: #53677d;
  background: #f2f6fa;
  white-space: nowrap;
}

.review-query-page .review-data-table tbody tr {
  transition: background-color 120ms ease;
}

.review-query-page .review-data-table tbody tr:hover td {
  background: #f7fafc;
}

.review-query-page .review-data-table tbody tr.is-active td,
.review-query-page .review-data-table tbody tr.is-active:hover td {
  background: #edf5fc;
}

.review-query-page .review-data-table tbody tr.is-active td:first-child {
  box-shadow: inset 3px 0 #397aa9;
}

.review-query-page .review-data-result-number strong {
  color: #1e5d8f;
  font-family: var(--font-number);
  font-size: 14px;
}

.review-query-page .review-data-result-number.is-recent strong {
  color: #14745f;
}

.review-query-page .review-data-row-actions {
  flex-wrap: wrap;
}

.review-query-page .review-data-row-actions button {
  min-height: 29px;
  padding: 3px 8px;
  border-radius: 4px;
}

.review-query-page .review-data-row-actions button:hover {
  background: #eef5fb;
  border-color: #8eafd0;
}

.review-query-page .review-data-row-actions button.danger {
  color: #a2434c;
  border-color: #dfb9bd;
}

.review-query-page .review-data-row-actions button.danger:hover {
  background: #fff2f2;
  border-color: #d49399;
}

.review-query-page .review-data-product-thumb {
  box-shadow: 0 2px 6px rgba(25, 48, 73, 0.08);
}

html[data-theme="dark"] .review-query-page,
html[data-theme="dark"] .review-query-page-head,
html[data-theme="dark"] .review-query-metrics,
html[data-theme="dark"] .review-query-page .review-data-workspace,
html[data-theme="dark"] .review-query-page .review-data-head,
html[data-theme="dark"] .review-query-page .review-data-result-block {
  color: #dce5ef;
  background: #19232f;
  border-color: #344357;
}

html[data-theme="dark"] .review-query-page-head h2,
html[data-theme="dark"] .review-query-metrics strong,
html[data-theme="dark"] .review-query-page .review-data-head h3,
html[data-theme="dark"] .review-query-page .review-data-section-title h4 {
  color: #edf3fa;
}

html[data-theme="dark"] .review-query-filter-bar,
html[data-theme="dark"] .review-query-page .review-data-history-block,
html[data-theme="dark"] .review-data-admin-create,
html[data-theme="dark"] .review-query-page .review-data-import-form {
  background: #151f2a;
  border-color: #344357;
}

html[data-theme="dark"] .review-query-metrics > div,
html[data-theme="dark"] .review-query-owner-field {
  border-color: #344357;
}

html[data-theme="dark"] .review-query-status-filters button,
html[data-theme="dark"] .review-query-owner-field select,
html[data-theme="dark"] .review-query-refresh,
html[data-theme="dark"] .review-query-page .review-data-section-actions .text-button,
html[data-theme="dark"] .review-query-page .review-data-row-actions button,
html[data-theme="dark"] .review-query-page .review-data-import-form input[type="file"] {
  color: #c9d7e6;
  background: #1d2a38;
  border-color: #43566b;
}

html[data-theme="dark"] .review-request-panel,
html[data-theme="dark"] .review-request-field input,
html[data-theme="dark"] .review-request-field select {
  color: #e1eaf3;
  background: #19232f;
  border-color: #43566b;
}

html[data-theme="dark"] .review-request-field { color: #c7d4e1; }
html[data-theme="dark"] .review-request-panel .compare-dialog-head p:last-child { color: #9eacbd; }
html[data-theme="dark"] .review-request-status {
  color: #b9c7d5;
  background: #151f2a;
  border-color: #344357;
}
html[data-theme="dark"] .review-request-status.is-error {
  color: #f0a4aa;
  background: #351e20;
  border-color: #784044;
}

html[data-theme="dark"] .review-query-status-filters button.is-active,
html[data-theme="dark"] .review-query-page .review-data-import-form button:not(:disabled) {
  color: #ffffff;
  background: #2d6fa5;
  border-color: #2d6fa5;
}

html[data-theme="dark"] .review-query-page .review-data-table-wrap,
html[data-theme="dark"] .review-query-page .review-data-table,
html[data-theme="dark"] .review-query-page .review-data-table th,
html[data-theme="dark"] .review-query-page .review-data-table td {
  border-color: #344357;
}

html[data-theme="dark"] .review-query-page .review-data-table th {
  color: #b5c3d2;
  background: #202c39;
}

html[data-theme="dark"] .review-query-page .review-data-table td {
  color: #c8d4e1;
  background: #19232f;
}

html[data-theme="dark"] .review-data-import-preview,
html[data-theme="dark"] .review-data-import-preview-wrap,
html[data-theme="dark"] .review-detail-table-wrap {
  background: #19232f;
  border-color: #344357;
}

html[data-theme="dark"] .review-data-import-preview-table th,
html[data-theme="dark"] .review-detail-table th {
  color: #b5c3d2;
  background: #202c39;
  border-color: #344357;
}

html[data-theme="dark"] .review-data-import-preview-table td,
html[data-theme="dark"] .review-detail-table td {
  color: #c8d4e1;
  background: #19232f;
  border-color: #344357;
}

html[data-theme="dark"] .review-import-content,
html[data-theme="dark"] .review-detail-content,
html[data-theme="dark"] .review-detail-section-head {
  color: #e0e8f1;
}

html[data-theme="dark"] .review-import-link a,
html[data-theme="dark"] .review-detail-link a {
  color: #8dcaef;
}

html[data-theme="dark"] .review-query-page .review-data-table tbody tr:hover td {
  background: #202c39;
}

html[data-theme="dark"] .review-query-page .review-data-table tbody tr.is-active td {
  background: #22364a;
}

html[data-theme="dark"] .review-data-date-range { border-color: #344357; }
html[data-theme="dark"] .review-data-history-tools > span,
html[data-theme="dark"] .review-data-date-range > span { color: #aebdcd; }
html[data-theme="dark"] .review-data-date-range input,
html[data-theme="dark"] .review-data-date-range button {
  color: #d5e1ed;
  background: #1d2a38;
  border-color: #43566b;
}

html[data-theme="dark"] .review-data-result-highlights article {
  color: #b7c6d5;
  background: #202c39;
  border-color: #3b4c60;
}

html[data-theme="dark"] .review-data-result-highlights article.is-primary {
  color: #a8d3f1;
  background: #193047;
  border-color: #355f80;
}

html[data-theme="dark"] .review-data-result-highlights article.is-recent {
  color: #9edcca;
  background: #18342e;
  border-color: #356b5d;
}

html[data-theme="dark"] .review-data-result-highlights strong,
html[data-theme="dark"] .review-query-page .review-data-result-number strong { color: #e9f2fa; }
html[data-theme="dark"] .review-data-result-highlights .is-primary strong { color: #8dcaef; }
html[data-theme="dark"] .review-data-result-highlights .is-recent strong,
html[data-theme="dark"] .review-query-page .review-data-result-number.is-recent strong { color: #83d7bf; }
html[data-theme="dark"] .review-data-result-highlights small { color: #8fa1b4; }

/* 1688 candidate profit comparison */
.profit-comparison-page {
  min-height: calc(100vh - 96px);
  color: #1d2b3d;
  background: #f5f7fa;
}

.profit-comparison-head {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  background: #ffffff;
  border-bottom: 1px solid #dce5ef;
}

.profit-comparison-head h2 {
  margin: 2px 0 5px;
  color: #14263d;
  font-size: 20px;
}

.profit-comparison-head p:last-child {
  margin: 0;
  color: #65758a;
  font-size: 13px;
  font-weight: 700;
}

.profit-comparison-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.profit-comparison-settings {
  padding: 18px 22px 20px;
  background: #ffffff;
  border-bottom: 1px solid #dce5ef;
}

.profit-comparison-settings-head h3 {
  margin: 0;
  color: #1c3149;
  font-size: 15px;
}

.profit-comparison-settings-head p {
  margin: 4px 0 0;
  color: #708095;
  font-size: 12px;
  font-weight: 700;
}

.profit-comparison-input-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.profit-comparison-input-grid label,
.profit-comparison-sale-price {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: #53647a;
  font-size: 11px;
  font-weight: 850;
}

.profit-comparison-input-grid input,
.profit-comparison-sale-price input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 6px 9px;
  color: #14263d;
  background: #ffffff;
  border: 1px solid #cbd7e4;
  border-radius: 5px;
  font: inherit;
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 800;
}

.profit-comparison-input-grid input:focus,
.profit-comparison-sale-price input:focus {
  border-color: #1677ff;
  outline: 2px solid rgba(22, 119, 255, 0.16);
}

.profit-comparison-groups {
  display: grid;
  gap: 16px;
  padding: 18px 22px 28px;
}

.profit-comparison-group {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d8e2ec;
  border-radius: 7px;
}

.profit-comparison-product-head {
  display: grid;
  grid-template-columns: 58px minmax(260px, 1fr) 180px minmax(220px, 0.6fr) minmax(132px, auto);
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #dce5ef;
}

.profit-comparison-product-image,
.profit-comparison-candidate-image {
  display: grid;
  overflow: hidden;
  place-items: center;
  cursor: zoom-in;
  background: #ffffff;
  border: 1px solid #d4dee9;
  border-radius: 5px;
}

.profit-comparison-product-image {
  width: 58px;
  height: 58px;
}

.profit-comparison-candidate-image {
  width: 48px;
  height: 48px;
  margin: 0 auto;
}

.profit-comparison-product-image img,
.profit-comparison-candidate-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profit-comparison-product-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profit-comparison-product-copy > span,
.profit-comparison-best span {
  color: #6d7d90;
  font-size: 10px;
  font-weight: 900;
}

.profit-comparison-product-copy h3 {
  margin: 0;
  overflow: hidden;
  color: #17324f;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-comparison-product-copy h3 a {
  color: inherit;
}

.profit-comparison-product-copy small {
  color: #6f8093;
  font-size: 11px;
  font-weight: 750;
}

.profit-comparison-best {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding-left: 16px;
  border-left: 1px solid #d8e2ec;
}

.profit-comparison-best strong {
  overflow: hidden;
  color: #176f63;
  font-family: var(--font-number);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-comparison-watch-action {
  display: grid;
  min-width: 132px;
  gap: 5px;
  justify-items: end;
}

.profit-comparison-watch-action small {
  max-width: 180px;
  color: #718095;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
}

.profit-comparison-watch-button {
  min-height: 32px;
  padding: 0 12px;
  color: #ffffff;
  background: #1677ff;
  border: 1px solid #1677ff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.profit-comparison-watch-button:hover { background: #0f63d7; }
.profit-comparison-watch-button.is-watched {
  color: #176f63;
  background: #e2f5ee;
  border-color: #a8dacb;
}

.profit-comparison-watch-button:disabled { opacity: 0.65; cursor: wait; }

.watch-bound-suppliers {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f0f8f6;
  border: 1px solid #cce7df;
  border-radius: 6px;
}

.watch-bound-suppliers-label {
  color: #176f63;
  font-size: 11px;
  font-weight: 900;
}

.watch-bound-supplier-list { display: grid; gap: 5px; }
.watch-bound-supplier {
  min-width: 0;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid #d5ebe5;
  border-radius: 5px;
}

.watch-bound-supplier-copy { display: grid; min-width: 0; gap: 2px; }
.watch-bound-supplier-copy a,
.watch-bound-supplier-copy strong {
  overflow: hidden;
  color: #17324f;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.watch-bound-supplier-copy small { color: #60758a; font-size: 10px; font-weight: 750; }

.profit-comparison-table-wrap {
  overflow-x: auto;
}

.profit-comparison-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
}

.profit-comparison-table th,
.profit-comparison-table td {
  height: 64px;
  padding: 8px 10px;
  border-bottom: 1px solid #e3e9ef;
  color: #263a51;
  font-size: 11px;
  text-align: right;
  vertical-align: middle;
}

.profit-comparison-table th {
  height: 36px;
  color: #5a6b7e;
  background: #f3f6f9;
  font-weight: 900;
  white-space: nowrap;
}

.profit-comparison-table th:nth-child(1),
.profit-comparison-table td:nth-child(1) { width: 54px; text-align: center; }
.profit-comparison-table th:nth-child(2),
.profit-comparison-table td:nth-child(2) { width: 68px; text-align: center; }
.profit-comparison-table th:nth-child(3),
.profit-comparison-table td:nth-child(3) { width: 300px; text-align: left; }
.profit-comparison-table th:nth-child(4),
.profit-comparison-table td:nth-child(4) { width: 88px; }
.profit-comparison-table th:nth-child(5),
.profit-comparison-table td:nth-child(5) { width: 86px; text-align: center; }
.profit-comparison-table th:nth-child(10),
.profit-comparison-table td:nth-child(10) { width: 88px; text-align: center; }

.profit-comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.profit-comparison-table tbody tr.is-best td {
  background: #effaf6;
}

.profit-comparison-table tbody tr.is-bound td {
  box-shadow: inset 0 1px #c8e4ff, inset 0 -1px #c8e4ff;
}

.profit-comparison-table tbody tr.is-bound td:first-child {
  box-shadow: inset 3px 0 #1677ff, inset 0 1px #c8e4ff, inset 0 -1px #c8e4ff;
}

.profit-comparison-row-check {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.profit-comparison-row-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #1677ff;
}

.profit-comparison-candidate-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.profit-comparison-candidate-copy a,
.profit-comparison-candidate-copy strong,
.profit-comparison-candidate-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-comparison-candidate-copy a,
.profit-comparison-candidate-copy strong {
  color: #17324f;
  font-weight: 900;
}

.profit-comparison-candidate-copy small {
  color: #6c7c90;
  font-size: 10px;
  font-weight: 750;
}

.profit-comparison-similarity,
.profit-comparison-verdict {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.profit-comparison-similarity {
  color: #176f63;
  background: #e2f5ee;
}

.profit-comparison-profit.is-positive { color: #0e7663; font-weight: 900; }
.profit-comparison-profit.is-negative { color: #bb3f36; font-weight: 900; }
.profit-comparison-verdict.good { color: #0e6959; background: #daf3ea; }
.profit-comparison-verdict.warning { color: #8a5b0a; background: #fff1c7; }
.profit-comparison-verdict.danger { color: #a53b35; background: #fee4e2; }
.profit-comparison-verdict.pending { color: #66768a; background: #edf1f5; }

.profit-comparison-empty {
  display: grid;
  min-height: 230px;
  place-content: center;
  justify-items: center;
  gap: 9px;
  color: #718095;
  background: #ffffff;
  border: 1px dashed #c9d6e3;
  border-radius: 7px;
  text-align: center;
}

.profit-comparison-empty strong {
  color: #233a54;
  font-size: 15px;
}

.profit-comparison-empty span {
  font-size: 12px;
  font-weight: 700;
}

.profit-comparison-product-only {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #d8e2ec;
  border-radius: 7px;
}

.profit-comparison-product-only-copy,
.profit-comparison-product-only-action {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.profit-comparison-product-only-copy span {
  color: #6d7d90;
  font-size: 10px;
  font-weight: 900;
}

.profit-comparison-product-only-copy strong {
  overflow: hidden;
  color: #17324f;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-comparison-product-only-copy small,
.profit-comparison-product-only-action small {
  color: #6f8093;
  font-size: 11px;
  font-weight: 750;
}

.profit-comparison-product-only-action {
  flex: 0 0 auto;
  justify-items: end;
}

.profit-comparison-empty-compact { min-height: 120px; }

html[data-theme="dark"] .profit-comparison-page,
html[data-theme="dark"] .profit-comparison-groups { color: #d9e4ef; background: #111a24; }
html[data-theme="dark"] .profit-comparison-head,
html[data-theme="dark"] .profit-comparison-settings,
html[data-theme="dark"] .profit-comparison-group,
html[data-theme="dark"] .profit-comparison-empty { background: #17222e; border-color: #35475a; }
html[data-theme="dark"] .profit-comparison-product-head,
html[data-theme="dark"] .profit-comparison-table th { background: #1d2a38; border-color: #35475a; }
html[data-theme="dark"] .profit-comparison-head h2,
html[data-theme="dark"] .profit-comparison-settings-head h3,
html[data-theme="dark"] .profit-comparison-product-copy h3,
html[data-theme="dark"] .profit-comparison-candidate-copy a,
html[data-theme="dark"] .profit-comparison-candidate-copy strong,
html[data-theme="dark"] .profit-comparison-empty strong { color: #e6eef6; }
html[data-theme="dark"] .profit-comparison-input-grid input,
html[data-theme="dark"] .profit-comparison-sale-price input { color: #e2ebf4; background: #15202b; border-color: #43566b; }
html[data-theme="dark"] .profit-comparison-table td { color: #c7d4e1; border-color: #304152; }
html[data-theme="dark"] .profit-comparison-table tbody tr.is-best td { background: #17332e; }

html[data-theme="dark"] .product-search-row-table .product-search-match-row td {
  background: #17332e;
  border-bottom-color: #315f55;
}

html[data-theme="dark"] .product-search-row-table .product-search-match-row.is-selected td {
  background: #194039;
}

html[data-theme="dark"] .product-search-match-copy a,
html[data-theme="dark"] .product-search-match-copy strong { color: #dcece7; }
html[data-theme="dark"] .product-search-match-copy small { color: #9fbab2; }

@media (max-width: 1100px) {
  .profit-comparison-input-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .profit-comparison-product-head {
    grid-template-columns: 58px minmax(220px, 1fr) 170px;
  }

  .profit-comparison-best {
    grid-column: 2 / -1;
    padding-top: 10px;
    padding-left: 0;
    border-top: 1px solid #d8e2ec;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .profit-comparison-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .profit-comparison-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profit-comparison-settings,
  .profit-comparison-groups {
    padding-right: 12px;
    padding-left: 12px;
  }

  .profit-comparison-product-head {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .profit-comparison-sale-price,
  .profit-comparison-best {
    grid-column: 1 / -1;
  }

  .profit-comparison-best {
    padding-top: 10px;
  }
}

/* Keep product search visible while the profit comparison is open. */
@media (min-width: 1181px) {
  :root {
    --profit-side-width: min(43vw, 760px);
    --profit-side-gap: 16px;
  }

  body.profit-analysis-active .market-layout {
    width: auto;
    max-width: none;
    margin-right: calc(var(--app-page-edge) + var(--profit-side-width) + var(--profit-side-gap));
    margin-left: calc(var(--app-page-edge) + var(--workflow-rail-width) + var(--app-workflow-gap));
    grid-template-columns: minmax(0, 1fr);
    padding-top: 18px;
  }

  body.profit-analysis-active .market-layout .dashboard-column {
    display: none !important;
  }

  body.profit-analysis-active .secondary-workspace {
    position: fixed;
    top: 133px;
    right: var(--app-page-edge);
    bottom: 0;
    z-index: 20;
    display: block;
    width: var(--profit-side-width);
    max-width: none;
    margin: 0;
    padding: 0 0 24px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f5f7fa;
    border-left: 1px solid #d5e0eb;
    box-shadow: -12px 0 28px rgba(26, 58, 92, 0.08);
  }

  body.profit-analysis-active .secondary-workspace > [data-app-page]:not(#profitAnalysis) {
    display: none !important;
  }

  body.profit-analysis-active #profitAnalysis {
    display: block !important;
    min-height: calc(100vh - 157px);
    overflow: hidden;
    border: 0;
    border-radius: 0;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-head {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 76px;
    padding: 14px 18px;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-head h2 {
    font-size: 17px;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-head p:last-child {
    max-width: 520px;
    font-size: 11px;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-settings {
    padding: 14px 18px 16px;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-groups {
    gap: 12px;
    padding: 12px 18px 24px;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-product-head {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    padding: 10px 12px;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-product-image {
    width: 48px;
    height: 48px;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-sale-price,
  body.profit-analysis-active #profitAnalysis .profit-comparison-best {
    grid-column: 1 / -1;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-best {
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid #d8e2ec;
    border-left: 0;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-watch-action {
    grid-column: 2 / -1;
    width: 100%;
    min-width: 0;
    justify-items: start;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-watch-action small {
    max-width: none;
    white-space: nowrap;
    text-align: left;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-watch-button {
    white-space: nowrap;
  }

  body.profit-analysis-active #profitAnalysis .profit-comparison-table {
    min-width: 820px;
  }

  body.profit-analysis-active.profit-analysis-expanded .market-layout {
    display: none !important;
  }

  body.profit-analysis-active.profit-product-list-expanded .market-layout {
    width: auto;
    max-width: none;
    margin-right: var(--app-page-edge);
  }

  body.profit-analysis-active.profit-product-list-expanded .secondary-workspace {
    display: none !important;
  }

  body.profit-analysis-active.profit-product-list-expanded .market-layout .search-panel,
  body.profit-analysis-active.profit-product-list-expanded .market-layout .sku-panel {
    display: none !important;
  }

  body.profit-analysis-active.profit-product-list-expanded .product-list-panel {
    min-width: 0;
  }

  body.profit-analysis-active.profit-product-list-expanded .product-search-table-scroll {
    max-height: calc(100vh - 260px);
    overflow: auto;
  }

  body.profit-analysis-active.profit-analysis-expanded .secondary-workspace {
    right: var(--app-page-edge);
    left: calc(var(--app-page-edge) + var(--workflow-rail-width) + var(--app-workflow-gap));
    width: auto;
  }

  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-input-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-product-head {
    grid-template-columns: 58px minmax(260px, 1fr) 180px minmax(220px, 0.6fr) minmax(132px, auto);
    gap: 14px;
    min-height: 82px;
    padding: 12px 16px;
  }

  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-product-image {
    width: 58px;
    height: 58px;
  }

  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-sale-price,
  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-best {
    grid-column: auto;
  }

  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-best {
    padding-top: 0;
    padding-left: 16px;
    border-top: 0;
    border-left: 1px solid #d8e2ec;
  }

  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-watch-action {
    grid-column: auto;
    width: auto;
    min-width: 132px;
    justify-items: end;
  }

  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-watch-action small {
    max-width: 180px;
    white-space: normal;
    text-align: right;
  }

  body.profit-analysis-active.profit-analysis-expanded #profitAnalysis .profit-comparison-table {
    min-width: 1120px;
  }
}

@media (min-width: 1281px) and (max-width: 1600px) {
  :root {
    --profit-side-width: min(50vw, 700px);
  }

  body.profit-analysis-active .selection-workflow,
  body.profit-analysis-active .selection-workflow-restore {
    display: none !important;
  }

  body.profit-analysis-active .market-layout {
    margin-left: var(--app-page-edge);
  }

  body.profit-analysis-active.profit-analysis-expanded .secondary-workspace {
    left: var(--app-page-edge);
  }

  body.profit-analysis-active.profit-product-list-expanded .market-layout {
    margin-left: var(--app-page-edge);
  }
}

@media (max-width: 1280px) {
  body.profit-analysis-active .market-layout {
    margin-bottom: 18px;
  }

  body.profit-analysis-active.profit-analysis-expanded .market-layout {
    display: none !important;
  }

  body.profit-analysis-active.profit-product-list-expanded .secondary-workspace {
    display: none !important;
  }

  body.profit-analysis-active .secondary-workspace {
    width: auto;
    margin: 0 12px 28px;
  }

  body.profit-analysis-active .secondary-workspace > [data-app-page]:not(#profitAnalysis) {
    display: none !important;
  }

  body.profit-analysis-active #profitAnalysis {
    display: block !important;
  }
}

html[data-theme="dark"] body.profit-analysis-active .secondary-workspace {
  background: #111a24;
  border-left-color: #35475a;
  box-shadow: -12px 0 28px rgba(0, 0, 0, 0.25);
}

@media (max-width: 900px) {
  .review-data-history-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-data-history-tools {
    width: 100%;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
  }

  .review-data-date-range {
    width: 100%;
    padding: 8px 0 0;
    border-top: 1px solid #d7e1eb;
    border-left: 0;
  }

  .review-data-date-range input {
    min-width: 0;
    flex: 1;
  }

  .review-data-result-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-query-page-head {
    min-height: 84px;
    padding: 16px;
  }

  .review-query-page-heading {
    grid-template-columns: 1fr;
  }

  .review-query-page-head .eyebrow {
    grid-column: 1;
  }

  .review-query-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-query-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .review-query-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid #e3eaf1;
  }

  .review-query-filter-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }

  .review-query-owner-field {
    width: 100%;
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid #d9e2ec;
  }

  .review-query-owner-field select {
    min-width: 0;
    flex: 1;
  }

  .review-query-page .review-data-import-form {
    grid-template-columns: 1fr;
  }

  .review-query-page .review-data-import-form button {
    width: 100%;
  }

  .review-query-page .review-data-import-form small {
    grid-column: 1;
  }
}

@media (max-width: 600px) {
  .review-data-date-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .review-data-date-range > span:first-child {
    grid-column: 1 / -1;
  }

  .review-data-date-range input {
    width: 100%;
  }

  .review-data-date-range button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .review-data-result-highlights article {
    min-height: 82px;
    padding: 12px 13px;
  }

  .review-data-result-highlights strong {
    font-size: 20px;
  }

  .review-query-page-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .review-query-head-actions {
    margin-left: auto;
  }

  .review-query-page-head h2 {
    font-size: 20px;
  }

  .review-query-page-head p:last-child {
    line-height: 1.5;
  }

  .review-query-refresh {
    min-width: 36px;
    width: 36px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .review-query-refresh span {
    font-size: 18px;
  }

  .review-query-add {
    min-width: 104px;
  }

  .review-request-form {
    padding: 16px;
  }

  .review-query-metrics > div {
    min-height: 70px;
    padding-right: 12px;
  }

  .review-query-metrics strong {
    font-size: 20px;
  }

  .review-query-status-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-query-filter-label {
    grid-column: 1 / -1;
  }

  .review-query-status-filters button {
    width: 100%;
  }

  .review-query-page .review-data-head,
  .review-query-page .review-data-result-block,
  .review-query-page .review-data-history-block {
    padding-right: 14px;
    padding-left: 14px;
  }

  .review-query-page .review-data-head > div:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .review-data-admin-create,
  .review-query-page .review-data-import-form {
    margin-right: 14px;
    margin-left: 14px;
  }

  .review-query-page .review-data-import-form label {
    grid-template-columns: 1fr;
  }

  .review-query-page .review-data-section-title,
  .review-data-section-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-data-section-actions {
    width: 100%;
    gap: 7px;
  }

  .review-data-section-actions > span {
    max-width: 100%;
    white-space: normal;
  }
}

/* ===== visual-kit 视觉增强：指标卡图标+大数字+sparkline+badge+hover (20260724) ===== */
.analysis-metric{display:flex;flex-direction:column;gap:8px;background:var(--panel-soft);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.analysis-metric:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:var(--line-strong)}
.analysis-metric .vk-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.analysis-metric .vk-head-l{display:flex;align-items:center;gap:6px;color:var(--quiet);font-size:11px}
.analysis-metric .vk-ic{width:14px;height:14px;flex:none;color:var(--teal)}
.analysis-metric strong{font-family:var(--font-number);font-size:24px;font-weight:500;line-height:1;letter-spacing:-.01em;color:var(--ink)}
.analysis-metric small{font-size:11px;color:var(--quiet)}
.analysis-metric .vk-spark{display:block;width:100%;height:22px;margin-top:auto}
.vk-badge{font-size:11px;font-weight:500;padding:1px 7px;border-radius:10px;white-space:nowrap}
.vk-badge.vk-up{background:#e7f7ef;color:#047857}
.vk-badge.vk-down{background:#fdecea;color:#a32d2d}
html[data-theme="dark"] .vk-badge.vk-up{background:#16352a;color:#5dcaa5}
html[data-theme="dark"] .vk-badge.vk-down{background:#3a1f1f;color:#f09595}
html[data-theme="dark"] .analysis-metric{background:var(--panel-soft);border-color:var(--line)}
html[data-theme="dark"] .analysis-metric strong{color:var(--ink)}

/* 重点指标卡 - 左 accent 边线突出 */
.analysis-metric--prominent{border-left:3px solid var(--teal);padding-left:16px;background:var(--panel)}
html[data-theme="dark"] .analysis-metric--prominent{background:var(--panel)}

/* Review center notifications and completed-result summaries. */
.notification-center {
  position: relative;
}

.notification-badge {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  color: #ffffff;
  background: #c83f49;
  border: 2px solid #ffffff;
  border-radius: 9px;
  font-family: var(--font-number);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.notification-badge[hidden],
.notification-dot[hidden],
.notification-panel[hidden] {
  display: none;
}

.notification-panel {
  display: flex;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 80;
  width: min(390px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 88px));
  max-height: calc(100vh - 88px);
  flex-direction: column;
  overflow: hidden;
  color: #263d54;
  background: #f3f6f9;
  border: 1px solid #ccd9e6;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(19, 45, 73, 0.18);
}

.notification-panel > header {
  display: flex;
  min-height: 72px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid #dde6ef;
}

.notification-panel > header > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.notification-panel > header strong {
  color: #17324d;
  font-size: 16px;
}

.notification-panel > header span {
  color: #718197;
  font-size: 12px;
  font-weight: 750;
}

.notification-panel > header button {
  height: 34px;
  min-height: 29px;
  padding: 3px 11px;
  color: #2d608e;
  background: #ffffff;
  border: 1px solid #bfcfdf;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.notification-panel > header button:disabled {
  cursor: default;
  opacity: 0.5;
}

.notification-list {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  align-content: start;
  gap: 8px;
  max-height: none;
  padding: 10px;
  overflow-y: auto;
  background: #f3f6f9;
}

.notification-list.empty {
  min-height: 128px;
  place-items: center;
  padding: 20px;
  color: #7a899a;
  font-size: 12px;
}

.notification-list.empty p {
  margin: 0;
}

.notification-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px 11px;
  width: 100%;
  height: auto;
  min-height: 112px;
  align-items: start;
  padding: 12px 13px;
  color: #314960;
  background: #ffffff;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  box-shadow: 0 2px 7px rgba(26, 51, 77, 0.05);
  cursor: pointer;
  text-align: left;
}

.notification-item:last-child {
  border-bottom: 1px solid #dce5ee;
}

.notification-item.is-unread {
  background: #f8fbff;
  border-color: #c6d9ea;
  box-shadow: inset 3px 0 #3479ae;
}

.notification-item:hover,
.notification-item:focus-visible {
  background: #f1f7fc;
  border-color: #a9c5dd;
  box-shadow: 0 5px 14px rgba(26, 51, 77, 0.1);
  transform: none;
}

.notification-state {
  display: inline-flex;
  width: 42px;
  min-width: 42px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
}

.notification-state.success {
  color: #126958;
  background: #eaf8f3;
  border-color: #a8d9cb;
}

.notification-state.failed {
  color: #9d3843;
  background: #fff0f1;
  border-color: #e5b0b5;
}

.notification-state.submitted {
  color: #1f5c8a;
  background: #eef6fc;
  border-color: #b3d7f0;
}

.notification-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.notification-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #203a53;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-copy small,
.notification-item time {
  color: #8090a2;
  font-family: var(--font-number);
  font-size: 10px;
  line-height: 1.4;
}

.notification-copy p {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  color: #586b7e;
  font-size: 11.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.notification-item time {
  grid-column: 2;
  width: 100%;
  margin-top: 1px;
  padding-top: 7px;
  border-top: 1px solid #edf1f5;
}

.review-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: #c83f49;
  border-radius: 50%;
  vertical-align: 1px;
}

.review-source-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  color: #4d6074;
  background: #f4f6f8;
  border: 1px solid #d5dee7;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.review-data-timeline {
  display: grid;
  gap: 0;
  margin-top: 14px;
  padding: 13px 14px;
  background: #f7f9fb;
  border: 1px solid #dce4ec;
  border-radius: 6px;
}

.review-data-timeline[hidden] {
  display: none;
}

.review-data-timeline h5 {
  margin: 0 0 8px;
  color: #274057;
  font-size: 12px;
}

.review-data-timeline > div {
  position: relative;
  display: grid;
  grid-template-columns: 122px 74px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 6px 0 6px 15px;
  border-top: 1px solid #e3e9ef;
}

.review-data-timeline > div::before {
  position: absolute;
  left: 0;
  width: 6px;
  height: 6px;
  background: #4d82ae;
  border-radius: 50%;
  content: "";
}

.review-data-timeline time {
  color: #6e7e90;
  font-family: var(--font-number);
  font-size: 9px;
}

.review-data-timeline p {
  margin: 0;
  color: #596b7d;
  font-size: 10px;
  line-height: 1.45;
}

.watch-review-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  padding: 8px 10px;
  color: #617286;
  background: #f3f8f6;
  border: 1px solid #cfe2db;
  border-left: 3px solid #25806c;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 750;
}

.watch-review-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.watch-review-summary strong {
  color: #1d4f45;
  font-family: var(--font-number);
  font-weight: 900;
}

.watch-review-summary button {
  min-height: 27px;
  margin-left: auto;
  padding: 3px 9px;
  color: #176653;
  background: #ffffff;
  border: 1px solid #9fcbbf;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.watch-review-summary button:hover,
.watch-review-summary button:focus-visible {
  background: #e6f5f0;
  border-color: #61a994;
}

html[data-theme="dark"] .notification-badge {
  border-color: #151f2a;
}

html[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .notification-item {
  color: #cbd7e4;
  background: #19232f;
  border-color: #344357;
}

html[data-theme="dark"] .notification-panel > header,
html[data-theme="dark"] .notification-list.empty,
html[data-theme="dark"] .review-data-timeline {
  color: #aebdcd;
  background: #151f2a;
  border-color: #344357;
}

html[data-theme="dark"] .notification-panel > header strong,
html[data-theme="dark"] .notification-copy strong,
html[data-theme="dark"] .review-data-timeline h5 {
  color: #edf3fa;
}

html[data-theme="dark"] .notification-panel > header button {
  color: #c9d7e6;
  background: #1d2a38;
  border-color: #43566b;
}

html[data-theme="dark"] .notification-item.is-unread,
html[data-theme="dark"] .notification-item:hover,
html[data-theme="dark"] .notification-item:focus-visible {
  background: #22364a;
}

html[data-theme="dark"] .notification-copy p,
html[data-theme="dark"] .review-data-timeline p,
html[data-theme="dark"] .review-data-timeline time {
  color: #aebdcd;
}

html[data-theme="dark"] .review-source-badge {
  color: #becbda;
  background: #202c39;
  border-color: #435469;
}

html[data-theme="dark"] .review-data-timeline > div {
  border-color: #344357;
}

html[data-theme="dark"] .watch-review-summary {
  color: #b6c5d4;
  background: #172b25;
  border-color: #315f50;
  border-left-color: #5ab99d;
}

html[data-theme="dark"] .watch-review-summary strong {
  color: #91d8c3;
}

html[data-theme="dark"] .watch-review-summary button {
  color: #9edbc9;
  background: #1b332b;
  border-color: #477967;
}

/* Keep monitoring cards on the same dark surface as the surrounding page. */
html[data-theme="dark"] .watchlist-page-panel .watch-list,
html[data-theme="dark"] .watch-pagination-shell {
  background: #111a24;
}

html[data-theme="dark"] .watchlist-page-panel .watch-item {
  color: #dbe7f3;
  background: #19232f !important;
  background-image: none !important;
  border-color: #344357;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .watchlist-page-panel .watch-item:hover {
  border-color: #5689c3;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.3);
}

/* The full monitoring card carries the latest price/sales refresh state. */
.watchlist-page-panel .watch-item.is-change-up {
  background: #edf9f2 !important;
  border-color: #65b98a;
  box-shadow: inset 4px 0 0 #26945c, 0 10px 22px rgba(31, 112, 69, 0.08);
}

.watchlist-page-panel .watch-item.is-change-down {
  background: #fff2f0 !important;
  border-color: #dc7a72;
  box-shadow: inset 4px 0 0 #cf4a3e, 0 10px 22px rgba(160, 58, 48, 0.08);
}

.watchlist-page-panel .watch-item.is-change-mixed {
  background: #fff8e7 !important;
  border-color: #d4aa46;
  box-shadow: inset 4px 0 0 #bd8614, 0 10px 22px rgba(133, 91, 15, 0.08);
}

.watchlist-page-panel .watch-item.is-change-unchanged {
  background: #f2f5f7 !important;
  border-color: #aeb9c5;
  box-shadow: inset 4px 0 0 #7f8b98, 0 8px 18px rgba(58, 70, 83, 0.05);
}

.watchlist-page-panel .watch-item.is-change-up:hover {
  border-color: #3d9e69;
  box-shadow: inset 4px 0 0 #21814f, 0 16px 30px rgba(31, 112, 69, 0.13);
}

.watchlist-page-panel .watch-item.is-change-down:hover {
  border-color: #ce5b50;
  box-shadow: inset 4px 0 0 #b93d32, 0 16px 30px rgba(160, 58, 48, 0.13);
}

.watchlist-page-panel .watch-item.is-change-mixed:hover {
  border-color: #bf8f22;
  box-shadow: inset 4px 0 0 #a87510, 0 16px 30px rgba(133, 91, 15, 0.13);
}

.watchlist-page-panel .watch-item.is-change-unchanged:hover {
  border-color: #8c99a7;
  box-shadow: inset 4px 0 0 #6d7986, 0 14px 26px rgba(58, 70, 83, 0.09);
}

html[data-theme="dark"] .watch-change-segments {
  background: #151f2a;
  border-color: #3b4b5d;
}

html[data-theme="dark"] .watch-change-segment {
  color: #b9c8d8;
  border-color: #3b4b5d;
}

html[data-theme="dark"] .watch-change-segment:hover {
  color: #edf5fc;
  background: #243649;
}

html[data-theme="dark"] .watch-change-segment.active {
  color: #fff;
  background: #3476ab;
}

html[data-theme="dark"] .watchlist-page-panel .watch-item.is-change-up {
  background: #173329 !important;
  border-color: #3f8b69;
}

html[data-theme="dark"] .watchlist-page-panel .watch-item.is-change-down {
  background: #3a2425 !important;
  border-color: #a85a55;
}

html[data-theme="dark"] .watchlist-page-panel .watch-item.is-change-mixed {
  background: #382f1d !important;
  border-color: #9c7a31;
}

html[data-theme="dark"] .watchlist-page-panel .watch-item.is-change-unchanged {
  background: #202a34 !important;
  border-color: #526170;
}

@media (max-width: 760px) {
  .watch-change-segments {
    order: -1;
  }
}

@media (max-width: 520px) {
  .watch-title-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

html[data-theme="dark"] .watchlist-page-panel .watch-title-row h3,
html[data-theme="dark"] .watchlist-page-panel .watch-stat strong {
  color: #edf3fa;
}

html[data-theme="dark"] .watch-refresh-progress {
  color: #c5d5e5;
  background: #172330;
  border-color: #3a536d;
}

html[data-theme="dark"] .watch-refresh-progress.is-complete {
  background: #152a25;
  border-color: #376a5b;
}

html[data-theme="dark"] .watch-refresh-progress.has-failures {
  background: #302719;
  border-color: #765b30;
}

html[data-theme="dark"] .watch-refresh-progress-head strong,
html[data-theme="dark"] .watch-title-link:hover,
html[data-theme="dark"] .watch-title-link:focus-visible {
  color: #b7dcff;
}

html[data-theme="dark"] .watch-refresh-progress-head span,
html[data-theme="dark"] .watch-refresh-progress-meta {
  color: #aebdcd;
}

html[data-theme="dark"] .watch-refresh-progress-track {
  background: #2b3d50;
}

html[data-theme="dark"] .watch-refresh-stop-button {
  color: #ff9a8c;
  background: #202c39;
  border-color: #5a3a33;
}

html[data-theme="dark"] .watch-refresh-stop-button:hover {
  background: #2a1c19;
  border-color: #7a4a3f;
}

html[data-theme="dark"] .watch-refresh-stop-button:active {
  background: #362420;
}

html[data-theme="dark"] .watchlist-page-panel .watch-title-edit-button,
html[data-theme="dark"] .watchlist-page-panel .watch-title-edit-form button {
  color: #c2dcf4;
  background: #202c39;
  border-color: #405166;
}

html[data-theme="dark"] .watchlist-page-panel .watch-title-edit-form button.watch-title-edit-save {
  color: #fff;
  background: linear-gradient(135deg, #1677ff, #0f5ec8);
  border-color: rgba(22, 119, 255, 0.15);
}

html[data-theme="dark"] .watchlist-page-panel .watch-title-edit-form input.watch-title-edit-input {
  color: #edf3fa;
  background: #111a24;
  border-color: #5689c3;
}

html[data-theme="dark"] .watchlist-page-panel .watch-title-cn,
html[data-theme="dark"] .watchlist-page-panel .watch-stat span,
html[data-theme="dark"] .watchlist-page-panel .meta,
html[data-theme="dark"] .watch-pagination-info {
  color: #aebdcd;
}

html[data-theme="dark"] .watchlist-page-panel .watch-stat {
  border-bottom-color: #344357;
}

@media (max-width: 760px) {
  .watch-refresh-progress-head,
  .watch-refresh-progress-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .watch-refresh-progress-meta span:last-child {
    text-align: left;
    white-space: normal;
  }

  .watch-add-progress .watch-refresh-progress-head span {
    white-space: normal;
  }

  .notification-button {
    min-width: 50px;
    width: 50px;
    padding: 0 7px;
  }

  .notification-label {
    display: inline;
  }

  .notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
  }

  .notification-panel {
    position: fixed;
    top: 64px;
    right: 8px;
    left: 8px;
    width: auto;
    height: calc(100vh - 76px);
    max-height: calc(100vh - 76px);
  }

  .notification-list {
    max-height: none;
  }

  .review-data-timeline > div {
    grid-template-columns: 1fr auto;
    gap: 5px 8px;
  }

  .review-data-timeline > div p {
    grid-column: 1 / -1;
  }

  .watch-review-summary {
    align-items: flex-start;
  }

  .watch-review-summary button {
    width: 100%;
    margin-left: 0;
  }
}

/* Requested local UI updates: search modes, keyword actions, and dashboard controls. */
.search-mode-tabs {
  display: inline-grid;
  width: fit-content;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
}

.search-mode-tab[data-keyword-search-mode="single"].is-active {
  color: #174f87;
  background: #f8fbff;
}

.search-mode-tab[data-keyword-search-mode="batch"].is-active {
  color: #8a4b08;
  background: #fffaf0;
}

.search-mode-tab[data-keyword-search-mode="batch"].is-active .search-mode-icon {
  background: #d97706;
}

.search-mode-tab[data-keyword-search-mode="ai"].is-active {
  color: #116149;
  background: #f1fbf7;
}

.search-mode-tab[data-keyword-search-mode="ai"].is-active .search-mode-icon {
  background: #168563;
}

.ai-mode-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 150px)) minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid #dce5ed;
  border-radius: 7px;
  background: #f8fafc;
}

.ai-mode-settings[hidden] {
  display: none;
}

.ai-mode-settings > label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #52677f;
  font-size: 12px;
  font-weight: 800;
}

.ai-mode-settings select {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 9px;
  border: 1px solid #ccd8e4;
  border-radius: 6px;
  color: #20364f;
  background: #ffffff;
}

.ai-mode-settings .ai-auto-review-toggle {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #b9dacd;
  border-radius: 6px;
  color: #116149;
  background: #f1fbf7;
}

.ai-auto-review-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #168563;
}

.ai-mode-results {
  margin-top: 10px;
  min-width: 0;
  max-width: 100%;
  border-top: 1px solid #dce5ed;
  padding-top: 12px;
}

.product-column {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

.search-panel,
.search-panel .searchbar,
.search-panel .search-main {
  min-width: 0;
  max-width: 100%;
}

.ai-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-results-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ai-results-head span {
  color: #5c6f84;
  font-size: 12px;
  font-weight: 800;
}

.ai-results-head strong {
  color: #20364f;
  font-size: 14px;
}

.ai-results-action {
  min-height: 32px;
  flex: 0 0 auto;
}

.ai-stage-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #52677f;
  background: #f4f7fa;
  font-size: 11px;
  font-weight: 800;
}

.ai-stage-status.is-with,
.ai-stage-status.is-running {
  color: #174f87;
  border-color: #a9c8e8;
  background: #edf6ff;
}

.ai-stage-status.is-without {
  color: #116149;
  border-color: #8ccbb5;
  background: #eaf8f2;
}

.ai-stage-status.is-failed {
  color: #9f302b;
  border-color: #e8b4b0;
  background: #fff1f0;
}

.ai-grade-summary {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ai-grade-summary span,
.ai-grade-badge {
  display: inline-flex;
  min-width: 30px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #4b5d72;
  background: #f4f7fa;
  font-size: 11px;
  font-weight: 900;
}

.ai-grade-summary .is-s,
.ai-grade-badge.is-s {
  color: #116149;
  border-color: #8ccbb5;
  background: #eaf8f2;
}

.ai-grade-summary .is-a,
.ai-grade-badge.is-a {
  color: #174f87;
  border-color: #a9c8e8;
  background: #edf6ff;
}

.ai-grade-summary .is-b,
.ai-grade-badge.is-b {
  color: #8a4b08;
  border-color: #ebc98f;
  background: #fff8e9;
}

.ai-grade-summary .is-c,
.ai-grade-badge.is-c {
  color: #9f302b;
  border-color: #e8b4b0;
  background: #fff1f0;
}

.ai-results-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dce5ed;
  border-radius: 7px;
}

.ai-results-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
}

.ai-results-table th,
.ai-results-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf1f5;
  color: #40546b;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.ai-results-table th {
  color: #687a8e;
  background: #f6f8fb;
  font-size: 11px;
  white-space: nowrap;
}

.ai-result-product {
  display: grid;
  grid-template-columns: 36px minmax(140px, 1fr);
  gap: 8px;
  align-items: center;
}

.ai-result-product img,
.ai-result-image-empty {
  display: block;
  width: 36px;
  height: 36px;
  border: 1px solid #e0e7ef;
  border-radius: 5px;
  object-fit: cover;
  background: #edf1f5;
}

.ai-result-product strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #20364f;
  line-height: 1.35;
}

.ai-score-value {
  color: #164f82;
  font-size: 18px;
}

.ai-score-total {
  color: #8593a4;
  font-size: 10px;
}

.ai-result-reasons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ai-result-reasons span {
  padding: 2px 5px;
  border-radius: 4px;
  color: #52677f;
  background: #f0f4f8;
  white-space: nowrap;
}

.ai-result-empty {
  padding: 16px;
  color: #687a8e;
  text-align: center;
}

.search-panel .search-control .search-submit-btn {
  width: auto;
  min-width: 96px;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 13px;
  box-shadow: 0 2px 7px rgba(23, 69, 120, 0.22);
}

.search-panel .search-control .search-history-button {
  width: auto;
  min-width: 76px;
  height: 40px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 13px;
  box-shadow: 0 2px 7px rgba(230, 119, 0, 0.2);
}

.add-watch-panel {
  width: min(560px, calc(100vw - 28px));
}

.keyword-watch-btn.is-watched,
.keyword-watch-btn:disabled {
  color: #0f766e;
  background: #ecfdf5;
  border-color: #a7e3cf;
  cursor: default;
  opacity: 1;
}

#trend .trend-keyword-field select {
  padding-right: 38px;
  background-color: #fbfdff;
  background-image: linear-gradient(45deg, transparent 50%, #52677f 50%), linear-gradient(135deg, #52677f 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  appearance: none;
  cursor: pointer;
}

#trend .category-hot-keyword-table .change-pill {
  min-width: 66px;
  gap: 6px;
}

#trend .category-hot-keyword-table .rank-change-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #ffffff;
  background: #7a8797;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

#trend .category-hot-keyword-table .change-pill.up .rank-change-icon {
  background: #159568;
}

#trend .category-hot-keyword-table .change-pill.down .rank-change-icon {
  background: #d43d34;
}

#trend .category-hot-keyword-table .change-pill.new,
#trend .category-hot-keyword-table .type-pill.new {
  color: #9a5a08;
  background: #fff8e7;
  border-color: #f5d58d;
}

#trend .category-hot-keyword-table .change-pill.new .rank-change-icon {
  background: #d78a14;
}

html[data-theme="dark"] .search-mode-tab[data-keyword-search-mode="single"].is-active {
  color: #a9d2ff;
  background: #1b2d41;
}

html[data-theme="dark"] .search-mode-tab[data-keyword-search-mode="batch"].is-active {
  color: #ffd08a;
  background: #382a18;
}

html[data-theme="dark"] .search-mode-tab[data-keyword-search-mode="ai"].is-active {
  color: #90e0c2;
  background: #173229;
}

.batch-keyword-preview {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: #f7fbff;
  border: 1px solid #cdddeb;
  border-radius: 6px;
}

.batch-keyword-preview[hidden] {
  display: none;
}

.batch-keyword-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.batch-keyword-preview-head strong {
  color: #173b61;
  font-size: 13px;
}

.batch-keyword-preview-head span {
  color: #65788b;
  font-size: 11px;
}

.batch-keyword-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.batch-keyword-preview-chip {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 5px 5px 5px 9px;
  color: #174f38;
  background: #eefaf3;
  border: 1px solid #b9e2ca;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 750;
}

.batch-keyword-preview-chip > span {
  overflow-wrap: anywhere;
}

.batch-keyword-preview-chip button {
  display: inline-grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  color: #4f7160;
  background: transparent;
  border: 0;
  border-radius: 3px;
  box-shadow: none;
  font-size: 17px;
  line-height: 1;
}

.batch-keyword-preview-chip button:hover {
  color: #8d2926;
  background: #ffe9e7;
}

html[data-theme="dark"] .batch-keyword-preview {
  background: #172330;
  border-color: #344357;
}

html[data-theme="dark"] .batch-keyword-preview-head strong {
  color: #d0def0;
}

html[data-theme="dark"] .batch-keyword-preview-head span {
  color: #aebdcd;
}

html[data-theme="dark"] .batch-keyword-preview-chip {
  color: #9de0bd;
  background: #173229;
  border-color: #315f51;
}

html[data-theme="dark"] .ai-mode-settings,
html[data-theme="dark"] .ai-results-table-wrap {
  border-color: #344357;
  background: #172330;
}

html[data-theme="dark"] .ai-mode-settings select,
html[data-theme="dark"] .ai-results-table {
  color: #d0def0;
  border-color: #344357;
  background: #151f2a;
}

html[data-theme="dark"] .ai-mode-settings .ai-auto-review-toggle {
  color: #90e0c2;
  border-color: #315f51;
  background: #173229;
}

html[data-theme="dark"] .ai-results-table th {
  color: #aebdcd;
  background: #1d2a38;
}

html[data-theme="dark"] .ai-results-table td {
  color: #bdcad8;
  border-bottom-color: #2b3949;
}

html[data-theme="dark"] .ai-result-product strong,
html[data-theme="dark"] .ai-results-head strong {
  color: #d0def0;
}

html[data-theme="dark"] #trend .trend-keyword-field select {
  background-color: #151f2a;
  background-image: linear-gradient(45deg, transparent 50%, #aebdcd 50%), linear-gradient(135deg, #aebdcd 50%, transparent 50%);
}

@media (max-width: 640px) {
  .search-mode-tabs {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-mode-tab {
    justify-content: center;
    min-width: 0;
    padding-inline: 7px;
  }

  .ai-mode-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-mode-settings .ai-auto-review-toggle {
    grid-column: 1 / -1;
  }

  .ai-results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-grade-summary {
    justify-content: flex-start;
  }

  .search-control-actions {
    justify-content: flex-end;
  }
}

/* The product search workspace uses the full width after removing the dashboard sidebar. */
.market-layout {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-column {
  display: none;
}

.product-image-keyword-panel {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 10px;
  background: #f7fafc;
  border-top: 1px solid #dfe7ef;
}

.product-image-keyword-panel[data-state="idle"] {
  display: none;
}

.product-image-keyword-head,
.product-image-keyword-group-head,
.product-image-keyword-selected {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-image-keyword-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.product-image-keyword-head strong,
.product-image-keyword-group-head strong {
  overflow: hidden;
  color: #17324f;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-keyword-head span,
.product-image-keyword-group-head span,
.product-image-keyword-selected span,
.product-image-keyword-selected small {
  overflow: hidden;
  color: #68788c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-keyword-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 29px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #cad6e3;
  border-radius: 4px;
}

.product-image-keyword-mode {
  min-width: 0;
  height: 29px;
  padding: 0 4px;
  color: #53677e;
  background: transparent;
  border: 0;
  border-right: 1px solid #d8e1ea;
  border-radius: 0;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.product-image-keyword-mode:last-child {
  border-right: 0;
}

.product-image-keyword-mode:hover,
.product-image-keyword-mode.is-active {
  color: #115f55;
  background: #e8f6f2;
}

.product-image-keyword-body,
.product-image-keyword-group,
.product-image-keyword-candidates {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.product-image-keyword-note {
  padding: 6px 8px;
  color: #725313;
  background: #fff8df;
  border: 1px solid #ead28b;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.45;
}

.product-image-keyword-mode-note {
  padding: 5px 8px;
  color: #496277;
  background: #f4f8fb;
  border: 1px solid #d9e4ed;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.45;
}

.product-image-keyword-group + .product-image-keyword-group {
  padding-top: 7px;
  border-top: 1px solid #dde6ee;
}

.product-image-keyword-chip-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.product-image-keyword-chip {
  max-width: 100%;
  min-height: 25px;
  padding: 4px 7px;
  overflow: hidden;
  color: #174c79;
  background: #eaf3fb;
  border: 1px solid #b8d0e5;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: normal;
}

.product-image-keyword-chip:hover {
  color: #0d3c63;
  background: #dcecf9;
  border-color: #8fb6d6;
}

.product-image-keyword-chip.is-selected {
  color: #ffffff;
  background: #174c79;
  border-color: #174c79;
}

.product-image-keyword-chip.is-selected:hover {
  color: #ffffff;
  background: #0d3c63;
  border-color: #0d3c63;
}

.product-image-keyword-chip-copy {
  margin-left: 5px;
  color: inherit;
  font-style: normal;
  font-size: 10px;
  opacity: 0.55;
}

.product-image-keyword-chip-score {
  display: inline-flex;
  min-height: 16px;
  align-items: center;
  margin-left: 6px;
  padding: 0 4px;
  color: #365064;
  background: #edf1f4;
  border: 1px solid #c8d2da;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.product-image-keyword-chip-score.is-high {
  color: #176348;
  background: #e1f3ea;
  border-color: #9bcbb7;
}

.product-image-keyword-chip-score.is-medium {
  color: #795a11;
  background: #fff3cf;
  border-color: #dec57c;
}

.product-image-keyword-chip-score.is-low {
  color: #8a3c37;
  background: #fae8e6;
  border-color: #dfaaa5;
}

.product-image-keyword-chip.is-selected .product-image-keyword-chip-score {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
}

.product-image-keyword-chip-copy:hover {
  opacity: 1;
}

.product-image-keyword-selection-hint {
  margin-top: 4px;
  color: #7a8ba0;
  font-size: 10px;
  line-height: 1.4;
}

.product-image-keyword-candidate {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  background: #ffffff;
  border: 1px solid #d7e0e9;
  border-radius: 4px;
  cursor: pointer;
}

.product-image-keyword-candidate:has(input:checked) {
  background: #eff9f6;
  border-color: #8ccabb;
}

.product-image-keyword-candidate input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #14796b;
}

.product-image-keyword-candidate > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.product-image-keyword-candidate strong,
.product-image-keyword-candidate small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-keyword-candidate strong {
  color: #1d344d;
  font-size: 11px;
}

.product-image-keyword-candidate small {
  color: #718094;
  font-size: 9px;
}

.product-image-keyword-search-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #dde6ee;
}

.product-image-keyword-search-action > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.product-image-keyword-search-action span,
.product-image-keyword-search-action small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-keyword-search-action span {
  color: #27435f;
  font-size: 10px;
  font-weight: 800;
}

.product-image-keyword-search-action small {
  color: #718094;
  font-size: 9px;
}

.product-image-keyword-search-action button {
  min-height: 29px;
  max-width: 150px;
  padding: 5px 9px;
  color: #ffffff;
  background: #14796b;
  border: 1px solid #14796b;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.product-image-keyword-search-action button:hover:not(:disabled) {
  background: #0f665b;
  border-color: #0f665b;
}

.product-image-keyword-search-action button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.product-image-keyword-loading,
.product-image-keyword-error {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  color: #66778b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}

.product-image-keyword-error {
  color: #983a36;
}

.product-image-keyword-retry {
  width: 100%;
  min-height: 29px;
  padding: 5px 9px;
  color: #174c79;
  background: #eaf3fb;
  border: 1px solid #b8d0e5;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.product-image-keyword-retry:hover {
  color: #0d3c63;
  background: #dcecf9;
  border-color: #8fb6d6;
}

.product-image-keyword-loading .loading-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: #14796b;
  border-radius: 50%;
  animation: product-image-keyword-pulse 1s ease-in-out infinite alternate;
}

@keyframes product-image-keyword-pulse {
  from { opacity: 0.35; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}

html[data-theme="dark"] .product-image-keyword-panel {
  background: #172330;
  border-top-color: #344357;
}

html[data-theme="dark"] .product-image-keyword-head strong,
html[data-theme="dark"] .product-image-keyword-group-head strong,
html[data-theme="dark"] .product-image-keyword-candidate strong {
  color: #d2deec;
}

html[data-theme="dark"] .product-image-keyword-modes,
html[data-theme="dark"] .product-image-keyword-candidate {
  background: #151f2a;
  border-color: #405064;
}

html[data-theme="dark"] .product-image-keyword-mode {
  color: #b2c1d1;
  border-right-color: #405064;
}

html[data-theme="dark"] .product-image-keyword-mode:hover,
html[data-theme="dark"] .product-image-keyword-mode.is-active,
html[data-theme="dark"] .product-image-keyword-candidate:has(input:checked) {
  color: #9de0bd;
  background: #173229;
}

html[data-theme="dark"] .product-image-keyword-chip {
  color: #acd2f0;
  background: #1b3348;
  border-color: #3c6280;
}

html[data-theme="dark"] .product-image-keyword-chip.is-selected {
  color: #eaf4fd;
  background: #2c5c96;
  border-color: #2c5c96;
}

html[data-theme="dark"] .product-image-keyword-chip.is-selected:hover {
  color: #eaf4fd;
  background: #3568a8;
  border-color: #3568a8;
}

html[data-theme="dark"] .product-image-keyword-selection-hint {
  color: #7f93ab;
}

html[data-theme="dark"] .product-image-keyword-retry {
  color: #acd2f0;
  background: #1b3348;
  border-color: #3c6280;
}

html[data-theme="dark"] .product-image-keyword-search-action {
  border-top-color: #344357;
}

html[data-theme="dark"] .product-image-keyword-search-action span {
  color: #d2deec;
}

@media (max-width: 720px) {
  .product-image-keyword-search-action {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-image-keyword-search-action button {
    width: 100%;
    max-width: none;
  }
}

/* ===== 源商品首格对照高亮（2026-08-20） ===== */
.competitor-group-product.is-source-product {
  border: 2px solid #0B766B;
  background: #f0faf8;
  box-shadow: 0 0 0 3px rgba(11, 118, 107, 0.10);
}
.competitor-source-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  color: #fff;
  background: #0B766B;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
}
.competitor-source-badge {
  font-style: normal;
  color: #0B766B;
  font-size: 11px;
  font-weight: 900;
}
.competitor-group-product button:disabled {
  background: #a9becf;
  border-color: #a9becf;
  cursor: not-allowed;
  opacity: 0.85;
}
.competitor-group-product.is-source-product small {
  color: #0B766B;
  background: #ddf5ef;
  border-color: #b8e8dc;
}

/* ===== 商品卡片视觉升级 card-visual-v1 (20260820) ===== */

.product-list-panel .decision-product {
  gap: 10px;
  padding: 12px 12px 13px !important;
  background: #ffffff;
  border: 1px solid #e4ebf3;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(23, 54, 92, 0.05);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.product-list-panel .decision-product:hover {
  background: #ffffff;
  border-color: #c9dcf2;
  box-shadow: 0 12px 28px rgba(23, 54, 92, 0.12);
}

.product-list-panel .decision-product.is-midplatform-match {
  border-color: rgba(15, 159, 143, 0.34);
  box-shadow: 0 10px 26px rgba(15, 159, 143, 0.12);
}

.product-list-panel .decision-product.is-midplatform-match .thumb-frame {
  border-color: rgba(15, 159, 143, 0.34);
}

.product-list-panel .decision-product .thumb-frame {
  border: 1px solid #e8eef5;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.product-list-panel .decision-product:hover .thumb-frame {
  border-color: #d3e2f2;
  box-shadow: 0 6px 16px rgba(23, 54, 92, 0.09);
}

.product-list-panel .decision-product .thumb-frame .thumb {
  border-radius: 10px;
}

.decision-product .compare-check {
  top: 20px;
  left: 20px;
  z-index: 4;
}

.decision-product .compare-check span {
  border-radius: 7px;
  box-shadow: 0 2px 6px rgba(15, 35, 60, 0.22);
}

.product-card-image-similarity {
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  box-shadow: 0 2px 8px rgba(15, 35, 60, 0.25);
  backdrop-filter: blur(4px);
}

.product-list-panel .decision-product .pill {
  color: #5b6b7e;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.product-list-panel .decision-product .product-commerce-line {
  min-height: 0;
  padding: 7px 10px 8px;
  background: #f7fafd;
  border: 1px solid #e8eef5;
  border-radius: 10px;
}

.product-list-panel .decision-product .product-card-price {
  font-size: 17px;
}

.product-list-panel .decision-product .product-card-sales,
.product-list-panel .decision-product .product-card-reviews {
  color: #5c6c80;
  font-size: 11.5px;
}

.product-list-panel .decision-product .product-card-metrics {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.product-list-panel .decision-product .product-card-conversion,
.product-list-panel .decision-product .product-card-rating {
  min-width: 0;
  overflow: hidden;
  color: #5c6c80;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-card-conversion,
html[data-theme="dark"] .product-list-panel .decision-product .product-card-rating {
  color: #9aa8bb;
}

.product-list-panel .decision-product .product-monitor-button,
.product-list-panel .decision-product .product-card-image-search-button,
.product-list-panel .decision-product .product-card-mid-similarity-button {
  height: 34px;
  min-height: 34px;
  border-radius: 9px;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 5px rgba(18, 48, 82, 0.16);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.product-list-panel .decision-product .product-monitor-button:hover:not(:disabled),
.product-list-panel .decision-product .product-card-image-search-button:hover:not(:disabled),
.product-list-panel .decision-product .product-card-mid-similarity-button:hover:not(:disabled) {
  box-shadow: 0 5px 12px rgba(18, 48, 82, 0.22);
  transform: translateY(-1px);
}

.product-list-panel .decision-product .product-monitor-button:active:not(:disabled),
.product-list-panel .decision-product .product-card-image-search-button:active:not(:disabled),
.product-list-panel .decision-product .product-card-mid-similarity-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(18, 48, 82, 0.18);
}

.product-list-panel .decision-product .compact-actions .link-button {
  height: 30px;
  color: #3d5470;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.product-list-panel .decision-product .compact-actions .link-button:hover {
  color: #274a76;
  background: #e7eff8;
  transform: translateY(-1px);
}

.product-image-keyword-panel {
  gap: 9px;
  padding: 10px 11px 11px;
  background: #f8fafd;
  border: 1px solid #e8eef5;
  border-top: 1px solid #e8eef5;
  border-radius: 10px;
}

.product-image-keyword-modes {
  min-height: 32px;
  padding: 3px;
  background: #e6edf5;
  border: 0;
  border-radius: 8px;
}

.product-image-keyword-mode {
  height: 26px;
  border: 0;
  border-radius: 6px;
  color: #5a6b80;
  font-size: 11px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.product-image-keyword-mode:hover {
  color: #3d5470;
  background: rgba(255, 255, 255, 0.6);
}

.product-image-keyword-mode.is-active {
  color: #0f766e;
  background: #ffffff;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(18, 48, 82, 0.14);
}

.product-image-keyword-chip {
  padding: 4px 10px;
  border-radius: 999px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.product-image-keyword-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(23, 54, 92, 0.12);
}

/* 暗色主题适配 card-visual-v1 */
html[data-theme="dark"] .product-list-panel .decision-product {
  background: #16202c;
  border-color: #263546;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .product-list-panel .decision-product:hover {
  background: #16202c;
  border-color: #35506e;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .product-list-panel .decision-product.is-midplatform-match {
  border-color: rgba(43, 154, 141, 0.5);
  box-shadow: 0 10px 26px rgba(43, 154, 141, 0.16);
}

html[data-theme="dark"] .product-list-panel .decision-product.is-midplatform-match .thumb-frame {
  border-color: rgba(43, 154, 141, 0.5);
}

html[data-theme="dark"] .product-list-panel .decision-product .thumb-frame {
  border-color: #2b3b4e;
  background: linear-gradient(180deg, #1a2430, #141d28);
}

html[data-theme="dark"] .product-list-panel .decision-product:hover .thumb-frame {
  border-color: #3d5470;
  box-shadow: none;
}

.product-list-panel .decision-product.is-image-candidate-source {
  position: relative;
  padding: 8px 8px 12px !important;
  background: #f0fbf8;
  border: 1px solid #55b8a8;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15, 159, 143, 0.12);
}

.product-list-panel .decision-product.is-image-candidate-source:hover {
  background: #edfaf7;
  border-color: #0f9f8f;
  box-shadow: 0 10px 22px rgba(15, 159, 143, 0.16);
}

.product-list-panel .decision-product.is-image-candidate-source .thumb-frame {
  border: 2px solid #0f9f8f;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.product-card-image-source-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 4px 8px;
  color: #fff;
  background: #087569;
  border-radius: 5px;
  box-shadow: 0 3px 8px rgba(8, 117, 105, 0.24);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  pointer-events: none;
}

.product-list-panel .decision-product.is-image-candidate-source .same-search-card-check {
  cursor: not-allowed;
  opacity: 0.55;
}

html[data-theme="dark"] .product-list-panel .decision-product .pill {
  color: #9eacbd;
  background: #1d2a38;
  border-color: #33465b;
}

html[data-theme="dark"] .product-list-panel .decision-product .product-commerce-line {
  background: #131c27;
  border-color: #243244;
}

html[data-theme="dark"] .product-list-panel .decision-product .compact-actions .link-button {
  color: #9eacbd;
  background: #1d2a38;
}

html[data-theme="dark"] .product-list-panel .decision-product .compact-actions .link-button:hover {
  color: #cfe0f2;
  background: #26374b;
}

html[data-theme="dark"] .product-image-keyword-panel {
  background: #131c27;
  border-color: #243244;
}

html[data-theme="dark"] .product-image-keyword-modes {
  background: #0e1722;
}

html[data-theme="dark"] .product-image-keyword-mode {
  color: #9eacbd;
}

html[data-theme="dark"] .product-image-keyword-mode:hover {
  color: #cfe0f2;
  background: #1d2a38;
}

html[data-theme="dark"] .product-image-keyword-mode.is-active {
  color: #7fd6c8;
  background: #1f3b39;
  box-shadow: none;
}

html[data-theme="dark"] .product-image-keyword-chip:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

/* ===== 主商品卡片 + 关键词面板两栏布局 keyword-panel-side-v1 (20260820) ===== */

.decision-product.has-keyword-panel {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 14px;
}

.decision-product-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

.decision-product-side {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  border-left: 1px dashed #dbe6f1;
  padding-left: 14px;
}

html[data-theme="dark"] .decision-product-side {
  border-left-color: #2a3a4d;
}

.decision-product-side .product-image-keyword-panel {
  margin: 0;
}

.product-image-keyword-chip.is-selected::before {
  content: "✓";
  margin-right: 5px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .decision-product.has-keyword-panel {
    grid-template-columns: 1fr;
  }

  .decision-product-side {
    border-left: 0;
    padding-left: 0;
    border-top: 1px dashed #dbe6f1;
    padding-top: 12px;
  }

  html[data-theme="dark"] .decision-product-side {
    border-top-color: #2a3a4d;
  }
}

/* ===== 关键词面板紧凑化 keyword-panel-compact-v1 (20260820) ===== */

.product-image-keyword-panel {
  gap: 6px;
  padding: 9px 10px;
}

.product-image-keyword-head {
  gap: 6px;
}

.product-image-keyword-head-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.product-image-keyword-refresh {
  flex: 0 0 auto;
  height: 22px;
  padding: 0 9px;
  border: 1px solid #b9d5e8;
  border-radius: 999px;
  background: #f5fbff;
  color: #17608c;
  font-size: 12px;
  cursor: pointer;
}

.product-image-keyword-refresh:hover:not(:disabled) {
  background: #e5f3fc;
}

.product-image-keyword-refresh:disabled {
  opacity: .55;
  cursor: wait;
}

.product-image-keyword-head .product-image-keyword-modes {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  min-height: 22px;
  border-radius: 999px;
}

.product-image-keyword-mode {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
}

.product-image-keyword-mode + .product-image-keyword-mode {
  border-left: 1px solid #d8e1ea;
}

.product-image-keyword-chip-list {
  gap: 4px;
}

.product-image-keyword-chip {
  min-height: 22px;
  padding: 3px 8px;
  gap: 3px;
}

.product-image-keyword-chip-copy {
  margin-left: 4px;
}

.product-image-keyword-body,
.product-image-keyword-group,
.product-image-keyword-candidates {
  gap: 5px;
}

.product-image-keyword-selected {
  min-height: 0;
}

.product-image-keyword-search-action {
  gap: 6px;
  padding-top: 6px;
}

.product-image-keyword-search-count {
  color: #27435f;
  font-size: 10px;
  font-weight: 700;
}

.product-image-keyword-search-count strong {
  color: #0f766e;
  font-size: 12px;
}

.product-image-keyword-search-action button {
  min-height: 26px;
  max-width: none;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.product-image-keyword-search-action .product-image-keyword-stop-search {
  background: #ffffff;
  color: #b85c5c;
  border-color: #b85c5c;
}

.product-image-keyword-search-action .product-image-keyword-stop-search:hover:not(:disabled) {
  background: #b85c5c;
  color: #ffffff;
}

.product-image-keyword-similarity-progress {
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 0;
  padding: 6px 9px;
  font-size: 10px;
}

.product-image-custom-keyword {
  display: grid;
  min-width: 0;
  gap: 6px;
  margin: 2px 0 0;
  padding-top: 10px;
  border-top: 1px solid #d8e3ec;
}

.product-image-custom-keyword > label {
  color: #27435f;
  font-size: 12px;
  font-weight: 700;
}

.product-image-custom-keyword-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  align-items: center;
  gap: 8px;
}

.product-image-custom-keyword-controls input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 7px 10px;
  border: 1px solid #b7cddd;
  border-radius: 6px;
  background: #fff;
  color: #173a5d;
  font-size: 13px;
  letter-spacing: 0;
}

.product-image-custom-keyword-controls button {
  height: 36px;
  padding: 6px 10px;
  border: 1px solid #176f67;
  border-radius: 6px;
  background: #176f67;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.product-image-custom-keyword-controls button:hover:not(:disabled) {
  background: #115e59;
}

.product-image-custom-keyword-controls button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.product-image-custom-keyword-controls :focus-visible {
  outline: 2px solid #168b80;
  outline-offset: 2px;
}

html[data-theme="dark"] .product-image-custom-keyword {
  border-color: #344b60;
}

html[data-theme="dark"] .product-image-custom-keyword > label {
  color: #dce8f2;
}

html[data-theme="dark"] .product-image-custom-keyword-controls input {
  border-color: #4a647a;
  background: #182b3b;
  color: #edf4f8;
}

@media (max-width: 1180px) {
  .product-image-keyword-head {
    flex-wrap: wrap;
  }
}

/* ===== PID 商品与图片关键词横向工作区 pid-product-wide-v4 (20260820) ===== */

.product-list-panel .decision-product.has-keyword-panel {
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: minmax(500px, 0.95fr) minmax(380px, 1.05fr) !important;
  gap: 18px;
  align-items: stretch;
  padding: 14px !important;
  background: #ffffff;
  border: 1px solid #d8e3ec;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(23, 54, 92, 0.08);
}

.product-list-panel .decision-product.has-keyword-panel:hover {
  background: #ffffff;
  border-color: #b9ccdc;
  box-shadow: 0 9px 22px rgba(23, 54, 92, 0.11);
  transform: translateY(-1px);
}

.product-list-panel .decision-product.has-keyword-panel .decision-product-main {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  gap: 10px 16px;
  align-content: start;
  min-width: 0;
}

.product-list-panel .decision-product.has-keyword-panel .thumb-frame {
  grid-column: 1;
  grid-row: 1 / span 4;
  width: 220px;
  height: 220px;
  aspect-ratio: 1 / 1;
  align-self: start;
  background: #f7f9fb;
  border: 1px solid #dce5ed;
  border-radius: 7px;
  box-shadow: none;
}

.product-list-panel .decision-product.has-keyword-panel:hover .thumb-frame .thumb {
  transform: none;
}

.product-list-panel .decision-product.has-keyword-panel .product-copy {
  grid-column: 2;
  grid-row: 1;
  align-content: start;
}

.product-list-panel .decision-product.has-keyword-panel h3 {
  min-height: 0;
  font-size: 15px;
}

.product-list-panel .decision-product.has-keyword-panel .meta {
  min-height: 0;
}

.product-list-panel .decision-product.has-keyword-panel .product-commerce-line {
  grid-column: 2;
  grid-row: 2;
}

.product-list-panel .decision-product.has-keyword-panel .product-mid-match-notice {
  grid-column: 2;
  grid-row: 3;
}

.product-list-panel .decision-product.has-keyword-panel .actions {
  grid-column: 2;
  grid-row: 4;
  align-self: end;
  margin-top: 0;
}

.product-list-panel .decision-product.has-keyword-panel .decision-product-side {
  display: grid;
  min-width: 0;
  align-content: start;
  border-left: 1px solid #dce5ed;
  padding-left: 18px;
}

.product-list-panel .decision-product.has-keyword-panel .product-image-keyword-panel {
  min-height: 0;
  padding: 2px 0 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.product-list-panel .decision-product.has-keyword-panel .product-image-keyword-body {
  max-height: 174px;
  overflow-y: auto;
  align-content: start;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: #b8c8d6 transparent;
}

.product-list-panel .decision-product.has-keyword-panel .product-image-keyword-chip-list {
  align-content: start;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel {
  padding: 0 !important;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel:hover {
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: none;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .thumb-frame {
  border: 2px solid #2f9b8c;
}

html[data-theme="dark"] .product-list-panel .decision-product.has-keyword-panel {
  background: #16202c;
  border-color: #2b3b4e;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .product-list-panel .decision-product.has-keyword-panel .decision-product-side {
  border-left-color: #2b3b4e;
}

html[data-theme="dark"] .product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel {
  background: #162724;
  border-color: #35766d;
}

@media (max-width: 1050px) {
  .product-list-panel .decision-product.has-keyword-panel {
    grid-template-columns: 1fr !important;
  }

  .product-list-panel .decision-product.has-keyword-panel .decision-product-side {
    border-top: 1px solid #dce5ed;
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
  }

  html[data-theme="dark"] .product-list-panel .decision-product.has-keyword-panel .decision-product-side {
    border-top-color: #2b3b4e;
  }
}

@media (max-width: 620px) {
  .product-list-panel .decision-product.has-keyword-panel .decision-product-main {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .product-list-panel .decision-product.has-keyword-panel .thumb-frame {
    width: 140px;
    height: 140px;
  }
}

@media (max-width: 440px) {
  .product-list-panel .decision-product.has-keyword-panel .decision-product-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .product-list-panel .decision-product.has-keyword-panel .thumb-frame,
  .product-list-panel .decision-product.has-keyword-panel .product-copy,
  .product-list-panel .decision-product.has-keyword-panel .product-commerce-line,
  .product-list-panel .decision-product.has-keyword-panel .product-mid-match-notice,
  .product-list-panel .decision-product.has-keyword-panel .actions {
    grid-column: 1;
    grid-row: auto;
  }

  .product-list-panel .decision-product.has-keyword-panel .thumb-frame {
    width: 100%;
    height: auto;
  }
}

/* Candidate result cards keep the compact product shelf; only the source card uses the wide workspace. */
.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) {
  grid-column: auto;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  align-items: start;
  padding: 0 0 10px !important;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity):hover {
  background: transparent;
  border: 0;
  box-shadow: none;
  transform: translateY(-2px);
}

.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .decision-product-main {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: none;
  gap: 9px;
}

.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .thumb-frame {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  border: 1px solid #edf1f6;
  border-radius: 3px;
}

.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .product-copy,
.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .product-commerce-line,
.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .product-mid-match-notice,
.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .actions {
  grid-column: auto;
  grid-row: auto;
}

.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .product-copy {
  display: grid;
  gap: 6px;
}

.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) h3 {
  min-height: 58px;
  font-size: 13px;
}

.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .actions {
  align-self: auto;
  margin-top: 1px;
}

.product-list-panel .decision-product.has-keyword-panel:has(.product-card-image-similarity) .decision-product-side {
  display: none;
}

/* ===== 主图放大增强 image-zoom-v1 (20260820) ===== */

.thumb-frame[data-image-preview]::after {
  content: "⤢";
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  background: rgba(15, 39, 66, 0.62);
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.thumb-frame[data-image-preview]:hover::after,
.thumb-frame[data-image-preview]:focus-visible::after {
  opacity: 1;
}

.product-list-panel .product-list .thumb-frame[data-image-preview]:hover,
.thumb-frame[data-image-preview]:hover {
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.35);
}

.image-preview-panel {
  overflow: hidden;
}

.image-preview-panel img {
  cursor: zoom-in;
  transition: transform 0.12s ease;
  touch-action: none;
  user-select: none;
}

.image-preview-panel footer {
  position: relative;
  z-index: 2;
  gap: 10px;
  background: #ffffff;
}

.image-preview-panel footer #imagePreviewZoomHint {
  flex: 0 0 auto;
  padding: 2px 8px;
  color: #33506e;
  background: #eef4fb;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

/* Keep PID image candidates in the same responsive product-card grid. */
.product-image-candidate-source {
  display: none !important;
}

.product-list-panel .decision-product.has-keyword-panel {
  grid-column: auto !important;
  grid-template-columns: 1fr !important;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 12px 12px 13px !important;
  background: #ffffff;
  border: 1px solid #e4ebf3;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(23, 54, 92, 0.05);
}

.product-list-panel .decision-product.has-keyword-panel:hover {
  background: #ffffff;
  border-color: #c9dcf2;
  box-shadow: 0 12px 28px rgba(23, 54, 92, 0.12);
}

.product-list-panel .decision-product.has-keyword-panel .decision-product-main {
  grid-column: auto;
  grid-row: auto;
  grid-template-columns: 1fr;
  grid-template-rows: none;
  gap: 9px;
}

.product-list-panel .decision-product.has-keyword-panel .thumb-frame,
.product-list-panel .decision-product.has-keyword-panel .product-copy,
.product-list-panel .decision-product.has-keyword-panel .product-commerce-line,
.product-list-panel .decision-product.has-keyword-panel .product-mid-match-notice,
.product-list-panel .decision-product.has-keyword-panel .actions {
  grid-column: auto;
  grid-row: auto;
}

.product-list-panel .decision-product.has-keyword-panel .thumb-frame {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.product-list-panel .decision-product.has-keyword-panel .product-copy h3 {
  min-height: 58px;
  font-size: 13px;
}

.product-list-panel .decision-product.has-keyword-panel .decision-product-side {
  display: grid;
  border-top: 1px solid #dce5ed;
  border-left: 0;
  padding-top: 12px;
  padding-left: 0;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel {
  background: #f0fbf8;
  border-color: #55b8a8;
  box-shadow: 0 8px 18px rgba(15, 159, 143, 0.12);
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel:hover {
  background: #edfaf7;
  border-color: #0f9f8f;
  box-shadow: 0 10px 22px rgba(15, 159, 143, 0.16);
}

html[data-theme="dark"] .product-list-panel .decision-product.has-keyword-panel {
  background: #16202c;
  border-color: #2b3b4e;
}

html[data-theme="dark"] .product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel {
  background: #162724;
  border-color: #35766d;
}

@media (max-width: 1050px) {
  .product-list-panel .decision-product.has-keyword-panel .decision-product-side {
    border-top: 1px solid #dce5ed;
    border-left: 0;
    padding-top: 12px;
    padding-left: 0;
  }
}

html[data-theme="dark"] .product-list-panel .decision-product.has-keyword-panel .decision-product-side {
  border-top-color: #2b3b4e;
}

/* PID 图片识别的主商品与候选商品使用相同的响应式卡片尺寸。 */
.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel {
  grid-column: auto !important;
  grid-template-columns: 1fr !important;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  align-items: start;
  padding: 12px 12px 13px !important;
  background: #f0fbf8;
  border: 1px solid #55b8a8;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(15, 159, 143, 0.12);
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel:hover {
  background: #edfaf7;
  border-color: #0f9f8f;
  box-shadow: 0 10px 22px rgba(15, 159, 143, 0.16);
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .decision-product-main {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: none;
  gap: 9px;
  align-content: start;
  min-width: 0;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .thumb-frame {
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  border: 2px solid #2f9b8c;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .product-copy {
  grid-column: auto;
  grid-row: auto;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel h3 {
  min-height: 58px;
  font-size: 13px;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .meta {
  min-height: 0;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .product-commerce-line {
  grid-column: auto;
  grid-row: auto;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .product-mid-match-notice {
  grid-column: auto;
  grid-row: auto;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .actions {
  grid-column: auto;
  grid-row: auto;
  align-self: auto;
  margin-top: 1px;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .decision-product-side {
  display: grid;
  min-width: 0;
  align-content: start;
  border-top: 1px solid #b8dfd6;
  border-left: 0;
  padding-top: 12px;
  padding-left: 0;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .product-image-keyword-panel {
  min-height: 0;
  padding: 0;
}

.product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .product-image-keyword-body {
  max-height: 190px;
  overflow-y: auto;
  align-content: start;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #b8c8d6 transparent;
}

html[data-theme="dark"] .product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel {
  background: #162724;
  border-color: #35766d;
}

html[data-theme="dark"] .product-list-panel .decision-product.is-image-candidate-source.has-keyword-panel .decision-product-side {
  border-top-color: #35766d;
}

/* ===== 搜索类型结果布局 result-layout-by-search-mode-v1 (20260821) ===== */

/* PID keeps the product work area and keyword recognition panel in one row. */
.product-list-panel .product-list.product-results-layout-pid:not(.empty) {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) !important;
  gap: 18px;
  align-items: stretch;
  padding: 14px !important;
  background: #ffffff;
  border: 1px solid #d8e3ec;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(23, 54, 92, 0.08);
}

.product-list-panel .product-list.product-results-layout-pid .decision-product .decision-product-main {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto auto;
  gap: 10px 16px;
  align-content: start;
  align-self: start;
  min-width: 0;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product .thumb-frame {
  grid-column: 1;
  grid-row: 1 / span 4;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product .thumb-frame .thumb {
  object-fit: contain;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product .product-copy {
  grid-column: 2;
  grid-row: 1;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product .product-commerce-line {
  grid-column: 2;
  grid-row: 2;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product .product-mid-match-notice {
  grid-column: 2;
  grid-row: 3;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product .actions {
  grid-column: 2;
  grid-row: 4;
  align-self: end;
  margin-top: 0;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel .decision-product-side {
  display: grid !important;
  min-width: 0;
  align-content: start;
  border-left: 1px solid #dce5ed;
  border-top: 0;
  padding-top: 0;
  padding-left: 18px;
}

/* Keyword mode uses the same compact card geometry for every product.
   The column count is computed in JS (fitKeywordResultColumns) and exposed
   via --keyword-grid-cols so each row can fully fill the container while
   keeping every card at a fixed width. */
.product-list-panel .product-list.product-results-layout-keyword:not(.empty) {
  grid-template-columns: repeat(var(--keyword-grid-cols, 10), minmax(0, 1fr)) !important;
  align-items: start;
  gap: 10px;
  padding: 10px;
}

/* Keep a lone keyword result compact instead of stretching its square image across the shelf. */
.product-list-panel .product-list.product-results-layout-keyword .decision-product {
  width: 100%;
  justify-self: stretch;
  container-type: inline-size;
  container-name: keyword-card;
}

@container keyword-card (max-width: 200px) {
  .product-list-panel .decision-product .product-commerce-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-list-panel .decision-product .product-card-sales-control {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .product-list-panel .decision-product .product-card-price {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel {
  grid-column: auto !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  align-items: start;
  padding: 12px 12px 13px !important;
  background: #ffffff;
  border: 1px solid #e4ebf3;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(23, 54, 92, 0.05);
}

.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .decision-product-main {
  display: grid;
  grid-template-columns: 1fr !important;
  grid-template-rows: none;
  gap: 9px;
  min-width: 0;
}

.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .thumb-frame,
.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .product-copy,
.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .product-commerce-line,
.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .product-mid-match-notice,
.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .actions {
  grid-column: auto;
  grid-row: auto;
}

.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .thumb-frame {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .product-copy h3 {
  min-height: 58px;
  font-size: 13px;
}

.product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel .decision-product-side {
  display: none !important;
}

.product-list-panel .product-list.product-results-layout-keyword .decision-product.is-image-candidate-source.has-keyword-panel {
  background: #f0fbf8;
  border-color: #55b8a8;
  box-shadow: 0 8px 18px rgba(15, 159, 143, 0.12);
}

html[data-theme="dark"] .product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel,
html[data-theme="dark"] .product-list-panel .product-list.product-results-layout-keyword .decision-product.has-keyword-panel {
  background: #16202c;
  border-color: #2b3b4e;
}

html[data-theme="dark"] .product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel .decision-product-side {
  border-left-color: #2b3b4e;
}

html[data-theme="dark"] .product-list-panel .product-list.product-results-layout-keyword .decision-product.is-image-candidate-source.has-keyword-panel {
  background: #162724;
  border-color: #35766d;
}

@media (max-width: 900px) {
  .product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel {
    grid-template-columns: 1fr !important;
  }

  .product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel .decision-product-side {
    border-top: 1px solid #dce5ed;
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .product-list-panel .product-list.product-results-layout-keyword .decision-product {
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 520px) {
  .product-list-panel .product-list.product-results-layout-pid .decision-product .decision-product-main {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto;
  }

  .product-list-panel .product-list.product-results-layout-pid .decision-product .thumb-frame,
  .product-list-panel .product-list.product-results-layout-pid .decision-product .product-copy,
  .product-list-panel .product-list.product-results-layout-pid .decision-product .product-commerce-line,
  .product-list-panel .product-list.product-results-layout-pid .decision-product .product-mid-match-notice,
  .product-list-panel .product-list.product-results-layout-pid .decision-product .actions {
    grid-column: 1;
    grid-row: auto;
  }

  .product-list-panel .product-list.product-results-layout-pid .decision-product .thumb-frame {
    width: min(220px, 100%);
    height: auto;
    justify-self: center;
  }
}

/* Keep the PID source card content-driven so its actions do not drop into a large empty shelf. */
.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel {
  align-items: start;
  min-height: 0;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel .decision-product-main {
  grid-template-rows: auto auto auto auto;
  align-content: start;
  align-self: start;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel .actions {
  align-self: start;
  margin-top: 0;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel .decision-product-side {
  align-self: start;
}

/* Final compact override for PID cards rendered without the optional layout class. */
.product-list-panel .decision-product.has-keyword-panel {
  align-items: start;
}

.product-list-panel .decision-product.has-keyword-panel .decision-product-main {
  grid-template-rows: auto auto auto auto;
  align-content: start;
  align-self: start;
}

.product-list-panel .decision-product.has-keyword-panel .actions {
  align-self: start;
  margin-top: 0;
}

/* Balance the two-column PID card when the keyword panel is taller than the
   product details: the left pane fills the card and keeps actions at its foot. */
.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel {
  align-items: stretch;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel .decision-product-main {
  height: 100%;
  grid-template-rows: auto auto 1fr auto;
  align-content: stretch;
}

.product-list-panel .product-list.product-results-layout-pid .decision-product.has-keyword-panel .actions {
  align-self: end;
}

/* Keep workflow navigation visible and compact on narrow screens. */
@media (max-width: 1180px) {
  body .selection-workflow {
    position: fixed;
    top: 116px;
    left: 12px;
    width: min(380px, calc(100vw - 24px));
    max-height: min(390px, calc(100vh - 134px));
    overflow-x: hidden;
    overflow-y: auto;
  }

  body .selection-workflow-inner {
    padding: 10px;
    gap: 8px;
  }

  body .selection-workflow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body .selection-workflow-step {
    min-height: 50px;
    gap: 7px;
    padding: 8px;
  }

  body .selection-workflow-step:not(:last-child)::after {
    display: none;
  }

  body .selection-workflow-filter-wrap,
  body .selection-workflow-branch {
    grid-column: span 2;
  }

  body .selection-workflow-branch {
    margin: -2px 0 0;
    padding: 0;
  }

  body .selection-workflow-branch::before {
    display: none;
  }

  body .workflow-copy strong {
    font-size: 12px;
  }

  body .workflow-step-status {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  body .selection-workflow {
    top: 134px;
    left: 8px;
    width: min(360px, calc(100vw - 16px));
    max-height: calc(100vh - 150px);
  }

  body .selection-workflow-steps {
    grid-template-columns: 1fr;
  }

  body .selection-workflow-filter-wrap,
  body .selection-workflow-branch {
    grid-column: auto;
  }
}

/* Final narrow-screen overrides: keep the workflow heading visible and clear
   the compact mobile navigation before the results content begins. */
@media (max-width: 1180px) {
  body .selection-workflow-title {
    display: flex !important;
  }
}

@media (max-width: 767px) {
  body .selection-workflow {
    position: sticky;
    top: 142px;
    left: auto;
    width: min(380px, calc(100vw - 24px));
    max-height: none;
    margin: 8px 12px 0;
    overflow: visible;
  }

  body .selection-workflow-inner {
    padding: 10px;
  }

  body .selection-workflow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body .selection-workflow-filter-wrap,
  body .selection-workflow-branch {
    grid-column: span 3;
  }

  body .selection-workflow-step {
    gap: 5px;
    padding: 6px;
  }

  body .selection-workflow-step .workflow-index {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  body .selection-workflow-step .workflow-copy strong {
    font-size: 11px;
  }

  body .selection-workflow-step .workflow-step-status {
    font-size: 10px;
  }
}

@media (max-width: 520px) {
  body .selection-workflow {
    top: 142px;
    left: auto;
    width: min(360px, calc(100vw - 16px));
    margin: 8px 8px 0;
  }
}

/* Search workflow stepper (2026-08-25). */
.selection-workflow-restore,
.selection-workflow-hide {
  display: none !important;
}

body .selection-workflow,
body.workflow-overlay-page .selection-workflow {
  position: sticky;
  inset: auto;
  top: 72px;
  z-index: 70;
  width: auto;
  max-height: none;
  margin: 16px var(--app-page-edge, 32px) 0;
  overflow: visible;
  background: #f8fbff;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  box-shadow: 0 9px 24px rgba(18, 40, 68, 0.11);
  backdrop-filter: blur(12px);
}

body .selection-workflow-inner {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 12px 20px 10px;
}

body .selection-workflow-title {
  display: flex !important;
  min-width: 0;
  align-items: center;
  padding: 0;
  border: 0;
}

body .selection-workflow-title > div:first-child {
  gap: 2px;
}

body .selection-workflow-title span {
  color: #607287;
  font-size: 11px;
}

body .selection-workflow-title strong {
  overflow: hidden;
  color: #173a63;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .selection-workflow-title-actions {
  margin-left: auto;
}

body .selection-workflow-steps {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 6px;
}

body .selection-workflow-steps::before {
  position: absolute;
  top: 15px;
  right: calc(100% / 12);
  left: calc(100% / 12);
  z-index: 0;
  height: 2px;
  content: "";
  background: #d5e1ed;
}

body .selection-workflow-step {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  padding: 0 4px 4px;
  color: #536579;
  background: transparent;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  text-align: center;
}

body .selection-workflow-step:hover,
body .selection-workflow-step:focus-visible,
body .selection-workflow-step.is-active,
body .selection-workflow-step.is-running,
body .selection-workflow-step.is-next,
body .selection-workflow-step.is-history-view,
body .selection-workflow-step.is-latest-return {
  background: rgba(37, 99, 168, 0.06);
  border: 0;
  box-shadow: none;
  transform: none;
}

body .selection-workflow-step::after {
  display: none;
}

body .selection-workflow .workflow-index {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
  background: #f8fbff;
  font-size: 12px;
}

body .selection-workflow .workflow-copy {
  justify-items: center;
  gap: 2px;
}

body .selection-workflow .workflow-copy strong {
  max-width: 100%;
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
}

body .selection-workflow .workflow-step-status {
  max-width: 100%;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .selection-workflow-step[data-workflow-step="collect"] { grid-column: 1; grid-row: 1; }
body .selection-workflow-step[data-workflow-step="keywords"] { grid-column: 2; grid-row: 1; }
body .selection-workflow-step[data-workflow-step="competitors"] { grid-column: 3; grid-row: 1; }
body .selection-workflow-filter-wrap { grid-column: 4; grid-row: 1; }
body .selection-workflow-step[data-workflow-step="imageSearch"] { grid-column: 5; grid-row: 1; }
body .selection-workflow-step[data-workflow-step="decision"] { grid-column: 6; grid-row: 1; }

body .selection-workflow-filter-wrap {
  position: relative;
  display: block;
  width: auto;
  min-width: 0;
}

body .selection-workflow-filter-wrap .selection-workflow-step {
  width: 100%;
}

body .workflow-filter-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: auto;
  min-width: 34px;
  height: 20px;
  min-height: 20px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  line-height: 18px;
  white-space: nowrap;
}

body .selection-workflow-branch {
  margin: 0;
  padding: 0;
}

body .filter-workflow-branch {
  grid-column: 4;
  grid-row: 2;
}

body #imageSearchWorkflowBranch {
  grid-column: 5;
  grid-row: 2;
}

body .selection-workflow-branch::before {
  display: none;
}

body .selection-workflow-branch-button {
  min-height: 38px;
  gap: 6px;
  padding: 5px 7px;
}

body .selection-workflow-branch-icon {
  width: 20px;
  height: 20px;
}

body .selection-workflow-branch-copy strong { font-size: 10px; }
body .selection-workflow-branch-copy small { font-size: 9px; }

body[data-search-channel="pid"] #filterSuite,
body[data-search-channel="pid"] .product-list-panel .result-actions-bar,
body[data-search-channel="pid"] .product-list-panel > .batch-keyword-nav,
body[data-search-channel="pid"] .product-list-panel > .product-classification-summary {
  display: none !important;
}

@media (min-width: 1181px) {
  .market-layout {
    margin-right: var(--app-page-edge);
    margin-left: var(--app-page-edge);
  }
}

html[data-theme="dark"] body .selection-workflow {
  background: #172333;
  border-color: #314256;
}

html[data-theme="dark"] body .selection-workflow-steps::before {
  background: #3b4d62;
}

html[data-theme="dark"] body .selection-workflow .workflow-index {
  background: #172333;
}

@media (max-width: 980px) {
  body .selection-workflow {
    width: auto;
    margin: 10px 12px 0;
  }

  body .selection-workflow-inner {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  body .selection-workflow-title {
    justify-content: space-between;
  }
}

@media (max-width: 680px) {
  body .selection-workflow {
    margin: 8px 8px 0;
  }

  body .selection-workflow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto;
    row-gap: 8px;
  }

  body .selection-workflow-steps::before {
    display: none;
  }

  body .selection-workflow-step[data-workflow-step="collect"] { grid-column: 1; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="keywords"] { grid-column: 2; grid-row: 1; }
  body .selection-workflow-step[data-workflow-step="competitors"] { grid-column: 3; grid-row: 1; }
  body .selection-workflow-filter-wrap { grid-column: 1; grid-row: 2; }
  body .selection-workflow-step[data-workflow-step="imageSearch"] { grid-column: 2; grid-row: 2; }
  body .selection-workflow-step[data-workflow-step="decision"] { grid-column: 3; grid-row: 2; }
  body .filter-workflow-branch { grid-column: 1 / 4; grid-row: 3; }
  body #imageSearchWorkflowBranch { grid-column: 1 / 4; grid-row: 3; }
}

@media (max-width: 560px) {
  body .selection-workflow,
  body.workflow-overlay-page .selection-workflow {
    top: 58px;
  }
}

/* Collapsible application side navigation (2026-08-25). */
:root {
  --primary-sidebar-width: 252px;
  --primary-sidebar-collapsed-width: 76px;
  --primary-sidebar-content-gap: 18px;
  --primary-sidebar-bg: #123c3b;
  --primary-sidebar-bg-deep: #0d302f;
  --primary-sidebar-text: #d8eeea;
  --primary-sidebar-muted: #91b9b3;
  --primary-sidebar-accent: #63d6c8;
}

.topbar {
  z-index: 90;
}

.brand-lockup {
  gap: 10px;
}

.primary-nav-toggle,
.primary-nav-close {
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  box-shadow: none;
  cursor: pointer;
}

.primary-nav-toggle {
  color: #255e5a;
  background: #eef8f6;
  border: 1px solid #c9e3df;
}

.primary-nav-toggle:hover,
.primary-nav-toggle:focus-visible {
  color: #123c3b;
  background: #dff2ef;
  border-color: #9fcfc8;
  box-shadow: none;
  transform: none;
}

.primary-nav-toggle span {
  font-size: 18px;
  line-height: 1;
}

.primary-nav {
  position: fixed;
  top: 62px;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  width: var(--primary-sidebar-width);
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  color: var(--primary-sidebar-text);
  background: var(--primary-sidebar-bg);
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  transition: width 0.2s ease, transform 0.22s ease;
  scrollbar-color: rgba(216, 238, 234, 0.28) transparent;
  scrollbar-width: thin;
}

.primary-nav-head {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  background: var(--primary-sidebar-bg-deep);
  border-bottom: 0;
}

.primary-nav-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.primary-nav-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: #183b38;
  background: #f6c453;
  border-radius: 7px;
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 900;
}

.primary-nav-brand-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.primary-nav-brand-copy strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-nav-brand-copy small {
  color: var(--primary-sidebar-muted);
  font-size: 10px;
  font-weight: 700;
}

.primary-nav-close {
  color: #c9e5e0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.primary-nav-close:hover,
.primary-nav-close:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: none;
  transform: none;
}

.primary-nav-close span {
  font-size: 24px;
  line-height: 1;
}

.primary-nav-inner {
  display: flex;
  width: 100%;
  min-width: 0;
  margin: 0;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 20px;
}

.primary-nav-group-label {
  margin: 12px 8px 4px;
  color: var(--primary-sidebar-muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-nav-group-label:first-child {
  margin-top: 2px;
}

.primary-nav .nav-item {
  position: relative;
  width: 100%;
  min-width: 0;
}

.primary-nav .nav-link {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 44px;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  padding: 0 10px;
  color: var(--primary-sidebar-text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

.primary-nav .nav-link::after {
  display: none !important;
  content: none !important;
}

.primary-nav .nav-link:hover,
.primary-nav .nav-link:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  box-shadow: none;
  transform: none;
}

.primary-nav .nav-link.active,
.primary-nav .nav-link.agent-open,
.primary-nav .nav-link[aria-expanded="true"] {
  color: #173b38;
  background: #f4fbfa;
  border: 0;
  border-radius: 6px;
  box-shadow: inset 3px 0 0 #f1b83d;
  font-weight: 850;
}

.primary-nav .nav-link .nav-symbol {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  margin: 0;
  color: var(--primary-sidebar-accent);
  background: rgba(99, 214, 200, 0.1);
  border-radius: 5px;
  font-family: var(--font-number);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  transform: none;
}

.primary-nav .nav-link.active .nav-symbol {
  color: #17665f;
  background: #dff4f0;
}

.primary-nav .nav-link .nav-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  transform: none;
}

.primary-nav .nav-link .nav-caret {
  width: 18px;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  color: var(--primary-sidebar-muted);
  font-size: 16px;
  line-height: 1;
  transform: rotate(-90deg);
  transition: transform 0.18s ease, color 0.18s ease;
}

.primary-nav .nav-link[aria-expanded="true"] .nav-caret {
  color: #17665f;
  transform: rotate(0);
}

.primary-nav .product-search-nav-menu {
  position: static;
  display: grid;
  width: auto;
  gap: 3px;
  margin: 4px 0 4px 43px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  animation: none;
}

.primary-nav .product-search-nav-menu[hidden] {
  display: none !important;
}

.primary-nav .product-search-nav-menu.closing {
  display: none;
  animation: none;
}

.product-search-nav-option {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 36px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 10px;
  color: #b9d8d3;
  background: transparent;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

/* Override the generic floating-menu button treatment for the nested sidebar menu. */
.primary-nav .product-search-nav-menu .product-search-nav-option {
  justify-self: stretch;
  background: transparent;
}

.primary-nav .product-search-nav-menu .product-search-nav-option:hover,
.primary-nav .product-search-nav-menu .product-search-nav-option:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transform: none;
}

.primary-nav .product-search-nav-menu .product-search-nav-option.is-active {
  color: #ffffff;
  background: rgba(99, 214, 200, 0.15);
  font-weight: 850;
}

.product-search-nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  color: #7fe1d4;
  background: rgba(99, 214, 200, 0.1);
  border-radius: 4px;
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 900;
}

.primary-nav-backdrop {
  position: fixed;
  inset: 62px 0 0;
  z-index: 70;
  pointer-events: none;
  background: rgba(18, 36, 35, 0.38);
  opacity: 0;
  transition: opacity 0.2s ease;
}

@media (min-width: 1181px) {
  body .selection-workflow {
    margin-right: var(--app-page-edge);
    margin-left: calc(var(--primary-sidebar-width) + var(--primary-sidebar-content-gap));
  }

  body .selection-workflow-inner {
    grid-template-columns: 172px minmax(0, 1fr);
    gap: 22px;
    padding: 16px 22px 14px;
  }

  body .selection-workflow-title span {
    font-size: 12px;
  }

  body .selection-workflow-title strong {
    font-size: 14px;
    line-height: 1.35;
  }

  body .selection-workflow-steps {
    column-gap: 10px;
    row-gap: 8px;
  }

  body .selection-workflow-steps::before {
    top: 17px;
  }

  body .selection-workflow-step {
    min-height: 68px;
    gap: 7px;
    padding: 0 6px 7px;
  }

  body .selection-workflow .workflow-index {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  body .selection-workflow .workflow-copy strong {
    font-size: 13px;
  }

  body .selection-workflow .workflow-step-status {
    font-size: 10px;
  }

  body .workflow-filter-toggle {
    top: 6px;
    right: 5px;
    min-width: 38px;
    height: 22px;
    min-height: 22px;
    font-size: 10px;
  }

  .primary-nav-head {
    min-height: 78px;
    padding: 16px;
  }

  .primary-nav-brand {
    gap: 12px;
  }

  .primary-nav-brand-mark {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }

  .primary-nav-brand-copy strong {
    font-size: 15px;
  }

  .primary-nav-brand-copy small {
    font-size: 11px;
  }

  .primary-nav-inner {
    gap: 6px;
    padding: 10px 14px 24px;
  }

  .primary-nav .nav-link {
    height: 50px;
    gap: 12px;
    padding: 0 12px;
    font-size: 14px;
  }

  .primary-nav .nav-link .nav-symbol {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .primary-nav .nav-link .nav-label {
    font-size: 14px;
  }

  body .market-layout,
  body .secondary-workspace {
    margin-right: var(--app-page-edge);
    margin-left: calc(var(--primary-sidebar-width) + var(--primary-sidebar-content-gap));
  }

  body.primary-nav-collapsed .primary-nav {
    width: var(--primary-sidebar-collapsed-width);
  }

  body.primary-nav-collapsed .selection-workflow,
  body.primary-nav-collapsed .market-layout,
  body.primary-nav-collapsed .secondary-workspace {
    margin-left: calc(var(--primary-sidebar-collapsed-width) + var(--primary-sidebar-content-gap));
  }

  body.primary-nav-collapsed .primary-nav-head {
    justify-content: center;
    padding-right: 8px;
    padding-left: 8px;
  }

  body.primary-nav-collapsed .primary-nav-brand-copy,
  body.primary-nav-collapsed .primary-nav-close,
  body.primary-nav-collapsed .primary-nav-group-label,
  body.primary-nav-collapsed .primary-nav .nav-link .nav-label,
  body.primary-nav-collapsed .primary-nav .nav-link .nav-caret,
  body.primary-nav-collapsed .primary-nav .product-search-nav-menu {
    display: none;
  }

  body.primary-nav-collapsed .primary-nav-inner {
    padding-right: 8px;
    padding-left: 8px;
  }

  body.primary-nav-collapsed .primary-nav .nav-link {
    width: 48px;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
  }

  body.primary-nav-collapsed .primary-nav .nav-link.active {
    box-shadow: inset 0 -3px 0 #f1b83d;
  }
}

@media (max-width: 1180px) {
  .primary-nav {
    top: 62px;
    width: min(280px, calc(100vw - 44px));
    transform: translateX(-102%);
  }

  body.primary-nav-open {
    overflow: hidden;
  }

  body.primary-nav-open .primary-nav {
    transform: translateX(0);
  }

  body.primary-nav-open .primary-nav-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  body .selection-workflow,
  body .market-layout,
  body .secondary-workspace {
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .primary-nav {
    top: 58px;
    height: calc(100vh - 58px);
  }

  .primary-nav-backdrop {
    inset: 58px 0 0;
  }

  .brand-lockup {
    gap: 6px;
  }

  .primary-nav-toggle {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
  }

  .brand-title-inline .brand-word {
    display: none;
  }
}

/* Compact the primary search workspace on large displays without affecting responsive layouts. */
@media (min-width: 1181px) {
  :root {
    --primary-workspace-max-width: 1440px;
  }

  body {
    --primary-workspace-sidebar-width: var(--primary-sidebar-width);
  }

  body.primary-nav-collapsed {
    --primary-workspace-sidebar-width: var(--primary-sidebar-collapsed-width);
  }

  body:not(.workflow-overlay-page) .selection-workflow,
  body .market-layout {
    width: auto;
    max-width: var(--primary-workspace-max-width);
    margin-right: max(
      var(--primary-sidebar-content-gap),
      calc((100vw - var(--primary-workspace-sidebar-width) - var(--primary-workspace-max-width)) / 2)
    );
    margin-left: calc(
      var(--primary-workspace-sidebar-width) +
      max(
        var(--primary-sidebar-content-gap),
        calc((100vw - var(--primary-workspace-sidebar-width) - var(--primary-workspace-max-width)) / 2)
      )
    );
  }

  body.primary-nav-collapsed:not(.workflow-overlay-page) .selection-workflow,
  body.primary-nav-collapsed .market-layout {
    margin-right: max(
      var(--primary-sidebar-content-gap),
      calc((100vw - var(--primary-workspace-sidebar-width) - var(--primary-workspace-max-width)) / 2)
    );
    margin-left: calc(
      var(--primary-workspace-sidebar-width) +
      max(
        var(--primary-sidebar-content-gap),
        calc((100vw - var(--primary-workspace-sidebar-width) - var(--primary-workspace-max-width)) / 2)
      )
    );
  }

  body:not(.workflow-overlay-page) .selection-workflow-inner {
    grid-template-columns: 156px minmax(0, 1fr);
    gap: 18px;
    padding: 11px 18px 9px;
  }

  body:not(.workflow-overlay-page) .selection-workflow-step {
    min-height: 58px;
    gap: 5px;
    padding-bottom: 5px;
  }

  body:not(.workflow-overlay-page) .selection-workflow .workflow-index {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .market-layout .search-panel .searchbar {
    gap: 16px;
    padding: 20px 22px;
  }

  .market-layout .search-copy h2 {
    font-size: 26px;
  }

  .market-layout .product-classification-summary {
    padding: 10px 14px 14px;
  }
}

/* Keep wide keyword result shelves balanced when filtering leaves only a few cards.
   JS handles the column count so this block only carries the wide-screen minimum. */
@media (min-width: 1181px) {
  .product-list-panel .product-list.product-results-layout-keyword:not(.empty) {
    --keyword-min-card-width: 150px;
  }
}

/* Match the compact validation workspace frame on wide desktop screens. */
@media (min-width: 1181px) {
  :root {
    --primary-sidebar-width: 230px;
    --app-page-edge: clamp(32px, 3vw, 56px);
  }

  .topbar {
    min-height: 48px;
    height: 48px;
    padding: 6px 16px 6px 4px;
  }

  .primary-nav {
    top: 48px;
  }

  .primary-nav-backdrop {
    inset: 48px 0 0;
  }

  body .selection-workflow,
  body.workflow-overlay-page .selection-workflow,
  body:not(.workflow-overlay-page) .selection-workflow,
  body.primary-nav-collapsed:not(.workflow-overlay-page) .selection-workflow {
    margin-right: var(--app-page-edge);
    margin-left: calc(var(--primary-sidebar-width) + var(--primary-sidebar-content-gap));
    max-width: none;
    width: auto;
  }

  body .selection-workflow {
    width: auto !important;
    max-width: none !important;
  }

  body .market-layout {
    width: auto;
    max-width: none;
    margin-right: var(--app-page-edge);
    margin-left: calc(var(--primary-sidebar-width) + var(--primary-sidebar-content-gap));
  }

  /* Keep every full-page workspace on the same fluid desktop frame as the
     product list. Functional pages must grow with the available viewport
     instead of stopping at the legacy centered 1,760px frame. */
  body:not(.profit-analysis-active) .secondary-workspace {
    width: auto;
    max-width: none;
    margin-right: var(--app-page-edge);
    margin-left: calc(var(--primary-sidebar-width) + var(--primary-sidebar-content-gap));
  }

  body.primary-nav-collapsed:not(.profit-analysis-active) .secondary-workspace {
    margin-left: calc(var(--primary-sidebar-collapsed-width) + var(--primary-sidebar-content-gap));
  }
}

/* 通用确认弹窗（危险操作二次确认，替代 window.confirm，规避 iframe sandbox 拦截） */
.confirm-dialog {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
}

.confirm-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 31, 0.42);
  backdrop-filter: blur(4px);
}

.confirm-dialog-panel {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(10, 22, 40, 0.28);
}

.confirm-dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 22px 0;
}

.confirm-dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 12px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.confirm-dialog-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
}

.confirm-dialog-body {
  padding: 12px 22px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 22px 22px;
}

.confirm-dialog-button {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.confirm-dialog-button.confirm-dialog-cancel {
  color: var(--ink-soft);
  background: var(--panel-soft);
  border-color: var(--line);
}

.confirm-dialog-button.confirm-dialog-cancel:hover {
  background: var(--line);
}

.confirm-dialog-button.confirm-dialog-danger {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.confirm-dialog-button.confirm-dialog-danger:hover {
  background: #a93443;
  border-color: #a93443;
  box-shadow: 0 8px 18px rgba(195, 68, 83, 0.28);
  transform: translateY(-1px);
}

.confirm-dialog-button.confirm-dialog-primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.confirm-dialog-button.confirm-dialog-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  box-shadow: 0 8px 18px rgba(11, 118, 107, 0.28);
  transform: translateY(-1px);
}

/* 评论 hover 翻译 tooltip（跟随鼠标，位于鼠标上方居中） */
.review-translate-tip {
  position: fixed;
  z-index: 200;
  max-width: 360px;
  padding: 8px 12px;
  color: #fff;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.28);
  font-size: 13px;
  line-height: 1.6;
  pointer-events: none;
  transform: translate(-50%, -100%);
  white-space: pre-wrap;
  word-break: break-word;
}

.review-translate-tip[hidden] {
  display: none;
}

/* ==== 以图选词：对当前 PID 商品主图触发关键词识别，复用现成 product-image-keyword-panel ==== */
.search-panel .search-control .search-image-pick-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, #12b39f, var(--teal-dark));
  box-shadow: 0 14px 24px rgba(15, 159, 143, 0.2);
}

.search-panel .search-control .search-image-pick-button[hidden] {
  display: none;
}

.search-panel .search-control .search-image-pick-button:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(135deg, var(--teal-dark), #0a5f57);
}

.search-panel .search-control .search-image-pick-button .search-image-pick-icon {
  width: 15px;
  height: 15px;
  border: 1.6px solid currentColor;
  border-radius: 3px;
  position: relative;
}

.search-panel .search-control .search-image-pick-button .search-image-pick-icon::before {
  content: "";
  position: absolute;
  left: 2.2px;
  bottom: 2.6px;
  width: 3.4px;
  height: 3.4px;
  border-radius: 50%;
  background: currentColor;
}

.search-panel .search-control .search-image-pick-button .search-image-pick-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 6.4px;
  width: 9px;
  height: 4.6px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(-38deg);
  transform-origin: left top;
}

/* ─────────────────────────────────────────────────────────────
   商品列表：后面还有更多数据时（JS 给 panel 加了 .has-more-products class），
   保持商品卡片和分页内容高度，避免空白区域撑满面板。
   ───────────────────────────────────────────────────────────── */

.product-list-panel.has-more-products {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.product-list-panel.has-more-products .product-classification-summary {
  flex-shrink: 0;
}

.product-list-panel.has-more-products .product-list:not(.empty) {
  flex: 0 0 auto;
  display: grid;
  grid-auto-rows: auto;
  align-content: start;
}

.product-list-panel.has-more-products .product-list:not(.empty) .decision-product {
  min-height: 0;
  align-self: start;
}

.product-list-panel.has-more-products .product-list:not(.empty) .decision-product .thumb-frame {
  min-height: 0;
}

.product-list-panel.has-more-products .product-list:not(.empty) .product-pagination {
  grid-column: 1 / -1;
  align-self: start;
  margin-top: 10px;
}

/* Keep the results shelf only as tall as its cards. The surrounding workspace
   supplies the page rhythm; an empty flex remainder makes the shelf look broken. */
.product-list-panel.has-more-products,
.product-list-panel.has-more-products .product-list:not(.empty) {
  min-height: 0;
  height: auto;
}

.product-list-panel.has-more-products .product-list:not(.empty) {
  align-items: start;
  justify-content: start;
}

/* ---------------------------------------------------------------------------
   关键词库挑选：识别面板的「从关键词库挑选」按钮 + 挑选弹窗
   --------------------------------------------------------------------------- */
.product-image-keyword-search-action .product-image-keyword-library-picker {
  color: #14796b;
  background: #ffffff;
  border-color: #b9d6d0;
}

.product-image-keyword-search-action .product-image-keyword-library-picker:hover:not(:disabled) {
  color: #0f665b;
  background: #f2f8f7;
  border-color: #14796b;
}

.keyword-library-picker-dialog {
  width: min(1060px, 94vw);
  max-height: 88vh;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(19, 42, 66, 0.28);
  color: #27435f;
}

.keyword-library-picker-dialog::backdrop {
  background: rgba(18, 33, 51, 0.45);
}

.keyword-library-picker {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}

.keyword-library-picker-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e3ebf2;
}

.keyword-library-picker-head-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.keyword-library-picker-head-copy strong {
  font-size: 16px;
  font-weight: 800;
}

.keyword-library-picker-head-copy span {
  color: #718094;
  font-size: 12px;
  line-height: 1.5;
}

.keyword-library-picker-close {
  margin-left: auto;
  padding: 4px 10px;
  color: #718094;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}

.keyword-library-picker-close:hover {
  color: #27435f;
  background: #eef3f8;
}

.keyword-library-picker-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid #eef3f8;
}

.keyword-library-picker-parent-field {
  flex: 1 1 100%;
  display: grid;
  gap: 6px;
}

.keyword-library-picker-field-label {
  color: #718094;
  font-size: 11px;
  font-weight: 700;
}

.keyword-library-picker-parent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-library-picker-parent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  color: #27435f;
  background: #ffffff;
  border: 1px solid #d6e0ea;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.keyword-library-picker-parent-chip small {
  color: #718094;
  font-size: 11px;
  font-weight: 700;
}

.keyword-library-picker-parent-chip:hover {
  border-color: #14796b;
  color: #14796b;
}

.keyword-library-picker-parent-chip.is-active {
  color: #ffffff;
  background: #14796b;
  border-color: #14796b;
}

.keyword-library-picker-parent-chip.is-active small {
  color: rgba(255, 255, 255, 0.8);
}

.keyword-library-picker-filters label {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.keyword-library-picker-filters label span {
  color: #718094;
  font-size: 11px;
  font-weight: 700;
}

.keyword-library-picker-filters select,
.keyword-library-picker-filters input {
  min-height: 34px;
  padding: 5px 9px;
  color: #27435f;
  background: #ffffff;
  border: 1px solid #d6e0ea;
  border-radius: 5px;
  font-size: 13px;
}

.keyword-library-picker-query-field {
  flex: 1 1 200px;
}

.keyword-library-picker-filters > button {
  min-height: 34px;
  padding: 5px 16px;
  color: #ffffff;
  background: #14796b;
  border: 1px solid #14796b;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.keyword-library-picker-filters > button:hover {
  background: #0f665b;
  border-color: #0f665b;
}

.keyword-library-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 22px;
  background: #f7fafb;
}

.keyword-library-picker-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 13px;
  background: #ffffff;
  border: 1px solid #e3ebf2;
  border-radius: 6px;
  cursor: pointer;
}

.keyword-library-picker-item:hover {
  border-color: #b9d6d0;
}

.keyword-library-picker-item.is-picked {
  border-color: #14796b;
  background: #f2f8f7;
}

/* 相关性标记：高度相关（score>=8）深绿 */
.keyword-library-picker-item.is-highly-relevant {
  border-color: #14796b;
  background: #e8f5f1;
}
.keyword-library-picker-item.is-highly-relevant .keyword-library-picker-item-copy strong {
  color: #0d5c50;
}

/* 相关性标记：相关（score>=4）浅绿 */
.keyword-library-picker-item.is-relevant {
  border-color: #7bc4b3;
  background: #f3faf8;
}
.keyword-library-picker-item.is-relevant .keyword-library-picker-item-copy strong {
  color: #14796b;
}

.keyword-library-picker-relevance-badge {
  position: absolute;
  top: 5px;
  right: 7px;
  padding: 2px 8px;
  color: #ffffff;
  background: #14796b;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.keyword-library-picker-item input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #14796b;
}

.keyword-library-picker-item-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding-top: 0;
}

.keyword-library-picker-item-copy strong {
  overflow: hidden;
  color: #27435f;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-library-picker-item-copy small {
  color: #718094;
  font-size: 11px;
}

.keyword-library-picker-empty {
  grid-column: 1 / -1;
  padding: 26px 0;
  color: #718094;
  font-size: 12px;
  text-align: center;
}

.keyword-library-picker-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid #e3ebf2;
}

.keyword-library-picker-summary {
  color: #718094;
  font-size: 12px;
}

.keyword-library-picker-actions {
  display: flex;
  margin-left: auto;
  gap: 10px;
}

.keyword-library-picker-actions button {
  min-height: 36px;
  padding: 6px 18px;
  color: #27435f;
  background: #ffffff;
  border: 1px solid #d6e0ea;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.keyword-library-picker-actions button.is-primary {
  color: #ffffff;
  background: #14796b;
  border-color: #14796b;
}

.keyword-library-picker-actions button.is-primary:hover {
  background: #0f665b;
  border-color: #0f665b;
}

/* ------------------------------------------------------------------
   模型推荐类目 chip 横排（关键词库挑选弹窗顶部）
   ------------------------------------------------------------------ */
.keyword-library-picker-recommended {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 22px 14px;
  border-bottom: 1px solid #eef3f8;
  background: #f7fafb;
}

.keyword-library-picker-recommended[hidden] {
  display: none;
}

.keyword-library-picker-recommended-label {
  display: inline-flex;
  align-items: center;
  color: #4a6276;
  font-size: 12px;
  font-weight: 800;
}

.keyword-library-picker-recommended-chips {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-library-picker-recommended-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  color: #27435f;
  background: #ffffff;
  border: 1px solid #d6e0ea;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.keyword-library-picker-recommended-chip small {
  color: #718094;
  font-size: 11px;
  font-weight: 700;
}

.keyword-library-picker-recommended-chip:hover {
  border-color: #14796b;
  color: #14796b;
}

.keyword-library-picker-recommended-chip.is-active {
  color: #ffffff;
  background: #14796b;
  border-color: #14796b;
}

.keyword-library-picker-recommended-chip.is-active small {
  color: rgba(255, 255, 255, 0.8);
}

/* 「匹配小类」行：紧跟在「模型推荐类目」下方，点击直接筛选到该小类 */
.keyword-library-picker-recommended-sections {
  border-top: 0;
  background: #f2f8f7;
}

.keyword-library-picker-recommended-chip.is-section {
  color: #14796b;
  background: #f2faf8;
  border-color: #b9dcd5;
}

.keyword-library-picker-recommended-chip.is-section:hover {
  color: #0f5f55;
  border-color: #0f5f55;
}

.keyword-library-picker-recommended-chip.is-section.is-active {
  color: #ffffff;
  background: #14796b;
  border-color: #14796b;
}

.keyword-library-picker-recommended-chip.is-section.is-active small {
  color: rgba(255, 255, 255, 0.8);
}

.keyword-library-picker-show-all {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  color: #4a6276;
  background: transparent;
  border: 1px dashed #c4d2df;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.keyword-library-picker-show-all:hover {
  color: #27435f;
  border-color: #718094;
}

.keyword-library-picker-show-all.is-active {
  color: #14796b;
  border-color: #14796b;
  border-style: solid;
  background: #f2f8f7;
}
