:root {
    --app-bg: #f4f6f9;
    --app-surface: #ffffff;
    --app-text: #202733;
    --app-muted: #6c757d;
    --app-primary: #0d6efd;
    --app-primary-soft: #eaf2ff;
    --app-border: #e8ebef;
    --app-radius: 1rem;
    --app-shadow: 0 12px 30px rgba(31, 45, 61, 0.08);
}

/* Project2: floating back-to-top button for view.php */
.p2-scroll-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 54px;
    height: 54px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #0d6efd;
    color: #fff;
    font: inherit;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(13, 110, 253, .35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.p2-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.p2-scroll-top:hover,
.p2-scroll-top:focus-visible {
    background: #0b5ed7;
    color: #fff;
}

.p2-scroll-top:focus-visible {
    outline: 3px solid rgba(13, 110, 253, .28);
    outline-offset: 3px;
}

@media (max-width: 767.98px) {
    .p2-scroll-top {
        right: 14px;
        bottom: 18px;
        width: 50px;
        min-width: 50px;
        height: 50px;
        padding: 0;
    }

    .p2-scroll-top span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .p2-scroll-top {
        transition: none;
    }
}

@media print {
    .p2-scroll-top {
        display: none !important;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

img {
    max-width: 100%;
}

.card {
    border-radius: var(--app-radius);
}

.card-hover {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card-hover:hover,
.card-hover:focus-within {
    transform: translateY(-5px);
    box-shadow: var(--app-shadow) !important;
}

.hero-section {
    overflow: hidden;
    border: 1px solid rgba(13, 110, 253, 0.08);
    border-radius: 1.25rem;
    background:
        radial-gradient(circle at top right, rgba(13, 202, 240, 0.18), transparent 36%),
        linear-gradient(120deg, #ffffff 0%, #eef5ff 100%);
    box-shadow: var(--app-shadow);
}

.hero-content {
    padding: clamp(1.5rem, 4vw, 3.25rem);
}

.hero-kicker,
.section-eyebrow {
    color: var(--app-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-title {
    max-width: 760px;
    font-size: clamp(2rem, 5vw, 3.7rem);
    font-weight: 800;
    line-height: 1.08;
}

.hero-description {
    max-width: 720px;
    color: var(--app-muted);
    font-size: 1.05rem;
}

.hero-summary-card {
    padding: 1.25rem;
    border: 1px solid rgba(13, 110, 253, 0.1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
}

.hero-summary-icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 1.3rem;
}

.hero-stat {
    height: 100%;
    padding: 0.8rem 0.35rem;
    border-radius: 0.8rem;
    background: #f8fafc;
    text-align: center;
}

.hero-stat strong,
.hero-stat span {
    display: block;
}

.hero-stat strong {
    font-size: 1.15rem;
}

.hero-stat span {
    margin-top: 0.15rem;
    color: var(--app-muted);
    font-size: 0.72rem;
}

.dashboard-sidebar {
    position: sticky;
    top: 1rem;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading.compact {
    align-items: center;
    margin-bottom: 0;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 750;
}

.section-link {
    color: var(--app-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.section-link:hover {
    text-decoration: underline;
}

.learning-card {
    overflow: hidden;
}

.learning-card-media {
    position: relative;
}

.quiz-thumb {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.learning-card-icon {
    position: absolute;
    right: 1rem;
    bottom: -1.25rem;
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--app-primary);
    color: #fff;
    font-size: 1.15rem;
}

.content-card {
    overflow: hidden;
}

.content-card-image {
    height: 145px;
    object-fit: cover;
    background: #edf3fb;
}

.truncate-2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.cta-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: 0 8px 22px rgba(31, 45, 61, 0.06);
}

.lesson-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.18s ease;
}

.lesson-list-item:hover {
    background: #f8fafc;
}

.lesson-list-icon {
    display: inline-grid;
    min-width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 0.75rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.footer-link {
    color: var(--app-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--app-primary);
}

@media (max-width: 991.98px) {
    .dashboard-sidebar {
        position: static;
    }

    .cta-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .hero-content {
        padding: 1.35rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .quiz-thumb {
        height: 140px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .card-hover {
        transition: none;
    }

    .card-hover:hover,
    .card-hover:focus-within {
        transform: none;
    }
}


/* Sprint1-Day2-v1.1 */
.empty-state {
    padding: 3rem 1.5rem;
    border: 1px dashed #cfd6df;
    border-radius: 1rem;
    background: #fff;
    text-align: center;
}

.subject-card {
    display: flex;
    min-height: 112px;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: 0 8px 20px rgba(31, 45, 61, 0.05);
    transition: transform .18s ease, box-shadow .18s ease;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--app-shadow);
}

.subject-card-icon {
    display: inline-grid;
    min-width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 1rem;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 1.3rem;
}

.search-header {
    padding: 1.35rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
}


/* Sprint1-Day3-v1.2 */
.knowledge-content {
    font-size: 1.05rem;
    line-height: 1.85;
}

.knowledge-content img {
    height: auto;
    border-radius: .75rem;
}

.knowledge-content h2,
.knowledge-content h3 {
    margin-top: 1.75rem;
    margin-bottom: .75rem;
}

.formula-card {
    border-left: 4px solid var(--app-primary) !important;
}

.learning-path {
    position: relative;
    display: grid;
    gap: 1rem;
}

.learning-path::before {
    position: absolute;
    top: 1rem;
    bottom: 1rem;
    left: 24px;
    width: 2px;
    background: #dce5f2;
    content: "";
}

.learning-path-step {
    position: relative;
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 1rem;
}

.learning-path-number {
    z-index: 1;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 4px solid var(--app-bg);
    border-radius: 50%;
    background: var(--app-primary);
    color: #fff;
    font-weight: 700;
}

.learning-path-card {
    padding: 1.25rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: 0 8px 22px rgba(31, 45, 61, .05);
}

.topic-item {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem;
    border: 1px solid #edf0f4;
    border-radius: .75rem;
    background: #f9fbfd;
}

@media (max-width: 575.98px) {
    .learning-path-step {
        grid-template-columns: 42px 1fr;
        gap: .75rem;
    }

    .learning-path-number {
        width: 42px;
        height: 42px;
    }

    .learning-path::before {
        left: 20px;
    }
}


/* Sprint1 Polish v1.3.1 */
.learning-subnav {
    position: relative;
    z-index: 1010;
}

.learning-subnav-links {
    gap: .25rem;
    scrollbar-width: thin;
}

.learning-subnav-links .nav-link {
    flex: 0 0 auto;
    padding: .45rem .75rem;
    color: #495057;
    font-size: .9rem;
}

.learning-subnav-links .nav-link:hover {
    background: #eef5ff;
    color: var(--app-primary);
}

.learning-subnav-links .nav-link.active {
    background: var(--app-primary);
    color: #fff;
}

.learning-quick-search {
    width: min(100%, 290px);
}

.knowledge-card {
    overflow: hidden;
}

.lesson-sidebar {
    top: 6.5rem;
}

.lesson-meta dt,
.lesson-meta dd {
    margin-bottom: .65rem;
}

.related-item {
    border-bottom: 1px dashed #e9ecef !important;
}

.related-item:last-child {
    border-bottom: 0 !important;
}

.adjacent-lesson-card {
    display: flex;
    min-height: 90px;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.15rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(31, 45, 61, .04);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.adjacent-lesson-card:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, .35);
    box-shadow: 0 10px 24px rgba(31, 45, 61, .08);
}

.app-notice {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1090;
    max-width: min(360px, calc(100vw - 2rem));
    padding: .8rem 1rem;
    border-radius: .75rem;
    background: #198754;
    color: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.app-notice.show {
    opacity: 1;
    transform: translateY(0);
}

.app-notice-warning {
    background: #b58100;
}

.app-notice-danger {
    background: #dc3545;
}

@media (max-width: 991.98px) {
    .learning-quick-search {
        width: 100%;
    }

    .lesson-sidebar {
        position: static !important;
    }
}


/* =========================================================
   Sprint1 Premium UI v1.4
========================================================= */
:root {
    --premium-navy: #10233f;
    --premium-blue: #1769e0;
    --premium-blue-soft: #eef5ff;
    --premium-cyan: #2ec5ce;
    --premium-text: #172033;
    --premium-muted: #667085;
    --premium-surface: #ffffff;
    --premium-bg: #f4f7fb;
    --premium-line: #e7ecf3;
    --premium-shadow: 0 18px 50px rgba(16, 35, 63, .08);
    --premium-radius: 22px;
}

body {
    background:
        radial-gradient(circle at 8% 0%, rgba(23, 105, 224, .07), transparent 26rem),
        var(--premium-bg);
    color: var(--premium-text);
}

.learning-toolbar {
    position: relative;
    z-index: 1005;
    border-bottom: 1px solid rgba(16, 35, 63, .08);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.learning-toolbar-inner {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.learning-tabs {
    display: flex;
    align-items: center;
    gap: .35rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.learning-tabs::-webkit-scrollbar {
    display: none;
}

.learning-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .55rem;
    padding: .65rem .85rem;
    border-radius: 12px;
    color: #536071;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    transition: .2s ease;
}

.learning-tab-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 10px;
    background: #f1f4f8;
    color: var(--premium-blue);
}

.learning-tab:hover {
    background: #f7f9fc;
    color: var(--premium-blue);
}

.learning-tab.active {
    background: var(--premium-blue-soft);
    color: var(--premium-blue);
}

.learning-tab.active .learning-tab-icon {
    background: var(--premium-blue);
    color: #fff;
    box-shadow: 0 8px 18px rgba(23, 105, 224, .25);
}

.learning-search {
    position: relative;
    display: flex;
    width: min(390px, 35vw);
    align-items: center;
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 14px;
    background: #fff;
    transition: .2s ease;
}

.learning-search:focus-within {
    border-color: rgba(23, 105, 224, .55);
    box-shadow: 0 0 0 4px rgba(23, 105, 224, .09);
}

.learning-search-icon {
    margin-left: .9rem;
    color: #8590a2;
}

.learning-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    padding: .78rem .7rem;
    background: transparent;
    font-size: .9rem;
}

.learning-search button {
    align-self: stretch;
    border: 0;
    padding: 0 1rem;
    background: var(--premium-blue);
    color: #fff;
    font-weight: 600;
}

.premium-learning-page {
    min-height: calc(100vh - 150px);
}

.premium-breadcrumb-wrap {
    margin-bottom: 1rem;
}

.premium-breadcrumb {
    padding: 0;
    font-size: .9rem;
}

.premium-breadcrumb a {
    color: var(--premium-blue);
    text-decoration: none;
}

.lesson-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: 2rem 2.1rem;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(242,247,255,.96)),
        #fff;
    box-shadow: var(--premium-shadow);
}

.lesson-hero::after {
    position: absolute;
    top: -90px;
    right: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 197, 206, .18), rgba(23, 105, 224, .04) 60%, transparent 72%);
    content: "";
}

.lesson-hero-main,
.lesson-hero-actions {
    position: relative;
    z-index: 1;
}

.lesson-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: .85rem;
}

.lesson-type-pill,
.lesson-level-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: .35rem .72rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.lesson-type-pill {
    background: var(--premium-blue);
    color: #fff;
    box-shadow: 0 8px 20px rgba(23, 105, 224, .23);
}

.lesson-level-pill {
    border: 1px solid #dce5f0;
    background: #fff;
    color: #5f6b7d;
}

.lesson-hero h1 {
    max-width: 820px;
    margin: 0;
    color: var(--premium-navy);
    font-size: clamp(2rem, 4vw, 3.55rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.lesson-lead {
    max-width: 760px;
    margin: 1rem 0 0;
    color: var(--premium-muted);
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    line-height: 1.75;
}

.lesson-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.4rem;
    margin-top: 1.25rem;
    color: #647084;
    font-size: .9rem;
}

.lesson-stats span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.lesson-stats i {
    color: var(--premium-blue);
}

.lesson-hero-actions {
    display: grid;
    min-width: 190px;
    gap: .7rem;
}

.premium-bookmark-btn,
.premium-outline-btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border-radius: 13px;
    padding: .72rem 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: .2s ease;
}

.premium-bookmark-btn {
    border: 1px solid #dce4ee;
    background: #fff;
    color: #39465a;
}

.premium-bookmark-btn:hover,
.premium-bookmark-btn.is-bookmarked {
    border-color: #f3c662;
    background: #fff5d8;
    color: #8a6100;
}

.premium-outline-btn {
    border: 1px solid rgba(23, 105, 224, .2);
    background: var(--premium-blue-soft);
    color: var(--premium-blue);
}

.premium-outline-btn:hover {
    background: var(--premium-blue);
    color: #fff;
}

.premium-content-card,
.premium-side-card {
    border: 1px solid rgba(16, 35, 63, .07);
    border-radius: var(--premium-radius);
    background: var(--premium-surface);
    box-shadow: var(--premium-shadow);
}

.premium-content-card {
    overflow: hidden;
}

.premium-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.55rem 1.8rem;
    border-bottom: 1px solid var(--premium-line);
    background: linear-gradient(180deg, #fff, #fbfcfe);
}

.premium-eyebrow,
.premium-side-card-title small {
    display: block;
    margin-bottom: .15rem;
    color: var(--premium-blue);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.premium-content-header h2,
.premium-side-card-title h2 {
    margin: 0;
    color: var(--premium-navy);
    font-size: 1.06rem;
    font-weight: 800;
}

.content-progress-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: 999px;
    padding: .42rem .7rem;
    background: #eaf9f0;
    color: #15803d;
    font-size: .78rem;
    font-weight: 700;
}

.premium-knowledge-content {
    padding: 2rem 1.8rem 2.3rem;
    color: #263247;
    font-size: 1.06rem;
    line-height: 1.95;
}

.premium-knowledge-content > :first-child {
    margin-top: 0;
}

.premium-knowledge-content h2 {
    margin: 2rem 0 .8rem;
    color: var(--premium-navy);
    font-size: 1.55rem;
    font-weight: 800;
}

.premium-knowledge-content h3 {
    margin: 1.65rem 0 .65rem;
    color: #213653;
    font-size: 1.2rem;
    font-weight: 750;
}

.premium-knowledge-content p {
    margin-bottom: 1rem;
}

.premium-knowledge-content .formula-box,
.premium-knowledge-content blockquote {
    position: relative;
    margin: 1.4rem 0;
    padding: 1.2rem 1.25rem 1.2rem 1.45rem;
    border: 0;
    border-left: 4px solid var(--premium-blue);
    border-radius: 0 16px 16px 0;
    background: linear-gradient(135deg, #f1f6ff, #f8fbff);
    color: #1f3655;
}

.premium-knowledge-content .formula-box::before {
    display: block;
    margin-bottom: .4rem;
    color: var(--premium-blue);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    content: "สูตรสำคัญ";
}

.lesson-complete-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 1.8rem 1.8rem;
    padding: 1.1rem 1.2rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff8ff, #f4fbff);
}

.lesson-complete-panel strong {
    color: var(--premium-navy);
}

.lesson-complete-panel p {
    margin: .15rem 0 0;
    color: var(--premium-muted);
    font-size: .87rem;
}

.premium-sidebar-stack {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 1rem;
}

.premium-side-card {
    padding: 1.25rem;
}

.premium-side-card-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.side-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    background: var(--premium-blue-soft);
    color: var(--premium-blue);
    font-size: 1.1rem;
}

.premium-meta-list {
    margin: 0;
}

.premium-meta-list > div {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: .7rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--premium-line);
}

.premium-meta-list > div:last-child {
    border-bottom: 0;
}

.premium-meta-list dt {
    color: #7a8596;
    font-size: .82rem;
    font-weight: 600;
}

.premium-meta-list dd {
    margin: 0;
    color: #24334b;
    font-size: .88rem;
    font-weight: 700;
}

.level-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: .4rem;
    border-radius: 50%;
    background: #22c55e;
}

.premium-side-action {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-top: .9rem;
    padding: .75rem .85rem;
    border-radius: 12px;
    background: #f7f9fc;
    color: #334155;
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
}

.premium-side-action:hover {
    background: var(--premium-blue-soft);
    color: var(--premium-blue);
}

.premium-related-list {
    display: grid;
    gap: .25rem;
}

.premium-related-item {
    display: grid;
    grid-template-columns: 38px 1fr 18px;
    align-items: center;
    gap: .7rem;
    padding: .72rem .25rem;
    border-bottom: 1px solid var(--premium-line);
    color: inherit;
    text-decoration: none;
}

.premium-related-item:last-child {
    border-bottom: 0;
}

.premium-related-item:hover strong {
    color: var(--premium-blue);
}

.related-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: #f2f6fb;
    color: var(--premium-blue);
}

.related-copy {
    min-width: 0;
}

.related-copy strong {
    display: block;
    overflow: hidden;
    color: #263247;
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-copy small {
    display: -webkit-box;
    overflow: hidden;
    margin-top: .2rem;
    color: #8590a2;
    font-size: .73rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.premium-related-item > i {
    color: #a1aaba;
    font-size: .8rem;
}

.premium-empty-related {
    padding: 1rem;
    text-align: center;
    color: var(--premium-muted);
}

.premium-empty-related i {
    font-size: 1.7rem;
}

.premium-empty-related p {
    margin: .4rem 0 0;
    font-size: .85rem;
}

.lesson-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.lesson-pagination-card {
    display: flex;
    min-height: 100px;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.15rem;
    border: 1px solid var(--premium-line);
    border-radius: 17px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(16, 35, 63, .05);
    transition: .2s ease;
}

.lesson-pagination-card:hover {
    transform: translateY(-2px);
    border-color: rgba(23, 105, 224, .3);
    box-shadow: 0 16px 32px rgba(16, 35, 63, .08);
}

.lesson-pagination-card span {
    margin-bottom: .3rem;
    color: var(--premium-blue);
    font-size: .78rem;
    font-weight: 700;
}

.lesson-pagination-card strong {
    color: var(--premium-navy);
    font-size: .92rem;
}

.lesson-pagination-card.next {
    text-align: right;
}

@media (max-width: 1199.98px) {
    .lesson-hero {
        align-items: stretch;
    }

    .lesson-hero-actions {
        min-width: 170px;
    }
}

@media (max-width: 991.98px) {
    .learning-toolbar-inner {
        min-height: auto;
        flex-direction: column;
        align-items: stretch;
        padding: .75rem 0;
    }

    .learning-search {
        width: 100%;
    }

    .lesson-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
    }

    .lesson-hero-actions {
        display: flex;
        min-width: 0;
        flex-wrap: wrap;
    }

    .premium-bookmark-btn,
    .premium-outline-btn {
        flex: 1 1 180px;
    }

    .premium-sidebar-stack {
        position: static;
    }
}

@media (max-width: 575.98px) {
    .premium-learning-page .container {
        padding-right: .85rem;
        padding-left: .85rem;
    }

    .learning-tab {
        padding: .55rem .65rem;
        font-size: .82rem;
    }

    .learning-tab-icon {
        width: 28px;
        height: 28px;
    }

    .lesson-hero {
        border-radius: 20px;
    }

    .lesson-hero h1 {
        font-size: 2rem;
    }

    .lesson-stats {
        gap: .65rem;
    }

    .premium-content-header,
    .premium-knowledge-content {
        padding-right: 1.15rem;
        padding-left: 1.15rem;
    }

    .content-progress-badge {
        display: none;
    }

    .lesson-complete-panel {
        flex-direction: column;
        align-items: stretch;
        margin-right: 1.15rem;
        margin-left: 1.15rem;
    }

    .lesson-pagination {
        grid-template-columns: 1fr;
    }

    .lesson-pagination-card.next {
        text-align: left;
    }
}


/* ==========================================================
   Project2 Version 3.0 Production
========================================================== */
:root {
    --p2-navy: #10233f;
    --p2-blue: #1769e0;
    --p2-cyan: #23b6c6;
    --p2-bg: #f4f7fb;
    --p2-line: #e2e8f0;
    --p2-muted: #64748b;
    --p2-radius: 20px;
    --p2-shadow: 0 18px 50px rgba(15, 35, 63, .08);
}

body.p2-body {
    min-height: 100vh;
    background: var(--p2-bg);
    color: #1f2937;
}

.p2-main-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 68px;
    background: linear-gradient(100deg, #0e1f36, #142f50);
    box-shadow: 0 8px 26px rgba(15, 35, 63, .16);
}

.p2-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-right: 1.5rem;
}

.p2-brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--p2-blue), var(--p2-cyan));
    box-shadow: 0 10px 24px rgba(23, 105, 224, .3);
}

