:root {
  --bg: #0a0d10;
  --panel: #111519;
  --panel-border: #1f262d;
  --amber: #ffb000;
  --amber-dim: #8a6200;
  --green: #3ddc84;
  --red: #ff5c5c;
  --text: #d9dee2;
  --text-dim: #7a8790;
  --mono: "SF Mono", "IBM Plex Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #000;
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 14px;
}
.brand-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
  box-shadow: 0 0 6px var(--green);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.clock { color: var(--text-dim); }
.status { color: var(--text-dim); font-size: 12px; }
.icon-btn {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--amber);
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
}
.icon-btn:hover { background: #1a2126; }

/* ---- ticker ---- */
.ticker {
  background: #000;
  border-bottom: 1px solid var(--panel-border);
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 0;
}
.ticker-track {
  display: inline-flex;
  gap: 28px;
  padding-left: 16px;
  animation: scroll-left 40s linear infinite;
}
.ticker.paused .ticker-track { animation-play-state: paused; }
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.tick {
  display: inline-flex;
  gap: 6px;
  font-size: 12px;
}
.tick .sym { color: var(--text-dim); }
.tick .up { color: var(--green); }
.tick .down { color: var(--red); }

/* ---- layout ---- */
.layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
  max-width: 2000px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 14px;
}
.panel-title {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px;
}
.sub-title {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.news-cols {
  columns: 3 280px;
  column-gap: 20px;
}
.news-cols .news-item {
  break-inside: avoid;
}
@media (max-width: 900px) {
  .news-cols { columns: 1; }
}

.panel-ipo .ipo-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .panel-ipo .ipo-body { grid-template-columns: 1fr; }
}

.ipo-table { display: flex; flex-direction: column; gap: 0; }
.ipo-row {
  display: grid;
  grid-template-columns: 78px 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--panel-border);
  font-size: 12px;
}
.ipo-row:last-child { border-bottom: none; }
.ipo-row .ipo-date { color: var(--text-dim); }
.ipo-row .ipo-name { color: var(--text); }
.ipo-row .ipo-sym { color: var(--amber); margin-left: 6px; font-size: 11px; }
.ipo-row .ipo-price { color: var(--green); white-space: nowrap; }
.ipo-row .ipo-exch { color: var(--text-dim); font-size: 11px; white-space: nowrap; }

.panel-note {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--panel-border);
  font-size: 11px;
  color: var(--text-dim);
}

.flows-body {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .flows-body { grid-template-columns: 1fr; }
}

.rotation-list { display: flex; flex-direction: column; gap: 8px; }
.rotation-row {
  display: grid;
  grid-template-columns: 150px 1fr 68px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.rotation-label { color: var(--text); }
.rotation-sym { color: var(--text-dim); font-size: 11px; margin-left: 4px; }
.rotation-bar-track {
  position: relative;
  height: 12px;
  background: #161b20;
  border-radius: 2px;
}
.rotation-bar-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--panel-border);
}
.rotation-bar-fill {
  position: absolute;
  top: 1px;
  bottom: 1px;
  border-radius: 2px;
}
.rotation-value { text-align: right; white-space: nowrap; }
.rotation-value.up { color: var(--green); }
.rotation-value.down { color: var(--red); }

.risk-pairs { display: flex; flex-direction: column; gap: 10px; }
.risk-pair {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
  font-size: 12px;
}
.risk-pair:last-child { border-bottom: none; }
.rp-label {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rp-detail { color: var(--text); }
.rp-tag {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tag-on { background: rgba(61, 220, 132, 0.15); color: var(--green); }
.tag-off { background: rgba(255, 92, 92, 0.15); color: var(--red); }

.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.sector-quotes {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--panel-border);
}
.sq-item { font-size: 12px; }
.sq-item .sym { color: var(--text); font-weight: 600; }
.sq-item .px { margin-left: 4px; color: var(--text-dim); }
.sq-item .chg { margin-left: 4px; }

/* ---- news lists ---- */
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-border);
}
.news-item:last-child { border-bottom: none; }
.news-item .headline {
  color: var(--text);
  display: block;
  margin-bottom: 3px;
}
.news-item .headline:hover { color: var(--amber); }
.news-item .meta {
  color: var(--text-dim);
  font-size: 11px;
}
.loading, .error, .empty {
  color: var(--text-dim);
  font-style: italic;
  font-size: 12px;
}
.error { color: var(--red); }

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 11px;
  padding: 16px;
}
