/* ============================================================================
   CHARTER · components.css — the PRODUCT UI library (what the system documents)
   ========================================================================== */

/* ====================== BUTTONS ====================== */
.btn {
  --_h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--_h); padding: 0 var(--space-4);
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: var(--weight-semibold);
  line-height: 1; letter-spacing: var(--tracking-snug);
  border-radius: var(--radius-md); border: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur), color var(--dur), box-shadow var(--dur), transform var(--dur-fast);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(0.5px); }
.btn [data-lucide] { width: 16px; height: 16px; }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--primary { background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow-xs); }
.btn--primary:hover { background: var(--accent-hover); }

.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--stone-400); }

.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }

.btn--subtle { background: var(--accent-soft); color: var(--accent-ink); }
.btn--subtle:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 14%); }

.btn--danger { background: var(--critical); color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--critical) 86%, #000); }

.btn--ai { background: var(--ai); color: #fff; }
.btn--ai:hover { background: color-mix(in srgb, var(--ai) 86%, #000); }

/* control heights climb on √φ: 30 → 38 (default) → 48 */
.btn--sm { --_h: 30px; padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn--lg { --_h: 48px; padding: 0 var(--space-6); font-size: var(--text-md); }
.btn--icon { width: var(--_h); padding: 0; }
.btn--block { display: flex; width: 100%; }

/* ====================== STATUS DOT ====================== */
.dot {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 500; color: var(--text);
}
.dot::before {
  content: ""; width: 9px; height: 9px; border-radius: 999px; flex: none;
  background: var(--stone-400);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stone-400) 18%, transparent);
}
.dot--strong::before   { background: var(--success);  box-shadow: 0 0 0 3px var(--success-soft); }
.dot--good::before     { background: var(--info);     box-shadow: 0 0 0 3px var(--info-soft); }
.dot--watch::before    { background: var(--warn);     box-shadow: 0 0 0 3px var(--warn-soft); }
.dot--action::before   { background: var(--urgent);   box-shadow: 0 0 0 3px var(--urgent-soft); }
.dot--critical::before { background: var(--critical); box-shadow: 0 0 0 3px var(--critical-soft); }

/* ====================== BADGE / PILL ====================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 600; line-height: 1;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge [data-lucide] { width: 12px; height: 12px; }
.badge--strong   { background: var(--success-soft);  color: var(--success-ink);  border-color: color-mix(in srgb, var(--success) 26%, transparent); }
.badge--good     { background: var(--info-soft);     color: var(--info-ink);     border-color: color-mix(in srgb, var(--info) 26%, transparent); }
.badge--watch    { background: var(--warn-soft);     color: var(--warn-ink);     border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge--action   { background: var(--urgent-soft);   color: var(--urgent-ink);   border-color: color-mix(in srgb, var(--urgent) 30%, transparent); }
.badge--critical { background: var(--critical-soft); color: var(--critical-ink); border-color: color-mix(in srgb, var(--critical) 30%, transparent); }
.badge--ai       { background: var(--ai-soft);       color: var(--ai-ink);       border-color: color-mix(in srgb, var(--ai) 28%, transparent); }

/* ====================== DUE PILL ====================== */
.due { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-sm); font-weight: 600; color: var(--warn-ink); }
.due [data-lucide] { width: 13px; height: 13px; }
.due--ok { color: var(--text-muted); }
.due--over { color: var(--critical-ink); }

/* ====================== HEALTH METER (●●●●◐) ====================== */
.health { display: inline-flex; align-items: center; gap: var(--space-2); }
.health__dots { display: inline-flex; gap: 3px; }
.health__dots i { width: 9px; height: 9px; border-radius: 999px; background: var(--border-strong); }
.health[data-level="5"] .health__dots i:nth-child(-n+5),
.health[data-level="4"] .health__dots i:nth-child(-n+4),
.health[data-level="3"] .health__dots i:nth-child(-n+3),
.health[data-level="2"] .health__dots i:nth-child(-n+2),
.health[data-level="1"] .health__dots i:nth-child(-n+1) { background: var(--success); }
.health[data-tone="watch"] .health__dots i { /* override when watch */ }
.health[data-tone="watch"][data-level="3"] .health__dots i:nth-child(-n+3) { background: var(--warn); }
.health__label { font-size: var(--text-sm); color: var(--text-muted); font-weight: 500; }

/* ====================== CONFIDENCE BAR ====================== */
.confidence { display: inline-flex; align-items: center; gap: var(--space-2); }
.confidence__track { display: block; width: 84px; height: 7px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.confidence__fill { display: block; height: 100%; border-radius: 999px; background: var(--ai); }
.confidence__val { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }

/* ====================== CHIPS (citation / source) ====================== */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: var(--radius-sm);
  font-size: var(--text-xs); font-weight: 600;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.chip [data-lucide] { width: 12px; height: 12px; color: var(--text-subtle); }
.chip--reg { font-family: var(--font-mono); font-weight: 500; color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.source-tag { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--text-subtle); }
.source-tag [data-lucide] { width: 12px; height: 12px; }
.ai-mark { display: inline-flex; width: 18px; height: 18px; border-radius: 5px; background: var(--ai-soft); color: var(--ai-ink); align-items: center; justify-content: center; }
.ai-mark [data-lucide] { width: 12px; height: 12px; }

/* ====================== CARD ====================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card__body { padding: var(--space-5); }

/* ====================== IMPACT CARD (signature molecule) ====================== */
.impact {
  width: min(560px, 100%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
  border-left: 3px solid var(--urgent);
}
.impact--med { border-left-color: var(--warn); }
.impact__top { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-5) 0; }
.impact__top .due { margin-left: auto; }
.impact__title { padding: var(--space-2) var(--space-5) 0; font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); line-height: var(--leading-snug); letter-spacing: var(--tracking-snug); }
.impact__why { padding: var(--space-3) var(--space-5) 0; font-size: var(--text-base); color: var(--text-muted); line-height: var(--leading-snug); }
.impact__why b { color: var(--text); font-weight: 600; }
.impact__staged { margin: var(--space-4) var(--space-5) 0; padding: var(--space-3) var(--space-4); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.impact__staged-label { font-size: var(--text-xs); font-weight: 600; color: var(--text-subtle); text-transform: uppercase; letter-spacing: var(--tracking-wide); margin-bottom: var(--space-2); }
.impact__staged ul { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.impact__staged li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.impact__staged li [data-lucide] { width: 14px; height: 14px; color: var(--success); }
.impact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-5) var(--space-5); }
.impact__actions .spacer { flex: 1; }
.linkish { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); padding: 6px 8px; border-radius: var(--radius-sm); }
.linkish:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.linkish [data-lucide] { width: 14px; height: 14px; }

