/* Odds page. The chart is the primary object; the stat strip above it and
   the machine table beside it support it. */
.odds-empty { max-width: 32rem; }
.odds-note { margin-bottom: .6rem; font-size: .85rem; color: var(--ink-dim); }

/* Stat strip: one row, flat cells split by hairlines */
.odds-page .stats { margin-bottom: .75rem; }
.odds-page .stat { flex: 1 1 170px; padding: .5rem .9rem; }
.odds-page .stat-value { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.odds-page .stats > .stat:first-child .stat-value { color: var(--accent); }

/* Chart */
.odds-title {
  font-size: .85rem; font-weight: 650; letter-spacing: -.005em;
  color: var(--ink-dim); margin-bottom: .45rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line-strong);
}
.odds-main { min-width: 0; }
.odds-main { margin-bottom: 1rem; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap svg text { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.chart-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: .5rem; min-height: 1.6rem; }

/* Legend: the direct key for builder lines. Hovering or focusing an entry
   opens the address in full and the machines behind it, fastest first. */
#odds-legend { display: flex; flex-wrap: wrap; gap: .25rem .4rem; }
.lg { position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border-radius: 8px; font-size: .82rem; cursor: default; outline: none; }
.lg:hover, .lg:focus-visible { background: var(--hover); }
.lg-dot { width: 12px; height: 3px; border-radius: 2px; flex: 0 0 auto; }
.lg-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg .n { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.lg-pop {
  display: none; position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 20;
  width: max-content; min-width: 17rem; max-width: min(26rem, 90vw);
  padding: .7rem .85rem; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); box-shadow: 0 6px 24px rgb(var(--ink-rgb) / .14);
  flex-direction: column; gap: .15rem; font-size: .8rem; line-height: 1.4; text-align: left;
}
.lg:hover .lg-pop, .lg:focus .lg-pop, .lg:focus-within .lg-pop { display: flex; }
.lg-who { font-weight: 650; font-size: .85rem; }
.lg-addr { font-family: var(--mono); font-size: .75rem; color: var(--ink-dim); overflow-wrap: anywhere; }
.lg-sub { color: var(--ink-dim); margin-bottom: .4rem; }
.lg-head, .lg-row { display: grid; grid-template-columns: minmax(0, 1fr) 3.2rem 3.4rem; gap: .6rem; padding: .22rem 0; }
.lg-head { color: var(--ink-dim); font-size: .74rem; border-bottom: 1px solid var(--rule); }
.lg-row { border-bottom: 1px solid var(--rule); }
.lg-row:last-child { border-bottom: 0; }
.lg-head > :nth-child(n+2), .lg-row > :nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.lg-row > :first-child { overflow-wrap: anywhere; }
.odds-hw { margin-left: auto; display: flex; align-items: baseline; gap: .45rem; font-size: .78rem; color: var(--ink-dim); }
.odds-hw .stat-label { margin: 0; font-weight: 500; font-size: .78rem; }

/* Chart grips (drag handles on the height axis) */
.x-grip { cursor: ew-resize; }
.x-grip text { fill: var(--ink-dim); }
.x-grip-thumb { fill: var(--ink-dim); }
.x-grip-line { stroke: var(--rule-lt); stroke-width: 0.5; opacity: .6; }
.x-grip rect, .x-grip text, .x-grip line { transition: fill .12s, stroke .12s, opacity .12s; }
.x-grip:hover .x-grip-thumb, .x-grip.is-held .x-grip-thumb,
.x-grip:hover text, .x-grip.is-held text { fill: var(--accent); }
.x-grip:hover .x-grip-line, .x-grip.is-held .x-grip-line { stroke: var(--accent); opacity: .45; }

@media (max-width: 640px) {
  .chart-wrap { overflow-x: auto; }
  .chart-wrap svg { min-width: 560px; }
  .odds-page .stat { flex-basis: 45%; min-width: 0; }
}
}

