:root {
  color-scheme: dark;
  --bg: #071426;
  --panel: #0d1d34;
  --panel-2: #122743;
  --line: rgba(137, 174, 255, .16);
  --line-strong: rgba(151, 188, 255, .26);
  --text: #f5f8ff;
  --muted: rgba(220, 232, 255, .64);
  --muted-2: rgba(204, 220, 255, .43);
  --accent: #4de3ff;
  --green: #42e8a1;
  --red: #ff6b8b;
  --yellow: #ad8cff;
  --violet: #8b7cff;
  --pink: #ff74c8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(77, 227, 255, .18), transparent 32rem),
    radial-gradient(circle at 88% 12%, rgba(139, 124, 255, .16), transparent 34rem),
    radial-gradient(circle at 52% 92%, rgba(255, 116, 200, .07), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
::selection { background: var(--accent); color: #061321; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 20, 38, .84);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1520px, calc(100% - 48px));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font-size: 13px; letter-spacing: .13em; line-height: 1.2; }
.brand small { margin-top: 2px; color: var(--muted-2); font-size: 9px; letter-spacing: .11em; }
.coin-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet) 70%, var(--pink));
  color: #061321;
  font-size: 19px;
  font-weight: 850;
  box-shadow: 0 0 30px rgba(77, 227, 255, .22), 0 0 50px rgba(139, 124, 255, .1);
}

nav { display: flex; justify-content: center; gap: 4px; }
nav a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  transition: .2s ease;
}
nav a:hover, nav a:focus-visible { background: rgba(99, 207, 255, .1); color: var(--text); outline: none; }

.connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
}
.connection > span, .pulse, .live-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--yellow);
}
.connection b, .price-meta b { font-weight: inherit; }
.connection.live > span, .pulse.live, .live-dot { background: var(--green); box-shadow: 0 0 12px rgba(66, 232, 161, .75); }
.connection.fallback > span, .pulse.fallback { background: var(--yellow); }

