/* LP notes use the shared Tufte typography; this file scopes the interactive study aids. */
.lp-notes {
  --lp-blue:#27618b;
  --lp-green:#35765c;
  --lp-orange:#b06c2d;
  --lp-red:#b04b49;
  --lp-purple:#7857a6;
}
.lp-notes [hidden] { display:none!important; }
.lp-notes .lp-chapter { scroll-margin-top:1.5rem; }
.lp-notes .lp-chapter > math[display="block"] { width:55%; max-width:100%; overflow-x:auto; padding-block:.5rem; }
.lp-math-var { display:inline-block; font-size:1em; vertical-align:-.08em; }

/* Compact source/printing strip. */
.lp-reading-guide { width:min(100%,76rem); margin:0 0 2rem; padding:.8rem 0; border-block:1px solid var(--site-line-soft); }
.lp-reading-guide-head { display:flex; gap:1.25rem; align-items:flex-start; justify-content:space-between; }
.lp-reading-guide-head h2 { margin:.05rem 0 .25rem; font-size:1.15rem; }
.lp-reading-guide-head p { max-width:58rem; margin:.25rem 0; }
.lp-tool-attribution { font-size:.86rem; line-height:1.4; color:#777; }
.lp-reading-guide button { flex:0 0 auto; margin-top:.1rem; white-space:nowrap; }

/* One synchronized primal/dual editor. */
.lp-master { width:min(100%,76rem); margin:1rem 0 3rem; padding:1rem 0 1.4rem; border-block:1px solid var(--site-line-soft); }
.lp-master-heading { max-width:62rem; }
.lp-master-heading h2 { margin:0 0 .25rem; }
.lp-master-heading p { margin:.25rem 0 1rem; }
.lp-master-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(14rem,19rem); gap:1.5rem 2rem; align-items:start; }
.lp-demo-main { min-width:0; }
.lp-demo-panes { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); border:1px solid var(--site-line-soft); }
.lp-demo-pane { min-width:0; padding:1rem; overflow:visible; }
.lp-demo-pane + .lp-demo-pane { border-left:1px solid var(--site-line-soft); }
.lp-pane-heading { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-bottom:.55rem; }
.lp-pane-heading h3 { margin:0; font-size:1.15rem; }
.lp-pane-heading span { color:#777; font-size:.8rem; }

.lp-sense-controls { display:inline-flex; margin:0 0 .65rem; border:1px solid var(--site-line-soft); }
.lp-sense-controls button { border:0; border-radius:0; padding:.35rem .65rem; background:transparent; }
.lp-sense-controls button + button { border-left:1px solid var(--site-line-soft); }
.lp-sense-controls button.is-active { font-weight:700; background:color-mix(in srgb,currentColor 8%,transparent); }

.lp-dim-controls { display:flex; flex-wrap:wrap; gap:.55rem 1.2rem; margin:0 0 .65rem; padding:.55rem .7rem; border:1px solid var(--site-line-soft); font-size:.86rem; }
.lp-dim-controls > div { display:flex; align-items:center; gap:.38rem; }
.lp-dim-controls > div > span { margin-right:.15rem; color:#666; }
.lp-dim-controls button { width:1.8rem; min-width:1.8rem; height:1.65rem; padding:0; line-height:1; }
.lp-dim-controls strong { min-width:1.2rem; text-align:center; font-weight:500; }
.lp-dim-controls small { color:#777; margin-left:.1rem; }

.lp-dual-map { margin:0 0 .8rem; padding:.55rem .7rem; border-left:2px solid var(--site-line-soft); font-size:.84rem; }
.lp-dual-map > div { display:flex; flex-wrap:wrap; gap:.3rem .55rem; margin-top:.3rem; }
.lp-dual-map small { display:block; margin-top:.35rem; color:#777; }
.lp-map-chip { display:inline-flex; align-items:center; gap:.25rem; padding:.12rem .32rem; border:1px solid var(--site-line-soft); border-radius:.2rem; }
.lp-map-chip b { font-weight:400; color:#777; }
.lp-map-c1 { color:var(--lp-blue); }
.lp-map-c2 { color:var(--lp-orange); }
.lp-map-c3 { color:var(--lp-green); }

/* The equations themselves are the editor. */
.lp-equation-editor { min-height:7.6rem; margin:.15rem 0 .55rem; font-size:.95rem; line-height:1.65; font-variant-numeric:tabular-nums; }
.lp-equation-row { display:grid; grid-template-columns:2.4rem minmax(0,1fr); gap:.25rem; align-items:start; margin:.08rem 0; }
.lp-equation-prefix { color:#777; font-variant:small-caps; }
.lp-equation-body { display:flex; flex-wrap:wrap; align-items:center; gap:.12rem .22rem; min-width:0; }
.lp-signed-term { display:inline-flex; align-items:center; gap:.1rem; }
.lp-plus { color:#777; margin-right:.05rem; }
.lp-relation { margin-inline:.15rem; }

.lp-coeff-control { position:relative; display:inline-block; }
.lp-coeff-button { min-width:2rem; padding:.05rem .28rem; border:0; border-bottom:1px dotted currentColor; border-radius:0; background:transparent; color:inherit; font:inherit; font-variant-numeric:tabular-nums; text-align:center; cursor:ew-resize; }
.lp-coeff-button:hover, .lp-coeff-button:focus-visible { background:color-mix(in srgb,currentColor 8%,transparent); outline:none; }

.lp-projection-buttons { display:flex; flex-wrap:wrap; gap:.3rem; margin:.25rem 0 .45rem; }
.lp-projection-buttons button { display:inline-flex; align-items:center; padding:.16rem .42rem; font-size:.78rem; }
.lp-projection-buttons button.is-active { font-weight:700; text-decoration:underline; text-underline-offset:.15rem; }

/* Heat-map geometry and direct-manipulation handles. */
.lp-heat-wrap { margin:.1rem 0 .65rem; }
.lp-heat-caption { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:.25rem .8rem; margin-bottom:.12rem; }
.lp-heat-caption > span { font-size:.76rem; text-transform:uppercase; letter-spacing:.035em; color:#777; }
.lp-heat-caption small { color:#777; font-size:.72rem; }
.lp-demo-plot { display:block; width:100%; height:auto; touch-action:none; }
.lp-grid { stroke:currentColor; opacity:.07; stroke-width:1; }
.lp-grid-strong { stroke:currentColor; opacity:.18; stroke-width:1; }
.lp-axis { stroke:currentColor; opacity:.5; stroke-width:1.15; }
.lp-heat-cell { stroke:none; opacity:.8; pointer-events:none; }
.lp-feasible-outline { fill:none; stroke:currentColor; stroke-width:1.4; opacity:.82; pointer-events:none; }
.lp-constraint-line { fill:none; stroke-width:1.7; opacity:.92; }
.lp-c1 { stroke:var(--lp-blue); }
.lp-c2 { stroke:var(--lp-orange); }
.lp-c3 { stroke:var(--lp-green); }
.lp-line-handle { fill:Canvas; stroke-width:2.4; cursor:grab; vector-effect:non-scaling-stroke; }
.lp-line-handle:active { cursor:grabbing; }
.lp-current { fill:var(--lp-red); stroke:currentColor; stroke-width:1; }
.lp-optimum { fill:var(--lp-green); stroke:currentColor; stroke-width:1; }
.lp-optimum-ring { fill:none; stroke:var(--lp-green); stroke-width:2.2; }
.lp-plot-label { fill:currentColor; font-family:inherit; font-size:12px; }
.lp-heat-legend { display:grid; grid-template-columns:auto minmax(6rem,10rem) auto; gap:.35rem; align-items:center; margin:.08rem 0 0; font-size:.72rem; color:#777; }
.lp-heat-gradient { height:.42rem; border-radius:999px; background:linear-gradient(90deg,hsl(220 76% 52%),hsl(115 76% 52%),hsl(35 76% 52%),hsl(10 76% 52%)); }

.lp-certificate { border:1px solid var(--site-line-soft); padding:.72rem 1rem; font-size:.88rem; }
.lp-principle { display:flex; flex-wrap:wrap; gap:.35rem 1rem; align-items:center; }
.lp-gap-summary { display:flex; flex-wrap:wrap; gap:.28rem .8rem; margin-top:.4rem; }
.lp-slackness-compact { display:grid; gap:.16rem; margin-top:.5rem; }
.lp-slackness-compact strong { font-weight:600; }
.lp-demo-note { font-size:.88rem; line-height:1.5; padding-left:1rem; border-left:1px solid var(--site-line-soft); }
.lp-normal-certificate svg { width:100%; height:auto; display:block; margin-bottom:.25rem; }
.lp-normal-certificate p { margin:.25rem 0 .75rem; }
.lp-normal-row { stroke-width:2.2; fill:none; }
.lp-normal-sum { stroke:var(--lp-purple); stroke-width:3; }
.lp-normal-objective { stroke:var(--lp-red); stroke-width:3; }
.lp-normal-label { fill:currentColor; font-family:inherit; font-size:10px; }
.lp-normal-empty { color:#777; }

.lp-notes-loader { width:min(100%,55rem); margin:2rem 0; padding:.75rem 0; border-block:1px solid var(--site-line-soft); display:flex; align-items:center; gap:.8rem; }
.lp-notes-loader button { font:inherit; cursor:pointer; }
.lp-notes-loader small { color:#777; }

/* Consolidated written notes. */
.lp-expanded-notes { width:min(100%,65rem); margin-top:2.5rem; }
.lp-notes:has(.lp-expanded-notes) > p { display:none; }
.lp-expanded-toc { display:flex; flex-wrap:wrap; gap:.35rem 1rem; margin:0 0 2rem; padding:.75rem 0; border-block:1px solid var(--site-line-soft); font-size:.92rem; }
.lp-long-section { scroll-margin-top:1.5rem; margin:0 0 4rem; content-visibility:auto; contain-intrinsic-size:1px 720px; }
.lp-long-section > h2 { margin-top:0; }
.lp-long-section h3 { margin-top:1.7rem; }
.lp-long-section p, .lp-long-section li { line-height:1.55; }
.lp-long-section ul { width:55%; }
.lp-source-line { color:#666; font-size:.9rem; }
.lp-equation { width:min(100%,38rem); margin:.85rem 0 1rem; padding:.65rem .8rem; border-left:2px solid var(--site-line-soft); font-size:1.06rem; line-height:1.55; font-variant-numeric:tabular-nums; }
.lp-inline-eq { white-space:nowrap; }
.lp-pair-text { width:min(100%,48rem); display:grid; grid-template-columns:1fr 1fr; gap:1rem 1.5rem; margin:1rem 0; }
.lp-pair-text > div { min-width:0; }
.lp-pair-text .lp-equation { width:auto; margin:.35rem 0; }
.lp-table-wrap { width:min(100%,55rem); overflow-x:auto; margin:1rem 0; }
.lp-table-wrap table { width:100%; border-collapse:collapse; font-size:.92rem; }
.lp-table-wrap th, .lp-table-wrap td { text-align:left; vertical-align:top; padding:.45rem .6rem; border-bottom:1px solid var(--site-line-soft); }

/* Collapsible, section-local intuition tools. */
.lp-intuition { width:min(100%,55rem); margin:.8rem 0 1.25rem; border-block:1px solid var(--site-line-soft); }
.lp-intuition > summary { cursor:pointer; padding:.55rem 0; font-weight:600; }
.lp-intuition > summary::marker { color:#777; }
.lp-intuition-body { padding:.15rem 0 .85rem; }
.lp-intuition-body p { width:100%; margin:.5rem 0 0; font-size:.9rem; }
.lp-mini-controls, .lp-mini-slider, .lp-mini-sliders { display:flex; flex-wrap:wrap; gap:.5rem 1rem; align-items:center; margin:.2rem 0 .55rem; font-size:.86rem; }
.lp-mini-controls label, .lp-mini-slider, .lp-mini-sliders label { display:flex; align-items:center; gap:.45rem; }
.lp-mini-slider input[type="range"] { width:min(22rem,65vw); }
.lp-mini-sliders input[type="range"] { width:min(10rem,30vw); }
.lp-mini-svg { display:block; width:min(100%,32rem); height:auto; border:1px solid var(--site-line-soft); }
.lp-mini-region { fill:color-mix(in srgb,var(--lp-blue) 18%,transparent); stroke:currentColor; stroke-width:1.2; }
.lp-mini-cone-fill { fill:color-mix(in srgb,var(--lp-green) 16%,transparent); stroke:none; }
.lp-mini-affine { stroke:var(--lp-purple); stroke-width:1.4; stroke-dasharray:5 4; }
.lp-mini-convex { stroke:var(--lp-red); stroke-width:4; }
.lp-mini-cone { fill:none; stroke:var(--lp-green); stroke-width:5; opacity:.65; }
.lp-farkas-separator { stroke:var(--lp-red); stroke-width:2; stroke-dasharray:6 4; }
.lp-product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; }
.lp-product-grid > div { display:grid; gap:.12rem; padding:.5rem .6rem; border:1px solid var(--site-line-soft); font-size:.82rem; }
.lp-product-grid strong { font-weight:600; }
.lp-algorithm-controls { display:flex; gap:.4rem; margin-bottom:.55rem; }
.lp-pd-stage { width:min(100%,36rem); padding:.7rem .8rem; border:1px solid var(--site-line-soft); }
.lp-pd-stage p { margin:.3rem 0 .65rem; }
.lp-pd-meter { height:.45rem; background:color-mix(in srgb,currentColor 9%,transparent); }
.lp-pd-meter span { display:block; height:100%; background:currentColor; transition:width .18s ease; }
.lp-pd-stage small { display:block; margin-top:.35rem; color:#777; }

/* Legacy per-section interaction mounts are removed by app.js. */
.lp-notes .lp-symbolic, .lp-notes .lp-tool { display:none!important; }

@media(max-width:900px) {
  .lp-master-layout { grid-template-columns:1fr; }
  .lp-demo-note { border-left:0; border-top:1px solid var(--site-line-soft); padding:.8rem 0 0; }
  .lp-normal-certificate svg { width:min(100%,22rem); }
}
@media(max-width:760px) {
  .lp-notes .lp-chapter > math[display="block"] { width:100%; }
  .lp-demo-panes, .lp-pair-text { grid-template-columns:1fr; }
  .lp-demo-pane + .lp-demo-pane { border-left:0; border-top:1px solid var(--site-line-soft); }
  .lp-reading-guide-head { display:block; }
  .lp-reading-guide button { margin:.55rem 0 0; }
  .lp-gap-control label { grid-template-columns:1fr; gap:.2rem; }
  .lp-long-section p, .lp-long-section ul { width:100%; }
  .lp-inline-eq { white-space:normal; }
  .lp-product-grid { grid-template-columns:1fr; }
  .lp-dim-controls > div { width:100%; }
}
@media print {
  .lp-reading-guide { width:100%; }
  .lp-reading-guide button, .lp-master, .lp-intuition { display:none!important; }
  .lp-long-section { break-before:page; }
  .lp-expanded-toc { display:none; }
}


/* True 3D primal/dual view. */
.lp-dual3d-wrap { margin:.15rem 0 .8rem; padding-bottom:.55rem; border-bottom:1px solid var(--site-line-soft); }
.lp-dual3d-plot { display:block; width:100%; height:auto; overflow:visible; contain:layout paint; }
.lp-dual3d-cube { stroke:currentColor; stroke-width:1; opacity:.16; vector-effect:non-scaling-stroke; }
.lp-dual3d-wire { stroke:currentColor; stroke-width:1.35; opacity:.72; vector-effect:non-scaling-stroke; }
.lp-dual3d-axis { stroke:currentColor; stroke-width:1.4; opacity:.65; vector-effect:non-scaling-stroke; }
.lp-dual3d-plane { stroke-width:1.15; vector-effect:non-scaling-stroke; pointer-events:none; }
.lp-dual3d-plane-1 { fill:var(--lp-blue); stroke:var(--lp-blue); fill-opacity:.09; stroke-opacity:.55; }
.lp-dual3d-plane-2 { fill:var(--lp-orange); stroke:var(--lp-orange); fill-opacity:.09; stroke-opacity:.55; }
.lp-dual3d-plane-3 { fill:var(--lp-green); stroke:var(--lp-green); fill-opacity:.09; stroke-opacity:.55; }
.lp-dual3d-point { opacity:.48; pointer-events:none; }
.lp-dual3d-mark { vector-effect:non-scaling-stroke; }
.lp-dual3d-note { width:100%; margin:.35rem 0 0; color:#666; font-size:.78rem; line-height:1.4; }
.lp-dual3d-projection { margin-top:.55rem; }
.lp-dual3d-projection > strong { display:block; margin-bottom:.15rem; font-size:.76rem; text-transform:uppercase; letter-spacing:.035em; color:#777; }


/* 3D interaction and button-only geometry mode controls. */
.lp-dual3d-plot[data-3d-rotate] { touch-action:none; cursor:grab; user-select:none; }
.lp-dual3d-plot[data-3d-rotate]:active { cursor:grabbing; }
.lp-dual3d-projection { margin:.3rem 0 .75rem; }
.lp-dual3d-projection > summary { cursor:pointer; color:#666; font-size:.8rem; }
.lp-poly-mode-buttons { display:inline-flex; gap:0; border:1px solid var(--site-line-soft); }
.lp-poly-mode-buttons button { border:0; border-radius:0; background:transparent; padding:.28rem .5rem; font-size:.8rem; }
.lp-poly-mode-buttons button + button { border-left:1px solid var(--site-line-soft); }
.lp-poly-mode-buttons button.is-active { font-weight:700; background:color-mix(in srgb,currentColor 8%,transparent); }


/* Dimension-aware normal certificate. */
.lp-normal-certificate-text > strong { display:block; margin-bottom:.45rem; }
.lp-normal-factors { display:grid; gap:.28rem; margin:.25rem 0 .55rem; }
.lp-normal-factor { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.35rem .55rem; align-items:baseline; padding-bottom:.2rem; border-bottom:1px solid var(--site-line-soft); font-variant-numeric:tabular-nums; }
.lp-normal-factor span:last-child { color:CanvasText; }
.lp-normal-certificate-text p { margin:.45rem 0; }
.lp-normal-sum-text { font-weight:600; }
.lp-normal-products { color:#666; font-size:.82rem; }


.lp-status-explanation { display:grid; gap:.28rem; }
.lp-status-explanation strong { font-size:.95rem; }
.lp-status-explanation span { color:#666; line-height:1.4; }
@media (prefers-color-scheme: dark) { .lp-status-explanation span { color:#aaa; } }


/* Heat-mapped surface of the clipped 3D feasible polyhedron. */
.lp-heat-face-3d { stroke:color-mix(in srgb,CanvasText 22%,transparent); stroke-width:.45; fill-opacity:.64; vector-effect:non-scaling-stroke; }
.lp-heat-face-3d-constraint { stroke-width:.8; }
.lp-heat-face-3d-clip { fill-opacity:.22; stroke-dasharray:3 3; }


/* Direct-manipulation reset: the main dual viewer is the visual baseline. */
.lp-reading-guide { margin-bottom:1rem; }
.lp-reading-guide-head { align-items:center; }
.lp-source-links { display:flex; flex-wrap:wrap; gap:.35rem .8rem; }
.lp-source-page { font-size:.82rem; white-space:nowrap; }
.lp-master { margin-top:.5rem; }
.lp-master-heading { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-bottom:.65rem; }
.lp-master-heading h2 { margin:0; }
.lp-master-layout { grid-template-columns:1fr; }
.lp-dual-map { display:grid; grid-template-columns:1fr 1fr; gap:.35rem 1rem; border-left:0; padding:.4rem 0; }
.lp-dual-map > div { margin:0; }
.lp-number-scrub { touch-action:none; user-select:none; cursor:ew-resize; }
.lp-number-scrub.is-scrubbing { background:color-mix(in srgb,currentColor 12%,transparent); outline:1px solid currentColor; }
.lp-coeff-button { min-width:1.65rem; border-bottom:1px dotted currentColor; }
.lp-certificate { border-top:0; padding:.55rem .8rem; }
.lp-principle { justify-content:space-between; }
.lp-labs { width:min(100%,76rem); display:grid; gap:1rem; margin:0 0 3rem; }
.lp-lab { border:1px solid var(--site-line-soft); padding:.8rem 1rem 1rem; content-visibility:auto; contain-intrinsic-size:1px 360px; }
.lp-lab > header { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-bottom:.55rem; }
.lp-lab > header h2 { margin:0; font-size:1.08rem; }
.lp-lab-controls { min-height:2rem; display:flex; flex-wrap:wrap; align-items:center; gap:.4rem .75rem; margin-bottom:.4rem; }
.lp-segmented { display:inline-flex; border:1px solid var(--site-line-soft); }
.lp-segmented button { border:0; border-radius:0; background:transparent; padding:.25rem .5rem; }
.lp-segmented button + button { border-left:1px solid var(--site-line-soft); }
.lp-segmented button.is-active { font-weight:700; background:color-mix(in srgb,currentColor 8%,transparent); }
.lp-lab-number-wrap { display:inline-flex; align-items:center; gap:.25rem; color:#666; font-size:.83rem; }
.lp-lab-number { min-width:2.5rem; padding:.12rem .35rem; border:0; border-bottom:1px dotted currentColor; background:transparent; color:inherit; font:inherit; font-variant-numeric:tabular-nums; }
.lp-lab-svg { display:block; width:min(100%,32rem); height:auto; border:1px solid var(--site-line-soft); touch-action:none; }
.lp-lab [data-lab-status] { display:flex; flex-wrap:wrap; gap:.3rem; margin:.2rem 0 .45rem; min-height:1.4rem; }
.lp-state-pill { display:inline-flex; align-items:center; padding:.1rem .35rem; border:1px solid var(--site-line-soft); border-radius:999px; font-size:.78rem; font-variant-numeric:tabular-nums; }
.lp-state-pill.is-good { border-color:var(--lp-green); color:var(--lp-green); }
.lp-lab-panes { display:grid; grid-template-columns:1fr 1fr; gap:.7rem; }
.lp-lab-panes > div > span { display:block; margin-bottom:.2rem; color:#777; font-size:.76rem; text-transform:uppercase; letter-spacing:.035em; }
.lp-lab-panes .lp-lab-svg { width:100%; }
.lp-expanded-notes,.lp-notes-loader,.lp-intuition { display:none!important; }
@media(max-width:760px){.lp-dual-map,.lp-lab-panes{grid-template-columns:1fr}.lp-master-heading,.lp-lab>header{align-items:flex-start;flex-direction:column;gap:.2rem}}


/* Persistent reference for the one LP that drives every demo. */
.lp-sticky-model { position:sticky; top:0; z-index:30; width:min(100%,76rem); margin:0 0 .8rem; padding:.5rem .65rem; background:Canvas; border-block:1px solid var(--site-line-soft); box-shadow:0 .18rem .45rem rgb(0 0 0 / .06); }
.lp-sticky-model-inner { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:.55rem .8rem; align-items:center; }
.lp-model-side { min-width:0; display:flex; flex-wrap:wrap; gap:.28rem .65rem; align-items:baseline; font-size:.76rem; font-variant-numeric:tabular-nums; }
.lp-model-title { display:flex; gap:.4rem; align-items:baseline; margin-right:.25rem; }
.lp-model-title strong { font-size:.88rem; }
.lp-model-title span, .lp-model-form { color:#666; }
.lp-model-field { display:inline-flex; gap:.28rem; align-items:baseline; white-space:nowrap; }
.lp-model-field small { color:#777; font-size:.68rem; text-transform:uppercase; letter-spacing:.03em; }
.lp-model-field b { font-weight:500; }
.lp-model-iff { font-size:1.25rem; line-height:1; }
.lp-iff { vertical-align:-.08em; }

/* Every number beneath the master model is annotated by its mathematical role. */
.lp-lab-model-key { display:flex; flex-wrap:wrap; gap:.3rem .8rem; margin:.25rem 0 .55rem; font-size:.78rem; font-variant-numeric:tabular-nums; }
.lp-lab-model-key span { display:inline-flex; gap:.3rem; align-items:baseline; }
.lp-lab-model-key small { color:#777; text-transform:uppercase; letter-spacing:.03em; font-size:.67rem; }
.lp-formula-key { display:flex; flex-wrap:wrap; gap:.3rem .7rem; margin:.35rem 0 .5rem; font-size:.78rem; font-variant-numeric:tabular-nums; }
.lp-formula-key span { padding:.1rem 0; }
.lp-dimension-hint { padding:.55rem .65rem; border:1px dashed var(--site-line-soft); color:#666; font-size:.82rem; }
.lp-lab-line-label, .lp-lab-axis-label { fill:currentColor; font-family:inherit; font-size:10px; }
.lp-lab-axis-label { opacity:.7; }
.lp-state-pill { display:inline-flex; margin:.15rem .28rem .15rem 0; padding:.12rem .35rem; border:1px solid var(--site-line-soft); border-radius:.2rem; font-size:.78rem; font-variant-numeric:tabular-nums; }
.lp-state-pill.is-good { border-color:var(--lp-green); }
.lp-lab-panes > div > strong { display:block; margin-bottom:.25rem; font-size:.78rem; font-weight:500; }

@media(max-width:760px) {
  .lp-sticky-model { top:0; padding:.4rem; }
  .lp-sticky-model-inner { grid-template-columns:1fr; gap:.28rem; }
  .lp-model-iff { text-align:center; transform:rotate(90deg); }
  .lp-model-field { white-space:normal; }
}


/* Beginner LP learning path and foundation interactables. */
.lp-learning-path { width:min(100%,76rem); margin:0 0 1rem; padding:.75rem 0 1rem; border-bottom:1px solid var(--site-line-soft); }
.lp-learning-path > div { display:flex; flex-wrap:wrap; gap:.35rem .8rem; align-items:baseline; margin-bottom:.55rem; }
.lp-learning-path > div span { color:#666; font-size:.86rem; }
.lp-learning-path nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:.3rem .55rem; }
.lp-learning-path a { display:flex; gap:.35rem; align-items:baseline; padding:.28rem .35rem; border-left:2px solid var(--site-line-soft); font-size:.78rem; text-decoration:none; }
.lp-learning-path a:hover { border-left-color:currentColor; }
.lp-learning-path a b { font-variant-numeric:tabular-nums; }
.lp-lab { scroll-margin-top:8.5rem; }
.lp-foundation-lab { border-width:1.5px; }
.lp-lab-explainer { max-width:62rem; margin:.05rem 0 .6rem; color:#555; font-size:.88rem; line-height:1.45; }
.lp-inline-explanation { flex-basis:100%; margin:.12rem 0 .25rem; color:#666; font-size:.8rem; line-height:1.4; }
.lp-mini-choice-label { color:#666; font-size:.78rem; margin-right:.2rem; }
[data-geometry-extra], [data-sensitivity-rows], [data-sensitivity-delta] { display:inline-flex; flex-wrap:wrap; align-items:center; gap:.25rem; }
[data-geometry-extra] > button, [data-sensitivity-rows] > button { min-width:1.8rem; padding:.18rem .38rem; }
[data-geometry-extra] > button.is-active, [data-sensitivity-rows] > button.is-active { font-weight:700; text-decoration:underline; text-underline-offset:.13rem; }
.lp-objective-level { stroke:var(--lp-red); stroke-width:2.2; stroke-dasharray:7 4; }
.lp-vertex-dot { fill:Canvas; stroke:currentColor; stroke-width:1.4; }
.lp-selected-vertex { fill:var(--lp-red); stroke:currentColor; stroke-width:1.6; }
.lp-simplex-path { fill:none; stroke:var(--lp-purple); stroke-width:3; stroke-linejoin:round; stroke-linecap:round; }
.lp-simplex-visited { fill:var(--lp-purple); stroke:Canvas; stroke-width:1.3; }
.lp-inequality-chain { width:min(100%,55rem); display:grid; gap:.45rem; padding:.75rem .85rem; border:1px solid var(--site-line-soft); font-variant-numeric:tabular-nums; }
.lp-inequality-chain strong { font-size:1.02rem; font-weight:600; overflow-wrap:anywhere; }
.lp-inequality-chain span { color:#666; font-size:.82rem; }
.lp-inequality-chain.is-valid { border-left:3px solid var(--lp-green); }
.lp-sensitivity-curve { fill:none; stroke:currentColor; stroke-width:2.2; }
.lp-sensitivity-tangent { stroke:var(--lp-purple); stroke-width:1.6; stroke-dasharray:6 4; opacity:.85; }
@media(max-width:900px){.lp-learning-path nav{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:560px){.lp-learning-path nav{grid-template-columns:1fr}.lp-lab{scroll-margin-top:13rem}}


/* Smooth 3D objective shading: triangle fills carry gradients; outlines come from the plane/wire layers. */
.lp-heat-face-3d { stroke:none; fill-opacity:.72; shape-rendering:geometricPrecision; }
.lp-heat-face-3d-constraint { stroke:none; }
.lp-heat-face-3d-clip { fill-opacity:.22; }
.lp-dual3d-plot { contain:layout paint; }

/* Standard-form/slack teaching view. */
.lp-standard-form-layout { display:grid; grid-template-columns:minmax(12rem,.75fr) minmax(0,1.25fr); gap:.8rem 1rem; align-items:center; }
.lp-slack-bars { display:grid; gap:.45rem; }
.lp-slack-row { display:grid; grid-template-columns:2rem minmax(5rem,1fr) 3.3rem; gap:.4rem; align-items:center; font-size:.8rem; font-variant-numeric:tabular-nums; }
.lp-slack-row b { font-weight:500; text-align:right; }
.lp-slack-track { height:.45rem; background:color-mix(in srgb,currentColor 10%,transparent); overflow:hidden; }
.lp-slack-track i { display:block; height:100%; background:var(--lp-green); min-width:2px; }
.lp-slack-track i.is-tight { background:var(--lp-purple); }
.lp-slack-track i.is-negative { background:var(--lp-red); }
@media(max-width:760px){.lp-standard-form-layout{grid-template-columns:1fr}}


/* Math typography: use real sub/sup layout instead of font-dependent Unicode subscript glyphs. */
.lp-var { display:inline-flex; align-items:baseline; white-space:nowrap; line-height:1; vertical-align:baseline; }
.lp-var-base { font-style:italic; }
.lp-var sub { position:relative; bottom:-.22em; margin-left:.025em; font-size:.7em; line-height:0; font-style:normal; }
.lp-svg-var { font-style:italic; }
.lp-svg-sub { font-size:8px; }

/* Formula wrapping is semantic: terms stay intact and whole formulas move to the next line. */
.lp-equation-body { row-gap:.18rem; }
.lp-signed-term, .lp-relation, .lp-lab-number-wrap { white-space:nowrap; }
.lp-lab [data-lab-status] { display:block; min-height:1.4rem; }
.lp-lab [data-lab-status] > .lp-state-pill { margin:.12rem .28rem .12rem 0; }
.lp-formula-key { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap:.3rem .75rem; align-items:start; }
.lp-formula-key > span { display:block; min-width:0; line-height:1.45; word-break:normal; overflow-wrap:normal; }
.lp-inline-explanation { max-width:62rem; }
.lp-lab-controls { align-items:flex-start; }

/* Weak duality as three separately justified comparisons. */
.lp-bound-chain { width:min(100%,42rem); display:grid; grid-template-columns:auto minmax(0,1fr); gap:.22rem .65rem; padding:.7rem .85rem; border:1px solid var(--site-line-soft); font-variant-numeric:tabular-nums; }
.lp-bound-chain.is-valid { border-left:3px solid var(--lp-green); }
.lp-bound-value { grid-column:2; font-weight:600; font-size:1.02rem; }
.lp-bound-step { grid-column:1 / -1; display:grid; grid-template-columns:1.4rem minmax(0,1fr); gap:.25rem; align-items:start; }
.lp-bound-step > b { text-align:center; font-size:1.1rem; line-height:1.45; }
.lp-bound-step strong { display:block; font-size:1.02rem; font-weight:600; }
.lp-bound-step small { display:block; margin-top:.06rem; color:#666; line-height:1.35; }
.lp-bound-chain p { grid-column:1 / -1; margin:.35rem 0 0; font-size:.82rem; line-height:1.4; }

/* Dual weights are vectors added head-to-tail. */
.lp-vector-step { fill:none; stroke-width:3; stroke-linecap:round; }
.lp-vector-step-dot { stroke:Canvas; stroke-width:1.3; fill:currentColor; }

/* Farkas: show the whole generated cone, not only its rays. */
.lp-farkas-cone { fill:color-mix(in srgb,var(--lp-green) 15%,transparent); stroke:none; pointer-events:none; }

/* Complementary slackness: pair each variable with exactly the slack it complements. */
.lp-cs-grid { display:grid; gap:.25rem; margin:.5rem 0 .4rem; max-width:62rem; }
.lp-cs-row { display:grid; grid-template-columns:minmax(6.5rem,1fr) auto minmax(6.5rem,1fr) auto 4.2rem minmax(8rem,1.1fr); gap:.3rem .45rem; align-items:baseline; padding:.28rem .4rem; border-left:3px solid var(--lp-red); font-size:.8rem; font-variant-numeric:tabular-nums; }
.lp-cs-row.is-zero { border-left-color:var(--lp-green); }
.lp-cs-row i { color:#777; font-style:normal; text-align:center; }
.lp-cs-row strong { font-weight:600; }
.lp-cs-row small { color:#666; }

@media(max-width:680px) {
  .lp-formula-key { grid-template-columns:1fr; }
  .lp-bound-chain { grid-template-columns:auto minmax(0,1fr); }
  .lp-cs-row { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto 3.5rem; }
  .lp-cs-row small { grid-column:1 / -1; }
}


/* Witness points are direct-manipulation handles shared across all duality labs. */
.lp-drag-point { cursor:grab; touch-action:none; stroke-width:2; }
.lp-drag-point:hover { stroke-width:3; }
.lp-drag-point.is-dragging { cursor:grabbing; stroke-width:3.5; }
.lp-weak-layout { display:grid; grid-template-columns:minmax(18rem,.9fr) minmax(0,1.1fr); gap:.8rem 1rem; align-items:start; }
.lp-witness-panes { grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr)); }
.lp-witness-panes > div > strong { text-transform:none; letter-spacing:0; font-size:.76rem; font-weight:500; }
@media(max-width:900px){.lp-weak-layout{grid-template-columns:1fr}}


/* Keep logical pieces of an LP constraint together when a compact editor wraps. */
.lp-rhs { display:inline-flex; align-items:baseline; gap:.14rem; white-space:nowrap; }
.lp-domain-list { display:inline-flex; flex-wrap:wrap; align-items:baseline; gap:.08rem .2rem; }
.lp-domain-var, .lp-domain-sign { white-space:nowrap; }
.lp-editor-sticky .lp-equation-body { align-content:flex-start; }


/* A failed comparison in the weak-duality chain should be visible at a glance. */
.lp-bound-step.is-broken { margin-inline:-.3rem; padding:.18rem .3rem; background:color-mix(in srgb,var(--lp-red) 9%,transparent); }
.lp-bound-step.is-broken > b, .lp-bound-step.is-broken small { color:var(--lp-red); }
