@charset "UTF-8";
/* Corridor R-01 — component stylesheet for the error-analysis site.
   Part 1: design-system §7 stylesheet, VERBATIM (corridor-r01-design-system.md).
   Part 2: site additions (M3 app bar, rail, fields, data table, side sheet, tooltip, progress, snackbar,
   empty state, pagination, help, divider, chart frame, legend). Load after tokens.css. */

/* Corridor R-01 — Material 3 component styles. Every colour is a token; no literals. */
body { background: var(--surface); color: var(--on-surface); font-family: var(--font-sans); font-size: 14px; line-height: 20px; letter-spacing: 0.25px; margin: 0; }
.cr-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-4); }

/* State layer: an overlay of the content colour (M3) */
.cr-state { position: relative; isolation: isolate; overflow: hidden; }
.cr-state::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity 120ms cubic-bezier(0.2, 0, 0, 1); pointer-events: none; z-index: -1; }
.cr-state:hover::before { opacity: var(--state-hover); }
.cr-state:focus-visible::before { opacity: var(--state-focus); }
.cr-state:active::before { opacity: var(--state-pressed); }
.cr-state:focus-visible { outline: var(--focus-ring-width) solid var(--secondary); outline-offset: var(--focus-ring-offset); }

/* Buttons: full shape, 40px, label-large */
.cr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 40px; padding: 0 var(--space-6); border-radius: var(--shape-full); border: 0;
  font: inherit; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; cursor: pointer; white-space: nowrap;
}
.cr-btn--filled { background: var(--primary); color: var(--on-primary); }
.cr-btn--filled:hover { box-shadow: var(--elevation-1); }
.cr-btn--tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.cr-btn--outlined { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1px var(--outline); }
.cr-btn--text { background: transparent; color: var(--primary); padding: 0 var(--space-3); }
.cr-btn--icon { width: 40px; padding: 0; color: var(--on-surface-variant); background: transparent; }
.cr-btn__icon { font-size: 18px; line-height: 1; }
.cr-btn:disabled { color: var(--text-disabled); background: transparent; box-shadow: none; cursor: not-allowed; }
.cr-btn--filled:disabled, .cr-btn--tonal:disabled { background: var(--surface-container-highest); }
.cr-btn:disabled::before { display: none; }

/* Status chip: M3 chip shape, tonal status fill, glyph + word */
.cr-chip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  height: 28px; padding: 0 var(--space-3) 0 10px; border-radius: var(--shape-sm);
  font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; white-space: nowrap;
}
.cr-chip__glyph { font-size: 13px; line-height: 1; }
.cr-chip--ok { background: var(--status-ok-subtle); color: var(--status-ok-text); }
.cr-chip--info { background: var(--status-info-subtle); color: var(--status-info-text); }
.cr-chip--warning { background: var(--status-warning-subtle); color: var(--status-warning-text); }
.cr-chip--danger { background: var(--status-danger-subtle); color: var(--status-danger-text); }
.cr-chip--unknown { background: var(--status-unknown-subtle); color: var(--status-unknown-text); }
.cr-chip--outline { background: transparent; color: var(--on-surface-variant); box-shadow: inset 0 0 0 1px var(--outline); }

/* Caveat badge */
.cr-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 var(--space-2); border-radius: var(--shape-full);
  font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap;
}
.cr-badge--ok { background: var(--status-ok-solid); color: var(--status-ok-on-solid); }
.cr-badge--info { background: var(--status-info-solid); color: var(--status-info-on-solid); }
.cr-badge--warning { background: var(--status-warning-solid); color: var(--status-warning-on-solid); }
.cr-badge--danger { background: var(--status-danger-solid); color: var(--status-danger-on-solid); }
.cr-badge--unknown { background: var(--status-unknown-solid); color: var(--status-unknown-on-solid); }

/* Cards */
.cr-card { border-radius: var(--shape-md); padding: var(--space-4); }
.cr-card--elevated { background: var(--surface-container-low); box-shadow: var(--elevation-1); }
.cr-card--filled { background: var(--surface-container-low); }
.cr-card--outlined { background: var(--surface); box-shadow: inset 0 0 0 1px var(--outline-variant); }

/* KPI tile */
.cr-kpi { display: flex; flex-direction: column; gap: var(--space-1); min-width: 168px; }
.cr-kpi__label { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; color: var(--on-surface-variant); }
.cr-kpi__value { font-size: 28px; line-height: 36px; font-weight: 400; color: var(--on-surface); font-variant-numeric: tabular-nums; }
.cr-kpi__unit { font-size: 14px; letter-spacing: 0.25px; color: var(--on-surface-variant); margin-left: 4px; }
.cr-kpi__foot { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; line-height: 16px; letter-spacing: 0.4px; color: var(--on-surface-variant); }
.cr-kpi__value--na { font-size: 16px; line-height: 36px; letter-spacing: 0.5px; color: var(--on-surface-variant); }

/* Segmented button (M3) */
.cr-seg { display: inline-flex; border-radius: var(--shape-full); box-shadow: inset 0 0 0 1px var(--outline); }
.cr-seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 56px; padding: 0 var(--space-4);
  border: 0; border-left: 1px solid var(--outline); background: transparent; color: var(--on-surface);
  font: inherit; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.cr-seg button:first-child { border-left: 0; border-radius: var(--shape-full) 0 0 var(--shape-full); }
