/* Opt-in lesson reading profile. Topic colour and global display preferences keep their owners. */
html[data-reading-text-profile="expanded"] { --reading-increment: 2px; }
html[data-reading-text-profile="expanded"][data-reading-text-size="small"] { --reading-increment: 0px; }
html[data-reading-text-profile="expanded"][data-reading-text-size="large"] { --reading-increment: 5.5px; }
html[data-reading-text-profile="expanded"] .unit-article {
    --unit-text-body: calc(16.5px + var(--reading-increment));
    --unit-text-detail: calc(15.5px + var(--reading-increment));
    --unit-text-copy: calc(15px + var(--reading-increment));
    --unit-text-support: calc(14.5px + var(--reading-increment));
    --unit-text-small: calc(14px + var(--reading-increment));
    --unit-text-emphasis: calc(17px + var(--reading-increment));
    --unit-text-heading-small: calc(16px + var(--reading-increment));
    --unit-text-heading-medium: calc(17px + var(--reading-increment));
    --unit-text-heading-large: calc(18px + var(--reading-increment));
    width: 100%; max-width: none; min-width: 0;
}
html[data-reading-text-profile="expanded"] body.unit-shell-v2 { background: #fff; }
/* One interval between Parts; paragraph and task spacing belong inside each Part. */
html[data-reading-text-profile="expanded"] .unit-article { gap: 0; }
html[data-reading-text-profile="expanded"] .unit-article > .unit-section + .unit-section { margin-top: 56px; }
html[data-reading-text-profile="expanded"] [data-unit-visual-extension] {
    --unit-text-body: 16.5px; --unit-text-detail: 15.5px; --unit-text-copy: 15px;
    --unit-text-support: 14.5px; --unit-text-small: 14px; --unit-text-emphasis: 17px;
    --unit-text-heading-small: 16px; --unit-text-heading-medium: 17px; --unit-text-heading-large: 18px;
}
html[data-reading-text-profile="expanded"] .unit-shell-workspace {
    width: min(1320px, calc(100% - 48px)); max-width: 1320px;
    display: grid; grid-template-columns: 148px minmax(0, 1080px);
    gap: 28px; padding: 32px 0 64px; align-items: start;
}
html[data-reading-text-profile="expanded"] .unit-shell-header-inner { max-width: 1320px; }
html[data-reading-text-profile="expanded"] .unit-action-rail {
    grid-column: 2; position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
html[data-reading-text-profile="expanded"] .unit-toc-panel { border: 0; padding: 0; background: transparent; box-shadow: none; }
html[data-reading-text-profile="expanded"] .unit-toc-list a { padding: 9px 7px; font-size: 12.5px; }
html[data-reading-text-profile="expanded"] .unit-section {
    border: 0; background: transparent; box-shadow: none;
    border-radius: 0; padding: 0; margin: 0;
}
html[data-reading-text-profile="expanded"] .unit-section h2 { font-size: 30px; line-height: 1.3; letter-spacing: -.025em; }
html[data-reading-text-profile="expanded"] .unit-section-heading { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
html[data-reading-text-profile="expanded"] .unit-section-number { width: 34px; background: transparent; border-radius: 0; }
html[data-reading-text-profile="expanded"] .unit-section-lead { font-size: var(--unit-text-body); line-height: 1.75; max-width: 80ch; margin-bottom: 0; }
html[data-reading-text-profile="expanded"] .unit-content-block { margin: 28px 0 0; }
html[data-reading-text-profile="expanded"] .unit-section > :last-child { margin-bottom: 0; }
html[data-reading-text-profile="expanded"] .unit-block-paragraph { max-width: none; }
html[data-reading-text-profile="expanded"] .unit-block-paragraph p { max-width: 80ch; line-height: 1.75; }
html[data-reading-text-profile="expanded"] .unit-block-paragraph + .unit-block-paragraph { margin-top: 14px; }
html[data-reading-text-profile="expanded"] .unit-term-hint { background: transparent; border: 0; padding: 0; box-shadow: none; margin: 0 0 24px; }
/* Explanation stays on the page; filled surfaces identify an activity or a question. */
html[data-reading-text-profile="expanded"] :is(.unit-block-definition, .unit-block-formula, .unit-block-misconception, .unit-block-exam_tip) { box-shadow: none; background: transparent; border: 0; border-radius: 0; padding: 0; }
html[data-reading-text-profile="expanded"] :is(.unit-block-misconception, .unit-block-exam_tip) .unit-block-identity { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
html[data-reading-text-profile="expanded"] :is(.unit-block-misconception, .unit-block-exam_tip) p { max-width: 80ch; line-height: 1.7; }
html[data-reading-text-profile="expanded"] .unit-block-definition::before { display: none; }
html[data-reading-text-profile="expanded"] .unit-lesson-transition { display: block; border: 0; background: transparent; border-radius: 0; padding: 0; margin-top: 28px; box-shadow: none; }
html[data-reading-text-profile="expanded"] .unit-lesson-transition-label { display: block; width: fit-content; padding: 0; background: transparent; color: var(--unit-muted); font-size: 12px; letter-spacing: .04em; margin-bottom: 7px; }
html[data-reading-text-profile="expanded"] .unit-lesson-transition p { font-size: var(--unit-text-copy); line-height: 1.75; color: var(--unit-muted); }
html[data-reading-text-profile="expanded"] .unit-block-worked_example { border: 0; border-radius: 0; padding: 0; margin-top: 36px; background: transparent; box-shadow: none; }
html[data-reading-text-profile="expanded"] :is(.unit-block-worked_example, .unit-block-derivation) .unit-block-identity { gap: 7px; }
html[data-reading-text-profile="expanded"] :is(.unit-block-worked_example, .unit-block-derivation) .unit-block-label { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
html[data-reading-text-profile="expanded"] :is(.unit-block-worked_example, .unit-block-derivation) .unit-block-title { font-size: calc(var(--unit-text-body) + 2px); font-weight: 650; line-height: 1.4; color: var(--unit-deep); }
html[data-reading-text-profile="expanded"] .unit-block-worked_example > p { margin-top: 12px; font-size: var(--unit-text-body); line-height: 1.75; }
html[data-reading-text-profile="expanded"] .unit-worked-solution { display: block; margin: 0 0 0 28px; padding-top: 18px; max-width: none; }
html[data-reading-text-profile="expanded"] .unit-step-list { list-style: none; counter-reset: worked-step; padding: 0; margin: 0; display: grid; gap: 16px; min-width: 0; }
html[data-reading-text-profile="expanded"] .unit-step-list li { counter-increment: worked-step; position: relative; min-width: 0; overflow-wrap: anywhere; margin: 0; padding: 0 0 0 46px; font-size: var(--unit-text-body); line-height: 1.8; }
html[data-reading-text-profile="expanded"] .unit-step-list li::before { content: counter(worked-step, decimal-leading-zero); position: absolute; left: 0; top: 1px; color: var(--unit-accent); font-size: 14px; font-weight: 650; line-height: 28px; }
html[data-reading-text-profile="expanded"] .unit-worked-answer { display: block; border: 0; margin: 18px 0 0 46px; padding: 0; background: transparent; min-width: 0; }
html[data-reading-text-profile="expanded"] .unit-worked-answer > strong { display: inline; font-size: 12px; letter-spacing: .04em; margin: 0 12px 0 0; }
html[data-reading-text-profile="expanded"] .unit-worked-answer p { display: inline; margin: 0; font-size: var(--unit-text-body); line-height: 1.8; }
html[data-reading-text-profile="expanded"] .unit-worked-answer.is-formula-result { display: grid; justify-items: center; gap: 4px; margin-left: 0; text-align: center; }
html[data-reading-text-profile="expanded"] .unit-worked-answer.is-formula-result > strong { margin: 0; }
html[data-reading-text-profile="expanded"] .unit-worked-answer.is-formula-result p { font-size: calc(var(--unit-text-body) + 4px); }
/* Read the complete argument before its conclusion; neither needs a reserved side column. */
html[data-reading-text-profile="expanded"] .unit-block-derivation { padding: 0; margin-top: 36px; border: 0; border-radius: 0; background: transparent; }
html[data-reading-text-profile="expanded"] .unit-derivation-intro { max-width: none; margin-top: 12px; font-size: var(--unit-text-body) !important; line-height: 1.75 !important; }
html[data-reading-text-profile="expanded"] .unit-derivation-body { gap: 16px; margin-top: 20px; padding: 0; }
html[data-reading-text-profile="expanded"] .unit-derivation-reasoning { gap: 12px; padding: 0; }
html[data-reading-text-profile="expanded"] .unit-derivation-steps { gap: 14px; }
html[data-reading-text-profile="expanded"] .unit-derivation-conclusion { min-width: 0; display: grid; gap: 16px; margin: 4px 0 0; }
html[data-reading-text-profile="expanded"] .unit-derivation-formula { justify-content: center; text-align: center; padding-block: 10px; }
html[data-reading-text-profile="expanded"] .unit-derivation-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; padding: 0; }
html[data-reading-text-profile="expanded"] .unit-derivation-facts > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; min-height: 0; padding: 0; }
html[data-reading-text-profile="expanded"] .unit-block-checkpoint { border: 0; border-radius: 12px; background: color-mix(in srgb, var(--unit-accent) 6%, white); padding: 24px 28px; margin: 32px 0 0; box-shadow: none; }
html[data-reading-text-profile="expanded"] .unit-block-checkpoint .unit-block-title { font-size: 16px; color: var(--unit-accent); margin-bottom: 14px; }
html[data-reading-text-profile="expanded"] .unit-checkpoint-reveal summary { min-height: 44px; align-content: center; }
html[data-reading-text-profile="expanded"] .unit-practice-card { margin: 28px 0 0; box-shadow: none; border-radius: 14px; background: color-mix(in srgb, var(--unit-accent) 3%, #f9fafb); }
html[data-reading-text-profile="expanded"] .unit-checkpoint-answer { border: 0; padding-left: 0; }
/* Preserve each model's measured border width, padding and drawing geometry. */
html[data-reading-text-profile="expanded"] .unit-article > .unit-section > [data-unit-visual-extension] { box-shadow: none; border-color: color-mix(in srgb, var(--unit-accent) 16%, #fff); background: color-mix(in srgb, var(--unit-accent) 3%, #fff); }
/* Only place an entry already admitted by the Unit's existing role gate. */
html[data-reading-text-profile="expanded"] .unit-shell-hero { background: var(--unit-hero-background); color: #fff; padding: 0; border: 0; box-shadow: none; }
html[data-reading-text-profile="expanded"] .unit-shell-hero::before,
html[data-reading-text-profile="expanded"] .unit-shell-hero::after { display: none; }
html[data-reading-text-profile="expanded"] .unit-shell-hero-inner { width: min(1320px, calc(100% - 48px)); max-width: 1320px; padding: 34px 22px; margin: auto; }
html[data-reading-text-profile="expanded"] .unit-hero-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .13em; margin: 0 0 8px; color: #ffffffcc; }
html[data-reading-text-profile="expanded"] .unit-hero-eyebrow::before { display: none; }
html[data-reading-text-profile="expanded"] .unit-shell-hero h1 { font-family: var(--ph-font-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif); font-size: clamp(30px, 3.5vw, 46px); font-weight: 650; line-height: 1.15; letter-spacing: -.035em; margin: 0 0 14px; color: #fff; }
html[data-reading-text-profile="expanded"] .unit-hero-subtitle { font-size: 17px; line-height: 1.6; max-width: 740px; margin: 0; color: #ffffffcc; }
html[data-reading-text-profile="expanded"] .unit-shell-hero .unit-hero-meta { display: flex; gap: 10px; margin-top: 20px; }
html[data-reading-text-profile="expanded"] .unit-hero-meta > span { display: none; }
html[data-reading-text-profile="expanded"] .unit-practice-entry { display: flex; align-items: center; gap: 18px; }
html[data-reading-text-profile="expanded"] .unit-shell-hero-inner.has-reading-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 36px; align-items: center; }
html[data-reading-text-profile="expanded"] .unit-reading-hero-copy { min-width: 0; }
html[data-reading-text-profile="expanded"] .unit-reading-hero-actions { min-width: 0; }
html[data-reading-text-profile="expanded"] .unit-reading-hero-actions .unit-classroom-entry { display: block; border: 0; border-radius: 0; overflow: visible; background: transparent; box-shadow: none; padding: 0; margin: 0; }
html[data-reading-text-profile="expanded"] .unit-reading-hero-actions .unit-classroom-entry::before { content: none; }
html[data-reading-text-profile="expanded"] .unit-reading-hero-actions .unit-classroom-entry-copy,
html[data-reading-text-profile="expanded"] .unit-reading-hero-actions .unit-classroom-entry-mark,
html[data-reading-text-profile="expanded"] .unit-reading-hero-actions .unit-classroom-entry-arrow { display: none; }
/* Quiet navigation controls share the existing control radius and keep the topic banner dominant. */
html[data-reading-text-profile="expanded"] .unit-shell-hero :is(.unit-builder-secondary, .homework-entry-link, .unit-classroom-entry-action) {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; margin: 0; padding: 10px 14px;
    border: 1px solid #ffffff40; border-radius: var(--ph-radius-control, 10px);
    background: #ffffff0d; color: #fffffff2; box-shadow: none;
    font-family: inherit; font-size: var(--unit-text-action, 14px); font-weight: 600; line-height: 1.2;
    letter-spacing: 0; text-decoration: none; white-space: nowrap;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    transition: background-color .16s ease, border-color .16s ease;
}
html[data-reading-text-profile="expanded"] .unit-shell-hero :is(.unit-builder-secondary, .homework-entry-link, .unit-classroom-entry-action):hover {
    background: #ffffff1f; border-color: #ffffff73; color: #fff; text-decoration: none; transform: none;
}
html[data-reading-text-profile="expanded"] .unit-shell-hero :is(.unit-builder-secondary, .homework-entry-link, .unit-classroom-entry-action):active { background: #ffffff2b; }
html[data-reading-text-profile="expanded"] .unit-shell-hero :is(.unit-builder-secondary, .homework-entry-link, .unit-classroom-entry-action):focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 760px) {
    html[data-reading-text-profile="expanded"] .unit-shell-workspace { display: block; width: calc(100% - 36px); padding: 26px 0 48px; }
    html[data-reading-text-profile="expanded"] .unit-toc-panel { background: #fff; padding: 18px; box-shadow: var(--unit-shadow-overlay); }
    html[data-reading-text-profile="expanded"] .unit-action-rail { margin-top: 32px; }
    html[data-reading-text-profile="expanded"] .unit-shell-hero-inner.has-reading-actions { grid-template-columns: 1fr; gap: 22px; }
    html[data-reading-text-profile="expanded"] .unit-mobile-toc-toggle { min-height: 44px; padding: 8px 12px; border-radius: 12px; }
    html[data-reading-text-profile="expanded"] .unit-mobile-current-label { display: none; }
}
@media (max-width: 560px) {
    html[data-reading-text-profile="expanded"] .unit-shell-hero-inner { width: calc(100% - 32px); padding: 25px 4px; }
    html[data-reading-text-profile="expanded"] .unit-section h2 { font-size: 26px; }
    html[data-reading-text-profile="expanded"] .unit-article > .unit-section + .unit-section { margin-top: 44px; }
    html[data-reading-text-profile="expanded"] .unit-worked-solution { margin-left: 4px; }
    html[data-reading-text-profile="expanded"] .unit-step-list li { padding-left: 36px; }
    html[data-reading-text-profile="expanded"] .unit-worked-answer { margin-left: 36px; }
    html[data-reading-text-profile="expanded"] .unit-block-derivation { padding: 0; }
    html[data-reading-text-profile="expanded"] .unit-derivation-conclusion { margin-left: 0; }
    html[data-reading-text-profile="expanded"] .unit-block-checkpoint { padding: 20px 18px; }
    html[data-reading-text-profile="expanded"] .unit-action-rail { display: block; }
}
@media (max-width: 620px) and (orientation: portrait) {
    html[data-reading-text-profile="expanded"] .unit-reading-hero-actions { display: none; }
}

html[data-reading-text-profile="expanded"] .unit-step-list mjx-container { display: inline-block !important; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: -.25em; }
html[data-reading-text-profile="expanded"] .unit-lesson-transition-arrow { display: none; }

/* Keep accessible MathML available without extending a visible formula's scroll bounds. */
html[data-reading-text-profile="expanded"] .unit-article mjx-assistive-mml { width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* Multi-row worked equation groups are displayed between their surrounding sentences. */
html[data-reading-text-profile="expanded"] .unit-block-worked_example mjx-container.unit-reading-display-math { display: block !important; width: 100%; max-width: 100%; margin: 12px 0 !important; overflow-x: auto; overflow-y: hidden; text-align: center; vertical-align: baseline; }
