/* Winston V3 — Playbooks screen styles.
   See dashboard/docs/architecture/playbook-design-lens.md and mockups
   at dashboard/v3/mockups/universe-c-v4.html for the visual reference.
   Tracker #226.
*/

.playbooks-screen {
  max-width: var(--content-max-dense, 1600px);
  margin-left: auto;
  margin-right: auto;
  padding: var(--space-6) var(--content-pad);
}

.playbooks-head { margin-bottom: var(--space-6); }
.playbooks-eyebrow {
  font-size: var(--type-xs);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: var(--weight-semi);
  margin-bottom: var(--space-2);
}
.playbooks-screen h1 {
  font-size: var(--type-2xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-3);
  line-height: var(--leading-tight);
}
.playbooks-intro {
  font-size: var(--type-sm);
  color: var(--ink-3);
  max-width: 720px;
  margin: 0;
  line-height: var(--leading-base);
}
.playbooks-intro strong { color: var(--ink); font-weight: var(--weight-semi); }

/* ── Market mood band ─────────────────────────────────────────────── */
.pb-mood-band {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--warn-soft);
  border: 1px solid rgba(217, 119, 6, 0.40);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  margin-bottom: var(--space-4);
}
.pb-mood-band[data-regime="risk_on"] {
  background: var(--money-up-soft);
  border-color: var(--money-up-line);
}
.pb-mood-band[data-regime="risk_on"] .pb-mood-title { color: var(--money-up); }
.pb-mood-band[data-regime="crisis"] {
  background: var(--money-down-soft);
  border-color: var(--money-down-line);
}
.pb-mood-band[data-regime="crisis"] .pb-mood-title { color: var(--money-down); }
.pb-mood-band[data-regime="neutral"] {
  background: var(--surface-2);
  border-color: var(--border);
}
.pb-mood-band[data-regime="neutral"] .pb-mood-title { color: var(--ink-3); }

.pb-mood-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }
.pb-mood-body { flex: 1; }
.pb-mood-title {
  font-size: var(--type-xs);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--warn);
  font-weight: var(--weight-bold);
  margin-bottom: 2px;
}
.pb-mood-text { font-size: var(--type-sm); color: var(--ink); line-height: var(--leading-snug); }
.pb-mood-text strong { color: var(--ink); font-weight: var(--weight-semi); }

/* ── Auto-pick band (per-sleeve, lives above each picker's active-set) ─ */
.pb-autopick-card,
.pb-autopick-band {
  background: var(--ai-soft);
  border: 1px solid var(--ai-line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.pb-autopick-band.is-active {
  border-color: var(--ai);
  background: color-mix(in srgb, var(--ai) 6%, var(--surface));
}
.pb-autopick-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ai);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-black);
  font-size: 16px;
  flex-shrink: 0;
}
.pb-autopick-body { flex: 1; min-width: 0; }
.pb-autopick-title {
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  color: var(--ink);
  margin-bottom: 2px;
}
.pb-autopick-sub { font-size: var(--type-sm); color: var(--ink-3); line-height: var(--leading-snug); }

.pb-toggle {
  width: 44px; height: 24px;
  background: var(--surface-3);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0;
}
.pb-toggle .pb-toggle-knob {
  position: absolute;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px; left: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left var(--motion-fast) var(--ease-out);
}
.pb-toggle[aria-pressed="true"] {
  background: var(--ai);
  border-color: var(--ai);
}
.pb-toggle[aria-pressed="true"] .pb-toggle-knob { left: 22px; }
.pb-toggle:disabled { opacity: 0.5; cursor: progress; }
.pb-toggle.is-mixed {
  background: var(--ai-soft);
  border-color: var(--ai);
}
.pb-toggle.is-mixed .pb-toggle-knob { left: 12px; }

/* Auto-pick: card emphasis when at least one sleeve is on. */
.pb-autopick-card.is-active {
  border-color: var(--ai);
  background: color-mix(in srgb, var(--ai) 5%, var(--surface));
}
.pb-autopick-pick {
  display: inline-block;
  margin-right: 8px;
  font-size: var(--type-sm);
}

/* Auto-pick: sleeve tab eyebrow shows the regime-resolved playbook name
   when this sleeve is in auto-pick mode. Cobalt instead of the static
   sleeve tint so it reads as "Winston-driven" at a glance. */