/* ====================== FORM CONTROLS ====================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.req { color: var(--urgent); margin-left: 2px; }
.field__hint { font-size: var(--text-sm); color: var(--text-subtle); }
.field__error { font-size: var(--text-sm); color: var(--critical-ink); display: flex; align-items: center; gap: 5px; }
.field__error [data-lucide] { width: 13px; height: 13px; }
.field__success { font-size: var(--text-sm); color: var(--success-ink); display: flex; align-items: center; gap: 5px; }
.field__success [data-lucide] { width: 13px; height: 13px; }

.input, .textarea, .select__el {
  width: 100%; height: 38px; padding: 0 var(--space-3);
  font: inherit; font-size: var(--text-base); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur), background var(--dur);
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .textarea:hover, .select__el:hover { border-color: var(--stone-400); }
.input:focus, .textarea:focus, .select__el:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input:disabled, .textarea:disabled, .select__el:disabled { background: var(--surface-2); color: var(--text-subtle); cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--critical); box-shadow: 0 0 0 3px var(--critical-soft); }
.input.is-valid, .textarea.is-valid, .select__el.is-valid { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.input.is-valid:focus, .textarea.is-valid:focus { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.input--sm { height: 30px; font-size: var(--text-sm); border-radius: var(--radius-sm); }
.input--lg { height: 48px; }
.textarea { height: auto; min-height: 92px; padding: var(--space-2) var(--space-3); line-height: var(--leading-normal); resize: vertical; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 38px; }
.input-group--suffix .input { padding-left: var(--space-3); padding-right: 38px; }
.input-group__icon { position: absolute; left: 11px; color: var(--text-subtle); display: flex; pointer-events: none; }
.input-group--suffix .input-group__icon { left: auto; right: 11px; }
.input-group__icon [data-lucide] { width: 16px; height: 16px; }
.input-group__btn { position: absolute; right: 9px; color: var(--text-subtle); display: flex; }
.input-group__btn:hover { color: var(--text); }
.input-group__btn [data-lucide] { width: 15px; height: 15px; }

/* text addons (prefix / suffix) — $ , % , https:// */
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); }
.input-affix:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.input-affix .input { border: 0; box-shadow: none; flex: 1; min-width: 0; border-radius: 0; background: transparent; }
.input-affix .input:focus { box-shadow: none; }
.input-affix__addon { display: inline-flex; align-items: center; padding: 0 var(--space-3); background: var(--surface-2); color: var(--text-muted); font-size: var(--text-base); white-space: nowrap; }
.input-affix__addon:first-child { border-right: 1px solid var(--border); border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-affix__addon:last-child { border-left: 1px solid var(--border); border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* number stepper */
.stepper-num { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.stepper-num:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.stepper-num input { width: 52px; height: 36px; text-align: center; border: 0; background: transparent; font: inherit; color: var(--text); outline: none; -moz-appearance: textfield; }
.stepper-num input::-webkit-outer-spin-button, .stepper-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-num button { width: 34px; background: var(--surface-2); border: 0; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; }
.stepper-num button:hover { background: var(--surface-sunken); color: var(--text); }
.stepper-num button:first-child { border-right: 1px solid var(--border); }
.stepper-num button:last-child { border-left: 1px solid var(--border); }
.stepper-num button [data-lucide] { width: 15px; height: 15px; }

.select { position: relative; display: block; }
.select__el { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--text-subtle); border-bottom: 2px solid var(--text-subtle); transform: rotate(45deg); pointer-events: none; }
.select--sm .select__el { height: 30px; font-size: var(--text-sm); padding: 0 26px 0 var(--space-2); border-radius: var(--radius-sm); }
.select--sm::after { right: 10px; width: 7px; height: 7px; margin-top: -5px; border-width: 0 1.5px 1.5px 0; }
.select--xs .select__el { height: 26px; font-size: var(--text-sm); padding: 0 24px 0 8px; border-radius: var(--radius-sm); }
.select--xs::after { right: 9px; width: 6px; height: 6px; margin-top: -4px; border-width: 0 1.5px 1.5px 0; }

.check { display: inline-flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; font-size: var(--text-base); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box { flex: none; width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface); display: grid; place-items: center; transition: background var(--dur), border-color var(--dur); }
.check__box [data-lucide] { width: 12px; height: 12px; color: #fff; opacity: 0; stroke-width: 3; }
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box [data-lucide] { opacity: 1; }
.check input:focus-visible + .check__box { box-shadow: var(--focus-ring); }
.check--radio .check__box { border-radius: 999px; }
.check--radio .check__box .check__dot { width: 8px; height: 8px; border-radius: 999px; background: #fff; opacity: 0; }
.check--radio input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check--radio input:checked + .check__box .check__dot { opacity: 1; }
.check__text small { display: block; color: var(--text-subtle); font-size: var(--text-sm); font-weight: 400; }

.switch { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background var(--dur); flex: none; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-xs); transition: transform var(--dur) var(--ease); }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus-ring); }

.form { display: flex; flex-direction: column; gap: var(--space-5); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-section__title { font-weight: 600; margin-bottom: var(--space-1); }
.form-actions { display: flex; gap: var(--space-2); justify-content: flex-end; border-top: 1px solid var(--border); padding-top: var(--space-4); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ====================== SEARCH & COMMAND ====================== */
.searchbar { display: flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-3); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); color: var(--text-subtle); }
.searchbar:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.searchbar [data-lucide] { width: 17px; height: 17px; }
.searchbar input { flex: 1; border: none; background: none; outline: none; font-size: var(--text-base); color: var(--text); min-width: 0; }
.searchbar kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }

