/* ═══════════════════════════════════════════════════════════════
   STYLES.CSS · Plumbline Stage IV: Prop Firm Verification
   ---------------------------------------------------------------
   v5.0 — Brand migration
     · Consumes /assets/brand-tokens.css
     · Dark + light theme via [data-theme] bridge vars
     · Killed steel blue #8fb8d8 / #b0d0ea / #aad0ec / #6da0c4
     · Killed ⚡ emoji in .instant-funded-badge (no-emoji rule §5)
     · Header rebuilt: shield SVG + wordmark + theme toggle + verdict card
     · Verdict badge: circle → rectangle (Stage II pattern)
     · Tab active state → orange underline
     · RUN SIMULATION → solid orange (was steel blue gradient)
     · Semantic color audit per §2.2 — orange reserved for chrome only
     · Footer: two-row with left-aligned motto
     · Legacy variable names (--bg-card, --bg-input, etc.) preserved and
       aliased through bridge vars so all existing rules keep working.
   ═══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   THEME BRIDGE VARS — consume these everywhere.
   NEVER reference var(--ws-*) or var(--mkt-*) outside these blocks.
   ══════════════════════════════════════════════════════════════ */
[data-theme="dark"]{
  /* Bridge — legacy Stage IV names, aliased to brand tokens */
  --bg:         var(--ws-bg);
  --bg-card:    var(--ws-surface);
  --bg-section: var(--ws-surface);
  --bg-input:   var(--ws-bg);
  --border:     var(--ws-border);
  --border-hl:  var(--ws-border-hi);
  --text:       var(--ws-text-hi);
  --text-dim:   var(--ws-text-dim);
  --text-muted: var(--ws-text-mute);

  /* Interactive / brand */
  --accent:     var(--pl-orange);
  --accent-deep:var(--pl-orange-deep);
  --accent2:    var(--pl-brass);          /* structural warm — was tan */
  --brass:      var(--pl-brass);
  --brass-light:var(--pl-brass-light);
  --brass-deep: var(--pl-brass-deep);
  --brass-glow: rgba(184,150,90,.14);
  --accent-glow:rgba(255,106,26,.12);

  /* Semantic */
  --pass:       var(--pl-pass);
  --warn:       var(--pl-warn);
  --fail:       var(--pl-fail);
  --info:       var(--pl-info);

  /* Type */
  --mono:       var(--font-mono);
  --sans:       'Barlow', var(--font-sans);
  --display:    var(--font-display);
  --serif:      var(--font-serif);

  /* Legacy */
  --radius:     6px;
  --radius-lg:  10px;
  --shadow:     0 2px 12px rgba(0,0,0,.35);
  --transition: .2s ease;
  --hair:       rgba(255,255,255,.07);
}

[data-theme="light"]{
  --bg:         var(--mkt-bg);
  --bg-card:    var(--mkt-surface);
  --bg-section: var(--mkt-surface);
  --bg-input:   var(--mkt-surface-2);
  --border:     var(--mkt-line);
  --border-hl:  #c9c0ac;
  --text:       var(--mkt-text);
  --text-dim:   var(--mkt-text-dim);
  --text-muted: #8a99a8;

  --accent:     var(--pl-orange-deep);
  --accent-deep:var(--pl-orange);
  --accent2:    var(--pl-brass-deep);
  --brass:      var(--pl-brass-deep);
  --brass-light:var(--pl-brass);
  --brass-deep: #6d5f39;
  --brass-glow: rgba(140,122,75,.08);
  --accent-glow:rgba(209,78,16,.10);

  --pass:       #059669;
  --warn:       #a06d1a;
  --fail:       #b23e3e;
  --info:       #5678a0;

  --mono:       var(--font-mono);
  --sans:       'Barlow', var(--font-sans);
  --display:    var(--font-display);
  --serif:      var(--font-serif);

  --radius:     6px;
  --radius-lg:  10px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --transition: .2s ease;
  --hair:       rgba(0,0,0,.06);
}

