:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #f2f4f3;
  --text: #11181d;
  --muted: #69747b;
  --border: #dfe4e1;
  --grid: #edf0ee;
  --green: #24a83d;
  --green-dark: #0f8f2c;
  --red: #bd3d32;
  --blue: #255f91;
  --shadow: 0 16px 40px rgba(27, 39, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 27px;
  line-height: 1.12;
}

h2 {
  font-size: 15px;
  line-height: 1.3;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.metric {
  min-width: 126px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(620px, 3fr);
  min-height: calc(100vh - 79px);
}

.research-panel {
  background: #fbfcfb;
  border-right: 1px solid var(--border);
  overflow: auto;
}

.panel-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.hero-section {
  padding-top: 20px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  color: #243039;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.summary-text,
.patch-list {
  color: #27343b;
  font-size: 13px;
  line-height: 1.45;
}

.patch {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.patch:first-child {
  border-top: 0;
  padding-top: 0;
}

.patch small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.market-panel {
  min-width: 0;
  padding: 18px;
  overflow: auto;
}

.market-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px 24px 14px;
}

.market-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 6px;
}

.asset-name {
  font-size: 13px;
  color: #1f282e;
  margin-bottom: 10px;
}

.asset-price {
  font-size: 36px;
  line-height: 1;
  font-weight: 700;
}

.asset-change {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.asset-change.positive {
  color: var(--green-dark);
}

.asset-change.negative {
  color: var(--red);
}

.range-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #f0f0f2;
  border-radius: 8px;
  flex-wrap: wrap;
}

.range-tabs button {
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7d858a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.range-tabs button.active {
  background: #fff;
  color: #11181d;
  box-shadow: 0 1px 4px rgba(24, 31, 36, 0.16);
}

.chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  min-height: 18px;
}

.canvas-wrap {
  width: 100%;
  aspect-ratio: 1.7 / 1;
  min-height: 360px;
  margin-top: 10px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.forecast-card {
  min-height: 132px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.forecast-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.forecast-card strong {
  display: block;
  font-size: 21px;
  margin-bottom: 6px;
}

.forecast-card span,
.forecast-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

  .research-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 54vh;
  }
}

@media (max-width: 720px) {
  .topbar,
  .market-head,
  .chart-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .market-panel {
    padding: 10px;
  }

  .market-card {
    padding: 14px 12px 10px;
  }

  .asset-price {
    font-size: 31px;
  }

  .canvas-wrap {
    min-height: 300px;
  }

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