.lab-help-open { overflow: hidden; }
.lab-help-center { position: fixed; inset: 0; z-index: 10050; color: var(--bs-body-color, #172033); }
.lab-help-center[hidden] { display: none; }
.lab-help-backdrop { position: absolute; inset: 0; background: rgb(15 23 42 / .68); backdrop-filter: blur(3px); }
.lab-help-dialog { position: absolute; inset: clamp(12px, 3vw, 34px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--bs-border-color, #dce3ec); border-radius: 20px; background: var(--bs-body-bg, #fff); box-shadow: 0 28px 80px rgb(15 23 42 / .3); }
.lab-help-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--bs-border-color, #dce3ec); }
.lab-help-header h1 { margin: 2px 0 0; font-size: clamp(1.15rem, 2.3vw, 1.65rem); }
.lab-help-eyebrow { color: var(--bs-primary, #2563eb); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lab-help-close { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--bs-border-color, #dce3ec); border-radius: 12px; color: inherit; background: transparent; }
.lab-help-layout { min-height: 0; display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); }
.lab-help-sidebar { min-height: 0; overflow: auto; padding: 16px; border-right: 1px solid var(--bs-border-color, #dce3ec); background: color-mix(in srgb, var(--bs-body-bg, #fff) 92%, var(--bs-primary, #2563eb)); }
.lab-help-search input { width: 100%; padding: 10px 12px; border: 1px solid var(--bs-border-color, #dce3ec); border-radius: 10px; color: inherit; background: var(--bs-body-bg, #fff); }
.lab-help-navigation { margin-top: 16px; }
.lab-help-nav-group + .lab-help-nav-group { margin-top: 16px; }
.lab-help-nav-group h2 { margin: 0 8px 5px; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--bs-secondary-color, #64748b); }
.lab-help-nav-group button { display: block; width: 100%; padding: 7px 9px; border: 0; border-radius: 8px; color: inherit; background: transparent; text-align: left; font-size: .86rem; }
.lab-help-nav-group button:hover, .lab-help-nav-group button:focus-visible { background: color-mix(in srgb, var(--bs-primary, #2563eb) 12%, transparent); outline: none; }
.lab-help-content { min-width: 0; overflow: auto; scroll-behavior: smooth; padding: clamp(20px, 4vw, 48px); }
.lab-help-article { max-width: 940px; margin: 0 auto 46px; scroll-margin-top: 18px; outline: none; }
.lab-help-article h2 { margin: 4px 0 10px; font-size: clamp(1.25rem, 2vw, 1.75rem); }
.lab-help-article h3 { font-size: 1rem; }
.lab-help-lead { font-size: 1.04rem; color: var(--bs-secondary-color, #526071); }
.lab-help-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.lab-help-badge { padding: 4px 7px; border-radius: 999px; background: color-mix(in srgb, var(--bs-primary, #2563eb) 13%, transparent); color: var(--bs-primary, #2563eb); font-size: .64rem; font-weight: 800; letter-spacing: .04em; }
.lab-help-badge.is-not-modeled, .lab-help-badge.is-unverified { color: #b45309; background: rgb(245 158 11 / .14); }
.lab-help-facts { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); border-top: 1px solid var(--bs-border-color, #dce3ec); }
.lab-help-facts dt, .lab-help-facts dd { margin: 0; padding: 9px; border-bottom: 1px solid var(--bs-border-color, #dce3ec); overflow-wrap: anywhere; }
.lab-help-facts dt { font-weight: 700; }
.lab-help-formula { margin-top: 18px; padding: 16px; border-left: 4px solid var(--bs-primary, #2563eb); border-radius: 0 12px 12px 0; background: color-mix(in srgb, var(--bs-primary, #2563eb) 7%, var(--bs-body-bg, #fff)); overflow-x: auto; }
.lab-help-formula code { display: block; width: max-content; min-width: 100%; padding: 12px; border-radius: 8px; color: inherit; background: rgb(15 23 42 / .08); font-size: .95rem; }

.labs-formula-help-trigger { display: inline-grid; width: 1.35rem; height: 1.35rem; flex: 0 0 auto; margin-inline-start: .25rem; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--bs-primary, #2563eb); background: transparent; font-size: .76rem; line-height: 1; vertical-align: middle; }
.labs-formula-help-trigger:hover, .labs-formula-help-trigger:focus-visible { background: color-mix(in srgb, var(--bs-primary, #2563eb) 12%, transparent); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--bs-primary, #2563eb) 22%, transparent); }
.labs-derived-value { display: inline-flex; min-width: 0; align-items: center; justify-content: flex-end; gap: .1rem; }
.labs-formula-help-dialog { width: min(34rem, calc(100vw - 2rem)); max-height: min(82vh, 44rem); padding: 0; overflow: auto; border: 1px solid var(--bs-border-color, #d7dde8); border-radius: .9rem; color: var(--bs-body-color, #172033); background: var(--bs-body-bg, #fff); box-shadow: 0 1.5rem 5rem rgb(15 23 42 / .3); }
.labs-formula-help-dialog::backdrop { background: rgb(15 23 42 / .52); backdrop-filter: blur(2px); }
.labs-formula-help-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--bs-border-color, #d7dde8); }
.labs-formula-help-dialog header small { color: var(--bs-primary, #2563eb); font-size: .64rem; font-weight: 800; letter-spacing: .1em; }
.labs-formula-help-dialog h2 { margin: .15rem 0 0; font-size: 1rem; }
.labs-formula-help-dialog header button { border: 0; color: inherit; background: transparent; }
.labs-formula-help-body { display: grid; gap: .8rem; padding: 1rem 1.1rem 1.1rem; }
.labs-formula-help-current { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .8rem; border-radius: .6rem; background: color-mix(in srgb, var(--bs-primary, #2563eb) 8%, var(--bs-body-bg, #fff)); }
.labs-formula-help-current span, .labs-formula-help-dialog h3, .labs-formula-help-dialog footer span { color: var(--bs-secondary-color, #64748b); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; }
.labs-formula-help-current strong { font-size: 1rem; }
.labs-formula-help-dialog section { min-width: 0; }
.labs-formula-help-dialog h3 { margin: 0 0 .3rem; }
.labs-formula-help-dialog section code { display: block; padding: .65rem .75rem; overflow-wrap: anywhere; white-space: pre-wrap; border-radius: .5rem; color: inherit; background: var(--bs-tertiary-bg, #f2f5f9); }
.labs-formula-help-dialog p { margin: 0; color: var(--bs-secondary-color, #64748b); font-size: .76rem; }
.labs-formula-help-dialog footer { display: grid; gap: .25rem; padding-top: .75rem; border-top: 1px solid var(--bs-border-color, #d7dde8); }
.labs-formula-help-dialog footer code { overflow-wrap: anywhere; font-size: .72rem; }
.lab-help-limitation { color: #b45309; font-weight: 650; }
.lab-help-source { display: block; margin-top: 14px; color: var(--bs-secondary-color, #64748b); }
.lab-help-empty { padding: 28px; border: 1px dashed var(--bs-border-color, #dce3ec); border-radius: 12px; text-align: center; }
@media (max-width: 720px) {
    .lab-help-dialog { inset: 0; border: 0; border-radius: 0; }
    .lab-help-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .lab-help-sidebar { max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--bs-border-color, #dce3ec); }
    .lab-help-navigation { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 70vw); gap: 10px; overflow-x: auto; }
    .lab-help-nav-group + .lab-help-nav-group { margin-top: 0; }
    .lab-help-content { padding: 20px 16px; }
    .lab-help-facts { grid-template-columns: 1fr; }
    .lab-help-facts dt { border-bottom: 0; padding-bottom: 2px; }
    .lab-help-facts dd { padding-top: 2px; }
}
