/* Shared structured lesson block styles (funnel + home) */
.lb-meta {
    font-size: .8125rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.lb-block {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
    overflow-y: visible;
}

.lb-block:has(.lb-workspace-wrap) {
    overflow: visible;
    padding-bottom: 1.5rem;
}

.lb-block:last-child {
    border-bottom: 0;
}

.lb-block-title {
    margin: 0 0 .65rem;
    font-size: 1rem;
    color: var(--text-primary, #0f172a);
}

.lb-hook {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    line-height: 1.5;
    padding: .75rem 1rem;
    border-left: 3px solid var(--accent-primary, #2563eb);
    background: var(--bg-secondary, #f8fafc);
    border-radius: 0 .75rem .75rem 0;
}

.lb-concept p {
    margin: 0;
    color: var(--text-secondary, #475569);
    line-height: 1.7;
}

.lb-diagram-rendered,
.lb-diagram {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: .75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.lb-diagram-canvas {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    max-height: min(78vh, 760px);
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
    cursor: grab;
    scrollbar-width: thin;
}

.lb-diagram-canvas.lb-diagram-canvas-dragging {
    cursor: grabbing;
}

.lb-diagram-canvas-tall {
    max-height: min(78vh, 760px);
}

.lb-diagram-canvas-wide {
    overflow-x: scroll;
    overflow-y: scroll;
}

.lb-diagram-canvas-wide .lb-diagram-svg-wrap {
    min-width: min-content;
}

.lb-diagram-svg-wrap {
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: visible;
    max-height: none;
}

.lb-diagram-rendered svg,
.lb-mermaid-svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.lb-table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.lb-table caption {
    text-align: left;
    font-weight: 700;
    margin-bottom: .5rem;
    color: var(--text-primary, #0f172a);
}

.lb-table th,
.lb-table td {
    border: 1px solid var(--border-color, #e2e8f0);
    padding: .6rem .75rem;
    text-align: left;
}

.lb-table thead th {
    background: var(--bg-secondary, #f8fafc);
    font-weight: 700;
}

.lb-flashcards {
    margin: 1rem 0;
}

.lb-fc-progress {
    font-size: .75rem;
    color: var(--text-muted, #64748b);
    margin-bottom: .5rem;
}

.lb-fc-stage {
    min-height: 140px;
    position: relative;
}

.lb-fc-card {
    display: none;
    cursor: pointer;
}

.lb-fc-card.active {
    display: block;
}

.lb-fc-inner {
    position: relative;
    min-height: 120px;
    transform-style: preserve-3d;
    transition: transform .45s;
}

.lb-fc-card.flipped .lb-fc-inner {
    transform: rotateY(180deg);
}

.lb-fc-front,
.lb-fc-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: .75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 1.25rem;
    background: var(--bg-secondary, #f8fafc);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lb-fc-back {
    transform: rotateY(180deg);
    background: var(--bg-primary, #fff);
}

.lb-fc-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted, #64748b);
    margin-bottom: .35rem;
}

.lb-fc-text {
    font-size: 1rem;
    color: var(--text-primary, #0f172a);
    line-height: 1.5;
}

.lb-fc-nav {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-top: .75rem;
}

.lb-video-moment {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: .75rem;
    border: 1px solid var(--border-color, #e2e8f0);
}

.lb-video-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .5rem .65rem;
}

.lb-video-title-wrap {
    flex: 1 1 12rem;
    min-width: 0;
}

.lb-video-title-wrap strong {
    display: block;
    line-height: 1.35;
}

.lb-video-embedded {
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 4px 18px rgba(37, 99, 235, .08);
}

.lb-video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    min-height: 180px;
}

.lb-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.lb-video-author {
    display: block;
    font-size: .75rem;
    color: var(--text-muted, #64748b);
    margin-top: .15rem;
}

.lb-video-clip-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    color: var(--accent-primary, #2563eb);
    background: rgba(37, 99, 235, .1);
    padding: .2rem .5rem;
    border-radius: 4px;
    margin: .25rem 0;
}

.lb-video-ref-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 4px;
    background: rgba(100, 116, 139, .12);
    color: var(--text-muted, #64748b);
}

.lb-video-thumb {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    border-radius: 8px;
    overflow: hidden;
}

.lb-video-thumb img {
    width: 100%;
    display: block;
}

.lb-video-thumb-wide {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: .75rem;
    overflow: hidden;
    background: #0f172a;
}

.lb-video-thumb-wide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lb-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 1.25rem;
}

.lb-video-body {
    font-size: .9rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.lb-video-body p {
    margin: .45rem 0;
}

.lb-video-body p:first-child {
    margin-top: 0;
}

.lb-video-body p:last-child {
    margin-bottom: 0;
}

.lb-video-moment.lb-video-transcript:not(.lb-video-premium) {
    border-color: rgba(124, 58, 237, .35);
    background: linear-gradient(180deg, rgba(124, 58, 237, .08), transparent);
}

.lb-video-moment:not(.lb-video-premium) .lb-video-header .fab {
    color: #ff0000;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: .15rem;
}

.lb-video-moment.lb-video-transcript:not(.lb-video-premium) .lb-video-ref-badge {
    color: #7c3aed;
    background: rgba(124, 58, 237, .12);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.lb-source-link {
    font-size: .8125rem;
    color: var(--accent-primary, #2563eb);
    text-decoration: none;
    font-weight: 600;
}

.lb-source-link:hover {
    text-decoration: underline;
}

.lb-activity {
    padding: 1rem 1.25rem;
    border-radius: .75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: linear-gradient(135deg, rgba(37, 99, 235, .06), rgba(220, 38, 38, .04));
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.lb-project-workspace {
    overflow: visible;
    padding-bottom: 1.15rem;
    border-left: 3px solid var(--accent-primary, #2563eb);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.lb-workspace-shell {
    overflow: visible;
    padding-bottom: 1.15rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.lb-activity-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--accent-primary, #2563eb);
    margin-bottom: .5rem;
}

.lb-success-criteria {
    font-size: .8125rem;
    margin-top: .5rem;
    color: var(--text-secondary, #475569);
}

.lb-brainstorm-prompts {
    margin: .5rem 0 1rem 1.25rem;
    color: var(--text-secondary, #475569);
}

.lb-project-brief {
    background: linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(16, 185, 129, .05));
}

.lb-project-field {
    margin: .75rem 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.lb-project-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted, #64748b);
    margin-bottom: .25rem;
}

.lb-project-today p {
    color: var(--accent-primary, #2563eb);
}

.lb-workspace-wrap {
    width: 100%;
    max-width: 100%;
    margin-top: 1rem;
    margin-bottom: .15rem;
    padding-top: 1rem;
    padding-bottom: .25rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
    box-sizing: border-box;
}

.lb-workspace-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted, #64748b);
    margin: 0 0 .5rem;
}

.lb-workspace-input {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: .85rem 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: .65rem;
    font-family: inherit;
    font-size: clamp(.875rem, 2.5vw, 1rem);
    line-height: 1.55;
    resize: vertical;
    min-height: 7rem;
    max-height: 20rem;
    background: var(--bg-card, var(--bg-secondary, #f8fafc));
    color: var(--text-primary, #0f172a);
    -webkit-appearance: none;
    appearance: none;
}

.lb-workspace-input::placeholder {
    color: var(--text-muted, #94a3b8);
    opacity: .9;
}

.lb-workspace-input:focus {
    outline: none;
    border-color: var(--accent-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.lb-check-project {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    padding-bottom: 1.15rem;
}

.lb-check-project .lb-workspace-wrap {
    margin-top: 1.15rem;
    margin-bottom: 0;
    padding-left: .1rem;
    padding-right: .1rem;
}

.lb-check-project .lb-workspace-input {
    width: 100%;
    max-width: 100%;
}

.lb-check-project .lb-check-reveal {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-top: .75rem;
}

.lb-check-project .lb-check-q {
    margin-bottom: .5rem;
    word-wrap: break-word;
}

.lb-success-panel,
.lb-self-check {
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: rgba(16, 185, 129, .06);
    border-radius: .5rem;
    border: 1px solid rgba(16, 185, 129, .15);
}

.lb-success-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #059669;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.lb-criteria-list {
    margin: .35rem 0 0 1.1rem;
    padding: 0;
    color: var(--text-secondary, #475569);
}

.lb-criteria-list li {
    margin: .35rem 0;
}

.lb-check-project .lb-check-criteria {
    margin-top: .5rem;
}

.lb-check-guidance {
    font-size: .875rem;
    color: var(--text-secondary, #475569);
    font-style: italic;
    margin-top: .5rem;
}

.lb-example-patterns {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}

.lb-reflection-hint {
    font-size: .8125rem;
    color: var(--text-muted, #64748b);
    margin: .5rem 0;
}

.lb-slice-intro {
    margin-bottom: .5rem;
}

.lb-lesson-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Hands-on practice blocks */
.lb-try-hands-on {
    border-left: 3px solid var(--accent-primary, #2563eb);
    background: var(--bg-card, var(--bg-secondary, #f8fafc));
}

.lb-try-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
    margin-bottom: .35rem;
}

.lb-try-time {
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    padding: .2rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    white-space: nowrap;
}

.lb-try-instruction {
    color: var(--text-secondary, #475569);
    line-height: 1.65;
    margin: .35rem 0 .75rem;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.lb-try-instruction p {
    margin: .35rem 0;
}

.lb-materials-panel {
    margin: .75rem 0;
    padding: .75rem 1rem;
    border-radius: .65rem;
    border: 1px dashed var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
}

.lb-materials-list {
    margin: .35rem 0 0 1.1rem;
    padding: 0;
    color: var(--text-secondary, #475569);
}

.lb-materials-list li {
    margin: .3rem 0;
}

.lb-try-criteria {
    margin-top: .75rem;
}

.lb-phase-guided {
    border-left-color: var(--accent-primary, #2563eb);
}

.lb-phase-independent {
    border-left-color: #059669;
}

.lb-phase-independent .lb-activity-badge {
    color: #059669;
}

.lb-phase-challenge {
    border-left-color: #d97706;
}

.lb-phase-challenge .lb-activity-badge {
    color: #d97706;
}

.lb-worked-hands-on {
    border-left: 3px solid var(--accent-primary, #2563eb);
    padding: 1rem 1.25rem;
    border-radius: .75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-card, var(--bg-secondary, #f8fafc));
    box-sizing: border-box;
}

.lb-step-checkpoint {
    border-color: rgba(37, 99, 235, .35);
    background: rgba(37, 99, 235, .06);
}

.lb-step-checkpoint .lb-step-num {
    background: #2563eb;
}

@media (max-width:768px) {
    .lb-activity {
        padding: .85rem 1rem;
    }

    .lb-worked-hands-on {
        padding: .85rem 1rem;
    }

    .lb-try-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lb-workspace-input {
        min-height: 6.5rem;
        font-size: .9375rem;
        padding: .75rem .85rem;
    }

    .lb-diagram-canvas-tall {
        max-height: min(72vh, 640px);
    }
}

@media (max-width:480px) {
    .lb-brainstorm-prompts {
        margin-left: 1rem;
        padding-right: .25rem;
    }

    .lb-workspace-input {
        min-height: 6rem;
    }
}

.lb-checklist {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
}

.lb-checklist li {
    margin: .5rem 0;
    color: var(--text-secondary, #475569);
    display: flex;
    gap: .5rem;
    align-items: flex-start;
}

.lb-definitions .lb-dl {
    margin: 0;
}

.lb-definitions dt {
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin-top: .75rem;
}

.lb-definitions dd {
    margin: .25rem 0 0;
    color: var(--text-secondary, #475569);
}

.lb-source-note {
    display: flex;
    gap: .75rem;
    padding: 1rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: .75rem;
    font-size: .875rem;
}

.lb-sources-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
    font-size: .8125rem;
}

.lb-sources-footer ul {
    margin: .5rem 0 0 1.25rem;
}

.lb-reading-body {
    line-height: 1.75;
    color: var(--text-secondary, #475569);
}

.lb-steps {
    margin: .75rem 0 0 1.25rem;
    color: var(--text-secondary, #475569);
}

.lb-steps li {
    margin: .5rem 0;
}

.lb-check:not(.lb-check-premium) {
    padding: .5rem 0;
}

.lb-check.lb-check-premium {
    padding: 1.15rem;
    overflow: visible;
    box-sizing: border-box;
}

.lb-hint-sm {
    font-size: .8125rem;
    color: var(--text-muted, #64748b);
    margin-top: .35rem;
}

.lesson-key-block {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: .75rem;
    border: 1px solid var(--border-color, #e2e8f0);
}

.lesson-key-block h4 {
    margin: 0 0 .75rem;
    font-size: .9375rem;
    color: var(--text-primary, #0f172a);
}

.lesson-key-points {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary, #475569);
    line-height: 1.6;
}

#theory-blocks-root {
    margin-top: 1rem;
}

/* Visual spotlight — primary diagram UX (v21) */
.lb-visual-spotlight {
    margin: 1rem 0;
}

.lb-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
}

.lb-spotlight-card {
    background: linear-gradient(145deg, rgba(37, 99, 235, .08), rgba(124, 58, 237, .06));
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 1rem;
    padding: 1rem;
    animation: lbSpotIn .45s ease both;
    animation-delay: calc(var(--card-i, 0) * 80ms);
}

.lb-spotlight-emoji {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: .5rem;
}

.lb-spotlight-label {
    font-weight: 700;
    font-size: .9375rem;
    color: var(--text-primary, #0f172a);
    margin-bottom: .35rem;
}

.lb-spotlight-detail {
    font-size: .8125rem;
    color: var(--text-secondary, #475569);
    line-height: 1.55;
    margin: 0;
}

.lb-diagram-visual-first .lb-mermaid-expand {
    margin-top: .75rem;
}

.lb-diagram-visual-first .lb-mermaid-expand summary {
    cursor: pointer;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--accent-primary, #2563eb);
    padding: .5rem 0;
}

@keyframes lbSpotIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Transcript-guided long video references */
.lb-video-transcript .lb-video-thumb-transcript {
    display: block;
    position: relative;
    border-radius: .75rem;
    overflow: hidden;
}

.lb-video-transcript-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .65rem 1rem;
    background: linear-gradient(transparent, rgba(15, 23, 42, .85));
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
}

.lb-video-ts-badge,
.lb-video-segment-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    padding: .15rem .45rem;
    border-radius: 4px;
    margin-left: .35rem;
}

.lb-video-ts-badge {
    background: rgba(16, 185, 129, .15);
    color: #059669;
}

.lb-video-segment-badge {
    background: rgba(124, 58, 237, .12);
    color: #7c3aed;
}

.lb-video-quote {
    margin: .75rem 0;
    padding: .75rem 1rem;
    border-left: 3px solid var(--accent-primary, #2563eb);
    background: rgba(37, 99, 235, .06);
    border-radius: 0 .5rem .5rem 0;
    font-style: italic;
    font-size: .875rem;
}

.lb-transcript-diagram {
    position: relative;
    margin: 1rem 0 1.25rem;
}

.lb-transcript-diagram .lb-diagram-header {
    margin-bottom: .65rem;
}

.lb-transcript-diagram .lb-diagram-canvas {
    min-height: min(42vh, 360px);
}

.lb-transcript-diagram .lb-diagram-rendered:not(.lb-mermaid-colors-normalized) svg .node rect,
.lb-transcript-diagram .lb-diagram-rendered:not(.lb-mermaid-colors-normalized) svg .node polygon,
.lb-transcript-diagram .lb-diagram-rendered:not(.lb-mermaid-colors-normalized) svg .cluster rect {
    fill: #1e3a5f !important;
    stroke: #3b82f6 !important;
}

.lb-transcript-diagram .lb-diagram-rendered:not(.lb-mermaid-colors-normalized) svg .nodeLabel,
.lb-transcript-diagram .lb-diagram-rendered:not(.lb-mermaid-colors-normalized) svg .label,
.lb-transcript-diagram .lb-diagram-rendered:not(.lb-mermaid-colors-normalized) svg text {
    fill: #f1f5f9 !important;
    color: #f1f5f9 !important;
}

.lb-check.revealed .lb-check-answer {
    margin-top: .75rem;
}

.lb-check-answer-body {
    font-size: .9rem;
    line-height: 1.55;
    color: var(--text-secondary, #475569);
}

.lb-check-criteria+.lb-check-answer-body {
    margin-top: .65rem;
}

/* Practice environment setup block */
.lb-practice-setup {
    padding: 1.15rem;
    border-radius: .75rem;
    border: 2px solid rgba(37, 99, 235, .2);
    background: linear-gradient(145deg, rgba(37, 99, 235, .06), rgba(16, 185, 129, .04));
}

.lb-setup-title {
    margin: 0 0 .5rem;
    font-size: 1.05rem;
    color: var(--text-primary, #0f172a);
}

.lb-setup-intro {
    font-size: .9rem;
    color: var(--text-secondary, #475569);
    margin: 0 0 1rem;
}

.lb-zero-install {
    margin: .75rem 0 1rem;
    padding: .75rem 1rem;
    border-radius: .5rem;
    background: rgba(16, 185, 129, .08);
    border: 1px solid rgba(16, 185, 129, .25);
}

.lb-tool-list {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;
    display: grid;
    gap: .65rem;
}

.lb-tool-card {
    padding: .75rem;
    border-radius: .5rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
}

.lb-tool-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: .1rem .4rem;
    border-radius: 4px;
    background: rgba(16, 185, 129, .15);
    color: #059669;
    margin-bottom: .35rem;
}

.lb-setup-steps {
    margin: .75rem 0 1rem 1.1rem;
    color: var(--text-secondary, #475569);
    line-height: 1.55;
}

.lb-setup-artifact {
    margin: 1rem 0;
}

.lb-artifact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .35rem;
    flex-wrap: wrap;
}

.lb-artifact-code {
    margin: 0;
    padding: .85rem 1rem;
    border-radius: .5rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: .78rem;
    line-height: 1.45;
    overflow-x: auto;
    max-height: 320px;
}

.lb-copy-btn {
    font-size: .75rem;
    padding: .35rem .65rem;
    border-radius: .35rem;
    border: 1px solid var(--border-color, #cbd5e1);
    background: #fff;
    cursor: pointer;
}

.lb-verify-check {
    margin-top: 1rem;
    padding: .75rem 1rem;
    border-radius: .5rem;
    background: rgba(37, 99, 235, .08);
    font-size: .875rem;
    color: var(--text-secondary, #475569);
}

/* Visual flashcards — icon-first recall (v29 polish) */
.lb-fc-visual .lb-fc-stage {
    min-height: 13.5rem;
}

.lb-fc-visual .lb-fc-inner {
    min-height: 13.5rem;
}

.lb-fc-focus {
    font-size: .8125rem;
    color: var(--text-muted, #64748b);
    margin: .15rem 0 .65rem;
    line-height: 1.45;
}

.lb-fc-visual-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: .75rem;
    width: 100%;
    max-width: 18rem;
    margin: 0 auto;
    padding: .25rem 0;
}

.lb-fc-icon-hero {
    font-size: clamp(2.5rem, 8vw, 3.25rem);
    line-height: 1;
    margin: 0;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--accent-primary, #2563eb) 12%, var(--bg-secondary, #f8fafc));
    border: 1px solid color-mix(in srgb, var(--accent-primary, #2563eb) 22%, var(--border-color, #e2e8f0));
    box-shadow: 0 4px 14px rgba(37, 99, 235, .12);
}

.lb-fc-visual-label {
    font-size: clamp(1.05rem, 3.5vw, 1.3rem);
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
    margin: 0;
}

.lb-fc-back-stack {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    width: 100%;
    text-align: left;
}

.lb-fc-answer-text {
    font-size: clamp(.875rem, 2.5vw, .95rem);
    line-height: 1.6;
    font-weight: 500;
    text-align: left;
    margin: 0;
}

.lb-fc-example {
    margin: 0;
    padding: .7rem .8rem;
    border-radius: .6rem;
    background: color-mix(in srgb, var(--accent-primary, #2563eb) 6%, var(--bg-secondary, #f8fafc));
    border: 1px solid color-mix(in srgb, var(--accent-primary, #2563eb) 18%, var(--border-color, #e2e8f0));
    border-left: 3px solid var(--accent-primary, #2563eb);
}

.lb-fc-example-label {
    display: block;
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent-primary, #2563eb);
    margin-bottom: .3rem;
}

.lb-fc-example-text {
    font-size: .8125rem;
    line-height: 1.5;
    color: var(--text-secondary, #475569);
}

.lb-fc-mnemonic {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 0;
    padding: .6rem .75rem;
    border-radius: .6rem;
    font-size: .8125rem;
    line-height: 1.45;
    color: var(--accent-primary, #2563eb);
    background: color-mix(in srgb, var(--accent-primary, #2563eb) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-primary, #2563eb) 20%, var(--border-color, #e2e8f0));
}

.lb-fc-mnemonic i {
    margin-top: .15rem;
    flex-shrink: 0;
    opacity: .85;
}

/* Visual panel infographics — programmatic layouts */
.lb-visual-panel {
    margin: 1rem 0;
    padding: 1.1rem 1.2rem;
    border-radius: .9rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: linear-gradient(145deg, rgba(37, 99, 235, .05), rgba(124, 58, 237, .04));
    overflow: hidden;
}

.lb-vp-header {
    margin-bottom: 1rem;
}

.lb-vp-header .lb-block-title {
    margin-bottom: .35rem;
}

.lb-vp-focus {
    font-size: .8125rem;
    color: var(--text-muted, #64748b);
    margin: 0;
    line-height: 1.5;
}

.lb-vp-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    gap: .75rem;
}

.lb-vp-grid-card {
    padding: 1rem;
    border-radius: .75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-primary, #fff);
    animation: lbSpotIn .45s ease both;
    animation-delay: calc(var(--vp-i, 0) * 70ms);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-height: 6.5rem;
}

.lb-vp-icon-wrap {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--accent-primary, #2563eb) 10%, var(--bg-secondary, #f8fafc));
    border: 1px solid color-mix(in srgb, var(--accent-primary, #2563eb) 15%, var(--border-color, #e2e8f0));
    margin-bottom: .15rem;
}

.lb-vp-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.lb-vp-label {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0;
    line-height: 1.35;
}

.lb-vp-caption {
    font-size: .78rem;
    color: var(--text-secondary, #475569);
    line-height: 1.5;
    margin: .15rem 0 0;
}

/* Timeline layout */
.lb-vp-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: .25rem;
}

.lb-vp-timeline-item {
    display: grid;
    grid-template-columns: 2.75rem 1fr;
    gap: .85rem;
    align-items: stretch;
    margin-bottom: .85rem;
    position: relative;
    animation: lbSpotIn .45s ease both;
    animation-delay: calc(var(--vp-i, 0) * 80ms);
}

.lb-vp-timeline-item:last-child {
    margin-bottom: 0;
}

.lb-vp-timeline-item:not(:last-child) .lb-vp-timeline-marker::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 2.65rem;
    bottom: -1rem;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(var(--accent-primary, #2563eb), rgba(124, 58, 237, .45));
    border-radius: 2px;
    z-index: 0;
}

.lb-vp-timeline-marker {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: .55rem;
}

.lb-vp-timeline-marker .lb-vp-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: var(--bg-primary, #fff);
    border: 2px solid color-mix(in srgb, var(--accent-primary, #2563eb) 35%, var(--border-color, #e2e8f0));
    box-shadow: 0 2px 8px rgba(37, 99, 235, .12);
}

.lb-vp-timeline-body {
    padding: .85rem 1rem;
    border-radius: .7rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-primary, #fff);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 3.75rem;
    box-sizing: border-box;
}

.lb-vp-timeline-body .lb-vp-label {
    font-size: .92rem;
}

.lb-vp-timeline-body .lb-vp-caption {
    margin-top: .35rem;
}

/* Stat strip layout */
.lb-vp-stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
    gap: .65rem;
}

.lb-vp-stat {
    text-align: center;
    padding: 1rem .75rem;
    border-radius: .75rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-primary, #fff);
    animation: lbSpotIn .45s ease both;
    animation-delay: calc(var(--vp-i, 0) * 70ms);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
}

.lb-vp-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--accent-primary, #2563eb);
    line-height: 1.1;
}

.lb-vp-stat-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.lb-vp-stat-label {
    font-size: .8125rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    line-height: 1.3;
}

.lb-vp-stat .lb-vp-caption {
    font-size: .72rem;
    margin-top: .15rem;
}

@media (max-width:768px) {

    .lb-fc-visual .lb-fc-stage,
    .lb-fc-visual .lb-fc-inner {
        min-height: 12.5rem;
    }

    .lb-fc-icon-hero {
        width: 3.75rem;
        height: 3.75rem;
        font-size: 2.25rem;
    }

    .lb-vp-icon-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lb-vp-stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lb-visual-panel {
        padding: .95rem 1rem;
    }
}

@media (max-width:480px) {

    .lb-fc-visual .lb-fc-stage,
    .lb-fc-visual .lb-fc-inner {
        min-height: 11.5rem;
    }

    .lb-fc-visual-stack {
        max-width: 100%;
        gap: .6rem;
    }

    .lb-fc-icon-hero {
        width: 3.25rem;
        height: 3.25rem;
        font-size: 2rem;
        border-radius: .85rem;
    }

    .lb-fc-visual-label {
        font-size: 1.05rem;
    }

    .lb-vp-icon-grid {
        grid-template-columns: 1fr;
    }

    .lb-vp-stat-strip {
        grid-template-columns: 1fr 1fr;
    }

    .lb-vp-timeline-item {
        grid-template-columns: 2.35rem 1fr;
        gap: .65rem;
    }

    .lb-vp-timeline-marker .lb-vp-icon {
        width: 2.15rem;
        height: 2.15rem;
        font-size: .95rem;
    }

    .lb-vp-timeline-body {
        padding: .75rem .85rem;
    }
}

/* Reading & Theory — OpenStax-style premium prose */
.lb-theory-prose {
    font-family: inherit;
    color: var(--text-secondary, #475569);
    line-height: 1.75;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.lb-theory-prose h1,
.lb-theory-prose h2,
.lb-theory-prose h3,
.lb-theory-prose h4 {
    color: var(--text-primary, #0f172a);
    line-height: 1.35;
    margin: 1.1rem 0 .55rem;
}

.lb-theory-prose h3 {
    font-size: 1.02rem;
}

.lb-theory-prose p {
    margin: .65rem 0;
}

.lb-theory-prose ul,
.lb-theory-prose ol {
    margin: .5rem 0 .75rem 1.15rem;
    padding: 0;
}

.lb-theory-prose li {
    margin: .35rem 0;
}

.lb-theory-prose code.lesson-inline-code {
    font-size: .86em;
    padding: .12rem .35rem;
    border-radius: .35rem;
    background: var(--bg-secondary, #f1f5f9);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-primary, #0f172a);
}

.lb-theory-prose .katex {
    color: var(--text-primary, #0f172a);
}

.lb-theory-prose .katex-display {
    margin: 1rem 0;
    padding: .85rem 1rem;
    overflow-x: auto;
    border-radius: .65rem;
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
}

.lb-reading-premium,
.lb-definitions-premium,
.lb-recap-premium {
    padding: 1.1rem 1.2rem;
    border-radius: .9rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-card, var(--bg-primary, #fff));
    box-sizing: border-box;
    max-width: 100%;
}

.lb-reading-header {
    margin-bottom: .85rem;
}

.lb-reading-header .lb-block-title {
    margin-bottom: .35rem;
}

.lb-reading-focus {
    margin: 0;
    font-size: .875rem;
    color: var(--text-muted, #64748b);
    line-height: 1.55;
}

.lb-learning-objectives {
    margin: 0 0 1rem;
    padding: .85rem 1rem;
    border-radius: .65rem;
    border: 1px solid color-mix(in srgb, var(--accent-primary, #2563eb) 18%, var(--border-color, #e2e8f0));
    background: color-mix(in srgb, var(--accent-primary, #2563eb) 6%, var(--bg-secondary, #f8fafc));
}

.lb-learning-objectives ul {
    margin: .45rem 0 0 1.1rem;
    padding: 0;
    color: var(--text-secondary, #475569);
}

.lb-reading-body {
    font-size: clamp(.9375rem, 2.4vw, 1.02rem);
    line-height: 1.78;
}

.lb-term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: .75rem;
    margin: 0;
    padding: 0;
}

.lb-term-card {
    margin: 0;
    padding: .9rem 1rem;
    border-radius: .7rem;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    animation: lbSpotIn .45s ease both;
    animation-delay: calc(var(--card-i, 0) * 70ms);
}

.lb-term-name {
    margin: 0 0 .4rem;
    font-size: .95rem;
    font-weight: 700;
    color: var(--accent-primary, #2563eb);
}

.lb-term-def {
    margin: 0;
    font-size: .875rem;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}

.lb-term-example {
    margin: .55rem 0 0;
    padding-top: .55rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
    font-size: .8125rem;
    color: var(--text-muted, #64748b);
}

.lb-term-example-label {
    display: block;
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--accent-primary, #2563eb);
    margin-bottom: .2rem;
}

.lb-recap-premium {
    border-left: 3px solid var(--accent-primary, #2563eb);
    background: linear-gradient(135deg, rgba(37, 99, 235, .05), rgba(16, 185, 129, .04));
}

.lb-recap-concepts {
    margin: .5rem 0 1rem 1.15rem;
    padding: 0;
    color: var(--text-secondary, #475569);
}

.lb-recap-concepts li {
    margin: .4rem 0;
}

.lb-recap-synthesis {
    font-size: .9375rem;
    line-height: 1.7;
    color: var(--text-secondary, #475569);
}

.lb-hook-reading {
    border-left: 3px solid var(--accent-primary, #2563eb);
    background: var(--bg-secondary, #f8fafc);
    padding: .9rem 1.1rem;
    border-radius: 0 .75rem .75rem 0;
}

.lb-hook-reading .lb-hook-text {
    font-weight: 500;
}

.lb-hook-funnel {
    border-left: 0;
    border-radius: .75rem;
    padding: 1rem 1.15rem;
    background: var(--bg-card, var(--bg-secondary, #f8fafc));
    border: 1px solid var(--border-color, #e2e8f0);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.55;
    box-sizing: border-box;
}

.lb-hook-funnel .lb-block-chip {
    margin-bottom: .5rem;
}

.lb-hook-funnel .lb-hook-text {
    font-weight: 500;
    margin-top: .35rem;
}

[data-theme="dark"] .lb-hook-funnel {
    background: var(--bg-card, #1e293b);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .lb-reading-premium,
[data-theme="dark"] .lb-definitions-premium,
[data-theme="dark"] .lb-recap-premium {
    background: var(--bg-card, #1e293b);
}

[data-theme="dark"] .lb-term-card {
    background: color-mix(in srgb, var(--bg-secondary, #0f172a) 80%, #1e293b);
}

[data-theme="dark"] .lb-theory-prose .katex-display {
    background: var(--bg-secondary, #0f172a);
}

@media (max-width: 768px) {

    .lb-reading-premium,
    .lb-definitions-premium,
    .lb-recap-premium {
        padding: .95rem 1rem;
    }

    .lb-term-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lb-reading-body {
        font-size: .9375rem;
        line-height: 1.72;
    }
}