.pb-sleeve-tab-eyebrow-auto {
  color: var(--ai) !important;
  font-family: var(--font-mono);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.pb-sleeve-tab.is-auto-picked .pb-sleeve-tab-count {
  /* When auto-pick is on for this sleeve, the count gives way to the
     resolved-name marker — dim the count so the eyebrow draws the eye. */
  color: var(--ink-faint);
}

/* ── Sleeve tabs ──────────────────────────────────────────────────── */
.playbooks-sleeve-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.pb-sleeve-tab {
  padding: var(--space-3) var(--space-4);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  text-align: left;
}
.pb-sleeve-tab-name {
  font-weight: var(--weight-semi);
  font-size: var(--type-base);
}
.pb-sleeve-tab-count {
  font-family: var(--font-mono);
  font-size: var(--type-sm);
  color: var(--ink-faint);
  font-weight: var(--weight-medium);
}
.pb-sleeve-tab-eyebrow {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: var(--weight-medium);
  margin-top: 2px;
}
.pb-sleeve-tab.is-active { color: var(--ink); }
.pb-sleeve-tab.is-active .pb-sleeve-tab-count { color: var(--ink-2); }
.pb-sleeve-tab[data-tier-tint="swing"].is-active   { border-bottom-color: var(--sleeve-swing); }
.pb-sleeve-tab[data-tier-tint="swing"].is-active   .pb-sleeve-tab-eyebrow { color: var(--sleeve-swing); }
.pb-sleeve-tab[data-tier-tint="scalp"].is-active   { border-bottom-color: var(--sleeve-scalp); }
.pb-sleeve-tab[data-tier-tint="scalp"].is-active   .pb-sleeve-tab-eyebrow { color: var(--sleeve-scalp); }
.pb-sleeve-tab[data-tier-tint="short"].is-active   { border-bottom-color: var(--sleeve-short); }
.pb-sleeve-tab[data-tier-tint="short"].is-active   .pb-sleeve-tab-eyebrow { color: var(--sleeve-short); }
.pb-sleeve-tab[data-tier-tint="options"].is-active { border-bottom-color: var(--sleeve-options); }
.pb-sleeve-tab[data-tier-tint="options"].is-active .pb-sleeve-tab-eyebrow { color: var(--sleeve-options); }
.pb-sleeve-tab[data-tier-tint="rotation"].is-active  { border-bottom-color: var(--sleeve-rotation); }
.pb-sleeve-tab[data-tier-tint="rotation"].is-active  .pb-sleeve-tab-eyebrow { color: var(--sleeve-rotation); }
.pb-sleeve-tab[data-tier-tint="reversion"].is-active { border-bottom-color: var(--sleeve-reversion); }
.pb-sleeve-tab[data-tier-tint="reversion"].is-active .pb-sleeve-tab-eyebrow { color: var(--sleeve-reversion); }
.pb-sleeve-tab[data-tier-tint="trend"].is-active     { border-bottom-color: var(--sleeve-trend); }
.pb-sleeve-tab[data-tier-tint="trend"].is-active     .pb-sleeve-tab-eyebrow { color: var(--sleeve-trend); }
.pb-sleeve-tab[data-tier-tint="income"].is-active    { border-bottom-color: var(--sleeve-income); }
.pb-sleeve-tab[data-tier-tint="income"].is-active    .pb-sleeve-tab-eyebrow { color: var(--sleeve-income); }
.pb-sleeve-tab[data-tier-tint="pead"].is-active      { border-bottom-color: var(--sleeve-pead); }
.pb-sleeve-tab[data-tier-tint="cta"].is-active      { border-bottom-color: var(--sleeve-cta); }
.pb-sleeve-tab[data-tier-tint="momentum"].is-active { border-bottom-color: var(--sleeve-momentum); }
.pb-sleeve-tab[data-tier-tint="pead"].is-active      .pb-sleeve-tab-eyebrow { color: var(--sleeve-pead); }
.pb-sleeve-tab[data-tier-tint="cta"].is-active      .pb-sleeve-tab-eyebrow { color: var(--sleeve-cta); }
.pb-sleeve-tab[data-tier-tint="momentum"].is-active .pb-sleeve-tab-eyebrow { color: var(--sleeve-momentum); }

/* ── Engine-status card (Hedge / Insurance dormant view) ─────────── */
.pb-engine-status {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.pb-engine-status-off { background: var(--surface-2); }
.pb-engine-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: var(--weight-bold);
  font-size: var(--type-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.pb-engine-status-pill-off {
  background: var(--ink-faint);
  color: white;
}
.pb-engine-status-pill-on {
  background: var(--money-up);
  color: white;
}
.pb-engine-status-pill .pb-engine-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: white;
  opacity: 0.85;
}
.pb-engine-status-body { flex: 1; min-width: 240px; }
.pb-engine-status-title {
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  color: var(--ink);
  margin-bottom: var(--space-1);
  letter-spacing: var(--tracking-snug);
}
.pb-engine-status-text {
  font-size: var(--type-sm);
  color: var(--ink-3);
  line-height: var(--leading-base);
}
.pb-engine-status-text strong { color: var(--ink); font-weight: var(--weight-semi); }
.pb-engine-status-text em { color: var(--ink-3); font-style: italic; }
.pb-engine-status-action { flex-shrink: 0; }

/* ── Conditions card (Hedge) ──────────────────────────────────────── */
.pb-conditions-card {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-3) 0 var(--space-4);
}
.pb-conditions-title {
  font-size: var(--type-xs);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}
.pb-cond-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 6px 0;
  font-size: var(--type-sm);
}
.pb-cond-mark {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.pb-cond-label { color: var(--ink); }
.pb-cond-actual {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--type-xs);
  color: var(--ink-muted);
}

/* ── ETF cards (Hedge) ────────────────────────────────────────────── */
.pb-etf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.pb-etf-name {
  font-family: var(--font-mono);
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  color: var(--ink);
  min-width: 80px;
}
.pb-etf-desc {
  flex: 1;
  font-size: var(--type-sm);
  color: var(--ink-3);
  line-height: var(--leading-snug);
}
.pb-etf-desc strong { color: var(--ink); font-weight: var(--weight-semi); }

/* ── Cards ────────────────────────────────────────────────────────── */
.pb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

