:root {
  color-scheme: light;
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --text: #161a1f;
  --muted: #65707c;
  --line: #d8dde3;
  --accent: #0f766e;
  --accent-strong: #164e63;
  --warn: #b45309;
}

* {
  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;
  letter-spacing: 0;
}

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

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

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

.meta span,
.section-title span,
.market-card__head span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

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

.meta button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.meta button:hover:not(:disabled) {
  border-color: var(--accent);
}

.meta button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.meta .button-secondary {
  background: var(--surface-soft);
  color: var(--muted);
}

.quote-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.quote-strip article,
.panel,
.market-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quote-strip article {
  padding: 18px;
}

.quote-strip span,
dt,
time {
  color: var(--muted);
  font-size: 13px;
}

.quote-strip strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 18px;
}

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

.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
}

.market-card {
  padding: 16px;
  background: var(--surface-soft);
}

.market-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}

.market-card h3 {
  font-size: 16px;
}

.market-card dl,
.metric-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.market-card dl div,
.metric-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dd {
  margin: 0;
  font-weight: 800;
}

.history {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.history article {
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
  padding: 12px 14px;
}

.history strong,
.history span {
  display: block;
  margin-top: 6px;
}

.history span {
  color: var(--muted);
  font-size: 13px;
}

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

  .topbar {
    display: grid;
  }

  .meta {
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 24px, 1380px);
    padding-top: 18px;
  }

  .quote-strip,
  .market-grid,
  .history {
    grid-template-columns: 1fr;
  }
}
