/* ============================================================
   Pythia Analyzer - Quantamental Cockpit
   UI/UX refactor: context bar + 3-mode switcher (Discover,
   Inspect, Calibrate) + Monitor drawer + tradeability glyph.

   Reuses the app's --pui-* token system (assets/style.css :root).
   Semantic color only; tabular numerals on prices/scores/risk.
   Scoped under #analyzer-cockpit so it never leaks to other routes.
============================================================ */

#analyzer-cockpit {
  /* Re-based onto the canonical --pa-* contract so the html.theme-slate flip
     (assets/style.css) recolors the cockpit. Terminal values are unchanged
     (aliases resolve to the prior literals). The *-rgb tokens carry the few
     translucent navy overlays through the theme; they are flipped to charcoal
     in the html.theme-slate override at the foot of this file. */
  --ck-ink: var(--pa-bg);
  --ck-panel: var(--pa-surface);
  --ck-elevated: var(--pa-surface-raised);
  --ck-border: var(--pa-border);
  --ck-hairline: var(--pui-border-subtle);
  --ck-blue: rgb(var(--pa-accent-strong-rgb));
  --ck-buy: var(--pui-positive);
  --ck-sell: var(--pui-negative);
  --ck-gated: var(--pui-warning);
  --ck-stale: var(--pui-stale);
  --ck-cyan: var(--pui-accent-strong);
  --ck-soft: var(--pui-accent);
  --ck-neutral: var(--pui-text-muted);
  --ck-text: var(--pui-text-strong);
  --ck-text-body: var(--pui-text-body);
  --ck-text-muted: var(--pui-text-muted);
  --ck-text-faint: var(--pui-text-faint);
  --ck-ink-rgb: 8, 17, 31;
  --ck-panel-rgb: 16, 27, 45;
  --ck-border-rgb: 38, 54, 79;
  --ck-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ck-tnum {
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}
.ck-kk {
  font-family: var(--ck-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ck-text-faint);
  font-weight: 600;
}