.omnibox { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.omnibox__input { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-bottom: 1px solid var(--border); }
.omnibox__input [data-lucide] { width: 19px; height: 19px; color: var(--ai); }
.omnibox__input input { flex: 1; border: none; background: none; outline: none; font-size: var(--text-lg); color: var(--text); }
.omnibox__results { max-height: 340px; overflow: auto; padding: var(--space-2); }
.result-group__label { padding: var(--space-2) var(--space-3) var(--space-1); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-subtle); }
.result { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); color: var(--text); cursor: pointer; }
.result:hover, .result.is-active { background: var(--surface-2); }
.result.is-ai:hover, .result.is-ai.is-active { background: var(--ai-soft); }
.result__icon { width: 30px; height: 30px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-muted); flex: none; }
.result.is-ai .result__icon { background: var(--ai-soft); color: var(--ai-ink); }
.result__icon [data-lucide] { width: 15px; height: 15px; }
.result__body { flex: 1; min-width: 0; }
.result__title { display: block; font-size: var(--text-base); font-weight: 500; line-height: 1.3; }
.result__meta { display: block; font-size: var(--text-sm); color: var(--text-subtle); line-height: 1.3; }
.result__kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); margin-left: auto; }
.omnibox__foot { display: flex; gap: var(--space-4); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-subtle); background: var(--surface-2); }
.omnibox__foot kbd { font-family: var(--font-mono); }

/* ====================== STEP NAVIGATION ====================== */
.stepper { display: flex; align-items: flex-start; }
.stepper__step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; gap: var(--space-2); }
.stepper__step:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: calc(50% + 19px); right: calc(-50% + 19px); height: 2px; background: var(--border-strong); }
.stepper__step.is-done::after { background: var(--accent); }
.stepper__dot { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-subtle); font-size: var(--text-sm); font-weight: 600; z-index: 1; }
.stepper__dot [data-lucide] { width: 15px; height: 15px; }
.stepper__step.is-done .stepper__dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper__step.is-active .stepper__dot { border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper__label { font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); max-width: 120px; }
.stepper__step.is-active .stepper__label { color: var(--text); font-weight: 600; }

.vstepper { display: flex; flex-direction: column; }
.vstep { display: grid; grid-template-columns: 30px 1fr; gap: var(--space-3); position: relative; padding-bottom: var(--space-5); }
.vstep:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--border-strong); }
.vstep.is-done::before { background: var(--accent); }
.vstep__dot { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-subtle); font-size: var(--text-sm); font-weight: 600; z-index: 1; }
.vstep__dot [data-lucide] { width: 15px; height: 15px; }
.vstep.is-done .vstep__dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.vstep.is-active .vstep__dot { border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.vstep__body { padding-top: 4px; }
.vstep__title { font-weight: 600; font-size: var(--text-base); }
.vstep.is-todo .vstep__title { color: var(--text-muted); font-weight: 500; }
.vstep__meta { font-size: var(--text-sm); color: var(--text-subtle); margin-top: 2px; }

/* ====================== DATA TABLE ====================== */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.table-toolbar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar .searchbar { height: 34px; width: min(260px, 45%); }
.table-toolbar__spacer { flex: 1; }
.dtable { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.dtable thead th { text-align: left; padding: var(--space-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-subtle); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.dtable th.is-sortable { cursor: pointer; }
.dtable th.is-sortable:hover { color: var(--text); }
.dtable th .sort { display: inline-flex; align-items: center; gap: 4px; }
.dtable th .sort [data-lucide] { width: 13px; height: 13px; opacity: .7; }
.dtable td { padding: var(--space-3); border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.dtable tbody tr:last-child td { border-bottom: none; }
.dtable tbody tr:hover td { background: var(--surface-2); }
.dtable tr.is-selected td { background: var(--accent-soft); }
.dtable .col-check { width: 42px; }
.dtable .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.dtable .cell-strong { font-weight: 600; }
.dtable--compact td, .dtable--compact thead th { padding: 7px var(--space-3); }
.table-foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-top: 1px solid var(--border); font-size: var(--text-sm); color: var(--text-muted); }
.table-foot__spacer { flex: 1; }
.owner { display: inline-flex; align-items: center; gap: var(--space-2); }
.avatar { width: 24px; height: 24px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
.avatar--lg { width: 36px; height: 36px; font-size: 13px; }
.avatar--bank { background: var(--info-soft); color: var(--info-ink); border-radius: 7px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.pager { display: inline-flex; align-items: center; gap: 2px; }
.pager button { min-width: 30px; height: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); }
.pager button:hover { background: var(--surface-2); color: var(--text); }
.pager .is-current { background: var(--accent); color: #fff; }
.pager [data-lucide] { width: 15px; height: 15px; }

/* ====================== FILE UPLOAD ====================== */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2); padding: var(--space-10) var(--space-6); text-align: center; transition: border-color var(--dur), background var(--dur); cursor: pointer; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__icon { width: 48px; height: 48px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto var(--space-3); color: var(--accent-ink); }
.dropzone__icon [data-lucide] { width: 22px; height: 22px; }
.dropzone__title { font-weight: 600; }
.dropzone__title b { color: var(--accent-ink); }
.dropzone__hint { font-size: var(--text-sm); color: var(--text-subtle); margin-top: 4px; }
.filelist { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-4); }
.file-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.file-item__icon { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-muted); flex: none; }
.file-item__icon [data-lucide] { width: 16px; height: 16px; }
.file-item__body { flex: 1; min-width: 0; }
.file-item__name { display: block; font-size: var(--text-base); font-weight: 500; }
.file-item__meta { display: block; font-size: var(--text-sm); color: var(--text-subtle); margin-top: 1px; }
.file-item__bar { display: block; height: 5px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; margin-top: 6px; }
.file-item__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.file-item.is-done .file-item__icon { background: var(--success-soft); color: var(--success-ink); }
.file-item.is-error .file-item__icon { background: var(--critical-soft); color: var(--critical-ink); }

/* ====================== RICH TEXT EDITOR ====================== */
.editor { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.editor__toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: var(--space-2); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ed-btn { min-width: 32px; height: 32px; padding: 0 7px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; color: var(--text-muted); font-weight: 600; font-size: var(--text-sm); }
.ed-btn:hover { background: var(--surface); color: var(--text); }
.ed-btn.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.ed-btn [data-lucide] { width: 16px; height: 16px; }
.ed-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.ed-select { height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--text-sm); color: var(--text); }
.editor__content { padding: var(--space-6) var(--space-8); min-height: 280px; line-height: var(--leading-relaxed); }
.editor__content h2 { font-size: var(--text-xl); margin: var(--space-5) 0 var(--space-2); }
.editor__content h3 { font-size: var(--text-lg); margin: var(--space-4) 0 var(--space-2); }
.editor__content p { margin-bottom: var(--space-3); color: var(--text); }
.editor__content ul, .editor__content ol { margin-bottom: var(--space-3); color: var(--text); }
.editor__foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border); font-size: var(--text-sm); color: var(--text-subtle); background: var(--surface-2); }
.editor__foot .spacer { flex: 1; }