.cr-seg button:last-child { border-radius: 0 var(--shape-full) var(--shape-full) 0; }
.cr-seg button[aria-pressed="true"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.cr-seg__check { display: none; font-size: 14px; }
.cr-seg button[aria-pressed="true"] .cr-seg__check { display: inline; }

/* Night canvas + legend */
.cr-night { background: var(--surface); color: var(--on-surface); border-radius: var(--shape-md); padding: var(--space-4); }
.cr-legend { display: grid; grid-template-columns: 56px 1fr; gap: 10px var(--space-3); align-items: center; font-size: 14px; line-height: 20px; letter-spacing: 0.25px; }
.cr-legend svg { display: block; overflow: visible; }
.cr-legend__cue { color: var(--on-surface-variant); font-size: 12px; letter-spacing: 0.4px; }

/* ==========================================================================================
   Site additions — error-analysis site (dashboard/errors). Material 3 components on the
   Corridor R-01 tokens. Every colour is a token; no literals. Rules kept from the DS:
   - status / eval colours only on surface, surface-container-lowest, surface-container-low
     (tables, cards, sheets, rich tooltips); never on the app bar, rail, inputs or plain tooltips;
   - state layers = content colour at state-hover / state-focus / state-pressed (.cr-state);
   - keyboard focus = 2px secondary ring at 2px offset;
   - motion uses the duration tokens, which prefers-reduced-motion sets to 0.
   Open/close contract for overlays (sheet, scrim, snackbar, tooltip): add .is-open
   (or data-open="true"); [hidden] always wins.
   ========================================================================================== */

:root {
  --cr-mask-drop-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M464-376 306-533q-2-2-3.5-4.76-1.5-2.77-1.5-5.92 0-6.32 4.13-10.82 4.12-4.5 10.87-4.5h328q6.75 0 10.88 4.64 4.12 4.63 4.12 10.81 0 1.55-5 10.55L496-376q-3 3-7.06 5t-8.94 2q-4.87 0-8.94-2-4.06-2-7.06-5Z'/%3E%3C/svg%3E");
  --cr-mask-sort-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M450-686 223-459q-9 9-21 9t-21-9q-9-9-9-21t9-21l278-278q5-5 10-7t11-2q6 0 11 2t10 7l278 278q9 9 9 21t-9 21q-9 9-21 9t-21-9L510-686v496q0 13-8.5 21.5T480-160q-13 0-21.5-8.5T450-190v-496Z'/%3E%3C/svg%3E");
  --cr-mask-sort-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M450-274v-496q0-13 8.5-21.5T480-800q13 0 21.5 8.5T510-770v496l227-227q9-9 21-9t21 9q9 9 9 21t-9 21L501-181q-5 5-10 7t-11 2q-6 0-11-2t-10-7L181-459q-9-9-9-21t9-21q9-9 21-9t21 9l227 227Z'/%3E%3C/svg%3E");
  --cr-mask-sort-none: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='m480-208 114-114q9.13-9 22.07-9 12.93 0 21.93 9.1 9 9.11 9 22 0 12.9-9 21.9L501-141q-5 5-10.13 7-5.14 2-11 2-5.87 0-10.87-2-5-2-10-7L322-278q-9-9.13-9-22.07 0-12.93 9.1-21.93 9.11-9 22-9 12.9 0 21.9 9l114 114Zm0-540L366-634q-9.13 9-22.07 9-12.93 0-21.93-9.1-9-9.11-9-22 0-12.9 9-21.9l137-137q5-5 10.13-7 5.14-2 11-2 5.87 0 10.87 2 5 2 10 7l137 137q9 9.13 9 22.07 0 12.93-9.1 21.93-9.11 9-22 9-12.9 0-21.9-9L480-748Z'/%3E%3C/svg%3E");
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--focus-ring-width) solid var(--secondary); outline-offset: var(--focus-ring-offset);
}
.cr-link { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.cr-link:hover { text-decoration-thickness: 2px; }
.cr-muted { color: var(--on-surface-variant); }
.cr-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.cr-skip {
  position: absolute; left: var(--space-2); top: calc(-1 * var(--appbar-height)); z-index: calc(var(--z-tooltip) + 1);
  padding: var(--space-2) var(--space-4); border-radius: var(--shape-full);
  background: var(--primary); color: var(--on-primary); font-weight: 500; text-decoration: none;
}
.cr-skip:focus { top: var(--space-2); }

/* ---- Icons (inline SVG from assets/icons.js) ---- */
.cr-icon { display: inline-block; flex: none; width: 24px; height: 24px; fill: currentColor; vertical-align: middle; }
.cr-icon--18 { width: 18px; height: 18px; }
.cr-icon--20 { width: 20px; height: 20px; }
.cr-icon--48 { width: 48px; height: 48px; }
.cr-btn svg, .cr-chip svg, .cr-seg button svg { flex: none; width: 18px; height: 18px; }
.cr-btn--icon svg { width: 24px; height: 24px; }
.cr-btn--text:has(svg) { padding: 0 var(--space-4) 0 var(--space-3); }
.cr-btn--filled:has(svg), .cr-btn--tonal:has(svg), .cr-btn--outlined:has(svg) { padding-left: var(--space-4); }

/* ---- Top app bar (surface-container; no status colour except caveat badges, which carry their own ink) ---- */
.cr-appbar {
  position: sticky; top: 0; z-index: var(--z-appbar);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
  min-height: var(--appbar-height); padding: var(--space-2) var(--space-4);
  background: var(--surface-container); color: var(--on-surface);
}
.cr-appbar--scrolled { box-shadow: var(--elevation-2); }
.cr-appbar__brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3); min-width: 0; }
.cr-appbar__title {
  margin: 0; font-size: var(--type-title-large-size); line-height: var(--type-title-large-line);
  font-weight: var(--type-title-large-weight); letter-spacing: var(--type-title-large-tracking); white-space: nowrap;
}
.cr-appbar__subtitle {
  margin: 0; color: var(--on-surface-variant); font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line); letter-spacing: var(--type-body-medium-tracking); white-space: nowrap;
}
.cr-appbar__spacer { flex: 1 1 auto; }
.cr-appbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.cr-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); min-width: 0; }

