/* Shared proportions for the modernized application views. */
:root {
    --modern-hero-radius: 28px;
    --modern-panel-radius: 22px;
    --modern-hero-padding: clamp(1.6rem, 3vw, 2.8rem);
    --modern-panel-padding: clamp(1.15rem, 2.4vw, 1.6rem);
    --modern-page-gap: 1.25rem;
}

:is(
    .dashboard-hero,
    .quiz-home-hero,
    .quiz-history-hero,
    .tasks-hero,
    .flashcards-panel-hero,
    .notes-modern-hero,
    .notes-submissions-modern-hero,
    .image-search-hero,
    .profile-modern-page .profile-hero,
    .ai-tokens-hero,
    .support-modern-hero,
    .support-form-hero,
    .support-detail-hero,
    .legal-modern-hero,
    .category-modern-hero,
    .question-create-modern-page .question-form__hero,
    .task-detail-modern-hero
) {
    min-height: 420px;
    padding: var(--modern-hero-padding);
    border-radius: var(--modern-hero-radius);
}

:is(
    .dashboard-hero,
    .quiz-home-hero,
    .quiz-history-hero,
    .tasks-hero,
    .flashcards-panel-hero,
    .notes-modern-hero,
    .notes-submissions-modern-hero,
    .image-search-hero,
    .profile-modern-page .profile-hero,
    .ai-tokens-hero,
    .support-modern-hero,
    .support-form-hero,
    .support-detail-hero,
    .legal-modern-hero,
    .category-modern-hero,
    .question-create-modern-page .question-form__hero,
    .task-detail-modern-hero
) h1 {
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

:is(
    .dashboard-hero__lead,
    .quiz-home-hero__lead,
    .quiz-history-hero__lead,
    .notes-modern-hero__content > p:not(.workspace-eyebrow),
    .notes-submissions-modern-hero__content > p:not(.workspace-eyebrow),
    .image-search-hero__info > p:not(.image-search-eyebrow),
    .profile-modern-page .profile-hero__info > p:last-child,
    .ai-tokens-hero__lead,
    .support-modern-hero__content > p:not(.support-modern-eyebrow),
    .support-form-hero > div:first-child > p:not(.support-modern-eyebrow),
    .legal-modern-hero__content > p:not(.legal-modern-eyebrow),
    .category-modern-hero__content > p:not(.category-modern-eyebrow),
    .tasks-hero > div:first-of-type > p:not(.workspace-eyebrow)
) {
    margin-top: 1rem;
    font-size: clamp(0.86rem, 1.25vw, 1rem);
    line-height: 1.6;
}

:is(
    .dashboard-hero__actions,
    .quiz-home-hero__actions,
    .image-search-hero__actions,
    .notes-modern-hero__actions,
    .notes-submissions-modern-hero__actions,
    .category-modern-hero__actions
) {
    margin-top: 1.15rem;
}

:is(
    .dashboard-page,
    .quiz-home-page,
    .quiz-history-page,
    .tasks-page,
    .flashcards-panel-page,
    .notes-modern-page,
    .notes-submissions-modern-page,
    .image-search-page,
    .profile-modern-page,
    .ai-tokens-page,
    .support-modern-page,
    .legal-modern-page,
    .category-modern-page,
    .question-create-modern-page,
    .task-detail-modern-page
) {
    gap: var(--modern-page-gap);
}

:is(
    .dashboard-page,
    .quiz-home-page,
    .quiz-history-page,
    .tasks-page,
    .task-detail-modern-page,
    .flashcards-panel-page,
    .flashcards-page,
    .notes-modern-page,
    .notes-submissions-modern-page,
    .image-search-page,
    .profile-modern-page,
    .ai-tokens-page,
    .support-modern-page,
    .legal-modern-page,
    .category-modern-page,
    .question-create-modern-page
) > * {
    animation: modern-page-rise 520ms both;
}

:is(
    .dashboard-page,
    .quiz-home-page,
    .quiz-history-page,
    .tasks-page,
    .task-detail-modern-page,
    .flashcards-panel-page,
    .flashcards-page,
    .notes-modern-page,
    .notes-submissions-modern-page,
    .image-search-page,
    .profile-modern-page,
    .ai-tokens-page,
    .support-modern-page,
    .legal-modern-page,
    .category-modern-page,
    .question-create-modern-page
) > *:nth-child(2) {
    animation-delay: 70ms;
}

:is(
    .dashboard-page,
    .quiz-home-page,
    .quiz-history-page,
    .tasks-page,
    .task-detail-modern-page,
    .flashcards-panel-page,
    .flashcards-page,
    .notes-modern-page,
    .notes-submissions-modern-page,
    .image-search-page,
    .profile-modern-page,
    .ai-tokens-page,
    .support-modern-page,
    .legal-modern-page,
    .category-modern-page,
    .question-create-modern-page
) > *:nth-child(3) {
    animation-delay: 120ms;
}

:is(
    .dashboard-page,
    .quiz-home-page,
    .quiz-history-page,
    .tasks-page,
    .task-detail-modern-page,
    .flashcards-panel-page,
    .flashcards-page,
    .notes-modern-page,
    .notes-submissions-modern-page,
    .image-search-page,
    .profile-modern-page,
    .ai-tokens-page,
    .support-modern-page,
    .legal-modern-page,
    .category-modern-page,
    .question-create-modern-page
) > *:nth-child(n + 4) {
    animation-delay: 160ms;
}

@keyframes modern-page-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

:is(
    .quiz-home-overview,
    .image-search-hero__stats,
    .ai-balance-panel,
    .support-modern-summary,
    .support-form-guide
) {
    padding: 1.2rem;
    border-radius: 20px;
}

.dashboard-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.75fr);
    gap: clamp(1.5rem, 4vw, 3.25rem);
}

