:root {
  --bg: #0a0d0f;
  --surface: #111518;
  --surface2: #181d21;
  --border: #1f2730;
  --text: #e8eaed;
  --muted: #6b7785;
  --pos: #22c55e;
  --pos-bg: rgba(34,197,94,0.08);
  --neg: #ef4444;
  --neg-bg: rgba(239,68,68,0.08);
  --neu: #f59e0b;
  --neu-bg: rgba(245,158,11,0.08);
  --mixed: #a78bfa;
  --mixed-bg: rgba(167,139,250,0.08);
  --accent: #38bdf8;
  --fed-bg: rgba(56,189,248,0.06);
  --fed-border: rgba(56,189,248,0.2);
  --condition-w: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  padding: 40px 24px 60px;
}

header {
  max-width: 1900px;
  margin: 0 auto 36px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 28px;
}

.eyebrow { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.18em; color: var(--accent); text-transform: uppercase; margin-bottom: 12px; }
h1 { font-family: 'DM Serif Display', serif; font-size: clamp(26px, 3.5vw, 48px); font-weight: 400; line-height: 1.1; color: var(--text); margin-bottom: 10px; }
h1 em { font-style: italic; color: var(--accent); }
.subtitle { font-size: 13px; color: var(--muted); max-width: 680px; line-height: 1.6; }

.legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 11px; font-family: 'DM Mono', monospace; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-pos { background: var(--pos); }
.dot-neg { background: var(--neg); }
.dot-neu { background: var(--neu); }
.dot-mixed { background: var(--mixed); }