/* ---- Navigation rail (surface-container; active indicator pill on secondary-container) ---- */
.cr-rail {
  display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3);
  width: var(--rail-width); padding: var(--space-3) 0; margin: 0; list-style: none;
  background: var(--surface-container); color: var(--on-surface-variant);
}
.cr-rail__item {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  width: 100%; min-height: 56px; padding: 0; margin: 0; border: 0; background: transparent;
  color: var(--on-surface-variant); font-family: inherit; text-align: center; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cr-rail__indicator {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center;
  width: 56px; height: 32px; border-radius: var(--shape-full); color: var(--on-surface-variant);
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.cr-rail__indicator::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: currentColor;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-standard); pointer-events: none;
}
.cr-rail__indicator svg { width: 24px; height: 24px; }
.cr-rail__label {
  max-width: 100%; font-size: var(--type-label-medium-size); line-height: var(--type-label-medium-line);
  font-weight: var(--type-label-medium-weight); letter-spacing: var(--type-label-medium-tracking); overflow-wrap: break-word;
}
.cr-rail__item:hover .cr-rail__indicator::before { opacity: var(--state-hover); }
.cr-rail__item:active .cr-rail__indicator::before { opacity: var(--state-pressed); }
.cr-rail__item:focus-visible { outline: none; }
.cr-rail__item:focus-visible .cr-rail__indicator { outline: var(--focus-ring-width) solid var(--secondary); outline-offset: var(--focus-ring-offset); }
.cr-rail__item:focus-visible .cr-rail__indicator::before { opacity: var(--state-focus); }
.cr-rail__item[aria-current="page"], .cr-rail__item.is-active { color: var(--on-surface); }
.cr-rail__item[aria-current="page"] .cr-rail__indicator, .cr-rail__item.is-active .cr-rail__indicator {
  background: var(--secondary-container); color: var(--on-secondary-container);
}
.cr-rail--horizontal { flex-direction: row; width: 100%; padding: var(--space-1) var(--space-2); overflow-x: auto; }
.cr-rail--horizontal .cr-rail__item { width: auto; min-width: 72px; }

/* ---- Filled field: native <select> or <input> (surface-container-highest; no status colour) ----
   <label class="cr-field"><span class="cr-field__label">Прогон</span><select class="cr-field__control">…</select></label>
   Search: <label class="cr-field cr-field--search"><svg class="cr-field__icon">…</svg><input class="cr-field__control" type="search" placeholder="…"></label> */
.cr-field {
  position: relative; isolation: isolate; display: inline-flex; flex-direction: column; min-width: 168px; max-width: 100%;
  border-radius: var(--shape-xs) var(--shape-xs) 0 0; background: var(--surface-container-highest); color: var(--on-surface);
  box-shadow: inset 0 -1px 0 var(--on-surface-variant); vertical-align: middle;
}
.cr-field::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--on-surface);
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-standard); pointer-events: none;
}
.cr-field:hover::before { opacity: var(--state-hover); }
.cr-field:focus-within { box-shadow: inset 0 -2px 0 var(--primary); }
.cr-field:has(.cr-field__control:focus-visible) { outline: var(--focus-ring-width) solid var(--secondary); outline-offset: var(--focus-ring-offset); }
.cr-field__label {
  position: absolute; top: 8px; left: var(--space-4); right: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--on-surface-variant); font-size: var(--type-body-small-size); line-height: var(--type-body-small-line);
  letter-spacing: var(--type-body-small-tracking); pointer-events: none;
}
.cr-field:focus-within .cr-field__label { color: var(--primary); }
.cr-field__control {
  -webkit-appearance: none; appearance: none; width: 100%; height: 56px; margin: 0; padding: 24px 48px 6px var(--space-4);
  border: 0; border-radius: inherit; background: transparent; color: inherit; outline: none;
  font-family: inherit; font-size: var(--type-body-large-size); line-height: var(--type-body-large-line);
  letter-spacing: var(--type-body-large-tracking); text-overflow: ellipsis; cursor: pointer;
}
.cr-field__control:focus-visible { outline: none; }
.cr-field__control option { background: var(--surface-container-high); color: var(--on-surface); }
.cr-field__control::placeholder { color: var(--on-surface-variant); opacity: 1; }
.cr-field:has(select)::after, .cr-field--select::after {
  content: ""; position: absolute; top: 50%; right: 12px; width: 24px; height: 24px; margin-top: -12px;
  background: var(--on-surface-variant); pointer-events: none;
  -webkit-mask: var(--cr-mask-drop-down) center / 24px 24px no-repeat; mask: var(--cr-mask-drop-down) center / 24px 24px no-repeat;
}
.cr-field:not(:has(.cr-field__label)) .cr-field__control, .cr-field--no-label .cr-field__control { padding-top: 0; padding-bottom: 0; }
.cr-field--dense .cr-field__control { height: 48px; padding-top: 20px; padding-bottom: 4px; font-size: var(--type-body-medium-size); line-height: var(--type-body-medium-line); letter-spacing: var(--type-body-medium-tracking); }
.cr-field--dense .cr-field__label { top: 5px; }
.cr-field--dense:not(:has(.cr-field__label)) .cr-field__control { height: 40px; padding-top: 0; padding-bottom: 0; }
.cr-field--search .cr-field__icon { position: absolute; top: 50%; left: 12px; width: 24px; height: 24px; margin-top: -12px; color: var(--on-surface-variant); pointer-events: none; }
.cr-field--search .cr-field__control { padding-left: 48px; padding-right: var(--space-4); cursor: text; }
.cr-field--search .cr-field__label { left: 48px; }
.cr-field:has(.cr-field__control:disabled) { color: var(--text-disabled); box-shadow: inset 0 -1px 0 var(--text-disabled); }
.cr-field:has(.cr-field__control:disabled)::before { display: none; }
.cr-field:has(.cr-field__control:disabled) .cr-field__control { cursor: not-allowed; }