/* ====================== BANNERS / ALERTS ====================== */
.banner { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid; font-size: var(--text-base); align-items: flex-start; }
.banner > [data-lucide] { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.banner__body { flex: 1; }
.banner__body b { font-weight: 600; }
.banner__close { color: inherit; opacity: .55; display: flex; }
.banner__close:hover { opacity: 1; }
.banner--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 26%, transparent); color: var(--info-ink); }
.banner--success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 26%, transparent); color: var(--success-ink); }
.banner--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn-ink); }
.banner--critical { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 30%, transparent); color: var(--critical-ink); }
.banner--ai { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 28%, transparent); color: var(--ai-ink); }

/* ====================== TOAST ====================== */
.toast { display: flex; align-items: flex-start; gap: var(--space-3); width: min(380px, 100%); padding: var(--space-3) var(--space-4); background: var(--stone-900); color: var(--stone-50); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.toast > [data-lucide] { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.toast--success > [data-lucide] { color: #77D3A3; }
.toast--ai > [data-lucide] { color: #AF9DF5; }
.toast__body { flex: 1; font-size: var(--text-base); }
.toast__body small { display: block; color: var(--stone-400); margin-top: 2px; }
.toast__action { color: #fff; font-weight: 600; font-size: var(--text-sm); white-space: nowrap; }

/* ====================== MODAL ====================== */
.modal-scrim { background: rgba(20,20,16,.5); border-radius: var(--radius-lg); padding: var(--space-10); display: grid; place-items: center; }
.modal { width: min(440px, 100%); background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal__head { padding: var(--space-5) var(--space-5) 0; }
.modal__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: var(--space-3); background: var(--accent-soft); color: var(--accent-ink); }
.modal__icon [data-lucide] { width: 20px; height: 20px; }
.modal__icon--danger { background: var(--critical-soft); color: var(--critical-ink); }
.modal__title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.modal__body { padding: var(--space-2) var(--space-5) var(--space-5); color: var(--text-muted); }
.modal__foot { display: flex; gap: var(--space-2); justify-content: flex-end; padding: var(--space-4) var(--space-5); background: var(--surface-2); border-top: 1px solid var(--border); }

/* ====================== TOOLTIP / POPOVER ====================== */
.tip__bubble { display: inline-block; background: var(--stone-900); color: var(--stone-50); font-size: var(--text-sm); padding: 6px 10px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); position: relative; }
.tip__bubble::after { content: ""; position: absolute; bottom: -5px; left: 18px; border: 5px solid transparent; border-top-color: var(--stone-900); border-bottom: 0; }
.popover { width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: var(--space-4); }
.popover__title { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-1); display: flex; align-items: center; gap: 6px; }
.popover__title [data-lucide] { width: 14px; height: 14px; color: var(--ai-ink); }
.popover__body { font-size: var(--text-sm); color: var(--text-muted); line-height: var(--leading-snug); }

/* ====================== EMPTY / LOADING ====================== */
.empty { text-align: center; padding: var(--space-10) var(--space-6); }
.empty__icon { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto var(--space-4); color: var(--text-subtle); }
.empty__icon [data-lucide] { width: 24px; height: 24px; }
.empty__title { font-weight: 600; font-size: var(--text-md); }
.empty__body { color: var(--text-muted); font-size: var(--text-base); margin-top: var(--space-1); max-width: 44ch; margin-inline: auto; }
.empty__actions { margin-top: var(--space-4); display: flex; gap: var(--space-2); justify-content: center; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-sunken) 50%, var(--surface-2) 75%); background-size: 200% 100%; border-radius: var(--radius-sm); animation: sk 1.4s ease infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton--text { height: 12px; }
.skeleton--line { height: 14px; }
.skeleton--block { height: 80px; border-radius: var(--radius-md); }
.skeleton--circle { width: 40px; height: 40px; border-radius: 999px; }
.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; flex: none; }
.spinner--lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { display: block; height: 8px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.progress__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress--ai .progress__fill { background: var(--ai); }
.streaming { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--ai-soft); border: 1px solid color-mix(in srgb, var(--ai) 24%, transparent); border-radius: var(--radius-md); color: var(--ai-ink); font-size: var(--text-base); }
.streaming .spinner { border-color: color-mix(in srgb, var(--ai) 30%, transparent); border-top-color: var(--ai); }

/* ====================== TABS / BREADCRUMBS / SEGMENTED / MENU ====================== */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); }
.tab { padding: var(--space-2) var(--space-3); font-size: var(--text-base); font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab [data-lucide] { width: 15px; height: 15px; }
.tab__count { font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; color: var(--text-muted); }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); gap: 2px; }
.segmented button { padding: 5px var(--space-3); font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); border-radius: 6px; }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

.crumbs { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-subtle); flex-wrap: wrap; }
.crumbs a { color: var(--text-muted); font-weight: 500; }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs__sep { color: var(--border-strong); }
.crumbs .is-current { color: var(--text); font-weight: 600; }

.menu { width: 224px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: var(--space-1); }
.menu__item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-base); color: var(--text); cursor: pointer; }
.menu__item:hover { background: var(--surface-2); }
.menu__item [data-lucide] { width: 15px; height: 15px; color: var(--text-subtle); }
.menu__item .menu__kbd { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); }
.menu__item--danger { color: var(--critical-ink); }
.menu__item--danger [data-lucide] { color: var(--critical-ink); }
.menu__sep { height: 1px; background: var(--border); margin: var(--space-1) 0; }
.menu__label { padding: var(--space-1) var(--space-3); font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-subtle); font-weight: 600; }

.fpill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--space-3); border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--text-sm); font-weight: 500; color: var(--text-muted); }
.fpill:hover { border-color: var(--stone-400); color: var(--text); }
.fpill.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent-ink); }
.fpill [data-lucide] { width: 14px; height: 14px; }