/* ── Active-playbook hero card ────────────────────────────────────── */
.pb-active-set {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  margin-bottom: var(--space-5);
}
.pb-active-set::before {
  content: "IN USE TODAY";
  position: absolute;
  top: -10px;
  left: var(--space-6);
  color: white;
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.10em;
  padding: 3px 10px;
  border-radius: 999px;
}
/* Dormant engines (Hedge, Insurance with engine.enabled=false) carry a
   different badge — the hero card is showing a preview of what Winston
   WOULD do if turned on, not what's actually running. Lens § The
   canonical Playbook page shape. */
.pb-active-set.is-preview::before { content: "WHAT WINSTON WOULD DO"; }
.pb-active-set-swing::before { background: var(--sleeve-swing); }
.pb-active-set-scalp::before { background: var(--sleeve-scalp); }
.pb-active-set-short::before { background: var(--sleeve-short); }
.pb-active-set-options::before { background: var(--sleeve-options); }
.pb-active-set-rotation::before { background: var(--sleeve-rotation); }
.pb-active-set-reversion::before { background: var(--sleeve-reversion); }
.pb-active-set-trend::before { background: var(--sleeve-trend); }
.pb-active-set-income::before { background: var(--sleeve-income); }
.pb-active-set-pead::before { background: var(--sleeve-pead); }
.pb-active-set-cta::before { background: var(--sleeve-cta); }
.pb-active-set-momentum::before { background: var(--sleeve-momentum); }

.pb-active-set-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pb-active-set-head-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pb-active-set-name {
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  color: var(--ink);
  letter-spacing: var(--tracking-snug);
  margin-bottom: 2px;
}
.pb-active-set-meta {
  font-size: var(--type-xs);
  color: var(--ink-muted);
}

.pb-stale-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: var(--type-xs);
  font-weight: var(--weight-semi);
}
.pb-stale-pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid rgba(217,119,6,0.40);
}
.pb-stale-pill-ok {
  background: var(--money-up-soft);
  color: var(--money-up);
  border: 1px solid var(--money-up-line);
}

/* Summary line — the one-sentence headline */
.pb-summary-line {
  font-size: var(--type-md);
  color: var(--ink);
  line-height: var(--leading-snug);
  padding: var(--space-3) 0 var(--space-4);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-5);
}
.pb-summary-line strong { font-weight: var(--weight-bold); }
.pb-summary-line .big {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
}
.pb-summary-line .big.green { color: var(--money-up); }
.pb-summary-line .big.red   { color: var(--money-down); }

/* ── Stock groups ─────────────────────────────────────────────────── */
.pb-stock-group { margin-bottom: var(--space-5); }
.pb-stock-group:last-of-type { margin-bottom: 0; }
.pb-stock-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.pb-stock-group-head .pb-group-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.pb-group-dot-ready   { background: var(--money-up); }
.pb-group-dot-owned   { background: var(--ai); }
.pb-group-dot-blocked { background: var(--ink-faint); }

.pb-group-title {
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  color: var(--ink);
}
.pb-group-count {
  font-family: var(--font-mono);
  font-size: var(--type-sm);
  color: var(--ink-muted);
  font-weight: var(--weight-semi);
}
.pb-group-desc {
  font-size: var(--type-sm);
  color: var(--ink-muted);
}

.pb-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: var(--space-2);
}

.pb-stock-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--motion-fast) var(--ease-out);
}
.pb-stock-card:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.pb-stock-card-tk {
  font-family: var(--font-mono);
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.pb-stock-card-pr {
  font-family: var(--font-mono);
  font-size: var(--type-xs);
  color: var(--ink-3);
  margin-top: 6px;
  line-height: 1;
}
.pb-stock-card-ch {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 4px;
  line-height: 1;
  font-weight: var(--weight-semi);
}
.pb-stock-card-ch.up { color: var(--money-up); }
.pb-stock-card-ch.down { color: var(--money-down); }

.pb-stock-card-owned {
  background: var(--ai-soft);
  border-color: var(--ai-line);
}
.pb-stock-card-owned::after {
  content: "OWNED";
  display: block;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--ai);
  font-weight: var(--weight-bold);
  margin-top: 4px;
  font-family: var(--font-body);
}

.pb-stock-group-blocked.is-placeholder .pb-stock-group-head {
  opacity: 0.8;
}

/* ── Perf strip (placeholder in Slice 1) ──────────────────────────── */
.pb-perf-strip {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.pb-perf-head { font-size: var(--type-sm); color: var(--ink-3); font-weight: var(--weight-medium); }
.pb-perf-stat { font-size: var(--type-xs); }
.pb-perf-stat a { color: var(--ai); font-weight: var(--weight-semi); }

/* ── Row actions ──────────────────────────────────────────────────── */
.pb-row-actions {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
}
.pb-ghost-link {
  color: var(--ai);
  font-size: var(--type-sm);
  text-decoration: none;
  font-weight: var(--weight-semi);
}
.pb-ghost-link:hover { text-decoration: underline; }

/* ── Bookshelf ────────────────────────────────────────────────────── */
.pb-bookshelf { margin-top: var(--space-8); }
.pb-bookshelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pb-bookshelf-title {
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  color: var(--ink);
  letter-spacing: var(--tracking-snug);
}
.pb-bookshelf-sub {
  font-size: var(--type-sm);
  color: var(--ink-muted);
  margin-top: 2px;
}
.pb-bookshelf-new {
  background: var(--ai);
  color: white;
  border: 1px solid var(--ai);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  text-decoration: none;
}
.pb-bookshelf-new:hover { background: var(--ai-2); }

.pb-bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}
.pb-ruleset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 120px;
}
.pb-ruleset-card:hover { border-color: var(--border-strong); }
.pb-ruleset-name {
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  color: var(--ink);
}
.pb-ruleset-status { font-size: var(--type-xs); }