/* ---- Chips: interactive filter chips and a small chip for table cells ---- */
button.cr-chip { margin: 0; border: 0; font-family: inherit; cursor: pointer; }
.cr-chip--filter { background: transparent; color: var(--on-surface-variant); box-shadow: inset 0 0 0 1px var(--outline); }
.cr-chip--filter[aria-pressed="true"], .cr-chip--filter.is-selected { background: var(--secondary-container); color: var(--on-secondary-container); box-shadow: none; }
.cr-chip--sm { height: 24px; padding: 0 var(--space-2) 0 6px; }
.cr-chip--sm .cr-chip__glyph { font-size: 12px; }

/* ---- Segmented control additions (.cr-seg is DS §7) ---- */
.cr-seg--dense button { height: 32px; min-width: 48px; padding: 0 var(--space-3); }
.cr-seg button:disabled { color: var(--text-disabled); cursor: not-allowed; }
.cr-seg button:disabled::before { display: none; }
.cr-seg button[aria-pressed="true"] .cr-seg__check + svg { display: none; }  /* M3: the check replaces the icon */

/* ---- Cards: heading helpers ---- */
.cr-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.cr-card__title {
  margin: 0; font-size: var(--type-title-medium-size); line-height: var(--type-title-medium-line);
  font-weight: var(--type-title-medium-weight); letter-spacing: var(--type-title-medium-tracking);
}
.cr-card__sub {
  margin: 0; color: var(--on-surface-variant); font-size: var(--type-body-small-size);
  line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking);
}
.cr-subhead {
  margin: var(--space-4) 0 var(--space-2); color: var(--on-surface-variant); font-size: var(--type-title-small-size);
  line-height: var(--type-title-small-line); font-weight: var(--type-title-small-weight); letter-spacing: var(--type-title-small-tracking);
}

/* ---- Data table ----
   <div class="cr-table-wrap"><table class="cr-table"><thead><tr><th aria-sort="descending" class="cr-num">
   <button class="cr-table__sort cr-state">Шаги</button></th>…</tr></thead><tbody><tr tabindex="0" aria-selected="false">… */
.cr-table-wrap {
  max-width: 100%; overflow: auto; border: 1px solid var(--outline-variant); border-radius: var(--shape-md);
  background: var(--surface-container-lowest);
}
.cr-table {
  width: 100%; border-collapse: separate; border-spacing: 0; color: var(--on-surface);
  font-size: var(--type-body-medium-size); line-height: var(--type-body-medium-line); letter-spacing: var(--type-body-medium-tracking);
  font-variant-numeric: tabular-nums;
}
.cr-table caption { padding: var(--space-3) var(--space-4); text-align: left; color: var(--on-surface-variant); font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); caption-side: bottom; }
.cr-table th, .cr-table td {
  height: 48px; padding: 0 var(--space-4); border-bottom: 1px solid var(--outline-variant);
  text-align: left; vertical-align: middle; white-space: nowrap;
}
.cr-table thead th {
  position: sticky; top: 0; z-index: 1; height: 44px; background: var(--surface-container-highest); color: var(--on-surface);
  font-size: var(--type-title-small-size); line-height: var(--type-title-small-line);
  font-weight: var(--type-title-small-weight); letter-spacing: var(--type-title-small-tracking);
}
.cr-table tbody th { font-weight: 500; }
.cr-table tbody tr:last-child > * { border-bottom: 0; }
.cr-table .cr-num, .cr-table td.num, .cr-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cr-table .cr-wrap { white-space: normal; min-width: 16ch; }
.cr-table tbody tr { transition: background-color var(--dur-fast) var(--ease-standard); }
.cr-table tbody tr:hover { background: color-mix(in srgb, var(--on-surface) var(--state-hover-pct), transparent); }
.cr-table tbody tr[tabindex], .cr-table tbody tr.is-clickable, .cr-table--interactive tbody tr { cursor: pointer; }
.cr-table tbody tr:focus-visible { outline: var(--focus-ring-width) solid var(--secondary); outline-offset: calc(-1 * var(--focus-ring-width)); }
.cr-table tbody tr:focus-visible { background: color-mix(in srgb, var(--on-surface) var(--state-focus-pct), transparent); }
.cr-table tbody tr[aria-selected="true"], .cr-table tbody tr.is-selected { background: var(--secondary-container); color: var(--on-secondary-container); }
.cr-table tbody tr[aria-selected="true"]:hover, .cr-table tbody tr.is-selected:hover {
  background: color-mix(in srgb, var(--on-secondary-container) var(--state-hover-pct), var(--secondary-container));
}
.cr-table tbody tr[aria-selected="true"] .cr-muted, .cr-table tbody tr.is-selected .cr-muted { color: inherit; }
.cr-table--dense th, .cr-table--dense td { height: 36px; padding: 0 var(--space-3); }
.cr-table--dense thead th { height: 40px; }
/* Sortable header: a button inside th; the icon follows th[aria-sort] */
.cr-table__sort {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 32px; margin: 0 calc(-1 * var(--space-2));
  padding: 0 var(--space-2); border: 0; border-radius: var(--shape-full); background: transparent; color: inherit;
  font: inherit; letter-spacing: inherit; white-space: nowrap; cursor: pointer;
}
.cr-table__sort::after {
  content: ""; flex: none; width: 18px; height: 18px; background: currentColor; opacity: 0;
  -webkit-mask: var(--cr-mask-sort-none) center / 18px 18px no-repeat; mask: var(--cr-mask-sort-none) center / 18px 18px no-repeat;
  transition: opacity var(--dur-fast) var(--ease-standard);
}
.cr-table__sort:hover::after, .cr-table__sort:focus-visible::after { opacity: 1; }
th[aria-sort="ascending"] .cr-table__sort::after { opacity: 1; -webkit-mask-image: var(--cr-mask-sort-up); mask-image: var(--cr-mask-sort-up); }
th[aria-sort="descending"] .cr-table__sort::after { opacity: 1; -webkit-mask-image: var(--cr-mask-sort-down); mask-image: var(--cr-mask-sort-down); }
.cr-num .cr-table__sort, th.num .cr-table__sort { flex-direction: row-reverse; }

