:root {
  color-scheme: dark;
  --bg: var(--crc-bg);
  --panel: var(--crc-panel);
  --panel-2: var(--crc-panel-raised);
  --text: var(--crc-text);
  --muted: var(--crc-muted);
  --line: var(--crc-line);
  --accent: var(--crc-accent);
  --warn: var(--crc-warning);
  --bad: var(--crc-danger);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(23, 27, 34, 0.9), rgba(14, 17, 22, 0) 360px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar,
.productHeader,
.controls,
.assetFilterPanel,
.assetFilters,
.workspace,
.math,
.summary,
.productInfo,
.productFooter {
  border: 1px solid var(--line);
  background: var(--panel);
}

.productHeader {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 8px;
}

.boxLogo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.boxLogoIcon {
  flex: 0 0 auto;
  width: 46px;
  height: 42px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--crc-surface);
}

.boxLogoIcon span {
  display: block;
  border-radius: 999px;
}

.boxLogoIcon span:nth-child(1) {
  background: var(--crc-rainbow-red);
}

.boxLogoIcon span:nth-child(2) {
  background: var(--crc-rainbow-yellow);
}

.boxLogoIcon span:nth-child(3) {
  background: var(--crc-rainbow-teal);
}

.boxLogoIcon span:nth-child(4) {
  background: var(--crc-rainbow-blue);
}

.boxLogoText strong {
  display: block;
  font-size: 16px;
}

.boxLogoText small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.productNav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.productNav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 0 12px;
  text-decoration: none;
  font-size: 13px;
}

.productNav a:hover {
  color: var(--text);
  background: var(--panel-2);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border-radius: 8px 8px 0 0;
}

.brandBlock {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brandMark {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    var(--crc-gradient-brand),
    #10141b;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
}

.dek {
  max-width: 760px;
  margin-top: 10px;
  color: #c5ccd8;
  font-size: 15px;
  line-height: 1.45;
}

h2 {
  font-size: 22px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.statusWrap {
  width: min(360px, 36vw);
}

.status {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.progressTrack {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #10141b;
}

.progressBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--crc-gradient-progress);
  transition: width 180ms ease;
}

.controls {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(140px, 1fr));
  gap: 12px;
  padding: 14px;
  border-top: 0;
}

.assetFilterPanel {
  border-top: 0;
}

.filterToggle {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.filterToggle .toggleIcon {
  width: 24px;
  height: 24px;
  font-size: 18px;
}

.assetFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 14px 12px;
  border-top: 0;
}

.assetFilterPanel.collapsed .assetFilters {
  display: none;
}

.checkControl {
  width: auto;
  min-height: 32px;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #10141b;
  padding: 0 12px;
  cursor: pointer;
}

.checkControl input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #10141b;
  color: var(--text);
  padding: 0 10px;
}

input[type="range"] {
  padding: 0;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-top: 0;
  background: var(--line);
}

.summaryCard {
  padding: 14px;
  background: var(--panel);
}

.summaryCard strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 680px;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.coinList {
  overflow: auto;
  max-height: 780px;
  border-right: 1px solid var(--line);
}

.coinButton {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.coinButton:hover,
.coinButton.active {
  background: var(--panel-2);
}

.coinButton img {
  width: 28px;
  height: 28px;
}

.coinButton strong {
  display: block;
  font-size: 14px;
}

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

.slopeBadge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: rgba(152, 162, 179, 0.14);
  color: var(--muted);
}

.slopeBadge.up {
  background: rgba(107, 213, 179, 0.14);
  color: var(--accent);
}

.slopeBadge.down {
  background: rgba(255, 107, 107, 0.14);
  color: var(--bad);
}

.slopeBadge.flat {
  background: rgba(255, 200, 87, 0.14);
  color: var(--warn);
}

.chartPanel {
  min-width: 0;
  padding: 18px;
}

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

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

.metric {
  min-width: 108px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #10141b;
}

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

.metric strong {
  font-size: 14px;
}

canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080a0e;
}

.math {
  margin-top: 18px;
  border-radius: 8px;
  color: #d8dee8;
}

.mathToggle {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 18px;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.toggleIcon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.mathContent {
  padding: 0 20px 20px;
}

.math.collapsed .mathContent {
  display: none;
}

.math:not(.collapsed) .toggleIcon {
  color: var(--warn);
}

.math p {
  max-width: 980px;
  margin-top: 10px;
  line-height: 1.55;
}

.productInfo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--line);
}

.productInfo > div {
  padding: 18px;
  background: var(--panel);
}

.productInfo p:not(.eyebrow) {
  margin-top: 10px;
  color: #c5ccd8;
  line-height: 1.55;
}

.productFooter {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.productFooter span:first-child {
  color: var(--text);
  font-weight: 700;
}

.footerLogo {
  font-weight: 700;
}

.footerLogo .boxLogoIcon {
  width: 34px;
  height: 30px;
  gap: 3px;
  padding: 6px;
}

code {
  color: #b9f1df;
}

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

  .productHeader,
  .topbar,
  .chartHead,
  .productFooter {
    display: grid;
  }

  .brandBlock {
    align-items: start;
  }

  .status,
  .statusWrap {
    width: 100%;
    text-align: left;
  }

  .coinList {
    max-height: 300px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
