/* Market map: one dot per stock on a white board, sector blocks led by big condensed counts.
   Tonight's event groups are the only colour; everything else stays ink, paper and rule. */
:root {
  --map-high: var(--color-up);
  --map-low: var(--color-down);
  --map-mover: oklch(50% 0.16 255);
  --map-pullback: oklch(58% 0.13 75);
  --map-breakout: oklch(47% 0.17 310);
  --map-none: var(--color-paper-3);
  --map-context: oklch(81% 0.018 250);
  --dot: 10px;
  --dot-gap: 6px;
}

.map-page main { max-width: var(--container); margin-inline: auto; padding: 40px 32px 64px; }
.map-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px; margin-bottom: 18px; }
.map-head h1 {
  max-width: none; color: var(--color-ink); font: 900 clamp(3rem, 5.2vw, 5.5rem)/0.85 var(--font-display);
  letter-spacing: -0.03em; text-transform: uppercase;
}
.map-head .day { color: var(--color-accent-2); }
.tally { color: var(--color-ink-2); font: 400 var(--text-sm)/1.3 var(--font-outlier); }
.tally b { color: var(--color-ink); font-weight: 500; }
.tally .sep { margin-inline: 6px; color: var(--color-muted); }
.map-note {
  flex-basis: 100%; width: fit-content; max-width: none; padding: 6px 10px; color: var(--color-ink);
  background: oklch(95% 0.04 75); border-left: 4px solid var(--map-pullback); font-size: var(--text-sm);
}

/* The legend is the summary: one line per event group with its count. */
.groups {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; margin: 0 0 28px; padding: 12px 16px;
  list-style: none; background: var(--color-sheet); border: 1px solid var(--color-rule-2); box-shadow: 3px 3px 0 var(--color-paper-3);
}
.groups li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.groups .n { color: var(--color-ink); font: 900 var(--text-2xl)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.groups .what { color: var(--color-ink); font: 700 var(--text-sm)/1.2 var(--font-body); }
.groups .from { color: var(--color-muted); font: 400 var(--text-xs) var(--font-outlier); }
.groups .off .n, .groups .off .what { color: var(--color-muted); }
.groups .key { padding-left: 18px; border-left: 1px solid var(--color-rule); }
.groups .key + .key { padding-left: 0; border-left: 0; }
.groups .key .what { color: var(--color-ink-2); font-weight: 400; font-size: var(--text-xs); }

.dot { display: block; flex: none; width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--map-none); }
.dot.high { background: var(--map-high); }
.dot.low { background: var(--map-low); }
.dot.daily-mover { background: var(--map-mover); }
.dot.pullback { background: var(--map-pullback); }
.dot.breakout { background: var(--map-breakout); }
.dot.context { background: var(--map-context); }
.dot.ring { outline: 2px solid var(--color-ink); outline-offset: 1px; }
.groups .dot.ring { background: var(--color-sheet); }
a.dot:hover { outline: 2px solid var(--color-accent-2); outline-offset: 1px; }
a.dot:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* Sector blocks flow left to right, the most lit first. */
.sectors { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 44px 36px; }
.sector { width: fit-content; min-width: 10rem; }
.sector h2 {
  display: grid; grid-template-columns: auto 1fr; align-items: end; align-content: end; column-gap: 2px;
  min-height: 4.9rem; max-width: none; /* two-line names: dot rows still line up */
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--color-ink);
}
.sector .lit { color: var(--color-ink); font: 900 2.75rem/0.8 var(--font-display); font-variant-numeric: tabular-nums; }
.sector .of { color: var(--color-muted); font: 400 var(--text-xs)/1 var(--font-outlier); }
.sector .name {
  grid-column: 1 / -1; width: 0; min-width: 100%; margin-top: 6px; color: var(--color-ink); font: 700 var(--text-xs)/1.2 var(--font-body);
  letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none;
}
.sector a.name { text-decoration: underline; text-decoration-color: var(--color-rule-2); }
.sector a.name:hover { color: var(--color-accent-2); text-decoration-color: currentColor; }
.sector.quiet h2 { border-bottom-color: var(--color-rule-2); }
.sector.quiet .lit { color: var(--color-quiet); }
.dots { display: grid; grid-template-columns: repeat(var(--cols), var(--dot)); gap: var(--dot-gap); padding: 3px; }
.cols-6 { --cols: 6; } .cols-8 { --cols: 8; } .cols-10 { --cols: 10; } .cols-12 { --cols: 12; }
.cols-14 { --cols: 14; } .cols-16 { --cols: 16; } .cols-20 { --cols: 20; } .cols-24 { --cols: 24; }
.empty { color: var(--color-muted); }

@media (max-width: 80rem) { .map-page main { padding-inline: 24px; } }
@media (max-width: 40rem) {
  .map-page main { padding-inline: 16px; }
  .sector { width: auto; }
  .dots { grid-template-columns: repeat(auto-fill, var(--dot)); }
}