/* Matrix / heat cells (confusion matrix, run matrix): value always printed, colour never alone */
.cr-cell { text-align: right; font-variant-numeric: tabular-nums; }
.cr-cell__sub { display: block; font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking); }
.cr-cell__glyph { margin-right: var(--space-1); }
.cr-cell--seq-0 { background: var(--surface); color: var(--on-surface-variant); }
.cr-cell--seq-1 { background: var(--seq-1); color: var(--on-seq-1); }
.cr-cell--seq-2 { background: var(--seq-2); color: var(--on-seq-2); }
.cr-cell--seq-3 { background: var(--seq-3); color: var(--on-seq-3); }
.cr-cell--seq-4 { background: var(--seq-4); color: var(--on-seq-4); }
.cr-cell--seq-5 { background: var(--seq-5); color: var(--on-seq-5); }
.cr-cell--seq-6 { background: var(--seq-6); color: var(--on-seq-6); }
.cr-cell--seq-7 { background: var(--seq-7); color: var(--on-seq-7); }
.cr-cell--div-n3 { background: var(--div-n3); color: var(--on-div-n3); }
.cr-cell--div-n2 { background: var(--div-n2); color: var(--on-div-n2); }
.cr-cell--div-n1 { background: var(--div-n1); color: var(--on-div-n1); }
.cr-cell--div-0 { background: var(--div-0); color: var(--on-div-0); }
.cr-cell--div-p1 { background: var(--div-p1); color: var(--on-div-p1); }
.cr-cell--div-p2 { background: var(--div-p2); color: var(--on-div-p2); }
.cr-cell--div-p3 { background: var(--div-p3); color: var(--on-div-p3); }
.cr-cell--diag::before { content: var(--glyph-eval-correct); margin-right: var(--space-1); }
.cr-cell--under { box-shadow: inset 0 0 0 2px var(--eval-under); }
.cr-cell--under::before { content: var(--glyph-eval-under); margin-right: var(--space-1); }
.cr-cell--na { color: var(--on-surface-variant); font-size: var(--type-body-small-size); letter-spacing: var(--type-body-small-tracking); }
.cr-cell-btn {
  display: block; width: 100%; min-height: 40px; margin: 0; padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--shape-xs);
  background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-align: inherit; cursor: pointer;
}

/* Inline meter (e.g. detection credit): value is printed next to the bar */
.cr-meter { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 120px; width: 100%; }
.cr-meter__track { position: relative; flex: 1 1 auto; height: 8px; overflow: hidden; border-radius: var(--shape-full); background: var(--surface-container-highest); }
.cr-meter__fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--value, 0) * 100%); border-radius: inherit; background: var(--primary); }
.cr-meter__value { min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Side sheet (modal, trailing edge). surface-container-low so status chips inside stay legible ---- */
.cr-scrim {
  position: fixed; inset: 0; z-index: var(--z-scrim); background: var(--scrim); opacity: 0; visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-standard), visibility 0s linear var(--dur-base);
}
.cr-scrim.is-open, .cr-scrim[data-open="true"] {
  opacity: var(--scrim-opacity); visibility: visible; transition: opacity var(--dur-slow) var(--ease-standard);
}
.cr-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-sheet);
  display: flex; flex-direction: column; width: min(var(--sheet-width), 100vw); max-width: 100vw; height: 100%; max-height: 100vh;
  margin: 0; padding: 0; border: 0; border-radius: var(--shape-lg) 0 0 var(--shape-lg);
  background: var(--surface-container-low); color: var(--on-surface); box-shadow: var(--elevation-3);
  transform: translateX(100%); visibility: hidden;
  transition: transform var(--dur-base) var(--ease-emphasized-accelerate), visibility 0s linear var(--dur-base);
}
.cr-sheet.is-open, .cr-sheet[data-open="true"], dialog.cr-sheet[open] {
  transform: none; visibility: visible; transition: transform var(--dur-slow) var(--ease-emphasized-decelerate);
}
dialog.cr-sheet { inset: 0 0 0 auto; }
dialog.cr-sheet::backdrop { background: color-mix(in srgb, var(--scrim) var(--scrim-pct), transparent); }
.cr-sheet--wide { --sheet-width: 720px; }
.cr-sheet__header { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-6) var(--space-3) var(--space-4) var(--space-6); }
.cr-sheet__heading { flex: 1 1 auto; min-width: 0; }
.cr-sheet__title {
  margin: 0; font-size: var(--type-title-large-size); line-height: var(--type-title-large-line);
  font-weight: var(--type-title-large-weight); letter-spacing: var(--type-title-large-tracking); overflow-wrap: anywhere;
}
.cr-sheet__sub {
  margin: var(--space-1) 0 0; color: var(--on-surface-variant); font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line); letter-spacing: var(--type-body-medium-tracking);
}
.cr-sheet__body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 var(--space-6) var(--space-6); overscroll-behavior: contain; }
.cr-sheet__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--outline-variant); }
.cr-sheet__body h3, .cr-sheet__section-title {
  margin: var(--space-6) 0 var(--space-2); font-size: var(--type-title-small-size); line-height: var(--type-title-small-line);
  font-weight: var(--type-title-small-weight); letter-spacing: var(--type-title-small-tracking);
}
.cr-sheet__body p { margin: 0 0 var(--space-3); }