.controls {
  max-width: 1900px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.filter-btn:hover, .filter-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

.scroll-hint {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  opacity: 0.7;
}
.scroll-hint span { animation: nudge 1.8s ease-in-out infinite; display: inline-block; }
@keyframes nudge { 0%,100%{transform:translateX(0)} 50%{transform:translateX(5px)} }

.scroll-track-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  padding: 6px 24px 8px;
  background: linear-gradient(transparent, rgba(10,13,15,0.95) 40%);
  pointer-events: none;
}
.scroll-track-inner {
  max-width: 1900px;
  margin: 0 auto;
  pointer-events: all;
}
.scroll-track {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  border-radius: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
}
.scroll-track::-webkit-scrollbar { height: 14px; }
.scroll-track::-webkit-scrollbar-track { background: var(--surface2); border-radius: 7px; }
.scroll-track::-webkit-scrollbar-thumb { background: #2d3a45; border-radius: 7px; border: 3px solid var(--surface2); }
.scroll-track::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.scroll-phantom { height: 1px; }

.table-wrap {
  max-width: 1900px;
  margin: 0 auto;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  scrollbar-width: none;
}
.table-wrap::-webkit-scrollbar { display: none; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 2100px;
  table-layout: fixed;
}
table.cols-filtered {
  min-width: unset;
  width: 100%;
  table-layout: auto;
}

thead { position: sticky; top: 0; z-index: 20; }

th {
  background: var(--surface2);
  padding: 0;
  text-align: left;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: top;
  transition: background 0.15s;
}
th:last-child { border-right: none; }

th .th-inner {
  padding: 12px 15px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
th .th-icon {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 2px;
}
th .th-name {
  font-family: 'DM Serif Display', serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
}
th .th-sub {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}

th.col-hover { background: rgba(56,189,248,0.06); }
td.col-hover { background: rgba(56,189,248,0.025) !important; }
td.condition-cell.col-hover,
td.condition-cell { background: var(--surface) !important; }

th.th-condition {
  width: var(--condition-w);
  min-width: var(--condition-w);
  max-width: var(--condition-w);
  position: sticky;
  left: 0;
  z-index: 21;
  background: var(--surface2) !important;
  box-shadow: 4px 0 16px rgba(0,0,0,0.8);
  padding: 12px 15px 11px;
  isolation: isolate;
}
th.th-condition .th-name { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 400; }
th.th-biz .th-name { color: #86efac; }

td {
  padding: 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
td:last-child { border-right: none; }
tr:last-child td { border-bottom: none; }
tr.hidden-row { display: none; }

.condition-cell {
  padding: 18px 15px;
  position: sticky;
  left: 0;
  z-index: 15;
  width: var(--condition-w);
  min-width: var(--condition-w);
  max-width: var(--condition-w);
  background: var(--surface);
  background-clip: padding-box;
  box-shadow: 4px 0 16px rgba(0,0,0,0.8);
  overflow: hidden;
  isolation: isolate;
}

.condition-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  border-radius: 0;
}
tr[data-outlook="positive"] .condition-cell::before { background: var(--pos); }
tr[data-outlook="mixed"] .condition-cell::before { background: var(--mixed); }
tr[data-outlook="negative"] .condition-cell::before { background: var(--neg); }

.condition-name { font-family: 'DM Serif Display', serif; font-size: 15px; color: var(--text); margin-bottom: 3px; }
.condition-desc { font-size: 11px; color: var(--muted); line-height: 1.5; margin-bottom: 9px; }

.fed-box {
  background: var(--fed-bg);
  border: 1px solid var(--fed-border);
  border-radius: 6px;
  padding: 7px 9px;
}
.fed-label { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.fed-rate { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.fed-objective { font-size: 11px; color: var(--muted); line-height: 1.5; }

.asset-cell { padding: 14px 15px; min-width: 185px; }
.biz-cell { padding: 14px 15px; min-width: 200px; background: rgba(134,239,172,0.015); }
table.cols-filtered .asset-cell,
table.cols-filtered .biz-cell { min-width: unset; width: auto; }
table.cols-filtered th:not(.th-condition) { width: auto; white-space: normal; }

.perf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  margin-bottom: 7px;
}
.perf-positive { background: var(--pos-bg); color: var(--pos); }
.perf-negative { background: var(--neg-bg); color: var(--neg); }
.perf-neutral  { background: var(--neu-bg); color: var(--neu); }
.perf-mixed    { background: var(--mixed-bg); color: var(--mixed); }

.perf-reason { font-size: 11px; color: var(--muted); line-height: 1.55; }

.intensity { display: flex; gap: 3px; margin-bottom: 5px; }
.intensity-bar { height: 3px; width: 16px; border-radius: 2px; background: var(--border); }
.intensity-bar.filled-pos { background: var(--pos); }
.intensity-bar.filled-neg { background: var(--neg); }
.intensity-bar.filled-neu { background: var(--neu); }
.intensity-bar.filled-mix { background: var(--mixed); }

tr:hover .asset-cell { background: rgba(56,189,248,0.02); }
tr:hover .biz-cell { background: rgba(134,239,172,0.04); }
tr:hover .condition-cell { background: #13191e; }

.section-divider td {
  background: var(--surface2);
  padding: 6px 15px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.section-divider .div-label { display: flex; align-items: center; gap: 8px; position: sticky; left: 0; }
.div-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

#col-tooltip {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  z-index: 9999;
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: 100px;
  padding: 7px 18px 7px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s;
  opacity: 0;
  white-space: nowrap;
}
#col-tooltip.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
#col-tooltip .tip-icon { font-size: 16px; line-height: 1; }
#col-tooltip .tip-name { font-weight: 500; }
#col-tooltip .tip-sub { font-size: 11px; color: var(--muted); margin-left: 2px; }

.controls-row {
  max-width: 1900px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.controls-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}
.controls-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.controls-spacer { flex: 1; }

.ms-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 100px;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  user-select: none;
}
.ms-trigger:hover { border-color: var(--accent); color: var(--text); }
.ms-trigger.has-selection { border-color: var(--accent); color: var(--accent); background: rgba(56,189,248,0.07); }
.ms-trigger .ms-icon { font-size: 13px; line-height: 1; }
.ms-trigger .ms-caret { font-size: 8px; margin-left: 2px; transition: transform 0.18s; }
.ms-trigger.open .ms-caret { transform: rotate(180deg); }
.ms-badge {
  background: var(--accent);
  color: #000;
  border-radius: 100px;
  font-size: 9px;
  font-weight: 500;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

.ms-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 0;
  min-width: 210px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  animation: panelIn 0.15s ease;
}
.ms-panel.open { display: block; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ms-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.ms-panel-title {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ms-clear {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  opacity: 0.7;
}
.ms-clear:hover { opacity: 1; }

.ms-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}
.ms-item:hover { background: rgba(56,189,248,0.06); }
.ms-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.ms-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.ms-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 4px;
  width: 4px; height: 7px;
  border: 2px solid #000;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.ms-item .ms-item-icon { font-size: 14px; line-height: 1; }
.ms-item-label { flex: 1; }
.ms-item-sub { font-size: 10px; color: var(--muted); font-family: 'DM Mono', monospace; }

th.col-selected { background: rgba(56,189,248,0.1) !important; }
th.col-selected .th-name { color: var(--accent) !important; }

.disclaimer {
  max-width: 1900px;
  margin: 32px auto 0;
  font-size: 10px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.ad-section {
  max-width: 1900px;
  margin: 40px auto 0;
  padding-bottom: 60px;
}
.ad-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.5;
  text-align: center;
  margin-bottom: 8px;
}
.ad-slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  width: 100%;
}
.ad-slot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 90px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0.35;
}
.ad-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 700px) {
  .ad-row { grid-template-columns: 1fr; }
}
.ad-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0 28px;
  opacity: 0.5;
}