:root {
  color-scheme: light;
  --bg: #f5f3ed;
  --ink: #14140f;
  --muted: #6f6a5e;
  --line: #d9d3c6;
  --panel: #fffdf7;
  --accent: #0a7f68;
  --accent-2: #b6462c;
  --shadow: 0 22px 60px rgba(50, 43, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(10, 127, 104, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(182, 70, 44, 0.08), transparent 30%),
    var(--bg);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

button,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.topbar,
.panel-head,
.api-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  min-height: 104px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 760;
}

h2 {
  font-size: 27px;
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

select,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.86);
  color: var(--ink);
  padding: 0 13px;
}

button {
  cursor: pointer;
  background: var(--ink);
  color: #fffdf7;
}

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

.metric,
.panel,
.api-band {
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.88);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 132px;
  padding: 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.metric strong {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel {
  min-width: 0;
  border-radius: 8px;
  padding: 20px;
}

.pill {
  flex: 0 0 auto;
  border: 1px solid rgba(10, 127, 104, 0.28);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(10, 127, 104, 0.08);
  padding: 8px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.chart-wrap {
  width: 100%;
  aspect-ratio: 16 / 8;
  min-height: 260px;
  margin-top: 20px;
}

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

.api-band {
  margin-top: 18px;
  border-radius: 8px;
  padding: 18px 20px;
}

.api-band code {
  max-width: 710px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7efe1;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

@media (max-width: 860px) {
  .topbar,
  .api-band {
    align-items: stretch;
    flex-direction: column;
  }

  .filters,
  .board {
    grid-template-columns: 1fr;
  }

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

  .filters {
    display: grid;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

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

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