/* ≠01 · what only this piece needs: the trade's controls, the crowd's layout, and the marks of its charts. */

/* ---------- chart marks ---------- */

.chart .obs { fill: none; stroke: var(--tiza); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .fit { fill: none; stroke: var(--chalk-dim); stroke-width: 1.25; opacity: 0.8; }
.chart .err line { stroke: var(--chalk-dim); stroke-width: 1; }
.chart .dot { fill: var(--tiza); stroke: var(--pizarra); stroke-width: 2; }
.chart .you-line { stroke: var(--chalk-dim); stroke-width: 1.5; }
.chart .you-line.on { stroke: var(--bermellon); }
.chart .mark circle { fill: var(--bermellon); stroke: var(--pizarra); stroke-width: 2; }
.board .chart .ref { stroke: var(--board-low); }
.paper .chart .ref { stroke: var(--pizarra-clara); stroke-width: 1; shape-rendering: crispEdges; }

.chart .bar { fill: var(--pizarra-media); outline: none; }
.chart .bar.lead { fill: var(--pizarra); }
.chart .bar:focus-visible { stroke: var(--pizarra); stroke-width: 2; }
.chart .trait { font-family: var(--serif); font-size: 15.5px; font-variant-numeric: normal; fill: var(--pizarra-media); }
.chart .trait.lead { fill: var(--pizarra); font-weight: 500; }
.chart .trend { fill: none; stroke: var(--pizarra-media); stroke-width: 2; stroke-linejoin: round; }
.chart .dot-ink { fill: var(--pizarra-media); stroke: var(--tiza); stroke-width: 2; }
.chart .dot-ink.lead { fill: var(--pizarra); }
.chart .focus-ring { fill: none; stroke: var(--pizarra); stroke-width: 2; pointer-events: none; }
.chart svg:focus-visible { outline: 2px solid var(--pizarra); outline-offset: 6px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
  font: 400 0.8125rem/1.3 var(--mono);
  color: var(--chalk-dim);
}
.legend[hidden] { display: none; }
.legend li { display: flex; align-items: center; gap: 0.55rem; }
.legend svg { width: 22px; height: 12px; flex: none; overflow: visible; }

.keys { margin: 0.75rem 0 0; font: 400 0.75rem/1.4 var(--mono); color: var(--pizarra-media); }
.nosig { margin: 1rem 0 0; max-width: 44rem; font-size: 1rem; line-height: 1.5; color: var(--pizarra-media); }
.nosig b { font-weight: 500; color: var(--pizarra); }

/* ---------- plate 1 · the trade ---------- */

.trade-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
}
.trade-price {
  min-width: 7.5ch;
  font: 500 clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem)/1 var(--mono);
  letter-spacing: -0.02em;
}
.trade-price-label { display: block; margin-bottom: 0.35rem; font: 400 0.8125rem/1 var(--mono); color: var(--chalk-dim); letter-spacing: 0; }
.trade-go { margin-left: auto; }
.trade-result {
  margin: 1.25rem 0 0;
  max-width: 34em;
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.6rem);
  line-height: 1.35;
  text-wrap: pretty;
}
.trade-result:empty { display: none; }
.trade-result strong { font-weight: 600; }
.trade-after { margin: 0.6rem 0 0; color: var(--chalk-dim); font-size: 1.0625rem; }
.trade-after[hidden] { display: none; }

/* ---------- plate 2 · a hundred users ---------- */

.crowd {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.crowd-stage {
  --hairline-plate: #12261f;
  --hairline-hi: #f2401f;
  --hairline-edge: #a9b5ae;
  --hairline-mid: #4a5c54;
  --hairline-lo: #3b5248;
  max-width: 44rem;
  /* The figure sits in the middle of its 5:4 stage: trim the empty bands above and below. */
  margin-block: -7%;
}
.crowd-label { margin: 0; font: 400 0.8125rem/1.3 var(--mono); color: var(--chalk-dim); }
.crowd-price {
  display: block;
  margin: 0.4rem 0 0.25rem;
  font: 500 clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem)/1 var(--mono);
  letter-spacing: -0.025em;
}
.crowd-stops { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.crowd-stops .btn { min-height: 40px; padding: 0.4rem 0.75rem; font-family: var(--mono); font-size: 0.8125rem; font-weight: 500; }
.crowd-status { margin: 1.25rem 0 0; font-size: 1.25rem; line-height: 1.4; text-wrap: pretty; min-height: 2.8em; }
.crowd-status strong { font-weight: 600; }
.crowd-who { margin: 0.9rem 0 0; min-height: 2.6em; font: 400 0.8125rem/1.45 var(--mono); color: var(--chalk-dim); }
.crowd-who.on { color: var(--tiza); }

/* Data plates with few marks put their head beside the chart. */
@media (min-width: 900px) {
  .sheet.split { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(0, 2.1fr); column-gap: clamp(2rem, 4vw, 4rem); align-items: start; }
  .sheet.split > .plate-head { margin-bottom: 0; }
  .sheet.split > .plate-table { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  .crowd { grid-template-columns: minmax(0, 1fr); }
  .trade-go { margin-left: 0; }
}