/* ---------------------------------------------------------------
   CONTEXT BAR - the one persistent strip below the global nav
--------------------------------------------------------------- */
.ck-ctxbar {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(180deg, var(--ck-ink) 0%, var(--ck-ink) 100%);
  border: 1px solid var(--ck-border);
  border-radius: var(--pui-radius-sm);
  overflow: hidden;
  position: sticky;
  top: var(--nav-height, 72px);
  z-index: var(--pui-z-sticky, 300);
  margin-bottom: var(--pui-space-4);
  box-shadow: var(--pui-shadow-raised);
}
.ck-ctxbar .ck-seg {
  padding: 10px 14px;
  border-left: 1px solid var(--ck-hairline);
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  min-width: 0;
}
.ck-ctxbar .ck-seg:first-child {
  border-left: 0;
}
.ck-ctxbar .ck-seg .ck-lab {
  font-family: var(--ck-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ck-text-faint);
  font-weight: 600;
  white-space: nowrap;
}
.ck-ctxbar .ck-seg .ck-val {
  font-size: 13px;
  color: var(--ck-text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.ck-ctxbar .ck-seg .ck-sub {
  font-size: 10.5px;
  color: var(--ck-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.ck-ctxbar .ck-seg.grow {
  flex: 1 1 auto;
}
.ck-ctxbar .ck-seg.tick {
  flex: 0 0 auto;
  min-width: 168px;
}
.ck-ctxbar .ck-seg.tick .ck-tick-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ck-ctxbar .ck-seg.tick input.form-control {
  height: 30px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--ck-elevated);
  border-color: var(--ck-border);
  color: var(--ck-text);
  max-width: 116px;
}
.ck-ctxbar .ck-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-left: 1px solid var(--ck-hairline);
}

/* the run/load button in the ticker segment */
.ck-ctxbar .ck-seg.tick .btn {
  padding: 5px 10px;
  font-size: 12px;
}

/* ---------------------------------------------------------------
   MODE SWITCHER - restyle dbc.Tabs as a segmented control
--------------------------------------------------------------- */
#main-workspace-tabs .nav-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 18px;
  border: 1px solid var(--ck-border);
  background: var(--ck-ink);
  border-radius: var(--pui-radius-sm);
  padding: 3px;
  gap: 2px;
}
#main-workspace-tabs .nav-tabs .nav-item .nav-link {
  border: 0;
  border-radius: 6px;
  padding: 7px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ck-text-muted);
  background: transparent;
  transition: background var(--pui-transition-fast), color var(--pui-transition-fast);
}
#main-workspace-tabs .nav-tabs .nav-item .nav-link:hover {
  color: var(--ck-text-body);
}
#main-workspace-tabs .nav-tabs .nav-item .nav-link.active {
  background: var(--ck-elevated);
  color: var(--ck-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ---------------------------------------------------------------
   STATUS PILLS - shared cockpit vocabulary
--------------------------------------------------------------- */
.ck-sp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ck-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid currentColor;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.ck-sp .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.ck-sp.buy,
.ck-sp.armed,
.ck-sp.high,
.ck-sp.fresh { color: var(--ck-buy); background: rgba(74, 222, 128, 0.1); }
.ck-sp.sell,
.ck-sp.missing { color: var(--ck-sell); background: rgba(251, 113, 133, 0.1); }
.ck-sp.gated,
.ck-sp.spec,
.ck-sp.dormant { color: var(--ck-gated); background: rgba(251, 191, 36, 0.1); }
.ck-sp.stale { color: var(--ck-stale); background: rgba(245, 158, 11, 0.1); }
.ck-sp.forming,
.ck-sp.running,
.ck-sp.standard { color: var(--ck-cyan); background: rgba(var(--pa-accent-soft-rgb), 0.1); }
.ck-sp.none { color: var(--ck-neutral); background: rgba(148, 163, 184, 0.08); }

/* ---------------------------------------------------------------
   TRADEABILITY GLYPH - gate, setup, conviction, 3 pips L-to-R
--------------------------------------------------------------- */
.ck-trd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ck-trd .pips {
  display: inline-flex;
  gap: 3px;
}
.ck-trd .pip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--ck-panel);
  border: 1px solid var(--ck-border);
}
.ck-trd .pip.on-buy { background: var(--ck-buy); border-color: var(--ck-buy); }
.ck-trd .pip.on-cyan { background: var(--ck-cyan); border-color: var(--ck-cyan); }
.ck-trd .pip.on-gated { background: var(--ck-gated); border-color: var(--ck-gated); }
.ck-trd .word {
  font-family: var(--ck-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.ck-trd.go .word { color: var(--ck-buy); }
.ck-trd.watch .word { color: var(--ck-cyan); }
.ck-trd.block .word { color: var(--ck-gated); }
.ck-trd.flat .word { color: var(--ck-neutral); }

/* ---------------------------------------------------------------
   REGIME STRIP - 4 lookback cells (1/3/6/12mo)
--------------------------------------------------------------- */
.ck-rstrip {
  display: inline-flex;
  gap: 3px;
}
.ck-rcell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 32px;
  padding: 3px 0;
  border-radius: 4px;
  background: var(--ck-ink);
  border: 1px solid var(--ck-hairline);
}
.ck-rcell .rt {
  font-family: var(--ck-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--ck-text-faint);
}
.ck-rcell .rb {
  font-family: var(--ck-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--ck-text-body);
}
.ck-rcell.on { border-color: rgba(74, 222, 128, 0.4); }
.ck-rcell.on .rb { color: var(--ck-buy); }
.ck-rcell.off { border-color: rgba(251, 113, 133, 0.4); }
.ck-rcell.off .rb { color: var(--ck-sell); }
.ck-rcell.chop { border-color: rgba(251, 191, 36, 0.4); }
.ck-rcell.chop .rb { color: var(--ck-gated); }

/* ---------------------------------------------------------------
   SECTIONS / panels inside the modes
--------------------------------------------------------------- */
.ck-section {
  border: 1px solid var(--ck-hairline);
  border-radius: var(--pui-radius-sm);
  background: rgba(var(--ck-panel-rgb), 0.6);
  padding: 16px 18px;
  margin-bottom: var(--pui-space-4);
}
.ck-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ck-section-head h5 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ck-text);
}
.ck-eyebrow {
  font-family: var(--ck-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ck-text-faint);
  font-weight: 600;
}

/* ---------------------------------------------------------------
   TRADE-PLAN CARD - canonical object (Inspect verdict)
--------------------------------------------------------------- */
.ck-tpc {
  border: 1px solid var(--ck-border);
  border-radius: var(--pui-radius-md);
  background: linear-gradient(180deg, var(--ck-ink) 0%, var(--ck-ink) 100%);
  overflow: hidden;
}
.ck-tpc .hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--ck-hairline);
}
.ck-tpc .hd .ttl {
  font-size: 12.5px;
  color: var(--ck-text);
  font-weight: 600;
}
.ck-tpc .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ck-hairline);
}
.ck-tpc .grid.three { grid-template-columns: repeat(3, 1fr); }
.ck-tpc .cell {
  background: var(--ck-ink);
  padding: 12px 16px;
}
.ck-tpc .cell .l {
  font-family: var(--ck-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ck-text-faint);
}
.ck-tpc .cell .v {
  font-size: 18px;
  color: var(--ck-text);
  font-weight: 600;
  margin-top: 5px;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}
.ck-tpc .cell .v.sell { color: var(--ck-sell); }
.ck-tpc .cell .v.buy { color: var(--ck-buy); }
.ck-tpc .cell .d {
  font-size: 10.5px;
  color: var(--ck-text-muted);
  margin-top: 2px;
}

/* ---------------------------------------------------------------
   SCORE-FAMILY DIGEST (Inspect) - four numbers + bars
--------------------------------------------------------------- */
.ck-fam {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ck-fam .f {
  border: 1px solid var(--ck-hairline);
  border-radius: var(--pui-radius-sm);
  background: var(--ck-ink);
  padding: 13px 14px;
}
.ck-fam .f.gov {
  border-color: rgba(74, 222, 128, 0.5);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.18);
}
.ck-fam .f .nm {
  font-family: var(--ck-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ck-text-muted);
}
.ck-fam .f.gov .nm { color: var(--ck-buy); }
.ck-fam .f .sc {
  font-size: 24px;
  color: var(--ck-text);
  font-weight: 600;
  margin-top: 6px;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}
