:root {
  color-scheme: dark;
  --bg: #0c1015;
  --panel: #12181f;
  --line: #2a343f;
  --ink: #edf2f6;
  --muted: #94a3b0;
  --dim: #66757f;
  --accent: #f0a93a;
  --accent-soft: #ffd489;
  --cyan: #7fd3e6;
  --amber: #ff8f5e;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-family: "Avenir Next", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px 20px 48px;
  background-color: var(--bg);
  background-image:
    linear-gradient(#f0a93a0a 1px, transparent 1px),
    linear-gradient(90deg, #f0a93a0a 1px, transparent 1px);
  background-size: 36px 36px;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--mono);
}

.shell {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
}

.lead {
  max-width: 700px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.lead code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  background: #111820;
  color: #d9e7f1;
  font-size: 13px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 3px;
  font-size: 13px;
  font-weight: 650;
}

.nav a {
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: #182029;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.nav a[aria-current="page"] {
  border-color: #f0a93a55;
  color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.canvas-card {
  padding: 12px;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #0b1116;
}

.panel {
  padding: 16px;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #ffffff0c;
  font-family: var(--mono);
  font-size: 11px;
}

.metric span:first-child {
  color: var(--dim);
}

.metric span:last-child {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.progress {
  height: 4px;
  margin: 18px 0 2px;
  overflow: hidden;
  background: #202530;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 9px #f0a93a88;
  transition: width 100ms linear;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: #182029;
  color: var(--ink);
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #4a5764;
  background: #1b232c;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #171104;
}

button.primary:hover:not(:disabled) {
  border-color: #ffd489;
  background: #ffd489;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 11px;
  padding: 0 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot,
.line {
  display: inline-block;
  flex: 0 0 auto;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.line {
  width: 18px;
  height: 0;
  border-top: 2px solid currentColor;
}

.line.dashed {
  border-top-style: dashed;
}

.note {
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.note strong {
  color: var(--ink);
}

@media (max-width: 780px) {
  .page-header {
    display: block;
  }

  .nav {
    justify-content: flex-start;
    margin-top: 16px;
  }

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

@media (max-width: 480px) {
  body {
    padding: 24px 14px 36px;
  }

  .lead {
    font-size: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .nav a {
    padding: 7px 9px;
  }

  .canvas-card {
    padding: 8px;
  }

  .panel {
    padding: 14px;
  }
}
