/* Theme-sensitive and structural overrides for the LP study page. */
.lp-editor-sticky {
  position:sticky;
  top:0;
  z-index:40;
  align-self:start;
  width:min(100%,76rem);
  margin:0 0 1rem;
  padding:.55rem .7rem .45rem;
  background:#fff;
  color:#111;
  border-block:1px solid var(--site-line-soft);
  box-shadow:0 .22rem .7rem rgb(0 0 0 / .12);
}
.lp-editor-topline { display:flex; justify-content:space-between; gap:.6rem 1rem; align-items:flex-start; }
.lp-editor-topline .lp-master-heading { display:flex; gap:.65rem; align-items:baseline; min-width:max-content; }
.lp-editor-topline .lp-master-heading h2 { margin:.1rem 0 0; font-size:1rem; }
.lp-editor-toolbar { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.3rem .55rem; }
.lp-editor-toolbar .lp-sense-controls, .lp-editor-toolbar .lp-dim-controls { margin:0; }
.lp-editor-toolbar .lp-dim-controls { padding:.25rem .4rem; gap:.35rem .7rem; font-size:.72rem; }
.lp-editor-toolbar .lp-dim-controls button { width:1.45rem; min-width:1.45rem; height:1.35rem; }
.lp-editor-toolbar .lp-sense-controls button { padding:.25rem .45rem; font-size:.72rem; }
.lp-editor-sticky .lp-dual-map { margin:.3rem 0 .35rem; padding:.25rem .45rem; font-size:.69rem; display:flex; flex-wrap:wrap; gap:.18rem .55rem; }
.lp-editor-sticky .lp-dual-map > div { margin:0; gap:.18rem .35rem; }
.lp-editor-sticky .lp-map-chip { padding:.05rem .22rem; }
.lp-editor-panes { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--site-line-soft); }
.lp-editor-pane { min-width:0; padding:.38rem .55rem .28rem; }
.lp-editor-pane + .lp-editor-pane { border-left:1px solid var(--site-line-soft); }
.lp-editor-sticky .lp-pane-heading { margin-bottom:.12rem; }
.lp-editor-sticky .lp-pane-heading h3 { font-size:.85rem; }
.lp-editor-sticky .lp-pane-heading span { font-size:.65rem; }
.lp-editor-sticky .lp-equation-editor { min-height:0; margin:0; font-size:.78rem; line-height:1.38; }
.lp-editor-sticky .lp-equation-row { grid-template-columns:2rem minmax(0,1fr); margin:.02rem 0; }
.lp-editor-sticky .lp-coeff-button { min-width:1.55rem; padding:0 .16rem; }
.lp-editor-certificate { margin-top:.2rem; padding:.25rem .55rem; font-size:.72rem; }
.lp-editor-certificate .lp-gap-summary { margin-top:.18rem; }
.lp-master { width:min(100%,76rem); margin:0 0 2rem; padding:0; border:0; overflow:visible; }
.lp-polyhedra-stage { padding:1rem 0 1.35rem; border-bottom:1px solid var(--site-line-soft); }
.lp-polyhedra-stage > header { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-bottom:.55rem; }
.lp-polyhedra-stage > header h2 { margin:0; font-size:1.08rem; }
.lp-polyhedra-stage > header span { color:#777; font-size:.78rem; margin-left:.5rem; }
.lp-geometry-panes { display:grid; grid-template-columns:1fr 1fr; gap:.8rem; }
.lp-geometry-pane { min-width:0; padding:.65rem; border:1px solid var(--site-line-soft); }
.lp-view-badge { display:inline-flex; margin:.2rem 0 .45rem .45rem; padding:.08rem .3rem; border:1px solid var(--site-line-soft); border-radius:999px; color:#666; font-size:.68rem; }
.lp-sticky-model { display:none!important; }

@media (prefers-color-scheme: dark) {
  .lp-editor-sticky {
    background:rgb(20 20 20 / .985);
    color:#eee;
    border-color:rgba(255,255,255,.18);
    box-shadow:0 .22rem .8rem rgb(0 0 0 / .48);
  }
  .lp-editor-sticky .lp-pane-heading span,
  .lp-editor-sticky .lp-dim-controls span,
  .lp-editor-sticky .lp-dim-controls small,
  .lp-editor-sticky .lp-equation-prefix { color:#b8b8b8; }
  .lp-view-badge { color:#bbb; }
}
@media(max-width:900px){
  .lp-editor-topline { display:block; }
  .lp-editor-toolbar { justify-content:flex-start; margin-top:.35rem; }
  .lp-geometry-panes { grid-template-columns:1fr; }
}
@media(max-width:760px){
  .lp-editor-sticky { max-height:58vh; overflow:auto; padding:.4rem; }
  .lp-editor-panes { grid-template-columns:1fr; }
  .lp-editor-pane + .lp-editor-pane { border-left:0; border-top:1px solid var(--site-line-soft); }
  .lp-editor-sticky .lp-dual-map { display:none; }
  .lp-polyhedra-stage > header { align-items:flex-start; flex-direction:column; gap:.2rem; }
}

/* This page is an interactive workspace, not a Tufte 55% prose column.
   Neutralize the CDN Tufte body's 12.5% left padding only on this page, then
   center the editor and teaching sequence in one predictable content rail. */
body:has(.lp-notes) {
  box-sizing:border-box;
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
}
body:has(.lp-notes) > header,
body:has(.lp-notes) > article {
  box-sizing:border-box;
  width:min(calc(100% - 2rem),78rem);
  max-width:none;
  margin-inline:auto;
  padding-inline:0;
}
body:has(.lp-notes) > article > h1 {
  width:100%;
  max-width:76rem;
  margin:2.1rem 0 .8rem;
}
body:has(.lp-notes) .lp-notes,
body:has(.lp-notes) .lp-notes *,
body:has(.lp-notes) .lp-notes *::before,
body:has(.lp-notes) .lp-notes *::after {
  box-sizing:border-box;
}
body:has(.lp-notes) .lp-notes,
body:has(.lp-notes) .lp-master,
body:has(.lp-notes) .lp-editor-sticky,
body:has(.lp-notes) .lp-reading-guide,
body:has(.lp-notes) .lp-learning-path,
body:has(.lp-notes) .lp-labs {
  width:100%;
  max-width:none;
}
body:has(.lp-notes) .lp-lab,
body:has(.lp-notes) .lp-polyhedra-stage {
  box-sizing:border-box;
}

/* Tufte reserves a 45% margin-note column for prose. This page has no margin
   notes: its prose belongs to the visualization it explains, so reset those
   inherited narrow-column widths inside the LP workspace. */
body:has(.lp-notes) > article > section {
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
}
body:has(.lp-notes) .lp-notes p,
body:has(.lp-notes) .lp-notes ul,
body:has(.lp-notes) .lp-notes ol,
body:has(.lp-notes) .lp-notes table,
body:has(.lp-notes) .lp-notes blockquote,
body:has(.lp-notes) .lp-notes pre {
  width:auto;
  max-width:100%;
}
body:has(.lp-notes) .lp-notes p {
  margin-left:0;
  margin-right:0;
}

/* Formula keys use color as the row cue; vertical separator bars add visual noise. */
body:has(.lp-notes) .lp-formula-key > span {
  border-left:0;
  padding-left:0;
  padding-right:0;
}

@media(max-width:760px) {
  body:has(.lp-notes) > header,
  body:has(.lp-notes) > article {
    width:min(calc(100% - 1rem),78rem);
  }
  body:has(.lp-notes) > article > h1 { margin-top:1.35rem; }
}
