@import url('/listing-diff.css');

@font-face {
  font-family: Playfair;
  src: url("/assets/fonts/PlayfairDisplay-VF.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/assets/fonts/Inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Mono;
  src: url("/assets/fonts/JetBrainsMono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
:root {
  --bg: #08080a;
  --card: #040406;
  --panel: #101116;
  --panel-2: #17181e;
  --border: #26282f;
  --border-strong: #3a3c45;
  --text: #e6e7ec;
  --muted: #a3a6b1;
  --faint: #82858f;
  --copper: #cc9166;
  --copper-soft: rgba(204, 145, 102, 0.14);
  --gold: #ae9357;
  --chart-red: #cf514b;
  --bar: #3a3d46;
  --s-copper: #c9814a;
  --s-blue: #4f93e0;
  --s-green: #5f9f3c;
  --s-violet: #a877d9;
  --good: #46b889;
  --warn: #d9a53a;
  --crit: #cf514b;
  --motion-fast: 250ms;
  --motion-slow: 600ms;
  --rail: 236px;
  color-scheme: dark;
  font-family: Inter, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
}
button,
select {
  font: inherit;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 8px 14px;
  max-width: 100%;
}
button {
  cursor: pointer;
}
button:hover {
  border-color: var(--border-strong);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}
a {
  color: inherit;
}
h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--panel);
  padding: 12px;
  z-index: 40;
}
.skip:focus {
  top: 12px;
}
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-icon {
  display: inline-flex;
}
.eyebrow {
  margin: 0;
  font: 500 10.5px/1.3 Mono, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.caveat,
.metadata {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}
.metadata {
  color: var(--faint);
  font-size: 12px;
}
.card-meta {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.mono {
  font: 12px Mono, monospace;
  overflow-wrap: anywhere;
  color: var(--faint);
}

/* ---------- shell ---------- */
.shell {
  overflow-x: clip;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: var(--card);
  border-right: 1px solid var(--border);
}
.wordmark {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 6px;
  font: 500 26px Playfair, serif;
  white-space: nowrap;
}
.wordmark span {
  color: var(--copper);
  font: 22px Inter, sans-serif;
}
.brand-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 6px;
  border: 1px solid rgba(204, 145, 102, 0.5);
  background: #2a1f18;
  color: #f0d3bd;
  font: 500 17px Playfair, serif;
}
.brand-field {
  min-width: 0;
  flex: 1;
}
.brand-field label {
  display: block;
  font-size: 11px;
  color: var(--faint);
}
.brand-field select {
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 600;
  text-overflow: ellipsis;
}
.brand-field input[type="search"] {
  width: 100%;
  min-height: 28px;
  margin: 2px 0;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover {
  background: var(--panel);
  color: var(--text);
}
.nav a[aria-current="page"] {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--copper);
}
.nav a[hidden] {
  display: none;
}
.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ask-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--copper-soft);
  border-color: rgba(204, 145, 102, 0.45);
  color: #f0d3bd;
}
.ask-button:hover {
  border-color: var(--copper);
}
.brief-link {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
}
.brief-link[hidden] { display: none; }
.brief-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.rail-note {
  margin: 0;
  padding: 0 6px;
  font-size: 11.5px;
  color: var(--faint);
}
main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
main:focus {
  outline: none;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 28px 12px;
  background: rgba(8, 8, 10, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topline {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.titles {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  min-width: 0;
}
h1 {
  font: 500 26px/1.1 Playfair, serif;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-actions button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.month-strip[hidden] {
  display: none;
}
.month-strip-inner {
  display: flex;
  align-items: stretch;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.month-year {
  align-self: center;
  padding: 0 3px;
  font: 10px Mono, monospace;
  color: var(--faint);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.month {
  flex: 1 0 50px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 4px 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  color: var(--faint);
  font-size: 11.5px;
}
.month:hover {
  background: var(--panel);
  color: var(--text);
  border-color: transparent;
}
.month[aria-pressed="true"] {
  border-color: var(--copper);
  background: var(--copper-soft);
  color: var(--text);
}
.month-bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 22px;
}
.month-bar b {
  display: block;
  width: 70%;
  border-radius: 2px 2px 0 0;
  background: var(--bar);
}
.month[aria-pressed="true"] .month-bar b {
  background: var(--copper);
}
/* Overview period bar: the mode buttons, then the strip, the month range or the two years */
.period-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.period-bar[hidden],
.month-strip-inner[hidden],
.story-range[hidden] {
  display: none;
}
.period-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}
.period-detail > .month-strip-inner {
  flex: 1 1 100%;
  min-width: 0;
}
.period-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.period-pick select {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12.5px;
}
.period-note {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}
.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: 22px 28px 48px;
}
#status {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
}
#status:empty,
#data-report:empty {
  display: none;
}
#report {
  min-width: 0;
}
.page, #shopify-report {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.page[hidden] {
  display: none;
}

/* ---------- cards ---------- */
.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.card-head > div {
  min-width: 0;
  flex: 1;
}
.card-head h2,
.card-head h3 {
  font: 600 15px/1.3 Inter, sans-serif;
}
.card-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.section-label {
  margin-top: 6px;
  font: 500 10.5px Mono, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.grid {
  display: grid;
  gap: 20px;
}
.grid-hero {
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
}
.grid-cards {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.notice {
  padding: 22px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--chart-red);
  border-radius: 8px;
  background: var(--panel);
}
.notice h2 {
  font: 500 20px Playfair, serif;
}
.notice p {
  color: var(--muted);
}
.notice-inline {
  margin: 0;
  padding: 16px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
}

/* tips: a caveat behind an "i" */
.tip {
  position: relative;
  flex: none;
}
.tip summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--faint);
  font: italic 600 11px Playfair, serif;
  cursor: pointer;
}
.tip summary::-webkit-details-marker {
  display: none;
}
.tip summary:hover,
.tip[open] summary {
  color: var(--text);
  border-color: var(--copper);
}
.tip p {
  position: absolute;
  right: -4px;
  top: 26px;
  z-index: 20;
  width: 270px;
  max-width: min(270px, calc(100vw - 40px));
  margin: 0;
  padding: 10px 12px;
  background: #1c1d24;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font: 400 12.5px/1.45 Inter, sans-serif;
  text-align: left;
}