.ck-fam .f.gov .sc { color: var(--ck-buy); }
.ck-fam .f .track {
  height: 5px;
  border-radius: 3px;
  background: var(--ck-elevated);
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--ck-border);
}
.ck-fam .f .track i {
  display: block;
  height: 100%;
  background: var(--ck-neutral);
}
.ck-fam .f.gov .track i { background: var(--ck-buy); }

@media (max-width: 991.98px) {
  .ck-fam { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------
   CALIBRATE - override badges, reset, preset bar
--------------------------------------------------------------- */
.ck-ovr {
  font-family: var(--ck-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ck-gated);
  border: 1px solid var(--ck-gated);
  background: rgba(251, 191, 36, 0.08);
}
.ck-deflt {
  font-family: var(--ck-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ck-text-faint);
  border: 1px solid var(--ck-hairline);
}
.ck-presetbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--ck-hairline);
  border-radius: var(--pui-radius-sm);
  background: var(--ck-ink);
  margin-bottom: var(--pui-space-4);
}

/* Validation header inside Calibrate */
.ck-validation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
}

/* ---------------------------------------------------------------
   DISCOVER summary cards row
--------------------------------------------------------------- */
.ck-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ck-hairline);
  border: 1px solid var(--ck-hairline);
  border-radius: var(--pui-radius-sm);
  overflow: hidden;
  margin-bottom: var(--pui-space-3);
}
.ck-summary .card-cell {
  background: var(--ck-ink);
  padding: 12px 16px;
}
.ck-summary .card-cell .lab {
  font-family: var(--ck-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ck-text-faint);
  font-weight: 600;
}
.ck-summary .card-cell .lab.buy { color: var(--ck-buy); }
.ck-summary .card-cell .big {
  font-size: 22px;
  color: var(--ck-text);
  font-weight: 600;
  margin-top: 3px;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}
.ck-summary .card-cell .big.buy { color: var(--ck-buy); }
.ck-summary .card-cell .mid {
  font-size: 15px;
  color: var(--ck-text);
  font-weight: 600;
  margin-top: 6px;
}
.ck-summary .card-cell .sub {
  font-size: 10.5px;
  color: var(--ck-text-muted);
}

@media (max-width: 767.98px) {
  .ck-summary { grid-template-columns: repeat(2, 1fr); }
}

/* status band */
.ck-statusband {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border: 1px solid var(--ck-hairline);
  border-radius: var(--pui-radius-sm);
  background: var(--ck-ink);
  font-size: 12px;
  color: var(--ck-text-body);
  margin-bottom: var(--pui-space-3);
}

/* ---------------------------------------------------------------
   Generic cockpit buttons (cosmetic, used in concept chrome)
--------------------------------------------------------------- */
.ck-btn {
  background: var(--ck-elevated);
  border: 1px solid var(--ck-hairline);
  color: var(--ck-text);
  font-size: 11.5px;
  padding: 6px 11px;
  border-radius: 5px;
  font-family: var(--ck-mono);
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
}
.ck-btn.ghost { background: transparent; color: var(--ck-text-muted); }

/* ---------------------------------------------------------------
   LEADERBOARD - tradeability conditional text colors come from
   dash_table style_data_conditional in Python; this just tightens
   the cockpit wrapper.
--------------------------------------------------------------- */
.ck-leaderboard .dash-spreadsheet-container .dash-cell-value {
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------
   RESPONSIVE - context bar collapses, stays present
--------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .ck-ctxbar {
    flex-wrap: wrap;
    top: var(--nav-height, 60px);
  }
  .ck-ctxbar .ck-seg {
    border-left: 0;
    border-top: 1px solid var(--ck-hairline);
    flex: 1 1 44%;
  }
  .ck-ctxbar .ck-seg:first-child,
  .ck-ctxbar .ck-seg.tick { flex: 1 1 100%; border-top: 0; }
  .ck-ctxbar .ck-action {
    border-left: 0;
    border-top: 1px solid var(--ck-hairline);
    flex: 1 1 100%;
    justify-content: flex-end;
  }
  .ck-tpc .grid { grid-template-columns: repeat(2, 1fr); }
}

#analyzer-cockpit *:focus-visible {
  outline: 2px solid var(--pui-accent-strong);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  #analyzer-cockpit * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------------------------------------------------------------
   Analyzer cockpit visual slice. Route-local only.
--------------------------------------------------------------- */
#analyzer-cockpit {
  --ck-bg: var(--ck-ink);
  --ck-panel: var(--ck-ink);
  --ck-panel-2: var(--ck-ink);
  --ck-panel-3: var(--ck-panel);
  --ck-line: var(--ck-panel);
  --ck-line-soft: var(--ck-panel);
  --ck-text: var(--ck-text);
  --ck-body: var(--ck-text-body);
  --ck-muted: var(--ck-text-faint);
  --ck-faint: var(--ck-border);
  --ck-green: var(--ck-buy);
  --ck-blue: var(--ck-cyan);
  --ck-royal: var(--ck-blue);
  --ck-yellow: var(--ck-gated);
  --ck-red: var(--ck-sell);
  max-width: none;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: var(--ck-bg);
  color: var(--ck-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0;
}

