
.ai-verdict, .ai-confidence, .ai-reason { display: block; }
.ai-verdict { font-size: 12px; font-weight: 600; }
.ai-verdict.same { color: #0b7168; }
.ai-verdict.different, .ai-verdict.error { color: #b32f27; }
.ai-verdict.uncertain { color: #a86a16; }
.ai-confidence { font-size: 11px; color: #74756f; margin-top: 3px; }
.ai-reason { max-width: 210px; min-width: 140px; font-size: 11px; color: #74756f; line-height: 1.5; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.price-catalog-panel { margin-bottom: 24px; }
.price-catalog-rules, .price-catalog-message, .price-catalog-upload, .price-catalog-search { margin: 16px 24px; }
.price-catalog-rules, .price-catalog-search, .price-catalog-message { color: #526861; font-size: 13px; }
.price-catalog-upload, .price-catalog-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.price-catalog-upload label { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.price-catalog-search { display: flex; gap: 12px; align-items: center; }
.price-catalog-search input { padding: 8px 12px; border: 1px solid #cbd9d2; border-radius: 8px; min-width: 200px; }
.price-catalog-scroll { overflow: auto; max-height: 540px; }
.price-catalog-scroll table { min-width: 1000px; width: 100%; }
.price-catalog-scroll th { position: sticky; top: 0; background: #edf4f0; z-index: 1; }
.price-catalog-scroll td { padding: 14px; vertical-align: top; }
.price-catalog-scroll td:first-child { min-width: 240px; max-width: 340px; white-space: normal; }
.price-catalog-scroll small { color: #526861; }
#productsView .price-catalog-scroll { max-width: 100%; }
#productsView .price-catalog-scroll table { display: table; min-width: 1300px; table-layout: fixed; }
#productsView .price-catalog-scroll thead { display: table-header-group; }
#productsView .price-catalog-scroll tbody { display: table-row-group; }
#productsView .price-catalog-scroll tr { display: table-row; }
#productsView .price-catalog-scroll th, #productsView .price-catalog-scroll td { display: table-cell; width: 110px; height: auto; padding: 12px; vertical-align: top; }
#productsView .price-catalog-scroll th:first-child { width: 300px; }
#productsView .price-catalog-scroll th:nth-child(2) { width: 190px; }
#productsView .price-catalog-scroll td:first-child { white-space: normal; }
.price-catalog-skus { font-size: 12px; overflow-wrap: anywhere; }
.price-catalog-preview { padding: 20px; margin: 20px 24px; border: 1px solid #b9d0c3; border-radius: 12px; background: #f5f9f6; }
.price-catalog-preview details { margin: 16px 0; }
.price-catalog-preview summary { cursor: pointer; font-weight: 600; }
.price-catalog-preview li { margin: 8px 0; }
.price-catalog-preview details > ul { max-height: 240px; overflow: auto; padding-right: 12px; }
.price-catalog-message.error { color: #b02d2d; }
@media (max-width: 600px) {
  .price-catalog-upload, .price-catalog-search { align-items: flex-start; flex-direction: column; }
  .price-catalog-preview { margin: 12px; padding: 12px; }
}

:root {
  --paper: #eeeae3;
  --surface: #fbfaf7;
  --surface-2: #f4f1eb;
  --ink: #191a18;
  --ink-soft: #3f413d;
  --muted: #74756f;
  --line: #d6d2c8;
  --line-strong: #bcb7ab;
  --accent: #d94f2b;
  --accent-soft: #f8dfd6;
  --teal: #0b7168;
  --teal-soft: #dcefea;
  --amber: #a86a16;
  --amber-soft: #f6ead2;
  --red: #b32f27;
  --red-soft: #f6ddda;
  --blue: #28638f;
  --shadow: 0 8px 24px rgba(35, 33, 27, 0.07);
  --display: "Archivo Black", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(25, 26, 24, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 26, 24, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.pagination-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shell {
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 7px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--accent);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
}

.brand-mark span:first-child {
  justify-self: end;
}

.brand-mark span:last-child {
  justify-self: start;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(18px, 2.4vw, 25px);
  line-height: 1.08;
  font-weight: 400;
}

.brand-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.live-pill[data-state="online"] {
  color: var(--teal);
  border-color: #a9cfc8;
}

.live-pill[data-state="online"] .live-pulse {
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
  animation: pulse 1.5s ease-in-out infinite;
}

.live-pill[data-state="reconnecting"] {
  color: var(--red);
  border-color: #e3b5b0;
}

.live-pill[data-state="reconnecting"] .live-pulse {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.sync-dot.online {
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.sync-dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.icon-button:hover {
  color: var(--accent);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.icon-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.workspace {
  padding-top: 28px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-tile {
  min-width: 0;
  padding: 17px 18px;
  background: rgba(251, 250, 247, 0.94);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  animation: tile-in 460ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--i) * 55ms);
}

.stat-tile.pending-stat {
  border-top-color: var(--amber);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat-label svg {
  width: 15px;
  height: 15px;
}

.stat-tile strong {
  display: block;
  margin: 12px 0 8px;
  font-family: var(--mono);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 500;
  line-height: 1;
  overflow-wrap: anywhere;
}

.stat-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.verified {
  background: var(--teal);
}

.status-dot.processing {
  background: var(--amber);
}

@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  min-height: 66px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.search-box {
  min-width: 250px;
  flex: 1 1 360px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.search-box:focus-within {
  border-color: var(--ink);
}

.search-box svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: #9a9a94;
}

.select-box {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.select-box span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.select-box select {
  max-width: 150px;
  padding: 0 20px 0 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  outline: 0;
  cursor: pointer;
}

.clear-filter {
  margin-left: 2px;
}

.discovery-range {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.date-box input {
  min-width: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  outline: 0;
}

.date-box:focus-within {
  border-color: var(--ink);
}

.date-box:has(input:invalid) {
  border-color: var(--red);
}

.findings-panel {
  margin-top: 22px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.panel-heading {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.panel-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.panel-legend svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.panel-legend .legend-lower svg {
  color: var(--teal);
}

.panel-legend .legend-higher svg {
  color: var(--red);
}

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

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th {
  height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

th.num,
td.num {
  text-align: right;
}

td {
  height: 72px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:hover {
  background: #f8f6f1;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.product-cell {
  max-width: 370px;
}

.product-sku {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.product-name {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.findings-panel table {
  min-width: 1280px;
  table-layout: fixed;
}

.findings-panel th,
.findings-panel td {
  padding-left: 8px;
  padding-right: 8px;
}

.findings-panel th:nth-child(3) { width: 118px; }
.findings-panel th:nth-child(4) { width: 52px; }
.findings-panel th:nth-child(5) { width: 110px; }
.findings-panel th:nth-child(6) { width: 104px; }
.findings-panel th:nth-child(7) { width: 88px; }
.findings-panel th:nth-child(8) { width: 125px; }
.findings-panel th:nth-child(9) { width: 82px; }
.findings-panel th:nth-child(10) { width: 104px; }
.findings-panel th:nth-child(11) { width: 88px; }
.findings-panel th:nth-child(12) { width: 88px; }

.findings-panel .product-cell,
.findings-panel .external-product-cell {
  min-width: 0;
  max-width: none;
}

.findings-panel .platform-name {
  max-width: 100%;
}

.findings-panel .money {
  font-size: 13px;
}

.findings-panel .gap-number {
  font-size: 12px;
}

.findings-panel .row-actions {
  display: flex;
  gap: 4px;
}

.findings-panel .row-actions .icon-button {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.external-product-cell {
  min-width: 260px;
  max-width: 320px;
}

.external-product-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.images-cell {
  min-width: 132px;
}

.product-images {
  display: flex;
  gap: 10px;
}

.product-images > div {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: var(--muted);
  font-size: 10px;
}

.product-image-button,
.image-missing {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.product-image-button {
  padding: 2px;
  cursor: zoom-in;
}

.product-image-button:hover,
.product-image-button:focus-visible {
  border-color: var(--blue);
}

.product-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-missing {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.image-dialog {
  position: fixed;
  max-width: min(90vw, 900px);
  max-height: 90vh;
  padding: 18px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 70px #0005;
}

.image-dialog::backdrop {
  background: #101820b8;
}

.image-dialog img {
  display: block;
  width: min(72vw, 640px);
  height: min(72vw, 640px, 70vh);
  object-fit: contain;
}

.image-dialog p {
  margin: 12px 0 0;
  text-align: center;
}

.image-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #fff;
}

.market-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 7px;
  color: var(--blue);
  background: #e7eef3;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
}

.money {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.money.amazon {
  color: var(--ink);
  font-weight: 500;
}

.money.external {
  color: var(--accent);
  font-weight: 500;
}

.source-tag {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.relation-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.relation-badge.lower {
  color: var(--teal);
  background: var(--teal-soft);
}

.relation-badge.equal {
  color: var(--amber);
  background: var(--amber-soft);
}

.relation-badge.higher {
  color: var(--red);
  background: var(--red-soft);
}

.gap-number {
  display: block;
  color: var(--teal);
  font-family: var(--mono);
  font-weight: 500;
}

.gap-number.negative {
  color: var(--red);
}

.gap-percent {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.platform-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-name::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 2px;
  background: var(--accent);
}

.score {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 64px;
}

.score-track {
  width: 34px;
  height: 4px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.score-fill {
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
}

.score-value {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.time-cell {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.view-tabs {
  display: flex;
  align-items: end;
  gap: 6px;
  min-height: 48px;
  padding: 8px 0 0;
  border-bottom: 1px solid var(--line);
}

.view-tab {
  min-height: 38px;
  padding: 0 17px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  cursor: pointer;
  font-weight: 600;
}

.view-tab.active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.text-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  color: var(--surface);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.text-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.text-button svg {
  width: 15px;
  height: 15px;
}

.run-toolbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0 14px;
}

.run-toolbar h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
}

.run-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.run-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.run-active-label {
  max-width: 330px;
  overflow: hidden;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-active-label::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

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

.runs-scroll {
  width: 100%;
  overflow-x: auto;
}

.runs-panel table {
  min-width: 920px;
}

.run-id {
  display: block;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.run-time {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.run-params {
  max-width: 300px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-cell {
  min-width: 120px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  width: 72px;
  height: 5px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
  transition: width 240ms ease;
}

.progress-text {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.run-status-copy {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
}

.run-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--muted);
}

.run-status-dot.running {
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
  animation: pulse 1.5s ease-in-out infinite;
}

.run-status-dot.failed {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.run-status-dot.succeeded {
  background: var(--teal);
}

.run-status-dot.cancelled {
  background: var(--muted);
}

.run-status-dot.queued {
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.run-status-text {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.status-badge.running,
.status-badge.cancelling {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-badge.queued {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-badge.succeeded {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-badge.failed {
  color: var(--red);
  background: var(--red-soft);
}

.status-badge.cancelled {
  color: var(--muted);
  background: var(--surface-2);
}

.status-badge.pending {
  color: var(--muted);
  background: var(--surface-2);
}

.status-badge.no_match {
  color: var(--muted);
  background: var(--surface-2);
}

.status-badge.blocked {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-badge.skipped {
  color: var(--muted);
  background: var(--surface-2);
}

.scan-dialog,
.run-detail-dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 40px));
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: 0 24px 70px rgba(30, 28, 23, 0.24);
}

.scan-dialog::backdrop,
.run-detail-dialog::backdrop {
  background: rgba(25, 26, 24, 0.42);
  backdrop-filter: blur(2px);
}

.scan-dialog header,
.run-detail-dialog header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.scan-dialog header h2,
.run-detail-dialog header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
}

.scan-dialog form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.dialog-body {
  overflow-y: auto;
  padding: 19px 20px;
}

.dialog-body label {
  display: block;
  margin-bottom: 14px;
}

.dialog-body label > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.dialog-body input[type="text"],
.dialog-body input[type="number"] {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
}

.dialog-body input:focus {
  border-color: var(--ink);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.scan-dialog form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
}

.scan-dialog form > footer .button {
  flex: 0 0 auto;
  min-width: 112px;
}

.run-detail-dialog {
  width: min(760px, calc(100vw - 32px));
}

.run-detail-body {
  overflow-y: auto;
  padding: 20px;
}

.run-detail-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

.run-detail-stat {
  min-width: 0;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.run-detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.run-detail-stat strong {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
}

.run-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

.run-items-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.run-items-scroll table {
  min-width: 620px;
}

.run-items-scroll td,
.run-items-scroll th {
  height: 48px;
}

.run-item-product {
  max-width: 300px;
}

.run-item-product span {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-badge.processed {
  color: var(--teal);
  background: var(--teal-soft);
}

.status-badge.processing {
  color: var(--amber);
  background: var(--amber-soft);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.row-actions .icon-button {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.row-actions .icon-button svg {
  width: 15px;
  height: 15px;
}

.empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
}

.empty-mark svg {
  width: 25px;
  height: 25px;
}

.empty-state h3 {
  margin: 18px 0 5px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 400;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
}

.pagination > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.pagination > div {
  display: flex;
  gap: 7px;
}

.pagination .pagination-controls,
.pagination-pages,
.pagination-size,
.pagination-jump,
.pagination-jump label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination .pagination-controls {
  flex-wrap: wrap;
  gap: 10px 16px;
  min-width: 0;
}

.pagination-pages {
  flex-wrap: wrap;
  gap: 4px;
}

.pagination-size,
.pagination-jump {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pagination[data-pagination] button,
.pagination[data-pagination] select,
.pagination[data-pagination] input {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
}

.pagination[data-pagination] button {
  min-width: 32px;
  cursor: pointer;
}

.pagination[data-pagination] button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.pagination[data-pagination] button[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  opacity: 1;
}

.pagination[data-pagination] button:disabled:not([aria-current="page"]),
.pagination[data-pagination] select:disabled,
.pagination[data-pagination] input:disabled {
  opacity: 0.45;
  cursor: default;
}

.pagination[data-pagination] input {
  width: 66px;
  font-family: var(--mono);
}

.pagination-ellipsis {
  padding: 0 2px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .pagination[data-pagination] {
    padding: 12px;
  }

  .pagination[data-pagination] .pagination-controls {
    width: 100%;
  }

  .pagination-pages {
    order: -1;
    width: 100%;
  }

  .pagination-jump {
    margin-left: auto;
  }
}

.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.drawer-layer.open {
  pointer-events: auto;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(25, 26, 24, 0.38);
  border: 0;
  cursor: default;
  opacity: 0;
  transition: opacity 200ms ease;
}

.drawer-layer.open .drawer-scrim {
  opacity: 1;
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 94vw);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: -18px 0 50px rgba(30, 28, 23, 0.16);
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawer-layer.open .drawer {
  transform: translateX(0);
}

.drawer-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.drawer-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.price-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.price-comparison > div {
  min-width: 0;
}

.price-comparison span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
}

.price-comparison strong {
  display: block;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-arrow {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.comparison-arrow svg {
  width: 18px;
  height: 18px;
}

.external-price strong {
  color: var(--accent);
}

.gap-block strong {
  color: var(--teal);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 0 20px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.detail-grid > div {
  min-width: 0;
  min-height: 62px;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-grid .wide {
  grid-column: 1 / -1;
}

.detail-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
}

.detail-links { display: grid; gap: 12px; margin: 20px 0; }
.detail-links .external-link { margin: 0; }
.detail-links small { display: block; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-links .external-link[aria-disabled="true"] { opacity: .6; cursor: default; text-decoration: none; pointer-events: none; }

.external-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--surface);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: background 140ms ease, transform 140ms ease;
}

.external-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.external-link svg {
  width: 16px;
  height: 16px;
}

.drawer-amazon-link {
  margin-bottom: 10px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.drawer-amazon-link:hover {
  color: var(--surface);
}

.drawer-amazon-link[hidden] {
  display: none;
}

.review-block {
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.review-heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 400;
}

.review-block label {
  display: block;
  margin-top: 13px;
}

.review-block label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.review-block input,
.review-block textarea {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  resize: vertical;
}

.review-block input:focus,
.review-block textarea:focus {
  border-color: var(--ink);
}

.review-actions {
  display: flex;
  gap: 9px;
  margin-top: 17px;
}

.button {
  min-height: 40px;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button.confirm {
  color: #fff;
  background: var(--teal);
  border: 1px solid var(--teal);
}

.button.reset {
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}

.button.progress {
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber);
}

.button.reject {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #e3b5b0;
}

.button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 15px;
  color: var(--surface);
  background: var(--ink);
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(25, 26, 24, 0.22);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-left-color: var(--red);
}

@media (max-width: 1180px) {
  .summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-box {
    flex-basis: 100%;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 0 16px 36px;
  }

  .topbar {
    min-height: 78px;
  }

  .topbar .text-button {
    width: 38px;
    padding: 0;
  }

  .topbar .text-button span {
    display: none;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .sync-state {
    display: none;
  }

  .live-pill {
    width: 28px;
    padding: 0;
    justify-content: center;
  }

  .live-pill #liveText {
    display: none;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-tile {
    padding: 15px;
  }

  .controls {
    align-items: stretch;
  }

  .run-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .run-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .select-box {
    flex: 1 1 44%;
  }

  .select-box select {
    max-width: none;
    width: 100%;
  }

  .discovery-range > span {
    flex-basis: 100%;
  }

  .date-box input {
    width: 100%;
  }

  .clear-filter {
    margin-left: auto;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .panel-legend {
    font-size: 10px;
  }

  .drawer {
    width: 100%;
  }

  .price-comparison {
    grid-template-columns: 1fr 1fr;
  }

  .comparison-arrow {
    display: none;
  }

  .gap-block {
    grid-column: 1 / -1;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid .wide {
    grid-column: auto;
  }

  .run-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Lingxing listing catalog: keep identifiers readable within the wide workspace. */
.catalog-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.catalog-store-filter { min-width: 200px; }
.catalog-store-filter select { max-width: 240px; }
.products-panel {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.catalog-sync { color: var(--muted); font-size: 11px; }
.catalog-table-scroll { width: 100%; overflow-x: auto; }
.products-panel table { min-width: 0; table-layout: fixed; }
.products-panel th, .products-panel td { padding-left: 8px; padding-right: 8px; }
.products-panel th:nth-child(1) { width: 62px; }
.products-panel th:nth-child(3) { width: 190px; }
.products-panel th:nth-child(4) { width: 108px; }
.products-panel th:nth-child(5) { width: 58px; }
.products-panel th:nth-child(7), .products-panel th:nth-child(8) { width: 96px; }
.products-panel th:nth-child(9) { width: 106px; }
.products-panel th:nth-child(10) { width: 106px; }
.products-panel th:nth-child(11) { width: 96px; }
.products-panel td { height: 82px; min-width: 0; }
.catalog-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.catalog-name:hover { color: var(--teal); }
.catalog-skus span, .catalog-store span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.7;
}
.catalog-skus span { font-family: var(--mono); font-size: 10px; }
.catalog-skus small { color: var(--muted); font-family: var(--body); }
.catalog-asin { font-family: var(--mono); font-size: 11px; }
.catalog-stock { font-family: var(--mono); font-size: 11px; }
.catalog-stock span, .catalog-stock small { display: block; white-space: nowrap; }
.catalog-stock small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.catalog-time { font-family: var(--mono); color: var(--muted); font-size: 10px; line-height: 1.7; }
.products-panel td.money { white-space: nowrap; font-size: 12px; }
.product-info-dialog {
  width: min(780px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(25, 26, 24, .24);
}
.product-info-dialog::backdrop { background: rgba(25, 26, 24, .45); }
.product-info-dialog .drawer-header { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.product-info-body { padding: 22px; }
.product-info-body .detail-grid a { color: var(--teal); }
.catalog-amazon-link { margin-bottom: 8px; }
.catalog-link-note { margin: 0; color: var(--muted); font-size: 11px; }
.catalog-hero { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.catalog-hero .product-image-button, .catalog-hero .image-missing { width: 108px; height: 108px; flex: 0 0 108px; }
.catalog-hero > div { min-width: 0; }
.catalog-hero h3 { margin: 0 0 8px; font-size: 16px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.catalog-hero p { margin: 0; color: var(--muted); font-size: 11px; }

@media (max-width: 1100px) {
  .catalog-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .products-panel table, .products-panel tbody { display: block; }
  .products-panel thead { display: none; }
  .products-panel tbody tr {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
  }
  .products-panel td { display: block; height: auto; padding: 0; border: 0; text-align: left; }
  .products-panel td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font: 10px var(--body); }
  .catalog-photo { grid-column: 1; }
  .catalog-title { grid-column: 2 / -1; }
  .catalog-title[data-label]::before { display: none !important; }
  .catalog-skus, .catalog-store, .catalog-action { grid-column: 1 / -1; }
  .catalog-asin { grid-column: 1 / 3; }
  .catalog-country { grid-column: 3; }
  .products-panel td:nth-child(7), .catalog-stock { grid-column: 1 / 3; }
  .products-panel td:nth-child(8), .catalog-time { grid-column: 3; }
  .catalog-action { justify-self: end; }
  .catalog-name { -webkit-line-clamp: 3; }
  .catalog-skus span, .catalog-store span { white-space: normal; overflow-wrap: anywhere; }
  .catalog-sync { white-space: normal; }
  .catalog-store-filter select { max-width: none; }
  .product-info-body { padding: 16px; }
  .catalog-hero { gap: 12px; }
  .catalog-hero .product-image-button, .catalog-hero .image-missing { width: 72px; height: 72px; flex-basis: 72px; }
}
/* Website monitoring follows the existing dashboard tables and mobile cards. */
.health-count { margin-left: 5px; padding: 2px 6px; border-radius: 10px; background: #fce7e5; color: #ad3930; font-size: 11px; }
.health-note { padding: 0 24px 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.health-table small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; white-space: normal; }
.health-table td { vertical-align: top; }
#healthView .health-table th:nth-child(1) { width: 17%; }
#healthView .health-table th:nth-child(2) { width: 8%; }
#healthView .health-table th:nth-child(3) { width: 12%; }
#healthView .health-table th:nth-child(4) { width: 23%; }
#healthView .health-table th:nth-child(5), #healthView .health-table th:nth-child(6) { width: 9%; }
#healthView .health-table th:nth-child(7) { width: 12%; }
#healthView .health-table th:nth-child(8) { width: 10%; }
.health-country { white-space: normal; }
.health-table td:first-child a { overflow-wrap: anywhere; }
.health-reason { min-width: 210px; max-width: 340px; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.health-status { display: inline-block; padding: 4px 9px; border-radius: 6px; font-size: 12px; background: #f0f1f3; color: #626b76; white-space: nowrap; }
.health-login_required, .health-partial { background: #fff3d7; color: #875a12; }
.health-healthy { background: #e3f3eb; color: #26734b; }
.health-blocked, .health-captcha, .health-rate_limited { background: #fce7e5; color: #ad3930; }
.health-network_error, .health-http_error { background: #fff0d9; color: #966315; }
.health-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.health-delete { color: var(--danger, #b42318); }
.health-history-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.health-history-item time { float: right; color: var(--muted); font-size: 12px; }
.health-history-item p { margin: 10px 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .view-tabs { overflow-x: auto; }
  .view-tab { flex-shrink: 0; }
  #healthView .health-table tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #healthView .health-table td { grid-column: auto; }
  #healthView .health-table td:first-child, #healthView .health-table .health-reason,
  #healthView .health-table td:last-child { grid-column: 1 / -1; }
  .health-reason { min-width: 0; max-width: none; }
  .health-note { padding: 0 18px 14px; }
  #healthView .run-toolbar { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
}
.quote-sources { margin: 20px 0; min-width: 0; }
.quote-sources h3 { font-size: 14px; margin: 0 0 12px; }
.quote-source { display: grid; gap: 6px; border-top: 1px solid var(--border, #e4e8eb); padding: 12px 0; font-size: 12px; overflow-wrap: anywhere; }
.quote-source span, .quote-source small { color: var(--muted, #64748b); }
.quote-source p { margin: 2px 0; white-space: pre-wrap; }
.quote-conflict { display: block; color: #98620b; font-size: 11px; margin-top: 5px; white-space: normal; }
.quote-source a { color: var(--accent, #087e72); }
.quote-help { margin: 0 0 12px; color: var(--muted, #64748b); font-size: 12px; line-height: 1.6; }
.product-quotes { padding: 0; }
.product-quote { border: 1px solid var(--border, #e4e8eb); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.quote-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
.quote-tags, .quote-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.quote-filter.matched { color: #087e72; }
.quote-date { font-weight: 600; }
.relation-badge.uncomparable { color: #64748b; background: #edf1f4; }

.finding-drawer { width: min(1280px, 80vw); }
.finding-drawer .drawer-header { flex-shrink: 0; align-items: flex-start; padding: 16px 20px; }
.drawer-context { min-width: 0; flex: 1; }
.drawer-context h2 { overflow-wrap: anywhere; }
.finding-drawer .drawer-header h2 { font-size: 26px; }
.drawer-context p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.drawer-tools { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.finding-drawer .drawer-body { padding: 16px 20px 28px; overscroll-behavior: contain; }
.finding-drawer .quote-sources { margin: 0; }
.quote-overview { margin-bottom: 12px; }
.quote-overview h3 { margin-bottom: 4px; }
.quote-overview p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.finding-drawer .product-quote { padding: 14px; margin-bottom: 12px; gap: 4px; border-color: var(--line); border-radius: 8px; background: var(--surface); }
.finding-drawer .product-quote.is-low { border-left: 3px solid var(--success, #087e72); }
.finding-drawer .quote-heading { align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.quote-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; }
.quote-platform { display: inline-flex; align-items: baseline; gap: 7px; max-width: 100%; padding: 6px 10px; border: 1px solid #e9b8a8; border-radius: 5px; color: #a5361a; background: var(--accent-soft); overflow-wrap: anywhere; }
.quote-platform span, .quote-merchant span { flex-shrink: 0; font-size: 11px; font-weight: 400; }
.quote-platform strong { min-width: 0; font-size: 15px; font-weight: 700; }
.finding-drawer .quote-heading .quote-merchant { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.quote-merchant span { color: var(--muted); }
.finding-drawer .quote-tags { flex-shrink: 0; gap: 6px; }
.quote-kind { padding: 4px 8px; border-radius: 4px; font-size: 11px; background: var(--surface-2); }
.quote-kind.low { color: #08776d; background: #e5f3ed; }
.comparison-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.comparison-product { min-width: 0; }
.comparison-product.external { border-left: 1px solid var(--line); padding-left: 14px; }
.comparison-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.comparison-label span { color: var(--muted); font-size: 11px; font-weight: 400; }
.comparison-content { display: grid; grid-template-columns: minmax(100px, 150px) minmax(0, 1fr); align-items: start; gap: 12px; }
.comparison-media { position: relative; min-width: 0; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.finding-drawer .comparison-media .product-image-button { position: absolute; inset: 10px; display: block; min-width: 0; min-height: 0; width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: #fff; }
.finding-drawer .comparison-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.comparison-image-missing { display: grid; place-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.comparison-image-missing svg { width: 26px; height: 26px; opacity: .55; }
.comparison-copy { min-width: 0; }
.comparison-name { margin: 0; font-size: 13px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.comparison-copy p { margin: 5px 0; color: var(--muted); font-size: 11px; }
.comparison-price { display: block; margin: 6px 0; font-family: var(--mono); font-size: 21px; font-variant-numeric: tabular-nums; }
.comparison-product.external .comparison-price { color: var(--accent); }
.comparison-copy .quote-links { align-items: flex-start; gap: 6px 12px; font-size: 11px; }
.quote-link-missing { color: var(--muted); }
.quote-metrics { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-top: 8px; padding: 8px 0 4px; border-top: 1px solid var(--line); font-size: 12px; }
.quote-evidence, .quote-archive { margin: 5px 0; font-size: 12px; }
.quote-evidence summary, .quote-archive summary { cursor: pointer; color: var(--muted); }
.quote-archive summary { color: #98620b; }
.quote-evidence dl { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px 18px; padding: 12px 0; }
.quote-evidence dt { color: var(--muted); margin-bottom: 4px; font-size: 11px; }
.quote-evidence dd { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.quote-review { margin-top: 6px; border-top: 1px solid var(--line); }
.quote-review > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0 0; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; }
.quote-review > summary::after { content: '+'; font-size: 19px; font-weight: 400; }
.quote-review[open] > summary::after { content: '−'; }
.quote-review > summary span:nth-child(2) { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 400; }
.quote-review-body { padding-top: 8px; }
.quote-review-owner { color: var(--muted); font-size: 11px; }
.quote-review-body label { display: grid; gap: 8px; font-size: 12px; }
.quote-review textarea { width: 100%; min-height: 90px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); color: var(--ink); font: inherit; line-height: 1.6; }
.finding-drawer .review-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.finding-drawer .review-actions button { width: 100%; min-height: 42px; }
.quote-save-message { color: #98620b; font-size: 12px; }
.quote-save-message:empty { display: none; }
.quote-history-button { margin-top: 12px; border: 0; padding: 4px 0; color: var(--muted); background: none; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.quote-card-history article { display: grid; gap: 5px; margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--line-strong); }
.quote-card-history article span { font-size: 11px; }
.status-badge.neutral { background: #eceeec; color: #69726c; }
@media (max-width: 1100px) { .comparison-content { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 900px) { .finding-drawer { width: 96vw; } }
@media (max-width: 640px) {
  .finding-drawer { width: 100vw; }
  .finding-drawer .drawer-header { gap: 10px; padding: 12px; }
  .finding-drawer .drawer-header h2 { font-size: 20px; }
  .drawer-tools { flex-direction: column-reverse; align-items: flex-end; gap: 9px; }
  .drawer-tools .status-badge { font-size: 10px; }
  .drawer-context p { display: none; }
  .finding-drawer .drawer-body { padding: 12px 10px 24px; }
  .finding-drawer .product-quote { padding: 10px; }
  .finding-drawer .quote-heading { flex-wrap: wrap; gap: 8px; }
  .quote-identity { gap: 6px 10px; }
  .quote-platform { padding: 4px 7px; }
  .quote-platform strong { font-size: 14px; }
  .finding-drawer .quote-heading .quote-merchant { font-size: 16px; }
  .comparison-pair { gap: 10px; }
  .comparison-product.external { padding-left: 10px; }
  .comparison-name { font-size: 12px; }
  .comparison-price { font-size: 17px; }
  .comparison-label { font-size: 12px; }
  .quote-evidence dl { grid-template-columns: minmax(0,1fr); }
  .finding-drawer .review-actions { gap: 6px; }
  .finding-drawer .review-actions button { padding: 8px 4px; font-size: 12px; }
}

[hidden] { display: none !important; }

#currentAccount { max-width: 260px; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
@media (max-width: 1180px) {
  .shell > .topbar { flex-wrap: wrap; gap: 12px; padding: 16px 0; }
  .shell > .topbar > .brand { flex: 1 0 100%; }
  .shell > .topbar > .topbar-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .shell > .topbar #currentAccount, .shell > .topbar #accountLogout { width: auto; padding: 0 10px; }
}
.catalog-edit-dialog { width: min(480px, calc(100vw - 32px)); border: 1px solid #d7dee8; border-radius: 12px; padding: 24px; color: #182331; }
.catalog-edit-dialog::backdrop { background: #15263866; }
.catalog-edit-dialog label { display: grid; gap: 6px; margin: 14px 0; }
.catalog-edit-dialog input, .catalog-edit-dialog select, #priceCatalogPending { max-width: 100%; padding: 9px; border: 1px solid #cbd5e1; border-radius: 6px; }
.catalog-edit-dialog p { line-height: 1.6; }
.monitoring-panel { margin-bottom: 24px; }
.monitoring-controls, .monitoring-actions, .monitoring-pagination { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 24px; }
.monitoring-controls label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.monitoring-controls input, .monitoring-controls select { max-width: 100%; min-width: 0; padding: 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
.monitoring-panel td small { color: #66717c; overflow-wrap: anywhere; }
.monitoring-panel td { max-width: 320px; min-width: 90px; }
.monitoring-panel td:first-child { min-width: 32px; }
.monitoring-panel td button { margin: 3px; }
.monitoring-panel [type="checkbox"] { width: 17px; height: 17px; accent-color: #ef5b27; }
#productsView .monitoring-panel .price-catalog-scroll table { min-width: 1200px; }
#productsView .monitoring-panel .price-catalog-scroll th { width: auto; }
#productsView .monitoring-panel .price-catalog-scroll th:first-child { width: 44px; }
#productsView .monitoring-panel .price-catalog-scroll td:first-child { min-width: 32px; max-width: 44px; }
#productsView .monitoring-panel .price-catalog-scroll th:nth-child(2) { width: 290px; }
#productsView .monitoring-panel .price-catalog-scroll th:nth-child(3) { width: 60px; }
#productsView .monitoring-panel .price-catalog-scroll th:nth-child(5) { width: 190px; }
#productsView .monitoring-panel .price-catalog-scroll th:nth-child(8) { width: 150px; }