.p2-brand strong,
.p2-brand small {
    display: block;
    line-height: 1.1;
}

.p2-brand strong {
    font-size: .95rem;
    letter-spacing: .03em;
}

.p2-brand small {
    margin-top: .18rem;
    color: rgba(255,255,255,.58);
    font-size: .67rem;
}

.p2-main-navbar .nav-link {
    margin: 0 .1rem;
    border-radius: 10px;
    padding: .62rem .72rem !important;
    color: rgba(255,255,255,.72);
    font-size: .9rem;
    font-weight: 600;
}

.p2-main-navbar .nav-link:hover,
.p2-main-navbar .nav-link.active,
.p2-main-navbar .show > .nav-link {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.p2-dropdown {
    min-width: 270px;
    border: 0;
    border-radius: 16px;
    padding: .55rem;
}

.p2-dropdown .dropdown-item {
    border-radius: 10px;
    padding: .7rem .75rem;
    font-size: .88rem;
}

.p2-nav-search {
    width: min(230px, 100%);
}

.p2-nav-search .form-control {
    border: 0;
    border-radius: 10px 0 0 10px;
}

.p2-nav-search .btn {
    border-radius: 0 10px 10px 0;
}

.p2-page-hero,
.p2-member-panel,
.p2-demo-question {
    border: 1px solid rgba(23,105,224,.1);
    border-radius: var(--p2-radius);
    background: linear-gradient(135deg, #fff, #edf6ff);
    box-shadow: var(--p2-shadow);
}

.p2-page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
}

.p2-page-hero h1,
.p2-member-panel h1 {
    margin: .25rem 0 .5rem;
    color: var(--p2-navy);
    font-weight: 850;
}

.p2-page-hero p,
.p2-member-panel p {
    margin: 0;
    color: var(--p2-muted);
}

.p2-kicker {
    color: var(--p2-blue);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .13em;
}

.p2-feature-card {
    height: 100%;
    padding: 1.4rem;
    border: 1px solid var(--p2-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(15,35,63,.05);
}

.p2-feature-card > i {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: #eaf2ff;
    color: var(--p2-blue);
    font-size: 1.3rem;
}

.p2-feature-card h2 {
    margin: 1rem 0 .4rem;
    color: var(--p2-navy);
    font-size: 1.05rem;
    font-weight: 800;
}

.p2-feature-card p {
    margin: 0;
    color: var(--p2-muted);
    font-size: .9rem;
}

.p2-demo-question {
    padding: 1.6rem;
    background: #fff;
}

.p2-demo-question h2 {
    margin-top: .35rem;
    color: var(--p2-navy);
    font-size: 1.25rem;
    font-weight: 800;
}

.p2-member-panel {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem;
    text-align: center;
}

.p2-member-icon {
    display: grid;
    width: 76px;
    height: 76px;
    margin: 0 auto 1rem;
    place-items: center;
    border-radius: 24px;
    background: #e9f8ef;
    color: #15803d;
    font-size: 2rem;
}

@media (max-width: 991.98px) {
    .p2-main-navbar {
        position: relative;
    }

    .p2-nav-search {
        margin-top: .8rem;
    }
}

@media (max-width: 575.98px) {
    .p2-page-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 1.4rem;
    }

    .p2-member-panel {
        padding: 1.5rem;
    }
}


/* Project2 Version 3.0.1 — One navbar only */
.p2-main-navbar {
    z-index: 1040;
}

.p2-main-navbar + .learning-subnav,
.learning-subnav,
.learning-toolbar-nav {
    display: none !important;
}

.p2-main-navbar .navbar-nav {
    gap: .08rem;
}

.p2-main-navbar .badge {
    font-size: .58rem;
    vertical-align: .12rem;
}

@media (max-width: 1199.98px) {
    .p2-main-navbar .navbar-collapse {
        padding: .75rem 0 1rem;
    }

    .p2-main-navbar .nav-link {
        width: 100%;
    }

    .p2-nav-search {
        width: 100%;
    }
}
