.tm-reading-progress { position: fixed; inset: 0 0 auto; z-index: 100; height: 3px; background: transparent; pointer-events: none; }
.tm-reading-progress span { display: block; width: 0; height: 100%; background: var(--tm-accent); transition: width .08s linear; }
.tm-lesson-hero { padding: 30px 0 52px; background: linear-gradient(180deg, var(--tm-accent-soft), #fff 78%); border-bottom: 1px solid var(--tm-border); }
.tm-lesson-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 64px; align-items: end; }
.tm-lesson-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--tm-muted); font-size: 13px; font-weight: 700; }
.tm-lesson-meta-line .tm-eyebrow { margin: 0; }
.tm-lesson-hero h1 { max-width: 880px; margin: 17px 0 18px; font-size: clamp(38px, 5vw, 64px); line-height: 1.02; letter-spacing: -.05em; }
.tm-lesson-deck { max-width: 870px; margin: 0; color: var(--tm-text-soft); font-size: 18px; line-height: 1.75; }

.tm-scope-note { display: grid; gap: 7px; max-width: 870px; margin-top: 20px; padding: 16px 18px; color: var(--tm-text-soft); border: 1px solid color-mix(in srgb, var(--tm-accent) 24%, var(--tm-border)); border-left: 4px solid var(--tm-accent); border-radius: 12px; background: rgba(255,255,255,.82); font-size: 14px; line-height: 1.6; }
.tm-scope-note strong { color: var(--tm-text); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.tm-scope-note a { width: fit-content; color: var(--tm-accent); font-weight: 760; text-underline-offset: 3px; }

.tm-lesson-facts { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 24px; color: var(--tm-muted); font-size: 13px; font-weight: 700; }
.tm-lesson-facts span { display: inline-flex; align-items: center; gap: 7px; }
.tm-lesson-facts svg { width: 17px; height: 17px; fill: var(--tm-accent); }
.tm-lesson-status-card { padding: 22px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius-md); background: rgba(255,255,255,.92); box-shadow: var(--tm-shadow-md); }
.tm-lesson-status-card > strong { display: block; margin: 10px 0; color: var(--tm-accent); font-size: 34px; letter-spacing: -.04em; }
.tm-lesson-status-card p { min-height: 18px; margin: 12px 0 0; color: var(--tm-muted); font-size: 12px; line-height: 1.5; }
.tm-article-layout { display: grid; grid-template-columns: minmax(0, 760px) 270px; justify-content: space-between; gap: 68px; padding-top: 66px; padding-bottom: 88px; }
.tm-lesson-article { min-width: 0; }
.tm-learning-objectives { padding: 28px; margin-bottom: 52px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius-lg); background: var(--tm-surface-soft); }
.tm-learning-objectives h2, .tm-article-section h2, .tm-practice-card h2, .tm-takeaway-card h2, .tm-complete-panel h2 { margin: 7px 0 16px; font-size: clamp(27px, 3vw, 36px); line-height: 1.18; letter-spacing: -.035em; }
.tm-learning-objectives ul, .tm-takeaway-card ul { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.tm-learning-objectives li, .tm-takeaway-card li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 11px; align-items: start; color: var(--tm-text-soft); line-height: 1.65; }
.tm-learning-objectives li > span, .tm-takeaway-card li > span { display: grid; place-items: center; width: 23px; height: 23px; margin-top: 1px; color: var(--tm-accent); background: var(--tm-accent-soft); border-radius: 50%; }
.tm-learning-objectives svg, .tm-takeaway-card svg { width: 15px; height: 15px; fill: currentColor; }
.tm-article-section { scroll-margin-top: 34px; margin-bottom: 54px; }
.tm-article-section p { margin: 0 0 18px; color: var(--tm-text-soft); font-size: 17px; line-height: 1.85; }
.tm-instruction-steps, .tm-practice-card ol { display: grid; gap: 14px; padding: 0; margin: 25px 0 0; list-style: none; }
.tm-instruction-steps li, .tm-practice-card ol li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; align-items: start; }
.tm-instruction-steps li > span, .tm-practice-card ol li > span { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; background: var(--tm-accent); border-radius: 12px; font-weight: 800; }
.tm-instruction-steps p, .tm-practice-card ol p { margin: 4px 0 0; }
.tm-checkpoint-box { padding: 22px; margin-top: 26px; border-left: 4px solid var(--tm-accent); border-radius: 0 12px 12px 0; background: var(--tm-accent-soft); }
.tm-checkpoint-box strong { display: block; margin-bottom: 10px; }
.tm-checkpoint-box ul { padding-left: 21px; margin: 0; color: var(--tm-text-soft); }
.tm-checkpoint-box li { margin: 7px 0; line-height: 1.55; }
.tm-practice-card { scroll-margin-top: 34px; padding: 30px; margin: 58px 0; border-radius: var(--tm-radius-lg); color: #fff; background: linear-gradient(145deg, var(--tm-text), #1d3557); box-shadow: var(--tm-shadow-md); }
.tm-practice-card .tm-kicker { color: color-mix(in srgb, var(--tm-accent) 65%, #fff); }
.tm-practice-card p { color: #cbd5e1; line-height: 1.75; }
.tm-practice-card li > span { color: var(--tm-text); background: #fff; }
.tm-warning-list { display: grid; gap: 12px; padding: 0; margin: 22px 0 0; list-style: none; }
.tm-warning-list li { position: relative; padding: 16px 18px 16px 46px; color: var(--tm-text-soft); border: 1px solid #fed7aa; border-radius: 12px; background: #fff7ed; line-height: 1.6; }
.tm-warning-list li::before { content: "!"; position: absolute; left: 16px; top: 16px; display: grid; place-items: center; width: 21px; height: 21px; color: #9a3412; background: #ffedd5; border-radius: 50%; font-size: 12px; font-weight: 900; }
.tm-takeaway-card { scroll-margin-top: 34px; padding: 30px; margin: 58px 0; border: 1px solid color-mix(in srgb, var(--tm-accent) 28%, var(--tm-border)); border-radius: var(--tm-radius-lg); background: var(--tm-accent-soft); }
.tm-faq details { border-bottom: 1px solid var(--tm-border); }
.tm-faq summary { padding: 18px 34px 18px 0; cursor: pointer; font-weight: 760; line-height: 1.45; }
.tm-faq details p { padding: 0 0 18px; margin: 0; font-size: 16px; }
.tm-complete-panel { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: 28px; margin: 58px 0 30px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius-lg); background: var(--tm-surface-soft); }
.tm-complete-panel h2 { margin-bottom: 6px; font-size: 27px; }
.tm-complete-panel p { margin: 0; color: var(--tm-muted); }
.tm-complete-panel .tm-button { flex: 0 0 auto; }
.tm-lesson-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.tm-lesson-nav-card { display: flex; flex-direction: column; min-height: 116px; padding: 20px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius-md); text-decoration: none; box-shadow: var(--tm-shadow-sm); }
.tm-lesson-nav-card:hover { border-color: var(--tm-accent); transform: translateY(-2px); }
.tm-lesson-nav-card span { margin-bottom: 9px; color: var(--tm-accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tm-lesson-nav-card strong { color: var(--tm-text); line-height: 1.45; }
.tm-lesson-nav-card.is-next { text-align: right; }
.tm-article-sidebar { position: sticky; top: 24px; align-self: start; display: grid; gap: 16px; }
.tm-article-toc, .tm-sidebar-path-card { padding: 21px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius-md); box-shadow: var(--tm-shadow-sm); }
.tm-article-toc { display: grid; gap: 3px; max-height: calc(100vh - 52px); overflow: auto; }
.tm-article-toc .tm-card-label { margin-bottom: 8px; }
.tm-article-toc a { padding: 7px 9px; color: var(--tm-text-soft); border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 650; line-height: 1.35; }
.tm-article-toc a:hover, .tm-article-toc a.is-active { color: var(--tm-accent); background: var(--tm-accent-soft); }
.tm-sidebar-path-card h2 { margin: 8px 0; font-size: 20px; }
.tm-sidebar-path-card p { margin: 0; color: var(--tm-muted); font-size: 13px; }
.tm-sidebar-position { display: flex; align-items: end; gap: 7px; margin: 18px 0; }
.tm-sidebar-position span { color: var(--tm-accent); font-size: 31px; font-weight: 850; line-height: 1; }
.tm-sidebar-position small { color: var(--tm-muted); }
.tm-not-found-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--tm-surface-soft); }
.tm-not-found-card { width: min(100%, 560px); padding: 42px; text-align: center; background: #fff; border: 1px solid var(--tm-border); border-radius: var(--tm-radius-lg); box-shadow: var(--tm-shadow-md); }
.tm-not-found-card h1 { margin: 9px 0 10px; font-size: 42px; }
.tm-not-found-card p { margin: 0 0 24px; color: var(--tm-muted); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tm-accent) 34%, transparent); outline-offset: 3px; }
@media (max-width: 1000px) {
    .tm-lesson-hero-grid { grid-template-columns: 1fr; gap: 28px; }
    .tm-lesson-status-card { max-width: 460px; }
    .tm-article-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 34px; }
}
@media (max-width: 760px) {
    .tm-lesson-hero { padding: 24px 0 38px; }
    .tm-lesson-hero h1 { font-size: 39px; }
    .tm-lesson-deck { font-size: 16px; }
    .tm-article-layout { display: flex; flex-direction: column; padding-top: 38px; padding-bottom: 64px; }
    .tm-article-sidebar { position: static; order: -1; }
    .tm-article-toc { display: none; }
    .tm-sidebar-path-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 16px; }
    .tm-sidebar-path-card .tm-card-label, .tm-sidebar-path-card h2, .tm-sidebar-path-card p { grid-column: 1; }
    .tm-sidebar-position { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
    .tm-sidebar-path-card .tm-button { grid-column: 1 / -1; }
    .tm-learning-objectives, .tm-practice-card, .tm-takeaway-card { padding: 22px 18px; }
    .tm-article-section p { font-size: 16px; }
    .tm-complete-panel { align-items: flex-start; flex-direction: column; }
    .tm-complete-panel .tm-button { width: 100%; }
    .tm-lesson-navigation { grid-template-columns: 1fr; }
    .tm-lesson-nav-card.is-next { text-align: left; }
}
@media (max-width: 430px) {
    .tm-lesson-hero h1 { font-size: 34px; }
    .tm-lesson-meta-line { align-items: flex-start; flex-direction: column; }
    .tm-lesson-status-card { padding: 18px; }
    .tm-sidebar-path-card { display: block; }
    .tm-sidebar-position { margin: 14px 0; }
    .tm-instruction-steps li, .tm-practice-card ol li { grid-template-columns: 32px minmax(0, 1fr); gap: 11px; }
    .tm-instruction-steps li > span, .tm-practice-card ol li > span { width: 32px; height: 32px; border-radius: 10px; }
}
@media print {
    .tm-site-header, .tm-site-footer, .tm-reading-progress, .tm-article-sidebar, .tm-complete-panel, .tm-lesson-navigation, .tm-lesson-status-card { display: none !important; }
    .tm-lesson-hero { padding: 15px 0; background: #fff; }
    .tm-article-layout { display: block; padding: 25px 0; }
    .tm-practice-card { color: #000; background: #fff; border: 1px solid #999; box-shadow: none; }
    .tm-practice-card p { color: #333; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* v1.2.0 curated lesson content */
.tm-prerequisites { scroll-margin-top: 34px; padding: 26px 28px; margin: 30px 0 38px; border: 1px solid var(--tm-border); border-left: 5px solid var(--tm-accent); border-radius: var(--tm-radius-md); background: #fff; box-shadow: var(--tm-shadow-sm); }
.tm-prerequisites h2 { margin: 7px 0 14px; font-size: 27px; }
.tm-prerequisites ul { display: grid; gap: 9px; padding-left: 22px; margin: 0; color: var(--tm-text-soft); }
.tm-prerequisites li { line-height: 1.6; }
.tm-lesson-figure { margin: 34px 0 48px; overflow: hidden; border: 1px solid var(--tm-border); border-radius: var(--tm-radius-lg); background: #fff; box-shadow: var(--tm-shadow-md); }
.tm-lesson-figure img { display: block; width: 100%; height: auto; aspect-ratio: 12 / 7; object-fit: contain; background: var(--tm-surface-soft); }
.tm-lesson-figure figcaption { padding: 13px 18px 15px; color: var(--tm-muted); border-top: 1px solid var(--tm-border); font-size: 13px; line-height: 1.55; }
.tm-callout { margin: 24px 0 6px; padding: 20px 22px; border: 1px solid var(--tm-border); border-left-width: 5px; border-radius: var(--tm-radius-md); background: #fff; }
.tm-callout strong { display: block; margin-bottom: 6px; color: var(--tm-text); font-size: 16px; }
.tm-callout p { margin: 0; font-size: 15px; }
.tm-callout-tip { border-left-color: #0b63f6; background: #f4f8ff; }
.tm-callout-example { border-left-color: #087f5b; background: #f1fbf7; }
.tm-callout-warning { border-left-color: #c2410c; background: #fff7ed; }
.tm-citation { position: relative; top: -.1em; margin-left: 3px; font-size: .67em; font-weight: 800; }
.tm-citation a { color: var(--tm-accent); text-decoration: none; }
.tm-citation a:hover { text-decoration: underline; }
.tm-sources { padding-top: 8px; }
.tm-source-list { display: grid; gap: 12px; padding: 0; margin: 24px 0; list-style: none; counter-reset: sources; }
.tm-source-list li { position: relative; padding: 16px 18px 16px 54px; border: 1px solid var(--tm-border); border-radius: 12px; background: #fff; counter-increment: sources; }
.tm-source-list li::before { content: counter(sources); position: absolute; left: 16px; top: 15px; display: grid; place-items: center; width: 25px; height: 25px; color: #fff; background: var(--tm-accent); border-radius: 50%; font-size: 12px; font-weight: 850; }
.tm-source-list a { display: inline; color: var(--tm-text); font-weight: 760; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tm-source-list a::after { content: " ↗"; color: var(--tm-accent); }
.tm-source-list span { display: block; margin-top: 5px; color: var(--tm-muted); font-size: 13px; }
.tm-review-date { padding: 12px 15px; color: var(--tm-muted); border-radius: 10px; background: var(--tm-surface-soft); font-size: 13px !important; }
@media (max-width: 760px) {
    .tm-prerequisites { padding: 22px 18px; }
    .tm-lesson-figure { margin: 28px 0 40px; border-radius: 16px; }
    .tm-source-list li { padding-left: 50px; }
}

/* v1.9.0 Learning Library knowledge graph */
.tm-related-learning { scroll-margin-top: 34px; margin: 52px 0 30px; padding: 30px; border: 1px solid var(--tm-border); border-radius: var(--tm-radius-lg); background: linear-gradient(145deg, #f8fbff, #fff); box-shadow: var(--tm-shadow-sm); }
.tm-related-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.tm-related-heading h2 { margin: 6px 0 8px; font-size: 30px; }
.tm-related-heading p { max-width: 680px; margin: 0; color: var(--tm-muted); }
.tm-related-heading .tm-button { flex: 0 0 auto; }
.tm-problem-routes { padding: 18px; margin-bottom: 28px; border: 1px solid color-mix(in srgb, var(--tm-accent) 25%, var(--tm-border)); border-radius: 14px; background: var(--tm-accent-soft); }
.tm-problem-routes > strong { display: block; margin-bottom: 11px; font-size: 14px; }
.tm-problem-routes > div { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-problem-routes a { padding: 8px 11px; color: var(--tm-accent); border: 1px solid color-mix(in srgb, var(--tm-accent) 28%, transparent); border-radius: 999px; background: #fff; text-decoration: none; font-size: 13px; font-weight: 750; }
.tm-related-group + .tm-related-group { margin-top: 26px; }
.tm-related-group h3 { margin: 0 0 13px; font-size: 19px; }
.tm-related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tm-related-card { display: block; padding: 18px; color: inherit; border: 1px solid var(--tm-border); border-radius: 14px; background: #fff; text-decoration: none; }
.tm-related-card:hover, .tm-resource-list a:hover { border-color: var(--tm-accent); transform: translateY(-2px); box-shadow: var(--tm-shadow-sm); }
.tm-related-card > span { display: block; margin-bottom: 6px; color: var(--tm-accent); font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.tm-related-card strong { display: block; color: var(--tm-text); line-height: 1.4; }
.tm-related-card p { margin: 7px 0 0; color: var(--tm-muted); font-size: 13px; line-height: 1.55; }
.tm-related-resource-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 28px; }
.tm-resource-list { display: grid; gap: 10px; }
.tm-resource-list a { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 15px; color: inherit; border: 1px solid var(--tm-border); border-radius: 13px; background: #fff; text-decoration: none; }
.tm-resource-list a > span { display: grid; place-items: center; width: 25px; height: 25px; color: #fff; background: var(--tm-accent); border-radius: 8px; font-weight: 900; }
.tm-resource-list strong { color: var(--tm-text); font-size: 14px; }
.tm-resource-list p { margin: 4px 0 0; color: var(--tm-muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 760px) {
    .tm-related-learning { padding: 22px 18px; }
    .tm-related-heading { flex-direction: column; }
    .tm-related-heading .tm-button { width: 100%; }
    .tm-related-grid, .tm-related-resource-columns { grid-template-columns: 1fr; }
}

/* v2.1.0 lesson-to-lab continuation */
.tm-related-lab-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 22px 24px; margin: -18px 0 44px; color: inherit; border: 1px solid color-mix(in srgb, var(--tm-accent) 30%, var(--tm-border)); border-radius: var(--tm-radius-lg); background: linear-gradient(145deg, var(--tm-accent-soft), #fff); box-shadow: var(--tm-shadow-sm); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.tm-related-lab-card:hover { transform: translateY(-2px); border-color: var(--tm-accent); box-shadow: var(--tm-shadow-md); }
.tm-related-lab-card:focus-visible { outline: 4px solid color-mix(in srgb, var(--tm-accent) 34%, transparent); outline-offset: 3px; }
.tm-related-lab-icon { display: grid; place-items: center; width: 50px; height: 50px; color: #fff; border-radius: 15px; background: var(--tm-accent); }
.tm-related-lab-icon svg { width: 25px; height: 25px; }
.tm-related-lab-card small { display: block; margin-bottom: 5px; color: var(--tm-accent); font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.tm-related-lab-card h2 { margin: 0; color: var(--tm-text); font-size: 21px; line-height: 1.35; }
.tm-related-lab-card p { margin: 7px 0 0; color: var(--tm-muted); font-size: 14px; line-height: 1.55; }
.tm-related-lab-card > strong { color: var(--tm-accent); font-size: 13px; white-space: nowrap; }

@media (max-width: 760px) {
    .tm-related-lab-card { grid-template-columns: 44px minmax(0, 1fr); align-items: start; padding: 20px 17px; margin-bottom: 38px; gap: 13px; }
    .tm-related-lab-icon { width: 42px; height: 42px; border-radius: 13px; }
    .tm-related-lab-card > strong { grid-column: 2; }
}

@media (max-width: 430px) {
    .tm-related-lab-card { grid-template-columns: 1fr; }
    .tm-related-lab-card > strong { grid-column: 1; }
}

/* Programming Hub v5 technical learning blocks */
.tm-code-block,
.tm-terminal-block,
.tm-file-tree-block,
.tm-expected-output-block,
.tm-challenge-block {
    margin: 1.25rem 0;
    border: 1px solid var(--tm-border, #d7deea);
    border-radius: 14px;
    background: #0f172a;
    color: #e5eefc;
    overflow: hidden;
}
.tm-block-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    padding: .75rem 1rem;
    background: #17223a;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.tm-block-toolbar span { font-weight: 700; }
.tm-block-toolbar code,
.tm-block-toolbar small { color: #b9c7df; }
.tm-code-block pre,
.tm-terminal-block pre,
.tm-file-tree-block pre,
.tm-expected-output-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
}
.tm-code-block code,
.tm-terminal-block code,
.tm-file-tree-block code,
.tm-expected-output-block code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92rem;
    line-height: 1.65;
}
.tm-file-tree-block,
.tm-expected-output-block { padding-top: .9rem; }
.tm-file-tree-block > strong,
.tm-expected-output-block > strong { display: block; padding: 0 1rem .45rem; }
.tm-block-warning { margin: 0; padding: .8rem 1rem; background: #4a2711; color: #fff3d6; }
.tm-challenge-block { padding: 1.15rem; background: #f7f9ff; color: #17223a; }
.tm-challenge-block h3 { margin: .35rem 0 .65rem; }
.tm-challenge-block ul { margin: .75rem 0; }
.tm-programming-internal-links { margin-top: 2rem; }
.tm-lesson-review { margin: 1.5rem 0; padding: 1rem 1.15rem; border: 1px solid var(--tm-border, #d7deea); border-radius: 12px; background: #f8fafc; }
.tm-lesson-review p { margin: .2rem 0; }
.tm-lesson-environment { margin-bottom: 1.5rem; }
@media (max-width: 720px) {
    .tm-block-toolbar { align-items: flex-start; flex-direction: column; }
    .tm-code-block pre,
    .tm-terminal-block pre,
    .tm-file-tree-block pre,
    .tm-expected-output-block pre { font-size: .82rem; }
}
