/* Copied from crates/web/style.css by crates/core/tests/site_demos.rs: do not edit. */

/* ---- Graphs ------------------------------------------------------------- */

/* One colour per line of a graph. The same class colours the curve, its
   entry in the legend, and the line on the page while the two are tied. */
.curve-0 { --curve: #2f6fde; }
.curve-1 { --curve: #d9480f; }
.curve-2 { --curve: #2b8a3e; }
.curve-3 { --curve: #9c36b5; }
.curve-4 { --curve: #0b7285; }
.curve-5 { --curve: #c2255c; }
@media (prefers-color-scheme: dark) {
  .curve-0 { --curve: #6ea2ff; }
  .curve-1 { --curve: #ffa94d; }
  .curve-2 { --curve: #8ce99a; }
  .curve-3 { --curve: #e599f7; }
  .curve-4 { --curve: #66d9e8; }
  .curve-5 { --curve: #faa2c1; }
}

/* A graph fills the width it has. The picture is drawn at that width, so
   its text and lines keep their size. */
.line.graph figure {
  flex: 1;
  min-width: 0;
  margin: 4px 0;
}
/* The picture, with a button to fill the screen that shows on hover and
   while the cursor is on the graph as a whole. */
.plot-box {
  position: relative;
  border-radius: 4px;
}
.plot-box.selected {
  outline: 1.5px solid color-mix(in srgb, var(--accent) 90%, transparent);
  outline-offset: 2px;
}
.graph-open {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms;
}
.line.graph:hover .graph-open,
.plot-box.selected .graph-open,
.graph-open:focus-visible {
  opacity: 1;
}
.graph-open:hover {
  color: var(--ink);
}
.graph-open svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.line.graph .plot svg {
  display: block;
  width: 100%;
  height: auto;
}
.line.graph figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding: 2px 0 0 46px;
  color: var(--muted);
  font-size: 13px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 6px 1px 4px;
  border-radius: 4px;
  color: var(--ink);
}
.legend .swatch {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--curve);
}
.legend li.off {
  opacity: 0.45;
  text-decoration: line-through;
}
.legend .problem {
  color: var(--warn);
  font-size: 12px;
}
.legend .problem:empty {
  display: none;
}
/* The line of the graph the cursor is on. */
.line.graph.active .legend li.current {
  background: color-mix(in srgb, var(--curve) 16%, transparent);
  outline: 1.5px solid color-mix(in srgb, var(--curve) 80%, transparent);
}

.graph-frame {
  fill: var(--panel);
  stroke: var(--rule);
}
.graph-grid {
  stroke: var(--rule);
  stroke-width: 1;
}
.graph-axis {
  stroke: var(--muted);
  stroke-width: 1.2;
}
.graph-label,
.graph-name,
.graph-point-label {
  fill: var(--muted);
  font: 11px var(--ui);
}
.graph-name {
  font-style: italic;
  font-size: 13px;
}
.graph-curve {
  fill: none;
  stroke: var(--curve, var(--accent));
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.line.graph.active .graph-curve.current {
  stroke-width: 3;
}
.graph-curve.dashed {
  stroke-dasharray: 7 5;
}
.graph-region {
  fill: var(--curve);
  fill-opacity: 0.16;
  stroke: none;
}
/* Where a curve runs off the page. */
.graph-pole {
  stroke: var(--curve);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.7;
}
.graph-point.dot {
  fill: var(--curve);
  stroke: var(--panel);
  stroke-width: 1.5;
}
/* A point that is missing from its curve. */
.graph-point.open {
  fill: var(--panel);
  stroke: var(--curve);
  stroke-width: 2;
}
.graph-point-label {
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 3px;
}

/* A graph filling the window: a panel of its expressions beside the
   picture. The bar at the bottom stays in view. */
.pane .line.graph.full {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: block;
  margin: 0;
  /* Room for the bar, which sits above the graph, so that nothing on the
     page shows between the two. */
  padding: 0 0 44px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}
.line.graph.full .mark {
  display: none;
}
.graph-minor {
  stroke: var(--rule);
  stroke-width: 0.6;
  opacity: 0.55;
}

.gl {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 100%;
  font-family: var(--ui);
}
.gl h2,
.gl h3 {
  margin: 0;
  font-weight: 600;
}
.gl kbd {
  font: 11px var(--mono);
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
}

/* The panel. */
.gl-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--rule);
}
.gl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
}
.gl-head h2 {
  color: var(--ink);
  font-size: 15px;
}
.gl-side section {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
}
.gl-side h3 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* One row per expression. */
.gl-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.gl-row {
  display: grid;
  grid-template-columns: 22px 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 14px 6px 10px;
  border-bottom: 1px solid var(--rule);
  box-shadow: inset 3px 0 0 transparent;
  cursor: pointer;
}
.gl-row:hover {
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.gl-row.current {
  background: color-mix(in srgb, var(--curve) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--curve);
}
.gl-row.editing {
  box-shadow: inset 3px 0 0 var(--pending);
}
.gl-index {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.gl-dot {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2.5px solid var(--curve);
  border-radius: 50%;
  background: var(--curve);
  cursor: pointer;
}
.gl-row.off .gl-dot {
  background: transparent;
}
.gl-row.off .gl-formula {
  opacity: 0.45;
}
.gl-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  color: var(--ink);
  font-size: 15px;
}
.gl-text .problem {
  color: var(--warn);
  font-size: 12px;
}
.gl-text .problem:empty {
  display: none;
}
.gl-new {
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 40px;
  color: var(--muted);
}
.gl-new .gl-text {
  color: var(--muted);
  font-size: 13px;
}

/* Sliders for the other letters. */
.gl-slider {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font: 13px var(--mono);
  color: var(--muted);
}
.gl-slider.set {
  color: var(--ink);
}
.gl-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gl-slider input {
  width: 100%;
  accent-color: var(--accent);
}

/* The keys that work here. */
.gl-keys ul {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 5px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--muted);
}
.gl-keys li {
  display: contents;
}
.gl-keys kbd {
  justify-self: start;
}

/* The picture fills the rest, exactly: its size is reported to the
   editor. */
.gl-plot {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.gl-plot .plot,
.gl-plot .plot svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.gl-plot .graph-frame {
  fill: var(--paper);
  stroke: none;
}
.gl-buttons {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gl-group {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.08);
}
.gl-group button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 17px var(--ui);
  cursor: pointer;
}
.gl-group button + button {
  border-top: 1px solid var(--rule);
}
.gl-group button:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.gl-group button.on {
  color: var(--accent);
}

/* A line tied to the line under the cursor: the lines a graph draws, or
   the graphs that draw a line. */
.line.linked {
  background: color-mix(in srgb, var(--curve) 9%, transparent);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--curve) 75%, transparent);
}
.line.linked.current {
  background: color-mix(in srgb, var(--curve) 18%, transparent);
  box-shadow: inset 4px 0 0 var(--curve);
}

/* ---- Figures ------------------------------------------------------------ */

/* A figure is drawn at its own size, never stretched: text keeps its size
   whatever the width of the pane. */
.line.figure .fig-box {
  flex: 1;
  min-width: 0;
  margin: 4px 0;
}
/* Figures sit in the middle of their pane, the way a book sets them. */
.fig {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  font-family: var(--ui);
}
.fig-error {
  color: var(--warn);
  font: 13px var(--ui);
}
/* A drawing: shapes at coordinates, in the page's ink unless coloured. */
.fig-draw .draw-stroke {
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fig-draw .draw-stroke.painted {
  stroke: var(--curve, var(--paint));
}
.fig-draw .draw-fill > * {
  fill: color-mix(in srgb, var(--curve, var(--paint, var(--accent))) 22%, transparent);
}
.fig-draw .draw-grid {
  stroke: var(--rule);
  stroke-width: 0.8;
}
.fig-draw .draw-head {
  fill: context-stroke;
}
.fig-draw .draw-math {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ink);
  font-size: 15px;
}
.fig-draw .draw-math.draw-start {
  justify-content: flex-start;
}
.fig-draw .draw-math.draw-end {
  justify-content: flex-end;
}

.fig-shape {
  fill: color-mix(in srgb, var(--accent) 8%, transparent);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.fig-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
}
.fig-line.dashed {
  stroke-dasharray: 5 4;
}
.fig-mark {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
}
.fig-name {
  fill: var(--ink);
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
}
.fig-angle {
  fill: var(--accent);
  font-size: 12px;
}
.fig-label,
.fig-value {
  fill: var(--muted);
  font-size: 12px;
}
.fig-value {
  fill: var(--ink);
  font-weight: 600;
}
/* Long division is set in the type of the mathematics. */
.fig-division-text {
  fill: var(--ink);
  font-family: KaTeX_Main, "Times New Roman", serif;
  font-size: 17px;
}
.fig-title {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.fig-edge,
.fig-axis,
.fig-tick {
  stroke: var(--muted);
  stroke-width: 1.4;
}
.fig-arrow {
  fill: var(--muted);
}
.fig-grid {
  stroke: var(--rule);
  stroke-width: 1;
}
/* Parts coloured by kind take the colour of their curve-N class, the same
   colours a graph uses for its lines. */
.fig-node,
.fig-key,
.fig-bar,
.fig-dot {
  fill: var(--curve);
}
.fig-node {
  fill: color-mix(in srgb, var(--curve) 22%, var(--panel));
  stroke: var(--curve);
  stroke-width: 1.6;
}
.fig-plain .fig-node,
.fig-node.fig-plain {
  fill: var(--panel);
  stroke: var(--muted);
}
.fig-node-label {
  fill: var(--ink);
  font-size: 13px;
}
.fig-open {
  fill: var(--panel);
  stroke: var(--curve, var(--ink));
  stroke-width: 2.2;
}
.fig-number-line .fig-dot {
  stroke: var(--panel);
  stroke-width: 1.5;
}
.fig-range {
  stroke: var(--curve);
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.75;
}
.fig-series {
  fill: none;
  stroke: var(--curve);
  stroke-width: 2.2;
  stroke-linejoin: round;
}
/* Words in a series are written, not outlined. */
.fig-series text {
  stroke: none;
}

/* Tables: headings tinted, entries plain. */
.fig-head,
.fig-cell {
  stroke: var(--rule);
  stroke-width: 1;
}
.fig-head {
  fill: color-mix(in srgb, var(--accent) 10%, var(--panel));
}
.fig-cell {
  fill: var(--panel);
}
.fig-head-text,
.fig-cell-text {
  fill: var(--ink);
  font-size: 13px;
  pointer-events: none;
}
.fig-head-text {
  font-weight: 600;
  font-style: italic;
}
/* Pie charts. */
.fig-wedge {
  fill: var(--curve);
  stroke: var(--panel);
  stroke-width: 2;
}
.fig-share {
  fill: #fff;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
/* Venn diagrams: each region is opaque, so a smaller one drawn over a
   bigger one shows its own shading. */
.fig-region {
  fill: var(--panel);
}
.fig-shaded .fig-region {
  fill: color-mix(in srgb, var(--accent) 28%, var(--panel));
}
rect.fig-region {
  stroke: var(--muted);
  stroke-width: 1.4;
}
.fig-set {
  fill: none;
  stroke: var(--curve);
  stroke-width: 2.2;
  pointer-events: none;
}
.fig-set-name {
  fill: var(--curve);
  font-size: 14px;
  font-weight: 600;
}
.fig-venn-label {
  pointer-events: none;
}
/* Scatter plots and vectors. */
.fig-axis-name {
  fill: var(--ink);
  font-size: 12px;
}
.fig-fit {
  stroke: var(--ink);
  opacity: 0.7;
  stroke-width: 1.8;
  stroke-dasharray: 6 4;
}
.fig-fit-text {
  fill: var(--muted);
  font-size: 12px;
  font-style: italic;
}
.fig-vector {
  stroke: var(--curve);
  stroke-width: 2.4;
  stroke-linecap: round;
}
.fig-vector-tip {
  fill: var(--curve);
}
.fig-vector-name {
  fill: var(--curve);
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
}
.fig-again {
  opacity: 0.55;
  pointer-events: none;
}
.fig-again .fig-vector {
  stroke-dasharray: 5 4;
}
.fig-sum {
  --curve: var(--ink);
  pointer-events: none;
}

/* ---- Editing figures ---------------------------------------------------- */

/* Each part of a figure can be clicked to pick it. Thin parts get a wide,
   unseen line or spot to click. */
.fig-part {
  cursor: pointer;
}
.fig-hit {
  fill: transparent;
}
.fig-hit-line {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  stroke-linecap: round;
}
.fig-part:hover .fig-hit,
.fig-part.selected .fig-hit {
  fill: color-mix(in srgb, var(--accent) 16%, transparent);
}
.fig-part:hover .fig-hit-line {
  stroke: color-mix(in srgb, var(--accent) 12%, transparent);
}
.fig-part.selected .fig-hit-line {
  stroke: color-mix(in srgb, var(--accent) 24%, transparent);
}
.fig-tree-node:hover .fig-node {
  stroke-width: 2.4;
}
.fig-part.selected .fig-node {
  stroke: var(--accent);
  stroke-width: 3;
}
.fig-part.selected .fig-bar,
.fig-part:hover .fig-bar {
  stroke: var(--ink);
  stroke-width: 2;
}
.fig-part.selected .fig-bar {
  stroke-width: 3;
}
.fig-part.selected .fig-series {
  stroke-width: 4;
}
.fig-part.selected .fig-dot,
.fig-part.selected .fig-open {
  stroke: var(--accent);
  stroke-width: 3;
}
.fig-part.selected .fig-range {
  stroke-width: 8;
  opacity: 1;
}
.fig-part.selected .fig-head,
.fig-part.selected .fig-cell {
  fill: color-mix(in srgb, var(--accent) 24%, var(--panel));
  stroke: var(--accent);
  stroke-width: 2;
}
.fig-part:hover .fig-cell,
.fig-part:hover .fig-head {
  stroke: var(--accent);
}
.fig-part.selected .fig-wedge,
.fig-part:hover .fig-wedge {
  stroke: var(--ink);
}
.fig-venn-region:hover .fig-region {
  fill: color-mix(in srgb, var(--accent) 10%, var(--panel));
}
.fig-shaded.fig-venn-region:hover .fig-region {
  fill: color-mix(in srgb, var(--accent) 36%, var(--panel));
}
.fig-part.selected .fig-region {
  fill: color-mix(in srgb, var(--accent) 18%, var(--panel));
  stroke: var(--accent);
  stroke-width: 3;
}
.fig-shaded.fig-part.selected .fig-region {
  fill: color-mix(in srgb, var(--accent) 40%, var(--panel));
}
.fig-part.selected .fig-set {
  stroke-width: 4;
}
.fig-part.selected .fig-vector {
  stroke-width: 4;
}
/* The + under a node of a tree, shown while the pointer is on the node. */
.fig-add {
  opacity: 0;
  transition: opacity 120ms;
  cursor: pointer;
}
.fig-add circle {
  fill: var(--panel);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.fig-add text {
  fill: var(--accent);
  font-size: 15px;
  font-weight: 700;
}
.fig-part:hover .fig-add,
.fig-part.selected .fig-add {
  opacity: 1;
}
.fig-add:hover circle {
  fill: color-mix(in srgb, var(--accent) 18%, var(--panel));
}

/* The panel under a figure the cursor is on. */
.line.figure {
  flex-wrap: wrap;
}
.fig-inspector {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 14px;
  margin: 2px 0 6px 1.3em;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--panel);
  font: 12px var(--ui);
  cursor: default;
}
.fig-inspector-title {
  align-self: center;
  color: var(--ink);
  font-weight: 600;
}
.fig-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
}
.fig-field input[type="text"] {
  width: 12em;
  padding: 4px 7px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font: 13px var(--ui);
}
.fig-field input:focus {
  outline: 1.5px solid var(--accent);
  outline-offset: 0;
}
.fig-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 5px 0;
  accent-color: var(--accent);
}
.fig-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.fig-actions button {
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: 12px var(--ui);
  cursor: pointer;
}
.fig-actions button:hover {
  border-color: var(--accent);
}
.fig-actions button.danger {
  color: var(--bad);
}

/* The grid of the matrix the cursor is in. */
.matrix-panel {
  align-items: center;
}
/* The grid of the matrix the cursor is in is drawn once for the page and
   placed over the room its line keeps for it. */
.matrix-overlay {
  position: absolute;
  z-index: 15;
}
.matrix-slot {
  flex-basis: 100%;
  margin: 2px 0 6px 1.3em;
}
.matrix-overlay .fig-inspector {
  margin: 0;
}

.matrix-grid {
  border-collapse: separate;
  border-spacing: 4px;
  border-left: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  border-radius: 4px;
}
.matrix-grid input {
  width: 6em;
  padding: 4px 6px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font: 13px var(--mono);
  text-align: center;
}
.matrix-grid input:focus {
  outline: 1.5px solid var(--accent);
}
.matrix-grid td.current input {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--rule));
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
}