/* ====================== STAT TILE / KEY-VALUE ====================== */
.stat { padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.stat__label { font-size: var(--text-sm); color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.stat__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; margin-top: var(--space-1); }
.stat__trend { font-size: var(--text-sm); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; }
.stat__trend.up { color: var(--success-ink); }
.stat__trend.down { color: var(--critical-ink); }
.stat__trend [data-lucide] { width: 14px; height: 14px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: var(--space-2) var(--space-4); font-size: var(--text-base); }
.kv dt { color: var(--text-subtle); }
.kv dd { color: var(--text); font-weight: 500; }

/* ====================== CARDS (extended) ====================== */
.card__head { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--space-3); }
.card__title { font-weight: 600; font-size: var(--text-md); font-family: var(--font-display); }
.card__foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; gap: var(--space-2); }
.card--link { display: block; transition: box-shadow var(--dur), transform var(--dur), border-color var(--dur); }
.card--link:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); text-decoration: none; }
.phc__rows { display: flex; flex-direction: column; gap: var(--space-2); }
.phc__row { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-sm); }
.phc__row .k { color: var(--text-muted); }
.phc__row .v { font-weight: 600; }

/* ====================== AVATARS (extended) ====================== */
.avatar--sm { width: 20px; height: 20px; font-size: 10px; }
.avatar--xl { width: 48px; height: 48px; font-size: 17px; border-radius: 13px; }
.avatar-wrap { position: relative; display: inline-flex; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 999px; border: 2px solid var(--surface); background: var(--success); }
.presence--away { background: var(--warn); }
.presence--off { background: var(--stone-400); }
.userline { display: inline-flex; align-items: center; gap: var(--space-2); }
.userline__name { font-weight: 500; }
.userline__sub { color: var(--text-subtle); font-size: var(--text-sm); }

/* ====================== TIMELINE / ACTIVITY ====================== */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); position: relative; padding-bottom: var(--space-4); }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 28px; height: 28px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-muted); z-index: 1; }
.tl-dot [data-lucide] { width: 14px; height: 14px; }
.tl-dot.is-ai { background: var(--ai-soft); color: var(--ai-ink); border-color: color-mix(in srgb, var(--ai) 24%, transparent); }
.tl-dot.is-done { background: var(--success-soft); color: var(--success-ink); border-color: color-mix(in srgb, var(--success) 24%, transparent); }
.tl-body { padding-top: 3px; }
.tl-body__text { font-size: var(--text-base); }
.tl-body__text b { font-weight: 600; }
.tl-body__time { font-size: var(--text-xs); color: var(--text-subtle); font-family: var(--font-mono); margin-top: 2px; }

/* ====================== FINDINGS BOARD ====================== */
.findings { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.findings__group-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--surface-2); font-size: var(--text-sm); font-weight: 600; border-bottom: 1px solid var(--border); }
.findings__group-head .count { color: var(--text-subtle); font-weight: 500; }
.finding { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.finding:last-child { border-bottom: none; }
.finding__check { margin-top: 2px; }
.finding__body { flex: 1; min-width: 0; }
.finding__title { font-weight: 500; }
.finding__sub { font-size: var(--text-sm); color: var(--text-subtle); margin-top: 3px; display: flex; gap: var(--space-3); flex-wrap: wrap; }
.finding__sub a { color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.finding__sub a:hover { color: var(--text); text-decoration: none; }
.finding__sub a [data-lucide] { width: 13px; height: 13px; }

/* ====================== RISK HEATMAP / ROLLUP ====================== */
.heatmap { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.heatmap th { text-align: left; padding: var(--space-2) var(--space-3); font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-subtle); border-bottom: 1px solid var(--border); }
.heatmap td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.heatmap tr:last-child td { border-bottom: none; }
.risk-cell { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.risk-cell::before { content: ""; width: 11px; height: 11px; border-radius: 3px; }
.risk-low { color: var(--success-ink); } .risk-low::before { background: var(--success); }
.risk-mod { color: var(--warn-ink); } .risk-mod::before { background: var(--warn); }
.risk-high { color: var(--urgent-ink); } .risk-high::before { background: var(--urgent); }
.residual { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); background: var(--surface-2); border-radius: var(--radius-md); border: 1px solid var(--border); }
.residual__label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-subtle); font-weight: 600; }
.residual__value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; }

/* ====================== EVIDENCE CHIP ====================== */
.evidence-chip { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.evidence-chip__icon { width: 32px; height: 32px; border-radius: 7px; background: var(--success-soft); color: var(--success-ink); display: grid; place-items: center; flex: none; }
.evidence-chip__icon [data-lucide] { width: 15px; height: 15px; }
.evidence-chip__body { flex: 1; min-width: 0; }
.evidence-chip__name { display: block; font-weight: 500; font-size: var(--text-base); }
.evidence-chip__meta { display: block; font-size: var(--text-sm); color: var(--text-subtle); margin-top: 1px; }

/* ====================== ASSISTANT (Argus) ====================== */
.assistant { width: 340px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.assistant__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.assistant__head .name { font-weight: 600; }
.assistant__ctx { font-size: var(--text-xs); color: var(--text-subtle); margin-left: auto; }
.assistant__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.msg--user { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); max-width: 85%; font-size: var(--text-base); }
.msg--ai { display: flex; gap: var(--space-2); }
.msg--ai .ai-mark { margin-top: 2px; }
.msg__text { line-height: var(--leading-snug); font-size: var(--text-base); }
.msg__text .cite { color: var(--ai-ink); font-weight: 600; cursor: pointer; }
.msg__actions { display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-2); align-items: flex-start; }
.msg__action { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--ai-ink); padding: 5px 8px; border-radius: var(--radius-sm); }
.msg__action:hover { background: var(--ai-soft); }
.msg__action [data-lucide] { width: 14px; height: 14px; }
.assistant__input { padding: var(--space-3); border-top: 1px solid var(--border); }