/* Shield glyph theme swap */
[data-theme="dark"]  .pl-p-glyph{ fill:#edf2f7; }
[data-theme="light"] .pl-p-glyph{ fill:#14181D; }

/* ── RESET & BASE ────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-size: 14px;
  width: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  background: var(--bg);
}
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
*:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 8px; height: 8px; }
::-webkit-scrollbar-track  { background: var(--bg); }
::-webkit-scrollbar-thumb  { background: var(--border-hl); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brass); }

/* ── CONTAINER ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1340px;
  margin-left: auto;
  margin-right: auto;
  padding: 24px 28px 16px;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER — Stage II pattern (shield + wordmark + toggle + verdict)
   ═══════════════════════════════════════════════════════════════ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 24px;
  flex-wrap: wrap;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}
.pl-shield {
  flex: 0 0 52px;
  filter: drop-shadow(0 0 12px var(--brass-glow));
}
.pl-wordmark {
  display: flex;
  flex-direction: column;
}
.header-left h1 {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--text);
  line-height: .9;
  text-transform: uppercase;
  margin: 0;
}
.header-left h1 .pl-wm-1 { color: var(--text); display: block; }
.header-left h1 .pl-wm-2 { color: var(--brass); display: block; margin-top: 2px; }
.header-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2.5px;
  margin-top: 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Theme toggle */
.pl-theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 38px; height: 38px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px; line-height: 1;
  transition: border-color .2s, color .2s, background .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pl-theme-toggle:hover {
  border-color: var(--brass);
  color: var(--brass-light);
  background: var(--brass-glow);
}

/* ── VERDICT BADGE (rectangular Stage II pattern) ─────────────── */
.verdict-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 2px solid var(--brass);
  border-radius: 8px;
  background: var(--bg-section);
  min-width: 130px;
  flex-shrink: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.verdict-badge.pass {
  border-color: var(--pass);
  background: rgba(138,191,155,.06);
  box-shadow: 0 0 18px rgba(138,191,155,.14);
}
.verdict-badge.fail {
  border-color: var(--fail);
  background: rgba(201,120,120,.06);
  box-shadow: 0 0 18px rgba(201,120,120,.14);
}
.verdict-badge.warn {
  border-color: var(--warn);
  background: rgba(214,161,95,.06);
  box-shadow: 0 0 18px rgba(214,161,95,.14);
}
.verdict-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.verdict-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: var(--text);
  text-align: center;
  line-height: 1;
}
.verdict-badge.pass .verdict-value { color: var(--pass); }
.verdict-badge.fail .verdict-value { color: var(--fail); }
.verdict-badge.warn .verdict-value { color: var(--warn); }

/* ═══════════════════════════════════════════════════════════════
   TAB BAR — active state = orange underline (Stage IV target §1)
   ═══════════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  padding: 10px 22px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  bottom: -1px;
  text-transform: uppercase;
}
.tab-btn:hover {
  color: var(--text);
  background: var(--accent-glow);
}
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: transparent;
}

/* ── TAB PAGES ───────────────────────────────────────────────── */
.tab-page {
  display: none;
  width: 100%;
  overflow: hidden;
  max-width: 100%;
}
.tab-page.active {
  display: block;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Empty state (results/charts placeholder) */
.empty-title{
  font-family: var(--display);
  font-size: 40px; font-weight: 900;
  letter-spacing: 4px; color: var(--text-muted);
  text-transform: uppercase; margin-bottom: 12px;
}
.empty-sub{
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 2px; color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS (cards)
   ═══════════════════════════════════════════════════════════════ */
.section {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative;
}
.section::before{
  content:'';
  position:absolute; top:0; left:0; right:0; height:2px;
  background:linear-gradient(90deg, var(--brass), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.section-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--brass);
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 600;
  opacity: 1;
}
.section-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   SETUP GRID (two-column layout)
   ═══════════════════════════════════════════════════════════════ */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.setup-grid > * {
  min-width: 0;
  overflow: hidden;
}

/* ── PARAM GROUPS ────────────────────────────────────────────── */
.param-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  transition: opacity var(--transition);
}
.param-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════ */
.param-input,
.param-select {
  width: 100%;
  max-width: 220px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.param-input:focus,
.param-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.param-input:disabled,
.param-select:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.param-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
/* Theme-aware chevron fill */
[data-theme="dark"] .param-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a8b8c8'/%3E%3C/svg%3E");
}
[data-theme="light"] .param-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234A5058'/%3E%3C/svg%3E");
}
.param-select option {
  background: var(--bg-card);
  color: var(--text);
}
input[type="file"] { display: none; }

/* ═══════════════════════════════════════════════════════════════
   FILE DROP ZONE
   ═══════════════════════════════════════════════════════════════ */
.file-zone {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 2px dashed var(--border-hl);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
}
.file-zone:hover,
.file-zone.drag-over {
  border-color: var(--brass);
  background: var(--brass-glow);
}
.file-icon {
  color: var(--brass);
  flex-shrink: 0;
  display: inline-flex;
}
.file-text  { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.file-text strong { font-size: 13px; color: var(--text); margin-bottom: 2px; font-family: var(--display); letter-spacing: 1px; }
.file-text span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: .5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browse-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 7px 16px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  flex-shrink: 0;
}
.browse-btn:hover {
  background: var(--brass-glow);
  border-color: var(--brass-light);
  color: var(--text);
}

/* ── COLUMN MAPPING ROW ──────────────────────────────────────── */
.mapping-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .5px;
}
.apply-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 7px 16px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  font-weight: 700;
}
.apply-btn:hover {
  background: var(--accent-deep);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════
   DATA TABLE (CSV preview)
   ═══════════════════════════════════════════════════════════════ */
.data-table-wrap {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-card);
  color: var(--brass);       /* structural, not orange */
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border-hl);
  text-align: left;
}
.data-table td {
  padding: 6px 12px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:hover td {
  background: var(--brass-glow);
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════════
   STATS BOX (P&L summary)
   ═══════════════════════════════════════════════════════════════ */
.stats-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  white-space: pre;
  line-height: 1.9;
}
.stats-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS TAB
   ═══════════════════════════════════════════════════════════════ */
.verdict-banner {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 2px;
  text-align: center;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  font-weight: 700;
}
.verdict-banner.pass {
  background: rgba(138,191,155,.10);
  border: 1px solid var(--pass);
  color: var(--pass);
}
.verdict-banner.fail {
  background: rgba(201,120,120,.10);
  border: 1px solid var(--fail);
  color: var(--fail);
}
.verdict-banner.warn {
  background: rgba(214,161,95,.10);
  border: 1px solid var(--warn);
  color: var(--warn);
}

/* ── TEST STRIP ──────────────────────────────────────────────── */
.test-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.test-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-hl);
  border-radius: var(--radius);
  padding: 10px 16px 10px 12px;
  flex: 1 1 auto;
  min-width: 140px;
  transition: border-color var(--transition);
}
.test-chip.pass { border-top-color: var(--pass); }
.test-chip.fail { border-top-color: var(--fail); }
.test-chip.warn { border-top-color: var(--warn); }
.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}
.test-chip.pass .chip-dot { background: var(--pass); box-shadow: 0 0 6px var(--pass); }
.test-chip.fail .chip-dot { background: var(--fail); box-shadow: 0 0 6px var(--fail); }
.test-chip.warn .chip-dot { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.chip-name {
  font-family: var(--display);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 1px;
  flex: 1;
  text-transform: uppercase;
  font-weight: 600;
}
.chip-status {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}
.test-chip.pass .chip-status { color: var(--pass); }
.test-chip.fail .chip-status { color: var(--fail); }
.test-chip.warn .chip-status { color: var(--warn); }

/* METRICS GRID rules removed — Section 03 "Key Statistics" retired.
   .metrics/.metric* were orphaned when Section 03 was deleted; Evaluation
   Pass Rate now renders as an .app-item tile in Section 02. Value colors
   (.accentN/.pass/.fail/.warn) live on .app-value (ACCOUNTS PER PAYOUT). */
/* ── FIRM INFO ───────────────────────────────────────────────── */
.interp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-input);
  border-left: 3px solid var(--brass);
  border-radius: var(--radius);
  letter-spacing: .5px;
  line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════════
   CHARTS TAB
   ═══════════════════════════════════════════════════════════════ */

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Net-outcome hero spans both columns; funnel + scaling share the row below */
.chart-card-wide { grid-column: 1 / -1; }
.chart-card-wide canvas { max-height: 300px; }