/* Key–value attribute list */
.cr-kv { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: var(--space-1) var(--space-4); margin: 0; }
.cr-kv dt { color: var(--on-surface-variant); font-size: var(--type-body-small-size); line-height: var(--type-body-medium-line); letter-spacing: var(--type-body-small-tracking); }
.cr-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Lists (episodes in a sheet) */
.cr-list { margin: 0; padding: 0; list-style: none; }
.cr-list > li + li, .cr-list__item + .cr-list__item { border-top: 1px solid var(--outline-variant); }
.cr-list__item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 56px; margin: 0;
  padding: var(--space-2) var(--space-4); border: 0; background: transparent; color: var(--on-surface);
  font: inherit; letter-spacing: inherit; text-align: left; text-decoration: none;
}
button.cr-list__item, a.cr-list__item { cursor: pointer; }
.cr-list__text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.cr-list__headline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-list__supporting { color: var(--on-surface-variant); font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking); }
.cr-list__trailing { flex: none; color: var(--on-surface-variant); font-size: var(--type-label-medium-size); line-height: var(--type-label-medium-line); font-weight: var(--type-label-medium-weight); letter-spacing: var(--type-label-medium-tracking); }

/* Two-lane strip (Разметка / Прогноз) — the track holds an SVG or canvas drawn from tokens */
.cr-strip { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--space-1) var(--space-2); align-items: center; }
.cr-strip__label { color: var(--on-surface-variant); font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking); }
.cr-strip__track { position: relative; height: 16px; min-width: 0; }
.cr-strip__track--line { height: 40px; }
.cr-strip__track > svg, .cr-strip__track > canvas { display: block; width: 100%; height: 100%; }

/* ---- Tooltips ---- */
.cr-tooltip {
  position: fixed; z-index: var(--z-tooltip); max-width: 320px; padding: var(--space-1) var(--space-2);
  border-radius: var(--shape-xs); background: var(--inverse-surface); color: var(--inverse-on-surface);
  font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking);
  pointer-events: none; opacity: 0; transition: opacity var(--dur-fast) var(--ease-standard);
}
.cr-tooltip.is-open, .cr-tooltip[data-open="true"] { opacity: 1; }
.cr-tooltip__title { display: block; font-weight: 500; }
.cr-tooltip__row { display: flex; justify-content: space-between; gap: var(--space-3); }
.cr-tooltip__row > :last-child { font-weight: 500; text-align: right; }
/* Rich tooltip: data surface (lowest) + elevation-2, so status chips / glyph words may appear inside */
.cr-tooltip--rich {
  max-width: 360px; padding: var(--space-3) var(--space-4); border-radius: var(--shape-md);
  background: var(--surface-container-lowest); color: var(--on-surface); box-shadow: var(--elevation-2);
  font-size: var(--type-body-medium-size); line-height: var(--type-body-medium-line); letter-spacing: var(--type-body-medium-tracking);
}
.cr-tooltip--rich .cr-tooltip__title { margin-bottom: var(--space-1); font-size: var(--type-title-small-size); line-height: var(--type-title-small-line); letter-spacing: var(--type-title-small-tracking); }
.cr-tooltip--rich .cr-tooltip__row > :first-child { color: var(--on-surface-variant); }

/* ---- Linear progress ---- */
.cr-progress { position: relative; width: 100%; height: 4px; overflow: hidden; border-radius: var(--shape-full); background: var(--secondary-container); }
.cr-progress__bar {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--value, 0) * 100%); border-radius: inherit; background: var(--primary);
  transition: width var(--dur-state) var(--ease-standard);
}
.cr-progress--indeterminate .cr-progress__bar { width: 40%; animation: cr-progress-slide 1600ms var(--ease-standard) infinite; }
@keyframes cr-progress-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---- Snackbar (inverse-surface, shape-sm, elevation-3) ---- */
.cr-snackbar {
  position: fixed; left: 50%; bottom: var(--space-4); z-index: var(--z-snackbar);
  display: flex; align-items: center; gap: var(--space-2); min-height: 48px; max-width: min(560px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4); border-radius: var(--shape-sm);
  background: var(--inverse-surface); color: var(--inverse-on-surface); box-shadow: var(--elevation-3);
  font-size: var(--type-body-medium-size); line-height: var(--type-body-medium-line); letter-spacing: var(--type-body-medium-tracking);
  opacity: 0; visibility: hidden; transform: translate(-50%, var(--space-4));
  transition: opacity var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard), visibility 0s linear var(--dur-base);
}
.cr-snackbar.is-open, .cr-snackbar[data-open="true"] {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
  transition: opacity var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-emphasized-decelerate);
}
.cr-snackbar__text { flex: 1 1 auto; padding: 10px 0; }
.cr-snackbar .cr-btn--text { color: var(--inverse-primary); }
.cr-snackbar .cr-btn--icon { color: var(--inverse-on-surface); }

