/* Audio Monkey — Price Intelligence
   Skinned to match the official audiomonkey.ro storefront: light grey canvas,
   white cards, signal-yellow (#FFC500) accent, graphite (#303030) text, Inter,
   sharp corners. Feels like an internal extension of the shop, not a separate app. */

:root {
  --am-yellow: #ffc500;
  --am-yellow-dark: #cc9e00;
  --am-graphite: #303030;
  --am-graphite-2: #3d3d3d;
  --bg: #f2f2f2;
  --card: #ffffff;
  --card-2: #fafafa;
  --line: #e4e4e4;
  --line-soft: #eeeeee;
  --ink: #303030;
  --ink-dim: #6d6d6d;
  --ink-faint: #959595;

  --danger: #d8352a;      /* competitor beats us */
  --danger-bg: #fdecea;
  --good: #1f9d55;        /* we win */
  --good-bg: #e9f6ee;
  --warn: #cc9e00;

  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Inter", ui-monospace, monospace;

  --r: 6px;              /* AM storefront uses near-sharp corners */
  --shadow: 0 1px 2px rgba(48,48,48,.06), 0 6px 20px -12px rgba(48,48,48,.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.grain { display: none; } /* storefront is clean/flat — no grain */

/* ---- top bar (mirrors the shop's white header + yellow) ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 3px solid var(--am-yellow);
  position: sticky; top: 0; z-index: 50; background: var(--card);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo-mark { display: none; }
.brand::before {
  content: ""; width: 168px; height: 56px; flex: none;
  background: url("assets/audio-monkey-logo.png") left center / contain no-repeat;
}
.brand-text h1 { display: none; }               /* logo already says Audio Monkey */
.brand-text {
  border-left: 1px solid var(--line); padding-left: 16px;
}
.brand-text span {
  font-family: var(--sans); font-size: 12px; color: var(--ink-dim);
  text-transform: uppercase; letter-spacing: .14em; font-weight: 600;
}
.topbar-meta { display: flex; align-items: center; gap: 18px; }
.refresh {
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--am-graphite);
  background: var(--am-yellow); border: none; border-radius: var(--r);
  padding: 9px 16px; cursor: pointer; transition: .15s;
}
.refresh:hover { background: var(--am-yellow-dark); }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-dim); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); }
.dot.ok { background: var(--good); }
.dot.err { background: var(--danger); }

/* ---- freshness banner (#26) ---- */
.freshness-banner {
  background: var(--danger-bg); color: var(--danger); border-bottom: 1px solid #f3c9c5;
  font-size: 13px; font-weight: 600; padding: 10px 28px; text-align: center;
}

/* ---- hero ---- */
.hero {
  display: grid; grid-template-columns: 1.1fr 1.4fr; gap: 24px;
  padding: 32px 28px 26px; max-width: 1280px; margin: 0 auto; width: 100%;
}
.hero-primary {
  background: var(--am-graphite); color: #fff;
  border-radius: var(--r); padding: 30px 32px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  border-top: 4px solid var(--am-yellow);
}
.hero-primary::after {
  content: ""; position: absolute; right: -40px; bottom: -50px; width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,197,0,.22), transparent 70%);
}
.hero-label { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--am-yellow); font-weight: 700; }
.hero-figure {
  font-family: var(--sans); font-weight: 800; font-size: clamp(42px, 6.5vw, 68px);
  line-height: 1; letter-spacing: -.03em; margin: 12px 0 8px; color: #fff;
  font-variant-numeric: tabular-nums;
}
.hero-sub { color: rgba(255,255,255,.7); font-size: 13px; max-width: 36ch; }