.chart-card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  min-height: 320px;
  position: relative;
}
.chart-card h3 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1.5px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
.chart-card canvas {
  width: 100% !important;
  max-height: 260px;
}

/* ═══════════════════════════════════════════════════════════════
   BOTTOM BAR — RUN SIMULATION solid orange (Stage IV target §1)
   ═══════════════════════════════════════════════════════════════ */
.bottom-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.run-btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  padding: 14px 34px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  flex-shrink: 0;
}
.run-btn:hover {
  background: var(--accent-deep);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}
.run-btn:active  { transform: translateY(0); }
.run-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brass), var(--accent));
  border-radius: 3px;
  transition: width .15s ease;
}
.status-text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 110px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER — two-row with left-aligned motto
   ═══════════════════════════════════════════════════════════════ */
footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
/* ═══════════════════════════════════════════════════════════════
   TRADE LOG
   ═══════════════════════════════════════════════════════════════ */
.trade-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.trade-log-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--brass);
  text-transform: uppercase;
}
.trade-log-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.trade-log-filter {
  width: 180px !important;
  max-width: 180px !important;
  font-size: 11px !important;
}
.trade-count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--pass);
  white-space: nowrap;
}
.trade-log-wrap {
  max-height: none;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.trade-log-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.page-btn-text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 6px 14px;
  color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn-text:hover:not(:disabled) {
  border-color: var(--brass);
  color: var(--text);
  background: var(--brass-glow);
}
.page-btn-text:disabled {
  opacity: .3;
  cursor: default;
}
.trade-log-page-info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .5px;
}
.row-num   { color: var(--text-muted); font-size: 10px; }
.dir-long  { color: #5ec4b6; font-weight: 600; }
.dir-short { color: var(--fail); font-weight: 600; }
.pnl-pos   { color: var(--pass); font-weight: 600; }
.pnl-neg   { color: var(--fail); font-weight: 600; }
.pnl-zero  { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   STRATEGY PORTFOLIO
   ═══════════════════════════════════════════════════════════════ */
.strat-portfolio {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
}
.strat-portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.strat-portfolio-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--brass);
  text-transform: uppercase;
}
.strat-clear-btn {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 5px 12px;
  color: var(--fail);
  background: transparent;
  border: 1px solid var(--fail);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}
