:root {
  color-scheme: dark;
  --bg: #101210;
  --panel: #171b18;
  --panel-2: #1f251f;
  --ink: #f3f0e7;
  --muted: #a8aa9f;
  --line: #33382f;
  --green: #8fd16a;
  --red: #ff6f59;
  --amber: #d9b44a;
  --cyan: #62c9bf;
  --paper: #e7dfc8;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Avenir Next, ui-sans-serif, system-ui, sans-serif;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(0deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(circle at 72% 8%, rgba(143,209,106,0.16), transparent 34rem),
    radial-gradient(circle at 0% 86%, rgba(217,180,74,0.14), transparent 30rem),
    var(--bg);
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-family: Georgia, Times, serif;
  font-size: clamp(34px, 5vw, 74px);
  line-height: 0.92;
  font-weight: 700;
}

h2 {
  font-size: 15px;
  text-transform: uppercase;
  color: var(--paper);
}

.status-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.doc-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(217,180,74,0.55);
  border-radius: 999px;
  color: var(--paper);
  background: rgba(217,180,74,0.12);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.doc-button:hover {
  border-color: rgba(217,180,74,0.9);
  background: rgba(217,180,74,0.2);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0,0,0,0.2);
  font-size: 12px;
  font-weight: 700;
}

.pill.good {
  color: var(--green);
  border-color: rgba(143,209,106,0.45);
}

.pill.bad {
  color: var(--red);
  border-color: rgba(255,111,89,0.45);
}

.ticker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(16,18,16,0.78);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.ticker div {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.ticker div:last-child {
  border-right: 0;
}

.ticker span,
.label,
.panel-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

.ticker strong {
  display: block;
  margin-top: 7px;
  font-family: Menlo, Consolas, monospace;
  font-size: clamp(18px, 2vw, 28px);
  overflow-wrap: anywhere;
}

.grid,
.tables {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr 0.8fr 0.95fr;
  gap: 14px;
}

.wide {
  margin: 14px 0;
}

.tables {
  grid-template-columns: 1.2fr 1fr;
}

.panel {
  min-width: 0;
  background: linear-gradient(180deg, rgba(31,37,31,0.96), rgba(18,21,18,0.96));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.decision-main {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.decision-main > div {
  min-width: 0;
  background: var(--panel);
  padding: 14px;
}

.decision-main strong {
  display: block;
  margin-top: 8px;
  font-family: Menlo, Consolas, monospace;
  font-size: clamp(17px, 1.25vw, 20px);
  white-space: nowrap;
}

.prob-row {
  padding: 14px 16px 4px;
}

.prob-row > div {
  margin-bottom: 12px;
}

.prob-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.bar {
  height: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  border-radius: 99px;
  overflow: hidden;
}

.bar i {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--amber);
}

.bar.theory i {
  background: var(--cyan);
}

.reason {
  margin: 0;
  padding: 4px 16px 16px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.metrics-list {
  padding: 8px 16px 16px;
}

.metrics-list div,
.filter-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.metrics-list span,
.filter-list span {
  color: var(--muted);
  font-size: 12px;
}

.metrics-list strong,
.filter-list strong {
  font-family: Menlo, Consolas, monospace;
}

.stack {
  padding: 16px;
}

.stack .track {
  height: 34px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
}

.track i {
  display: block;
  min-width: 2px;
}

.legend {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.legend div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-right: 7px;
}

.filter-list {
  padding: 8px 16px 16px;
}

.market-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.market-card {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  background: rgba(0,0,0,0.18);
  overflow: hidden;
}

.market-card.is-live {
  border-color: rgba(143,209,106,0.42);
  box-shadow: inset 0 0 0 1px rgba(143,209,106,0.12);
}

.market-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.market-card-head strong,
.market-card-grid b {
  font-family: Menlo, Consolas, monospace;
}

.market-card-head span,
.market-card-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.market-stack {
  display: flex;
  height: 10px;
  margin: 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(0,0,0,0.25);
  overflow: hidden;
}

.market-stack i {
  min-width: 2px;
}

.market-card-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
  padding: 0 10px 10px;
  align-items: baseline;
}

.market-card-grid b {
  text-align: right;
  font-size: 11px;
  white-space: nowrap;
}

.market-last {
  min-height: 35px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.doc-shell {
  width: min(1120px, calc(100vw - 32px));
}

.doc-topbar {
  align-items: start;
}

.doc-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.doc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 14px;
  margin-bottom: 14px;
}

.doc-panel {
  padding: 18px;
}

.doc-panel h2,
.doc-panel h3 {
  margin: 0 0 12px;
  color: var(--paper);
}

.doc-panel h2 {
  font-family: Georgia, Times, serif;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1;
  text-transform: none;
}

.doc-panel h3 {
  font-size: 15px;
  text-transform: uppercase;
}

.doc-panel p,
.doc-panel li {
  color: #d8d2c4;
  font-size: 15px;
  line-height: 1.65;
}

.doc-panel ul,
.doc-panel ol {
  margin: 0;
  padding-left: 20px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.doc-kpis {
  display: grid;
  gap: 8px;
}

.doc-kpis div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 8px 0;
}

.doc-kpis span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.doc-kpis strong {
  font-family: Menlo, Consolas, monospace;
}

.concept-list {
  display: grid;
  gap: 10px;
}

.concept-item {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  padding: 12px;
  background: rgba(0,0,0,0.14);
}

.concept-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--paper);
}

.concept-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.doc-note {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-align: left;
  font-size: 12px;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: #dedbd0;
  font-family: Menlo, Consolas, monospace;
  white-space: nowrap;
}

td:last-child {
  white-space: normal;
  overflow-wrap: anywhere;
}

.empty {
  display: none;
  padding: 22px 16px;
  color: var(--muted);
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

@media (max-width: 1100px) {
  .ticker {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .market-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .doc-hero,
  .doc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 18px;
  }

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

  .ticker,
  .grid,
  .decision-main {
    grid-template-columns: 1fr;
  }

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

  .ticker div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