.hero-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  position: relative; box-shadow: var(--shadow);
}
.kpi::before { content:""; position:absolute; left:0; top:16px; bottom:16px; width:4px; border-radius:0 3px 3px 0; background: var(--am-yellow); }
.kpi-danger::before { background: var(--danger); }
.kpi-warn::before { background: var(--warn); }
.kpi-good::before { background: var(--good); }
.kpi-num { font-family: var(--sans); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-danger .kpi-num { color: var(--danger); }
.kpi-good .kpi-num { color: var(--good); }
.kpi-label { font-size: 12px; color: var(--ink-dim); line-height: 1.35; }

/* ---- tabs ---- */
.tabs {
  display: flex; gap: 2px; padding: 0 28px; max-width: 1280px; margin: 6px auto 0; width: 100%;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tab {
  background: none; border: none; color: var(--ink-dim); cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  padding: 14px 16px; border-bottom: 3px solid transparent; transition: .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--am-graphite); border-bottom-color: var(--am-yellow); }
.tab-count {
  display: inline-block; min-width: 16px; padding: 1px 5px; margin-left: 4px;
  background: var(--warn); color: #fff; border-radius: 10px; font-size: 10.5px; font-weight: 700;
}

/* ---- panels ---- */
main { max-width: 1280px; margin: 0 auto; width: 100%; padding: 24px 28px 60px; }
.panel { display: none; animation: rise .35s cubic-bezier(.2,.7,.2,1); }
.panel.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-head { margin-bottom: 20px; }
.panel-head h2 { font-family: var(--sans); font-weight: 800; font-size: 24px; letter-spacing: -.02em; }
.panel-head p { color: var(--ink-dim); font-size: 13.5px; max-width: 78ch; margin-top: 4px; }

/* ---- toggle row (#21) ---- */
.toggle-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--ink); margin-bottom: 14px; cursor: pointer; user-select: none;
}
.toggle-row input { width: 16px; height: 16px; accent-color: var(--am-yellow); cursor: pointer; }
.toggle-hint { font-weight: 500; color: var(--ink-dim); }