/* ── Editor view (slice 3) ────────────────────────────────────────── */
.pb-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  overflow: hidden;
}
.pb-editor-back {
  padding: var(--space-3) var(--space-5) 0;
}
.pb-editor-head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.pb-editor-name {
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  color: var(--ink);
  letter-spacing: var(--tracking-snug);
  margin-bottom: var(--space-1);
}
.pb-editor-meta {
  font-size: var(--type-xs);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pb-editor-actions-head { flex-shrink: 0; }
.pb-editor-tabs {
  display: flex;
  gap: 2px;
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border);
}
.pb-editor-tab {
  background: transparent;
  border: none;
  padding: var(--space-3) var(--space-4) var(--space-4);
  cursor: pointer;
  color: var(--ink-muted);
  font-size: var(--type-sm);
  font-weight: var(--weight-semi);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.pb-editor-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--ai);
}
.pb-editor-body { padding: var(--space-4) var(--space-5); }

.pb-editor-readonly-note {
  font-size: var(--type-sm);
  margin: 0 0 var(--space-4);
  line-height: var(--leading-snug);
  padding: var(--space-3) var(--space-4);
  background: var(--ai-soft);
  border-left: 3px solid var(--ai);
  border-radius: var(--radius-xs);
}
.pb-editor-readonly-note a { color: var(--ai); font-weight: var(--weight-semi); }

/* Slice 4: editable knob inputs + dirty state. */
.pb-knob-edit {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  color: var(--ink);
  width: 100%;
  outline: none;
  padding: 0;
}
.pb-knob-input.is-dirty {
  background: var(--ai-soft);
  border-color: var(--ai);
}
.pb-knob-row.is-dirty .pb-knob-label {
  color: var(--ai);
  font-weight: var(--weight-bold);
}
.pb-knob-dirty-dot {
  width: 6px; height: 6px;
  background: var(--ai);
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}
.pb-knob-readonly-tag {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: var(--weight-bold);
  margin-left: var(--space-2);
}

/* Slice 4: editor action bar (Save / Activate / Discard). */
.pb-editor-actions {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}
.pb-editor-dirty-count {
  font-size: var(--type-xs);
  color: var(--ai);
  font-weight: var(--weight-semi);
}
.pb-editor-dirty-count .pb-editor-dirty-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ai);
  margin-right: 6px;
  vertical-align: middle;
}
.pb-editor-btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: var(--type-xs);
  font-weight: var(--weight-semi);
  cursor: pointer;
  font-family: inherit;
}
.pb-editor-btn:disabled,
.pb-editor-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.pb-editor-btn-primary {
  background: var(--ai);
  color: white;
  border-color: var(--ai);
  font-weight: var(--weight-bold);
}
.pb-editor-btn-secondary {
  background: var(--money-up-soft);
  color: var(--money-up);
  border-color: rgba(21,128,61,0.30);
  font-weight: var(--weight-bold);
}

/* Knob bucket section */
.pb-knob-group {
  padding: var(--space-4) 0;
  border-bottom: 1px dashed var(--border);
}
.pb-knob-group:last-child { border-bottom: none; }
.pb-knob-group-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.pb-knob-group-name {
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  color: var(--ink);
}
.pb-knob-group-sub {
  font-size: var(--type-xs);
  color: var(--ink-muted);
}