.strat-clear-btn:hover {
  background: var(--fail);
  color: #fff;
}
.strat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: border-color var(--transition);
}
.strat-card:last-child { margin-bottom: 0; }
.strat-card:hover { border-color: var(--brass); }
.strat-card-icon { font-size: 18px; flex-shrink: 0; color: var(--brass); }
.strat-card-info { flex: 1; min-width: 0; }
.strat-card-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strat-card-meta {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.strat-card-mean {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.strat-card-mean.pos { color: var(--pass); }
.strat-card-mean.neg { color: var(--fail); }
.strat-remove-btn {
  font-size: 14px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: all var(--transition);
  flex-shrink: 0;
}
.strat-remove-btn:hover {
  color: var(--fail);
  background: rgba(201,120,120,.1);
}
.strat-combined {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  line-height: 1.8;
}
.strat-combined strong {
  color: var(--text);
  font-weight: 600;
}
/* Combined EV: neutral data value per §2.2 (was orange) */
.strat-combined .combined-ev {
  color: var(--text);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   ACCOUNTS PER PAYOUT
   ═══════════════════════════════════════════════════════════════ */
.accounts-per-payout {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.app-item {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
}
.app-item:hover {
  border-color: var(--border-hl);
  transform: translateY(-2px);
}
.app-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.app-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
/* Semantic §2.2: accent2 = structural warm, pass/fail/warn = semantic */
.app-value.accent2 { color: var(--brass-light); }
.app-value.pass    { color: var(--pass); }
.app-value.fail    { color: var(--fail); }
.app-value.warn    { color: var(--warn); }

/* ═══════════════════════════════════════════════════════════════
   CASCADE UI (Phase 2)
   ═══════════════════════════════════════════════════════════════ */
.cascade-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cascade-group .param-group {
  margin-bottom: 0;
}
.firm-resolved {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.firm-resolved-name {
  color: var(--brass);          /* was orange — structural label */
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
}
.firm-resolved-line {
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.5px;
}
.firm-src-link {
  color: var(--accent);         /* interactive link — orange OK */
  text-decoration: none;
  margin-left: 6px;
}
.firm-src-link:hover {
  text-decoration: underline;
}

/* ── PARAM SUB-SECTIONS ──────────────────────────────────────── */
.param-subsection {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.param-subsection:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.param-subheader {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--brass);          /* was tan #d6a15f accent2 — brass structural */
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
  font-weight: 700;
}

/* ── INSTANT-FUNDED BADGE (⚡ emoji killed per §5) ────────────── */
.instant-funded-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--brass-glow);
  border: 1px solid var(--brass);
  border-left: 4px solid var(--brass);
  border-radius: 8px;
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--brass-light);
  font-weight: 700;
  text-transform: uppercase;
}
/* No emoji ::before — the badge design (border, glow, uppercase display font) is distinct enough */

/* ── FIRM NOTES ──────────────────────────────────────────────── */
.firm-notes {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-left: 3px solid var(--brass);   /* was orange — structural */
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.7;
  font-style: italic;
}
.firm-notes-label {
  color: var(--brass);
  font-weight: 700;
  font-style: normal;
  margin-right: 4px;
}

/* ── CAP SCHEDULE DISPLAY ────────────────────────────────────── */
.cap-schedule-display {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-wrap: wrap;
}
.cap-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 55px;
}
.cap-tier-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.cap-tier-val {
  font-family: var(--display);
  font-size: 13px;
  color: var(--text);           /* neutral data per §2.2 */
  font-weight: 700;
}

.hidden-field { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   PARAM LABEL TOOLTIPS
   ═══════════════════════════════════════════════════════════════ */
.param-label[data-tooltip] {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--text-muted);
}
.param-label[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--brass);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--brass-light);
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(4px);
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.param-label[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}
.param-label[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 12px;
  margin-bottom: 1px;
  border: 5px solid transparent;
  border-top-color: var(--brass);
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 101;
}
.param-label[data-tooltip]:hover::before {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════════ */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  max-width: 380px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-hl);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  pointer-events: auto;
  animation: toastSlideIn .25s ease;
}
.toast-info    { border-left-color: var(--brass); }
.toast-success { border-left-color: var(--pass); }
.toast-warn    { border-left-color: var(--warn); }
.toast-error   { border-left-color: var(--fail); }
.toast-msg {
  flex: 1;
  line-height: 1.5;
  word-wrap: break-word;
  letter-spacing: 0.3px;
}
.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  transition: color var(--transition);
}
.toast-close:hover { color: var(--text); }
.toast-dismissing { animation: toastSlideOut .25s ease forwards; }
@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   SWEEP · Test-All-Firms toggle + leaderboard
   ═══════════════════════════════════════════════════════════════ */
