/* C5iSR Dashboard — Dark Crypto Aesthetic */

:root {
  --bg-primary: #0a0a0f;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.6);
  --text-muted: rgba(255,255,255,0.3);
  --green: #00ff88;
  --green-dim: rgba(0,255,136,0.15);
  --red: #ff3355;
  --red-dim: rgba(255,51,85,0.15);
  --amber: #ffaa00;
  --amber-dim: rgba(255,170,0,0.15);
  --blue: #0088ff;
  --blue-dim: rgba(0,136,255,0.15);
  --purple: #aa55ff;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand a.back-to-main {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
}
.header-brand a.back-to-main:hover {
  color: var(--green);
  border-color: var(--green-dim);
  background: var(--green-dim);
}

.header-brand h1 {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
}

.header-brand .tagline {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

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

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn-sm {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn-metamask {
  border-color: var(--amber);
  color: var(--amber);
}

.btn-metamask:hover {
  background: var(--amber-dim);
}

.btn-logout {
  border-color: var(--red);
  color: var(--red);
}

.btn-logout:hover { background: var(--red-dim); }

/* ── Grid Layout ── */
.dashboard {
  padding: 20px 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-full { grid-template-columns: 1fr; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Price Cards ── */
.price-symbol {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
}

.price-name {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.price-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  margin: 12px 0 4px;
}

.price-change {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}

.price-change.positive { color: var(--green); }
.price-change.negative { color: var(--red); }

/* ── Signal Badge ── */
.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.signal-buy {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.3);
}

.signal-sell {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255,51,85,0.3);
}

.signal-hold {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(255,170,0,0.3);
}

/* ── RSI Gauge ── */
.rsi-gauge {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  margin: 8px 0;
  position: relative;
  overflow: hidden;
}

.rsi-gauge-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

.rsi-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── MACD Histogram ── */
.macd-bar {
  display: inline-block;
  width: 4px;
  margin: 0 1px;
  border-radius: 2px 2px 0 0;
  vertical-align: bottom;
}

.macd-positive { background: var(--green); }
.macd-negative { background: var(--red); }

/* ── DCA Plan ── */
.dca-tranche {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
}

.dca-tranche:last-child { border-bottom: none; }

.dca-label {
  color: var(--green);
  font-weight: 600;
}

.dca-price { color: var(--text-primary); }
.dca-amount { color: var(--text-secondary); }

/* ── Risk Metrics ── */
.risk-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.risk-label { color: var(--text-secondary); }
.risk-value {
  font-family: var(--font-mono);
  font-weight: 500;
}

.risk-stop { color: var(--red); }
.risk-target { color: var(--green); }

/* ── Market Regime ── */
.regime-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.regime-bull {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
}

.regime-bear {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255,51,85,0.2);
}

.regime-sideways {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(255,170,0,0.2);
}

/* ── Backtest Card ── */
.bt-stat {
  text-align: center;
  padding: 12px;
}

.bt-stat-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
}

.bt-stat-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ── Alert Log ── */
.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.alert-item:last-child { border-bottom: none; }

.alert-time {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 11px;
  min-width: 60px;
}

.alert-symbol {
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 40px;
}

.alert-msg {
  color: var(--text-secondary);
  flex: 1;
}