/* ---------- KPI strip ---------- */
.story-headline {
  margin: 0 0 14px;
  font: 500 22px/1.3 Playfair, serif;
  color: var(--text);
}
.story-headline[hidden] {
  display: none;
}
.story-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.story-tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 10px;
  background: var(--panel);
}
.story-tile:first-child {
  border-radius: 8px 0 0 8px;
}
.story-tile:last-child {
  border-radius: 0 8px 8px 0;
}
.story-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.story-head h3 {
  flex: 1;
  min-width: 0;
  font: 500 12.5px/1.3 Inter, sans-serif;
  color: var(--muted);
}
.story-badge {
  padding: 0 5px;
  border: 1px solid rgba(217, 165, 58, 0.45);
  border-radius: 3px;
  color: var(--warn);
  font: 500 10px Mono, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.story-tile[hidden],
.story-badge[hidden] {
  display: none;
}
.story-value {
  margin: 4px 0 0;
  font: 600 25px/1.15 Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.story-value.unavailable,
.imported-value.unavailable,
.value.unavailable,
.stat-value.unavailable {
  font-size: 17px;
  font-weight: 500;
  color: var(--muted);
}
.story-range {
  margin: 0;
  font-size: 11.5px;
  color: var(--faint);
}
.story-delta {
  min-height: 1.4em;
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}
.story-delta[data-direction="up"]::before {
  content: "▲ " / "";
  color: var(--good);
}
.story-delta[data-direction="down"]::before {
  content: "▼ " / "";
  color: var(--crit);
}
/* A change smaller than the measure's threshold keeps its arrow, in grey. */
.story-delta-quiet[data-direction]::before {
  color: var(--faint);
}

/* what changed */
.callout-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 11px 12px;
  text-align: left;
  background: var(--card);
  border-color: var(--border);
  font-size: 13px;
  line-height: 1.45;
}
.callout-static {
  border: 1px solid var(--border);
  border-radius: 6px;
}
.callout-look {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.callout-look:hover {
  border-color: var(--border-strong);
}
.callout-look > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.callout-page {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.story-callouts[hidden] {
  display: none;
}
/* With nothing to look at, the chart takes the whole row. */
.grid-hero:has(> .story-callouts[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.callout-rule {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.callout-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 6px;
  background: var(--copper-soft);
  color: var(--copper);
}
.callout-empty,
.callout-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- charts ---------- */
.trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.trend-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.trend-card-hero {
  padding: 16px 18px;
  background: var(--panel);
}
.trend-card h3 {
  font: 600 14px/1.3 Inter, sans-serif;
}
.trend-plot {
  min-width: 0;
}
.trend-scale {
  margin: 0 0 4px;
  font: 11px Mono, monospace;
  color: var(--faint);
}
.trend-data {
  margin-top: auto;
}
.chart {
  min-width: 0;
  border-radius: 4px;
}
.chart:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}
.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}
/* Charts stop growing near reading size (12px labels draw at no more than the 14px body text) and sit
   left-aligned with the card text instead of scaling up or centring in a wide card. */
.chart-trend .chart-svg {
  max-width: 370px;
}
.chart-daily .chart-svg {
  max-width: 740px;
}
.chart-hero .chart-svg {
  max-width: 840px;
}
.chart-spark .chart-svg {
  height: 34px;
  margin: 2px 0 0;
}
.chart-axis {
  stroke: var(--border);
  stroke-width: 1;
}
.chart-label {
  fill: var(--faint);
  font: 12px Inter, sans-serif;
}
.chart-end-label {
  font-weight: 600;
}
.chart-line {
  fill: none;
  stroke: var(--s-copper);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  animation: draw var(--motion-slow) ease-out;
}
.chart-daily .chart-line {
  stroke: var(--s-blue);
}
.chart-line-emphasis {
  stroke-width: 2.5;
}
.chart-line-muted {
  stroke-width: 1.25;
  opacity: 0.6;
}
.chart-line-dashed {
  stroke-dasharray: 0.01 0.008;
  animation: none;
}
.chart-settled .chart-line {
  animation: none;
}
.chart-spark .chart-line {
  stroke: #7c6552;
  stroke-width: 1.5;
}
.chart-dot {
  fill: var(--gold);
  stroke: var(--card);
  stroke-width: 1.5;
}
.chart-bar {
  fill: var(--bar);
  transition: fill var(--motion-fast);
}
.chart-bar.chart-selected {
  fill: var(--copper);
}
.chart-bar-marked,
.chart-bar-marked.chart-selected {
  fill: var(--card);
  stroke: var(--copper);
  stroke-width: 1.5;
}
.chart-zero {
  fill: var(--gold);
}
.chart-na {
  fill: var(--faint);
  font: 9px Mono, monospace;
}
.chart-band {
  fill: var(--copper);
  opacity: 0.1;
  transition: transform var(--motion-fast) ease-out;
}
.chart-ring {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2;
  transition: transform var(--motion-fast) ease-out;
}
.chart-cross {
  stroke: var(--muted);
  stroke-dasharray: 3 3;
}
.chart-readout {
  min-height: 1.5em;
  margin: 8px 0 0;
  font: 12px Mono, monospace;
  color: var(--muted);
  overflow-wrap: anywhere;
}
@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
}

/* ---------- card links, meters, stats ---------- */
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 10px;
  color: var(--text);
  font-size: 12.5px;
  text-decoration: none;
  border-top: 1px solid var(--border);
  width: 100%;
}
.card-link:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.meter {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 3px;
  overflow: hidden;
}
.meter-lg {
  height: 14px;
}
.meter i,
.stack i {
  display: block;
  flex-basis: 0;
}
.meter-good {
  background: var(--s-green);
}
.meter-info {
  background: var(--s-blue);
}
.meter-alt {
  background: var(--s-violet);
}
.meter-warn {
  background: var(--warn);
}
.meter-copper {
  background: var(--copper);
}
.meter-empty {
  background: #2a2c33;
}
.meter-unknown {
  background: repeating-linear-gradient(135deg, #5b5e68 0 2px, #2a2c33 2px 6px);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  display: block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}
.stat {
  min-width: 0;
  padding: 9px 11px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.stat-label {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}
.stat-value {
  margin: 2px 0 0;
  font: 600 18px Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-note {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--faint);
}
.standing-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 28px;
}
.standing-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.standing-text {
  margin: 0;
  font-size: 15px;
}
.tone-good {
  box-shadow: inset 3px 0 0 var(--s-green);
}
.tone-info {
  box-shadow: inset 3px 0 0 var(--s-blue);
}
.tone-alt {
  box-shadow: inset 3px 0 0 var(--s-violet);
}
.tone-warn {
  box-shadow: inset 3px 0 0 var(--warn);
}
.tone-crit {
  box-shadow: inset 3px 0 0 var(--crit);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
}
.pill-ok {
  color: var(--good);
  border-color: rgba(70, 184, 137, 0.35);
}
.pill-warn {
  color: var(--warn);
  border-color: rgba(217, 165, 58, 0.4);
}
.pill-crit {
  color: var(--crit);
  border-color: rgba(207, 81, 75, 0.45);
}
.pill-unk {
  color: var(--muted);
  border-style: dashed;
}

/* ---------- customers ---------- */
.imported-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.imported-card {
  min-width: 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.imported-value {
  margin: 6px 0 0;
  font: 600 20px Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.imported-block table {
  min-width: 560px;
}
.demographic-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px 28px;
}
.demographic-group {
  min-width: 0;
}
.demographic-group h3 {
  margin-bottom: 10px;
  font: 500 10.5px Mono, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.demographic-row {
  margin: 0 0 9px;
}
.demographic-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.demographic-label strong {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.demographic-track {
  height: 8px;
  margin-top: 4px;
  background: var(--card);
  border-radius: 2px;
}
.demographic-fill {
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: var(--s-blue);
}
.demographic-row .caveat {
  margin-top: 2px;
  font-size: 11px;
  color: var(--faint);
}
.demographic-group details {
  margin-top: 8px;
}

.coverage-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.filters button {
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 12.5px;
}
.filters button[aria-pressed="true"] {
  border-color: var(--copper);
  background: var(--copper-soft);
  color: var(--text);
}
.filters input {
  flex: 0 1 280px;
  min-height: 34px;
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.stack {
  display: flex;
  gap: 2px;
  height: 8px;
  min-width: 4px;
  border-radius: 2px;
  overflow: hidden;
}
.stack i {
  height: 100%;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- search ---------- */
/* Who owns page 1: ranked bars, ours in copper and the rest grey, with a tick at each brand's top-3 share. */
.owner-bars {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.owner-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 13px;
}
.owner-label span:first-child {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.owner-label strong {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.owner-us .owner-label span:first-child,
.owner-us .owner-label strong {
  color: var(--copper);
  font-weight: 600;
}
.owner-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
}
.owner-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--faint);
}
.owner-us .owner-track i {
  background: var(--copper);
}
.owner-tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: var(--text);
}
.exact-values {
  margin-top: 12px;
}

/* ---------- data health ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.listing-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.value {
  font: 600 22px Inter, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.timeline-axis {
  display: flex;
  justify-content: space-between;
  margin-left: calc(180px + 14px);
  margin-right: calc(140px + 14px);
  font: 10.5px Mono, monospace;
  color: var(--faint);
}
.timeline-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 140px;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-row:last-child {
  border-bottom: 0;
}
.timeline-name {
  display: flex;
  flex-direction: column;
  font-weight: 500;
}
.timeline-name small {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 400;
}
.timeline-track {
  position: relative;
  height: 18px;
  background: var(--card);
  border-radius: 3px;
}
.timeline-range,
.timeline-point {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 2px;
  background: var(--s-blue);
}
.timeline-point {
  width: 8px;
  margin-left: -4px;
  top: 3px;
  bottom: 3px;
  border-radius: 50%;
}
.timeline-row .pill {
  justify-self: start;
}
.sources details + details {
  margin-top: -6px;
}

/* ---------- shared structure ---------- */
.report-details { margin-top: 20px; }
.report-details > summary { min-height: 48px; font-size: 14px; font-weight: 600; }
.report-details > .card-sub { margin: 0 0 16px; }
.report-details #data-report .card { margin-top: 16px; }
details {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  padding: 0 12px;
}
details[open] {
  padding-bottom: 12px;
}
summary {
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
}
summary:hover {
  color: var(--text);
}
.tip {
  border: 0;
  padding: 0;
  background: none;
}
.tip[open] {
  padding: 0;
}
.tip summary {
  min-height: 0;
}
dl {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr);
  gap: 6px 16px;
  margin: 4px 0 0;
  font-size: 12.5px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 12.5px;
}
th,
td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  font: 500 10.5px Mono, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--border-strong);
}
.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pager button {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12.5px;
}
.pager span {
  color: var(--muted);
  font-size: 12.5px;
}
.pager:empty {
  display: none;
}
.fade-in {
  animation: fade-in var(--motion-fast) ease-out;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- questions panel ---------- */
.ask-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 400px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 16px;
  background: #14151b;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}
.ask-panel[hidden] {
  display: none;
}
.ask-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ask-head h2 {
  flex: 1;
  font: 500 19px Playfair, serif;
}
.ask-close {
  min-height: 32px;
  width: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}
.question-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.question-choices button {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
}
.question-choices button:hover:not(:disabled) {
  color: var(--text);
}
#question-answer {
  overflow-wrap: anywhere;
}
#question-answer:not(:empty) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
#question-answer p {
  margin: 0;
}
.ask-fab {
  display: none;
}
.ask-button[hidden],
.ask-fab[hidden] {
  display: none;
}
/* On wide screens an open questions panel sits beside the report instead of covering it. */
@media (min-width: 1180px) {
  /* A wide chart keeps its legend and readout in a right column; a narrow card wraps them below. */
  .chart-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: 28px;
  }
  .chart-hero > .chart-svg {
    flex: 0 1 840px;
    min-width: 0;
  }
  .chart-hero > .chart-aside {
    flex: 1 0 200px;
  }
  body:has(#ask-panel:not([hidden])) main {
    margin-right: 424px;
  }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .grid-hero {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .wordmark {
    font-size: 21px;
    padding: 0;
    gap: 6px;
  }
  .wordmark span {
    font-size: 18px;
  }
  .brand-pick {
    order: 2;
    flex: 0 1 auto;
    min-width: 0;
    margin-left: auto;
    padding: 4px 8px;
  }
  .chart-hero .chart-label,
  .chart-daily .chart-label {
    font-size: 24px;
  }
  .brand-mark {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
  .brand-field label {
    display: none;
  }
  .nav {
    order: 3;
    flex-direction: row;
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav a {
    flex: none;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 0;
    white-space: nowrap;
    font-size: 13.5px;
  }
  .nav a[aria-current="page"] {
    background: none;
    box-shadow: inset 0 -2px 0 var(--copper);
  }
  .nav .nav-icon {
    display: none;
  }
  .rail-foot {
    order: 1;
    flex-direction: row;
    margin: 0;
  }
  .ask-button,
  .rail-note,
  .brief-text {
    display: none;
  }
  .brief-link {
    width: 36px;
    min-height: 36px;
  }
  .topbar {
    padding: 12px 16px 10px;
  }
  h1 {
    font-size: 21px;
  }
  .top-actions .chip {
    display: none;
  }
  .content {
    padding: 16px 16px 96px;
    gap: 14px;
  }
  .page {
    gap: 14px;
  }
  .card {
    padding: 14px;
  }
  .story-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .story-tile:first-child,
  .story-tile:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
  .story-tile,
  .story-tile:first-child,
  .story-tile:last-child {
    border-radius: 0;
  }
  .story-value {
    font-size: 21px;
  }
  .filters input {
    flex-basis: 100%;
    margin-left: 0;
  }
  .hide-sm {
    display: none;
  }
  dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  dd {
    margin-bottom: 8px;
  }
  .timeline-axis {
    display: none;
  }
  .timeline-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .timeline-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .ask-panel {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 24px);
  }
  .ask-fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 25;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--copper);
    color: #1a0f07;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  }
  .ask-fab[aria-expanded="true"] {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- monthly brief ---------- */
.brief-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.brief-top .wordmark {
  font-size: 22px;
  gap: 8px;
}
.brief-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.brief-controls select {
  min-height: 36px;
  padding: 4px 10px;
}
.brief-controls .imported-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.brief-controls .brief-link {
  white-space: nowrap;
  padding: 0 14px;
  min-height: 36px;
}
.brief {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 24px 40px;
}
.brief:focus {
  outline: none;
}
.brief-status {
  color: var(--muted);
  padding: 40px 0;
}
.lede {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: end;
  gap: 40px;
  padding: 36px 0 30px;
}
.lede h1 {
  margin: 12px 0 14px;
  font: 400 clamp(30px, 4.2vw, 44px)/1.12 Playfair, serif;
}
.brief-lead {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 15px;
}
.trio {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-left: 1px solid var(--border);
}
.trio div {
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--border);
}
.trio div:last-child {
  border-bottom: 0;
}
.trio dt {
  font-size: 12.5px;
}
.trio dd {
  font: 500 28px/1.15 Playfair, serif;
  font-variant-numeric: tabular-nums;
}
.trio dd.unavailable {
  font: 500 17px Inter, sans-serif;
  color: var(--muted);
}
.trio .trio-delta {
  margin: 2px 0 0;
  font: 12px Inter, sans-serif;
  color: var(--faint);
}
.brief-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
}
.brief-section > h2 {
  font: 500 24px Playfair, serif;
}
.brief-section .card-link {
  width: auto;
  border-top: 0;
}
.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.watch-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.watch-kind {
  margin: 0;
  font: 500 10.5px Mono, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
}
.watch-card h3 {
  font: 600 14.5px/1.4 Inter, sans-serif;
}
.watch-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.brief-body .card-link {
  margin-top: 4px;
}
.brief-foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 24px 40px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 12px;
}
@media (max-width: 760px) {
  .brief-top,
  .brief,
  .brief-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .brief-controls {
    margin-left: 0;
    width: 100%;
  }
  #brief-tenant {
    flex: 1 1 100%;
  }
  .lede {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 24px;
  }
  .trio {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .trio div {
    padding-left: 0;
  }
}

/* ---------- data sources ---------- */
#data-sources {
  gap: 16px;
}
.connections {
  display: grid;
  gap: 16px;
}
.conn-grid,
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.conn-card {
  padding: 18px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow-wrap: anywhere;
  display: grid;
  gap: 10px;
  align-content: start;
}
.conn-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.conn-head h3 {
  margin: 0;
  font-size: 15px;
}
.conn-logo,
.conn-initials {
  width: 32px;
  height: 32px;
  flex: none;
}
.conn-initials {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--copper);
  font-size: 12px;
}
.conn-card .metadata {
  margin: 0;
}
.conn-badges,
.conn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge-status {
  border: 1px solid var(--border);
  padding: 3px 10px;
  font-size: 12px;
  color: var(--muted);
}
.badge-status--active {
  border-color: var(--gold);
  color: var(--gold);
}
.badge-status--needs {
  border-color: var(--chart-red);
  color: var(--chart-red);
}
.badge-status--connecting {
  border-color: var(--copper);
  color: var(--copper);
}
.badge-status--unknown {
  border-style: dashed;
}
.conn-read-check,
.conn-capture {
  margin: 0;
  padding: 7px 10px;
  border-left: 2px solid var(--border-strong);
  background: var(--panel);
  font-size: 12px;
  line-height: 1.5;
}
.conn-read-check--verified {
  border-left-color: var(--good);
}
.conn-read-check--unavailable {
  border-left-color: var(--warn);
}
.conn-live:empty {
  display: none;
}
.conn-confirm,
.conn-live {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--copper);
  background: var(--panel);
  margin: 0;
}
.conn-live {
  margin-bottom: 16px;
}
.conn-banner--failed {
  border-left-color: var(--chart-red);
}
.conn-confirm h3 {
  margin-top: 0;
}
.conn-confirm button + button {
  margin-left: 8px;
}
.conn-confirm label {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.conn-confirm input,
.conn-search input {
  font: inherit;
  min-height: 44px;
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
  display: block;
  margin-bottom: 12px;
}
.conn-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.conn-search input {
  flex: 1 1 220px;
  margin: 0;
}
.conn-catalog > button {
  margin-top: 14px;
}
.connections button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- locked sections ---------- */
.card-locked {
  border: 1px dashed var(--border-strong);
  color: var(--muted);
}
.locked-label {
  margin: 0;
  font-weight: 600;
}
.locked-needs {
  margin: 0;
  padding-left: 18px;
}
/* A panel that is coming soon or temporarily unavailable: one plain line, and Details for staff. */
.card-state {
  border: 1px dashed var(--border-strong);
}
.state-line {
  margin: 0;
  color: var(--muted);
}
.state-details summary {
  cursor: pointer;
  color: var(--muted);
}

/* ---------- attention list ---------- */
.page-attention {
  margin-bottom: 16px;
}
.attention-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--copper);
  list-style: none;
}
.attention-trigger::-webkit-details-marker { display: none; }
.attention-trigger::after { content: '+'; margin-left: 4px; }
.page-attention[open] > .attention-trigger::after { content: '−'; }
.attention-trigger:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.page-attention > .card { margin-top: 10px; }
.attention-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.attention-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.attention-head h3 {
  margin: 0;
  font-size: 14px;
}
.attention-rows {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.attention-more {
  align-self: flex-start;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--copper);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.attention-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.attention-more:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.attention-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.attention-result .caveat {
  margin: 0;
}

/* ---------- parity panels ---------- */
.stackbar {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
}
.stackbar i {
  display: block;
  flex-basis: 0;
  min-width: 2px;
}
.swatch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch-label i {
  display: block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
/* market page: chart legend, brand rows, family picker */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}
.chart-mark {
  fill: var(--card);
  stroke-width: 2;
}
.row-brand td {
  background: var(--copper-soft);
}
.listing-title {
  display: inline-block;
  min-width: 240px;
}
.market-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.funnel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.funnel-stage {
  display: grid;
  grid-template-columns: minmax(96px, 150px) 1fr auto;
  align-items: center;
  gap: 4px 12px;
}
.funnel-label,
.funnel-count {
  margin: 0;
  font-size: 12.5px;
}
.funnel-count {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.funnel-track {
  height: 14px;
  background: #2a2c33;
  border-radius: 3px;
  overflow: hidden;
}
.funnel-bar {
  height: 100%;
  background: var(--s-blue);
}
.funnel-advance {
  grid-column: 2 / -1;
  margin: 0;
  font-size: 11px;
  color: var(--faint);
}
/* pricing page: price check tiles, one row per product with a MAP, the CSV link and the sellers undercutting us */
.price-tiles .stat { padding: 14px 16px; border-top: 2px solid var(--border-strong); }
.price-tiles .stat-value { font-size: 26px; letter-spacing: -.02em; }
.price-tiles .stat-alert { border-top-color: var(--crit); }
.seller-token { font-size: 11px; color: var(--muted); }
.pricing-card th { white-space: normal; min-width: 64px; }
.map-asin {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: none;
}
.map-asin summary,
.map-asin-plain {
  min-height: 0;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 8px 0;
  list-style: none;
}
.map-asin-plain {
  padding-left: 22px;
}
.map-asin summary::-webkit-details-marker {
  display: none;
}
/* A visible expand arrow that turns down when the block is open. */
.map-asin summary::before {
  content: "\25B8";
  color: var(--faint);
  transition: transform 0.15s ease;
}
.map-asin[open] > summary::before {
  transform: rotate(90deg);
}
.map-asin-name {
  color: var(--text);
  font-weight: 500;
}
.map-asin-facts {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.map-asin-under {
  color: var(--crit);
  font-weight: 600;
}
.map-asin-ok {
  color: var(--good);
}
.map-asin-days {
  margin-left: auto;
  color: var(--copper);
  font-size: 13px;
}
.map-asin .chart {
  margin: 8px 0 12px;
}
.map-export {
  margin: 0 0 16px;
}
.map-export-link,
.seller-name {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--copper);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.map-export-link:disabled {
  color: var(--faint);
  text-decoration: none;
  cursor: default;
}
.seller-bars .owner-label .seller-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.seller-bars .owner-track i {
  background: var(--crit);
}
/* keyword panels: share bars beside their percent, a keyword with its tag, the LQS legend */
.share-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.share-cell .stackbar {
  flex: 0 1 160px;
  height: 10px;
}
.keyword-term {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.keyword-card h3 {
  margin: 16px 0 8px;
}

/* ---------- glossary ---------- */
.glossary-list {
  display: grid;
  gap: 4px;
  margin: 0;
}
.glossary-list dt {
  margin-top: 8px;
  font-weight: 600;
}
.glossary-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- product cards and the listing drawer ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.product-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 10px;
  text-align: left;
  background: var(--card);
}
.product-card:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}
.product-image,
.listing-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}
.image-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  color: var(--faint);
  font-size: 12.5px;
}
.product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.35;
}
.product-meta,
.listing-count {
  color: var(--muted);
  font-size: 12.5px;
}
.product-score {
  font-size: 13px;
}
.listing-drawer {
  width: min(760px, calc(100vw - 32px));
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #14151b;
  color: var(--text);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}