#analyzer-cockpit,
#analyzer-cockpit * {
  box-sizing: border-box;
}

#analyzer-cockpit > .pui-route-section {
  display: contents;
}

#analyzer-cockpit .ck-compat-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.ck-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: 56px auto 1fr auto;
  overflow: hidden;
  background: var(--ck-bg);
  border: 1px solid var(--ck-panel);
}

.ck-topnav {
  height: 56px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 28px;
  background: var(--ck-ink);
  border-bottom: 1px solid var(--ck-line);
}

.ck-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ck-text);
  font-weight: 800;
}

.ck-brand-mark {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--ck-blue);
  font-family: var(--ck-mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.ck-brand-mark:hover {
  background: rgba(var(--pa-accent-soft-rgb), 0.12);
  color: var(--ck-cyan);
}

.ck-brand span {
  display: block;
  margin-top: 1px;
  color: var(--ck-cyan);
  font-family: var(--ck-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.ck-nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ck-nav-tab {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ck-text-muted);
  font-weight: 800;
}

.ck-nav-tab:focus,
.ck-icon-button:focus,
.ck-run-scan:focus,
.ck-toolbar-button:focus {
  outline: none;
  box-shadow: none;
}

.ck-nav-tab:focus-visible,
.ck-icon-button:focus-visible,
.ck-run-scan:focus-visible,
.ck-toolbar-button:focus-visible {
  outline: 1px solid var(--ck-blue);
  outline-offset: 2px;
}

.ck-view-discover .ck-nav-tab[data-view="discover"],
.ck-view-pipeline .ck-nav-tab[data-view="pipeline"] {
  background: var(--ck-panel);
  color: var(--ck-text);
}

.ck-nav-tab.is-disabled {
  opacity: 0.38;
}

.ck-nav-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.ck-icon-button {
  height: 36px;
  border: 1px solid var(--ck-line);
  border-radius: 7px;
  background: var(--ck-ink);
  color: var(--ck-text);
  font-weight: 800;
}

.ck-sliders {
  width: 36px;
  position: relative;
}

.ck-sliders::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--ck-text-body);
  box-shadow: 0 7px 0 var(--ck-text-body), 0 14px 0 var(--ck-text-body);
}

.ck-sliders::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 13px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--ck-text-body);
  box-shadow: 8px 7px 0 var(--ck-text-body), -2px 14px 0 var(--ck-text-body);
}

.ck-context-wrap {
  display: contents;
}

.ck-context-summary {
  display: contents;
}

.ck-context-strip {
  min-height: 82px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(135px, auto);
  align-items: stretch;
  background: var(--ck-ink);
  border-bottom: 1px solid var(--ck-line);
}

.ck-context-cell,
.ck-context-action {
  min-width: 0;
  padding: 14px 18px 10px;
  border-right: 1px solid var(--ck-line);
}

.ck-context-cell.wide {
  min-width: 260px;
}

.ck-context-cell.grow {
  min-width: 280px;
}

.ck-context-cell.ck-control-cell {
  min-width: 205px;
  padding-top: 12px;
}

.ck-context-cell.ck-control-cell.wide {
  min-width: 260px;
}

.ck-cockpit-dropdown {
  margin-top: 6px;
  min-width: 178px;
  font-size: 12px;
}

.ck-cockpit-dropdown .Select-control {
  height: 32px;
  min-height: 32px;
  border: 1px solid var(--ck-elevated);
  border-radius: 6px;
  background: var(--ck-ink);
  box-shadow: none;
}

.ck-cockpit-dropdown.is-open .Select-control,
.ck-cockpit-dropdown .Select-control:hover {
  border-color: var(--ck-blue);
  box-shadow: none;
}

.ck-cockpit-dropdown .Select-placeholder,
.ck-cockpit-dropdown .Select-value,
.ck-cockpit-dropdown .Select-value-label,
.ck-cockpit-dropdown .Select-input > input {
  color: var(--ck-text) !important;
  line-height: 30px !important;
  font-size: 12px;
  font-weight: 800;
}

.ck-cockpit-dropdown .Select-placeholder {
  color: var(--ck-text-faint) !important;
}

.ck-cockpit-dropdown .Select-arrow-zone {
  width: 26px;
}

.ck-cockpit-dropdown .Select-arrow {
  border-color: var(--ck-text-muted) transparent transparent;
}

.ck-cockpit-dropdown.is-open .Select-arrow {
  border-color: transparent transparent var(--ck-text-muted);
}

.ck-cockpit-dropdown .Select-clear-zone {
  display: none;
}

.ck-cockpit-dropdown .Select-menu-outer {
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--ck-elevated);
  border-radius: 7px;
  background: var(--ck-ink);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
  color: var(--ck-text-body);
  z-index: 2000;
}