.pb-knob-rows { display: flex; flex-direction: column; }
.pb-knob-row {
  display: grid;
  grid-template-columns: 220px 160px 1fr;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  align-items: center;
}
.pb-knob-label {
  font-size: var(--type-sm);
  color: var(--ink);
  font-weight: var(--weight-medium);
}
.pb-knob-input {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.pb-knob-value {
  font-family: var(--font-mono);
  font-size: var(--type-sm);
  font-weight: var(--weight-bold);
  color: var(--ink);
}
.pb-knob-help {
  font-size: var(--type-xs);
  color: var(--ink-3);
  line-height: var(--leading-snug);
}

@media (max-width: 600px) {
  .pb-knob-row { grid-template-columns: 1fr; gap: var(--space-1); }
  .pb-knob-help { font-size: 11px; }
}

/* ── Wizard (slice 6) ─────────────────────────────────────────────── */
.pb-wizard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-5);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.pb-wizard-head {
  padding: var(--space-5) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.pb-wizard-back { margin-bottom: var(--space-2); }
.pb-wizard-title {
  font-size: var(--type-lg);
  font-weight: var(--weight-bold);
  color: var(--ink);
  margin: 0 0 var(--space-2);
  letter-spacing: var(--tracking-snug);
}
.pb-wizard-sub {
  font-size: var(--type-sm);
  color: var(--ink-3);
  margin: 0;
  line-height: var(--leading-base);
  max-width: 740px;
}

/* Progress bar */
.pb-wizard-progress {
  padding: var(--space-4) var(--space-6);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pb-wp-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.pb-wp-marker {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-bold);
}
.pb-wp-step.is-done .pb-wp-marker {
  background: var(--money-up);
  border-color: var(--money-up);
  color: white;
}
.pb-wp-step.is-current .pb-wp-marker {
  background: var(--ai);
  border-color: var(--ai);
  color: white;
}
.pb-wp-label {
  font-size: var(--type-xs);
  color: var(--ink-3);
  font-weight: var(--weight-medium);
}
.pb-wp-step.is-current .pb-wp-label { color: var(--ink); font-weight: var(--weight-bold); }
.pb-wp-step.is-done .pb-wp-label { color: var(--ink-3); }
.pb-wp-connector {
  flex: 0 0 24px;
  height: 2px;
  background: var(--border);
  margin-top: 12px;
}
.pb-wp-connector.is-done { background: var(--money-up); }

/* Body */
.pb-wizard-body { padding: var(--space-6); }
.pb-wizard-q {
  font-size: var(--type-xl);
  font-weight: var(--weight-bold);
  color: var(--ink);
  letter-spacing: var(--tracking-snug);
  margin: 0 0 var(--space-2);
}
.pb-wizard-step-sub {
  font-size: var(--type-sm);
  color: var(--ink-3);
  line-height: var(--leading-base);
  margin-bottom: var(--space-4);
  max-width: 740px;
}
.pb-wizard-brain-hint {
  background: var(--ai-soft);
  border-left: 3px solid var(--ai);
  padding: var(--space-3) var(--space-4);
  font-size: var(--type-sm);
  color: var(--ink-3);
  border-radius: var(--radius-xs);
  margin-bottom: var(--space-5);
  line-height: var(--leading-base);
}
.pb-wizard-brain-hint strong { color: var(--ai); font-weight: var(--weight-bold); }
.pb-wizard-brain-hint .mono { font-family: var(--font-mono); font-weight: var(--weight-bold); color: var(--ink); }

/* Radio rows */
.pb-wiz-radio-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--type-sm);
  color: var(--ink);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--motion-fast) var(--ease-out);
}
.pb-wiz-radio-row:hover { background: var(--surface-2); }
.pb-wiz-radio-dot {
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
}
.pb-wiz-radio-dot.is-on {
  border-color: var(--ai);
  background: radial-gradient(circle, var(--ai) 0 4px, transparent 5px);
}
.pb-wiz-radio-label { flex: 1; }
.pb-wiz-radio-meta {
  font-size: var(--type-xs);
  color: var(--ink-muted);
  font-family: var(--font-mono);
}
.pb-wiz-brain-tag {
  font-size: 10px;
  color: white;
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ai);
  padding: 3px 10px;
  border-radius: 999px;
}