.listing-drawer::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.listing-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: #14151b;
  border-bottom: 1px solid var(--border);
}
.listing-head h2 {
  margin: 0;
  font-size: 17px;
}
.listing-body {
  display: grid;
  gap: 16px;
}
.listing-drawer > div:last-child {
  padding: 16px;
}
.listing-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.listing-part h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.listing-title,
.listing-description {
  margin: 0;
  white-space: pre-line;
}
.listing-bullets {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}
.listing-bullets li span {
  display: block;
}
.listing-checklist {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.listing-checklist li {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: baseline;
}
.check-met .check-mark {
  color: var(--good);
}
.check-missed .check-mark {
  color: var(--crit);
}
.check-unknown .check-mark {
  color: var(--faint);
}
@media (max-width: 760px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .listing-drawer {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  .listing-checklist li {
    grid-template-columns: 20px 1fr;
  }
  .listing-checklist .listing-count {
    grid-column: 2;
  }
}

/* Product type groups and persistent portal proposals. */
.product-type-heading { grid-column: 1 / -1; list-style: none; border-bottom: 1px solid var(--line, #d8dde4); padding-top: 1rem; }
.product-type-heading h3 { margin: .25rem 0 .65rem; }
.amazon-detail-link { display: inline-block; padding: .5rem 0; font-size: .85rem; }
.listing-workflow { margin-top: .5rem; border-top: 2px solid #32697a; padding-top: .45rem; }
.listing-workflow > h3 { margin: .15rem 0 .45rem; }
.listing-proposal { border-top: 1px solid var(--line, #d8dde4); margin-top: 1rem; padding: 1rem 0; }
.proposal-editor label, .listing-proposal label { display: block; margin: 1rem 0; font-weight: 600; }
.proposal-editor textarea, .listing-proposal textarea { display: block; box-sizing: border-box; width: 100%; margin-top: .35rem; font: inherit; padding: .65rem; border: 1px solid var(--line, #9aa6b4); border-radius: 3px; }
.proposal-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.listing-workflow button { margin: .35rem .5rem .35rem 0; }
.workflow-message { min-height: 1.5em; }
.workflow-message:empty { display: none; }
.workflow-source { margin: .35rem 0; }
.listing-head-image { flex: 0 0 56px; }
.listing-head-thumbnail { display: block; width: 56px; height: 56px; padding: 4px; }
.listing-head > div:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.listing-head h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.listing-workflow.proposed-source { width: 100%; box-sizing: border-box; }
.listing-two-panels:has(.workflow-view-modes) { display: block; }
.workflow-view-modes { display: flex; gap: .35rem; border-bottom: 1px solid var(--border); margin: .1rem 0 .45rem; }
.workflow-view-modes button { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--text); font: inherit; padding: .4rem .75rem; min-height: 36px; opacity: .84; }
.workflow-view-modes button:hover, .workflow-view-modes button:focus-visible { color: #fff; opacity: 1; }
.workflow-view-modes button[aria-pressed="true"] { border-bottom-color: var(--copper); color: #fff; background: var(--copper-soft); font-weight: 700; opacity: 1; }
.workflow-actions { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; background: var(--panel, #fff); border-top: 2px solid #32697a; box-shadow: 0 -5px 16px #12253422; padding: .55rem .75rem; }
.workflow-actions button { margin: 0; }
.workflow-unsaved { font-weight: 650; color: #86550d; }
.workflow-quality, .workflow-refresh, .workflow-export { overflow-wrap: anywhere; }
.workflow-quality-total { font-weight: 700; margin: .55rem 0; }
.workflow-export { margin: .8rem 0; }
.workflow-export-notice { padding: .6rem; border-left: 3px solid #32697a; background: var(--panel-2, #eef2f5); }
.workflow-reconciliation { font-weight: 700; }
.workflow-observed-badge { display: inline-block; padding: .3rem .55rem; border: 1px solid var(--good); color: #b9efd8; background: #183127; border-radius: 4px; font-weight: 700; }
.workflow-observed-badge[hidden] { display: none; }
.workflow-comparison-head { margin: .35rem .75rem; }
.listing-workflow .listing-diff { margin: .2rem 0; }
.listing-workflow .listing-diff > h3 { display: none; }
.listing-workflow .listing-diff-summary { padding: .45rem .75rem; }
.listing-workflow .listing-diff-field { padding: .55rem .75rem; }
.workflow-preview-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.workflow-preview-pair > section { min-width: 0; }
.workflow-preview-pair .pdp-lead { grid-template-columns: 1fr; }
.workflow-preview-pair .pdp-main-image { height: 230px; }
@media (max-width: 800px) { .workflow-preview-pair { grid-template-columns: 1fr; } .workflow-actions button { flex: 1 1 9rem; } }

/* Three sources stay visually distinct: observed PDP, seller contribution, proposed portal copy. */
.listing-drawer:has(.listing-three-sources) { width: min(96vw, 1500px); max-width: 1500px; }
.listing-three-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.3rem; align-items: start; }
.comparison-source { min-width: 0; padding: 1rem; border: 1px solid var(--line, #d8dde4); border-top: 3px solid #32697a; }
.seller-source { border-top-color: #a57b35; }
.proposed-source { border-top-color: #4d7957; margin-top: 0; }
.listing-three-sources .listing-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.listing-three-sources .listing-image { max-height: 180px; }
.listing-three-sources .listing-checklist li { display: flex; flex-wrap: wrap; }
.listing-facts, .listing-recommendations { padding-top: 1.5rem; margin-top: 1.5rem; border-top: 1px solid var(--line, #d8dde4); }
.product-fact, .listing-recommendation { padding: 1rem 0; border-bottom: 1px solid var(--line, #d8dde4); }
.fact-editor label, .seller-source label { display: block; font-weight: 600; margin: .8rem 0; }
.fact-editor textarea, .fact-editor input, .seller-source select { display: block; width: 100%; box-sizing: border-box; font: inherit; padding: .65rem; margin-top: .35rem; }
.source-digest { overflow-wrap: anywhere; font-size: .75rem; }
.recommendation-patch { border-left: 3px solid #4d7957; padding-left: 1rem; }
.comparison-values { padding-left: 1.3rem; }
@media (max-width: 1100px) { .listing-three-sources { grid-template-columns: 1fr; } }

/* Visual comparison: the captured PDP and selected proposed state share the same renderer. */
/* The drawer opens at its final size: the read view for brand readers and the public, the wider workspace for editors. */
.listing-drawer-edit { width: min(96vw, 1500px); max-width: 1500px; }
.listing-two-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.listing-two-panels .listing-gallery { display: block; }
.pdp-hero { background: #fff; border: 1px solid var(--line, #d8dde4); padding: .8rem; text-align: center; }
.pdp-main-image { display: block; width: 100%; height: 330px; max-height: none; object-fit: contain; }
.pdp-thumbnails { display: flex; gap: .5rem; flex-wrap: wrap; padding: 0; margin: .7rem 0 1.2rem; list-style: none; }
.pdp-thumbnails li { flex: 0 1 100px; min-width: 0; }
.pdp-thumbnail { display: block; width: 100%; padding: .3rem; border: 1px solid var(--line, #d8dde4); background: #fff; }
.pdp-thumbnail[aria-pressed="true"] { outline: 2px solid #32697a; }
.pdp-thumb-image { width: 100%; height: 75px; object-fit: contain; }
.pdp-image-action { width: 100%; padding: .2rem; font-size: .7rem; line-height: 1.2; }
.pdp-title { font-size: 1.25rem; line-height: 1.45; font-weight: 650; overflow-wrap: anywhere; }
.pdp-bullets { padding-left: 1.4rem; }
.pdp-bullets li { padding: .35rem 0; }
.pdp-empty { color: var(--muted, #596576); padding: .75rem; background: #eef2f5; }
.preview-invalid-image { overflow-wrap: anywhere; font-size: .8rem; }
.proposal-preview-selector { display: block; width: 100%; box-sizing: border-box; font: inherit; padding: .6rem; margin: .5rem 0 1rem; }
.preview-revision { overflow-wrap: anywhere; }
.seller-secondary { padding: 1rem; margin-top: 1.3rem; border: 1px solid var(--line, #d8dde4); }
.proposal-edit, .proposal-new { border-top: 1px solid var(--line, #d8dde4); padding-top: .75rem; margin-top: 1rem; }
@media (max-width: 800px) { .listing-two-panels { grid-template-columns: 1fr; } .pdp-main-image { height: 270px; } }
.pdp-change-summary { padding: .65rem; margin-bottom: .8rem; background: var(--panel-2); color: var(--text); border-left: 2px solid var(--good); }
.pdp-change-badge { display: inline-block; margin-right: .4rem; padding: .2rem .4rem; border-left: 2px solid var(--good); color: var(--text); font-size: .78rem; }
.pdp-preview-toolbar { display: grid; grid-template-columns: minmax(250px, 1fr) 1fr; column-gap: 1rem; align-items: center; margin-bottom: .8rem; }
.pdp-preview-toolbar { display: block; margin-bottom: .15rem; }
.pdp-preview-toolbar .proposal-preview-selector { margin: .2rem 0 .35rem; padding: .4rem .6rem; min-height: 36px; }
.pdp-preview-toolbar .workflow-message { grid-column: 1 / -1; margin: 0; }
.listing-two-panels .preview-revision { min-height: 0; margin: .35rem 0; }
@media (max-width: 800px) { .pdp-preview-toolbar { display: block; } .listing-two-panels .preview-revision { min-height: 0; } }

.pdp-change-summary .metadata { color: var(--muted); }
.pdp-image-controls { display: inline-block; width: 120px; vertical-align: top; margin: .5rem; }
.pdp-thumbnail > span { display: inline-block; background: var(--panel-2); color: var(--text); padding: .15rem .45rem; }
.listing-policy { margin: 1rem 0; padding: 1rem; border: 1px solid var(--border); background: var(--panel-2); }
.policy-status { font-weight: 700; border-left: 3px solid var(--good); padding-left: .6rem; }
.policy-blocked, .policy-block { border-left: 3px solid var(--bad, #df6f67); padding: .4rem .7rem; }
.policy-required, .policy-review { border-left: 3px solid var(--warn, #e2b568); padding: .4rem .7rem; }
.policy-finding { margin: .7rem 0; padding: .6rem; }
.policy-owner-review label { display: block; margin: .7rem 0; font-weight: 600; }
.policy-owner-review textarea, .policy-owner-review select { display: block; width: 100%; box-sizing: border-box; padding: .5rem; font: inherit; margin: .35rem 0; }
.policy-owner-review input[type="checkbox"] { margin-left: .7rem; }
.policy-owner-review input[type="number"] { margin-left: .6rem; max-width: 75px; }

.policy-review-image { display: block; width: 150px; height: 180px; object-fit: contain; background: #fff; margin: .5rem 0; }

/* Products: a bounded catalog rail and consistent identity, independent of capture completeness. */
.product-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(230px, calc((100% - 64px) / 5))), 1fr)); gap: 16px; margin-top: 24px; }
.product-type-heading { margin: 20px 0 2px; padding-top: 8px; }
.product-type-heading:first-child { margin-top: 0; }
.product-card-shell { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--card); }
.product-card { flex: 1; height: auto; padding: 12px; border: 0; border-radius: 0; gap: 8px; }
.product-image { height: 190px; aspect-ratio: auto; flex-shrink: 0; padding: 12px; box-sizing: border-box; }
.product-title { -webkit-line-clamp: 3; min-height: 55px; font-size: 14px; line-height: 1.35; }
.product-part { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.product-score { font-size: 12px; color: var(--muted); }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.product-open { font: inherit; font-size: 12px; padding: 6px 9px; }
.product-card-footer .amazon-detail-link { font-size: 12px; white-space: nowrap; }
.product-card-shell > .metadata { margin: 0; padding: 0 12px 10px; font-size: 11px; }
.product-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.product-filters select { min-width: 210px; }
.product-filters input { width: min(420px, 100%); flex: 0 1 420px; }
.listing-head { z-index: 2; }
.listing-head h2 { font-size: 18px; line-height: 1.35; }
.listing-identity { margin: 5px 0 0; font-size: 12px; }
.listing-drawer-read { width: min(1100px, calc(100vw - 32px)); max-width: 1100px; }
/* Product images on a dark card: a fixed, rounded white tray; no usable image shows the product's initials. */
.image-tray { display: flex; align-items: center; justify-content: center; box-sizing: border-box; overflow: hidden; border-radius: 6px; background: #fff; }
.image-tray img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-initials { color: #596576; font-size: 28px; font-weight: 700; letter-spacing: .04em; }
.listing-head-thumbnail .image-initials { font-size: 15px; }
/* While the listing loads: grey blocks in its shape. */
.listing-skeleton { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); grid-auto-rows: 14px; gap: 14px 24px; margin-top: 16px; }
.skeleton-block { border-radius: 4px; background: var(--panel-2); }
.skeleton-image { grid-row: span 12; }
.skeleton-line:nth-child(odd) { width: 70%; }
.sku-product { display: grid; gap: 2px; min-width: 0; }
.sku-asin { font-size: 11px; color: var(--muted); }
.observed-only .listing-body { display: block; }
.pdp-lead { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 24px; align-items: start; }
.pdp-gallery { min-width: 0; margin: 0; }
.pdp-overview { min-width: 0; }
.pdp-gallery .pdp-main-image { height: 300px; }
.pdp-thumbnails li { flex: 0 0 48px; }
.pdp-thumb-image { height: 48px; }
.pdp-thumbnails { gap: 6px; margin: 10px 0 20px; }
.listing-two-panels .pdp-lead { grid-template-columns: minmax(180px, .8fr) minmax(0, 1fr); gap: 16px; }
.pdp-empty { background: var(--panel-2); color: var(--muted); }
.workspace-product-cta { display: inline-block; margin-top: 18px; padding: 10px 14px; border: 1px solid var(--copper); border-radius: 5px; color: var(--text); }
@media (max-width: 1100px) { .listing-two-panels .pdp-lead { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .pdp-lead { grid-template-columns: 1fr; } .product-filters select, .product-filters input { width: 100%; flex-basis: 100%; } .product-image { height: 180px; } }

.product-filters select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel-2); color: var(--text); font: inherit; }
.synthetic-fixture-banner { padding: 10px; color: var(--text); background: var(--panel-2); font-size: 12px; }
.product-filters { justify-content: flex-start; }

.card-continuation { border-top: 0; margin-top: -12px; }

.freshness-list { list-style: none; padding: 0; }
.freshness-list li { display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.freshness-list li > span:first-child { flex: 1; min-width: 140px; }
.report-skeleton { padding: 20px 0; }
.skeleton-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.skeleton-tiles i, .skeleton-chart { display: block; border-radius: 12px; background: linear-gradient(100deg,var(--border),var(--muted),var(--border)); background-size: 200% 100%; animation: report-shimmer 2s ease-in-out infinite; opacity: .3; }
.skeleton-tiles i { height: 105px; }
.skeleton-chart { height: 260px; margin-top: 20px; }
@keyframes report-shimmer { to { background-position: -200% 0; } }
.glossary-list { grid-template-columns: 1fr; }
@media (max-width: 760px) { .skeleton-tiles { grid-template-columns: repeat(2, 1fr); } .chart-trend .chart-label { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .report-skeleton * { animation: none; } }
.brand-field:has(#tenant[hidden]) label { display: none; }
#brand-label { font-family: var(--font-serif); font-size: 18px; }

/* Stable wrappers let the phone view selector retain identity as periods change. */
.period-section { display: contents; }
.period-coverage { margin: 0; }
.shared-period-bar .period-pick select { max-width: 100%; }
@media (max-width: 760px) {
  .period-section.mobile-section-inactive { display: none; }
  .shared-period-bar .period-modes { display: flex; flex-wrap: wrap; }
  .shared-period-bar .period-modes button { min-height: 44px; }
  .shared-period-bar .period-pick { flex: 1 1 140px; min-width: 0; }
  .shared-period-bar .period-pick select { min-width: 0; flex: 1; min-height: 44px; }
}

/* ASINs and product labels open the exact Amazon PDP. */
.asin-link {text-decoration: underline; text-underline-offset: .18em;}
.asin-link:hover {color: var(--s-copper);}
.asin-link:focus-visible {outline: 2px solid var(--s-copper); outline-offset: 3px;}

.creator-review-editor { margin: 1rem 0; padding: 1.2rem; border: 1px solid var(--border); border-left: 3px solid var(--s-copper); border-radius: 6px; }
.creator-review-editor form { display: grid; gap: .8rem; max-width: 48rem; }
.creator-review-editor label { display: grid; gap: .35rem; }
.creator-review-editor textarea, .creator-review-editor input { width: 100%; box-sizing: border-box; padding: .65rem; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; }
.creator-review-editor textarea { resize: vertical; }
.creator-review-editor [role="status"] { margin: 0; color: var(--s-copper); }
.creator-review-editor fieldset { display: grid; gap: .65rem; margin: 1rem 0; border: 1px solid var(--border); }
.creator-review-editor summary { cursor: pointer; }
.people-invite {
  margin-top: 16px;
}