.dashboard-hero h1 {
    max-width: 650px;
}

.dashboard-hero__lead {
    max-width: 590px;
}

.dashboard-hero__actions {
    gap: 0.55rem;
}

.dashboard-action {
    min-height: 43px;
    padding: 0.62rem 0.85rem;
    font-size: 0.78rem;
}

.dashboard-hero__bonus {
    margin-top: 0.85rem;
    font-size: 0.72rem;
}

.dashboard-hero__stats {
    gap: 0.6rem;
}

.dashboard-hero__stats li {
    min-height: 105px;
    padding: 0.9rem;
    border-radius: 16px;
}

.quiz-home-hero,
.support-modern-hero {
    gap: clamp(1.5rem, 4vw, 3.25rem);
}

.quiz-home-overview {
    gap: 0.9rem;
}

.quiz-home-overview__progress {
    width: 88px;
    height: 88px;
}

.support-modern-summary__stats {
    margin-top: 0.9rem;
}

.support-modern-summary__main > strong {
    font-size: clamp(3rem, 5vw, 4.2rem);
}

.profile-modern-page .profile-membership,
.profile-modern-page .profile-bonus-card {
    border-radius: 18px;
}

:is(
    .dashboard-grid,
    .dashboard-recent,
    .quiz-home-library,
    .image-search-upload,
    .image-search-extracted,
    .image-search-results,
    .image-search-empty,
    .ai-package-card,
    .ai-benefits-card,
    .ai-orders-card,
    .support-modern-section,
    .support-modern-form-card,
    .support-conversation,
    .support-reply-card,
    .legal-modern-content,
    .question-create-modern-page .question-form__section
) {
    border-radius: var(--modern-panel-radius);
}

@media (max-width: 920px) {
    .dashboard-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-hero__copy,
    .dashboard-hero__stats {
        width: 100%;
        min-width: 0;
    }

    :is(
        .dashboard-hero,
        .quiz-home-hero,
        .quiz-history-hero,
        .tasks-hero,
        .flashcards-panel-hero,
        .notes-modern-hero,
        .notes-submissions-modern-hero,
        .image-search-hero,
        .profile-modern-page .profile-hero,
        .ai-tokens-hero,
        .support-modern-hero,
        .support-form-hero,
        .support-detail-hero,
        .legal-modern-hero,
        .category-modern-hero,
        .question-create-modern-page .question-form__hero,
        .task-detail-modern-hero
    ) {
        min-height: 0;
    }
}

@media (max-width: 680px) {
    :root {
        --modern-hero-radius: 24px;
        --modern-panel-radius: 19px;
        --modern-hero-padding: 1.25rem;
        --modern-panel-padding: 1rem;
        --modern-page-gap: 0.9rem;
    }

    :is(
        .dashboard-hero,
        .quiz-home-hero,
        .quiz-history-hero,
        .tasks-hero,
        .flashcards-panel-hero,
        .notes-modern-hero,
        .notes-submissions-modern-hero,
        .image-search-hero,
        .profile-modern-page .profile-hero,
        .ai-tokens-hero,
        .support-modern-hero,
        .support-form-hero,
        .support-detail-hero,
        .legal-modern-hero,
        .category-modern-hero,
        .question-create-modern-page .question-form__hero,
        .task-detail-modern-hero
    ) h1 {
        font-size: clamp(2.15rem, 10.5vw, 2.85rem);
    }

    .dashboard-hero {
        gap: 1.35rem;
        padding: 1.25rem;
    }

    .dashboard-hero h1 {
        max-width: 100%;
        font-size: clamp(2.05rem, 10.5vw, 2.75rem);
        line-height: 1.02;
        overflow-wrap: anywhere;
    }

    .dashboard-hero__lead {
        max-width: 100%;
        font-size: 0.88rem;
        line-height: 1.58;
    }

    .dashboard-hero__actions {
        width: 100%;
    }

    .dashboard-action {
        min-width: 0;
        padding-inline: 0.7rem;
        font-size: 0.73rem;
        line-height: 1.25;
        text-align: center;
    }

    .dashboard-hero__bonus {
        width: 100%;
        margin-top: 1rem;
        font-size: 0.7rem;
        line-height: 1.45;
    }

    .dashboard-hero__stats {
        position: relative;
        z-index: 1;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero__stats li {
        width: auto;
        min-width: 0;
        min-height: 96px;
    }

    .dashboard-stat__head small {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .dashboard-stat__value {
        font-size: clamp(1.6rem, 12cqi, 2rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    :is(
        .dashboard-page,
        .quiz-home-page,
        .quiz-history-page,
        .tasks-page,
        .task-detail-modern-page,
        .flashcards-panel-page,
        .flashcards-page,
        .notes-modern-page,
        .notes-submissions-modern-page,
        .image-search-page,
        .profile-modern-page,
        .ai-tokens-page,
        .support-modern-page,
        .legal-modern-page,
        .category-modern-page,
        .question-create-modern-page
    ) > * {
        animation: none;
    }
}
