/* 1-1. darbs — study panels. Every class is prefixed lp-. Colours and fonts come only from tokens.css. */

.lp-root {
  container-type: inline-size;
  font-family: var(--f-body);
  font-size: var(--t-s);
  line-height: 1.5;
  color: var(--ink);
  min-width: 0;
  max-width: 100%;
}
.lp-root *, .lp-root *::before, .lp-root *::after { box-sizing: border-box; }
.lp-root sub, .lp-root sup { font-size: .72em; line-height: 0; }
.lp-root p { margin: 0 0 .6em; }
.lp-root b { font-weight: 600; }

.lp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.lp-h { font-family: var(--f-display); font-size: var(--t-l); font-weight: 650; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .25rem; }
.lp-h3 { font-family: var(--f-display); font-size: var(--t-m); font-weight: 600; line-height: 1.3; margin: 0 0 .6rem; }
.lp-h4 { font-family: var(--f-display); font-size: var(--t-s); font-weight: 600; margin: 1rem 0 .4rem; }
.lp-lede { color: var(--muted); margin: 0; max-width: 60ch; }
.lp-muted { color: var(--muted); font-weight: 400; }
.lp-foot { color: var(--muted); font-size: var(--t-xs); line-height: 1.5; margin: .5rem 0 0; max-width: 72ch; }
.lp-bad { color: var(--warn); }
.lp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lp-grow { flex: 1 1 auto; }
.lp-sec { border-top: 1px solid var(--line); padding: 1.1rem 0 .4rem; margin-top: 1rem; }
.lp-sec-first { border-top: 0; margin-top: 0; padding-top: 0; }
.lp-list { margin: 0; padding-left: 1.1rem; }
.lp-list li { margin: 0 0 .4rem; max-width: 72ch; }
.lp-tag {
  display: inline-block; font-size: var(--t-xs); font-weight: 600; letter-spacing: .02em;
  color: var(--accent); background: var(--accent-soft); border-radius: var(--r-s); padding: 0 .4rem; line-height: 1.6;
}

/* ---------- controls ---------- */
.lp-btn {
  font: inherit; font-size: var(--t-s); font-weight: 500; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-s);
  min-height: 34px; padding: .3rem .75rem; cursor: pointer; line-height: 1.2;
  transition: background-color .15s ease, border-color .15s ease;
}
.lp-btn:hover { background: var(--surface-2); border-color: var(--muted); }
.lp-btn:active { background: var(--accent-soft); }
.lp-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.lp-btn-soft { color: var(--accent); border-color: var(--accent); }
.lp-btn-danger { color: var(--lead-red); border-color: var(--lead-red); }
.lp-root :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse) { .lp-btn, .lp-seg button { min-height: 44px; } }

.lp-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); padding: 2px; gap: 2px; background: var(--surface); }
.lp-seg button {
  font: inherit; font-size: var(--t-s); font-weight: 500; color: var(--muted); background: transparent;
  border: 0; border-radius: calc(var(--r-s) - 2px); min-height: 30px; padding: .25rem .8rem; cursor: pointer;
}
.lp-seg button:hover { color: var(--ink); }
.lp-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.lp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0; }
.lp-status { color: var(--muted); font-size: var(--t-xs); font-variant-numeric: tabular-nums; margin-right: auto; }
.lp-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .35rem .5rem; border: 1px solid var(--lead-red); border-radius: var(--r-s); background: var(--surface); }
.lp-confirm span { font-size: var(--t-s); }

.lp-in {
  font: inherit; font-family: var(--f-mono); font-size: var(--t-s); font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px;
  padding: .2rem .35rem; width: 5.5em; text-align: right; min-height: 30px;
}
.lp-in:focus-visible { outline-offset: 0; border-color: var(--accent); }
.lp-in[aria-invalid="true"] { border-color: var(--warn); background: var(--surface); }
.lp-in-t { width: 4.2em; min-height: 28px; padding: .1rem .3rem; }