/* ---- Empty / loading / error states ---- */
.cr-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 48px var(--space-6); text-align: center; color: var(--on-surface-variant);
  font-size: var(--type-body-large-size); line-height: var(--type-body-large-line); letter-spacing: var(--type-body-large-tracking);
}
.cr-empty__icon { width: 48px; height: 48px; color: var(--on-surface-variant); }
.cr-empty__title {
  margin: 0; color: var(--on-surface); font-size: var(--type-title-medium-size); line-height: var(--type-title-medium-line);
  font-weight: var(--type-title-medium-weight); letter-spacing: var(--type-title-medium-tracking);
}
.cr-empty__text { max-width: 60ch; margin: 0; }
.cr-empty .cr-progress { max-width: 240px; }
.cr-empty--compact { padding: var(--space-6) var(--space-4); font-size: var(--type-body-medium-size); line-height: var(--type-body-medium-line); letter-spacing: var(--type-body-medium-tracking); }
.cr-code {
  display: inline-block; padding: 2px var(--space-2); border-radius: var(--shape-xs); background: var(--surface-container-highest);
  color: var(--on-surface); font: inherit; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all;
}

/* ---- Pagination ---- */
.cr-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); color: var(--on-surface-variant);
  font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking);
}
.cr-pager__range { margin-right: var(--space-2); font-variant-numeric: tabular-nums; }
.cr-pager .cr-btn--icon:disabled { color: var(--text-disabled); }

/* ---- Help text, notes, divider ---- */
.cr-help { margin: var(--space-1) 0 0; color: var(--on-surface-variant); font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking); }
.cr-note {
  display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; padding: var(--space-3) var(--space-4);
  border-radius: var(--shape-sm); box-shadow: inset 0 0 0 1px var(--outline-variant); color: var(--on-surface-variant);
}
.cr-note > svg { flex: none; width: 20px; height: 20px; margin-top: 0; color: var(--on-surface-variant); }
.cr-divider { display: block; flex: none; height: 1px; margin: var(--space-2) 0; border: 0; background: var(--outline-variant); }
.cr-divider--inset { margin-left: var(--space-4); margin-right: var(--space-4); }
.cr-divider--vertical { width: 1px; height: auto; align-self: stretch; margin: 0 var(--space-2); }