.ck-cockpit-dropdown .VirtualizedSelectOption {
  background: var(--ck-ink);
  color: var(--ck-text-body);
  font-size: 12px;
  font-weight: 700;
}

.ck-cockpit-dropdown .VirtualizedSelectFocusedOption,
.ck-cockpit-dropdown .VirtualizedSelectSelectedOption {
  background: var(--ck-panel);
  color: var(--ck-text);
}

.ck-context-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 138px;
  padding: 12px 10px;
}

.ck-label,
.ck-kpi-label,
.ck-section-label,
.ck-table-head > div,
.ck-sort-label,
.ck-inspector-kicker,
.ck-node-index {
  font-family: var(--ck-mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 9px;
  font-weight: 800;
  color: var(--ck-text-faint);
}

.ck-value {
  margin-top: 6px;
  color: var(--ck-text);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ck-value.xl {
  font-size: 18px;
}

.ck-sub {
  margin-top: 4px;
  color: var(--ck-text-body);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ck-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--ck-buy);
  border-radius: 5px;
  color: var(--ck-green);
  font-family: var(--ck-mono);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.ck-pill::before,
.ck-health::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.ck-pill.running {
  border-color: var(--ck-blue);
  color: var(--ck-blue);
}

.ck-pill.queued {
  border-color: var(--ck-border);
  color: var(--ck-text-muted);
}

.ck-pill.blocked {
  border-color: var(--ck-red);
  color: var(--ck-red);
}

.ck-health {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 10px;
  color: var(--ck-green);
  font-weight: 800;
}

.ck-health.warn {
  color: var(--ck-yellow);
}

.ck-health.queued {
  color: var(--ck-text-muted);
}

.ck-health.blocked {
  color: var(--ck-red);
}

.ck-run-scan {
  min-width: 112px;
  height: 38px;
  border: 1px solid var(--ck-buy) !important;
  border-radius: 6px !important;
  background: var(--ck-panel) !important;
  color: var(--ck-green) !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}

.ck-run-scan::before {
  content: "~";
  margin-right: 8px;
}

.ck-run-scan.is-scanning {
  cursor: progress !important;
  opacity: 0.9 !important;
}

.ck-run-scan.is-scanning::before {
  content: "";
  width: 12px;
  height: 12px;
  display: inline-block;
  margin-right: 9px;
  border: 2px solid rgba(63, 242, 141, 0.26);
  border-top-color: var(--ck-green);
  border-radius: 50%;
  vertical-align: -2px;
  animation: ck-spin 0.8s linear infinite;
}

.ck-body {
  min-height: 0;
  display: block;
  overflow: hidden;
  background: var(--ck-ink);
}

.ck-view {
  min-height: 0;
}

.ck-discover-view {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.ck-view-discover .ck-pipeline-context,
.ck-view-discover .ck-pipeline-view {
  display: none;
}

.ck-view-pipeline .ck-discover-context,
.ck-view-pipeline .ck-discover-view {
  display: none;
}

.ck-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 108px;
  background: var(--ck-ink);
  border-bottom: 1px solid var(--ck-line);
}

.ck-kpi {
  padding: 17px 22px 14px;
  border-right: 1px solid var(--ck-line);
}

.ck-kpi:last-child {
  border-right: 0;
}

.ck-kpi-value {
  margin-top: 8px;
  color: var(--ck-text);
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ck-kpi.is-actionable .ck-kpi-value,
.ck-kpi.is-actionable .ck-kpi-label {
  color: var(--ck-green);
}

.ck-kpi-detail {
  margin-top: 9px;
  color: var(--ck-text-body);
  font-size: 12px;
}

.ck-discover-table {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 58px 42px 1fr 32px;
  background: var(--ck-ink);
}

.ck-discover-table > .ck-toolbar-left,
.ck-discover-table > .ck-toolbar-right {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 20px;
  border-bottom: 1px solid var(--ck-line);
  background: var(--ck-ink);
}

.ck-discover-table > .ck-toolbar-left {
  justify-content: flex-start;
  padding-right: 540px;
}

.ck-discover-table > .ck-toolbar-right {
  justify-content: flex-end;
  padding-left: 540px;
  pointer-events: none;
  background: transparent;
}

.ck-discover-table > .ck-toolbar-right > * {
  pointer-events: auto;
}

.ck-selected-count {
  min-width: 156px;
  color: var(--ck-text-body);
  font-family: var(--ck-mono);
  font-size: 12px;
}

.ck-toolbar-button {
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--ck-elevated);
  border-radius: 6px;
  background: var(--ck-panel);
  color: var(--ck-text-muted);
  font-size: 12px;
  font-weight: 850;
}

.ck-toolbar-button.primary {
  border-color: var(--ck-border);
  color: var(--ck-cyan);
}

.ck-toolbar-button.export {
  color: var(--ck-text);
  background: var(--ck-ink);
}

.ck-toolbar-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ck-sort-label {
  margin-right: 4px;
}

.ck-sort-tabs {
  display: inline-flex;
  border: 1px solid var(--ck-elevated);
  border-radius: 7px;
  overflow: hidden;
}

.ck-sort-tabs button {
  height: 30px;
  min-width: 60px;
  border: 0;
  border-right: 1px solid var(--ck-elevated);
  background: var(--ck-ink);
  color: var(--ck-text-muted);
  font-family: var(--ck-mono);
  font-size: 11px;
  font-weight: 850;
}

.ck-sort-tabs button:last-child {
  border-right: 0;
}

.ck-sort-tabs button.is-active,
.ck-sort-tabs button:focus {
  background: var(--ck-panel);
  color: var(--ck-text);
}

.ck-table-head,
.ck-candidate-row {
  display: grid;
  grid-template-columns: 42px 38px minmax(210px, 1.42fr) 155px 155px 140px 100px 100px 90px minmax(160px, 0.8fr) 116px;
  align-items: center;
  column-gap: 0;
}

.ck-table-head {
  grid-row: 2;
  grid-column: 1;
  min-height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ck-line);
  background: var(--ck-ink);
}

.ck-table-body {
  grid-row: 3;
  grid-column: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: var(--ck-text-muted) var(--ck-text-body);
  scrollbar-width: auto;
}

.ck-scan-loading {
  grid-row: 2 / 5;
  grid-column: 1;
  z-index: 7;
  display: none;
  align-content: start;
  gap: 18px;
  padding: 68px min(9vw, 120px) 24px;
  background: rgba(var(--ck-ink-rgb), 0.88);
  border-top: 1px solid rgba(var(--ck-border-rgb), 0.78);
  backdrop-filter: blur(4px);
}

.ck-scan-loading.is-active {
  display: grid;
}

.ck-scan-loading-head {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ck-text);
}

