@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Silkscreen:wght@400;700&display=swap');

:root {
  --bg-base: #0b0f15;
  --bg-elev-1: #131b25;
  --bg-elev-2: #1a2430;
  --border-subtle: rgba(177, 196, 208, 0.22);
  --border-strong: rgba(188, 219, 226, 0.36);
  --text-strong: #eaf0ef;
  --text-muted: #b6c3c7;
  --accent: #95b8c8;
  --accent-strong: #c1d9e2;
  --accent-2: #7a2c44;
  --success: #57d390;
  --warn: #dec79a;
  --danger: #ff6f87;
  --grid-line-x: rgba(150, 184, 200, 0.025);
  --grid-line-y: rgba(150, 184, 200, 0.016);
  --btn-primary-bg: rgba(122, 44, 68, 0.16);
  --btn-primary-bg-hover: rgba(122, 44, 68, 0.24);
  --hover-bg: rgba(122, 44, 68, 0.13);
  --surface-panel: linear-gradient(180deg, rgba(20, 29, 39, 0.96), rgba(16, 24, 33, 0.98));
  --surface-card: linear-gradient(180deg, rgba(20, 29, 39, 0.96), rgba(16, 24, 33, 0.98));
  --surface-chart: linear-gradient(180deg, rgba(17, 24, 34, 0.96), rgba(13, 20, 29, 0.96));
  --surface-chart-alt: linear-gradient(180deg, rgba(20, 28, 40, 0.96), rgba(13, 20, 30, 0.96));
  --surface-feed: linear-gradient(180deg, rgba(10, 22, 41, 0.95), rgba(10, 18, 33, 0.98));
  --shadow-card: 0 0 0 1px rgba(193, 217, 226, 0.09), 0 16px 34px rgba(4, 10, 17, 0.5);
  --theme-toggle-bg: rgba(149, 184, 200, 0.08);
  --theme-toggle-bg-hover: rgba(149, 184, 200, 0.16);
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 28px;
  --space-6: 40px;
  --space-7: 64px;
}

html[data-theme="light"] {
  --bg-base: #eef2f4;
  --bg-elev-1: #ffffff;
  --bg-elev-2: #f1f5f7;
  --border-subtle: rgba(62, 80, 98, 0.16);
  --border-strong: rgba(62, 80, 98, 0.28);
  --text-strong: #17212b;
  --text-muted: #5a6976;
  --accent: #3e6d84;
  --accent-strong: #224c63;
  --accent-2: #a25163;
  --grid-line-x: rgba(60, 92, 112, 0.055);
  --grid-line-y: rgba(60, 92, 112, 0.038);
  --btn-primary-bg: rgba(162, 81, 99, 0.1);
  --btn-primary-bg-hover: rgba(162, 81, 99, 0.18);
  --hover-bg: rgba(149, 184, 200, 0.18);
  --surface-panel: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 250, 0.98));
  --surface-card: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 249, 0.98));
  --surface-chart: linear-gradient(180deg, rgba(252, 253, 254, 0.98), rgba(240, 245, 248, 0.98));
  --surface-chart-alt: linear-gradient(180deg, rgba(249, 252, 253, 0.98), rgba(236, 243, 246, 0.98));
  --surface-feed: linear-gradient(180deg, rgba(250, 252, 253, 0.98), rgba(241, 246, 248, 0.98));
  --shadow-card: 0 0 0 1px rgba(62, 80, 98, 0.06), 0 14px 28px rgba(94, 113, 128, 0.14);
  --theme-toggle-bg: rgba(34, 76, 99, 0.07);
  --theme-toggle-bg-hover: rgba(34, 76, 99, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-base);
  color: var(--text-strong);
  font-family: "JetBrains Mono", monospace;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, var(--grid-line-x) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-y) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.24;
}

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

.shell {
  position: relative;
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: var(--space-5) 0 var(--space-7);
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: 0 0 var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  width: 42px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background: var(--theme-toggle-bg);
  color: var(--text-strong);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--theme-toggle-bg-hover);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.icon-sun {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: block;
}

html[data-theme="light"] .icon-moon {
  display: none;
}

.top-links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.top-links a {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border: 1px solid rgba(122, 44, 68, 0.65);
  color: var(--text-muted);
  transition: border-color 140ms ease, color 140ms ease;
}

.top-links a:hover {
  color: var(--text-strong);
  border-color: var(--accent-strong);
}

