:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #66717f;
  --line: #d9e0e7;
  --panel: #ffffff;
  --bg: #f4f7f6;
  --green: #1f8a70;
  --red: #b94747;
  --amber: #b7791f;
  --blue: #2f6f9f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  min-height: 86px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

.mode-badge {
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  color: var(--blue);
  background: #f8fbfd;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 87px);
}

.sidebar {
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.panel-head,
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title span,
.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.candidate-list,
.setup-grid {
  display: grid;
  gap: 12px;
}

.candidate-card,
.setup-card,
.summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.candidate-card {
  width: 100%;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.candidate-card.active {
  border-color: var(--blue);
  box-shadow: inset 4px 0 0 var(--blue);
}

.candidate-symbol {
  font-size: 18px;
  font-weight: 800;
}

.candidate-meta,
.setup-meta,
.summary-grid {
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  padding: 22px 28px 36px;
}

.summary {
  padding: 18px;
  margin-bottom: 22px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 12px;
}

.metric {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 16px;
}

.setup-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.setup-card {
  padding: 16px;
}

.setup-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rating {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.rating.b,
.rating.c {
  background: var(--amber);
}

.rating.d {
  background: var(--red);
}

.setup-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.legs {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.legs th,
.legs td {
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.rationale {
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

