/* The front page hero (website2 issue 10): the living map from the design handoff.
   Scoped under .ab-live so it doesn't restyle the rest of the site. */
main.page:has(.ab-live) { max-width: none; padding-top: 0; padding-bottom: 0; }
.ab-live.hero { height: calc(100vh - 49px); min-height: 620px; display: grid; grid-template-rows: auto minmax(0, 1fr); padding-top: var(--space-6); padding-bottom: var(--space-4); box-sizing: border-box; }
.ab-live .num { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
  .ab-live .intro { margin-bottom: var(--space-4); }
  .ab-live .eyebrow { margin: 0 0 var(--space-2); font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
  .ab-live .eyebrow .num { color: var(--ink); }
  .ab-live h1 { margin: 0 0 var(--space-2); font-size: 32px; line-height: 38px; font-weight: 750; letter-spacing: -0.02em; max-width: 44ch; text-wrap: balance; }
  .ab-live .sub { margin: 0; color: var(--muted); max-width: 72ch; }

  .ab-live .stage { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: var(--space-6); min-height: 0; }
  .ab-live .viz { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; min-height: 0; gap: var(--space-2); }
  .ab-live .map { position: relative; min-height: 0; }
  .ab-live .map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
  .ab-live .map canvas:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 0; }
  .ab-live .labels { position: absolute; inset: 0; pointer-events: none; }
  .ab-live .lab { position: absolute; font-family: var(--font-mono); font-size: 11px; line-height: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
  .ab-live .lab.proj { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 650; color: var(--ink); }
  .ab-live .lab.dir { padding: 0 4px; background: rgba(15, 17, 20, .82); border-radius: 3px; }
  .ab-live .tip { position: absolute; z-index: 2; pointer-events: none; width: max-content; max-width: 300px; padding: 8px 10px; background: var(--raised); border-radius: var(--radius-card); box-shadow: var(--pop); font-size: 12px; line-height: 16px; color: var(--muted); opacity: 0; transition: opacity 150ms linear; }
  .ab-live .tip.on { opacity: 1; }
  .ab-live .tip .f { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
  .ab-live .tip .ab-agent { color: var(--ink); }

.ab-live .timebar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: start; }
  .ab-live .timebar .ab-btn { margin-top: 10px; width: 72px; justify-content: center; }
  .ab-live .strip { position: relative; height: 56px; cursor: pointer; touch-action: none; }
  .ab-live .strip canvas { position: absolute; left: 0; top: 0; width: 100%; height: 40px; display: block; }
  .ab-live .strip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
  .ab-live .axis { position: absolute; left: 0; right: 0; top: 42px; height: 14px; }
  .ab-live .axis span { position: absolute; font-family: var(--font-mono); font-size: 11px; line-height: 14px; color: var(--muted); white-space: nowrap; }

  .ab-live .caption { margin: 0; min-height: 40px; display: flex; gap: var(--space-3); align-items: baseline; font-size: 14px; line-height: 20px; color: var(--ink); }
  .ab-live .caption .txt { transition: opacity 150ms linear; }

.ab-live .side { display: flex; flex-direction: column; gap: var(--space-4); min-height: 0; }
  .ab-live .counts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); min-height: 196px; align-content: start; }
  .ab-live .counts li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
  .ab-live .counts .n { font-family: var(--font-mono); font-size: 18px; line-height: 24px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
  .ab-live .counts .n.held { color: var(--fail); }
  .ab-live .counts .l { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 500; }
  .ab-live .key { margin: 0; padding-top: var(--space-4); border-top: 1px solid var(--rule); display: grid; gap: var(--space-3); font-size: 12px; line-height: 16px; color: var(--muted); }
  .ab-live .key .agents { display: flex; flex-wrap: wrap; gap: 6px 10px; }
  .ab-live .key .agents .ab-agent { font-size: 12px; line-height: 16px; }
  .ab-live .key .row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--space-2); align-items: start; }
  .ab-live .sw { width: 15px; height: 15px; margin: 1px 0 0 2px; box-sizing: border-box; border-radius: 50%; }
  .ab-live .sw.held { box-shadow: 0 0 0 2px var(--fail); background: #3a3e45; width: 11px; height: 11px; margin: 3px 0 0 4px; }
  .ab-live .sw.dbl { background: #3a3e45; box-shadow: 0 0 0 2px var(--agent-4), 0 0 0 3px var(--paper), 0 0 0 5px var(--agent-3); width: 9px; height: 9px; margin: 4px 0 0 5px; }
  .ab-live .sw.heat { background: radial-gradient(circle at 50% 50%, #a19d94 0 3px, #5b5d5f 3px 5px, #2e3238 5px); }
  .ab-live .sw.others { box-shadow: inset 0 0 0 1.5px var(--ink); background: #22262d; }
  .ab-live .sw.own { background: linear-gradient(90deg, #5a7393 0 50%, #3f6f62 50%); }
  .ab-live .sw.ring { background: #3a3e45; box-shadow: 0 0 0 2px var(--agent-5); width: 11px; height: 11px; margin: 3px 0 0 4px; }
  .ab-live .moments { display: none; }

  @media (max-width: 900px) {
    .ab-live.hero { height: auto; min-height: 0; display: block; padding-top: var(--space-4); }
    .ab-live h1 { font-size: 26px; line-height: 32px; }
    .ab-live .stage { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
    .ab-live .viz { grid-template-rows: auto auto auto; }
    .ab-live .map { height: auto; min-height: 0; margin: 0; overflow: hidden; }
    .ab-live .map::before { content: ""; display: block; padding-top: calc(100% / var(--ar, 0.72)); }
    .ab-live .map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
    .ab-live .stage, .ab-live .viz, .ab-live .side, .ab-live .caption, .ab-live .sub { min-width: 0; }
    .ab-live .caption, .ab-live .sub, .ab-live .key { overflow-wrap: anywhere; }
    .ab-live .timebar .ab-btn { width: 64px; }
    .ab-live .counts { min-height: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
    .ab-live .counts li { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .ab-live .counts .n { text-align: left; }
    .ab-live .counts li.extra { display: none; }
    .ab-live .counts.is-end li.extra { display: grid; }
    .ab-live .caption { min-height: 60px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .ab-live .tip, .ab-live .caption .txt { transition: none; }
    .ab-live .map canvas { transition: opacity 0.25s linear; }
    .ab-live .caption { display: none; }
    .ab-live .moments { display: block; margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 16px; color: var(--muted); columns: 2; column-gap: var(--space-6); }
    .ab-live .moments li { break-inside: avoid; margin-bottom: 6px; }
  }
@media (prefers-reduced-motion: reduce) and (min-width: 901px) {
  .ab-live.hero { height: auto; }
  .ab-live .viz { grid-template-rows: auto auto auto; }
  .ab-live .map { height: 440px; }
}

body.rec .ab-live .intro, body.rec .ab-live .side, body.rec .ab-live #play, body.rec .ab-live .moments { display: none !important; }
body.rec .ab-live.hero { max-width: none; height: 100vh; min-height: 0; padding: 40px 72px 28px; grid-template-rows: minmax(0, 1fr); }
body.rec .ab-live .stage { grid-template-columns: minmax(0, 1fr); }
body.rec .ab-live .timebar { grid-template-columns: minmax(0, 1fr); }
body.rec .ab-live .viz { gap: var(--space-4); }
body.rec .ab-live .caption { font-size: 22px; line-height: 30px; min-height: 30px; display: flex !important; }

/* Live (website2 issue 181): the public projects now. No time bar: the map, then the switch to the replay. Flat: a solid dot. */
.ab-live.is-live .viz { grid-template-rows: minmax(0, 1fr) auto; }
.ab-live .ab-live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--pass); vertical-align: 0; }
.ab-live .lv-word { color: var(--ink); font-weight: 650; }
.ab-live .ab-hero-switch { margin: 0; font-size: 13px; line-height: 20px; }
.ab-live .ab-hero-switch a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.ab-live .sw.first { background: #3a3e45; }
@media (max-width: 900px) {
  .ab-live.is-live .viz { grid-template-rows: auto auto; }
}
