/* chart.css — shared 2-D chart chrome (P04; v5 W1-D). Owns .chart, .chart-raster, .chart-fog, .chart-svg,
   .chart-overlay and every .ch-* class (PLAN §4.5, PLAN_v5 §3.3 / §3.11). Light only. Colours come from
   tokens.css; the only literal colour is #fff (under-strokes, halos, strokes on ink/coral marks). Sizes are
   CSS px: ticks 10 (var(--text-tick)) in var(--chart-tick), axis titles 9.5 tracked 2.7 (uppercase in
   source — no text-transform, so units and symbols keep their case), series/marker labels 9.5 tracked 1,
   contour / chip / off-scale labels 10. Nothing below var(--text-min). Mono weight 400 (B4).
   Colour roles (A13): coral-deep is graphics only (the live point, the focus ring); SVG text that was coral
   uses --sfr-coral-text; targets the operator sets (the n* line, the P* line, the manual S line and their
   grips) use --sfr-target; the ◆ design marker is ink with a 1.5-px white stroke. */

/* ---- container and its stacked children (DOM order: raster < fog < svg < overlay) ---- */
.chart{position:relative;display:block;min-width:0;min-height:0;touch-action:none;user-select:none;-webkit-user-select:none}
.chart-raster,.chart-fog{position:absolute;left:0;top:0;display:block;pointer-events:none}
.chart-svg{position:absolute;left:0;top:0;width:100%;height:100%;display:block;overflow:visible}
.chart-svg text{font-family:var(--os-font-mono);font-weight:400;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;pointer-events:none;user-select:none;-webkit-user-select:none}
.chart-overlay{position:absolute;inset:0;pointer-events:none;overflow:visible}
.chart.ch-grab-y{cursor:ns-resize}
.chart.ch-grab-x{cursor:ew-resize}

