:root {
  color-scheme: dark;
  --bg: #051114;
  --panel: rgba(10, 21, 27, 0.92);
  --panel-strong: rgba(13, 29, 36, 0.97);
  --panel-soft: rgba(20, 40, 48, 0.86);
  --ink: #eff8fb;
  --muted: #8ba8b2;
  --line: rgba(201, 240, 255, 0.1);
  --accent: #58e1c1;
  --accent-strong: #21bfa0;
  --accent-soft: rgba(88, 225, 193, 0.16);
  --gold: #f7d774;
  --danger: #ff7b72;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(88, 225, 193, 0.14), transparent 24rem),
    radial-gradient(circle at bottom left, rgba(247, 215, 116, 0.08), transparent 24rem),
    linear-gradient(180deg, #041014 0%, #08161b 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.monitor-shell {
  width: min(1380px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 4rem;
}

.monitor-topbar,
.brand-block,
.nav-links,
.hero-panel,
.hero-copy,
.hero-status,
.metric-grid,
.dashboard-grid,
.panel-card,
.section-head,
.stat-row,
.bar-copy,
.rank-item,
.symbol-head,
.symbol-metrics,
.symbol-card,
.chart-toolbar,
.chart-control,
.table-wrap,
.timeline-copy {
  min-width: 0;
  max-width: 100%;
}

.monitor-topbar,
.hero-panel,
.metric-grid,
.dashboard-grid,
.panel-card {
  margin-bottom: 1rem;
}

.monitor-topbar,
.hero-panel,
.metric-card,
.panel-card,
.symbol-card {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: linear-gradient(180deg, var(--panel-strong) 0%, var(--panel) 100%);
  box-shadow: var(--shadow);
}

.monitor-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
  color: #06201c;
  font-family: "Arial Black", "Avenir Next Condensed", sans-serif;
}

.eyebrow,
.panel-label,
.metric-label {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent);
}

.brand-block h1,
.hero-copy h2,
.section-head h3,
.symbol-card h4 {
  margin: 0;
  font-family: "Arial Black", "Avenir Next Condensed", sans-serif;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  max-width: 100%;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 1rem;
  padding: 1.3rem;
}

.hero-copy h2 {
  font-size: clamp(2.3rem, 5vw, 4.7rem);
  line-height: 0.95;
  max-width: 12ch;
}

.lede,
.subtle-copy,
.timeline-copy span,
.table-subcopy,
.rank-item span,
.bar-copy span {
  color: var(--muted);
}

.panel-card strong,
.symbol-card strong,
.rank-item strong,
.stat-row strong,
.timeline-copy p,
.subtle-copy,
.table-subcopy,
td,
th {
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.primary-action,
.secondary-action {
  padding: 0.9rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}

.primary-action {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
  color: #07211d;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.hero-status {
  padding: 1rem;
  border-radius: 1.2rem;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.metric-grid,
.dashboard-grid,
.symbol-grid {
  display: grid;
  gap: 1rem;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.panel-card,
.symbol-card {
  padding: 1.1rem;
}

.panel-card {
  overflow: hidden;
}

.metric-card strong {
  font-family: "Arial Black", "Avenir Next Condensed", sans-serif;
  font-size: 2rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bar-stack,
.rank-list,
.timeline,
.stat-stack {
  display: grid;
  gap: 0.8rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.bar-row {
  display: grid;
  gap: 0.45rem;
}

.bar-copy {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.bar-track {
  height: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong) 0%, var(--gold) 100%);
}

.rank-item,
.timeline-item,
.symbol-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
}

.timeline-dot-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
  box-shadow: 0 0 0 4px rgba(88, 225, 193, 0.12);
}

.rank-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
}

.rank-item > div,
.stat-row > span,
.bar-copy > span,
.symbol-head > div {
  min-width: 0;
}

.rank-metric {
  font-family: "Arial Black", "Avenir Next Condensed", sans-serif;
  color: var(--gold);
}

.symbol-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.symbol-head,
.symbol-metrics {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.symbol-metrics {
  margin: 1rem 0;
}

.symbol-metrics div {
  display: grid;
  gap: 0.15rem;
}

.run-badge,
.micro-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
}

.micro-chip-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.chart-toolbar {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.chart-control {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-control select {
  min-width: 11rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
}

.chart-layout {
  display: grid;
  gap: 0.9rem;
}

.chart-stage {
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: radial-gradient(circle at top right, rgba(88, 225, 193, 0.08), transparent 18rem), var(--panel-soft);
  overflow: hidden;
}

.chart-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-stage-small svg {
  min-height: 170px;
}

.chart-legend {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem 1rem;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: var(--muted);
}

.sma-fast-pill {
  box-shadow: inset 0 0 0 1px rgba(88, 225, 193, 0.7);
}

.sma-slow-pill {
  box-shadow: inset 0 0 0 1px rgba(247, 215, 116, 0.7);
}

.entry-pill {
  box-shadow: inset 0 0 0 1px rgba(95, 223, 147, 0.7);
}

.exit-pill {
  box-shadow: inset 0 0 0 1px rgba(255, 123, 114, 0.7);
}

.strategy-stats {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.strategy-stat-card {
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.strategy-stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.table-subcopy {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.95rem 1rem;
}

.timeline-dot {
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.3rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
}

.timeline-dot-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--gold) 100%);
}

.timeline-copy {
  display: grid;
  gap: 0.25rem;
}

.timeline-copy p {
  margin: 0;
}

.timeline-item.alert-high {
  border-color: rgba(255, 123, 114, 0.5);
}

.timeline-item.alert-medium {
  border-color: rgba(247, 215, 116, 0.45);
}

.empty-state,
.empty-table {
  color: var(--muted);
  text-align: center;
  padding: 1rem 0.5rem;
}

@media (max-width: 980px) {
  .hero-panel,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .monitor-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .monitor-shell {
    width: 100%;
    padding: 0.65rem 0.5rem 2.75rem;
  }

  .monitor-topbar,
  .section-head,
  .stat-row,
  .rank-item,
  .symbol-head,
  .symbol-metrics,
  .chart-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h2 {
    max-width: none;
    font-size: clamp(2.15rem, 12vw, 3.2rem);
  }

  .hero-panel,
  .monitor-topbar,
  .metric-card,
  .panel-card,
  .symbol-card {
    border-radius: 1.1rem;
    padding: 0.95rem;
  }

  .hero-actions .primary-action,
  .hero-actions .secondary-action,
  .chart-control,
  .chart-control select {
    width: 100%;
  }

  .chart-stage svg {
    min-width: 0;
  }

  th,
  td {
    padding: 0.7rem 0.55rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 360px) {
  .monitor-shell {
    padding-inline: 0.35rem;
  }

  .hero-panel,
  .monitor-topbar,
  .metric-card,
  .panel-card,
  .symbol-card {
    padding: 0.8rem;
  }

  .brand-mark {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 0.75rem;
  }
}