.sweep-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}
body.sweep-all-enabled .sweep-toggle-row {
  border-color: var(--brass);
  background: var(--brass-glow);
}
.sweep-toggle-copy { flex: 1; min-width: 0; }
.sweep-toggle-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sweep-toggle-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-top: 2px;
}

/* iOS-style switch */
.sweep-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.sweep-switch input { display: none; }
.sweep-slider {
  position: absolute; inset: 0;
  cursor: pointer;
  background: var(--border-hl);
  border-radius: 26px;
  transition: background .25s ease;
}
.sweep-slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; top: 3px;
  background: #d8dee6;
  border-radius: 50%;
  transition: transform .25s ease, background .25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.sweep-switch input:checked + .sweep-slider {
  background: linear-gradient(135deg, var(--brass-light), var(--brass-deep));
}
.sweep-switch input:checked + .sweep-slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* Dim cascade when toggle ON */
body.sweep-all-enabled #cascadeGroup,
body.sweep-all-enabled #firmResolved {
  opacity: .35;
  pointer-events: none;
  filter: saturate(.5);
  transition: opacity var(--transition);
}

/* Sweep-mode: hide result body during iteration */
body.sweep-mode .tab-page,
body.sweep-mode .tab-bar { pointer-events: none; }
body.sweep-mode #tab-results,
body.sweep-mode #tab-charts { display: none !important; }

