:root {
  --bg: #0a0e14;
  --surface: #11161f;
  --surface2: #161d28;
  --border: #222b38;
  --text: #e6edf6;
  --muted: #8a97a8;
  --dim: #5c6878;
  --teal: #34d399;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --red: #f87171;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 80% -10%, #10202a 0%, transparent 60%), var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 20, 0.82);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 34px;
  height: 34px;
  color: var(--teal);
}

.brand h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand h1 span {
  font-size: 10px;
  vertical-align: super;
  color: var(--muted);
  font-weight: 400;
  margin-left: 1px;
}

.brand .sub {
  font-size: 12px;
  color: var(--muted);
}

.meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.live {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

.sep {
  color: var(--dim);
}

main {
  width: 80%;
  max-width: none;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

/* TOP GAUGES STYLING */
.gauges-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.gauge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-dial-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: center;
}

.gauge-dial-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.gauge-needle-img {
  position: absolute;
  bottom: 21%;
  left: 50%;
  width: 38px;
  height: auto;
  transform-origin: 50% 88%;
  transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.4, 1);
  z-index: 2;
  pointer-events: none;
}

.gauge-cap {
  display: none;
}

.gauge-reading {
  text-align: center;
  margin-top: 10px;
}

.gauge-status-text {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.gauge-sub-text {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* SEAF HERO AND PANELS */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, #0e1620, #11161f);
}

.kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.portfolio {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.portfolio .pill {
  display: inline-block;
  padding: 2px 10px;
  margin: 0 4px;
  border-radius: 8px;
  background: #16331f;
  color: var(--teal);
  border: 1px solid #1f4a2b;
  font-size: 28px;
}

.portfolio-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  max-width: 380px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
}

.stat-l {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-v {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--teal);
}

.stat-v.neg {
  color: var(--red);
}

.panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}

.panel-head h3 {
  font-size: 13px;
  font-weight: 600;
}

.legend {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lg {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin: 0 4px 0 8px;
  vertical-align: middle;
}

.lg.fav {
  background: var(--teal);
  margin-left: 0;
}

.lg.neu {
  background: var(--amber);
  margin-left: 8px;
}

.lg.avo {
  background: var(--red);
  margin-left: 8px;
}

.lg.seaf {
  background: var(--teal);
  margin-left: 0;
}

.lg.spy {
  background: var(--blue);
  margin-left: 8px;
}

.table-wrap {
  overflow-x: auto;
}

.ranktbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.ranktbl th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ranktbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ranktbl tbody tr:hover {
  background: var(--surface2);
}

.ranktbl tbody tr:last-child td {
  border-bottom: none;
}

.rk-num {
  font-family: var(--mono);
  color: var(--dim);
  width: 24px;
}

.tk {
  font-family: var(--mono);
  font-weight: 600;
}

.comp {
  font-family: var(--mono);
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.Favored {
  background: rgba(52, 211, 153, 0.14);
  color: var(--teal);
}

.badge.Neutral {
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
}

.badge.Avoid {
  background: rgba(248, 113, 113, 0.14);
  color: var(--red);
}

.cellrank {
  font-family: var(--mono);
  color: var(--muted);
}

.cellrank.hl {
  color: var(--teal);
  font-weight: 600;
}

.flow {
  font-family: var(--mono);
  font-size: 14px;
}

.flow.pos {
  color: var(--teal);
}

.flow.neg {
  color: var(--red);
}

.chart-panel {
  padding: 0;
}

.chartwrap {
  padding: 14px 18px 18px;
  height: 230px;
}

.disc {
  font-size: 11px;
  color: var(--dim);
  padding: 0 22px 18px;
  line-height: 1.5;
}

footer {
  border-top: 1px solid var(--border);
  padding: 20px 28px;
  text-align: center;
}

footer p {
  font-size: 12px;
  color: var(--dim);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* per-sector flow cards */
.lg-tr {
  background: var(--teal);
  opacity: 0.55;
  margin-left: 0;
}

.lg-ta {
  background: var(--amber);
  margin-left: 8px;
}

.lg-st {
  background: var(--blue);
  margin-left: 8px;
}

.flows-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}

.flow-card {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.fc-tk {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  font-size: 13px;
}

.fc-head .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-head .badge {
  padding: 1px 7px;
  font-size: 10px;
}

.fc-chart {
  height: 54px;
  position: relative;
}

.fc-chart svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.fc-chart .zero {
  stroke: var(--dim);
  stroke-dasharray: 2 3;
  stroke-width: 1;
}

@media (max-width: 820px) {
  .gauges-row {
    grid-template-columns: 1fr;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .portfolio {
    font-size: 30px;
  }
  .portfolio .pill {
    font-size: 26px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .flows-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}