/* ====================== WORKFLOW RUNNER ====================== */
.runner { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.runner__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.runner__title { font-weight: 600; font-family: var(--font-display); font-size: var(--text-md); }
.runner__grid { display: grid; grid-template-columns: 232px 1fr 288px; min-height: 440px; }
.runner__rail { border-right: 1px solid var(--border); padding: var(--space-5) var(--space-4); overflow: auto; }
.runner__canvas { padding: var(--space-6); }
.runner__ctx { border-left: 1px solid var(--border); padding: var(--space-5) var(--space-4); background: var(--surface-2); }
.runner__ctx h4 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-subtle); margin-bottom: var(--space-2); }
.runner__foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); background: var(--surface-2); font-size: var(--text-sm); color: var(--text-muted); }
.runner__dots { display: flex; gap: 5px; }
.runner__dots i { width: 8px; height: 8px; border-radius: 999px; background: var(--border-strong); }
.runner__dots i.on { background: var(--accent); }
@media (max-width: 900px) { .runner__grid { grid-template-columns: 1fr; } .runner__rail, .runner__ctx { border: none; border-bottom: 1px solid var(--border); } }

/* ====================== DASHBOARD / TODAY ====================== */
.needsyou { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.needsyou__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.needsyou__item:last-child { border-bottom: none; }
.needsyou__num { width: 24px; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); flex: none; }
.needsyou__text { flex: 1; }
.needsyou__tag { font-size: var(--text-xs); color: var(--text-subtle); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-4); }
.dash-cols { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-5); }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }

/* ====================== RADAR FEED ====================== */
.radar-tier { font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: var(--space-2); margin: var(--space-6) 0 var(--space-3); }
.radar-tier .count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: 11px; color: var(--text-subtle); }
.horizon { display: flex; align-items: stretch; gap: 0; padding: var(--space-5) var(--space-4) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow-x: auto; }
.horizon__pt { flex: 1; min-width: 110px; text-align: center; position: relative; padding-top: var(--space-5); }
.horizon__pt::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--border-strong); }
.horizon__pt:first-child::before { left: 50%; }
.horizon__pt:last-child::before { right: 50%; }
.horizon__dot { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); width: 11px; height: 11px; border-radius: 999px; background: var(--accent); border: 2px solid var(--surface); }
.horizon__label { font-size: var(--text-sm); font-weight: 600; }
.horizon__date { font-size: var(--text-xs); color: var(--text-subtle); margin-top: 2px; }

/* ====================== SLIDER / COMBOBOX / TOKENS (advanced inputs) ====================== */
.combo { position: relative; }
.combo__list { position: static; margin-top: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); padding: var(--space-1); }
.combo__opt { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-base); cursor: pointer; }
.combo__opt:hover, .combo__opt.is-active { background: var(--surface-2); }
.combo__opt mark { background: transparent; color: var(--accent-ink); font-weight: 600; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 38px; padding: 5px var(--space-2); border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); }
.token { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 6px 0 9px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); font-size: var(--text-sm); font-weight: 500; }
.token button { display: flex; color: inherit; opacity: .7; }
.token button:hover { opacity: 1; }
.token [data-lucide] { width: 12px; height: 12px; }
.tokens input { flex: 1; min-width: 80px; border: none; outline: none; background: none; font-size: var(--text-base); }
.range { width: 100%; accent-color: var(--accent); }

/* ====================== CHARTS / DATA VIZ ====================== */
.legend { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-sm); color: var(--text-muted); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { width: 10px; height: 10px; border-radius: 3px; }
.barchart { display: flex; align-items: flex-end; gap: var(--space-3); height: 170px; }
.barchart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barchart__bar { width: 100%; max-width: 40px; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 3px; transition: height var(--dur); }
.barchart__bar.is-muted { background: var(--border-strong); }
.barchart__label { font-size: var(--text-xs); color: var(--text-subtle); }
.barchart__val { font-size: var(--text-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.spark { display: block; overflow: visible; }
.axis { font-size: 10px; fill: var(--text-subtle); font-family: var(--font-sans); }
.donut-wrap { position: relative; display: inline-grid; place-items: center; }
.donut { transform: rotate(-90deg); }
.donut-center { position: absolute; text-align: center; line-height: 1; }
.donut-center b { display: block; font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; line-height: 1; }
.donut-center small { display: block; font-size: var(--text-xs); color: var(--text-subtle); line-height: 1; margin-top: 3px; }
.heatstrip { display: flex; height: 16px; border-radius: 999px; overflow: hidden; }
.heatstrip span { flex: 1; }

/* ====================== SYSTEM & EDGE STATES ====================== */
.errorpage { text-align: center; padding: var(--space-16) var(--space-6); max-width: 480px; margin: 0 auto; }
.errorpage__code { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.errorpage__icon { width: 56px; height: 56px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto var(--space-4); color: var(--text-muted); }
.errorpage__icon [data-lucide] { width: 26px; height: 26px; }
.errorpage__title { font-family: var(--font-display); font-size: var(--text-xl); margin-top: var(--space-2); }
.errorpage__body { color: var(--text-muted); margin-top: var(--space-2); line-height: var(--leading-relaxed); }
.errorpage__actions { margin-top: var(--space-5); display: flex; gap: var(--space-2); justify-content: center; }
.gate { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.gate__teaser { padding: var(--space-6); filter: blur(3px); opacity: .55; pointer-events: none; user-select: none; }
.gate__overlay { padding: var(--space-6); text-align: center; border-top: 1px solid var(--border); background: var(--surface-2); }
.gate__lock { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; margin: 0 auto var(--space-3); }
.gate__lock [data-lucide] { width: 20px; height: 20px; }
.imp-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent); border-radius: var(--radius-md); color: var(--warn-ink); font-size: var(--text-sm); }
.imp-bar b { font-weight: 600; }
.imp-bar__spacer { flex: 1; }

/* ====================== ACCORDION ====================== */
.accordion { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.acc-item + .acc-item { border-top: 1px solid var(--border); }
.acc-head { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-4); font-weight: 600; font-size: var(--text-base); text-align: left; color: var(--text); }
.acc-head:hover { background: var(--surface-2); }
.acc-head__icon { margin-left: auto; color: var(--text-subtle); transition: transform var(--dur); display: flex; }
.acc-item.is-open .acc-head__icon { transform: rotate(180deg); }
.acc-body { padding: 0 var(--space-4) var(--space-4); color: var(--text-muted); line-height: var(--leading-relaxed); max-width: 68ch; }

/* ====================== DRAWER / SIDE SHEET ====================== */
.drawer-demo { position: relative; height: 380px; border-radius: var(--radius-lg); overflow: hidden; background: rgba(20,20,16,.45); display: flex; justify-content: flex-end; }
.drawer { width: 340px; background: var(--surface); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4); border-bottom: 1px solid var(--border); }
.drawer__title { font-weight: 600; font-family: var(--font-display); }
.drawer__body { padding: var(--space-4); overflow: auto; flex: 1; }
.drawer__foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); display: flex; gap: var(--space-2); justify-content: flex-end; background: var(--surface-2); }

