/* The colours and the type of note/4.design/canvas/.
   Every measured value uses the monospaced face, so a value that changes
   width does not move the text beside it. */

:root {
  --ground: #f7f6f2;
  --card: #ffffff;
  --hairline: #dfdcd4;
  --hairline-soft: #efede6;
  --ink: #16181a;
  --body: #3a4044;
  --muted: #5c6266;
  --faint: #8a9095;
  --blank: #c2bfb6;
  --accent: #c0512c;
  --accent-deep: #9e3a1b;
  --reference: #2f5d62;
  --caution-edge: #e4d3a8;
  --caution-fill: #fcf6e6;
  --caution-ink: #6b5314;
  --reject-edge: #e8bdb0;
  --reject-fill: #fcf0ec;
  --reject-ink: #7e3418;
  --ok-edge: #cde3d2;
  --ok-fill: #f1f8f2;
  --ok-ink: #2c5c39;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 40px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
}

h1, h2 { margin: 0; font-weight: 400; }

.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); font-size: 26px; }
.muted { color: var(--faint); }
.note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-header h1 {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: -0.2px;
}

.subtitle { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.chip {
  padding: 7px 13px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.chip-link { display: inline-flex; align-items: center; gap: 7px; }

.dot { width: 7px; height: 7px; border-radius: 999px; background: #a8adb2; }

.chip-link[data-state="connected"],
.chip-link[data-state="receiving"] { border-color: var(--ok-edge); background: var(--ok-fill); color: var(--ok-ink); }
.chip-link[data-state="connected"] .dot,
.chip-link[data-state="receiving"] .dot { background: #3c8a50; }
.chip-link[data-state="error"] { border-color: var(--reject-edge); background: var(--reject-fill); color: var(--reject-ink); }
.chip-link[data-state="error"] .dot { background: var(--accent-deep); }

.banner {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
}

.banner svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke-width: 2; stroke-linecap: round; }

.banner-caution { border: 1px solid var(--caution-edge); background: var(--caution-fill); color: var(--caution-ink); }
.banner-caution svg { stroke: #8a6a1f; }
.banner-reject { border: 1px solid var(--reject-edge); background: var(--reject-fill); color: var(--reject-ink); }
.banner-reject svg { stroke: var(--accent-deep); }

main { display: flex; gap: 32px; flex: 1 1 auto; align-items: stretch; }

.panel {
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--card);
}

.plot-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.column { width: 428px; flex: 0 0 428px; display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1 1 auto; }

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.panel-head h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.panel-head.baseline h2 { font-size: 26px; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--ink); }
.panel-head .note { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--faint); }

.label { font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }

.rule { margin-top: 10px; height: 3px; width: 56px; border-radius: 999px; background: #e4e1d9; }
.rule[data-state="complete"] { background: var(--accent); }
.rule[data-state="rejected"] { background: var(--accent-deep); }

.plot { flex: 1 1 auto; min-height: 420px; }
.plot[hidden] { display: none; }

.empty {
  flex: 1 1 auto;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
}

.empty-title { margin: 0; font-family: var(--serif); font-size: 24px; color: var(--body); }
.empty-body { margin: 0; max-width: 480px; font-size: 14px; color: #6b7075; }

.live { display: flex; gap: 40px; margin: 0; }
.live div { text-align: center; }
.live dt { font-size: 12px; color: var(--muted); order: 2; margin-top: 3px; }
.live dd { margin: 0; font-family: var(--mono); font-size: 24px; color: var(--ink); order: 1; }
.live div { display: flex; flex-direction: column; }

.plot-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend-group { display: flex; align-items: center; gap: 10px; }
.legend-group .mono { font-size: 11px; color: var(--faint); }
.ramp { width: 150px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #f0d9c9, #e5a583, #d97757, #c0512c, #9e3a1b); }
.dash { width: 22px; border-top: 1.5px dashed var(--reference); }

.rows { margin: 12px 0 0; }
.rows div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--hairline-soft); }
.rows div:last-child { border-bottom: none; }
.rows dt { font-size: 14px; color: var(--body); }
.rows dd { margin: 0; font-size: 17px; color: var(--ink); }
.rows dd.blank { color: var(--blank); }

.tiles { margin-top: 12px; display: flex; gap: 12px; }
.tile { flex: 1 1 0; min-width: 0; padding: 12px 14px; border: 1px solid var(--hairline-soft); border-radius: 8px; background: #fcfbf8; }
.tile-value { font-size: 22px; color: var(--ink); }
.tile-value.blank { color: var(--blank); }
.tile-name { margin-top: 3px; font-size: 12px; color: var(--muted); }
.tile-hint { margin-top: 2px; font-size: 11px; color: var(--faint); }

#speed-strip, #live-trace { display: block; max-width: 100%; margin-top: 14px; }
.strip-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }

.saved { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; font-size: 12px; color: var(--muted); }
.saved .mono { color: var(--body); }

[hidden] { display: none !important; }

@media (max-width: 1100px) {
  body { padding: 20px; }
  main { flex-direction: column; }
  .column { width: auto; flex: 1 1 auto; }
}