.ck-scan-loading-head b,
.ck-scan-loading-head span {
  display: block;
}

.ck-scan-loading-head b {
  font-size: 15px;
  font-weight: 900;
}

.ck-scan-loading-head span {
  margin-top: 3px;
  color: var(--ck-text-muted);
  font-size: 12px;
}

.ck-scan-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(var(--pa-accent-soft-rgb), 0.22);
  border-top-color: var(--ck-blue);
  border-radius: 50%;
  animation: ck-spin 0.8s linear infinite;
}

.ck-scan-loading-lines {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.ck-scan-skeleton {
  height: 48px !important;
  border-radius: 7px !important;
  background: rgba(var(--ck-panel-rgb), 0.82) !important;
}

.ck-scan-skeleton:nth-child(2) {
  width: 84% !important;
}

.ck-scan-skeleton:nth-child(3) {
  width: 68% !important;
}

.ck-candidate-row {
  min-height: 67px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ck-line);
  color: var(--ck-text);
  background: var(--ck-ink);
}

.ck-candidate-row:hover,
.ck-candidate-row.is-selected {
  background: var(--ck-ink);
}

.ck-candidate-row.is-blocked {
  opacity: 0.58;
}

.ck-row-check {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ck-elevated);
  border-radius: 5px;
  background: var(--ck-ink);
}

.ck-candidate-row.is-selected .ck-row-check {
  border-color: var(--ck-blue);
  background: var(--ck-elevated);
}

.ck-rank {
  color: var(--ck-text-faint);
  font-family: var(--ck-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ck-ticker {
  color: var(--ck-text);
  font-size: 15px;
  font-weight: 900;
}

.ck-company {
  margin-top: 4px;
  color: var(--ck-text-faint);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ck-tradeability {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ck-green);
  font-family: var(--ck-mono);
  font-size: 11px;
  font-weight: 900;
}

.ck-tradeability.watch {
  color: var(--ck-cyan);
}

.ck-tradeability.blocked {
  color: var(--ck-yellow);
}

.ck-pip {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--ck-elevated);
}

.ck-pip.on {
  background: var(--ck-buy);
}

.ck-pip.watch {
  background: var(--ck-cyan);
}

.ck-pip.blocked {
  background: var(--ck-yellow);
}

.ck-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 21px;
  padding: 0 9px;
  border: 1px solid var(--ck-buy);
  border-radius: 5px;
  color: var(--ck-green);
  font-family: var(--ck-mono);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.ck-chip.standard {
  border-color: var(--ck-cyan);
  color: var(--ck-cyan);
}

.ck-chip.spec {
  border-color: var(--ck-yellow);
  color: var(--ck-yellow);
}

.ck-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ck-score-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ck-score-bar {
  width: 60px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ck-green) var(--ck-score), var(--ck-elevated) var(--ck-score));
}

.ck-num,
.ck-upside {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ck-text-body);
}

.ck-upside {
  color: var(--ck-green);
}

.ck-muted {
  color: var(--ck-text-faint);
}

.ck-last-run {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ck-text-body);
  font-family: var(--ck-mono);
  font-size: 11px;
  font-weight: 800;
}

.ck-last-run.saved {
  color: var(--ck-green);
}

.ck-last-run.running {
  color: var(--ck-cyan);
}

.ck-last-run.blocked {
  color: var(--ck-yellow);
}

.ck-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(var(--pa-accent-soft-rgb), 0.13);
}