/* ====================== NOTIFICATION CENTER ====================== */
.notif-panel { width: 360px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.notif-panel__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); font-weight: 600; }
.notif-panel__head .link { margin-left: auto; font-size: var(--text-sm); font-weight: 500; color: var(--accent-ink); }
.notif-item { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread { background: var(--accent-soft); }
.notif-item__icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-muted); flex: none; }
.notif-item__icon [data-lucide] { width: 15px; height: 15px; }
.notif-item__icon.is-ai { background: var(--ai-soft); color: var(--ai-ink); border-color: color-mix(in srgb, var(--ai) 24%, transparent); }
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__text { display: block; font-size: var(--text-sm); }
.notif-item__text b { font-weight: 600; }
.notif-item__time { display: block; font-size: var(--text-xs); color: var(--text-subtle); margin-top: 2px; }
.notif-item__dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); margin-top: 6px; flex: none; }

/* ====================== CALENDAR ====================== */
.cal { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.cal__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.cal__title { font-weight: 600; font-family: var(--font-display); font-size: var(--text-md); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__dow { padding: var(--space-2); text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-subtle); font-weight: 600; border-bottom: 1px solid var(--border); }
.cal__day { min-height: 92px; padding: 6px 7px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal__day:nth-child(7n) { border-right: none; }
.cal__daynum { font-size: var(--text-sm); color: var(--text-muted); }
.cal__day.is-muted .cal__daynum { color: var(--text-subtle); opacity: .5; }
.cal__day.is-today .cal__daynum { background: var(--accent); color: #fff; border-radius: 999px; width: 22px; height: 22px; display: inline-grid; place-items: center; font-weight: 600; }
.cal-event { display: block; margin-top: 4px; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event--effective { background: var(--success-soft); color: var(--success-ink); }
.cal-event--comment { background: var(--info-soft); color: var(--info-ink); }
.cal-event--mandatory { background: var(--urgent-soft); color: var(--urgent-ink); }

/* ====================== BUTTON GROUP / SPLIT ====================== */
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.btn-group .btn:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.btn-split { display: inline-flex; }
.btn-split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 9px; margin-left: 1px; }

/* ====================== BULK-ACTION BAR ====================== */
.bulkbar { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--stone-900); color: var(--stone-50); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.bulkbar__count { font-weight: 600; font-size: var(--text-sm); padding: 0 var(--space-2); }
.bulkbar__sep { width: 1px; height: 20px; background: rgba(255,255,255,.18); }
.bulkbar button { color: #fff; font-size: var(--text-sm); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; }
.bulkbar button:hover { background: rgba(255,255,255,.12); }
.bulkbar button [data-lucide] { width: 14px; height: 14px; }
.bulkbar__spacer { flex: 1; }
.bulkbar__clear { opacity: .8; }

/* ====================== TREE ====================== */
.tree { font-size: var(--text-base); }
.tree-item__row { display: flex; align-items: center; gap: 6px; padding: 5px var(--space-2); border-radius: var(--radius-sm); cursor: pointer; }
.tree-item__row:hover { background: var(--surface-2); }
.tree-item__toggle { color: var(--text-subtle); display: flex; width: 16px; }
.tree-item__toggle [data-lucide] { width: 15px; height: 15px; transition: transform var(--dur); }
.tree-item.is-open > .tree-item__row .tree-item__toggle [data-lucide] { transform: rotate(90deg); }
.tree-item__icon { color: var(--text-subtle); display: flex; }
.tree-item__icon [data-lucide] { width: 15px; height: 15px; }
.tree-item__count { margin-left: auto; font-size: var(--text-xs); color: var(--text-subtle); font-family: var(--font-mono); }
.tree-children { margin-left: var(--space-5); border-left: 1px solid var(--border); padding-left: var(--space-2); }

/* ====================== DIFF ====================== */
.diff { display: flex; flex-direction: column; gap: 3px; }
.diff__line { padding: 5px var(--space-3); border-radius: var(--radius-sm); line-height: var(--leading-snug); font-size: var(--text-sm); }
.diff__line--add { background: var(--success-soft); color: var(--success-ink); }
.diff__line--del { background: var(--critical-soft); color: var(--critical-ink); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.diff__tag { font-family: var(--font-mono); font-weight: 700; margin-right: 8px; }

/* ====================== COACH MARK ====================== */
.coach { width: 290px; background: var(--stone-900); color: var(--stone-50); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-lg); }
.coach__step { font-size: var(--text-xs); color: var(--stone-400); font-weight: 600; letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.coach__title { font-weight: 600; font-family: var(--font-display); margin-top: 4px; }
.coach__body { font-size: var(--text-sm); color: var(--stone-300); margin-top: 6px; line-height: var(--leading-snug); }
.coach__foot { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.coach__dots { display: flex; gap: 5px; }
.coach__dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.3); }
.coach__dots i.on { background: #fff; }
.coach__spacer { flex: 1; }

/* ====================== CHARTS — EXTENDED ====================== */
/* chart card wrapper */
.chart-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.chart-card__head { display: flex; align-items: flex-start; gap: var(--space-4); padding: var(--space-4) var(--space-5) 0; }
.chart-card__kpi { min-width: 0; }
.chart-card__title { font-size: var(--text-sm); color: var(--text-muted); font-weight: 500; }
.chart-card__value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; line-height: 1; margin-top: 5px; }
.chart-card__delta { font-size: var(--text-sm); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; margin-top: 5px; }
.chart-card__delta.up { color: var(--success-ink); }
.chart-card__delta.down { color: var(--critical-ink); }
.chart-card__delta [data-lucide] { width: 14px; height: 14px; }
.chart-card__period { margin-left: auto; }
.chart-card__body { padding: var(--space-4) var(--space-5) var(--space-5); }
.chart-card__foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.chart-grid-lines line { stroke: var(--border); stroke-width: 1; }

/* sparkline variants */
.sparkbars { display: inline-flex; align-items: flex-end; gap: 2px; height: 28px; vertical-align: middle; }
.sparkbars i { width: 4px; background: var(--accent); border-radius: 1px; }
.winloss { display: inline-flex; align-items: center; gap: 2px; height: 26px; vertical-align: middle; }
.winloss i { width: 4px; height: 9px; border-radius: 1px; }
.winloss i.w { background: var(--success); align-self: flex-start; }
.winloss i.l { background: var(--urgent); align-self: flex-end; }

/* horizontal bars (ranking) */
.hbarchart { display: flex; flex-direction: column; gap: var(--space-3); }
.hbar { display: grid; grid-template-columns: 170px 1fr 52px; gap: var(--space-3); align-items: center; }
.hbar__label { font-size: var(--text-sm); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__track { height: 16px; background: var(--surface-sunken); border-radius: 5px; overflow: hidden; }
.hbar__fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar__val { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-muted); text-align: right; }

/* grouped bars */
.barchart__group { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; }
.barchart__group .barchart__bar { max-width: 20px; }

/* stacked bars (vertical, composition over time) */
.stackchart { display: flex; align-items: flex-end; gap: var(--space-3); height: 180px; }
.stackcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.stackcol__bar { width: 100%; max-width: 42px; display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden; }
.stackcol__bar span { display: block; }
.stackcol__label { font-size: var(--text-xs); color: var(--text-subtle); }

/* bullet graph (actual vs target) */
.bullet { position: relative; height: 24px; border-radius: 5px; overflow: hidden; background: var(--surface-sunken); }
.bullet__zone { position: absolute; top: 0; bottom: 0; left: 0; background: color-mix(in srgb, var(--border-strong) 40%, var(--surface-2)); }
.bullet__measure { position: absolute; top: 6px; bottom: 6px; left: 0; background: var(--accent); border-radius: 3px; }
.bullet__measure.is-under { background: var(--warn); }
.bullet__target { position: absolute; top: 2px; bottom: 2px; width: 3px; background: var(--stone-900); border-radius: 2px; }
:root[data-theme="dark"] .bullet__target { background: var(--stone-50); }

/* histogram */
.histo { display: flex; align-items: flex-end; gap: 2px; height: 150px; }
.histo i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.histo i.is-flag { background: var(--urgent); }

/* multi-segment progress meter */
.meter { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-sunken); }
.meter span { display: block; height: 100%; }
.segprog { display: flex; gap: 5px; }
.segprog i { flex: 1; height: 9px; border-radius: 3px; background: var(--surface-sunken); }
.segprog i.on { background: var(--accent); }

/* gauge labels */
.gauge-val { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; }

/* RISK MATRIX (likelihood × impact) */
.rm-wrap { display: grid; grid-template-columns: 22px auto; grid-template-rows: auto 22px; gap: var(--space-2); max-width: 440px; }
.rm-ylabel { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 11px; font-weight: 600; color: var(--text-subtle); letter-spacing: var(--tracking-wide); }
.rm-xlabel { grid-column: 2; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-subtle); letter-spacing: var(--tracking-wide); }
.riskmatrix { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); gap: 4px; }
.rm-cell { border-radius: 6px; min-height: 48px; position: relative; display: grid; place-items: center; }
.rm-cell--l { background: var(--success-soft); }
.rm-cell--m { background: var(--warn-soft); }
.rm-cell--h { background: var(--urgent-soft); }
.rm-cell--c { background: var(--critical-soft); }
.rm-marker { width: 26px; height: 26px; border-radius: 999px; background: var(--surface); border: 2px solid var(--text); display: grid; place-items: center; font-size: 11px; font-weight: 700; box-shadow: var(--shadow-sm); }

/* PROGRAM HEALTH MATRIX */
.pmatrix { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: var(--text-sm); }
.pmatrix th { font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-subtle); font-weight: 600; padding: 0 4px 4px; text-align: center; }
.pmatrix th.row { text-align: left; }
.pmatrix td.row { font-weight: 600; color: var(--text); white-space: nowrap; padding-right: var(--space-3); }
.pm-cell { height: 32px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.pm-cell--strong { background: var(--success-soft); color: var(--success-ink); }
.pm-cell--good { background: var(--info-soft); color: var(--info-ink); }
.pm-cell--watch { background: var(--warn-soft); color: var(--warn-ink); }
.pm-cell--na { background: var(--surface-2); color: var(--text-subtle); }

/* ACTIVITY / CONTRIBUTION HEATMAP */
.cheat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; gap: 3px; }
.cheat span { border-radius: 3px; background: var(--surface-sunken); }
/* intensity = tints of the functional accent, so the heatmap follows a
   color-vision mode (green by default, blue under red-green) and auto-adapts
   to light/dark via the surface mix. */
