/* Shared styling for the interactive demos (demos/src/). Colours are variables on
   .qb-demo, so a dark theme only needs to override these. */
.qb-demo {
  --qb-fg: #222; --qb-muted: #777; --qb-grid: #e3e3e3; --qb-axis: #444;
  --qb-bg: #fff; --qb-panel: #f6f7f9; --qb-accent: #1f77b4;
  --qb-c1: #1f77b4; --qb-c2: #d62728; --qb-c3: #2ca02c; --qb-c4: #ff7f0e; --qb-c5: #9467bd;
  display: flex; flex-wrap: wrap; gap: 1.2em; align-items: flex-start;
  color: var(--qb-fg); font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.35; margin: 1em 0;
}
.qb-demo svg { display: block; user-select: none; -webkit-user-select: none; }
.qb-demo svg text { fill: var(--qb-fg); font-family: inherit; }
.qb-demo .qb-plot { flex: 1 1 320px; min-width: 0; max-width: 560px; }
.qb-demo .qb-panel { flex: 0 1 300px; display: flex; flex-direction: column; gap: .55em; }
.qb-demo .grid { stroke: var(--qb-grid); }
.qb-demo .axis { stroke: var(--qb-axis); }
.qb-demo .handle { fill: #fff; stroke-width: 3; cursor: grab; }

.qb-demo .qb-slider { display: grid; grid-template-columns: auto 1fr 3.6em; gap: .5em; align-items: center; }
.qb-demo .qb-slider-name { white-space: nowrap; }
.qb-demo .qb-slider input[type=range] { width: 100%; min-width: 6em; accent-color: var(--qb-accent); }
.qb-demo .qb-slider output { font-family: ui-monospace, monospace; text-align: right; }
.qb-demo .qb-check { display: flex; align-items: center; gap: .3em; cursor: pointer; }
.qb-demo .qb-presets { display: flex; flex-wrap: wrap; gap: .35em; }
.qb-demo .qb-btn {
  font: inherit; font-size: .85em; padding: .25em .7em; border-radius: 6px; cursor: pointer;
  border: 1px solid #bbb; background: var(--qb-bg); color: var(--qb-fg);
}
.qb-demo .qb-btn:hover { border-color: var(--qb-accent); }
.qb-demo .qb-btn.active { background: var(--qb-accent); border-color: var(--qb-accent); color: #fff; }
.qb-demo .qb-readout {
  font-family: ui-monospace, monospace; font-size: .9em; white-space: pre-wrap;
  background: var(--qb-panel); border-radius: 6px; padding: .45em .6em;
}
.qb-demo .qb-note { font-size: .85em; color: var(--qb-muted); }
.qb-demo .qb-big { font-size: 1.25em; font-weight: 600; }

/* Inside a reveal.js slide: larger text, no outer margin, fit the content area. */
.reveal .qb-demo { font-size: 22px; margin: .2em 0; text-align: left; }
.reveal .qb-demo .qb-plot { max-width: none; }
.reveal .qb-demo .qb-btn { font-size: .8em; }

@media (max-width: 640px) {
  .qb-demo { flex-direction: column; }
  .qb-demo .qb-panel { flex-basis: auto; width: 100%; }
}