/* Profile cards (Step 2 risk) */
.pb-wiz-profile-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.pb-wiz-profile-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--motion-fast) var(--ease-out);
}
.pb-wiz-profile-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pb-wiz-profile-card.is-selected {
  border-color: var(--ai);
  border-width: 2.5px;
  background: var(--ai-soft);
  box-shadow: 0 4px 14px rgba(31, 63, 143, 0.10);
}
.pb-wiz-winston-pick {
  position: absolute;
  top: -10px;
  right: 18px;
  background: var(--ai);
  color: white;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pb-wiz-profile-icon { font-size: 28px; line-height: 1; }
.pb-wiz-profile-name {
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  color: var(--ink);
}
.pb-wiz-profile-oneliner {
  font-size: var(--type-sm);
  color: var(--ink-3);
  line-height: var(--leading-base);
}
.pb-wiz-profile-levers {
  display: flex;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
}
.pb-wiz-profile-card.is-selected .pb-wiz-profile-levers { border-top-color: var(--ai-line); }
.pb-wiz-lever-lbl {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: var(--weight-bold);
}
.pb-wiz-lever-val {
  font-family: var(--font-mono);
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  margin-top: var(--space-1);
}
.pb-wiz-lever-val.win  { color: var(--money-up); }
.pb-wiz-lever-val.loss { color: var(--money-down); }

/* Step 4 — name + summary */
.pb-wiz-name-input {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  font-family: inherit;
  font-size: var(--type-md);
  color: var(--ink);
  margin-bottom: var(--space-5);
}
.pb-wiz-name-input:focus { outline: 2px solid var(--ai-line); border-color: var(--ai); }
.pb-wiz-summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.pb-wiz-summary-head {
  font-size: var(--type-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}
.pb-wiz-summary-list {
  margin: 0;
  padding-left: var(--space-5);
  font-size: var(--type-sm);
  color: var(--ink);
}
.pb-wiz-summary-list li { padding: var(--space-1) 0; }
.pb-wiz-summary-list strong { color: var(--ink); font-weight: var(--weight-bold); }
.pb-wiz-summary-note { font-size: var(--type-xs); }
.pb-wiz-summary-note a { color: var(--ai); font-weight: var(--weight-semi); }

/* Wizard action bar */
.pb-wizard-actions {
  padding: var(--space-4) var(--space-6);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pb-wizard-btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: var(--type-sm);
  font-weight: var(--weight-semi);
  cursor: pointer;
  font-family: inherit;
}
.pb-wizard-btn-primary {
  background: var(--ai);
  color: white;
  border-color: var(--ai);
  font-weight: var(--weight-bold);
}

/* ── Coming-soon placeholder (slice 2 sleeves before they ship) ──── */
.pb-coming-soon {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  text-align: center;
  color: var(--ink-3);
}
.pb-coming-soon-icon { font-size: 32px; margin-bottom: var(--space-3); }
.pb-coming-soon-title {
  font-size: var(--type-md);
  font-weight: var(--weight-bold);
  color: var(--ink);
  margin-bottom: var(--space-2);
}
.pb-coming-soon-sub {
  font-size: var(--type-sm);
  color: var(--ink-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: var(--leading-base);
}
.pb-coming-soon-sub a { color: var(--ai); font-weight: var(--weight-semi); }

/* Helpers */
.playbooks-screen .muted { color: var(--ink-muted); }

/* ── Slice 5 — Past performance + Edit history ─────────────────────── */
.pb-perf-grid { display: flex; flex-direction: column; gap: var(--space-4); }
.pb-perf-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}
.pb-perf-stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
}
.pb-perf-stat-lbl {
  font-size: var(--type-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.pb-perf-stat-val { font-size: var(--type-xl); font-weight: 700; margin-top: 4px; }
.pb-perf-stat-sub { font-size: var(--type-xs); margin-top: 4px; }
.pb-perf-period {
  font-size: var(--type-xs);
  color: var(--ink-muted);
  border-top: 1px dashed var(--border);
  padding-top: var(--space-3);
}

.pb-history-list { display: flex; flex-direction: column; gap: 2px; }
.pb-history-row {
  display: grid;
  grid-template-columns: 140px 1fr 200px;
  gap: var(--space-3);
  padding: 8px 12px;
  border-left: 3px solid transparent;
  background: var(--surface);
  align-items: center;
}
.pb-history-row-operator { border-left-color: var(--ink); }
.pb-history-row-planner  { border-left-color: var(--accent-cobalt, #2358ff); }
.pb-history-row-actor    { font-size: var(--type-xs); font-weight: 700; }
.pb-history-row-label    { font-size: var(--type-sm); }
.pb-history-row-ts       { font-size: var(--type-xs); text-align: right; }
.pb-history-foot         { font-size: var(--type-xs); padding-top: var(--space-3); }

/* ── Slice 8 — Chat-proposal hand-off banner on the editor head ────── */
.pb-editor-draft-banner {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--accent-cobalt, #2358ff);
  background: color-mix(in srgb, var(--accent-cobalt, #2358ff) 6%, var(--surface));
  border-radius: var(--radius-sm);
}
.pb-editor-draft-banner .pb-w-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-cobalt, #2358ff);
  color: #fff;
  font-weight: 700;
  font-size: var(--type-sm);
  flex-shrink: 0;
}
.pb-editor-draft-body { flex: 1; }
.pb-editor-draft-title { font-weight: 700; font-size: var(--type-sm); }
.pb-editor-draft-rationale {
  font-size: var(--type-sm);
  font-style: italic;
  margin-top: 4px;
}
.pb-editor-draft-sub { font-size: var(--type-xs); margin-top: 4px; }

/* ── Mobile (≥ 768px is desktop layout above; --bp-md breakpoint) ─── */
@media (max-width: 600px) {
  .playbooks-screen { padding: var(--space-4) var(--content-pad-mobile); }
  .pb-active-set { padding: var(--space-4); }
  .pb-mood-band { padding: var(--space-3); }
  .pb-autopick-card { padding: var(--space-3); }
  .pb-stock-grid { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); }
}


/* ── Library — inline in each picker's bookshelf (#237) ────────────── */
/* The library table is rendered inside `.pb-bookshelf-library` so we can
   give the bookshelf wrapper a little more breathing room than the old
   4-card grid had. */
.pb-bookshelf-library { padding-top: var(--space-3); }
.pb-lib-gates {
  font-size: var(--type-sm);
  margin: var(--space-3) 0 var(--space-2);
}
.pb-lib-loading,
.pb-lib-error {
  font-size: var(--type-sm);
  margin: var(--space-3) 0;
}
.pb-lib-error { color: var(--danger-fg, #991b1b); }

.pb-lib-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-4);
}
.pb-lib-filter-group, .pb-lib-sort-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pb-lib-filter-label { font-size: var(--type-sm); color: var(--text-muted); }
.pb-lib-filter-chip {
  background: var(--surface-2, #f3f4f6);
  border: 1px solid var(--line-soft, #e5e7eb);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: var(--type-sm);
  cursor: pointer;
  color: var(--text-default);
}
.pb-lib-filter-chip.is-active {
  background: var(--ai-soft, #eef2ff);
  border-color: var(--ai-line, #c7d2fe);
  color: var(--ai-fg, #4338ca);
  font-weight: 600;
}
.pb-lib-filter-chip .mono { color: var(--text-muted); font-size: var(--type-xs); margin-left: 4px; }
.pb-lib-sort-group select {
  padding: 4px 8px;
  border: 1px solid var(--line-soft, #e5e7eb);
  border-radius: 6px;
  background: var(--surface-1, #fff);
  font-size: var(--type-sm);
  color: var(--text-default);
}

.pb-lib-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-sm);
  background: var(--surface-1, #fff);
  border: 1px solid var(--line-soft, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
}
.pb-lib-table th, .pb-lib-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft, #e5e7eb);
}
.pb-lib-table th {
  background: var(--surface-2, #f9fafb);
  font-weight: 600;
  font-size: var(--type-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.pb-lib-table th.num, .pb-lib-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pb-lib-table tbody tr:last-child td { border-bottom: none; }
.pb-lib-row { transition: background 120ms ease; }
.pb-lib-row:hover { background: var(--surface-2, #f9fafb); }
.pb-lib-row.is-active { background: var(--ai-soft, #eef2ff); }
.pb-lib-row.is-active:hover { background: var(--ai-soft, #e0e7ff); }

.pb-lib-active-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: var(--type-xs);
  font-weight: 700;
  background: var(--ai-line, #c7d2fe);
  color: var(--ai-fg, #4338ca);
  border-radius: 4px;
}

.pb-lib-owner-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--type-xs);
  font-weight: 600;
  border-radius: 999px;
}
.pb-lib-owner-winston {
  background: var(--ai-soft, #eef2ff);
  color: var(--ai-fg, #4338ca);
}
.pb-lib-owner-user {
  background: #ecfdf5;
  color: #047857;
}
.pb-lib-owner-system {
  background: #f3f4f6;
  color: #4b5563;
}

.pb-lib-qual-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--type-xs);
  font-weight: 600;
  border-radius: 999px;
  cursor: help;
}
.pb-lib-qual-pass {
  background: #d1fae5;
  color: #065f46;
}
.pb-lib-qual-fail {
  background: #fee2e2;
  color: #991b1b;
}

.pb-lib-empty { text-align: center; padding: var(--space-4); }
.pb-lib-footnote { margin-top: var(--space-3); font-size: var(--type-sm); }

@media (max-width: 720px) {
  .pb-lib-table { font-size: var(--type-xs); }
  .pb-lib-table th, .pb-lib-table td { padding: 6px 8px; }
  .pb-lib-controls { flex-direction: column; align-items: flex-start; }
}


/* ── #313 strategy-discovery card — engine-led, Winston-first ───────────────
   Surfaced at the TOP of the Scalp picker when Winston has backtested + gated
   a new draft. Cobalt (--ai) accent marks it as a Winston-autonomous finding.
   Honest-evidence layout: drawdown carries equal visual weight to return; the
   "simulated" hazard label is always visible. */
.pb-discovery {
  border: 1px solid var(--ai-line);
  background: color-mix(in srgb, var(--ai) 4%, var(--surface));
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.pb-discovery-head { margin-bottom: var(--space-3); }
.pb-discovery-eyebrow {
  display: block;
  font-weight: 700;
  color: var(--ai);
  font-size: var(--type-base, 15px);
}
.pb-discovery-sub {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: var(--type-sm);
  line-height: var(--leading-snug);
}
.pb-discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}
.pb-discovery-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pb-discovery-card-head {
  display: flex;
  flex-wrap: wrap;          /* #313 audit: let the sim label drop below the name
                               at narrow widths instead of overflowing */
  justify-content: space-between;
  align-items: baseline;
  gap: 4px var(--space-2);
}
.pb-discovery-name { font-weight: 600; color: var(--ink); word-break: break-word; }
.pb-discovery-sim {
  font-size: var(--type-xs);
  font-weight: 600;
  color: var(--warn);
  white-space: nowrap;
}
.pb-discovery-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.pb-discovery-stat { display: flex; flex-direction: column; }
.pb-discovery-stat-label {
  font-size: var(--type-xs);
  color: var(--ink-3);
}
.pb-discovery-stat-val {
  font-size: var(--type-base, 15px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pb-discovery-stat-val.pos { color: var(--money-up); }
.pb-discovery-stat-val.neg { color: var(--money-down); }
.pb-discovery-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--type-xs);
  color: var(--ink-3);
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-2);
}
.pb-discovery-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.pb-discovery-btn,
.pb-discovery-btn-primary {
  cursor: pointer;
  font-size: var(--type-sm);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.pb-discovery-btn {
  color: var(--ai);
  border: 1px solid var(--ai-line);
  background: var(--surface);
}
.pb-discovery-btn-primary {
  color: #fff;
  background: var(--ai);
  border: 1px solid var(--ai);
  flex: 1;
}
.pb-discovery-btn:hover { background: var(--ai-soft); }
.pb-discovery-btn-primary:hover { filter: brightness(1.05); }

@media (max-width: 720px) {
  .pb-discovery-grid { grid-template-columns: 1fr; }
  /* #313 audit: two action buttons don't fit a phone-width card side by side
     — stack them so "Activate for tomorrow →" isn't clipped at the edge. */
  .pb-discovery-actions { flex-direction: column; }
}

/* #313 S2 — swing "live paper record" cards. The honest counterpart to the
   scalp `.pb-discovery-sim` warn label: a live record is earned evidence, not a
   caution, so it reads in the calm "live" accent rather than amber. */
.pb-discovery-live {
  font-size: var(--type-xs);
  font-weight: 600;
  color: var(--ai);
  white-space: nowrap;
}
.pb-paper-state {
  font-size: var(--type-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pb-paper-state-qualified       { color: var(--money-up); }
.pb-paper-state-building        { color: var(--ink-3); }
.pb-paper-state-underperforming { color: var(--money-down); }
.pb-paper-prov {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--warn);
}

/* ── Morning screen results (Universe bucket, swing) ──────────────────────── */
.pb-screen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.pb-screen-summary { font-size: var(--type-sm); color: var(--ink-2); }
.pb-screen-summary strong { color: var(--ink); }
.pb-screen-run { white-space: nowrap; }
.pb-screen-run[disabled] { opacity: 0.65; cursor: progress; }
.pb-screen-spin {
  display: inline-block;
  width: 11px; height: 11px;
  margin-right: 4px;
  vertical-align: -1px;
  border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent);
  border-top-color: var(--ai);
  border-radius: var(--radius-full);
  animation: pb-screen-spin 0.7s linear infinite;
}
@keyframes pb-screen-spin { to { transform: rotate(360deg); } }

.pb-screen-selected { display: flex; flex-direction: column; }
.pb-screen-row {
  display: grid;
  grid-template-columns: 4.5rem 3.5rem 1fr auto;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.pb-screen-row:last-child { border-bottom: none; }
.pb-screen-tk { font-weight: var(--weight-bold); color: var(--sleeve-swing); }
.pb-screen-up { color: var(--money-up); font-variant-numeric: tabular-nums; }
.pb-screen-meta-cell { font-size: var(--type-xs); }
.pb-screen-row.is-held .pb-screen-tk { color: var(--ink-3); }
.pb-screen-row.is-held .pb-screen-up { color: var(--ink-3); }
/* Intraday (scalp) variant: ticker takes the scalp sleeve color, and the metric
   column is neutral — it carries ATR% (daily range), not a P&L gain, so it must
   not read as a green "+%". Held rows still grey out (higher specificity wins). */
.pb-screen-row--scalp .pb-screen-tk { color: var(--sleeve-scalp); }
.pb-screen-row--scalp .pb-screen-up { color: var(--ink-2); }
.pb-screen-held-chip {
  justify-self: end;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--sleeve-swing-soft);
  color: var(--sleeve-swing);
  font-weight: var(--weight-bold);
}

/* Entry-verdict overlay (screen-verdict sidecar): green = the engine would buy
   this name, red = a playbook/entry rule blocks it. A left accent + soft tint;
   the reason chip + caret ride the existing `auto` tail column. Each row is an
   inline-accordion disclosure (data-screen-row) that expands the symbol detail
   below it. Absent verdict → neutral row (no tint). */
.pb-screen-row[data-screen-row] { cursor: pointer; border-radius: var(--radius-sm); }
.pb-screen-row[data-screen-row]:hover { background: var(--surface-2); }
.pb-screen-row[data-screen-row]:focus-visible {
  outline: 2px solid var(--sleeve-swing);
  outline-offset: -2px;
}
.pb-screen-row--pass {
  box-shadow: inset 3px 0 0 var(--money-up);
  padding-left: var(--space-2);
  background: color-mix(in srgb, var(--money-up) 7%, transparent);
}
.pb-screen-row--blocked {
  box-shadow: inset 3px 0 0 var(--money-down);
  padding-left: var(--space-2);
  background: color-mix(in srgb, var(--money-down) 7%, transparent);
}
/* Blocked rows read as "not happening" — dim the ticker a touch. Higher
   specificity than the scalp/held color rules so it wins on blocked rows. */
.pb-screen-row.pb-screen-row--blocked .pb-screen-tk { color: var(--ink-2); }
/* Tail cell: optional verdict chip + the disclosure caret, right-aligned in the
   existing `auto` grid column. */
.pb-screen-tail {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.pb-screen-caret {
  color: var(--ink-3);
  font-size: 10px;
  transition: transform 0.15s ease;
}
.pb-screen-row[aria-expanded="true"] .pb-screen-caret { transform: rotate(90deg); }
.pb-screen-reason-chip,
.pb-screen-pass-chip {
  font-size: 10px;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}
.pb-screen-reason-chip {
  background: color-mix(in srgb, var(--money-down) 14%, transparent);
  color: var(--money-down);
}
.pb-screen-pass-chip {
  background: color-mix(in srgb, var(--money-up) 14%, transparent);
  color: var(--money-up);
}
.pb-screen-pass-n  { color: var(--money-up); }
.pb-screen-block-n { color: var(--money-down); }
.pb-screen-verdict-age { font-size: var(--type-xs); }

/* Inline-accordion detail panel — the shared symbol detail (.symbol-drawer /
   .sd-* body from components/symbol-drawer.js) rendered under the expanded row. */
.pb-screen-detail {
  padding: var(--space-3);
  margin: 0 0 var(--space-2);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}
.pb-screen-detail[hidden] { display: none; }

.pb-screen-empty { padding: var(--space-2) 0; font-size: var(--type-sm); }

.pb-screen-rejected { margin-top: var(--space-3); }
.pb-screen-rej-head {
  font-size: var(--type-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}
.pb-screen-rej-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-1) var(--space-4);
}
.pb-screen-rej-row { display: flex; align-items: baseline; gap: var(--space-2); }
.pb-screen-rej-n {
  min-width: 1.4rem;
  text-align: right;
  font-weight: var(--weight-bold);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pb-screen-rej-label { font-size: var(--type-sm); }