.ck-row-action {
  min-width: 68px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ck-royal);
  border-radius: 6px;
  background: var(--ck-panel);
  color: var(--ck-text-body);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.ck-row-action.open {
  border-color: var(--ck-buy);
  background: var(--ck-panel);
  color: var(--ck-buy);
}

.ck-row-action:disabled {
  opacity: 0.45;
}

.ck-empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 7px;
  text-align: center;
  color: var(--ck-text-muted);
}

.ck-empty-title {
  color: var(--ck-text);
  font-size: 14px;
  font-weight: 900;
}

.ck-empty-copy {
  font-family: var(--ck-mono);
  font-size: 11px;
}

.ck-discover-foot {
  grid-row: 4;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  padding: 0 20px;
  border-top: 1px solid var(--ck-line);
  background: var(--ck-ink);
  color: var(--ck-text-muted);
  font-family: var(--ck-mono);
  font-size: 11px;
}

.ck-pipeline-view {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(430px, 46vw) 1fr;
  background: var(--ck-ink);
}

.ck-pipeline-rail,
.ck-pipeline-inspector {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  border-right: 1px solid var(--ck-line);
}

.ck-pane-head {
  height: 54px;
  display: grid;
  grid-template-columns: 1fr 190px;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  border-bottom: 1px solid var(--ck-line);
}

.ck-pane-title h2 {
  margin: 0;
  color: var(--ck-text);
  font-size: 16px;
  font-weight: 900;
}

.ck-pane-title span {
  color: var(--ck-text-body);
  font-family: var(--ck-mono);
  font-size: 11px;
}

.ck-run-progress {
  display: grid;
  grid-template-columns: 1fr 46px;
  align-items: center;
  gap: 10px;
  color: var(--ck-text);
  font-family: var(--ck-mono);
  font-size: 11px;
}

.ck-run-progress::before {
  content: "";
  height: 4px;
  grid-row: 1;
  grid-column: 1;
  border-radius: 999px;
  background: var(--ck-elevated);
}

.ck-progress-fill {
  height: 4px;
  grid-row: 1;
  grid-column: 1;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ck-green), var(--ck-blue));
  z-index: 1;
}

.ck-node-list {
  padding: 18px 26px 76px;
}

.ck-node {
  display: grid;
  grid-template-columns: 34px 1fr 32px;
  gap: 12px;
  padding: 12px 0;
  position: relative;
}

.ck-node::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 34px;
  bottom: -18px;
  width: 1px;
  background: var(--ck-elevated);
}

.ck-node:last-child::before {
  display: none;
}

.ck-node-marker {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ck-green);
  border-radius: 999px;
  color: var(--ck-green);
  font-family: var(--ck-mono);
  font-size: 9px;
  font-weight: 900;
}

.ck-node.running .ck-node-marker {
  border-color: var(--ck-blue);
  color: var(--ck-blue);
}

.ck-node.warn .ck-node-marker {
  border-color: var(--ck-yellow);
  color: var(--ck-yellow);
}

.ck-node.queued .ck-node-marker {
  border-color: var(--ck-border);
  color: var(--ck-text-faint);
}

.ck-node-body {
  min-width: 0;
}

.ck-node-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ck-node-title {
  color: var(--ck-text);
  font-weight: 900;
  font-size: 14px;
}

.ck-node-summary {
  margin-top: 5px;
  color: var(--ck-text-muted);
  font-size: 12px;
}

.ck-node-pill {
  height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid currentColor;
  color: var(--ck-green);
  font-family: var(--ck-mono);
  font-size: 9px;
  font-weight: 900;
}

.ck-node-pill.running {
  color: var(--ck-blue);
}

.ck-node-pill.warn,
.ck-node-pill.queued {
  color: var(--ck-yellow);
}

.ck-node-metrics {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  color: var(--ck-text-muted);
  font-family: var(--ck-mono);
  font-size: 11px;
}

.ck-node-metrics b {
  display: block;
  margin-top: 2px;
  color: var(--ck-text);
}

.ck-node-check {
  color: var(--ck-green);
  font-family: var(--ck-mono);
  font-size: 11px;
  font-weight: 900;
}

