/* ==========================================================================
   RainMkr UI -- design system
   Light off-white content on white/near-white cards, near-black nav,
   fresh green accent. Hand-written, zero external dependencies (fonts,
   icons, frameworks all local).
   ========================================================================== */

:root {
  --bg: #f4f6f5;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #eef8f1 0%, #f4f6f5 55%);
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --surface-3: #eef1ee;
  --border: #dbe2de;
  --border-soft: #e6eae7;

  --text: #0f172a;
  --text-dim: #384049;
  --muted: #6b7280;

  --accent: #1eb854;
  --accent-strong: #17a34a;
  --accent-soft: rgba(30, 184, 84, .14);
  --accent-text: #15803d;

  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, .13);
  --good: #16a34a;
  --good-soft: rgba(22, 163, 74, .12);
  --bad: #dc2626;
  --bad-soft: rgba(220, 38, 38, .12);

  /* Top nav — always near-black regardless of content theme */
  --nav-bg: #0a0f0a;
  --nav-bg-2: #0d130e;
  --nav-border: rgba(255, 255, 255, .08);
  --nav-text: #f1f5f2;
  --nav-muted: #9aa39c;
  --nav-hover-bg: rgba(255, 255, 255, .06);
  --nav-active-bg: rgba(30, 184, 84, .18);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 8px 24px -8px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, .18), 0 4px 12px rgba(15, 23, 42, .08);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); color: var(--text); }

.accent { color: var(--accent-text); }

/* Slim top-of-page progress hint (nice-to-have polish) */
.top-loader {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: loaderSlide 1.1s ease-in-out infinite;
  opacity: 0; pointer-events: none; z-index: 999;
  transition: opacity .15s ease;
}
.top-loader.active { opacity: 1; }
@keyframes loaderSlide { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------------------------------------------------------------------- */
/* Top nav                                                                  */
/* ---------------------------------------------------------------------- */

header.topnav {
  display: flex;
  align-items: center;
  gap: 4px 4px;
  padding: 10px 24px;
  background: linear-gradient(180deg, var(--nav-bg-2) 0%, var(--nav-bg) 100%);
  border-bottom: 1px solid var(--nav-border);
  min-height: 60px;
  flex-wrap: wrap;
  row-gap: 6px;
  position: sticky;
  top: 0;
  z-index: 50;
}

header.topnav .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: .01em;
  margin-right: 24px;
  color: var(--nav-text);
  white-space: nowrap;
}
header.topnav .brand .mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, var(--shadow-sm);
}
header.topnav .brand .mark svg { width: 14px; height: 14px; }
header.topnav .brand .wordmark .accent { color: var(--accent); }
header.topnav .brand .client-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--nav-muted);
  padding: 3px 9px;
  margin-left: 2px;
  border: 1px solid var(--nav-border);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}

header.topnav nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

header.topnav nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--nav-muted);
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: color .12s ease, background .12s ease;
}
header.topnav nav a svg { width: 15px; height: 15px; opacity: .85; flex: none; }

header.topnav nav a:hover { color: var(--nav-text); background: var(--nav-hover-bg); text-decoration: none; }
header.topnav nav a.active {
  color: var(--nav-text);
  background: var(--nav-active-bg);
  font-weight: 600;
}
header.topnav nav a.active svg { opacity: 1; color: var(--accent); }
header.topnav nav a.active::after {
  content: "";
  position: absolute; left: 13px; right: 13px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

main {
  padding: 28px 24px 60px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------- */
/* Page header (eyebrow + heading + subtitle)                              */
/* ---------------------------------------------------------------------- */

.page-header { margin-bottom: 22px; }
.page-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent-text);
  margin-bottom: 6px;
}

h1 {
  font-size: 24px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.page-header .page-sub { margin: 6px 0 0; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }

h2.section-title {
  font-size: 12.5px;
  margin: 30px 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------------------------------------------------------------- */
/* Cards / panels                                                           */
/* ---------------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.notice {
  background: var(--accent-soft);
  border: 1px solid rgba(30, 184, 84, .3);
  color: var(--text-dim);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.notice svg { flex: none; margin-top: 1px; color: var(--accent-text); }
.notice.caution { background: var(--amber-soft); border-color: rgba(180, 83, 9, .35); }
.notice.caution svg { color: var(--amber); }

/* ---------------------------------------------------------------------- */
/* KPI / stat cards                                                         */
/* ---------------------------------------------------------------------- */

.kpi-grid, .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}

.kpi-card, .stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kpi-card:hover, .stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border);
}
.kpi-card::before, .stat::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent);
  opacity: .7;
}
.kpi-card.good::before, .stat .value.good ~ .label, .stat.tone-good::before { background: var(--good); }
.kpi-card.bad::before, .stat.tone-bad::before { background: var(--bad); }
.kpi-card.warn::before, .stat.tone-warn::before { background: var(--amber); }

