/* ---------- Chart kit ---------------------------------------------------
   Shared marks for every time series in the app: the bedside lanes, the flow
   sheet's graph cards and spark strip, the labs sparkline, the report trends.
   Loaded before them all so a surface can only choose its size, never what a
   colour means.
   ------------------------------------------------------------------------ */
/* Parameter inks are the app's existing --t-* palette (00-theme.css), which the
   flow-sheet graph cards have used since they were built. Colour on a trace
   identifies WHICH parameter it is — never how alarming it is. That job belongs
   to the value and to the severity rule below, because a line recoloured by
   status paints most of itself amber on any patient who is durably out of
   range, and buries the one excursion that needed attention. */

/* Ink selection. A lane sets one of these on its plot; every mark inside
   inherits it, so a trace, its envelope and its head dot can never drift apart. */
.ck-ink-hr{--ck-ink:var(--t-hr)}
.ck-ink-bp{--ck-ink:var(--t-bp)}
.ck-ink-map{--ck-ink:var(--t-map)}
.ck-ink-spo2{--ck-ink:var(--t-spo2)}
.ck-ink-rr{--ck-ink:var(--t-rr)}
.ck-ink-temp{--ck-ink:var(--t-temp)}
.ck-ink-vent{--ck-ink:var(--t-vent)}
.ck-ink-neuro{--ck-ink:var(--t-neuro)}
.ck-ink-metabolic{--ck-ink:var(--t-glu)}

/* Marks. Every chart surface draws with these classes. */
.ck-band{fill:var(--ok-graphic);opacity:.09}   /* retained for surfaces that still fill */
/* The band's boundary, always drawn even when the wash is suppressed: it is the
   line the eye is actually measuring against. */
.ck-band-edge{stroke:var(--ok-graphic);stroke-width:1;opacity:.55;stroke-dasharray:4 3}
.ck-grid{stroke:var(--hairline);stroke-width:1;opacity:.75}
.ck-grid.ck-grid-y{opacity:.5}
/* The reading itself: the heaviest, darkest mark in the lane. Everything else
   is reference and must recede behind it. */
.ck-line{fill:none;stroke:var(--ck-ink,var(--ink-2));stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.ck-line.ck-pair{stroke-width:1.2;stroke-dasharray:3 3;opacity:.8}
/* Everything the reading could have been inside the interval. Without it a
   chart of means is a chart of a patient who never had a bad minute. */
.ck-envelope{fill:var(--ck-ink,var(--ink-2));opacity:.13}
.ck-envelope.ck-pair{opacity:.07}
/* Its boundary. A fill alone, in the trace's own hue, reads as a glow around
   the line; the edges are what make it read as the range it is. */
/* The range each interval covered, as its two boundaries rather than a wash.
   A translucent fill in the trace's own hue reads as a glow around the line —
   the first question it draws is "what does the diffused colour mean", which is
   the question a chart mark should never provoke. */
.ck-envelope-edge{fill:none;stroke:var(--ck-ink,var(--ink-2));stroke-width:1;opacity:.38;stroke-dasharray:2 2}
.ck-envelope-edge.ck-pair{opacity:.2}
.ck-head{fill:var(--ck-ink,var(--ink-2))}
/* Severity, as a rule under the trace rather than a repaint of it: a short
   excursion is a short mark, a long one is a long mark, and the trace stays
   readable as a shape. */
.ck-run{stroke-linecap:butt}
.ck-run-warn{stroke:var(--warn-graphic);stroke-width:3}
.ck-run-crit{stroke:var(--crit);stroke-width:3}
.ck-scale{font-size:8.5px;line-height:1;fill:var(--muted);font-variant-numeric:tabular-nums}

/* Legend. Five encodings on one lane is four more than anyone can infer. */
.ck-legend{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;font-size:9.5px;color:var(--muted)}
.ck-key{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.ck-swatch{width:12px;height:8px;border-radius:2px;flex:none}
.ck-swatch-band{background:var(--ok-graphic);opacity:.35}
.ck-swatch-line{height:2px;border-radius:1px;background:var(--ink-2)}
.ck-swatch-support{background:var(--brand);opacity:.28}
.ck-swatch-support{background:var(--brand);opacity:.28}
.ck-swatch-env{background:color-mix(in srgb, var(--ink-2) 18%, transparent);border-top:1px solid var(--ink-2);border-bottom:1px solid var(--ink-2)}
.ck-swatch-warn{height:3px;background:var(--warn-graphic)}
.ck-swatch-crit{height:3px;background:var(--crit)}
.ck-swatch-score{background:linear-gradient(90deg,var(--ok-graphic),var(--warn-graphic),var(--crit))}
.ck-mark{width:11px;height:11px;flex:none;color:var(--ink-2)}

/* Event marks: shape carries the family, so they survive at 11px and read the
   same on every platform — which the emoji they replaced did not. */
.ck-ev-glyph{width:9px;height:9px;display:block}
.ck-mark::before{content:"";display:block;width:9px;height:9px;margin:1px;background:currentColor}
.ck-mark-med::before{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.ck-mark-pump::before{clip-path:polygon(50% 0,100% 100%,0 100%)}
.ck-mark-lab::before{clip-path:none}
.ck-mark-vent::before{clip-path:polygon(42% 0,58% 0,58% 42%,100% 42%,100% 58%,58% 58%,58% 100%,42% 100%,42% 58%,0 58%,0 42%,42% 42%)}