.dashboard-wrap {
  width: min(1520px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.status-banner {
  margin-top: 18px;
  padding: 11px 14px;
  border: 1px solid rgba(173, 140, 255, .38);
  border-radius: 10px;
  background: rgba(139, 124, 255, .11);
  color: #d8ccff;
  font-size: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(500px, .75fr);
  gap: 40px;
  align-items: end;
  padding: 16px 0 30px;
}

.eyebrow, .card-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.price-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-top: 11px; }
.price-row h1 {
  min-height: 70px;
  margin: 0;
  font-size: clamp(48px, 6.4vw, 90px);
  font-weight: 610;
  letter-spacing: -.065em;
  line-height: .92;
}
.change-pill {
  margin-bottom: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.change-pill.positive { background: rgba(66,232,161,.14); color: var(--green); }
.change-pill.negative { background: rgba(255,107,139,.14); color: var(--red); }
.price-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; color: var(--muted-2); font-size: 11px; }
.price-meta span { display: inline-flex; align-items: center; gap: 6px; }

.skeleton { display: inline-block; border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.price-skeleton { width: min(70vw, 520px); height: .8em; }
@keyframes shimmer { to { background-position: -200% 0; } }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: var(--line);
  gap: 1px;
}
.metric-card { min-width: 0; padding: 17px 18px; background: rgba(13, 29, 52, .96); }
.metric-card p { margin: 0; color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; font-size: clamp(18px, 2vw, 25px); font-weight: 580; letter-spacing: -.025em; }
.metric-card span { display: block; margin-top: 6px; color: var(--muted-2); font-size: 10px; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }

.main-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(330px, .72fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, rgba(17, 38, 66, .96), rgba(10, 25, 45, .98)); box-shadow: inset 0 1px 0 rgba(255,255,255,.025); }
.panel-heading { min-height: 74px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .section-heading h2, .outlook-panel h2 { margin: 5px 0 0; font-size: 19px; font-weight: 590; letter-spacing: -.025em; }

.chart-panel { min-width: 0; overflow: hidden; }
.chart-heading { align-items: center; }
.timeframes { display: flex; gap: 3px; overflow-x: auto; }
.timeframes button { border: 0; border-radius: 7px; padding: 7px 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; }
.timeframes button:hover { color: var(--text); }
.timeframes button.active { background: linear-gradient(135deg, var(--accent), #8ba9ff); color: #061321; }
.ohlc-bar { min-height: 33px; display: flex; align-items: center; gap: 18px; padding: 0 20px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-size: 9px; }
.ohlc-bar strong { margin-left: 3px; color: var(--muted); font-weight: 540; }
.chart-shell { position: relative; height: 420px; background: #0a182b; }
.chart-canvas { width: 100%; height: 100%; }
.chart-state { position: absolute; inset: 0; display: grid; place-items: center; border: 0; background: rgba(10,24,43,.84); color: var(--muted); font-size: 12px; }
.chart-state.error { color: #d8ccff; cursor: pointer; }
.source-line { display: flex; align-items: center; gap: 7px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9px; letter-spacing: .04em; }
.source-line .live-dot { width: 5px; height: 5px; }

.pulse-card { padding-bottom: 17px; overflow: hidden; }
.model-badge, .source-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(77,227,255,.28);
  border-radius: 999px;
  padding: 4px 7px;
  background: linear-gradient(135deg, rgba(77,227,255,.1), rgba(139,124,255,.1));
  color: #8cecff;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .09em;
  white-space: nowrap;
}
.bias-block { display: grid; grid-template-columns: 78px 1fr; gap: 15px; align-items: center; margin: 18px; padding: 16px; border: 1px solid rgba(66,232,161,.22); border-radius: 12px; background: linear-gradient(135deg, rgba(66,232,161,.09), rgba(77,227,255,.035)); }
.bias-block.neutral { border-color: rgba(173,140,255,.24); background: linear-gradient(135deg, rgba(139,124,255,.11), rgba(77,227,255,.035)); }
.bias-block.negative { border-color: rgba(255,107,139,.23); background: rgba(255,107,139,.075); }
.bias-score { font-size: 32px; font-weight: 600; letter-spacing: -.04em; }
.bias-score small { color: var(--muted-2); font-size: 11px; }
.bias-block strong { display: block; font-size: 14px; }
.bias-block p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.scores { padding: 0 18px; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 9px 14px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.055); }
.score-copy { display: flex; flex-direction: column; }
.score-copy span { font-size: 11px; }
.score-copy small { margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.score-value { color: var(--muted); font-size: 10px; }
.score-track { grid-column: 1 / -1; height: 3px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.score-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--accent), var(--green)); }
.score-fill.muted { width: 12%; background: rgba(255,255,255,.15); }
.disclaimer { margin: 14px 18px 0; color: var(--muted-2); font-size: 9px; line-height: 1.45; }

.dashboard-section { padding-top: 72px; scroll-margin-top: 60px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 18px; }
.section-heading h2 { font-size: clamp(22px, 3vw, 31px); }
.section-heading > p { max-width: 590px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: right; }

.flow-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.flow-card { min-height: 218px; padding: 18px; }
.flow-card.featured { border-color: rgba(77,227,255,.26); background: radial-gradient(circle at 90% 0%, rgba(77,227,255,.13), transparent 48%), linear-gradient(145deg, rgba(17,38,66,.98), rgba(10,25,45,.98)); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.flow-value { margin-top: 26px; font-size: 37px; font-weight: 590; letter-spacing: -.04em; }
.flow-card p { min-height: 38px; margin: 6px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.flow-card > small, .network-card > small { color: var(--muted-2); font-size: 8px; }
.split-bar { height: 5px; overflow: hidden; border-radius: 99px; background: var(--red); }
.split-bar span { display: block; height: 100%; background: var(--green); }
.split-labels { display: flex; justify-content: space-between; margin: 7px 0 13px; color: var(--muted-2); font-size: 8px; }
.derivatives-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px 15px 0 0; background: var(--line); }
.derivatives-grid .metric-card { min-height: 128px; padding: 22px; }
.derivatives-grid + .position-panel { border-top: 0; border-radius: 0 0 15px 15px; }
.position-panel { padding: 18px 22px; }
.position-labels { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.position-labels span:first-child { color: var(--green); }
.position-labels span:last-child { color: var(--red); }
.position-bar { height: 7px; overflow: hidden; border-radius: 99px; background: var(--red); }
.position-bar span { display: block; height: 100%; background: var(--green); }
.position-notes { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 13px; color: var(--muted-2); font-size: 9px; }

.network-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.network-card { min-height: 180px; padding: 18px; }
.network-card strong { display: block; margin-top: 24px; color: var(--text); font-size: 34px; letter-spacing: -.035em; }
.network-card p { min-height: 34px; margin: 7px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.macro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.macro-card { min-height: 125px; padding: 18px; }
.macro-card strong { display: block; margin-top: 18px; color: var(--text); font-size: 26px; }
.macro-card small { display: block; margin-top: 7px; color: var(--muted-2); font-size: 9px; }
.insight-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); gap: 12px; }
.sentiment-panel, .outlook-panel { min-height: 390px; }
.sentiment-body { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: center; padding: 28px; }
.gauge { width: 200px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) var(--gauge-value), rgba(255,255,255,.06) 0); position: relative; }
.gauge::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--panel); }
.gauge > div { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.gauge strong { font-size: 48px; font-weight: 600; letter-spacing: -.05em; }
.gauge span { max-width: 110px; color: var(--muted); font-size: 10px; text-align: center; }
.sentiment-history { height: 190px; display: flex; align-items: stretch; gap: clamp(7px, 1.5vw, 18px); border-bottom: 1px solid var(--line); background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 100% 25%; }
.sentiment-history > div { flex: 1; min-width: 20px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.sentiment-history span { width: min(24px, 70%); min-height: 6px; border-radius: 4px 4px 0 0; background: linear-gradient(var(--accent), rgba(139,124,255,.28)); }
.sentiment-history small { color: var(--muted-2); font-size: 8px; }
.outlook-panel { padding: 24px; }
.outlook-panel h2 { margin-top: 7px; font-size: 25px; }
.scenario { display: flex; justify-content: space-between; gap: 15px; margin: 24px 0 18px; padding: 14px; border: 1px solid rgba(77,227,255,.2); border-radius: 10px; background: linear-gradient(135deg, rgba(77,227,255,.08), rgba(139,124,255,.07)); }
.scenario span { color: var(--muted); font-size: 11px; }
.scenario strong { font-size: 12px; }
.outlook-panel ul { list-style: none; margin: 0; padding: 0; }
.outlook-panel li { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.outlook-panel li strong { color: var(--text); font-weight: 570; }
.outlook-panel > p { margin: 18px 0 0; color: var(--muted-2); font-size: 9px; line-height: 1.5; }

footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 30px; margin-top: 74px; padding-top: 24px; border-top: 1px solid var(--line); }
.footer-brand .coin-mark { width: 30px; height: 30px; font-size: 15px; }
.footer-copy { margin: 0 auto; text-align: center; }
.footer-copy p { margin: 4px 0; color: var(--muted-2); font-size: 9px; line-height: 1.45; }
.footer-copy a { color: var(--accent); font-weight: 650; transition: color .2s ease; }
.footer-copy a:hover, .footer-copy a:focus-visible { color: var(--text); outline: none; }
.footer-sources { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.footer-sources span { border: 1px solid var(--line); border-radius: 99px; padding: 5px 8px; color: var(--muted-2); font-size: 8px; }

@media (max-width: 1180px) {
  .header-inner, .dashboard-wrap { width: min(100% - 32px, 1520px); }
  .header-inner { gap: 18px; }
  nav a { padding-inline: 8px; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .main-grid { grid-template-columns: 1fr; }
  .pulse-card { display: grid; grid-template-columns: 1fr 1fr; }
  .pulse-card .panel-heading, .pulse-card .disclaimer { grid-column: 1 / -1; }
  .scores { padding: 8px 18px 0 0; }
  .flow-grid, .network-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .header-inner { grid-template-columns: 1fr auto; }
  nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; margin: 0 -16px; padding: 0 16px 8px; }
  nav a { white-space: nowrap; }
  .connection { justify-self: end; }
  .hero { padding-top: 6px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .price-row h1 { font-size: clamp(43px, 12vw, 72px); }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-heading > p { text-align: left; }
  .derivatives-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .insight-grid { grid-template-columns: 1fr; }
  .sentiment-body { grid-template-columns: 180px 1fr; gap: 20px; }
  .gauge { width: 170px; }
  footer { grid-template-columns: 1fr; justify-items: center; }
}

@media (max-width: 590px) {
  .header-inner, .dashboard-wrap { width: min(100% - 24px, 1520px); }
  .dashboard-wrap { padding-top: 22px; }
  .coin-mark { width: 32px; height: 32px; font-size: 16px; }
  .brand strong { font-size: 11px; }
  .brand small { font-size: 7px; }
  .price-row { align-items: center; }
  .price-row h1 { min-height: 50px; font-size: clamp(38px, 13vw, 58px); }
  .change-pill { margin: 0; }
  .price-meta { gap: 8px 12px; }
  .hero-stats, .flow-grid, .network-grid, .derivatives-grid, .macro-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 18px; }
  .chart-heading { align-items: flex-start; flex-direction: column; }
  .timeframes { width: 100%; }
  .timeframes button { flex: 1; }
  .ohlc-bar { gap: 10px; overflow-x: auto; }
  .chart-shell { height: 360px; }
  .pulse-card { display: block; }
  .scores { padding: 0 18px; }
  .dashboard-section { padding-top: 54px; }
  .flow-card { min-height: 210px; }
  .flow-grid .flow-card { grid-column: 1 / -1; }
  .derivatives-grid .metric-card { min-height: 105px; padding: 16px; }
  .position-notes { flex-direction: column; }
  .network-grid .network-card { grid-column: 1 / -1; min-height: 150px; }
  .macro-grid .macro-card:last-child { grid-column: 1 / -1; }
  .sentiment-body { grid-template-columns: 1fr; justify-items: center; padding: 22px 16px; }
  .sentiment-history { width: 100%; }
  .source-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
