:root {
  --bg: #070b18;
  --bg2: #0b1124;
  --card: rgba(20, 27, 48, 0.72);
  --card-solid: #141b30;
  --inset: #0e1428;
  --text: #eaf0fb;
  --muted: #8a96b8;
  --faint: #59648a;
  --line: rgba(120, 140, 190, 0.14);
  --green: #2ee6a6;
  --red: #ff5f73;
  --amber: #ffb13d;
  --blue: #4d96ff;
  --purple: #a78bfa;
  --cyan: #29d3e6;
  --grad: linear-gradient(135deg, #4d96ff 0%, #29d3e6 50%, #2ee6a6 100%);
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.7);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
.num, .stat-v, .mini-v, .donut-num, .hero-range, td.n, .badge, .tag { font-variant-numeric: tabular-nums; }

/* ambient background */
.bg-grid {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(77,150,255,0.16), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(41,211,230,0.10), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(46,230,166,0.08), transparent 60%),
    var(--bg);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(14px, 4vw, 30px);
  background: rgba(7, 11, 24, 0.7);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { filter: drop-shadow(0 0 10px rgba(46,230,166,0.4)); }
.brand-name { font-weight: 800; letter-spacing: 0.14em; font-size: 14px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--inset); border: 1px solid var(--line); color: var(--muted);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 0 currentColor; }
.status-pill.open { color: var(--green); } .status-pill.open .dot { background: var(--green); animation: pulse 2s infinite; }
.status-pill.pre { color: var(--amber); } .status-pill.pre .dot { background: var(--amber); }
.status-pill.closed { color: var(--muted); } .status-pill.closed .dot { background: var(--muted); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,230,166,0.5);} 70%{ box-shadow:0 0 0 7px rgba(46,230,166,0);} 100%{box-shadow:0 0 0 0 rgba(46,230,166,0);} }
.updated { font-size: 11px; color: var(--faint); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; cursor: pointer; font-size: 17px;
  background: var(--inset); border: 1px solid var(--line); color: var(--text);
  transition: transform 0.5s, background 0.2s;
}
.icon-btn:hover { background: var(--card-solid); }
.icon-btn:active { transform: rotate(180deg); }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: clamp(14px, 3vw, 26px); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-12 { grid-column: span 12; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
h2 { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tag { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--inset); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }
.label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.03em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.footnote { font-size: 11.5px; color: var(--faint); margin-top: 12px; line-height: 1.5; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(280px, 0.9fr) 1.4fr; gap: 26px; align-items: center; }
.hero-range { display: flex; align-items: baseline; gap: 14px; margin: 10px 0 6px; }
.hero-range .num { font-size: clamp(34px, 6vw, 56px); font-weight: 900; letter-spacing: -0.02em; line-height: 1; }
.hero-range .tilde { font-size: 26px; color: var(--cyan); font-weight: 700; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.hero-meta b { color: var(--text); font-weight: 700; }
.hero-meta .sep { color: var(--faint); }
.badges { display: flex; gap: 8px; }
.badge { padding: 6px 13px; border-radius: 999px; font-weight: 800; font-size: 11.5px; letter-spacing: 0.06em; border: 1px solid transparent; }
.badge.trade { background: rgba(46,230,166,0.14); color: var(--green); border-color: rgba(46,230,166,0.4); }
.badge.notrade { background: rgba(255,95,115,0.14); color: var(--red); border-color: rgba(255,95,115,0.4); }
.badge.ghost { background: var(--inset); color: var(--muted); border-color: var(--line); }
.badge.high { color: var(--green); border-color: rgba(46,230,166,0.4); }
.badge.medium { color: var(--amber); border-color: rgba(255,177,61,0.4); }
.badge.low { color: var(--red); border-color: rgba(255,95,115,0.4); }
.notice { margin-top: 14px; padding: 10px 13px; border-radius: 11px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,95,115,0.1); border: 1px solid rgba(255,95,115,0.32); color: var(--red); }
.hero-chart { min-width: 0; }
#rangeChart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legend i { width: 11px; height: 3px; border-radius: 2px; display: inline-block; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.stat-grid.four { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--inset); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; }
.stat-k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-v { font-size: 17px; font-weight: 800; }
.stat-v.good { color: var(--green); } .stat-v.danger { color: var(--red); }

/* ---------- condor viz ---------- */
.condor-viz { background: var(--inset); border: 1px solid var(--line); border-radius: 13px; padding: 16px 14px; }
.condor-viz svg { width: 100%; height: auto; display: block; }

/* ---------- component bars ---------- */
.comp-bars { display: flex; flex-direction: column; gap: 11px; }
.cbar { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; }
.cbar-name { font-size: 12px; font-weight: 700; }
.cbar-track { position: relative; height: 22px; background: var(--inset); border-radius: 7px; border: 1px solid var(--line); }
.cbar-fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; opacity: 0.85; }
.cbar-val { font-size: 10px; color: var(--text); position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; padding: 0 5px; font-weight: 600; }

/* ---------- donut / track record ---------- */
.donut-wrap { position: relative; width: 160px; height: 160px; margin: 4px auto 16px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-num { font-size: 30px; font-weight: 900; }
.donut-lbl { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini { background: var(--inset); border: 1px solid var(--line); border-radius: 12px; padding: 11px 6px; text-align: center; }
.mini-v { font-size: 19px; font-weight: 800; display: block; }
.mini-v.good { color: var(--green); }
.mini-k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.progress-row { margin-top: 16px; }
.progress-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.progress { height: 9px; background: var(--inset); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width 0.6s ease; }

/* ---------- charts ---------- */
.chart-box { position: relative; height: 240px; }

/* ---------- news ---------- */
.news-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.news-item { display: flex; gap: 11px; align-items: flex-start; padding: 12px; border-radius: 13px;
  background: var(--inset); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color 0.2s, transform 0.15s; }
.news-item:hover { border-color: rgba(77,150,255,0.5); transform: translateY(-1px); }
.news-kw { flex-shrink: 0; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 7px;
  background: rgba(77,150,255,0.14); color: var(--blue); border: 1px solid rgba(77,150,255,0.3); text-transform: uppercase; }
.news-kw.alert { background: rgba(255,95,115,0.14); color: var(--red); border-color: rgba(255,95,115,0.3); }
.news-body { min-width: 0; }
.news-title { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-src { font-size: 10.5px; color: var(--faint); margin-top: 5px; }

/* ---------- chips (events) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.chip { font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--inset); color: var(--muted); border: 1px solid var(--line); }
.chip.warn { color: var(--amber); border-color: rgba(255,177,61,0.4); }

/* ---------- misc ---------- */
.status { text-align: center; color: var(--muted); padding: 60px 16px; font-size: 14px; }
.status.error { color: var(--red); }
.hidden { display: none !important; }
.disclaimer { color: var(--faint); font-size: 11px; text-align: center; line-height: 1.6; margin: 26px auto 36px; max-width: 560px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .col-7, .col-6, .col-5 { grid-column: span 12; }
  .news-list { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stat-grid.four { grid-template-columns: repeat(2, 1fr); }
  .hero-range .num { font-size: 38px; }
  .brand-sub { display: none; }
  .updated { display: none; }
}
