
.fact-generation-view {
    margin-top: 48px;
    padding: clamp(22px, 4vw, 36px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 24px
}

.generation-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgb(20 11 46 / .72);
    backdrop-filter: blur(12px)
}

.generation-overlay.hidden {
    display: none !important
}

.generation-view {
    width: min(740px, 100%);
    max-height: calc(100dvh - 40px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 26px;
    box-shadow: 0 32px 90px rgb(20 11 46 / .34)
}

.generation-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px
}

.generation-head h2 {
    font-size: clamp(26px, 3.2vw, 34px)
}

#generationPercent,
#quickFactGenerationPercent {
    font: 800 clamp(32px, 4.5vw, 42px)/1 var(--font-display);
    color: var(--color-primary);
    font-variant-numeric: tabular-nums
}

.progress-track {
    height: 10px;
    overflow: hidden;
    margin: 14px 0 0;
    border-radius: var(--radius-pill);
    background: #e1e8e5
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-primary), #2ba99d);
    transition: width .35s var(--ease)
}

.generation-steps {
    display: grid;
    gap: 10px;
    margin: 0
}

.generation-step {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    color: var(--color-text-muted);
    background: #fff;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease
}

.generation-step i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border-strong);
    border-radius: 11px;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
    background: #f7f5fc
}

.generation-step.running {
    border-color: #94c9bf;
    color: var(--color-text);
    background: var(--color-primary-soft)
}

.generation-step.running i {
    border: 3px solid #afd9d1;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    font-size: 0;
    background: #fff
}

.generation-step.completed {
    color: var(--color-success)
}

.generation-step.completed i {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success)
}

.generation-error {
    padding: 16px 18px;
    background: #fff1f0;
    color: #8f2118;
    border: 1px solid #fac7c3;
    border-radius: 12px;
    margin: 16px 0 0
}

.learning-screen {
    min-height: 70vh
}

.back-button {
    margin-bottom: 24px
}

.learning-screen #courseDetail {
    margin-top: 0
}

.learning-screen .detail-head {
    border-top: 0;
    padding-top: 0
}

@media(max-width:600px) {
    .generation-head {
        align-items: flex-start
    }

    .fact-generation-view {
        margin-top: 32px
    }
}