/* Widget styles only. Override --jj-* on a host root; viewBoxes stay fixed. */
.jj-widget {
 --jj-fg: #273039; --jj-bg: #fff; --jj-muted: #78828a;
 --jj-c1: #176b87; --jj-c2: #a9435d; --jj-c3: #956013; --jj-c4: #6b5b95;
 --jj-font: sans-serif; --jj-label-size: 1em;
 color: var(--jj-fg); background: var(--jj-bg); font-family: var(--jj-font);
 container-type: inline-size; min-width: 0;
}
.jj-widget {
  font-size: 1em;
}

.jj-widget .tex-fo {
  overflow: visible;
}

.jj-widget .tex-label {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jj-fg);
  line-height: 1;
  white-space: nowrap;
}

.jj-widget .tex-label.start {
  justify-content: flex-start;
}

.jj-widget .tex-label.end {
  justify-content: flex-end;
}

.jj-widget .jj-controls {
  display: flex;
  flex-direction: column;
  gap: 0.55em;
}

.jj-widget .jj-slider {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.6em;
}

.jj-widget .jj-slider input {
  grid-column: 1/span 2;
  width: 100%;
  accent-color: var(--jj-c1);
}

.jj-widget .jj-slider output {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.jj-widget .jj-button {
  align-self: flex-start;
  padding: 0.2em 0.7em;
  border: 1px solid var(--jj-muted);
  border-radius: 0.4em;
  background: var(--jj-bg);
  font: inherit;
  cursor: pointer;
}

.jj-widget .jj-plots {
  display: grid;
  align-items: start;
  gap: 0.6em;
}

.jj-widget .jj-plots.two {
  grid-template-columns: 1fr 1fr;
}

.jj-widget .jj-plots.three {
  grid-template-columns: 0.55fr 1fr 1fr;
}

.jj-widget svg.jj-plot {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.jj-widget .jj-plot .frame {
  fill: none;
  stroke: var(--jj-fg);
  stroke-width: 1.5;
}

.jj-widget .jj-plot .tick {
  stroke: var(--jj-fg);
  stroke-width: 1.5;
}

.jj-widget .jj-plot .guide {
  stroke: var(--jj-muted);
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
}

.jj-widget .jj-plot .series {
  fill: none;
  stroke-width: 3.2;
  stroke-linejoin: round;
}

.jj-widget .jj-plot .series.c1 {
  stroke: var(--jj-c1);
}

.jj-widget .jj-plot .series.c2 {
  stroke: var(--jj-c2);
}

.jj-widget .jj-plot .series.c3 {
  stroke: var(--jj-c1);
}

.jj-widget .jj-plot .series.ref {
  stroke: var(--jj-muted);
  stroke-width: 2.2;
  stroke-dasharray: 7 5;
}

.jj-widget .jj-plot .dot.c1 {
  fill: var(--jj-c1);
}

.jj-widget .jj-plot .dot.c2 {
  fill: var(--jj-c2);
}

.jj-widget .jj-plot .continuum {
  fill: var(--jj-muted);
}

.jj-widget .jj-plot .plot-title .tex-label {
  color: var(--jj-muted);
}

.jj-widget .jj-plot .trail {
  fill: none;
  stroke: var(--jj-c1);
  stroke-width: 2;
  stroke-opacity: 0.35;
}

.jj-widget .jj-plot .dot.live {
  fill: var(--jj-c1);
  stroke: var(--jj-bg);
  stroke-width: 3;
}

.jj-widget .jj-plot .region {
  opacity: 0.12;
}

.jj-widget .jj-plot .region.short {
  fill: var(--jj-c1);
}

.jj-widget .jj-plot .region.long {
  fill: var(--jj-c2);
}

.jj-widget .jj-plot .region.tunnel {
  fill: var(--jj-muted);
}

.jj-widget .jj-plot .region-label .tex-label {
  color: var(--jj-muted);
}

.jj-widget .jj-plot .lead.left {
  fill: var(--jj-c1);
}

.jj-widget .jj-plot .lead.right {
  fill: var(--jj-c2);
}

.jj-widget .jj-plot .lead-left .tex-label {
  color: var(--jj-c1);
}

.jj-widget .jj-plot .lead-right .tex-label {
  color: var(--jj-c2);
}

.jj-widget .jj-plot .normal-site {
  fill: var(--jj-muted);
}

.jj-widget .jj-plot .onsite {
  stroke: var(--jj-c3);
  stroke-width: 3;
}

.jj-widget .jj-plot .guide.delta {
  stroke: var(--jj-c2);
  stroke-dasharray: 4 4;
}

.jj-widget .jj-plot .c1 .tex-label {
  color: var(--jj-c1);
}

.jj-widget .jj-plot .c2 .tex-label {
  color: var(--jj-c2);
}

.jj-widget .jj-plot .level {
  stroke: var(--jj-muted);
  stroke-width: 2.5;
}

.jj-widget .jj-plot .m-conjecture .tex-label {
  color: var(--jj-c3);
}

.jj-widget .jj-plot .sc {
  fill: var(--jj-muted);
}

.jj-widget .jj-plot .sc.right {
  fill: var(--jj-muted);
}

.jj-widget .jj-plot .normal {
  fill: var(--jj-muted);
  stroke: var(--jj-muted);
  stroke-width: 1.5;
}

.jj-widget .jj-plot .region-label {
  font-size: 34px;
  font-weight: 600;
  fill: var(--jj-fg);
}

.jj-widget .jj-plot .scale {
  stroke: var(--jj-fg);
  stroke-width: 3;
  marker-start: none;
}

.jj-widget .jj-plot .scale.xi {
  stroke: var(--jj-c2);
}

.jj-widget .jj-plot .regime {
  font-size: 36px;
  font-weight: 700;
}

.jj-widget .jj-plot .bond {
  stroke: var(--jj-c1);
  stroke-width: 4;
}

.jj-widget .jj-plot .bond-label .tex-label {
  color: var(--jj-c1);
}

.jj-widget .jj-plot .site {
  fill: var(--jj-bg);
  stroke: var(--jj-c1);
  stroke-width: 3;
}

.jj-widget .jj-plot .site.sc {
  fill: var(--jj-c2);
  stroke: var(--jj-c2);
}

.jj-widget .jj-plot .sc-label .tex-label {
  color: var(--jj-c2);
}

.jj-widget .regime.short {
  color: var(--jj-c1);
  fill: var(--jj-c1);
}

.jj-widget .regime.long {
  color: var(--jj-c2);
  fill: var(--jj-c2);
}

.jj-widget .jj-plot .shortish {
  fill: var(--jj-c1);
  opacity: 0.07;
}

.jj-widget .jj-plot .series.rand { stroke-width: 2.2; stroke-opacity: 0.55; }

.jj-widget .jj-plot .series.bound { fill: none; stroke-width: 2.2; stroke-dasharray: 7 5; }

.jj-widget .jj-plot .series.bound.tunnel,
.jj-widget .jj-plot .series.bound.open { stroke: var(--jj-c1); stroke-opacity: 0.55; }

.jj-widget .jj-plot .series.bound.long { stroke: var(--jj-c2); stroke-opacity: 0.6; }

.jj-widget .tex-fo,
.jj-widget .tex-fo * {
  pointer-events: none;
}

.jj-widget .jj-plot .ann { animation: jj-appear 1s ease 0.2s both; }

.jj-widget .jj-plot .drop-arrow .level { stroke-dasharray: 5 5; stroke-width: 1.5; }

.jj-widget .jj-plot .drop-arrow .shaft { stroke-width: 3; }

.jj-widget .jj-plot .drop-arrow.c1 .level,
.jj-widget .jj-plot .drop-arrow.c1 .shaft { stroke: var(--jj-c1); }

.jj-widget .jj-plot .drop-arrow.c1 .head { fill: var(--jj-c1); }

.jj-widget .jj-plot .drop-arrow.c2 .level,
.jj-widget .jj-plot .drop-arrow.c2 .shaft { stroke: var(--jj-c2); }

.jj-widget .jj-plot .drop-arrow.c2 .head { fill: var(--jj-c2); }

.jj-widget .jj-plot .drop-arrow.c1 .tex-label { color: var(--jj-c1); font-weight: 700; }

.jj-widget .jj-plot .drop-arrow.c2 .tex-label { color: var(--jj-c2); font-weight: 700; }

.jj-widget .jj-plot .series.tail-guide { fill: none; stroke: var(--jj-fg); stroke-width: 2; stroke-dasharray: 3 5; }

.jj-widget .jj-plot .tail-label .tex-label { color: var(--jj-fg); }

.jj-widget .jj-plot .level.harm { stroke: var(--jj-c2); stroke-width: 2; stroke-dasharray: 3 5; stroke-opacity: 0.8; }

.jj-widget .jj-plot .ann-static .ann { animation: none; }

.jj-widget .jj-plot .series.exact { fill: none; stroke: var(--jj-muted); stroke-width: 2; stroke-dasharray: 6 5; }

.jj-widget .jj-plot .pole { stroke: var(--jj-c1); stroke-width: 3; }

.jj-widget .jj-plot .plane-continuum { fill: var(--jj-c1); opacity: 0.25; }

.jj-widget .jj-plot .mats-dots circle { fill: var(--jj-c2); }

.jj-widget .jj-plot .lab-levels .tex-label { color: var(--jj-c1); }

.jj-widget .jj-plot .lab-mats .tex-label { color: var(--jj-c2); }

.jj-widget .twosums-left .jj-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15em;
}

.jj-widget .jj-plot .pole.in { stroke: var(--jj-c1); }

.jj-widget .jj-plot .pole.out { stroke: var(--jj-muted); }

.jj-widget .jj-plot .mats-dots circle.in { fill: var(--jj-c2); stroke: var(--jj-c2); }

.jj-widget .jj-plot .mats-dots circle.out { fill: var(--jj-bg); stroke: var(--jj-c2); stroke-width: 2; }

.jj-widget .jj-controls.row .jj-slider {
  flex: 1;
}

.jj-widget .jj-plot .forbidden { fill: var(--jj-c2); fill-opacity: 0.1; stroke: none; }

.jj-widget .jj-plot .limit-line { stroke: var(--jj-c2); stroke-width: 2; stroke-dasharray: 7 5; }

.jj-widget .forbidden-label .tex-label { color: var(--jj-c2); }

.jj-widget .jj-plot .area-t { fill: var(--jj-c1); fill-opacity: 0.12; stroke: none; }

.jj-widget .jj-plot .area-t2 { fill: var(--jj-c1); fill-opacity: 0.28; stroke: none; }

.jj-widget .jj-plot .series.too-fast { stroke: var(--jj-c2); }

.jj-widget .jj-plot .series.squared { stroke-dasharray: 5 4; }/* Host-neutral layout defaults; material.css supplies this site's layout. */
.jj-widget { padding: .8rem; border: 1px solid var(--jj-muted); border-radius: .3rem; margin: 1rem 0; }
.jj-widget .jj-controls { margin: .5rem 0 1rem; }
.jj-widget .jj-controls.row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.jj-widget .square-sketch { max-width: 250px; margin: auto; }
.jj-widget .jj-button, .jj-widget .host-controls button { color: var(--jj-fg); background: var(--jj-bg); border: 1px solid var(--jj-muted); padding: .35em .65em; border-radius: .25rem; cursor: pointer; font: inherit; }
.jj-widget .host-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.jj-widget [hidden] { display: none !important; }
.jj-widget .katex { font-size: var(--jj-label-size); }
.jj-widget .katex .textsf { font-family: var(--jj-font); }
.jj-widget .jj-plot-frame { min-width: 0; }
.jj-widget input[type="range"]:focus-visible { outline: 2px solid var(--jj-c1); outline-offset: 3px; }
.jj-widget .host-controls button[aria-pressed="true"] { border-color: var(--jj-c1); box-shadow: inset 0 -3px var(--jj-c1); }

/* Fixed legends sit outside SVG coordinates and never follow the curves. */
.jj-widget .jj-plot-panel { min-width: 0; }
.jj-widget .jj-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .8rem; padding: .3rem 0; font-size: 14px; line-height: 1.4; }
.jj-widget .jj-legend-item { display: inline-flex; align-items: center; gap: .35em; }
.jj-widget .jj-legend-swatch { display: inline-block; width: 1.4em; border-top: 2px solid currentColor; }
.jj-widget .jj-legend-item.c1, .jj-widget .jj-legend-item.c3 { color: var(--jj-c1); }
.jj-widget .jj-legend-item.c2, .jj-widget .jj-legend-item.too-fast { color: var(--jj-c2); }
.jj-widget .jj-legend-item.ref, .jj-widget .jj-legend-item.exact { color: var(--jj-muted); }
.jj-widget .jj-legend-item.bound { color: var(--jj-c1); }
.jj-widget .jj-legend-item.long { color: var(--jj-c2); }
.jj-widget .ref .jj-legend-swatch, .jj-widget .exact .jj-legend-swatch,
.jj-widget .squared .jj-legend-swatch, .jj-widget .bound .jj-legend-swatch { border-top-style: dashed; }
.jj-widget .jj-plot .series.bound.open { stroke-dasharray: 2 4; }
.jj-widget .open .jj-legend-swatch { border-top-style: dotted; }
.jj-widget .alpha-readout { display: flex; justify-content: center; align-items: baseline; gap: .7rem; padding: .5rem; }
.jj-widget .alpha-readout .big { font-size: 1.1rem; font-weight: 600; }

.jj-widget .jj-mobile-ylabel { display: none; }
.jj-widget .tail-guide .jj-legend-swatch { border-top-style: dotted; }
