/* Defaults for the shared charts and tables. A direction overrides the --c-* variables (and any class)
   in its own stylesheet; it never needs to touch site.js. */
:root {
  --c-ink: #1b1b1b;          /* words and our figures */
  --c-muted: #6f6f6f;        /* quiet words, values */
  --c-accent: #1f5c4a;       /* our top tenth: the one colour that means "us" */
  --c-other: #b4b0a6;        /* the longest-hold rule */
  --c-ref: #1b1b1b;          /* the county rate (reference tick and line) */
  --c-rule: #d8d4ca;         /* axes and connectors */
  --c-font: inherit;         /* chart words */
  --c-font-num: inherit;     /* chart numbers */
  --map-fill: #ece8de;
  --map-line: #ffffff;
  --map-hover: #d9d3c4;
  --map-sel: var(--c-accent);
}

[data-chart] { display: block; width: 100%; }
.c-svg { display: block; max-width: 100%; height: auto; overflow: visible; font-family: var(--c-font); }
.c-svg text { font-family: var(--c-font); fill: var(--c-ink); font-size: 13px; }
.c-legend-text { font-size: 12px !important; fill: var(--c-muted) !important; }
.c-head { font-size: 11.5px !important; fill: var(--c-muted) !important; }
.c-label { font-size: 14px !important; }
.c-value { font-family: var(--c-font-num) !important; font-size: 12.5px !important; fill: var(--c-muted) !important; font-variant-numeric: tabular-nums; }
.c-value-ours { fill: var(--c-ink) !important; font-weight: 600; }
.c-value-base { fill: var(--c-muted) !important; }
.c-lift { font-family: var(--c-font-num) !important; font-size: 15px !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-tick { font-size: 11.5px !important; fill: var(--c-muted) !important; }
.c-track { stroke: var(--c-rule); stroke-width: 1.5; }
.c-axis { stroke: var(--c-rule); stroke-width: 1; }
.c-base { stroke: var(--c-ref); stroke-width: 2; fill: none; }
.c-base-line { stroke-dasharray: 4 4; stroke-width: 1.25; }
.c-ours { fill: var(--c-accent); }
.c-longest { fill: var(--c-other); }
.c-bar-ours { fill: var(--c-accent); }
.c-bar-rest { fill: var(--c-accent); fill-opacity: 0.28; }

.c-map { display: block; width: 100%; height: auto; }
.c-map .d { fill: var(--map-fill); stroke: var(--map-line); stroke-width: 1.4; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .15s; outline: none; }
.c-map .d:hover, .c-map .d:focus { fill: var(--map-hover); }
.c-map .d.sel { fill: var(--map-sel); }
.c-map .d-label { font-size: 11px; fill: var(--c-muted); pointer-events: none; }

.t-ledger, .t-districts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.t-ledger th, .t-districts th { text-align: left; font-weight: 500; color: var(--c-muted); border-bottom: 1px solid var(--c-rule); padding: 8px 12px 8px 0; }
.t-ledger td, .t-districts td { border-bottom: 1px solid var(--c-rule); padding: 10px 12px 10px 0; vertical-align: top; }
.t-ledger .num, .t-districts .num, .t-ledger th.t-r { text-align: right; }
.t-ledger .num + td, .t-ledger th.t-r + th { padding-left: 28px; }
.t-ledger .hash code { font-family: var(--c-font-num); font-size: 0.92em; }
.t-ledger tbody th { font-weight: 600; color: inherit; padding: 10px 12px 10px 0; vertical-align: top; }
.t-ledger tbody th small { display: block; margin-top: 2px; font-size: 0.92em; font-weight: 400; color: var(--c-muted); }
.t-ledger .when, .t-ledger .due { white-space: nowrap; }

/* Narrow tables, by the table's own width (a phone, or a narrow column on a wide page). */
[data-table] { container-type: inline-size; }
@container (max-width: 600px) {
  /* each recorded run stacks: the market and its calls, when it was recorded and when it's due, then its fingerprint */
  [data-table] .t-ledger, [data-table] .t-ledger tbody { display: block; width: 100%; }
  [data-table] .t-ledger thead { display: none; }
  [data-table] .t-ledger tr { display: grid; grid-template: "who num" "when due" "hash hash" / minmax(0, 1fr) auto; gap: 9px 16px; padding: 14px 0; border-bottom: 1px solid var(--c-rule); }
  [data-table] .t-ledger tr:first-child { border-top: 1px solid var(--c-rule); }
  [data-table] .t-ledger tbody th, [data-table] .t-ledger td { display: block; padding: 0; border: 0; }
  [data-table] .t-ledger td::before { content: attr(data-label); display: block; color: var(--c-muted); font-size: 0.86em; }
  [data-table] .t-ledger .who { grid-area: who; }
  [data-table] .t-ledger .num { grid-area: num; text-align: right; }
  [data-table] .t-ledger .when { grid-area: when; }
  [data-table] .t-ledger .due { grid-area: due; text-align: right; }
  [data-table] .t-ledger .hash { grid-area: hash; }
  [data-table] .t-ledger .hash::before { content: none; }
  [data-table] .t-ledger .hash code { overflow-wrap: anywhere; }
}
@container (max-width: 520px) {
  [data-table] .t-districts .t-sold { display: none; }
}
.l-sources { margin: 0; padding-left: 1.2em; }
.l-sources li { margin: 0 0 6px; }
.l-sources a { color: inherit; }
