/* grepped.ai/market: the market map. Light is the marketplace's white (Erik, 6 Nov 2026: one look); dark is its own selected steps.
   Kind colours: the validated 8-slot categorical order, one slot per kind of data, always stacked in slot order. */
.viz-root {
  color-scheme: light;
  --page: #ffffff;
  --surface-1: #ffffff;
  --text-primary: #222222;
  --text-secondary: #6a6a6a;
  --text-muted: #8a8a8a;
  --grid: #ebebeb;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --track: #f7f7f7;
  --accent: #f2c230;
  --wash: rgba(242, 194, 48, 0.16);
  /* kinds, slot order */
  --k-email: #2a78d6; --k-av: #eb6834; --k-chat: #1baf7a; --k-docs: #eda100;
  --k-cad: #e87ba4; --k-records: #008300; --k-code: #6250d6; --k-tickets: #e34948; --k-other: #b9b8b0;
  /* sequential blue, ordinal steps 250 -> 700 (low -> high) */
  --s1: #86b6ef; --s2: #5598e7; --s3: #2a78d6; --s4: #1c5cab; --s5: #104281; --s6: #0d366b;
  --s-none: #e3e2dc;
  --on-s-light: #0b0b0b; --on-s-dark: #ffffff;
  --bench: #898781;
  --corp: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .viz-root {
    color-scheme: dark;
    --page: #0d0d0d; --surface-1: #1a1a19; --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10); --track: #242422; --wash: rgba(242, 194, 48, 0.10);
    --k-email: #3987e5; --k-av: #d95926; --k-chat: #199e70; --k-docs: #c98500;
    --k-cad: #d55181; --k-records: #008300; --k-code: #9085e9; --k-tickets: #e66767; --k-other: #5a5955;
    --s1: #184f95; --s2: #1c5cab; --s3: #256abf; --s4: #3987e5; --s5: #6da7ec; --s6: #b7d3f6;
    --s-none: #2a2a28; --on-s-light: #0b0b0b; --on-s-dark: #ffffff;
    --bench: #898781; --corp: #3987e5;
  }
}
:root[data-theme="dark"] .viz-root {
  color-scheme: dark;
  --page: #0d0d0d; --surface-1: #1a1a19; --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10); --track: #242422; --wash: rgba(242, 194, 48, 0.10);
  --k-email: #3987e5; --k-av: #d95926; --k-chat: #199e70; --k-docs: #c98500;
  --k-cad: #d55181; --k-records: #008300; --k-code: #9085e9; --k-tickets: #e66767; --k-other: #5a5955;
  --s1: #184f95; --s2: #1c5cab; --s3: #256abf; --s4: #3987e5; --s5: #6da7ec; --s6: #b7d3f6;
  --s-none: #2a2a28; --on-s-light: #0b0b0b; --on-s-dark: #ffffff;
  --bench: #898781; --corp: #3987e5;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #ffffff; }
:root[data-theme="dark"] body { background: #0d0d0d; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) body { background: #0d0d0d; } }
.viz-root { background: var(--page); color: var(--text-primary); font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.5; min-height: 100vh; padding-bottom: 64px; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)); }
.mono { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
a { color: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; height: 68px; border-bottom: 1px solid var(--border); }
.logo img { height: 22px; display: block; }
:root[data-theme="dark"] .logo img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .logo img { filter: invert(1); } }
.top nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.top nav a { text-decoration: none; color: var(--text-secondary); }
.top nav a[aria-current] { color: var(--text-primary); font-weight: 600; }
.theme { background: none; border: 1px solid var(--border); color: var(--text-secondary); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }

.hero { padding: 44px 0 28px; }
.eyebrow { color: var(--text-secondary); margin: 0; display: flex; align-items: center; gap: 10px; }
.eyebrow .dot { width: 7px; height: 7px; background: var(--accent); display: inline-block; }
h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.02; letter-spacing: -.03em; font-weight: 700; margin: 14px 0 12px; max-width: 20ch; text-wrap: balance; }
.dek { color: var(--text-secondary); font-size: 17px; max-width: 62ch; margin: 0 0 28px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--text-primary); }
.kpi { padding: 16px 18px 6px 0; border-right: 1px solid var(--border); padding-left: 18px; }
.kpi:first-child { padding-left: 0; }
.kpi:last-child { border-right: 0; }
.kpi b { display: block; font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi span { color: var(--text-secondary); font-size: 13px; display: block; margin-top: 4px; max-width: 24ch; }
.kpis.small { grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); margin-bottom: 18px; }
.kpis.small .kpi b { font-size: 26px; }

.panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px 18px; margin-top: 20px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
h2 { font-size: 20px; letter-spacing: -.01em; margin: 0; font-weight: 600; }
h3 { color: var(--text-muted); margin: 0 0 10px; font-weight: 500; }
.sub { color: var(--text-secondary); margin: 4px 0 0; font-size: 14px; max-width: 70ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.grid2 > .panel { margin-top: 20px; }
.grid2.inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 36px; }

