/* Hand-written CSS, no framework and no build step.
   Colours are tokens so the dark variant only redefines values. */
:root {
  --bg: #ffffff;
  --panel: #f7f7f8;
  --border: #e2e2e5;
  --text: #17171a;
  --muted: #6b6b75;
  --accent: #bf5700;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --panel: #1c1c20;
    --border: #2e2e34;
    --text: #ececf0;
    --muted: #9a9aa5;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 650; }

.primary-picker { display: flex; gap: .85rem; flex-wrap: wrap; }

label {
  display: inline-flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
}

select, button {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .4rem .55rem;
  min-width: 8rem;
}

button {
  min-width: 0;
  cursor: pointer;
  font-weight: 600;
  background: var(--panel);
}
button:hover { border-color: var(--muted); }

main { padding: 1.25rem 1.5rem 2rem; max-width: 1180px; margin: 0 auto; }

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.control { display: flex; flex-direction: column; gap: .35rem; }
.control > label { flex-direction: row; }
.compare-row { display: flex; gap: .5rem; flex-wrap: wrap; }

.hint { margin: .1rem 0 0; font-size: .8rem; color: var(--muted); max-width: 46ch; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .25rem 0 1.25rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .3rem .3rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: .85rem;
}
.chip .swatch { width: .7rem; height: .7rem; border-radius: 50%; }
.chip.primary { font-weight: 650; }
.chip button {
  border: 0; background: transparent; padding: 0 .3rem;
  color: var(--muted); font-size: 1rem; line-height: 1;
}
.chip button:hover { color: var(--text); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 .75rem; font-size: .95rem; font-weight: 650; }

.chart { width: 100%; height: 420px; }
.chart-short { height: 300px; }

.table-wrap { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td {
  text-align: right;
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: .78rem;
     text-transform: uppercase; letter-spacing: .03em; }
tr.primary td { font-weight: 700; }

.status { color: var(--muted); font-size: .85rem; min-height: 1.2em; }

footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 2rem;
  color: var(--muted);
  font-size: .82rem;
}
