/*
 * Chart styles — board-2: the plot is printed directly on the solder slab,
 * the way silkscreen is printed on a board. No panel, no stat strip, no
 * in-figure controls — the page's one filter form (styles.css) drives this
 * figure, and the slab's lead sentence is the numbers.
 * Everything the design round might repaint lives in the custom properties
 * below or in the sc-* class hooks; nothing here hardcodes a second palette
 * — the page's :root tokens are the palette. The baked SVG carries fallback
 * presentation attributes; these rules are author-level and therefore win
 * wherever this file loads.
 */

.sc-chart {
  /* palette — the page's :root tokens (board-2) are the palette: --sc-silk,
     --sc-plate, --sc-ink, --sc-ground inherit straight from there. Only two
     live here: the board colour (an alias of the page's solder green — the
     median casing and the sparse dot ring) and trace green, which only the
     chart uses. */
  --sc-board: var(--sc-solder, #0e3a2c);
  --sc-trace: #bfcfca;
  /* for-sale yellow — the live-listing dots only. Not the median's gold:
     brighter and more lemon than amber, so the two yellows never blur
     together on the board (owner, Nov 7) */
  --sc-for-sale: #ffe24d;
  /* auction azure — live auctions at their bid (owner, Nov 14). Blue, so it
     reads apart from the white sold dots, the gold line and the for-sale
     yellow, colour-blind views included (theme.ts has the numbers) */
  --sc-auction: #4da8ff;
  /* type — Barlow per the board concept; page may override the family */
  --sc-chart-font: "Barlow Condensed", "Archivo Narrow", system-ui, sans-serif;

  margin: 0;
  min-width: 0;
  font-family: var(--sc-chart-font);
  /* The figure lives on the dark hero slab, so its own text (direct labels,
     noscript line) is silkscreen-on-green, never the page's dark ink. */
  color: var(--sc-silk);
}

/* ---- the two baked sizes: one figure, a media query picks the pair ---- */
.sc-svg {
  display: none;
  width: 100%;
  height: auto;
}
.sc-svg-m {
  display: block;
}
@media (min-width: 680px) {
  .sc-svg-m {
    display: none;
  }
  .sc-svg-d {
    display: block;
  }
  /* A one-layout bake (the home strip's slides 2-5 carry only the phone
     picture, marked with both size classes) keeps the desktop bake's shape
     on a wide screen. The strip takes its height from its tallest slide, so
     a 393x300 picture grown to the content width would leave a gap under
     every other slide. The browser's recompute replaces it. */
  .sc-svg.sc-svg-m.sc-svg-d {
    aspect-ratio: 1140 / 440;
  }
}

.sc-svg text {
  font-family: var(--sc-chart-font);
}

/* Marks: CSS beats SVG presentation attributes, so these rules restate the
 * baked fallback colours through tokens. The default draw is the sold cloud
 * (quiet dots, opacity comes from the mark), the middle-half band and the
 * gold median; bid-to, excluded and ask marks are opt-in (plot.ts). */
.sc-svg .sc-dots-sold path {
  fill: var(--sc-silk);
  stroke: none;
}
/* the compact sold cloud (merge.ts): each dot is a round-capped zero-length
   stroke, so the colour goes on the stroke; width and opacity are attributes */
.sc-svg .sc-dots-sold path.sc-pts {
  fill: none;
  stroke: var(--sc-silk);
}
/* the rolling middle half of sales: a brighter wash of the dot colour —
   the band is where the cloud is thickest; gold stays on the line alone */
.sc-svg .sc-band path {
  fill: var(--sc-silk);
  fill-opacity: 0.16;
  stroke: none;
}
.sc-svg .sc-dots-bid path {
  stroke: var(--sc-silk);
  fill: none;
}
.sc-svg .sc-dots-excl path {
  stroke: var(--sc-trace);
  fill: none;
}
/* hidden Best Offers at their listed price: a hollow ring in the SOLD colour
   (the spec keeps dots to one colour, so shape carries the difference) */
.sc-svg .sc-dots-listed path {
  stroke: var(--sc-silk);
  fill: none;
}
/* listings for sale now: filled for-sale-yellow dots (owner, Nov 7). They
   count toward nothing; the colour is a reader signal, not a price claim. */
.sc-svg .sc-asks path {
  fill: var(--sc-for-sale);
  stroke: none;
}
/* live auctions: the same dot in auction azure. The group keeps sc-asks, so
   hit tests and the More toggle treat it as for sale; the bid prints no
   price label (plot.ts) */
.sc-svg .sc-asks.sc-asks-auction path {
  fill: var(--sc-auction);
}
/* the median: gold line over a slab-coloured casing so it stays legible
   wherever it crosses a dense cloud of white dots */
.sc-svg .sc-median-casing path {
  stroke: var(--sc-board);
}
.sc-svg .sc-median path {
  stroke: var(--sc-plate);
}
.sc-svg .sc-retail path {
  stroke: var(--sc-silk);
}
/* family pages: the all-types median is the gold line; module types are the
   thin dashed silkscreen context behind it (bake only, no client redraw) */
.sc-svg .sc-fam-median path {
  stroke: var(--sc-plate);
}
.sc-svg .sc-fam-series path {
  stroke: var(--sc-silk);
}
.sc-svg .sc-ask-labels text {
  fill: var(--sc-silk);
}
.sc-svg .sc-empty text {
  fill: var(--sc-silk);
}

.sc-svg .sc-axis text {
  fill: var(--sc-trace);
  font-size: 11px; /* desktop bake; the 360 bake is displayed ~1:1 */
}
.sc-svg-m .sc-axis text {
  font-size: 10.5px;
}
.sc-svg .sc-axis-y text {
  text-anchor: end;
}
.sc-svg .sc-axis line,
.sc-svg .sc-axis-y line {
  stroke: var(--sc-silk);
  stroke-opacity: 0.35;
}
.sc-svg g[aria-label="y-grid"] line {
  stroke: var(--sc-silk);
  stroke-opacity: 0.13;
}

/* ---- direct labels: lines name themselves at their ends ---- */
/* Text never wears the data colour: labels ride the secondary trace, the
   mark beside them carries the identity. The labels sit INSIDE the plot now
   (the right gutter was plot width spent on two words), so a board-coloured
   halo — stroke painted under the fill — keeps the letters clean over dots
   without boxing them. */
.sc-svg .sc-label text {
  fill: var(--sc-trace);
  paint-order: stroke fill;
  stroke: var(--sc-board);
  stroke-width: 3px;
  stroke-linejoin: round;
}
/* The typical-price end label is the exception to "text never wears the
   data colour": it IS the line's number, in the line's gold, so the two
   read as one thing (owner, Nov 7). The halo stays. */
.sc-svg .sc-price-label text {
  fill: var(--sc-plate);
}

.sc-plot:focus-visible {
  outline: 2px solid var(--sc-plate);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- tooltip ---- */
.sc-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: var(--sc-ink);
  color: var(--sc-silk);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  white-space: nowrap;
  transform: translateY(-100%);
}
.sc-tip-kbd {
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
}

.sc-noscript {
  color: var(--sc-trace);
  font-size: 13px;
  padding: 6px 2px 2px;
  margin: 0;
}

/* ---- the key: names the marks a reader cannot guess (sold dot, listed
   ring, for-sale dot) ---- Small and quiet, under the plot, in the figure
   so it is there with JS off. Shown while any named mark is in view (bake
   sets it; chart/main.ts re-checks each item after every filter). */
.sc-key {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  padding: 8px 2px 0;
  margin: 0;
  color: var(--sc-trace);
  font-size: 12px;
  line-height: 1.3;
}
.sc-key[hidden] {
  display: none;
}
.sc-key-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* a mark that is not in this view drops out of the key (chart/main.ts
   toggles the attribute after every render) */
.sc-key-item[hidden] {
  display: none;
}
.sc-key-swatch {
  width: 11px;
  height: 11px;
  flex: none;
}
.sc-key-swatch circle {
  stroke: var(--sc-silk);
  fill: none;
}
.sc-key-dot circle {
  fill: var(--sc-silk);
  fill-opacity: 0.55;
  stroke: none;
}
.sc-key-ring circle {
  stroke-width: 1.5;
}
.sc-key-for circle {
  fill: var(--sc-for-sale);
  stroke: none;
}
.sc-key-auction circle {
  fill: var(--sc-auction);
  stroke: none;
}
