@font-face {
  font-family: "Syne";
  src: url("../../fonts/syne-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("../../fonts/syne-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../../fonts/source-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../../fonts/source-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b0d10;
  --panel: #13171c;
  --line: #2a3138;
  --paper: #eef2f4;
  --dim: #b4bec6;
  --mute: #7d8892;
  --gold: #c9a227;
  --gold-2: #e8c547;
  --input: #fff6d8;
  --ink-text: #161409;
  --green: #6fbf8b;
  --red: #d46757;
  --focus: #e8c547;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.demo-banner {
  background: #1a1f25;
  border-bottom: 1px solid var(--line);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.55rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.demo-banner a { color: var(--paper); text-decoration: none; }

.wrap { width: min(1100px, calc(100% - 2rem)); margin: 2rem auto 3rem; }
h1 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
}
.lede { color: var(--dim); margin: 0 0 1.75rem; max-width: 42rem; }

.grid {
  display: grid;
  grid-template-columns: 22rem 1fr;
  gap: 1rem;
  align-items: start;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.15rem 1.15rem 1.25rem;
}
h2 {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin: 0 0 1rem;
}
label { display: block; font-size: 0.82rem; color: var(--dim); margin: 0 0 0.3rem; }
.field { margin: 0 0 0.8rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
input, select {
  width: 100%;
  background: var(--input);
  color: var(--ink-text);
  border: 1px solid transparent;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.92rem;
  padding: 0.5rem 0.55rem;
}
.hint { font-size: 0.76rem; color: var(--mute); margin: 0.2rem 0 0; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.kpi { border: 1px solid var(--line); padding: 0.7rem 0.75rem; }
.kpi .k { display: block; color: var(--mute); font-size: 0.78rem; margin-bottom: 0.2rem; }
.kpi .v { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 1.05rem; font-weight: 500; }
.kpi .v.up { color: var(--green); }
.kpi .v.down { color: var(--red); }

svg.chart { width: 100%; height: auto; display: block; background: #0e1216; border: 1px solid var(--line); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--mute); margin: 0.45rem 0 1rem; }
.legend i { display: inline-block; width: 0.7rem; height: 2px; margin-right: 0.3rem; vertical-align: middle; }

table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { text-align: right; padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); font-weight: 500; }
td { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.table-wrap { overflow-x: auto; max-height: 22rem; overflow-y: auto; }

.fine { margin-top: 1.5rem; color: var(--mute); font-size: 0.8rem; max-width: 50rem; }

@media (max-width: 860px) {
  .grid, .kpis, .row { grid-template-columns: 1fr; }
}