.kpi-card .label, .stat .label {
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.kpi-card .value, .stat .value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi-card .sub, .stat .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.value.good { color: var(--good); }
.value.bad { color: var(--bad); }
.value.warn { color: var(--amber); }
.value.muted-val { color: var(--muted); font-size: 15px; font-weight: 600; }

.health-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(15,23,42,.05);
}
.health-dot.good { background: var(--good); box-shadow: 0 0 10px rgba(22,163,74,.55); }
.health-dot.warn { background: var(--amber); box-shadow: 0 0 10px rgba(180,83,9,.55); }
.health-dot.bad { background: var(--bad); box-shadow: 0 0 10px rgba(220,38,38,.55); }

/* ---------------------------------------------------------------------- */
/* Tables                                                                   */
/* ---------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; font-size: 13.2px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 1;
}
th a.sort-link { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
th a.sort-link:hover { color: var(--text); text-decoration: none; }
th a.sort-link .arrow { font-size: 10px; color: var(--accent-text); }

tbody tr { transition: background .1s ease; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }

.right { text-align: right; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; cursor: default; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* variance / delta tinting */
.cell-flag {
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.cell-flag.pos { background: var(--bad-soft); color: var(--bad); }
.cell-flag.neg { background: var(--bad-soft); color: var(--bad); }
.cell-flag.zero { background: var(--good-soft); color: var(--good); }

/* ---------------------------------------------------------------------- */
/* Badges / status pills                                                    */
/* ---------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.6;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.info { background: rgba(37,99,235,.12); color: #2563eb; }
.badge.muted { background: rgba(107,114,128,.14); color: var(--muted); }
.badge.running::before { animation: pulseDot 1.4s ease-in-out infinite; }
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 5px transparent; opacity: .55; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

/* ---------------------------------------------------------------------- */
/* Empty states                                                             */
/* ---------------------------------------------------------------------- */

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty-state .icon {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border);
}
.empty-state .icon svg { width: 22px; height: 22px; }
.empty-state .big { font-size: 15px; color: var(--text); margin-bottom: 6px; font-weight: 600; }
.empty-state .detail { max-width: 480px; margin: 0 auto; font-size: 13px; line-height: 1.6; }

/* ---------------------------------------------------------------------- */
/* Filter bar                                                               */
/* ---------------------------------------------------------------------- */

form.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
form.filters .search-wrap { position: relative; flex: 1 1 240px; min-width: 200px; }
form.filters .search-wrap svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--muted); pointer-events: none;
}
form.filters input[type=text] { padding-left: 30px; width: 100%; }
form.filters input[type=text], form.filters select {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  transition: border-color .12s ease, box-shadow .12s ease;
}
form.filters input[type=text]:focus, form.filters select:focus,
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
form.filters button, .btn {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  border: none;
  color: #052e13;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: filter .12s ease, transform .12s ease;
}
form.filters button:hover, .btn:hover { filter: brightness(1.06); }
form.filters button:active, .btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface-3); border: 1px solid var(--border); color: var(--text); }
.btn.block { width: 100%; text-align: center; display: block; }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: none; }

.pagination { display: flex; gap: 10px; margin-top: 16px; align-items: center; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------------- */
/* Calculator                                                               */
/* ---------------------------------------------------------------------- */

.calc-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .calc-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: var(--font);
}

.autocomplete { position: relative; }
.autocomplete-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 20;
  display: none;
  box-shadow: var(--shadow-lg);
}
.autocomplete-results.show { display: block; }
.autocomplete-results .ac-row {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; gap: 10px;
}
.autocomplete-results .ac-row:last-child { border-bottom: none; }
.autocomplete-results .ac-row:hover { background: var(--surface-2); }
.autocomplete-results .ac-row .ac-name { color: var(--muted); font-size: 12px; }
.autocomplete-results .ac-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