/* ── Chart Container ── */
.chart-container {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ── Confidence Bar ── */
.confidence-bar {
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s;
}

/* ── Loading Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Refresh Timer ── */
.refresh-timer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Global Market Stats Bar ── */
.market-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.market-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.market-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.market-stat-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Fear & Greed Gauge ── */
.fear-greed-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fear-greed-gauge {
  height: 8px;
  background: linear-gradient(90deg, #ff3355 0%, #ffaa00 35%, #00ff88 65%, #00ff88 100%);
  border-radius: 4px;
  position: relative;
  overflow: visible;
}

.fear-greed-fill {
  display: none;
}

.fear-greed-pointer {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Trending Coins ── */
/* ── Precious Metals ── */
.metals-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.metals-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.metals-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-hover);
}

.metals-symbol {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.metals-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.metals-price {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.metals-change {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 3px;
  text-align: right;
}

.skeleton-inline {
  opacity: 0.5;
}

/* ── Trending Coins ── */
.trending-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.trending-coin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.trending-coin:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.trending-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 20px;
}

.trending-coin-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.trending-coin-info {
  flex: 1;
  min-width: 0;
}

.trending-coin-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trending-coin-symbol {
  font-size: 11px;
  color: var(--text-muted);
}

.trending-coin-price {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

/* ── Skeleton Loading ── */
.skeleton-row {
  height: 40px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.skeleton-card {
  height: 120px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Card Animations ── */
.card-animate {
  animation: fadeSlideIn 0.4s ease-out both;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* stagger animation delay for grid children */
.grid > .card-animate:nth-child(1) { animation-delay: 0.05s; }
.grid > .card-animate:nth-child(2) { animation-delay: 0.1s; }
.grid > .card-animate:nth-child(3) { animation-delay: 0.15s; }
.grid > .card-animate:nth-child(4) { animation-delay: 0.2s; }
.grid > .card-animate:nth-child(5) { animation-delay: 0.25s; }

/* ── Toast Notification ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: rgba(10,10,15,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  z-index: 1000;
  animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 2.7s forwards;
  backdrop-filter: blur(10px);
}

.toast-success { border-color: var(--green); color: var(--green); }
.toast-error { border-color: var(--red); color: var(--red); }
.toast-info { border-color: var(--blue); color: var(--blue); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Sparkline ── */
.sparkline-container {
  width: 80px;
  height: 32px;
  opacity: 0.8;
}

.sparkline-container svg {
  display: block;
}

/* ── Price Card Extras ── */
.price-card {
  cursor: default;
}

.price-card-clickable {
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.price-card-clickable:hover {
  border-color: rgba(0, 255, 136, 0.35);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.12);
  transform: translateY(-2px);
}

.price-card-active {
  border-color: rgba(0, 255, 136, 0.65) !important;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.2) !important;
}

.price-card-hint {
  font-size: 9px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}

.price-card-clickable:hover .price-card-hint {
  opacity: 1;
}

.price-mcap {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Market Stat Change ── */
.market-stat-change {
  font-family: var(--font-mono);
  font-size: 10px;
  margin-top: 1px;
}

.market-stat-change.positive { color: var(--green); }
.market-stat-change.negative { color: var(--red); }

/* ── Last Updated ── */
.last-updated {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Chart Legend ── */
.chart-legend {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 0 0;
  min-height: 24px;
}

/* ── Chart Timeframe Group ── */
.chart-timeframe-group {
  display: inline-flex;
  gap: 4px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.chart-tf-btn.active {
  border-color: var(--blue);
  color: var(--blue);
}

/* ── Market Cap Rankings Table ── */
.rankings-table {
  overflow-x: auto;
}

.rankings-header,
.rankings-row {
  display: grid;
  grid-template-columns: 40px 120px 110px 70px 70px 70px 100px 90px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 13px;
}

.rankings-header {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.rankings-row {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s;
}

.rankings-row:hover {
  background: rgba(255,255,255,0.02);
}

.rankings-row:last-child {
  border-bottom: none;
}

.rank-col {
  color: var(--text-muted);
  text-align: center;
}

.rank-name-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rank-coin-img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.rank-coin-name {
  font-weight: 600;
}

.rank-price-col {
  color: var(--text-primary);
  font-weight: 500;
}

.rank-change-col {
  text-align: right;
  font-size: 12px;
}

.rank-change-col.positive { color: var(--green); }
.rank-change-col.negative { color: var(--red); }

.rank-mcap-col {
  color: var(--text-secondary);
  text-align: right;
  font-size: 12px;
}

.rank-spark-col {
  width: 80px;
  height: 24px;
}

/* ── Error Card ── */
.error-card {
  text-align: center;
  padding: 24px;
  color: var(--red);
  font-size: 13px;
  border-color: var(--red-dim);
}

/* ── Dashboard Footer ── */
.dashboard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 16px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Status Online Animation ── */
.status-online {
  box-shadow: 0 0 6px var(--green);
}

/* ── Portfolio Tracker ── */
.portfolio-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portfolio-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}

.portfolio-row:last-child { border-bottom: none; }

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

.portfolio-inputs {
  display: flex;
  gap: 8px;
}

.portfolio-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 8px;
  width: 110px;
  outline: none;
  transition: border-color 0.2s;
}

.portfolio-input:focus {
  border-color: var(--green);
  background: rgba(0,255,136,0.04);
}

.portfolio-input::placeholder { color: var(--text-muted); }
.portfolio-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.portfolio-pnl {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 130px;
  text-align: right;
}

/* ── Scripture Banner ── */
.scripture-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(0,255,136,0.04) 0%, rgba(170,85,255,0.04) 100%);
  border: 1px solid rgba(0,255,136,0.12);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
  animation: scriptureIn 0.6s ease both;
}

@keyframes scriptureIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scripture-cross {
  font-size: 22px;
  color: rgba(0,255,136,0.5);
  flex-shrink: 0;
  line-height: 1;
}

.scripture-content { flex: 1; min-width: 0; }

.scripture-text {
  font-style: italic;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
}

.scripture-ref {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(0,255,136,0.55);
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .scripture-text { white-space: normal; font-size: 13px; }
  .scripture-cross { font-size: 18px; }
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .rankings-header,
  .rankings-row {
    grid-template-columns: 30px 100px 100px 60px 60px 60px 90px 80px;
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .dashboard { padding: 12px; }
  .header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .market-stats-bar { padding: 8px 12px; justify-content: center; }
  .trending-container { grid-template-columns: repeat(2, 1fr); }
  .rankings-header,
  .rankings-row {
    grid-template-columns: 30px 90px 90px 55px 55px 55px 80px;
    font-size: 11px;
  }
  .rank-spark-col { display: none; }
  .chart-timeframe-group { margin-left: 4px; padding-left: 4px; }
  .portfolio-row { grid-template-columns: 100px 1fr; }
  .portfolio-pnl { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}

@media (max-width: 600px) {
  .grid-5 { grid-template-columns: 1fr; }
  .price-value { font-size: 20px; }
  .header-brand h1 { font-size: 16px; }
  .market-stats-bar { flex-direction: column; gap: 6px; }
  .market-stat { flex-direction: row; gap: 8px; width: 100%; justify-content: space-between; }
  .trending-container { grid-template-columns: 1fr; }
  .fear-greed-value { font-size: 22px; }
  .rankings-header,
  .rankings-row {
    grid-template-columns: 25px 80px 80px 50px 50px;
    font-size: 10px;
  }
  .rank-change-col:last-of-type,
  .rank-mcap-col,
  .rank-spark-col { display: none; }
  .sparkline-container { display: none; }
  .chart-timeframe-group { display: none; }
  .dashboard-footer { flex-direction: column; text-align: center; }
  .last-updated { display: none; }
  .btn-metamask { display: none; }
  .portfolio-row { grid-template-columns: 1fr; gap: 6px; }
  .portfolio-inputs { flex-wrap: wrap; }
  .portfolio-input { width: 100%; }
  .portfolio-pnl { flex-direction: row; justify-content: space-between; width: 100%; }
  #intelBriefContent { font-size: 12px; }
}

/* ── Market Intelligence Brief ── */
#intelBriefContent {
  line-height: 1.5;
}
#intelBriefContent .intel-stat {
  text-align: center;
  min-width: 60px;
}
#intelBriefContent .intel-stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}
#intelBriefContent .intel-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* ── Sticky Key Price Ticker (v3.0) ── */
.price-ticker {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 6px 24px;
  background: rgba(5,5,10,0.98);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 57px; /* just below the fixed header */
  z-index: 99;
  backdrop-filter: blur(12px);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.price-ticker::-webkit-scrollbar { display: none; }

.ticker-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  white-space: nowrap;
}

.ticker-sym {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.ticker-price {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.ticker-chg {
  font-family: var(--font-mono);
  font-size: 10px;
  min-width: 44px;
}
.ticker-chg.up   { color: var(--green); }
.ticker-chg.down { color: var(--red); }

.ticker-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex-shrink: 0;
}

.ticker-spacer {
  flex: 1;
  min-width: 12px;
}

@media (max-width: 768px) {
  .price-ticker { top: 50px; gap: 0; padding: 5px 12px; }
  .ticker-item { padding: 0 8px; }
  .ticker-chg { display: none; }
}

/* ── Prediction Range Bar (v3.0) ── */
.pred-range-wrap {
  width: 100%;
  margin: 4px 0 2px;
}
.pred-range-track {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: visible;
}
.pred-range-sl {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--red-dim, rgba(255,68,68,0.25));
  border-radius: 2px 0 0 2px;
}
.pred-range-tp {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  background: rgba(0,255,136,0.12);
  border-radius: 0 2px 2px 0;
}
.pred-range-cursor {
  position: absolute;
  top: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  transform: translateX(-50%);
  transition: left 0.4s;
  z-index: 2;
}
.pred-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