.brand-mark {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sys-labels {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  min-height: calc(100vh - 240px);
  padding: var(--space-6) 0 var(--space-6);
}

.hero-title {
  margin: 0;
  font-family: "Silkscreen", "JetBrains Mono", monospace;
  font-size: clamp(2.4rem, 7.4vw, 5.3rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  text-rendering: geometricPrecision;
  text-shadow: 2px 2px 0 rgba(122, 44, 68, 0.42), 6px 6px 0 rgba(8, 13, 20, 0.85);
}

.hero-subtitle,
.hero-subline {
  margin: 0;
  font-size: clamp(0.78rem, 1.4vw, 1rem);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.hero-name {
  font-family: "Silkscreen", "JetBrains Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-divider {
  color: rgba(122, 44, 68, 0.82);
}

.hero-role {
  margin: 4px 0 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hero-role-inline {
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-copy {
  width: auto;
  max-width: none;
  margin: var(--space-4) auto 0;
  font-size: 1.02rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hero-actions {
  margin-top: var(--space-4);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 var(--space-4);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.btn-primary {
  border: 1px solid var(--accent-2);
  background: var(--btn-primary-bg);
  color: var(--text-strong);
}

.btn-primary:hover {
  border-color: var(--accent-strong);
  background: var(--btn-primary-bg-hover);
}

.btn-link {
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
}

.btn-link:hover {
  color: var(--text-strong);
  border-bottom-color: var(--accent);
}

.social-icons,
.footer-icons {
  margin-top: var(--space-5);
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.social-icons {
  margin-top: 0;
  padding-top: 0;
  position: absolute;
  left: 50%;
  bottom: var(--space-3);
  transform: translateX(-50%);
}

.icon-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  overflow: hidden;
  color: var(--text-muted);
  border: 1px solid rgba(122, 44, 68, 0.75);
  transition: border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.icon-link svg {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px;
  min-height: 17px;
  max-width: 17px;
  max-height: 17px;
  display: block;
  flex: 0 0 17px;
  fill: currentColor;
}

.icon-link:hover {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  background: var(--hover-bg);
  transform: translateY(-1px);
}

.section-block {
  margin-top: var(--space-7);
}

.section-head {
  margin-bottom: var(--space-4);
}

.section-title {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.section-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.system-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.system-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  padding: var(--space-5);
  min-height: 380px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.system-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.system-title {
  margin: 0;
  font-size: 1.36rem;
  letter-spacing: 0.02em;
}

.system-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.97rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid rgba(119, 145, 179, 0.34);
  padding: 4px 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.meta-list {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
}

.meta-key {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-value {
  color: var(--text-strong);
  text-align: right;
}

.lifecycle-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.section-copy {
  margin: var(--space-4) 0 0;
  max-width: 880px;
  color: var(--text-muted);
}

.about-list {
  margin: var(--space-3) 0 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.about-list li {
  margin: 4px 0;
}

.site-footer {
  margin-top: var(--space-7);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.footer-left {
  margin: 0;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-icons {
  margin-top: 0;
  justify-content: flex-end;
}

.footer-note {
  margin: var(--space-3) 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.price-live {
  color: var(--accent-strong);
  font-weight: 700;
  transition: color 140ms ease;
}

.price-up {
  color: var(--success);
}

.price-down {
  color: var(--danger);
}

.price-flat {
  color: var(--text-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--text-muted);
}

.badge-live {
  color: var(--success);
}

.badge-live::before {
  background: var(--success);
}

.badge-degraded {
  color: var(--warn);
}

.badge-degraded::before {
  background: var(--warn);
}

.badge-cold,
.badge-offline {
  color: var(--danger);
}

.badge-cold::before,
.badge-offline::before {
  background: var(--danger);
}

.mini-chart {
  margin-top: var(--space-2);
  height: 42px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.mini-bar {
  width: 8px;
  background: linear-gradient(180deg, rgba(108, 232, 248, 0.95), rgba(61, 145, 235, 0.78));
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.page-title {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: clamp(1rem, 2.8vw, 1.4rem);
}

.back-link {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.back-link:hover {
  color: var(--accent-strong);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-3);
}

.panel {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  padding: var(--space-3);
}

.kpi {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--accent-strong);
  margin: 6px 0;
}

.kpi-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: "JetBrains Mono", monospace;
}

.status {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.status-live {
  color: var(--success);
}

.status-reconnect {
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

.chart-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.agg-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.agg-control select {
  background: var(--bg-elev-1);
  color: var(--text-strong);
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 5px 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}

.chart-shell {
  width: 100%;
  height: 360px;
  background: var(--surface-chart);
  border: 1px solid var(--border-subtle);
}

.market-page {
  height: 100vh;
  overflow: hidden;
}

.market-page .shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 0 14px;
}

.market-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-3);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.metric-card {
  min-height: 94px;
}

.metric-value {
  margin-top: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1rem, 2vw, 1.55rem);
  color: var(--accent-strong);
}

.metric-value-muted {
  color: var(--text-strong);
}

.metric-sub {
  margin-top: 2px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.market-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr);
  gap: var(--space-3);
}

.reddit-page {
  min-height: 100vh;
  overflow-x: auto;
  overflow-y: auto;
}

.reddit-page .shell {
  width: min(1380px, 98vw);
  min-height: 100vh;
  padding: 16px 0 14px;
}

.reddit-layout {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: var(--space-3);
}

.reddit-controls-panel {
  padding: var(--space-2) var(--space-3);
}

.reddit-controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  align-items: end;
}

.reddit-controls-grid .agg-control {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.reddit-controls-grid select,
.reddit-input {
  width: 100%;
}

.reddit-input {
  background: var(--bg-elev-1);
  color: var(--text-strong);
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 5px 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}

.toggle-control {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.reddit-controls-grid .toggle-control {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}

.toggle-control input {
  accent-color: var(--accent);
}

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

.reddit-main {
  min-height: 420px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-3);
}

.reddit-charts-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  min-width: 0;
}

.reddit-chart-panel {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.reddit-series-shell,
.reddit-compass-shell {
  height: 220px;
}

.reddit-compass-shell {
  background: var(--surface-chart-alt);
}

.metric-value-small {
  font-size: 0.9rem;
  margin-top: 10px;
  line-height: 1.4;
}

.sentiment-gauge {
  position: relative;
  margin-top: 8px;
  height: 14px;
  border: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.sentiment-gauge-neg {
  background: rgba(255, 111, 135, 0.24);
}

.sentiment-gauge-pos {
  background: rgba(87, 211, 144, 0.24);
}

.sentiment-gauge-marker {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 2px;
  height: 18px;
  background: var(--accent-strong);
  transform: translateX(-50%);
}

.split-labels {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.split-positive {
  color: var(--success);
}

.split-negative {
  color: var(--danger);
}

.split-bar {
  margin-top: 7px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.split-positive-fill,
.split-negative-fill {
  height: 8px;
}

.split-positive-fill {
  background: var(--success);
  justify-self: start;
}

.split-negative-fill {
  background: var(--danger);
  justify-self: start;
}

.sentiment-positive {
  color: var(--success);
}

.sentiment-negative {
  color: var(--danger);
}

.sentiment-neutral {
  color: var(--text-strong);
}

.reddit-feed-panel {
  min-height: 250px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.reddit-feed-lane {
  margin-top: 10px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  padding: 2px 2px 8px;
}

.reddit-feed-card {
  border: 1px solid var(--border-subtle);
  background: var(--surface-feed);
  color: var(--text-strong);
  padding: 10px;
  width: 290px;
  min-width: 290px;
  min-height: 180px;
  animation: cardSlideIn 180ms ease;
}

.reddit-feed-card.sentiment-positive {
  border-color: rgba(87, 211, 144, 0.35);
}

.reddit-feed-card.sentiment-negative {
  border-color: rgba(255, 111, 135, 0.4);
}

.reddit-feed-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.reddit-feed-title {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.reddit-feed-body {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
  max-height: 70px;
  overflow: hidden;
}

.reddit-feed-metrics {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reddit-chip {
  border: 1px solid var(--border-subtle);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
}

.reddit-feed-tail {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.reddit-feed-tail a {
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#reddit-series-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#reddit-compass-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-toolbar {
  min-width: 0;
}

.chart-toolbar .metric-sub {
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.reddit-layout,
.reddit-main,
.reddit-charts-row,
.reddit-chart-panel,
.reddit-feed-panel,
.chart-shell {
  min-width: 0;
}

@media (max-width: 1200px) {
  .reddit-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chart-panel,
.trades-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.market-page .chart-shell {
  flex: 1;
  min-height: 0;
  height: auto;
}

.trades-panel .table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.trades-panel table {
  font-size: 0.73rem;
}

.trades-panel th,
.trades-panel td {
  padding: 7px 5px;
}

.metric-positive {
  color: var(--success);
}

.metric-negative {
  color: var(--danger);
}

#tick-candles-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(119, 145, 179, 0.2);
  white-space: nowrap;
}

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

.col-4 {
  grid-column: span 4;
}

.col-8 {
  grid-column: span 8;
}

.col-12 {
  grid-column: span 12;
}

.about-page .shell {
  padding-top: var(--space-5);
}

.about-page-head {
  margin-top: var(--space-4);
  margin-bottom: var(--space-5);
  align-items: flex-end;
}

.about-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.about-title {
  max-width: 760px;
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  line-height: 1.12;
}

.about-grid {
  row-gap: var(--space-4);
}

.about-intro-panel,
.about-side-panel,
.about-wide-panel,
.about-system-panel,
.about-research-panel,
.about-philosophy-panel,
.about-stack-panel {
  padding: var(--space-5);
}

.about-lead {
  margin: 12px 0 0;
  max-width: 15ch;
  font-family: "Silkscreen", "JetBrains Mono", monospace;
  font-size: clamp(1.3rem, 3.2vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.about-copy,
.about-now-copy,
.about-system-line,
.about-stack-item p,
.about-mini-list p {
  margin: 0;
  max-width: 68ch;
  color: var(--text-muted);
}

.about-copy {
  margin-top: 14px;
}

.about-copy-tight {
  max-width: 70ch;
}

.about-chip-list {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  color: var(--text-strong);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.about-divider {
  margin: var(--space-4) 0;
  height: 1px;
  background: var(--border-subtle);
}

.about-mini-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.about-section-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  max-width: 48ch;
}

.about-toolbar {
  margin-bottom: var(--space-4);
}

.about-now-grid,
.about-stack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.about-now-item,
.about-stack-item,
.about-research-item {
  display: grid;
  gap: 10px;
}

.about-now-title,
.about-stack-label,
.about-research-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-strong);
}

.about-card-title {
  margin: 14px 0 14px;
  font-size: 1.22rem;
  line-height: 1.2;
}

.about-system-panel {
  display: grid;
  gap: 12px;
}

.about-system-line strong {
  color: var(--text-strong);
  display: block;
  margin-bottom: 4px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.about-link-row {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.about-research-list {
  margin-top: var(--space-4);
  display: grid;
  gap: var(--space-4);
}

.about-quote {
  margin: 16px 0 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--accent-2);
  color: var(--text-strong);
  font-size: 0.94rem;
  line-height: 1.75;
}

@media (max-width: 980px) {
  .system-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    width: min(660px, 100%);
    max-width: 100%;
    white-space: normal;
  }

  .about-now-grid,
  .about-stack-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .col-4,
  .col-8,
  .col-12 {
    grid-column: span 12;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-icons {
    justify-content: flex-start;
  }

  .market-page {
    height: auto;
    overflow: auto;
  }

  .market-page .shell {
    height: auto;
    display: block;
    padding: var(--space-5) 0 var(--space-6);
  }

  .market-layout {
    display: block;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: var(--space-3);
  }

  .market-main {
    grid-template-columns: 1fr;
  }

  .reddit-page {
    height: auto;
    overflow: auto;
  }

  .reddit-page .shell {
    width: min(1320px, 98vw);
    min-height: auto;
    padding: var(--space-5) 0 var(--space-6);
  }

  .reddit-layout {
    display: block;
    min-height: auto;
  }

  .reddit-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: var(--space-3);
  }

  .reddit-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: var(--space-3);
  }

  .reddit-main {
    grid-template-rows: auto auto;
  }

  .reddit-charts-row {
    grid-template-columns: 1fr;
  }

  .reddit-series-shell,
  .reddit-compass-shell {
    height: 200px;
  }

  .hero-subline {
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav-right {
    width: 100%;
    justify-content: space-between;
  }

  .sys-labels {
    justify-content: flex-start;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .hero {
    min-height: 72vh;
    text-align: left;
    padding-top: var(--space-6);
    align-items: flex-start;
  }

  .hero-copy {
    margin-left: 0;
  }

  .hero-actions,
  .social-icons {
    justify-content: flex-start;
  }

  .hero-subline {
    justify-content: flex-start;
    gap: 6px;
  }

  .social-icons {
    position: static;
    transform: none;
    margin-top: var(--space-5);
  }

  .meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta-value {
    text-align: left;
  }

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

  .reddit-metrics-grid {
    grid-template-columns: 1fr;
  }

  .reddit-controls-grid {
    grid-template-columns: 1fr;
  }

  .reddit-feed-card {
    width: 260px;
    min-width: 260px;
  }

  .about-intro-panel,
  .about-side-panel,
  .about-wide-panel,
  .about-system-panel,
  .about-research-panel,
  .about-philosophy-panel,
  .about-stack-panel {
    padding: var(--space-4);
  }

  .about-lead {
    max-width: none;
  }
}