.cheat .l1 { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
.cheat .l2 { background: color-mix(in srgb, var(--accent) 46%, var(--surface)); }
.cheat .l3 { background: color-mix(in srgb, var(--accent) 70%, var(--surface)); }
.cheat .l4 { background: var(--accent); }
:root[data-theme="dark"] .cheat .l1 { background: color-mix(in srgb, var(--accent) 34%, var(--surface)); }
:root[data-theme="dark"] .cheat .l2 { background: color-mix(in srgb, var(--accent) 56%, var(--surface)); }
:root[data-theme="dark"] .cheat .l3 { background: color-mix(in srgb, var(--accent) 78%, var(--surface)); }
:root[data-theme="dark"] .cheat .l4 { background: color-mix(in srgb, var(--accent) 86%, white); }

/* FUNNEL */
.funnel { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.funnel__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) var(--space-4); border-radius: 6px; color: #fff; font-weight: 600; font-size: var(--text-sm); }
.funnel__row .n { font-family: var(--font-mono); }

/* chart empty / loading */
.chart-empty { display: grid; place-items: center; height: 150px; text-align: center; color: var(--text-subtle); }
.chart-empty [data-lucide] { width: 24px; height: 24px; margin-bottom: var(--space-2); }
.chart-skeleton { display: flex; align-items: flex-end; gap: var(--space-3); height: 150px; }
.chart-skeleton i { flex: 1; border-radius: 4px 4px 0 0; }