/* ---- Chart frame (data surface; axis/grid/budget/threshold hooks for SVG) ---- */
.cr-chart {
  display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-4);
  border-radius: var(--shape-md); background: var(--surface-container-low); color: var(--on-surface);
}
.cr-chart--plain { padding: 0; background: transparent; }
.cr-chart__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.cr-chart__title {
  margin: 0; font-size: var(--type-title-medium-size); line-height: var(--type-title-medium-line);
  font-weight: var(--type-title-medium-weight); letter-spacing: var(--type-title-medium-tracking);
}
.cr-chart__sub { margin: 0; color: var(--on-surface-variant); font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking); }
.cr-chart__plot { position: relative; min-width: 0; }
.cr-chart__plot > svg, .cr-chart__plot > canvas { display: block; width: 100%; }
.cr-chart__scroll { overflow-x: auto; }
.cr-chart__canvas { display: block; image-rendering: pixelated; cursor: crosshair; }
.cr-chart svg { overflow: visible; font-family: var(--font-sans); }
.cr-chart svg text { fill: var(--on-surface-variant); font-size: var(--type-body-small-size); letter-spacing: var(--type-body-small-tracking); font-variant-numeric: tabular-nums; }
.cr-chart__axis line, .cr-chart__axis path { fill: none; stroke: var(--chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.cr-chart__grid line, .cr-chart__grid path { fill: none; stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.cr-chart__budget { fill: none; stroke: var(--chart-budget-line); stroke-width: 2; }
.cr-chart__threshold { fill: none; stroke: var(--chart-threshold); stroke-width: 1; stroke-dasharray: 4 4; }
.cr-chart__cursor { fill: none; stroke: var(--chart-cursor); stroke-width: 1; }
.cr-chart__band { fill: var(--chart-band); stroke: none; }
.cr-chart__incident { fill: var(--tertiary-container); stroke: none; }
.cr-chart__line { fill: none; stroke: var(--chart-series-1); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.cr-chart__bar { fill: var(--chart-pred); }
.cr-chart__pred { fill: none; stroke: var(--chart-pred); stroke-width: 1.5; }
.cr-chart__truth { fill: none; stroke: var(--chart-truth); stroke-width: 1.5; }
.cr-chart__truth-band { fill: none; stroke: var(--truth-outline); stroke-width: 1.5; }
.cr-chart__series--1 { stroke: var(--chart-series-1); color: var(--chart-series-1); }
.cr-chart__series--2 { stroke: var(--chart-series-2); color: var(--chart-series-2); }
.cr-chart__series--3 { stroke: var(--chart-series-3); color: var(--chart-series-3); }
.cr-chart__series--4 { stroke: var(--chart-series-4); color: var(--chart-series-4); }
.cr-chart svg .cr-chart__label { fill: var(--on-surface); }
.cr-chart svg .cr-chart__label--budget { fill: var(--status-danger-text); }
.cr-chart svg .cr-chart__label--threshold { fill: var(--on-surface-variant); }

/* Colour hooks for marks: set `color`, draw with fill/stroke="currentColor" (data surfaces only) */
.cr-fg--eval-correct { color: var(--eval-correct); } .cr-fg--eval-over { color: var(--eval-over); }
.cr-fg--eval-under { color: var(--eval-under); } .cr-fg--eval-abstain { color: var(--eval-abstain); }
.cr-fg--seg-open { color: var(--seg-open); } .cr-fg--seg-congested { color: var(--seg-congested); }
.cr-fg--seg-partial { color: var(--seg-partial); } .cr-fg--seg-closed { color: var(--seg-closed); } .cr-fg--seg-unknown { color: var(--seg-unknown); }
.cr-fg--src-ok { color: var(--src-ok); } .cr-fg--src-degraded { color: var(--src-degraded); }
.cr-fg--src-failed { color: var(--src-failed); } .cr-fg--src-unknown { color: var(--src-unknown); }
.cr-fg--lat-ok { color: var(--lat-ok); } .cr-fg--lat-warn { color: var(--lat-warn); } .cr-fg--lat-breach { color: var(--lat-breach); }
.cr-fg--ok { color: var(--status-ok-text); } .cr-fg--info { color: var(--status-info-text); } .cr-fg--warning { color: var(--status-warning-text); }
.cr-fg--danger { color: var(--status-danger-text); } .cr-fg--unknown { color: var(--status-unknown-text); }

/* ---- Legend pieces (swatch = the mark colour the chart draws; glyph + word beside it) ---- */
.cr-key {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin: 0; padding: 0; list-style: none;
  color: var(--on-surface); font-size: var(--type-body-small-size); line-height: var(--type-body-small-line); letter-spacing: var(--type-body-small-tracking);
}
.cr-key__item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cr-key__glyph { min-width: 1em; text-align: center; font-weight: 500; }
.cr-key__glyph--ok { color: var(--status-ok-text); } .cr-key__glyph--warning { color: var(--status-warning-text); }
.cr-key__glyph--danger { color: var(--status-danger-text); } .cr-key__glyph--unknown { color: var(--status-unknown-text); }
.cr-key__glyph--info { color: var(--status-info-text); }
.cr-swatch { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: var(--shape-xs); background: currentColor; vertical-align: middle; }
.cr-swatch--eval-correct { background: var(--eval-correct); }
.cr-swatch--eval-over { background: var(--eval-over); }
.cr-swatch--eval-under { background: var(--eval-under); }
.cr-swatch--eval-abstain { background: var(--eval-abstain); }
.cr-swatch--eval-quiet { background: var(--eval-correct-quiet); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.cr-swatch--eval-na { background: var(--eval-na); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.cr-swatch--seg-open { background: var(--seg-open); } .cr-swatch--seg-congested { background: var(--seg-congested); }
.cr-swatch--seg-partial { background: var(--seg-partial); } .cr-swatch--seg-closed { background: var(--seg-closed); }
.cr-swatch--seg-unknown { background: var(--seg-unknown); }
.cr-swatch--src-ok { background: var(--src-ok); } .cr-swatch--src-degraded { background: var(--src-degraded); }
.cr-swatch--src-failed { background: var(--src-failed); } .cr-swatch--src-unknown { background: var(--src-unknown); }
.cr-swatch--grp-main { background: var(--grp-main); } .cr-swatch--grp-north { background: var(--grp-north); }
.cr-swatch--grp-south { background: var(--grp-south); } .cr-swatch--grp-connector { background: var(--grp-connector); }
.cr-swatch--seq-1 { background: var(--seq-1); } .cr-swatch--seq-2 { background: var(--seq-2); } .cr-swatch--seq-3 { background: var(--seq-3); }
.cr-swatch--seq-4 { background: var(--seq-4); } .cr-swatch--seq-5 { background: var(--seq-5); } .cr-swatch--seq-6 { background: var(--seq-6); }
.cr-swatch--seq-7 { background: var(--seq-7); }
.cr-swatch--incident { background: var(--tertiary-container); box-shadow: inset 0 0 0 1px var(--tertiary); }
.cr-swatch--band { background: var(--chart-band); }
.cr-swatch--truth { background: transparent; box-shadow: inset 0 0 0 2px var(--truth-outline); }
.cr-swatch--line { width: 24px; height: 0; border-radius: 0; background: none; border-top: 2px solid currentColor; }
.cr-swatch--dashed { border-top-style: dashed; border-top-width: 1px; }
.cr-swatch--budget { color: var(--chart-budget-line); }
.cr-swatch--threshold { color: var(--chart-threshold); }
.cr-seq-ramp { display: inline-flex; gap: 2px; vertical-align: middle; }
.cr-seq-ramp > .cr-swatch { width: 12px; border-radius: 0; }

/* DS §6 MapLegend swatch lines (class names from the DS example) */
.cr-legend .s { fill: none; stroke-width: var(--seg-width-trunk); stroke-linecap: butt; }
.cr-legend .s.open { stroke: var(--seg-open); }
.cr-legend .s.cong { stroke: var(--seg-congested); stroke-width: calc(var(--seg-width-trunk) + var(--seg-congested-extra-width)); }
.cr-legend .s.part { stroke: var(--seg-partial); stroke-dasharray: var(--seg-partial-dash); }
.cr-legend .s.clos { stroke: var(--seg-closed); }
.cr-legend .s.unk { stroke: var(--seg-unknown); stroke-width: var(--seg-width-unknown); stroke-dasharray: var(--seg-unknown-dash); stroke-linecap: round; }
.cr-legend .chev { fill: none; stroke: var(--seg-congested); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cr-legend .tick { stroke: var(--seg-closed); stroke-width: 2; }

/* ---- Night canvas container (DS §7 .cr-night): always dark in both page themes ---- */
.cr-night { color-scheme: dark; }
.cr-night .cr-key, .cr-night .cr-legend { color: var(--on-surface); }

/* ---- Reduced motion: no transitions or animation; indeterminate progress becomes a static dashed bar ---- */
@media (prefers-reduced-motion: reduce) {
  .cr-state::before, .cr-rail__indicator, .cr-rail__indicator::before, .cr-field::before, .cr-table tbody tr,
  .cr-table__sort::after, .cr-scrim, .cr-sheet, .cr-tooltip, .cr-snackbar, .cr-progress__bar {
    transition: none !important;
  }
  .cr-progress--indeterminate .cr-progress__bar {
    width: 100%; animation: none;
    background: repeating-linear-gradient(90deg, var(--primary) 0 12px, transparent 12px 20px);
  }
}
