/* Scatter pages (Peak vs. Career, Prime vs. Career): layout, dots, tips, the
   clicked person's box. Page-specific bits are in scatter.js's config. */
*, *::before, *::after { box-sizing: border-box; }

:root { --actors: #002868; --actresses: #d9822b; --other: #999; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  padding: 24px 16px 32px;
  background: #f7f8fa;
  color: #111;
}

.container { max-width: 480px; margin: 0 auto; }
@media (min-width: 768px) { .container { max-width: 860px; } }

.accent-bar { height: 5px; background: #002868; border-radius: 3px; margin-bottom: 20px; }

h1 { font-size: clamp(18px, calc(6.2vw - 3px), 22px); font-weight: 600; margin: 0 0 4px;
  letter-spacing: -0.3px; text-align: center; }
.crosslink { font-size: 15px; margin: 0 0 16px; text-align: center; }
.crosslink a, .notes a { color: #002868; }

/* Actors / Actresses / Both, and Show everyone */
.controls { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid #cfd5de; border-radius: 8px; overflow: hidden; background: #fff; }
.seg button, .toggle { font: inherit; font-size: 14px; padding: 8px 12px; border: none; background: none;
  color: #333; cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid #cfd5de; }
.seg button[aria-pressed=true], .toggle[aria-pressed=true] { background: #002868; color: #fff; font-weight: 600; }
.toggle { border: 1px solid #cfd5de; border-radius: 8px; background: #fff; }

/* Key: which color is which */
.key { display: flex; gap: 14px; margin-left: auto; font-size: 13px; color: #444; white-space: nowrap; }
.key span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 5px; vertical-align: -1px; background: var(--c); }

.chart-wrap { position: relative; background: #fff; border: 1px solid #e3e6eb; border-radius: 10px;
  padding: 8px 8px 4px; }
svg { display: block; width: 100%; height: auto; overflow: visible; }
.grid line { stroke: #eef0f3; }
.axis text { font-size: 11px; fill: #777; }
.axis-title { font-size: 12px; fill: #444; font-weight: 600; }
.dot { fill-opacity: 0.8; stroke: #fff; stroke-width: 1; }
.dot.M { fill: var(--actors); }
.dot.F { fill: var(--actresses); }
.dot.O { fill: var(--other); }
.dot.hover { stroke: #111; stroke-width: 1.5; fill-opacity: 1; }
.dot.picked { stroke: #111; stroke-width: 2.5; fill-opacity: 1; }
svg.everyone .dot { stroke-width: 0.5; }

/* Name on hover / tap */
.dot-tip { position: absolute; z-index: 3; pointer-events: none; background: #fff; border: 1px solid #cfd5de;
  border-radius: 6px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); padding: 5px 8px; font-size: 12px;
  line-height: 1.45; white-space: nowrap; color: #222; }
.dot-tip[hidden] { display: none; }
.dot-tip b { font-size: 13px; }
.dot-tip .nums { color: #555; font-variant-numeric: tabular-nums; }

/* The clicked person's two charts, under the scatter */
.person { background: #fff; border: 1px solid #e3e6eb; border-radius: 10px; padding: 14px 12px 16px; margin-top: 12px; }
.person[hidden] { display: none; }
.person h2 { font-size: 16px; margin: 0 0 2px; white-space: nowrap; }
.person .nums { font-size: 13px; color: #555; margin: 0 0 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.notes { font-size: 13px; color: #555; line-height: 1.5; margin: 22px 0 0; }
.notes p { margin: 0 0 10px; }
.empty-line { color: #666; padding: 16px; margin: 0; text-align: center; }

@media (max-width: 600px) {
  body { padding: 14px 10px 24px; }
  .accent-bar { margin-bottom: 12px; }
  .seg button, .toggle { padding: 8px 8px; }
  .key { margin-left: 0; }
  .person { padding: 12px 8px 14px; }
}
@media (max-width: 360px) {
  .seg button, .toggle { font-size: 13px; padding: 8px 5px; }
}