/* ---- #61/#63 filter bar ---- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.filter-num {
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 10px; width: 100px;
}
.filter-checkbox {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-dim); cursor: pointer; user-select: none;
}
.filter-checkbox input { width: 15px; height: 15px; accent-color: var(--am-yellow); cursor: pointer; }
.filter-btn-clear, .filter-btn-save {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; cursor: pointer;
  border-radius: var(--r); padding: 8px 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-dim); transition: .15s;
}
.filter-btn-clear:hover { color: var(--danger); border-color: var(--danger); }
.filter-btn-save { background: var(--am-yellow); color: var(--am-graphite); border-color: var(--am-yellow); }
.filter-btn-save:hover { background: var(--am-yellow-dark); }
.saved-views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.saved-view-chip {
  font-family: var(--sans); font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 20px;
  padding: 5px 10px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
}
.saved-view-chip:hover { border-color: var(--am-yellow); }
.saved-view-x { color: var(--ink-faint); font-weight: 700; }
.saved-view-x:hover { color: var(--danger); }
.saved-view-empty { font-size: 12px; color: var(--ink-faint); font-style: italic; }

/* ---- classification badges (#21, #16) ---- */
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; letter-spacing: .02em; white-space: nowrap; }
.badge-parity { background: #eef1f2; color: var(--ink-dim); }
.badge-exception { background: var(--danger-bg); color: var(--danger); }
.badge-unclassified { background: #fff7e0; color: var(--warn); }

/* ---- #89 traffic-light status dot ---- */
.dot3 { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot3-red { background: var(--danger); }
.dot3-amber { background: var(--warn); }
.dot3-green { background: var(--good); }

/* ---- market position panel ---- */
.section-sub { font-family: var(--sans); font-weight: 800; font-size: 16px; letter-spacing: -.01em; margin: 28px 0 4px; }
.section-sub:first-of-type { margin-top: 4px; }
.section-hint { color: var(--ink-dim); font-size: 12.5px; max-width: 72ch; margin-bottom: 12px; }
.section-hint kbd {
  font-family: var(--mono); font-size: 11px; background: var(--card-2); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; color: var(--ink);
}
.market-block { margin-bottom: 8px; }

.histogram {
  display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.hist-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.hist-count { font-size: 10px; font-weight: 700; color: var(--ink-dim); }
.hist-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 4px; }
.hist-parity .hist-bar { background: var(--am-yellow); }
.hist-bad .hist-bar { background: var(--danger); opacity: .75; }
.hist-good .hist-bar { background: var(--good); opacity: .6; }
.hist-label { font-size: 9px; color: var(--ink-faint); white-space: nowrap; transform: rotate(-45deg); transform-origin: top center; margin-top: 2px; }
.hist-caption { font-size: 11.5px; color: var(--ink-faint); margin-top: 10px; }

.hold-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

/* ---- #65 brand scorecards ---- */
.scorecard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.scorecard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 14px 16px; border-top: 3px solid var(--am-yellow);
}
.scorecard-brand { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.scorecard-stat { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; }
.scorecard-val { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.scorecard-label { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }

/* ---- #66 category rollup ---- */
.category-block { margin-bottom: 8px; }
.category-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 12px 16px; cursor: pointer; font-family: var(--sans);
  font-size: 13.5px; font-weight: 700; color: var(--ink); text-align: left;
}
.category-head:hover { border-color: var(--am-yellow); }
.category-stats { font-size: 12px; font-weight: 500; color: var(--ink-dim); flex: 1; text-align: right; }
.category-chevron { color: var(--ink-faint); }
.category-drill { margin-top: 4px; }

/* ---- #95 positioning quadrant ---- */
.quadrant-svg {
  width: 100%; height: 300px; display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.quadrant-axis { stroke: var(--line); stroke-width: 1; }
.quadrant-label { font-size: 11px; fill: var(--ink-faint); font-family: var(--sans); }
.quadrant-dot { cursor: default; }
.quadrant-dot-bad { fill: var(--danger); opacity: .75; }
.quadrant-dot-good { fill: var(--good); opacity: .75; }

/* ---- #97 goal tracking ---- */
.goal-list { display: flex; flex-direction: column; gap: 6px; }
.goal-row {
  display: grid; grid-template-columns: 1fr auto 100px; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 10px 14px;
}
.goal-brand { font-size: 13px; font-weight: 600; }
.goal-actual { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.goal-input {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--ink);
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 6px 8px; width: 90px;
}

/* ---- #93 triage ---- */
.triage-list { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.triage-card {
  display: flex; align-items: flex-start; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 14px 16px; border-left: 4px solid var(--ink-faint);
}
.triage-card.triage-red { border-left-color: var(--danger); }
.triage-card.triage-amber { border-left-color: var(--warn); }
.triage-card .dot3 { margin-top: 4px; flex: none; }
.triage-body { flex: 1; min-width: 0; }
.triage-title { font-size: 14px; font-weight: 700; line-height: 1.35; }
.triage-detail { font-size: 12.5px; color: var(--ink-dim); margin-top: 4px; line-height: 1.4; }
@media (max-width: 560px) {
  .triage-card { padding: 16px; }
  .triage-title { font-size: 15px; }
}
.hold-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; box-shadow: var(--shadow); border-left: 4px solid var(--ink-faint);
}
.hold-card.hold-clear { border-left-color: var(--good); }
.hold-card.hold-watch { border-left-color: var(--warn); }
.hold-card p { font-size: 12.5px; color: var(--ink-dim); margin-top: 8px; line-height: 1.4; }

/* ---- #67 brand vs. brand ---- */
.cmp-picker { display: flex; align-items: center; gap: 12px; }
.cmp-select {
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 12px; cursor: pointer;
}
.cmp-vs { font-size: 12px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; }
.cmp-table {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: hidden;
}
.cmp-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.cmp-row:last-child { border-bottom: none; }
.cmp-row.cmp-header { background: var(--card-2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.cmp-label { font-size: 13px; color: var(--ink-dim); }
.cmp-val { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- #94 compare two SKUs ---- */
.skucmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.skucmp-col {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px;
}
.skucmp-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.skucmp-col .cmp-row { padding: 8px 0; }
@media (max-width: 700px) { .skucmp-grid { grid-template-columns: 1fr; } }

/* ---- #7/#8 trend charts (inline SVG, no charting library) ---- */
.spark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.spark-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 12px 14px;
}
.spark-card.spark-cold { display: flex; flex-direction: column; justify-content: center; min-height: 96px; }
.spark-cold-note { font-size: 11.5px; color: var(--ink-faint); font-style: italic; }
.spark-title { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.spark-svg { width: 100%; height: 40px; display: block; }
.spark-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-line-us { stroke: var(--am-graphite); }
.spark-line-market { stroke: var(--am-yellow-dark); }
.spark-legend { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-faint); margin-top: 6px; }

/* ---- #24 parity heatmap ---- */
.heatmap-table { border-collapse: collapse; font-size: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.heatmap-table th { padding: 8px 10px; font-weight: 700; text-align: center; color: var(--ink-dim); font-size: 11px; background: var(--card-2); }
.heatmap-rowlabel { text-align: left !important; font-weight: 600; padding: 8px 12px !important; white-space: nowrap; }
.heatmap-cell { text-align: center; padding: 8px 10px; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid var(--line-soft); color: var(--am-graphite); min-width: 56px; }
.heatmap-empty { color: var(--ink-faint); font-weight: 400; }

/* ---- #25 evidence export ---- */
.evidence-btn {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; cursor: pointer;
  border-radius: var(--r); padding: 6px 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-dim); transition: .15s;
}
.evidence-btn:hover { border-color: var(--am-yellow); color: var(--am-graphite); }
.evidence-fallback { display: block; width: 100%; margin-top: 6px; font-family: var(--mono); font-size: 11px; height: 80px; }

/* ---- #17 verify-matches compare ---- */
.verify-expand-btn {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; cursor: pointer;
  border-radius: var(--r); padding: 6px 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-dim); white-space: nowrap;
}
.verify-expand-btn:hover { border-color: var(--am-yellow); color: var(--am-graphite); }
.verify-compare-row td { padding: 0 !important; border-bottom: 1px solid var(--line-soft); }
.verify-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); padding: 12px; background: var(--card-2); }
.verify-compare-col { background: var(--card); padding: 14px 16px; }
.verify-compare-col h5 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 700; margin-bottom: 8px; }
.verify-compare-meta { font-size: 11.5px; color: var(--ink-dim); margin-top: 4px; }
.verify-compare-price { font-size: 18px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }
.spark-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.spark-dot-us { background: var(--am-graphite); }
.spark-dot-market { background: var(--am-yellow-dark); margin-left: 8px; }

.band-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.band-lowest { font-size: 12px; font-weight: 600; color: var(--good); }
.band-svg {
  width: 100%; height: 180px; display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.band-area { fill: var(--am-yellow); opacity: .14; }
.band-line-us { fill: none; stroke: var(--am-graphite); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.band-swatch { width: 14px; height: 8px; border-radius: 2px; background: var(--am-yellow); opacity: .5; display: inline-block; margin-left: 8px; }

/* ---- tables ---- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; background: var(--card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-family: var(--sans); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-faint); font-weight: 700;
  padding: 13px 16px; border-bottom: 2px solid var(--line); position: sticky; top: 0;
  background: var(--card-2); white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fffdf3; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.prod-cell { display: flex; flex-direction: column; gap: 3px; max-width: 320px; }
.prod-title { font-weight: 600; line-height: 1.25; }
.prod-meta { font-size: 11px; color: var(--ink-faint); font-weight: 500; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: .02em; }
.tag-brand { background: var(--am-yellow); color: var(--am-graphite); }
.gap-bad { color: var(--danger); font-weight: 700; }
.gap-good { color: var(--good); font-weight: 700; }
.since { font-size: 12px; color: var(--ink-dim); font-weight: 500; }
.empty-row td { text-align: center; color: var(--ink-faint); font-style: italic; padding: 40px; }

/* ---- external check-links (our page / competitor page) ----
   Every price claim links to the page it came from, so a "we're beaten by 47%" row
   can be verified on both live pages in two clicks. Underline-on-hover only, so
   dense tables don't turn into a wall of blue. */
.ext-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--ink-faint); }
.ext-link:hover { color: var(--am-yellow-dark); border-bottom-style: solid; border-bottom-color: currentColor; }
.ext-link:focus-visible { outline: 2px solid var(--am-yellow); outline-offset: 2px; border-radius: 2px; }
.ext-ico { font-size: .78em; margin-left: 3px; opacity: .55; vertical-align: baseline; }
.ext-link:hover .ext-ico { opacity: 1; }
/* Alert feed: the two check-links sit on their own line under the message. */
.alert-links { display: flex; gap: 14px; margin-top: 6px; font-size: 11.5px; font-weight: 600; flex-wrap: wrap; }
.alert-links .ext-link { color: var(--ink-dim); }
.alert-links .ext-link:hover { color: var(--am-yellow-dark); }

/* ---- beaten cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; box-shadow: var(--shadow); border-left: 4px solid var(--danger);
}
.card h4 { font-weight: 700; font-size: 15px; line-height: 1.3; margin-bottom: 3px; }
.card .prod-meta { margin-bottom: 14px; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.price-row:last-child { border: none; }
.price-row .who { font-size: 12.5px; color: var(--ink-dim); }
.price-row .who.us { color: var(--am-graphite); font-weight: 700; }
.price-row .who.us::after { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--am-yellow); margin-left: 6px; border-radius: 2px; }
.price-row .amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.card-foot { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; }

/* ---- upside summary ---- */
.upside-summary {
  display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 20px;
  background: var(--good-bg); border: 1px solid #cfe9d8; border-left: 4px solid var(--good);
  border-radius: var(--r); padding: 22px 26px;
}
.upside-summary .big { font-family: var(--sans); font-weight: 800; font-size: 38px; color: var(--good); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.upside-summary .cap { font-size: 12px; color: var(--ink-dim); }

/* ---- activity ---- */
.activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.activity-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.activity-grid h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 4px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.activity-subhead { font-size: 11.5px; color: var(--ink-faint); margin-bottom: 12px; line-height: 1.4; }
.feed { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.feed li {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; font-size: 13px; line-height: 1.4; border-left: 4px solid var(--ink-faint);
}
.feed li.pending { border-left-color: var(--warn); }
.feed li.approved { border-left-color: var(--good); }
.feed li.applied { border-left-color: var(--good); }
.feed li.apply_failed { border-left-color: var(--danger); }
.feed li.rejected { border-left-color: var(--ink-faint); opacity: .7; }
.feed li .when { display: block; font-size: 10.5px; color: var(--ink-faint); margin-top: 5px; font-weight: 500; }

/* ---- #52/#53 dedup + snooze ---- */
.snooze-btn {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; cursor: pointer;
  border-radius: var(--r); padding: 4px 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-faint); margin-top: 6px;
}
.snooze-btn:hover { border-color: var(--warn); color: var(--warn); }

/* ---- #28 stale-alert note ---- */
.stale-alert-warning { background: var(--danger-bg); color: var(--danger); border: 1px solid #f3c9c5; border-radius: var(--r); padding: 12px 16px; font-size: 13px; font-weight: 600; }
.feed .empty { color: var(--ink-faint); font-style: italic; border-left-color: transparent; }

/* ---- footer ---- */
.foot { max-width: 1280px; margin: 0 auto; width: 100%; padding: 20px 28px 40px; display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--ink-faint); border-top: 1px solid var(--line); flex-wrap: wrap; gap: 12px; font-weight: 500; }
.foot-actions { display: flex; align-items: center; gap: 10px; }

/* ---- High Visibility Mode toggle (footer button) ----
   Deliberately NOT theme-dependent: this button must already be findable, in its
   final high-contrast form, by someone who needs the mode before they've turned it
   on — a low-vision user can't rely on hover/proximity to locate a subtle default-mode
   button just to reach the control that fixes their contrast problem. So it's
   permanently black/saturated-yellow with a thick border in every theme, not just
   inside [data-theme="high-visibility"]. */
.hv-toggle {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans);
  font-size: 13px; font-weight: 800; color: #ffe600; background: #000;
  border: 3px solid #ffe600; border-radius: var(--r); padding: 10px 16px;
  cursor: pointer; transition: .15s;
}
.hv-toggle:hover { background: #ffe600; color: #000; }
.hv-toggle:focus-visible { outline: 3px solid #21e6ff; outline-offset: 2px; }
.hv-toggle[aria-pressed="true"] { background: #ffe600; color: #000; }
.hv-icon { flex: none; }
.logout-btn {
  font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink-dim);
  background: none; border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 14px; cursor: pointer; transition: .15s;
}
.logout-btn:hover { color: var(--ink); border-color: var(--ink-faint); }

/* =========================================================================
   High Visibility Mode — for severe low vision where white causes glare/
   halation. Pure black background, saturated yellow/cyan text, no white
   anywhere (backgrounds, borders, icons, or images), all AAA contrast
   (7:1+) against black. Overrides the same CSS variables the rest of the
   sheet already uses, rather than a parallel theme system.

   NOTE on error color: the spec's #ff3b30 measures 5.92:1 on pure black,
   which clears AA but fails the AAA bar this mode targets. Shifted to
   #ff6e66 (same hue, lighter) = 7.67:1, still unambiguously "red/error".
   ========================================================================= */
:root[data-theme="high-visibility"] {
  --am-yellow: #ffe600;
  --am-yellow-dark: #d9c400;
  --am-graphite: #ffe600;   /* was near-black brand ink; repurposed as primary-text/accent role */
  --am-graphite-2: #ffe600;
  --bg: #000000;
  --card: #000000;
  --card-2: #000000;
  --line: #21e6ff;
  --line-soft: #21e6ff;
  --ink: #ffe600;
  --ink-dim: #21e6ff;
  --ink-faint: #21e6ff;

  --danger: #ff6e66;       /* adjusted from spec's #ff3b30 to clear AAA on black — see note above */
  --danger-bg: #000000;
  --good: #21e6ff;         /* success stays in the cyan/yellow family per spec, not a separate green */
  --good-bg: #000000;
  --warn: #ff9d00;

  --r: 4px;
  --shadow: none;
}

[data-theme="high-visibility"] body {
  font-size: 26px;
  font-weight: 600;
  background: #000;
  color: var(--ink);
}

/* No background images, gradients, or text-over-image treatments in this mode. */
[data-theme="high-visibility"] .grain,
[data-theme="high-visibility"] .brand::before,
[data-theme="high-visibility"] .login-logo,
[data-theme="high-visibility"] .hero-primary::after {
  display: none !important;
  background: none !important;
}
[data-theme="high-visibility"] .brand::after {
  content: "AUDIO MONKEY"; font-weight: 800; letter-spacing: .04em;
}

/* Every card/panel/table/button border becomes a thick, high-contrast outline. */
[data-theme="high-visibility"] .topbar,
[data-theme="high-visibility"] .kpi,
[data-theme="high-visibility"] .table-wrap,
[data-theme="high-visibility"] .card,
[data-theme="high-visibility"] .feed li,
[data-theme="high-visibility"] .hero-primary,
[data-theme="high-visibility"] .upside-summary,
[data-theme="high-visibility"] .login-card,
[data-theme="high-visibility"] .login-field input,
[data-theme="high-visibility"] thead th,
[data-theme="high-visibility"] tbody td,
[data-theme="high-visibility"] .toggle-hint,
[data-theme="high-visibility"] .badge,
[data-theme="high-visibility"] .tag,
[data-theme="high-visibility"] .logout-btn,
[data-theme="high-visibility"] .refresh,
[data-theme="high-visibility"] .login-submit {
  border-width: 4px !important;
  border-style: solid !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
  background: #000 !important;
  color: var(--ink) !important;
}
[data-theme="high-visibility"] .kpi::before { display: none; } /* the colored accent bar relied on subtlety, not usable here */
[data-theme="high-visibility"] .hero-primary { border-top: 4px solid var(--line) !important; }
[data-theme="high-visibility"] .hero-figure,
[data-theme="high-visibility"] .hero-sub,
[data-theme="high-visibility"] .hero-label { color: var(--ink) !important; }

[data-theme="high-visibility"] .kpi-danger,
[data-theme="high-visibility"] .kpi-danger .kpi-num,
[data-theme="high-visibility"] .gap-bad,
[data-theme="high-visibility"] .badge-exception { color: var(--danger) !important; border-color: var(--danger) !important; }
[data-theme="high-visibility"] .kpi-warn,
[data-theme="high-visibility"] .badge-unclassified { color: var(--warn) !important; border-color: var(--warn) !important; }
[data-theme="high-visibility"] .kpi-good,
[data-theme="high-visibility"] .kpi-good .kpi-num,
[data-theme="high-visibility"] .gap-good,
[data-theme="high-visibility"] .badge-parity { color: var(--good) !important; border-color: var(--good) !important; }

[data-theme="high-visibility"] .tab.active { border-bottom-color: var(--am-yellow); background: #000 !important; }
[data-theme="high-visibility"] tbody tr:hover { background: #000 !important; }
[data-theme="high-visibility"] .badge-parity { background: #000 !important; color: var(--ink-dim) !important; }
[data-theme="high-visibility"] .freshness-banner {
  background: #000 !important; color: var(--danger) !important;
  border-bottom: 4px solid var(--danger) !important;
}
[data-theme="high-visibility"] .tab-count { background: var(--danger) !important; color: #000 !important; }
[data-theme="high-visibility"] .tag-brand { background: var(--am-yellow) !important; color: #000 !important; }
[data-theme="high-visibility"] .price-row .who.us::after { background: var(--am-yellow) !important; }
[data-theme="high-visibility"] .dot { background: var(--ink-faint); }
[data-theme="high-visibility"] .dot.ok { background: var(--good); }
[data-theme="high-visibility"] .dot.err { background: var(--danger); }

/* Any image (e.g. the shop logo, if re-enabled anywhere) gets inverted + hue-locked so
   a white background/glyph inside a raster asset can't leak white pixels onto the page. */
[data-theme="high-visibility"] img {
  filter: grayscale(1) invert(1) contrast(1.2);
}

/* Bigger, bolder type scale across headings/labels/tables. */
[data-theme="high-visibility"] h1,
[data-theme="high-visibility"] h2,
[data-theme="high-visibility"] h3,
[data-theme="high-visibility"] h4 { font-weight: 800; }
[data-theme="high-visibility"] .hero-figure { font-size: clamp(52px, 8vw, 84px); }
[data-theme="high-visibility"] .panel-head h2 { font-size: 32px; }
[data-theme="high-visibility"] .panel-head p { font-size: 18px; font-weight: 600; }
[data-theme="high-visibility"] table { font-size: 20px; }
[data-theme="high-visibility"] thead th { font-size: 15px; font-weight: 800; }
[data-theme="high-visibility"] .tab { font-size: 18px; padding: 16px 18px; }
[data-theme="high-visibility"] .kpi-num { font-size: 44px; }
[data-theme="high-visibility"] .kpi-label { font-size: 15px; font-weight: 600; }
[data-theme="high-visibility"] .refresh,
[data-theme="high-visibility"] .hv-toggle,
[data-theme="high-visibility"] .logout-btn { font-size: 16px; padding: 12px 18px; }

/* Strong, unmissable focus ring for keyboard navigation. */
[data-theme="high-visibility"] :focus-visible {
  outline: 4px solid var(--am-yellow) !important;
  outline-offset: 3px !important;
}

/* Site issues panel tick — the hover background was a hardcoded near-white that
   isn't routed through the shared variables. (The ticked-state white checkmark is
   handled further down, alongside the rest of that panel's HV fixes.) */
[data-theme="high-visibility"] .tick:hover { background: #000 !important; }

/* External check-links: in this mode a dotted grey underline is invisible, and link
   text must stay distinguishable from body text without introducing a third colour.
   Cyan (the established secondary/accent) + a solid underline does both at 13.8:1. */
[data-theme="high-visibility"] .ext-link {
  color: var(--ink-dim) !important;
  border-bottom: 2px solid var(--ink-dim) !important;
  font-weight: 700;
}
[data-theme="high-visibility"] .ext-link:hover {
  color: #000 !important;
  background: var(--ink-dim) !important;
}
[data-theme="high-visibility"] .ext-ico { opacity: 1; }
[data-theme="high-visibility"] .alert-links { font-size: 15px; gap: 18px; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .activity-grid, .activity-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero-secondary { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .brand::before { width: 132px; height: 44px; }
  main, .hero, .tabs { padding-left: 16px; padding-right: 16px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   Site issues — audit worklist panel.
   Built on the same custom properties as everything else, so High Visibility Mode
   (which only re-points those variables) restyles this panel without extra rules.
   ══════════════════════════════════════════════════════════════════════════════ */

/* overall progress hero */
.issues-summary { margin-bottom: 18px; }
.issues-hero {
  display: flex; align-items: center; gap: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 22px; box-shadow: var(--shadow);
}
.issues-hero-num {
  font-weight: 800; font-size: 32px; line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; display: block;
}
.issues-hero-of { font-weight: 600; font-size: 20px; color: var(--ink-faint); }
.issues-hero-label { font-size: 12px; color: var(--ink-dim); }
.issues-hero-bar {
  flex: 1; height: 8px; background: var(--line-soft); border-radius: 20px; overflow: hidden;
}
.issues-hero-bar > span {
  display: block; height: 100%; background: var(--am-yellow);
  border-radius: 20px; transition: width .3s ease;
}
.issues-hero-pct {
  font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; min-width: 3.5ch; text-align: right;
}

/* filter row */
.issues-controls { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.seg-btn {
  border: 0; background: transparent; padding: 7px 16px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-dim); cursor: pointer; border-right: 1px solid var(--line);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn.active { background: var(--am-yellow); color: var(--am-graphite); }
.seg-btn:hover:not(.active) { background: var(--card-2); color: var(--ink); }
.issues-search {
  flex: 1; min-width: 220px; padding: 7px 12px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink);
}
.issues-search:focus { outline: 2px solid var(--am-yellow); outline-offset: -1px; }

/* auto vs manual re-check chips — explains why some ticks appear on their own */
.auto-chip, .manual-chip {
  display: inline-block; font-size: 9.5px; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle;
}
.auto-chip { background: var(--good-bg); color: var(--good); }
.manual-chip { background: var(--line-soft); color: var(--ink-faint); }

/* category groups */
.issues-groups { display: flex; flex-direction: column; gap: 10px; }
.issue-group { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.issue-group-head {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 18px; background: transparent; border: 0; font: inherit; cursor: pointer; color: var(--ink);
}
.issue-group-head:hover { background: var(--card-2); }
.issue-caret { color: var(--ink-faint); font-size: 12px; transition: transform .15s ease; flex: none; }
.issue-group.expanded .issue-caret { transform: rotate(90deg); }
.issue-icon { font-size: 16px; flex: none; }
.issue-group-title { flex: 1; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.issue-blurb { flex-basis: 100%; font-weight: 400; font-size: 12px; color: var(--ink-dim); }
.issue-group-stats { display: flex; align-items: center; gap: 12px; flex: none; }
.issue-prog { width: 90px; height: 6px; background: var(--line-soft); border-radius: 20px; overflow: hidden; }
.issue-prog > span { display: block; height: 100%; background: var(--good); border-radius: 20px; transition: width .3s ease; }
.issue-count { font-size: 12px; font-weight: 600; color: var(--ink-dim); font-variant-numeric: tabular-nums; min-width: 9ch; text-align: right; }
.issue-group-body:not(:empty) { border-top: 1px solid var(--line); padding: 14px 18px 18px; }

/* rows */
.issues-table { width: 100%; border-collapse: collapse; }
.issues-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.issues-table tr:last-child td { border-bottom: 0; }
.issue-tick { width: 40px; }
.tick {
  width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 5px; background: var(--card);
  cursor: pointer; font-size: 13px; font-weight: 800; line-height: 1; color: transparent;
  display: grid; place-items: center; padding: 0; transition: all .12s ease;
}
/* card-2 rather than a literal near-white: High Visibility Mode remaps it to pure
   black, and that mode permits no white anywhere. */
.tick:hover { border-color: var(--am-yellow); background: var(--card-2); }
.tick[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: #fff; }
.tick:focus-visible { outline: 2px solid var(--am-yellow); outline-offset: 2px; }
.issue-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.issue-title a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.issue-title a:hover { color: var(--am-yellow-dark); border-bottom-color: currentColor; }
.issue-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.issue-sku { font-size: 10.5px; color: var(--ink-faint); font-family: var(--mono); }
.issue-detail { font-size: 11px; color: var(--ink-dim); }
.issue-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.issue-status { width: 70px; text-align: right; }
.fixed-by { font-size: 10.5px; font-weight: 700; color: var(--good); white-space: nowrap; }
/* struck through, dimmed — resolved rows stay visible but recede */
.issue-row.is-fixed .issue-title { text-decoration: line-through; opacity: .5; }
.issue-row.is-fixed .issue-price, .issue-row.is-fixed .issue-meta { opacity: .45; }

/* ---- #92 keyboard-driven review ---- */
.issue-row.is-focused { background: #fffaf0; box-shadow: inset 3px 0 0 var(--am-yellow); }
.issue-row.is-focused .issue-title { font-weight: 700; }

.issues-note { font-size: 12.5px; color: var(--ink-dim); font-style: italic; padding: 10px 2px; }
.issues-note code { font-style: normal; background: var(--card-2); padding: 1px 5px; border-radius: 3px; font-size: 11.5px; }
.issues-note-err { color: var(--danger); font-style: normal; }

@media (max-width: 720px) {
  .issues-hero { flex-wrap: wrap; gap: 12px; }
  .issues-hero-bar { order: 3; flex-basis: 100%; }
  .issue-group-stats { flex-direction: column; align-items: flex-end; gap: 4px; }
  .issue-prog { width: 60px; }
}

/* Save-failure notice. Sits outside #issues-groups (which renderIssues() rewrites),
   so a failed tick stays visible long enough to read. */
.issues-error {
  margin-bottom: 14px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid currentColor; border-radius: var(--r);
}

/* High Visibility Mode: the ticked checkmark sits on --good, which this mode remaps
   from green to cyan. White-on-cyan is ~2:1 and this mode forbids white outright —
   black on cyan is 11.4:1 and keeps the tick unmistakably "done". */
[data-theme="high-visibility"] .tick[aria-pressed="true"] { color: #000; }

/* High Visibility Mode remaps --line-soft and --ink-faint to the SAME cyan, which
   made the "manual" chip cyan-on-cyan (invisible). Same collapse hid the active
   segmented-button label (yellow bg + yellow text). Re-separate both here. */
[data-theme="high-visibility"] .manual-chip { background: #000; color: var(--ink); border: 1px solid var(--ink); }
[data-theme="high-visibility"] .auto-chip { background: #000; color: var(--good); border: 1px solid var(--good); }
[data-theme="high-visibility"] .seg-btn.active { background: var(--am-yellow); color: #000; }
