/* Hide TradingView attribution logo on charts */
[id^="chart-"] a {
  display: none !important;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  padding: 28px;
  background: #0f0f10;
  color: #e9e9ea;
}

.card {
  background: #17181b;
  padding: 18px 18px 14px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.muted {
  color: #a7a7ad;
  font-size: 13px;
}

.row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pill {
  background: #22242a;
  padding: 10px 12px;
  border-radius: 12px;
  min-width: 200px;
}

/* Trade page responsive helpers */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.metric-grid .pill { min-width: 0; }
.trade-card {
  flex: 1 1 360px;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  body.trade-page { padding: 14px; }
  .trade-card { flex-basis: 100%; }
}

.signal {
  font-size: 18px;
  margin-top: 12px;
}

code {
  color: #d5d5ff;
}

/* Header and Controls */
.header-section {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.controls-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.control-select {
  background: #17181b;
  color: #e9e9ea;
  border: 1px solid #333;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

/* Mobile: full width controls */
@media (max-width: 768px) {
  .header-section {
    flex-direction: column;
  }

  .controls-row {
    width: 100%;
    flex-direction: column;
  }

  .pill {
    width: 100%;
  }
}

/* Two-column grid — stacks to single column on mobile */
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
@media (max-width: 680px) {
  .two-col-grid { grid-template-columns: 1fr; }
}

/* Divergence pair columns */
.risk-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.pairs-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.pair-column {
  background: #17181b;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* Limit to max 3 columns per row */
@media (min-width: 1200px) {
  .pairs-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Correlation monitor — wider cards, single column on mobile */
.corr-grid {
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
}
@media (max-width: 540px) {
  .corr-grid {
    grid-template-columns: 1fr;
  }
}

.pair-column h2 {
  margin: 0 0 12px;
  font-size: 18px;
  text-align: center;
}

.pair-column .trends {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pair-column .trend-item {
  flex: 1;
  background: #22242a;
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 120px;
}

.pair-column .divergence-signal {
  background: #22242a;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  margin-bottom: 12px;
}

.pair-column .pair-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
}

.pair-column .chart-container {
  margin-top: 12px;
}

.pair-column .chart-title {
  font-size: 13px;
  color: #a7a7ad;
  margin-bottom: 6px;
}

/* Navigation Bar */
.site-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 0;
  margin-bottom: 18px;
  border-bottom: 1px solid #2a2b2f;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.nav-link {
  color: #888;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link.active,
.nav-link:hover {
  color: #e9e9ea;
  background: #2a2b2f;
}

/* Macro Model Page */
.macro-score {
  background: #17181b;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-bottom: 18px;
}

.macro-score-value {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 4px;
}

.macro-score-sub {
  color: #a7a7ad;
  font-size: 13px;
}

.categories-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.category {
  background: #17181b;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.category-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.asset-card {
  background: #22242a;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asset-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asset-symbol {
  font-weight: 700;
  font-size: 13px;
}

.asset-name {
  color: #a7a7ad;
  font-size: 11px;
  line-height: 1.3;
}

.asset-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.asset-price {
  font-size: 16px;
  font-weight: 600;
}

.asset-change {
  font-size: 12px;
}

.asset-change.positive { color: #10b981; }
.asset-change.negative { color: #ef4444; }

.asset-sparkline {
  width: 100%;
  height: 52px;
  display: block;
  margin-top: auto;
}

.asset-signal {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
  letter-spacing: 0.03em;
}

.asset-signal.above {
  background: rgba(16,185,129,0.15);
  color: #10b981;
}

.asset-signal.below {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

.asset-signal.neutral {
  background: rgba(167,167,173,0.15);
  color: #a7a7ad;
}

/* Breadth score bar */
.breadth-score-bar {
  background: #1e2025;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.breadth-score-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #a7a7ad;
  margin-bottom: 7px;
}

.breadth-bar-track {
  height: 6px;
  background: #2a2b2f;
  border-radius: 3px;
  overflow: hidden;
}

.breadth-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Regime Cards Row */
.regime-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 700px) {
  .regime-row { grid-template-columns: 1fr; }
}
.regime-card-title {
  font-size: 10px;
  font-weight: 700;
  color: #a7a7ad;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}
.regime-no-flags  { font-size: 11px; color: #a7a7ad; }
.regime-quadrant {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #e9e9ea;
}
.regime-description {
  font-size: 11px;
  color: #a7a7ad;
  line-height: 1.45;
  margin-bottom: 10px;
}
.regime-axes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 10px;
}
.regime-axis-group { display: flex; flex-direction: column; gap: 6px; }
.regime-axis-detail { padding-left: 64px; }
.regime-axis {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #a7a7ad;
}
.regime-axis-label { width: 56px; flex-shrink: 0; }
.regime-axis-track {
  flex: 1;
  height: 5px;
  background: #2a2b2f;
  border-radius: 3px;
  overflow: hidden;
}
.regime-axis-fill  { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.regime-axis-pct   { width: 28px; text-align: right; flex-shrink: 0; font-weight: 600; color: #e9e9ea; font-size: 11px; }
.regime-flag-list  { display: flex; flex-direction: column; gap: 0; margin-top: 10px; }
.regime-flag-item  { display: flex; flex-direction: column; gap: 5px; padding: 10px 0; border-top: 1px solid #2a2b2f; }
.regime-flag-item:first-child { border-top: none; padding-top: 0; }
.regime-flag-chips { display: flex; flex-direction: column; gap: 4px; }
.regime-flag       { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; display: inline-block; white-space: nowrap; align-self: flex-start; letter-spacing: 0.04em; }
.regime-flag-desc  { font-size: 11px; color: #a7a7ad; line-height: 1.5; }
.regime-method-note {
  flex: 1;
  font-size: 11px;
  color: #a7a7ad;
  line-height: 1.6;
}
.regime-method-note strong { color: #e9e9ea; font-weight: 600; }

/* Tab Bar */
.tab-bar { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; background: #17181b; border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn { padding: 6px 14px; border: none; background: transparent; color: #a7a7ad; cursor: pointer; border-radius: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.tab-btn.active { background: #2a2b2f; color: #e9e9ea; }
.tab-panel        { display: none; }
.tab-panel.active { display: block; }

/* Overview Category Cards */
.overview-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.overview-cat-card {
  background: #17181b;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: background 0.15s;
}

.overview-cat-card:hover {
  background: #1e2025;
}
.overview-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.overview-cat-title { display: flex; align-items: center; gap: 8px; }
.overview-cat-name  { font-size: 13px; font-weight: 600; color: #e9e9ea; }
.split-bar-track { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 8px 0 12px; }
.split-bar-seg   { height: 100%; transition: width 0.4s ease; }
.overview-theme-label { font-size: 13px; font-weight: 600; color: #e9e9ea; margin-bottom: 4px; }
.overview-theme-desc  { font-size: 12px; color: #a7a7ad; line-height: 1.45; margin-bottom: 12px; }
.overview-chips-section { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.overview-chips-row { display: flex; align-items: flex-start; gap: 6px; }
.overview-chips-dir { font-size: 11px; font-weight: 700; flex-shrink: 0; padding-top: 2px; }
.overview-chips-dir.above { color: #10b981; }
.overview-chips-dir.below { color: #ef4444; }
.overview-chips     { display: flex; flex-wrap: wrap; gap: 4px; }
.sym-chip { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 4px; }
.sym-chip.above { background: rgba(16,185,129,0.15); color: #10b981; }
.sym-chip.below { background: rgba(239,68,68,0.15);  color: #ef4444; }
.sym-chip.neutral { background: rgba(255,255,255,0.08); color: #6b7280; }
.regime-signal-row   { display: flex; align-items: flex-start; gap: 8px; margin-top: 5px; }
.regime-signal-dir   { font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; padding-top: 2px; min-width: 95px; }
.regime-signal-dir.up   { color: #10b981; }
.regime-signal-dir.down { color: #ef4444; }
.regime-signal-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sym-chip-none  { font-size: 12px; color: #3a3a42; }
.overview-cat-footer { margin-top: 14px; }
.overview-details-link { font-size: 11px; color: #4a7abf; cursor: pointer; }
.overview-details-link:hover { color: #7aa2f7; }

/* Stacked sparkline */
.stacked-sparkline {
  width: 100%;
  height: 80px;
  display: block;
  margin-bottom: 4px;
}

.stacked-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #9ca3af;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-sym {
  font-weight: 600;
}