.ck-node-legend {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 16px;
  padding: 12px 26px;
  border-top: 1px solid var(--ck-line);
  background: var(--ck-ink);
  color: var(--ck-text-muted);
  font-family: var(--ck-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.ck-pipeline-inspector {
  border-right: 0;
}

.ck-inspector-head {
  padding: 20px 26px;
  border-bottom: 1px solid var(--ck-line);
}

.ck-inspector-head h1 {
  margin: 12px 0 6px;
  color: var(--ck-text);
  font-size: 22px;
  font-weight: 900;
}

.ck-inspector-head p {
  margin: 0;
  color: var(--ck-text-body);
}

.ck-inspector-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ck-inspector-meta {
  display: flex;
  gap: 34px;
  margin-top: 18px;
}

.ck-inspector-meta span {
  display: block;
  color: var(--ck-text-faint);
  font-family: var(--ck-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.ck-inspector-meta b {
  color: var(--ck-text);
  font-size: 15px;
}

.ck-inspector-body {
  padding: 20px 26px 96px;
}

.ck-substeps,
.ck-stream {
  margin: 12px 0 24px;
  border: 1px solid var(--ck-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ck-ink);
}

.ck-substep {
  display: grid;
  grid-template-columns: 26px 1fr 24px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ck-line);
  color: var(--ck-text-body);
}

.ck-substep:last-child {
  border-bottom: 0;
}

.ck-substep.active span,
.ck-stream-log .warn {
  color: var(--ck-yellow);
}

.ck-stream-head {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ck-line);
  color: var(--ck-text-faint);
  font-family: var(--ck-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.ck-stream-log {
  padding: 12px 16px;
  display: grid;
  gap: 10px;
  font-family: var(--ck-mono);
  font-size: 12px;
}

.ck-stream-log > div {
  display: grid;
  grid-template-columns: 72px 20px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--ck-text-muted);
}

.ck-stream-log b {
  color: var(--ck-text);
}

.ck-stream-log .info {
  color: var(--ck-blue);
}

.ck-confidence {
  color: var(--ck-text-body);
}

.ck-final-output {
  margin: 12px 0 24px;
  padding: 16px;
  border: 1px solid var(--ck-line);
  border-radius: 8px;
  background: var(--ck-ink);
}

.ck-final-output.is-pending {
  opacity: 0.72;
}

.ck-final-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.ck-final-rating {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--ck-line);
  border-radius: 6px;
  color: var(--ck-text);
  font-weight: 800;
  letter-spacing: 0;
}

.ck-final-rating.buy {
  color: var(--ck-green);
  border-color: rgba(43, 230, 139, 0.7);
}

.ck-final-rating.sell {
  color: var(--ck-sell);
  border-color: rgba(255, 122, 144, 0.7);
}

.ck-final-rating.hold {
  color: var(--ck-yellow);
  border-color: rgba(255, 204, 51, 0.7);
}

.ck-final-rating.no-rating {
  color: var(--ck-text-muted);
}

.ck-final-state {
  color: var(--ck-text-muted);
  font-family: var(--ck-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.ck-final-state.buy_enabled,
.ck-final-state.sell_enabled {
  color: var(--ck-green);
}

.ck-final-state.blocked,
.ck-final-state.no_position {
  color: var(--ck-yellow);
}

.ck-final-summary {
  margin: 12px 0 14px;
  color: var(--ck-text-body);
  line-height: 1.45;
}

.ck-final-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ck-final-metrics > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(var(--ck-border-rgb), 0.75);
  border-radius: 6px;
  background: rgba(var(--ck-ink-rgb), 0.35);
}

.ck-final-metrics span {
  display: block;
  margin-bottom: 4px;
  color: var(--ck-text-faint);
  font-family: var(--ck-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.ck-final-metrics b {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ck-text);
}

.ck-final-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.ck-final-chip {
  padding: 4px 8px;
  border: 1px solid rgba(255, 204, 51, 0.45);
  border-radius: 999px;
  color: var(--ck-yellow);
  font-family: var(--ck-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.ck-final-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ck-final-action {
  min-width: 92px;
  min-height: 34px;
  border: 1px solid var(--ck-line);
  border-radius: 7px;
  background: var(--ck-panel);
  color: var(--ck-text);
  font-weight: 800;
}

.ck-final-action.buy:not(:disabled) {
  border-color: var(--ck-green);
  color: var(--ck-green);
}

.ck-final-action.sell:not(:disabled) {
  border-color: var(--ck-sell);
  color: var(--ck-sell);
}

.ck-final-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ck-final-alert {
  margin-top: 10px;
}

.ck-final-alert-message {
  padding: 10px 12px;
  border: 1px solid var(--ck-line);
  border-radius: 6px;
  color: var(--ck-text-body);
  background: rgba(var(--ck-ink-rgb), 0.45);
  font-size: 13px;
}

.ck-final-alert-message.ok {
  border-color: rgba(43, 230, 139, 0.55);
  color: var(--ck-green);
}

.ck-final-alert-message.warn {
  border-color: rgba(255, 204, 51, 0.55);
  color: var(--ck-yellow);
}

@keyframes ck-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .ck-table-head,
  .ck-candidate-row {
    grid-template-columns: 36px 34px minmax(180px, 1fr) 132px 110px 110px 86px 86px 78px minmax(130px, 0.8fr) 86px;
  }

  .ck-discover-table > .ck-toolbar-left {
    padding-right: 360px;
  }

  .ck-discover-table > .ck-toolbar-right {
    padding-left: 360px;
  }
}

@media (max-width: 820px) {
  #analyzer-cockpit {
    overflow: auto;
  }

  .ck-shell {
    min-width: 980px;
  }
}

/* ============================================================
   SLATE override — the *-rgb surface tokens have no --pa rgb twin,
   so flip them here to the charcoal surfaces. Everything else in
   this file re-themes automatically via the --pa-* aliases above.
   ============================================================ */
html.theme-slate #analyzer-cockpit {
  --ck-ink-rgb: 21, 23, 28;
  --ck-panel-rgb: 29, 32, 39;
  --ck-border-rgb: 44, 49, 59;
}