/* ---------- tables ---------- */
.lp-tablewrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); -webkit-overflow-scrolling: touch; }
.lp-t { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: .8125rem; white-space: nowrap; width: 100%; }
.lp-t th, .lp-t td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem .45rem; text-align: right; vertical-align: middle; }
.lp-t tr > :last-child { border-right: 0; }
.lp-t tbody tr:last-child > * { border-bottom: 0; }
.lp-t thead th { background: var(--surface-2); font-weight: 600; text-align: center; font-size: var(--t-xs); }
.lp-t thead .lp-crow th { font-family: var(--f-mono); font-weight: 400; color: var(--muted); }
.lp-t thead .lp-units th { font-weight: 500; color: var(--muted); }
.lp-t td { font-family: var(--f-mono); font-size: .78rem; }
.lp-t td.lp-div { color: var(--muted); }
.lp-t .lp-c-n { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; white-space: normal; min-width: 5.6rem; max-width: 7rem; border-right: 1px solid var(--line); }
.lp-t thead .lp-c-n { background: var(--surface-2); z-index: 2; }
.lp-rn { display: block; font-family: var(--f-mono); font-weight: 600; font-size: .8125rem; }
.lp-rcap { display: block; font-size: .6875rem; font-weight: 400; color: var(--muted); line-height: 1.25; }
.lp-t .lp-x { background: var(--surface-2); color: var(--muted); }
.lp-t thead .lp-x { color: var(--ink); }
.lp-t .lp-x1 { border-left: 1px dashed var(--muted); }
.lp-thsub { display: block; font-size: .625rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
.lp-t tr.lp-pending td { background: transparent; }
.lp-t tr.lp-pending .lp-rn { color: var(--muted); font-weight: 400; }
.lp-t tr.lp-latest > * { background: var(--accent-soft); }
.lp-t tr.lp-latest .lp-c-n { background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.lp-t tr.lp-flash > * { animation: lp-flash 1.4s ease-out; }
@keyframes lp-flash { 0%, 25% { background-color: color-mix(in srgb, var(--accent) 28%, transparent); } 100% { background-color: var(--accent-soft); } }
.lp-t .lp-c-del { width: 2.2rem; text-align: center; padding: 0 .2rem; }
.lp-x-btn { font: inherit; font-size: 1rem; color: var(--muted); background: transparent; border: 0; border-radius: var(--r-s); width: 28px; height: 28px; cursor: pointer; }
.lp-x-btn:hover { color: var(--lead-red); background: var(--surface-2); }

.lp-meters { border: 1px solid var(--line); border-radius: var(--r-s); padding: .6rem .75rem .5rem; margin: 0 0 .75rem; }
.lp-meters legend { font-weight: 600; padding: 0 .3rem; font-size: var(--t-s); }
.lp-meter { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; padding: .3rem 0; }
.lp-meter + .lp-meter { border-top: 1px solid var(--line); }
.lp-meter-name { font-weight: 600; min-width: 6.5rem; }
.lp-meter label { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: var(--t-xs); }
.lp-cout { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--accent); font-variant-numeric: tabular-nums; }
.lp-cout.lp-bad { color: var(--warn); }

/* ---------- formulas ---------- */
.lp-eqs { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.lp-eq { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .1rem 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.lp-eq-f { font-family: var(--f-body); font-size: var(--t-m); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lp-eq-n { color: var(--muted); font-size: var(--t-xs); }
.lp-steps { margin: 0; padding-left: 1.4rem; font-variant-numeric: tabular-nums; }
.lp-steps li { margin: 0 0 .35rem; padding-left: .2rem; }
.lp-steps li::marker { color: var(--muted); font-size: var(--t-xs); }
.lp-concl p { max-width: 72ch; }

/* ---------- graph ---------- */
.lp-graph { margin: 0; }
.lp-g-box { width: 100%; min-height: 1px; }
.lp-g { display: block; max-width: 100%; height: auto; overflow: visible; }
.lp-g-grid { stroke: var(--line); stroke-width: 1; fill: none; }
.lp-g-axis { stroke: var(--muted); stroke-width: 1; fill: none; }
.lp-g-tick { fill: var(--muted); font-family: var(--f-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.lp-g-title { fill: var(--ink); font-family: var(--f-body); font-size: 12px; font-weight: 600; }
.lp-g-tick-eta { fill: var(--good); }
.lp-g-ref { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.lp-g-reflab { fill: var(--ink); font-family: var(--f-body); font-size: 11px; font-weight: 500; }
.lp-g-sub { font-size: 8px; }
.lp-g-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lp-g-open { fill: var(--surface); stroke-width: 1.5; }
.lp-g-pt { stroke-width: 1.5; }
.lp-g-pt.lp-mk-circle, .lp-g-pt.lp-mk-diamond { stroke: var(--surface); stroke-width: 1; }
.lp-g-pt.lp-mk-square { fill: var(--surface); }
.lp-c-ab { stroke: var(--lead-red); } .lp-g-pt.lp-c-ab.lp-mk-circle { fill: var(--lead-red); }
.lp-c-bc { stroke: var(--accent); } .lp-g-pt.lp-c-bc.lp-mk-circle { fill: var(--accent); }
.lp-c-p { stroke: var(--ink); }
.lp-c-eta { stroke: var(--good); } .lp-g-pt.lp-c-eta.lp-mk-diamond { fill: var(--good); }
.lp-g-pt.lp-mk-square.lp-c-ab { stroke: var(--lead-red); }
.lp-g-pt.lp-mk-square.lp-c-bc { stroke: var(--accent); }
.lp-g-pt.lp-mk-square.lp-c-p { stroke: var(--ink); }
.lp-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .5rem; font-size: var(--t-xs); }
.lp-lg { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.lp-lg svg { flex: none; overflow: visible; }
.lp-g-cap { margin-top: .5rem; }

/* graph drawn on graph paper (protocol page 5) */
.lp-g-paper .lp-gp-minor { stroke: var(--warn); stroke-opacity: .16; stroke-width: .6; fill: none; }
.lp-g-paper .lp-gp-major { stroke: var(--warn); stroke-opacity: .36; stroke-width: .8; fill: none; }
.lp-g-paper .lp-g-grid { stroke: none; }
.lp-g-paper .lp-g-axis { stroke: var(--viewport); stroke-width: 1.2; }
.lp-g-paper .lp-g-tick, .lp-g-paper .lp-g-title, .lp-g-paper .lp-g-reflab, .lp-g-paper .lp-g-curvelab {
  fill: var(--pencil); font-family: var(--f-hand); font-size: 15px; font-weight: 500;
}
.lp-g-paper .lp-g-title { font-size: 16px; font-weight: 600; }
.lp-g-paper .lp-g-curvelab { font-size: 17px; font-weight: 600; }
.lp-g-paper .lp-g-sub { font-size: 11px; }
.lp-g-paper .lp-g-ref { stroke: var(--pencil); stroke-opacity: .6; }
.lp-g-paper .lp-g-line { stroke: var(--pencil); stroke-width: 1.5; }
.lp-g-paper .lp-g-open { fill: var(--paper); stroke: var(--pencil); }
.lp-g-paper .lp-g-pt.lp-g-pt.lp-g-pt { stroke: var(--pencil); fill: var(--paper); stroke-width: 1.3; }
.lp-g-paper .lp-g-pt.lp-g-pt.lp-g-pt.lp-mk-circle, .lp-g-paper .lp-g-pt.lp-g-pt.lp-g-pt.lp-mk-diamond { fill: var(--pencil); stroke: var(--paper); }

/* ---------- variant calculator ---------- */
.lp-varpick { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-bottom: .75rem; max-width: 30rem; }
.lp-varpick button {
  font: inherit; font-family: var(--f-mono); font-size: var(--t-s); color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: var(--r-s); min-height: 40px; padding: .15rem 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.lp-varpick button:hover { background: var(--surface-2); }
.lp-varpick button small { font-family: var(--f-body); font-size: .625rem; color: var(--accent); }
.lp-varpick button.lp-mine { border-color: var(--accent); }
.lp-varpick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.lp-varpick button[aria-pressed="true"] small { color: var(--accent-ink); }
.lp-varin { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .75rem; }
.lp-varin label { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: var(--t-xs); }
.lp-varout > p { max-width: 72ch; }
.lp-cond { font-size: var(--t-m); line-height: 1.45; }
.lp-cond .lp-tag { margin-right: .35rem; vertical-align: .1em; }
.lp-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 0 1.25rem; margin: .4rem 0 .9rem; border-top: 1px solid var(--line); }
.lp-kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.lp-kv dt { color: var(--muted); font-size: var(--t-xs); }
.lp-kv dd { margin: 0; font-family: var(--f-mono); font-size: .8125rem; font-variant-numeric: tabular-nums; text-align: right; }
.lp-kv-ov { grid-template-columns: 1fr; margin-bottom: 0; }
.lp-kv-ov > div { justify-content: flex-start; }
.lp-kv-ov dt { min-width: 6.5rem; }
.lp-kv-ov dd { text-align: left; font-family: var(--f-body); font-size: var(--t-s); }

/* ---------- quiz ---------- */
.lp-qprog { margin-bottom: .5rem; }
.lp-progress { display: flex; height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.lp-progress-known { background: var(--good); }
.lp-progress-unk { background: var(--warn); opacity: .55; }
.lp-qstat { font-size: var(--t-xs); color: var(--muted); margin: .4rem 0 0; font-variant-numeric: tabular-nums; }
.lp-qstat b { color: var(--ink); }
.lp-qsec { margin-top: 1.25rem; }
.lp-qsec .lp-h3 { padding-bottom: .4rem; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.lp-qsec .lp-h3 .lp-muted { font-family: var(--f-mono); font-size: var(--t-xs); margin-left: .3rem; }
.lp-qi { padding: .75rem 0 .8rem .75rem; border-bottom: 1px solid var(--line); border-left: 2px solid transparent; }
.lp-qlist > .lp-qi:first-child { border-top: 1px solid var(--line); }
.lp-qi[data-grade="y"] { border-left-color: var(--good); }
.lp-qi[data-grade="n"] { border-left-color: var(--warn); }
.lp-qhead { display: flex; gap: .5rem; align-items: center; min-height: 0; }
.lp-qhead:empty { display: none; }
.lp-qgroup { font-size: .6875rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lp-qmark { font-size: .6875rem; font-weight: 600; margin-left: auto; }
.lp-qmark:empty { display: none; }
.lp-qi[data-grade="y"] .lp-qmark { color: var(--good); }
.lp-qi[data-grade="n"] .lp-qmark { color: var(--warn); }
.lp-qq { font-family: var(--f-body); font-size: var(--t-m); font-weight: 600; line-height: 1.4; margin: .1rem 0 .55rem; max-width: 68ch; }
.lp-qa { max-width: 68ch; }
.lp-qa p { margin: 0 0 .6rem; }
.lp-qa:not([hidden]) { animation: lp-reveal .22s ease-out; }
@keyframes lp-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.lp-qgrade { display: flex; gap: .5rem; }
.lp-yes[aria-pressed="true"] { background: color-mix(in srgb, var(--good) 14%, transparent); border-color: var(--good); color: var(--good); }
.lp-no[aria-pressed="true"] { background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: var(--warn); color: var(--warn); }
.lp-empty-note { color: var(--muted); padding: 1rem 0; }

/* ---------- protocol ---------- */
.lp-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem 1.5rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.lp-page:first-of-type { border-top: 0; padding-top: 0; }
.lp-sheet-meta { font-size: var(--t-s); font-weight: 600; margin-bottom: .45rem; display: flex; align-items: center; gap: .5rem; }
.lp-sheet {
  background: var(--paper); color: var(--viewport); border: 1px solid var(--line); border-radius: 2px;
  padding: 5% 5.5%; font-size: .75rem; line-height: 1.35; min-width: 0;
}
.lp-guide .lp-list li { font-size: var(--t-s); }
.lp-pf { border: 1.5px solid var(--viewport); min-height: 100%; min-width: 0; display: flex; flex-direction: column; }
.lp-pf-lab { padding: .35rem .5rem .2rem; font-size: .75rem; }
.lp-pf-head { border-bottom: 1.5px solid var(--viewport); }
.lp-pf-uni { text-align: center; padding: .4rem .5rem; border-bottom: 1.5px solid var(--viewport); font-size: .75rem; line-height: 1.3; }
.lp-pf-uni b { letter-spacing: .06em; font-size: .8125rem; }
.lp-pf-top { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1.5px solid var(--viewport); }
.lp-pf-top > * + * { border-top: 1px solid var(--viewport); }
.lp-pf-brig, .lp-pf-me { padding: .35rem .5rem; display: grid; gap: .1rem; }
.lp-pf-c { text-align: center; }
.lp-pf-me small { display: block; font-size: .5625rem; text-align: right; }
.lp-under { text-decoration: underline; text-decoration-color: var(--pencil); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.lp-pf-no { text-align: center; font-weight: 700; font-size: .9375rem; padding: .6rem .5rem .2rem; }
.lp-pf-line { padding: .2rem .5rem .5rem; }
.lp-pf-box { padding-bottom: .5rem; }
.lp-pf-formulas { display: grid; grid-template-columns: 1fr; padding: 0 .5rem 0 1.2rem; }
.lp-pf-teacher { border-top: 1px solid var(--viewport); min-height: 4.5rem; margin-top: auto; }
.lp-pf-blank { flex: 1; min-height: 2rem; }
.lp-pf-scroll { overflow-x: auto; max-width: 100%; }
.lp-pf-fig { padding: .3rem .5rem .6rem; display: flex; justify-content: center; border-bottom: 1px solid transparent; }
.lp-pf-fig img { width: min(100%, 22rem); height: auto; mix-blend-mode: multiply; display: block; }
.lp-pf-steps { margin: 0; padding: 0 .5rem .6rem 1.8rem; }
.lp-pf-steps li { margin-bottom: .1rem; }
.lp-pf-concl { padding: 0 .5rem; }
.lp-pf-concl p { margin: 0 0 .25rem; }
.lp-pf-sign { align-self: flex-end; text-align: center; font-size: .625rem; padding: .8rem .6rem .5rem; }
.lp-pf-sign span { display: block; width: 9rem; border-bottom: 1px solid var(--viewport); margin-bottom: .15rem; height: 1rem; }
.lp-pf-graph { padding: .2rem .3rem .5rem; }

.lp-hand { font-family: var(--f-hand); color: var(--pencil); font-size: 1.22em; line-height: 1.15; font-weight: 500; }
.lp-hand-note { color: var(--pencil); opacity: .62; font-size: 1.05em; }
.lp-hand-ic { color: var(--pencil); text-align: center; }
.lp-sysicon { display: inline-block; vertical-align: middle; }

.lp-pt { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.lp-pt th, .lp-pt td { border: 1px solid var(--viewport); padding: .12rem .3rem; font-weight: 400; text-align: center; vertical-align: middle; }
.lp-pt caption { text-align: left; padding: .25rem .5rem; border: 1px solid var(--viewport); border-bottom: 0; }
.lp-pt-3 { white-space: nowrap; font-size: .75rem; }
.lp-pt-3 tbody th { font-weight: 400; }
.lp-pt-dev { font-size: .6875rem; }
.lp-pt-dev td { white-space: nowrap; }
.lp-pt-dev thead th { font-size: .625rem; line-height: 1.2; }
.lp-pt-sign th { text-align: left; font-size: .6875rem; }
.lp-pt-sign thead th { text-align: center; }
.lp-pt-sign td { min-width: 3.5rem; height: 1.5rem; }
.lp-pf-top .lp-pt-sign { border-style: hidden; }

/* ---------- files ---------- */
.lp-filelist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lp-filerow { border-bottom: 1px solid var(--line); }
.lp-file { display: grid; grid-template-columns: 2.8rem 1fr auto; grid-template-areas: "k t s" "k t a"; align-items: center; gap: 0 .75rem; padding: .7rem .25rem; color: var(--ink); text-decoration: none; border-radius: var(--r-s); }
.lp-file:hover { background: var(--surface-2); }
.lp-file-kind { grid-area: k; font-family: var(--f-mono); font-size: .6875rem; font-weight: 600; color: var(--accent); border: 1px solid var(--line); border-radius: var(--r-s); text-align: center; padding: .45rem 0; }
.lp-file-txt { grid-area: t; display: grid; min-width: 0; }
.lp-file-name { font-weight: 600; }
.lp-file-desc { color: var(--muted); font-size: var(--t-xs); }
.lp-file-size { grid-area: s; font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.lp-file-act { grid-area: a; font-size: var(--t-xs); color: var(--accent); font-weight: 600; text-align: right; }

.lp-desc { max-width: 72ch; }
.lp-desc p { margin: 0 0 .6rem; }
.lp-d-kicker { font-size: .6875rem; letter-spacing: .08em; color: var(--muted); margin-bottom: .2rem !important; }
.lp-d-no { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--accent); margin-bottom: .1rem !important; }
.lp-d-title { font-family: var(--f-display); font-size: var(--t-l); font-weight: 650; margin: 0 0 1rem; line-height: 1.2; }
.lp-d-sec { padding-top: .8rem; margin-top: .6rem; border-top: 1px solid var(--line); }
.lp-d-h { font-family: var(--f-display); font-size: var(--t-m); font-weight: 600; margin: 0 0 .5rem; }
.lp-d-h5 { font-size: var(--t-s); font-weight: 600; margin: .9rem 0 .4rem; }
.lp-d-item { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0 .2rem; }
.lp-d-num { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); padding-top: .15em; font-variant-numeric: tabular-nums; }
.lp-d-sub { list-style: none; margin: -.2rem 0 .7rem 2.6rem; padding: 0; }
.lp-d-sub li { margin-bottom: .2rem; }
.lp-d-var { list-style: none; margin: 0 0 .6rem; padding: 0; border-top: 1px solid var(--line); }
.lp-d-var li { display: grid; grid-template-columns: 2rem 1fr; padding: .3rem .25rem; border-bottom: 1px solid var(--line); }
.lp-d-var li.lp-mine { background: var(--accent-soft); }
.lp-d-fig { margin: .5rem 0 1rem; }
.lp-d-fig figcaption { font-size: var(--t-xs); color: var(--muted); margin-top: .4rem; text-align: center; }
.lp-d-table { margin: .3rem 0 .2rem; }
.lp-d-cap { font-size: var(--t-xs); color: var(--muted); }

.lp-fig { background: var(--paper); border-radius: var(--r-s); padding: .6rem; display: flex; justify-content: center; }
.lp-fig img { display: block; width: 100%; max-width: 30rem; height: auto; mix-blend-mode: multiply; }

/* ---------- overlays ---------- */
.lp-ov {
  max-width: 520px; width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-m); padding: .8rem .95rem .85rem; font-size: var(--t-s);
}
.lp-ov-h { font-family: var(--f-display); font-weight: 600; font-size: var(--t-s); margin-bottom: .55rem; }
.lp-ov .lp-fig { padding: .4rem; }
.lp-ov .lp-fig img { max-height: 44vh; width: auto; max-width: 100%; }
.lp-ov-leg { margin: .5rem 0 0; color: var(--muted); font-size: var(--t-xs); }
.lp-ov .lp-steps { font-size: var(--t-s); }
.lp-ov .lp-steps li { margin-bottom: .2rem; }
.lp-ov .lp-cond { font-size: var(--t-s); font-weight: 600; }
.lp-eqs-ov .lp-eq { padding: .3rem 0; }

/* ---------- wider containers ---------- */
@container (min-width: 560px) {
  .lp-pf-top { grid-template-columns: 1.35fr 1fr 1.2fr; }
  .lp-pf-top > * + * { border-top: 0; border-left: 1px solid var(--viewport); }
  .lp-pf-formulas { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
  .lp-eqs { grid-template-columns: 1fr; }
}
@container (min-width: 900px) {
  .lp-page { grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); align-items: start; }
  .lp-guide { padding-top: 1.9rem; }
  .lp-page { max-width: 72rem; }
  .lp-sheet { aspect-ratio: 210 / 297; overflow: hidden; }
  .lp-page:has(.lp-pt-3) .lp-sheet, .lp-page:has(.lp-pt-dev) .lp-sheet { aspect-ratio: auto; }
  .lp-quiz .lp-qlist, .lp-quiz .lp-qprog, .lp-quiz .lp-qtools { max-width: 52rem; }
  .lp-eqs { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
  .lp-calc .lp-graph { max-width: 60rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-root *, .lp-root *::before, .lp-root *::after { animation: none !important; transition: none !important; }
}
@media (prefers-contrast: more) {
  .lp-t th, .lp-t td, .lp-btn, .lp-seg { border-color: var(--muted); }
  .lp-foot, .lp-muted { color: var(--ink); }
}
