/* The model-bill spread map (app/lineage-spreadmap.js), the lineage
   family view's tile map. Every colour is one of lineage.html's own
   tokens (var(--...)); no hex anywhere in this file -- see
   tools/tests/lineage_spreadmap_test.mjs. */
.lsm { margin: 18px 0 0; }
.lsm-title { font-size: 15px; font-weight: 700; color: var(--text); }
.lsm-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; max-width: 68ch; }

.lsm-legend { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-wrap: wrap;
  gap: 8px 16px; font-size: 12px; color: var(--muted); }
.lsm-legend li { display: flex; align-items: center; gap: 6px; }
.lsm-key { width: 14px; height: 14px; border-radius: 4px; display: inline-block; box-sizing: border-box; }
.lsm-key.solid { background: var(--k); }
.lsm-key.partial { background: var(--k); border: 1px solid var(--border-strong); }
.lsm-key.hollow { background: none; border: 2px solid var(--k); }
.lsm-key.ring { background: none; border: 2.5px solid var(--k); border-radius: 50%; }

.lsm-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.lsm-slider-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.lsm-slider { width: 220px; max-width: 50vw; accent-color: var(--gold); }
.lsm-date { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text); font-weight: 600;
  /* a fixed width: the date changes length as the slider moves ("May 1, 2019" vs "Sept 30, 2021"), and a
     date that grew or shrank pushed the slider sideways under the pointer, so the thumb jumped while dragging */
  display: inline-block; width: 14ch; white-space: nowrap; }
.lsm-play { font-size: 12.5px; }

.lsm-plot { max-width: 620px; }
.lsm-svg { display: block; width: 100%; height: auto; }
.lsm-tile-rect { stroke-width: 1.5; transition: fill .15s, opacity .15s; }
@media (prefers-reduced-motion: reduce) { .lsm-tile-rect { transition: none; } }
.lsm-tile-ring { pointer-events: none; }
.lsm-tile-label { font-size: 11px; font-weight: 700; fill: var(--text); pointer-events: none; }
.lsm-tile-label.off { fill: var(--faint); }
.lsm-tile-label.on-hollow { fill: var(--muted); }
.lsm-tile-label.on-pending { fill: var(--on-gold); }
/* the geographic map: outlines, labels at each state's centre or, for the small north-eastern states, in the Atlantic with a leader line */
.lsm-plot:has(.lsm-geo) { max-width: 820px; }
.lsm-geo .lsm-tile-rect { stroke-width: 1; stroke-linejoin: round; }
.lsm-geo .lsm-tile-label { font-size: 13px; }
.lsm-geo-labels { pointer-events: none; }
.lsm-geo-leader { stroke: var(--border-strong); stroke-width: 1; }
.lsm-geo-callout.on, .lsm-geo-callout.on-pending, .lsm-geo-callout.on-hollow { fill: var(--text); }
.lsm-hit { cursor: pointer; }
.lsm-hit:focus { outline: none; }
.lsm-hit:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.lsm-tip { position: fixed; z-index: 50; max-width: 300px; padding: 7px 10px; border-radius: 6px;
  background: var(--text); color: var(--panel); font-size: 12px; line-height: 1.4; pointer-events: none; }

.lsm-card { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold); border-radius: 0 6px 6px 0; background: var(--panel2); max-width: 420px; }
.lsm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lsm-card-head b { color: var(--text); font-size: 14px; }
.lsm-x { background: transparent; border: 1px solid var(--border-strong); border-radius: 5px;
  color: var(--muted); width: 26px; height: 26px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.lsm-x:hover { color: var(--text); border-color: var(--gold); }
.lsm-card-list { list-style: none; margin: 8px 0 0; padding: 0; }
.lsm-card-list li { padding: 4px 0; border-top: 1px dashed var(--border); }
.lsm-card-list li:first-child { border-top: 0; }
.lsm-card-list a { color: var(--gold); text-decoration: none; display: inline-flex; align-items: center;
  min-height: 24px; }
.lsm-card-list a:hover { text-decoration: underline; }
.lsm-card-note { margin: 8px 0 0; font-size: 12px; color: var(--gold); }

.lsm-table-wrap { margin-top: 14px; }
.lsm-table-wrap summary { cursor: pointer; color: var(--gold); font-size: 12.5px; min-height: 28px;
  display: flex; align-items: center; }
.lsm-table-wrap .table-scroll { overflow: auto; max-height: 420px; border: 1px solid var(--border);
  border-radius: 6px; margin-top: 8px; }
.lsm-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lsm-table-wrap th { position: sticky; top: 0; text-align: left; background: var(--panel2);
  color: var(--faint); font-size: 11px; text-transform: uppercase; padding: 7px 8px;
  border-bottom: 1px solid var(--border-strong); }
.lsm-table-wrap td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lsm-table-wrap a { color: var(--gold); display: inline-flex; align-items: center; min-height: 24px; }
