:root {
  color: #1f2937;
  background: #f6f7f9;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d8dee8;
  display: flex;
  justify-content: space-between;
  padding: 24px clamp(20px, 4vw, 48px);
}

.topbar h1,
.detail h2,
.chart-toolbar h2 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

.label,
.status,
.section-title,
.search-label,
.metrics dt,
.comparison-item small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

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

.sidebar {
  background: #eef2f6;
  border-right: 1px solid #d8dee8;
  padding: 24px;
}

.search {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: block;
  margin-top: 8px;
  padding: 12px 14px;
  width: 100%;
}

.artist-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 28px;
}

.artist-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
}

.artist-row:hover,
.artist-row:focus-visible {
  border-color: #2563eb;
  outline: 0;
}

.artist-row small {
  color: #64748b;
  white-space: nowrap;
}

.main-panel {
  padding: 28px clamp(20px, 4vw, 52px);
}

.detail,
.chart-toolbar,
.comparison {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.detail {
  border-bottom: 1px solid #d8dee8;
  padding-bottom: 24px;
}

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

.metrics div {
  background: #ffffff;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  padding: 14px;
}

.metrics dd {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 0;
}

.chart-toolbar {
  margin-top: 28px;
}

.segmented {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  gap: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

.segmented legend {
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.segmented label {
  cursor: pointer;
  padding: 9px 13px;
}

.segmented input {
  accent-color: #2563eb;
  margin-right: 6px;
}

.comparison {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.comparison-item {
  background: #ffffff;
  border-left: 4px solid var(--series-color);
  border-radius: 6px;
  padding: 14px;
}

.comparison-item span,
.comparison-item strong,
.comparison-item small {
  display: block;
}

.comparison-item strong {
  font-size: 22px;
  margin: 6px 0;
}

.chart {
  background: #ffffff;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  margin-top: 16px;
  min-height: 320px;
  padding: 24px;
}

.chart svg {
  display: block;
  height: auto;
  width: 100%;
}

.chart line {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.chart polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

@media (max-width: 860px) {
  .topbar,
  .detail,
  .chart-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace,
  .metrics,
  .comparison {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
  }
}