/* ── SWEEP LEADERBOARD ───────────────────────────────────────── */
.sweep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.sweep-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding: 14px 16px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.sweep-filter-group { display: flex; flex-direction: column; gap: 6px; }
.sweep-filter-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.sweep-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.sweep-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  padding: 5px 12px;
  color: var(--text-dim);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
}
.sweep-chip:hover  { color: var(--text); border-color: var(--brass); }
.sweep-chip.active {
  color: #fff;
  background: var(--accent);       /* active state — orange OK */
  border-color: var(--accent);
  font-weight: 700;
}
.sweep-checkbox {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px;
  color: var(--text-dim); letter-spacing: .5px;
  cursor: pointer;
}
.sweep-checkbox input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Table */
.sweep-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-section);
}
.sweep-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.sweep-table th {
  background: var(--bg-card);
  color: var(--brass);           /* was orange — structural header */
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 10px;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-hl);
  white-space: nowrap;
}
.sweep-table td {
  padding: 12px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sweep-table tr:last-child td { border-bottom: none; }
.sweep-num  { text-align: right; }
.sweep-table th.sweep-num { text-align: right; }
.sweep-rank {
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
  width: 40px;
}
.sweep-firm { font-weight: 600; color: var(--text); }
.sweep-variant { color: var(--text-muted); font-size: 10px; margin-left: 4px; }
.sweep-drill {
  text-align: center;
  width: 30px;
  color: var(--text-muted);
  font-size: 18px;
  transition: color var(--transition);
}
.sweep-row { cursor: pointer; transition: background var(--transition); }
.sweep-row:hover {
  background: var(--brass-glow);
}
.sweep-row:hover .sweep-drill { color: var(--accent); }
.sweep-row:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* Sub-gate rows: firms below the eval-pass gate are dimmed and sink to the
   bottom (see SWEEP_PASS_GATE in sweep.js). Still fully readable on hover
   so the user can drill in. */
.sweep-row.sweep-gated { opacity: .45; }
.sweep-row.sweep-gated:hover { opacity: 1; }

/* Top 3 highlight — medal colors OK, not brand */
.sweep-table tbody tr:nth-child(1) .sweep-rank { color: #d4b84a; font-size: 15px; }
.sweep-table tbody tr:nth-child(2) .sweep-rank { color: #b8b8b8; font-size: 14px; }
.sweep-table tbody tr:nth-child(3) .sweep-rank { color: #cd7f32; font-size: 13px; }

/* Pass-rate & EV coloring */
.sweep-pass-pass strong { color: var(--pass); font-size: 14px; }
.sweep-pass-warn strong { color: var(--warn); font-size: 14px; }
.sweep-pass-fail strong { color: var(--fail); font-size: 14px; }
.sweep-ev-pass  { color: var(--pass); }
.sweep-ev-fail  { color: var(--fail); }
.sweep-cost     { color: var(--text-dim); }

/* Product line badges — recolored off steel blue */
.sweep-badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid;
}
.sweep-badge-lucidpro    { color: var(--pl-brass-light); border-color: var(--pl-brass-light); background: rgba(232,206,149,.10); }
.sweep-badge-lucidflex   { color: #b48fd8; border-color: #b48fd8; background: rgba(180,143,216,.08); }
.sweep-badge-luciddirect { color: var(--pl-warn);       border-color: var(--pl-warn);       background: rgba(214,161,95,.10); }
.sweep-badge-topstep     { color: var(--pass);          border-color: var(--pass);          background: rgba(138,191,155,.08); }
.sweep-badge-apex        { color: var(--fail);          border-color: var(--fail);          background: rgba(201,120,120,.08); }

.sweep-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-style: italic;
}
.sweep-footer {
  margin-top: 14px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: .5px;
  text-align: center;
  border-top: 1px dashed var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════ */
@media print {
  @page{ margin: 0.5in; size: auto; }
  *{
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  .file-zone, .sweep-toggle-row, .bottom-bar,
  .pl-theme-toggle, .tab-bar, .toast, #toast-container { display: none !important; }
  .section, .chart-card { break-inside: avoid; page-break-inside: avoid; }
  .container { max-width: 100%; padding: 20px 0; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .setup-grid         { grid-template-columns: 1fr; }
  .chart-grid         { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .container           { padding: 16px 14px 12px; }
  header               { flex-direction: column; text-align: center; gap: 16px; align-items: flex-start; }
  .header-left         { flex-direction: row; align-items: center; }
  .header-left h1      { font-size: 28px; letter-spacing: 2px; }
  .header-right        { align-self: stretch; justify-content: space-between; }
  .tab-bar             { overflow-x: auto; }
  .tab-btn             { padding: 8px 14px; font-size: 10px; letter-spacing: 1.5px; }
  .test-strip          { flex-direction: column; }
  .test-chip           { min-width: unset; }
  .bottom-bar          { flex-wrap: wrap; }
  .run-btn             { width: 100%; text-align: center; }
  .progress-track      { order: 3; width: 100%; }
  .mapping-row         { flex-direction: column; align-items: stretch; }
  .mapping-row .param-select { width: 100% !important; max-width: none; }
  .file-zone           { flex-direction: column; text-align: center; }
  .accounts-per-payout { flex-direction: column; }
  footer               { gap: 12px; }
  /* Phase 2 responsive tweaks */
  .cap-schedule-display { flex-direction: column; }
  .cap-tier             { flex-direction: row; justify-content: space-between; min-width: 0; }
  .param-subsection     { padding-bottom: 10px; margin-bottom: 12px; }
  .instant-funded-badge { font-size: 11px; padding: 12px 14px; letter-spacing: 1.5px; }
  /* Sweep responsive */
  .sweep-table th, .sweep-table td { padding: 8px 8px; font-size: 11px; }
  .sweep-table th:nth-child(3), .sweep-table td:nth-child(3),
  .sweep-table th:nth-child(4), .sweep-table td:nth-child(4) { display: none; }
  .sweep-filters { gap: 14px; padding: 12px; }
}
@media (max-width: 480px) {
  .param-group   { flex-direction: column; align-items: stretch; }
  .param-input,
  .param-select  { max-width: none; }
  .verdict-badge { min-width: 100px; padding: 10px 18px; }
  .verdict-value { font-size: 22px; }
}

/* ═══════════════════════════════════════════════════════════════
   FRAGILITY ANALYSIS · Best-Day Fragility Test (v5.1 patch)
   ---------------------------------------------------------------
   Semantic color audit per BRAND_MIGRATION §2.2:
     · Table headers → brass (structural chrome, not orange)
     · Baseline row EV → neutral text (context, no threshold crossed)
     · Δ column → keeps semantic red for negative
     · STATUS column → keeps semantic green for SURVIVES
     · ✓ ROBUST banner → keeps semantic green

   Selector strategy: covers .fragility-*, .frag-*, .best-day-*
   AND a generic fallback for any table inside a .section that
   isn't already claimed by .data-table / .sweep-table / .trade-log.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tier 1 · Explicit fragility class names ─────────────────── */
.fragility-table th,
.fragility-analysis th,
.frag-table th,
.best-day-table th,
.fragility-section table th,
.fragility-test th {
  color: var(--brass);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 10px;
}

/* Baseline row EV cell — neutral historical value, no threshold */
.fragility-table .baseline-row td,
.fragility-table .frag-baseline td,
.fragility-table tr.baseline .ev-value,
.frag-table .baseline-row td,
.frag-table tr.baseline .ev,
.best-day-table .baseline-row td,
.fragility-baseline-ev,
.frag-baseline-value,
.fragility-value.baseline,
.frag-ev.is-baseline,
tr.fragility-baseline .ev,
tr[data-frag-row="baseline"] td:nth-child(2) {
  color: var(--text);
}

/* ── Tier 2 · Generic fallback for any unclaimed table in a section ── */
.section table:not(.data-table):not(.sweep-table):not(.trade-log) th {
  color: var(--brass) !important;
}

/* Any body cell that inlines an orange color — force neutral */
.section table:not(.data-table):not(.sweep-table):not(.trade-log)
  td[style*="FF6A1A" i],
.section table:not(.data-table):not(.sweep-table):not(.trade-log)
  td[style*="ff6a1a" i],
.section table:not(.data-table):not(.sweep-table):not(.trade-log)
  td[style*="var(--accent)" i],
.section table:not(.data-table):not(.sweep-table):not(.trade-log)
  td[style*="var(--pl-orange)" i] {
  color: var(--text) !important;
}

/* Also catch the case where the JS wraps the value in a <span
   style="color:..."> instead of setting td style directly. */
.section table:not(.data-table):not(.sweep-table):not(.trade-log)
  td span[style*="FF6A1A" i],
.section table:not(.data-table):not(.sweep-table):not(.trade-log)
  td span[style*="ff6a1a" i],
.section table:not(.data-table):not(.sweep-table):not(.trade-log)
  td span[style*="var(--accent)" i] {
  color: var(--text) !important;
}

/* ── Tier 3 · ROBUST banner defensive rules ──────────────────── */
/* If JS assigns .accent instead of .pass to the ✓ ROBUST banner,
   force it green anyway. Same for warn.                         */
.fragility-verdict.accent,
.frag-verdict.accent,
.fragility-banner.accent,
.frag-banner.accent {
  color: var(--pass);
}
.fragility-verdict.warn,
.frag-verdict.warn,
.fragility-banner.warn,
.frag-banner.warn {
  color: var(--warn);
}
/* Phase 5 model limitation states */
.model-warning{margin-top:14px;padding:14px 18px;border-left:4px solid var(--warn);background:rgba(160,109,26,.10);color:var(--text);font-family:var(--sans);font-size:12.5px;font-weight:500;line-height:1.8;letter-spacing:.2px;border-radius:0 var(--radius) var(--radius) 0;}
.model-warning code,.model-warning .rule-key{font-family:var(--mono);font-size:11.5px;color:var(--warn);background:rgba(160,109,26,.12);padding:1px 5px;border-radius:3px;}
.model-warning-block{border-left-color:var(--fail);background:rgba(178,62,62,.11);}
.model-warning-approx{border-left-color:var(--warn);}
.model-warning[hidden]{display:none!important;}

/* Phase 7 statistical integrity */
.phase7-uncertainty-note{margin-top:10px;padding-top:10px;border-top:1px dashed var(--border);color:var(--warn);}
.sweep-statistical-tie td:first-child{box-shadow:inset 3px 0 0 var(--warn);}
.phase7-sweep-note{color:var(--warn);}
.sweep-uncertainty{margin-top:3px;font-size:9px;line-height:1.35;color:var(--text-muted);white-space:nowrap;}
.sweep-statistical-tie{background:rgba(214,161,95,.055);}
.sweep-statistical-tie .sweep-rank::after{content:' ≈';color:var(--warn);font-size:10px;}
/* Phase 8 schema-consumption warnings */
.schema-audit-warning{margin-top:12px;padding:12px 14px;border-left:4px solid var(--fail);background:rgba(178,62,62,.11);color:var(--text);font:600 12px/1.55 var(--mono);white-space:pre-line;}
.schema-audit-warning[hidden]{display:none!important;}
.schema-audit-warning strong{color:var(--fail);}

/* MAE/MFE enhanced drawdown data status */
.excursion-status{margin:0 0 14px;padding:11px 13px;border-left:4px solid var(--pass);background:rgba(138,191,155,.08);color:var(--text);font:600 11px/1.55 var(--mono);}
.excursion-status.limited{border-left-color:var(--warn);background:rgba(214,161,95,.08);}
.excursion-status[hidden]{display:none!important;}


/* ═══════════════════════════════════════════════════════════════
   PARAM HINT — inline assumption/help text under a field
   (fix: was undefined → collapsed into the flex row as a column)
   ═══════════════════════════════════════════════════════════════ */
.param-hint {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .3px;
  color: var(--text-muted);
  margin: -2px 0 12px;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   STANDARDIZED PLUMBLINE FOOTER — disclaimer + cols + motto + legal
   Theme-aware via bridge vars. Overrides legacy `footer` flex rule.
   ═══════════════════════════════════════════════════════════════ */
footer.pl-footer {
  display: block;
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--accent);
}
.pl-footer-disclaimer {
  border: 1px solid var(--border);
  border-left: 4px solid var(--fail);
  background: var(--bg-section);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 36px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
}
.pl-footer-disclaimer strong { color: var(--fail); font-weight: 700; }
.pl-footer-disclaimer a { color: var(--accent); text-decoration: underline; }
.pl-footer-disclaimer a:hover { color: var(--accent-deep); }

.pl-footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 44px;
  padding-bottom: 34px;
}
.pl-footer-col h4 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text);
  margin-bottom: 16px;
}
.pl-footer-links { display: flex; flex-direction: column; gap: 11px; }
.pl-footer-links a {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--transition);
  width: fit-content;
}
.pl-footer-links a:hover { color: var(--accent); }
.pl-footer-col p {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.pl-footer-col p:last-child { margin-bottom: 0; }
.pl-footer-col p a { color: var(--accent); text-decoration: none; }
.pl-footer-col p a:hover { text-decoration: underline; }

.pl-footer-motto {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--brass);
  text-align: center;
  padding: 26px 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.pl-footer-legal {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 20px;
  letter-spacing: .3px;
}
.pl-footer-legal strong { color: var(--text-dim); font-weight: 700; }
.pl-footer-time { margin-left: 10px; opacity: .8; }
.pl-footer-time:empty { margin-left: 0; }

@media (max-width: 768px) {
  .pl-footer-cols { grid-template-columns: 1fr; gap: 30px; }
  footer.pl-footer { margin-top: 32px; }
}


/* ===============================================================
   SITE TOP NAV - Stage IV local implementation
   =============================================================== */
.pl-topnav {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 10px 4px 12px;
  margin: -8px 0 20px;
  border-bottom: 1px solid var(--border);
}
.pl-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.pl-nav-shield {
  display: block;
  width: 30px;
  height: 38px;
  flex: 0 0 30px;
}
.pl-nav-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  line-height: 1;
}
.pl-nav-plumbline,
.pl-nav-trading {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.25px;
}
.pl-nav-plumbline { color: var(--text); }
.pl-nav-trading { color: var(--accent); }
.pl-nav-suite {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.2px;
  color: var(--brass);
  text-transform: uppercase;
}
.pl-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 2.2vw, 30px);
  margin-left: auto;
}
.pl-nav-links a {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--transition);
}
.pl-nav-links a:hover,
.pl-nav-links a:focus-visible { color: var(--accent); }

/* Make the standardized footer win over the legacy generic footer rules. */
body footer.pl-footer {
  display: block;
  width: 100%;
  margin-top: 44px;
  padding: 30px 0 4px;
  border-top: 1px solid var(--accent);
}
body footer.pl-footer .pl-footer-disclaimer { display: block; }
body footer.pl-footer .pl-footer-cols { display: grid; }
body footer.pl-footer .pl-footer-links { display: flex; }

@media (max-width: 900px) {
  .pl-topnav { align-items: flex-start; flex-direction: column; gap: 12px; }
  .pl-nav-links { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
}
@media (max-width: 520px) {
  .pl-nav-plumbline, .pl-nav-trading { font-size: 17px; }
  .pl-nav-suite { font-size: 9px; letter-spacing: 1.5px; }
  .pl-nav-links { gap: 15px; }
  .pl-nav-links a { font-size: 10px; }
}