/* ---- plot frame, grid, axes ---- */
.ch-frame{fill:#fff;stroke:var(--chart-frame);stroke-width:1;shape-rendering:crispEdges}
.ch-well{fill:var(--chart-well);stroke:var(--chart-frame);stroke-width:1;shape-rendering:crispEdges}
.ch-frame--clear{fill:none}   /* raster/fog charts: the canvases carry the plot, the frame is stroke-only above them */
.ch-grid{fill:none;stroke:var(--chart-grid);stroke-width:1;shape-rendering:crispEdges}
.ch-axis{fill:none;stroke:var(--chart-axis);stroke-width:1;shape-rendering:crispEdges}

/* ---- text ---- */
.ch-tick{font-size:var(--text-tick);fill:var(--chart-tick)}
.ch-title{font-size:var(--text-min);letter-spacing:2.7px;fill:var(--chart-title)}
.ch-label{font-size:9.5px;letter-spacing:1px;fill:var(--iv-ink)}
.ch-label--2{font-size:var(--text-min);letter-spacing:1px;fill:var(--iv-ink-muted)}
.ch-label--muted{fill:var(--iv-ink-muted)}
.ch-label--subtle{fill:var(--iv-ink-subtle)}
.ch-label--coral{fill:var(--sfr-coral-text)}
.ch-fog-label{font-size:9.5px;letter-spacing:1px;fill:var(--iv-ink-subtle);text-anchor:middle}

/* ---- series ---- */
.ch-series-q{fill:none;stroke:var(--sfr-series-q);stroke-width:1.6;stroke-linejoin:round}
.ch-series-pfus{fill:none;stroke:var(--sfr-series-pfus);stroke-width:1.6;stroke-linejoin:round}
.ch-series-wall{fill:none;stroke:var(--iv-ink);stroke-width:1.6;stroke-linejoin:round}
.ch-series-s{fill:none;stroke:var(--iv-ink);stroke-width:1.4;stroke-linejoin:round}

/* ---- guides ---- */
.ch-asymptote{fill:none;stroke:var(--iv-ink);stroke-width:1;stroke-dasharray:4 3}
.ch-asymptote-label{letter-spacing:1.6px}
.ch-current{fill:none;stroke:var(--iv-rule-35);stroke-width:1;stroke-dasharray:2 3}
.ch-hline-paux{fill:none;stroke:var(--iv-coral-deep);stroke-width:1;stroke-dasharray:4 3}
.ch-hline-paux-label{fill:var(--sfr-coral-text)}
.ch-zero{fill:none;stroke:var(--iv-rule-35);stroke-width:1;shape-rendering:crispEdges}
.ch-crosshair{fill:none;stroke:var(--iv-rule-35);stroke-width:1;stroke-dasharray:2 3;pointer-events:none}

/* ---- v5 targets (the n* line, the P* line) and their grips ---- */
.ch-target{fill:none;stroke:var(--sfr-target);stroke-width:1.5;shape-rendering:crispEdges}
.ch-target.is-grabbed{stroke-width:2}
.ch-target-label{fill:var(--sfr-target);paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}
.ch-knob-s{fill:none;stroke:var(--sfr-target);stroke-width:1.25;stroke-dasharray:4 3}
.ch-knob-s-label{fill:var(--sfr-target);paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}
/* the grip: a transparent hit box (width/height set inline, ≥ var(--size-hit)) centred on the line in the
   margin, carrying a --ch-grip-size visual tab that points at the plot */
.ch-grip{position:absolute;display:block;box-sizing:border-box;min-width:var(--size-hit);min-height:var(--size-hit);margin:0;padding:0;border:0;border-radius:var(--radius-control);background:transparent;pointer-events:auto;touch-action:none;cursor:ns-resize;-webkit-appearance:none;appearance:none}
.ch-grip--x{cursor:ew-resize}
.ch-grip::before{content:"";position:absolute;left:50%;top:50%;width:var(--ch-grip-size,16px);height:calc(var(--ch-grip-size,16px) * 0.75);transform:translate(-50%,-50%);background:var(--sfr-target);clip-path:polygon(0 50%,35% 0,100% 0,100% 100%,35% 100%)}
.ch-grip--x::before{width:calc(var(--ch-grip-size,16px) * 0.75);height:var(--ch-grip-size,16px);clip-path:polygon(50% 0,100% 35%,100% 100%,0 100%,0 35%)}
.ch-grip::after{content:"";position:absolute;left:calc(50% + 1px);top:50%;width:calc(var(--ch-grip-size,16px) * 0.35);height:1px;transform:translate(-25%,-50%);background:#fff;box-shadow:0 -3px 0 #fff,0 3px 0 #fff}
.ch-grip--x::after{left:50%;top:calc(50% + 1px);width:1px;height:calc(var(--ch-grip-size,16px) * 0.35);transform:translate(-50%,-25%);box-shadow:-3px 0 0 #fff,3px 0 0 #fff}
.ch-grip:hover::before{background:var(--iv-ink)}
.ch-grip:focus-visible{outline:2px solid var(--sfr-focus);outline-offset:1px}
.ch-grip[hidden]{display:none}

/* ---- marks ---- */
.ch-diamond{fill:var(--iv-ink);stroke:#fff;stroke-width:1.5;stroke-linejoin:round}
.ch-diamond--hollow{fill:#fff;stroke:var(--iv-ink);stroke-width:1.5}   /* white inside: stays visible on ink (v4 ignited cells) and on every ramp stop */
.ch-ring{fill:none;stroke:var(--iv-coral);stroke-width:1}
/* the live point: coral-deep fill, 1.5-px white stroke, over the 0.75-px ink ring (circle r + 1.5 drawn first) */
.ch-point{fill:var(--iv-coral-deep);stroke:#fff;stroke-width:1.5}
.ch-point-ring{fill:var(--iv-ink);stroke:none}
.ch-point--ink{fill:var(--iv-ink)}
.ch-burn-ring{fill:none;stroke:var(--iv-ink);stroke-width:2}
.ch-dot{fill:var(--iv-ink);stroke:none}
.ch-cross{fill:none;stroke:var(--iv-ink);stroke-width:1.75;stroke-linecap:round}
.ch-circle{fill:none;stroke:var(--iv-ink);stroke-width:1.5}
.ch-pass{fill:var(--iv-ink);stroke:#fff;stroke-width:1.5;stroke-linejoin:round}
/* white halos drawn under a mark (marker() adds them): ring 2-px ink over a 4-px white = 1-px halo each side */
.ch-halo{fill:none;stroke:#fff;stroke-width:4;stroke-linejoin:round;stroke-linecap:round}
.ch-halo--cross{stroke-width:4.25}

/* ---- contours ---- */
.ch-contour-beta{fill:none;stroke:var(--iv-rule-55);stroke-width:1;stroke-dasharray:4 3}
.ch-contour-q{fill:none;stroke:var(--iv-ink);stroke-width:1}
.ch-contour-q1{fill:none;stroke:var(--iv-ink);stroke-width:1.8}
.ch-ignition{fill:none;stroke:var(--iv-ink);stroke-width:2;stroke-linejoin:round}
.ch-isobar{fill:none;stroke:var(--sfr-target);stroke-width:1.5;stroke-dasharray:6 3}
.ch-stab{fill:none;stroke:var(--iv-ink);stroke-width:1;stroke-dasharray:2 2}
.ch-locus{fill:none;stroke:var(--iv-ink);stroke-width:1.25;stroke-dasharray:5 3}
.ch-contour-label{font-size:var(--text-tick);letter-spacing:0.5px;fill:var(--iv-ink);paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}

/* ---- ghost (forecast) path ---- */
.ch-ghost{fill:none;stroke:var(--iv-ink);stroke-width:1.25;stroke-dasharray:3 3;stroke-linejoin:round;stroke-linecap:round}
.ch-ghost.is-stale{stroke:var(--iv-ink-subtle);stroke-dasharray:2 4}

/* ---- chips (rect + text pill) ---- */
.ch-chip{pointer-events:none}
.ch-chip>rect{fill:#fff;stroke:var(--iv-ink);stroke-width:1}
.ch-chip-text{font-size:var(--text-tick);letter-spacing:0.5px;fill:var(--iv-ink)}

/* ---- off-scale arrow ---- */
.ch-offscale{fill:var(--iv-ink);stroke:#fff;stroke-width:1;stroke-linejoin:round}
.ch-offscale-label{font-size:var(--text-tick);letter-spacing:0.5px;fill:var(--iv-ink);paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}

/* ---- legend swatches for the canvas patterns (HTML; periods match chart.js hatchPattern/stipplePattern) ---- */
.ch-hatch-swatch{display:inline-block;box-sizing:border-box;width:14px;height:10px;border:1px solid var(--iv-rule-35);background-color:#fff;vertical-align:middle;flex:none}
.ch-hatch-swatch--ignited{background-image:repeating-linear-gradient(45deg,color-mix(in srgb,var(--iv-ink) 90%,transparent) 0 0.75px,transparent 0.75px 2.83px)}
.ch-hatch-swatch--none{background-image:repeating-linear-gradient(135deg,color-mix(in srgb,var(--iv-ink) 18%,transparent) 0 0.75px,transparent 0.75px 4.24px)}
.ch-hatch-swatch--stable{background-image:radial-gradient(circle at 1px 1px,color-mix(in srgb,var(--iv-ink) 35%,transparent) 0 0.75px,transparent 0.9px);background-size:4px 4px}

/* ---- paths (flight path, trail) ---- */
.ch-path-under{fill:none;stroke:#fff;stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.ch-path{fill:none;stroke:var(--iv-ink);stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}
.ch-trail{fill:none;stroke:var(--iv-ink);stroke-width:1;stroke-dasharray:1 4;stroke-linejoin:round}

/* ---- SVG fog (unvisited range): surface-2 base + the per-instance 7 px / 7 % 135° hatch pattern ---- */
.ch-fog-rect{pointer-events:none}
.ch-fog-base{fill:var(--iv-surface-2)}
