/* ---- CASCADE LAYER ------------------------------------------------------
 *
 * Everything the kit ships sits in ONE layer named `overscan`, so a consumer's
 * own CSS beats it without a specificity fight and without !important. That is
 * close to mandatory for a distributed kit: an app should be able to restyle a
 * panel by writing a plain rule.
 *
 * ⚠️ ONE layer, deliberately, NOT a sub-layer per file. Sub-layers look tidier
 * and would silently reorder the kit against itself: layer order beats
 * specificity, so a high-specificity rule in an early file that currently wins
 * would start losing to a low-specificity rule in a later one. A single layer
 * preserves source order exactly, so nothing inside the kit changes.
 *
 * Unlayered author CSS wins over all of it. That is the point.
 */

@layer overscan {
/* A forecast as the chance of each outcome, with no line through the middle. */

ov-fan {
  display: grid;
  gap: 6px;
  font-family: var(--ov-font-mono);
  font-size: var(--ov-size-1);
  letter-spacing: 1px;
  color: var(--ov-dim);
  inline-size: 100%;
  max-inline-size: var(--ov-fan-size, 420px);
}

.ov-fan__svg {
  display: block;
  inline-size: 100%;
  background: var(--ov-field);
  border: var(--ov-bezel) solid var(--ov-line-strong);
}

.ov-fan__plot { fill: none; stroke: var(--ov-line); stroke-width: 1; }
.ov-fan__grid { stroke: var(--ov-line); stroke-width: 0.5; stroke-dasharray: 1 3; }
.ov-fan__text { font: 8px var(--ov-font-mono); fill: var(--ov-faint); letter-spacing: 0.4px; }
.ov-fan__text.is-now { fill: var(--ov-ink); }

/* 🔴 No outline on any band: an edge drawn round the 90% would read as the
   limit of what can happen. Density falls off toward the outside instead. */
.ov-fan__band { stroke: none; fill: var(--ov-accent); }
.ov-fan__band.is-k0 { fill: color-mix(in srgb, var(--ov-accent) 78%, transparent); }
.ov-fan__band.is-k1 { fill: color-mix(in srgb, var(--ov-accent) 56%, transparent); }
.ov-fan__band.is-k2 { fill: color-mix(in srgb, var(--ov-accent) 38%, transparent); }
.ov-fan__band.is-k3 { fill: color-mix(in srgb, var(--ov-accent) 24%, transparent); }
.ov-fan__band.is-k4 { fill: color-mix(in srgb, var(--ov-accent) 13%, transparent); }

/* The outer region: named, in the margin, with a thin leader to where it starts. */
.ov-fan__outer { font: 8px var(--ov-font-mono); fill: var(--ov-dim); letter-spacing: 0.4px; }
.ov-fan__lead { stroke: var(--ov-line-strong); stroke-width: 0.6; stroke-dasharray: 1.5 1.5; }

.ov-fan__history { fill: none; stroke: var(--ov-ink); stroke-width: 1.4; stroke-linejoin: round; }
.ov-fan__point { fill: var(--ov-ink); }
.ov-fan__now { stroke: var(--ov-ink); stroke-width: 0.8; stroke-dasharray: 3 2; }
.ov-fan__gap { stroke: var(--ov-alarm); stroke-width: 0.8; stroke-dasharray: 2 2; }
.ov-fan__cut { fill: var(--ov-alarm); }

[data-ov-stale-forecast] .ov-fan__band { opacity: 0.45; }

.ov-fan__void {
  display: grid; place-items: center; min-block-size: 140px;
  color: var(--ov-alarm); text-transform: uppercase;
  border: 1px dashed var(--ov-line-strong);
}
.ov-fan__readout { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ov-fan__readout .is-flag { color: var(--ov-accent-2); }
}