.selected-chip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft);
  border: 1px solid rgba(30,184,84,.3);
  border-radius: 10px;
  padding: 10px 12px;
  margin: -2px 0 14px;
  font-size: 12.5px;
}
.selected-chip .chip-sku { font-family: var(--mono); font-weight: 700; color: var(--accent-text); }
.selected-chip .chip-meta { color: var(--text-dim); display: flex; gap: 14px; flex-wrap: wrap; }
.selected-chip .chip-meta b { color: var(--text); }

.result-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.result-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(320px 140px at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.result-hero .eyebrow { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.result-hero .price {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
  transition: color .15s ease;
}
.result-hero .price .cur { font-size: 24px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.result-hero .formula-line { color: var(--muted); font-size: 12.5px; margin-top: 8px; font-family: var(--mono); }

.compare-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}
.compare-box {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.compare-box .label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.compare-box .amt { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.compare-arrow { color: var(--muted); font-size: 20px; }
.delta-badge { display: inline-block; margin-top: 6px; }

.result-box { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; text-align: center; }

.footer-note { color: var(--muted); font-size: 12px; margin-top: 34px; text-align: center; }

/* misc helpers */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; color: var(--muted);
}

/* ---------------------------------------------------------------------- */
/* New products (Buying): queue filter, progress log, checks, images       */
/* ---------------------------------------------------------------------- */

.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-tabs a {
  padding: 5px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: var(--surface-3); border: 1px solid transparent;
}
.filter-tabs a:hover { color: var(--text); text-decoration: none; }
.filter-tabs a.active { background: var(--text); color: #fff; }
.filter-tabs a .n { opacity: .6; font-weight: 500; margin-left: 4px; }

.queue-step { color: #2563eb; font-size: 12px; }
.pill-count {
  display: inline-block; padding: 1px 7px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.pill-count.dup { background: var(--bad); color: #fff; }
.pill-count.fail { background: var(--bad-soft); color: var(--bad); }
.pill-count.review { background: var(--amber-soft); color: var(--amber); }
.pill-count.pass { background: var(--good-soft); color: var(--good); }

/* Working panel: progress bar + step list */
.working { background: rgba(37,99,235,.06); border: 1px solid rgba(37,99,235,.25); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 20px; }
.working .bar { height: 6px; border-radius: 999px; background: rgba(37,99,235,.18); overflow: hidden; margin-top: 10px; }
.working .bar > span { display: block; height: 100%; border-radius: 999px; background: #2563eb; transition: width 1s linear; }
.progress-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.progress-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--text-dim); }
.progress-list li .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--good); }
.progress-list li.doing .dot { background: #2563eb; animation: pulseDot 1.4s ease-in-out infinite; }
.progress-list li.doing .step { color: #1e3a8a; font-weight: 600; }
.progress-list li .detail { display: block; color: var(--muted); font-size: 11.5px; }
.progress-list li .q { font-style: italic; }

/* What was checked */
.check-row { border: 1px solid; border-radius: 10px; padding: 8px 12px; margin-bottom: 7px; font-size: 12.5px; }
.check-row .outcome { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .75; margin-right: 8px; }
.check-row .name { font-weight: 600; }
.check-row .detail { margin: 2px 0 0; opacity: .9; }
.check-row.pass { background: var(--good-soft); border-color: rgba(22,163,74,.3); color: #14532d; }
.check-row.review { background: var(--amber-soft); border-color: rgba(180,83,9,.3); color: #78350f; }
.check-row.fail { background: var(--bad-soft); border-color: rgba(220,38,38,.4); color: #7f1d1d; }
.check-row form { display: inline; }
.btn.tiny { padding: 2px 8px; font-size: 11px; border-radius: 6px; }
.btn.danger { background: var(--surface); border: 1px solid rgba(220,38,38,.5); color: var(--bad); }

.box-bad { background: var(--bad-soft); border: 1px solid rgba(220,38,38,.4); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 20px; color: #7f1d1d; }
.box-bad h3 { margin: 0 0 6px; font-size: 13.5px; color: #7f1d1d; }
.box-bad ul { margin: 0; padding-left: 18px; }
.box-bad a { color: #7f1d1d; text-decoration: underline; }

/* Source tags on spec rows / images */
.src { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; }
.src.feed, .src.research { background: var(--good-soft); color: var(--good); }
.src.form, .src.reviewer, .src.derived { background: rgba(37,99,235,.12); color: #2563eb; }
.src.web { background: var(--amber-soft); color: var(--amber); }
.src.other { background: rgba(107,114,128,.14); color: var(--muted); }

/* Weight options */
.weight-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.weight-opt { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; cursor: pointer; background: var(--surface); min-width: 150px; }
.weight-opt input { margin-right: 6px; }
.weight-opt.in-use { border-color: var(--accent); background: var(--accent-soft); }
.weight-opt .kg { font-weight: 700; font-size: 14px; }
.weight-opt .from { display: block; color: var(--muted); font-size: 11.5px; }

/* Image cards */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 14px; }
.img-card { display: block; border: 2px solid var(--border-soft); border-radius: 10px; padding: 8px; background: var(--surface); cursor: pointer; }
.img-card.approved { border-color: var(--accent); background: var(--accent-soft); }
.img-card img { width: 100%; height: 140px; object-fit: contain; background: #fff; border-radius: 6px; display: block; }
.img-card.error { border-color: rgba(220,38,38,.35); cursor: default; }

textarea.ta {
  width: 100%; background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  padding: 9px 11px; border-radius: 8px; font-size: 13.5px; font-family: var(--font); resize: vertical;
}
textarea.ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.spec-table td, .spec-table th { padding: 6px 8px; white-space: normal; }
.spec-table input { width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 12.5px; color: var(--text); }
.signoff { background: var(--surface-2); }
.char-count.over { color: var(--bad); font-weight: 700; }

/* ---------------------------------------------------------------------- */
/* New products: review page (two-column), queue                            */
/* ---------------------------------------------------------------------- */

.np-centre { max-width: 860px; margin: 0 auto; }
.np-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.np-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 32px); overflow-y: auto; padding-right: 2px; }
.np-side .panel, .np-side .box-bad { margin-bottom: 0; }
.np-side .panel { padding: 14px 16px; }
@media (max-width: 1100px) {
  .np-layout { grid-template-columns: 1fr; }
  .np-side { position: static; max-height: none; overflow: visible; }
}

/* preview card */
.np-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.np-preview-bar span .btn + .btn { margin-left: 6px; }
.np-hero { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 720px) { .np-hero { grid-template-columns: 1fr; } }
.np-main-img { position: relative; border: 1px solid var(--border-soft); border-radius: 10px; background: #fff; height: 280px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.np-main-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.np-main-img.empty { background: var(--surface-2); }
.np-main-img.unticked img { opacity: .45; }
.np-main-note { position: absolute; left: 8px; right: 8px; bottom: 8px; font-size: 11px; color: var(--amber); font-weight: 600; text-align: center; }
.np-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.np-thumb { position: relative; width: 64px; height: 64px; border: 2px solid var(--border-soft); border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; }
.np-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; opacity: .6; }
.np-thumb.ticked img { opacity: 1; }
.np-thumb.ticked { border-color: var(--accent); }
.np-thumb.main { box-shadow: 0 0 0 2px var(--accent-soft); }
.np-tick { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255,255,255,.92); color: transparent; font-size: 12px; line-height: 18px; padding: 0; cursor: pointer; opacity: 0; transition: opacity .12s; }
.np-thumb:hover .np-tick, .np-thumb.ticked .np-tick { opacity: 1; }
.np-thumb.ticked .np-tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.np-thumb-src { position: absolute; left: 0; bottom: 0; font-size: 9px; font-weight: 700; padding: 1px 5px; border-top-right-radius: 6px; }
.np-thumb-src.feed { background: var(--good-soft); color: var(--good); }
.np-thumb-src.web { background: var(--amber-soft); color: var(--amber); }
.np-thumb-page { position: absolute; right: 0; bottom: 0; font-size: 11px; padding: 0 5px; background: rgba(255,255,255,.9); border-top-left-radius: 6px; }
.np-gallery-note { margin-top: 6px; }
.np-saved { color: var(--good); font-weight: 600; opacity: 0; transition: opacity .2s; margin-left: 4px; }
.np-saved.show { opacity: 1; }

.np-title .np-name { font-size: 19px; line-height: 1.3; margin: 4px 0 8px; font-weight: 700; color: var(--text); }
.np-lead { font-size: 14px; color: var(--text-dim); margin: 0 0 8px; }
.np-codes b { color: var(--text); font-weight: 600; }
.np-prices { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 6px; margin-top: 14px; }
@media (max-width: 720px) { .np-prices { grid-template-columns: repeat(3, 1fr); } }
.np-price { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 6px 8px; text-align: center; min-width: 0; }
.np-price.rrp { background: var(--accent-soft); border-color: rgba(30,184,84,.35); }
.np-price-name { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.np-price-amt { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); margin-top: 2px; white-space: nowrap; }
.np-price.rrp .np-price-amt { font-size: 20px; color: var(--accent-text); }
.np-price-mk { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.np-desc { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-soft); font-size: 13.5px; color: var(--text-dim); max-width: 760px; }
.np-desc h2, .np-desc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 6px; }
.np-desc p { margin: 0 0 10px; }
.np-desc ul { margin: 0 0 10px; padding-left: 20px; }
.np-desc li { margin-bottom: 3px; }
.np-desc table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 0 0 10px; border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; }
.np-desc th, .np-desc td { padding: 5px 10px; border-bottom: 1px solid var(--border-soft); white-space: normal; text-align: left; vertical-align: top; }
.np-desc th { width: 38%; font-weight: 600; color: var(--text); background: var(--surface-2); text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.np-keywords { margin: 10px 0 0; }
.np-unknown { color: var(--amber); margin: 6px 0 0; }

/* edit form */
.np-edit-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.np-edit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
@media (max-width: 720px) { .np-edit-cols, .np-edit-grid { grid-template-columns: 1fr 1fr; } }
.np-spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
@media (max-width: 960px) { .np-spec-list { grid-template-columns: 1fr; } }
.np-spec-row { display: grid; grid-template-columns: 2fr 3fr auto; gap: 6px; align-items: center; }
.np-spec-row[hidden] { display: none; }
.np-spec-row input[type=text] { width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 12.5px; color: var(--text); font-family: var(--font); min-width: 0; }
.np-spec-row input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.np-spec-row .src { min-width: 54px; text-align: center; }
.np-spec-row.add input { border-style: dashed; }

/* sidebar: verdict */
.np-verdict { border-left: 4px solid var(--good); }
.np-verdict.warn { border-left-color: var(--amber); }
.np-verdict.bad { border-left-color: var(--bad); }
.np-verdict-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.np-verdict-head .badge { font-size: 12px; padding: 4px 10px; }
.np-verdict-counts { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.np-checks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.np-check { border-radius: 8px; padding: 6px 10px; font-size: 12.5px; border: 1px solid; }
.np-check-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.np-check .name { font-weight: 600; }
.np-check .detail { font-size: 11.5px; opacity: .9; margin-top: 1px; }
.np-check form { display: inline; }
.np-check.pass { background: var(--good-soft); border-color: rgba(22,163,74,.3); color: #14532d; }
.np-check.review { background: var(--amber-soft); border-color: rgba(180,83,9,.3); color: #78350f; }
.np-check.fail { background: var(--bad-soft); border-color: rgba(220,38,38,.4); color: #7f1d1d; }
.np-details summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 10px; }
.np-details summary:hover { color: var(--text); }
.np-details[open] summary { color: var(--text); }

/* sidebar: essentials */
.np-ess-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.np-ess-grid .field { margin-bottom: 9px; }
.np-ess-grid .field.span2 { grid-column: span 2; }
.np-ess-grid .field label { font-size: 11px; margin-bottom: 3px; }
.np-ess-grid .field input, .np-ess-grid .field select { padding: 6px 8px; font-size: 12.5px; }
.np-ess-grid .field input.mono { font-size: 12px; }
.np-ess-grid input[hidden] { display: none; }
.np-ess-grid #np-weight-input { margin-top: 5px; }

/* sidebar: sign-off */
.np-signoff-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.np-signoff .field input { padding: 7px 9px; font-size: 12.5px; }
.np-push-steps { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 12px; }
.np-push-step { display: flex; gap: 8px; align-items: flex-start; }
.np-push-step .mono { word-break: break-word; }

/* sidebar: small print */
.np-fine { padding: 0 4px; }
.np-fine summary { margin-top: 0; }
.np-fine-body { display: grid; grid-template-columns: 1fr; gap: 3px; margin-top: 8px; font-size: 11.5px; }
.np-fine-body > div { display: flex; justify-content: space-between; gap: 10px; }
.np-fine-body b { color: var(--text); font-weight: 600; text-align: right; word-break: break-word; }
.np-notes { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px; margin: 8px 0 0; max-height: 360px; overflow: auto; font-family: var(--font); font-size: 11.5px; }

/* queue */
#queue tbody tr { cursor: pointer; }
#queue td.np-q-name { max-width: 380px; white-space: normal; }
#queue .np-q-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
#queue .np-q-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
#queue .np-q-price .arrow { color: var(--muted); margin: 0 4px; }