.controls { display: flex; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg-label { color: var(--text-muted); padding: 0 8px 0 6px; }
.sel { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; padding: 3px 3px 3px 4px; font-size: 13px; }
.sel select { appearance: none; -webkit-appearance: none; border: 0; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 500; color: var(--surface-1); background: var(--text-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center; padding: 5px 26px 5px 11px; cursor: pointer; }
.sel select:focus-visible { outline: 2px solid var(--s3); outline-offset: 2px; }
.seg button { border: 0; background: none; color: var(--text-secondary); font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--text-primary); color: var(--surface-1); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips button { border: 1px solid var(--border); background: none; color: var(--text-secondary); font: inherit; font-size: 13px; padding: 4px 11px; border-radius: 6px; cursor: pointer; }
.chips button[aria-checked="true"] { border-color: var(--text-primary); color: var(--text-primary); font-weight: 500; }
.chips button i { font-style: normal; color: var(--text-muted); margin-left: 4px; font-variant-numeric: tabular-nums; }

.map { width: 100%; height: 640px; position: relative; }
.map svg, #mix svg, #years svg, #bench svg, #price-hist svg, #price-cat svg { display: block; width: 100%; overflow: visible; }
.map .tile { cursor: pointer; }
.map .tile:hover rect, .map .tile.hl rect { stroke: var(--text-primary); stroke-width: 2; }
.map-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--text-secondary); font-size: 12.5px; }
.legend .sw { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .ramp { display: inline-flex; gap: 2px; }
.legend .ramp i { width: 22px; height: 10px; border-radius: 2px; display: inline-block; }
.legend.kinds { margin-bottom: 14px; }

.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin-top: 10px; }
.tablewrap { margin-top: 12px; max-height: 360px; overflow: auto; border-top: 1px solid var(--grid); }
.tablewrap table { border-collapse: collapse; width: 100%; font-size: 13px; }
.tablewrap th, .tablewrap td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--grid); }
.tablewrap td.num, .tablewrap th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap th { color: var(--text-muted); font-weight: 500; position: sticky; top: 0; background: var(--surface-1); }

.callout { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; margin-top: 14px; color: var(--text-secondary); font-size: 14px; }
.callout b { color: var(--text-primary); }
.note { color: var(--text-muted); font-size: 12.5px; margin: 10px 0 0; }
.foot { color: var(--text-muted); margin-top: 28px; text-transform: none; letter-spacing: 0; font-size: 12px; }

svg text { font-family: Geist, system-ui, sans-serif; }
svg .tick { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg .lab { fill: var(--text-secondary); font-size: 12.5px; }
svg .lab-strong { fill: var(--text-primary); font-size: 13px; font-weight: 600; }
svg .val { fill: var(--text-primary); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
svg .hit { fill: transparent; cursor: default; }
svg .seg-r:hover, svg .bar:hover { opacity: .85; }

.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14); border-radius: 10px; padding: 10px 12px; font-size: 13px; max-width: 320px; line-height: 1.4; }
.tip .t { font-weight: 600; margin-bottom: 2px; }
.tip .m { color: var(--text-secondary); font-size: 12px; }
.tip .row { display: flex; justify-content: space-between; gap: 16px; margin-top: 3px; }
.tip .row span:first-child { color: var(--text-secondary); }
.tip .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }
.tip .mixbar { display: flex; gap: 2px; height: 8px; margin: 8px 0 4px; }
.tip .mixbar i { display: block; height: 8px; border-radius: 2px; }
.tip .sw { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; font-size: 11.5px; color: var(--text-secondary); }
.tip .sw i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-right: 0; padding-left: 0; border-bottom: 1px solid var(--border); }
  .grid2, .grid2.inner { grid-template-columns: minmax(0, 1fr); }
  .kpis.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map { height: 760px; }
  .panel { padding: 18px 16px 14px; }
}
@media (forced-colors: active) { .map .tile rect { stroke: CanvasText; } }
@media (max-width: 560px) {
  .logo img { height: 17px; }
  .top nav { gap: 12px; font-size: 13px; white-space: nowrap; }
  .top nav a:first-child { display: none; }
}
/* Compact, light-only layout (Oct 31): three small histograms in a row, two even bar lists below. */
.hero { padding: 28px 0 18px; }
h1 { font-size: clamp(30px, 4vw, 44px); margin: 10px 0 18px; }
.kpi { padding-top: 12px; }
.kpi b { font-size: 28px; }
.panel { padding: 18px 20px 14px; margin-top: 16px; }
.panel > h2 { margin: 0; }
.panel > .sub { margin: 2px 0 12px; }
.map { height: 580px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid3 > .panel, .grid2 > .panel { margin-top: 16px; display: flex; flex-direction: column; }
.grid3 .callout, .grid2.even .callout { margin-top: auto; padding-top: 2px; }
.grid3 .callout { font-size: 13px; }
.grid2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid2.even .legend { margin-bottom: 10px; }
.grid2.even #supply, .grid2.even #depth { margin-bottom: 12px; }
@media (max-width: 900px) {
  .grid3, .grid2.even { grid-template-columns: minmax(0, 1fr); }
  .map { height: 700px; }
}

/* Hold the headline figures' space while data.json loads, so the map below doesn't jump down. */
#kpis:empty { min-height: 74px; }
@media (max-width: 900px) { #kpis:empty { min-height: 221px; } }
