/* notebook.css - the Notebook page: nested bench-note lists, whole-picture figures, fractions, the calibration plot */

/* ── outline: ● ○ ■ ● by depth, like the notebook ── */
.nb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-body);
}
.nb-list .nb-list { margin-top: 0.15rem; }
.nb-list li { position: relative; padding: 0.2rem 0 0.2rem 1.25rem; }
.nb-list li.is-bare { padding-left: 0; }
.nb-list li.is-bare::before { display: none; }
.nb-list li strong { color: var(--text-strong); font-weight: 600; }
.nb-list li::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: calc(0.2rem + 0.85em - 3px);
    width: 6px;
    height: 6px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--primary-light);
}
.nb-list--d1 > li::before { background: none; border: 1.5px solid var(--primary-light); }
.nb-list--d2 > li::before { border-radius: 1px; width: 5px; height: 5px; }
.nb-list--d3 > li::before { width: 5px; height: 5px; }

/* numbered steps */
ol.nb-list { counter-reset: nb-step; }
ol.nb-list > li { counter-increment: nb-step; padding-left: 1.6rem; }
ol.nb-list > li::before {
    content: counter(nb-step) ".";
    width: auto;
    height: auto;
    top: 0.2rem;
    left: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-weight: 600;
    color: var(--text-muted);
}

/* ── figure: the whole picture at its own ratio, never wider than it is ── */
.nb-figure { margin: 1.2rem auto 0; max-width: 100%; }
.nb-figure-frame {
    width: min(100%, var(--w), calc(60vh * var(--ar)));
    aspect-ratio: var(--ar);
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    background: #e4ebe6;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.nb-figure-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.nb-figure-frame.is-missing img { visibility: hidden; }
.nb-caption {
    margin: 0.6rem auto 0;
    max-width: 36rem;
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.55;
    text-align: center;
    color: var(--text-muted);
}

/* ── equation: lhs = numerator over denominator ── */
.nb-equation { margin: 1rem 0; text-align: center; color: var(--text-strong); font-size: 0.98rem; }
.nb-eq { display: inline-flex; align-items: center; gap: 0.5rem; font-style: italic; }
.nb-eq-op { font-style: normal; }
.nb-frac { display: inline-flex; flex-direction: column; align-items: center; }
.nb-frac-num { padding: 0 0.3rem 0.15rem; border-bottom: 1.5px solid currentColor; }
.nb-frac-den { padding: 0.15rem 0.3rem 0; }

/* ── curve: points with error bars, fit line, legend, stats ── */
.nb-curve { margin: 1.4rem 0 0.4rem; }
.nb-curve-plot { position: relative; max-width: 640px; margin: 0 auto; }
.nb-curve-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.nb-curve-axes text { font-size: 13px; fill: var(--text-muted); }
.nb-curve-axes .nb-curve-title { font-size: 14px; fill: var(--text-body); }
.nb-curve-grid { stroke: rgba(49,64,49,0.08); stroke-width: 1; }
.nb-curve-axis { stroke: rgba(49,64,49,0.45); stroke-width: 1; }
.nb-curve-fit { stroke: var(--series-1); stroke-width: 2; stroke-linecap: round; }
.nb-curve-mark { fill: var(--text-strong); stroke: var(--page-bg, #fff); stroke-width: 2; paint-order: stroke; }
.nb-curve-err { stroke: var(--text-strong); stroke-width: 1.25; fill: none; }
.nb-curve-hit { fill: transparent; cursor: default; }
.nb-curve-point { outline: none; }
.nb-curve-point.is-on .nb-curve-mark,
.nb-curve-point:focus-visible .nb-curve-mark { fill: var(--series-1); }
.nb-curve-tip {
    position: absolute;
    transform: translate(-50%, calc(-100% - 14px));
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.94);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-body);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.nb-curve-tip.is-on { opacity: 1; }
.nb-curve-tip strong { display: block; color: var(--text-strong); font-weight: 600; }

.nb-curve-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.4rem;
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    font-size: 0.82rem;
    color: var(--text-body);
}
.nb-curve-legend li { display: flex; align-items: center; gap: 0.45rem; }
.nb-curve-key { display: inline-block; }
.nb-curve-key--mark { width: 10px; height: 10px; border-radius: 1.5px; background: var(--text-strong); }
.nb-curve-key--fit { width: 22px; height: 2px; border-radius: 1px; background: var(--series-1); }

.nb-curve-stats { width: auto; max-width: 100%; margin: 1rem auto 0; font-size: 0.82rem; }
.nb-curve-stats td { text-align: center; }

/* ── tables: headers keep their case, so µg/mL never reads as MG/ML ── */
.project-main .content-table thead th { text-transform: none; letter-spacing: 0.2px; font-size: 0.78rem; white-space: normal; }
.project-main .content-table th, .project-main .content-table td { padding: 0.6rem 0.7rem; }
.project-main .content-tablewrap { margin-block: 0.4rem 1.2rem; }
.project-main .content-table-scroll { padding-bottom: 6px; }

/* ── dark mode ── */
html[data-dark] .nb-list li::before { background: rgba(157,190,150,0.7); }
html[data-dark] .nb-list--d1 > li::before { background: none; border-color: rgba(157,190,150,0.7); }
html[data-dark] ol.nb-list > li::before { background: none; }
html[data-dark] .nb-figure-frame { background: var(--d-tint); box-shadow: none; }
html[data-dark] .nb-curve-grid { stroke: var(--d-hairline); }
html[data-dark] .nb-curve-axis { stroke: var(--d-hairline-2); }
html[data-dark] .nb-curve-mark { stroke: var(--d-page-solid); }
html[data-dark] .nb-curve-tip { background: var(--d-page-solid); box-shadow: 0 6px 20px var(--d-shadow); }

@media (forced-colors: active) {
    .nb-list li::before, .nb-curve-key { background: CanvasText; border-color: CanvasText; }
    .nb-curve-fit, .nb-curve-err, .nb-curve-axis { stroke: CanvasText; }
    .nb-curve-mark { fill: CanvasText; }
}

@media (max-width: 700px) {
    .project-main .content-table th, .project-main .content-table td { padding: 0.5rem 0.55rem; }
}

@media (max-width: 700px) {
    .project-main .content-table--m-stack tbody td[data-label]::before { text-transform: none; letter-spacing: 0.2px; font-size: 0.78rem; }
}
