:root {
    --bg: #f5f7fb;
    --surface: rgba(255, 255, 255, 0.94);
    --text: #172033;
    --muted: #667085;
    --primary: #315efb;
    --primary-dark: #2349cf;
    --border: #e5e9f2;
    --shadow: 0 20px 60px rgba(30, 45, 80, 0.10);
    --radius: 24px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(49, 94, 251, .12), transparent 32rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-page { min-height: 100vh; }

.login-shell {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 32px;
    box-shadow: var(--shadow);
}

.brand-panel {
    min-height: 620px;
    padding: 64px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(145deg, rgba(20, 35, 76, .92), rgba(49, 94, 251, .90)),
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.2), transparent 20rem);
}

.brand-panel h1 {
    max-width: 650px;
    font-size: clamp(2.2rem, 4vw, 4.4rem);
    line-height: 1.03;
    letter-spacing: -.05em;
    margin: 18px 0;
}

.brand-panel p {
    max-width: 600px;
    color: rgba(255,255,255,.82);
    font-size: 1.05rem;
}

.brand-mark, .mini-mark {
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: -.04em;
    background: #fff;
    color: var(--primary);
}

.brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    font-size: 1.7rem;
    margin-bottom: 28px;
}

.mini-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    margin-right: 8px;
    box-shadow: 0 8px 20px rgba(49,94,251,.16);
}

.eyebrow {
    display: inline-block;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--primary);
}

.brand-panel .eyebrow { color: rgba(255,255,255,.72); }

.feature-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.feature-strip span {
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.1);
    padding: 9px 14px;
    border-radius: 999px;
    font-size: .86rem;
}

.login-panel {
    padding: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-panel h2 {
    font-size: 2rem;
    letter-spacing: -.03em;
}

.form-control {
    border-radius: 14px;
    border-color: var(--border);
    padding: .9rem 1rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(49,94,251,.12);
}

.btn { border-radius: 13px; }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.demo-box {
    padding: 16px 18px;
    border: 1px dashed #cbd3e5;
    background: #f8faff;
    border-radius: 16px;
    color: var(--muted);
    font-size: .9rem;
}

.app-body { min-height: 100vh; }

.app-navbar {
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand-inline {
    color: var(--text);
    font-weight: 800;
    letter-spacing: -.03em;
    display: flex;
    align-items: center;
}

.hero-card, .content-card, .module-card, .stat-card {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.85);
    box-shadow: 0 14px 40px rgba(32, 48, 80, .07);
}

.hero-card, .content-card {
    border-radius: var(--radius);
    padding: 30px;
}

.hero-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.hero-card h1 { letter-spacing: -.04em; }

.progress-badge {
    min-width: 110px;
    text-align: center;
    padding: 16px;
    border-radius: 18px;
    background: #eef2ff;
    color: var(--primary);
}

.progress-badge span, .progress-badge strong { display: block; }

.progress-badge span {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 700;
}

.progress-badge strong {
    font-size: 1.35rem;
    margin-top: 4px;
}

.module-card {
    display: block;
    min-height: 260px;
    padding: 26px;
    border-radius: 22px;
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 50px rgba(32, 48, 80, .12);
}

.module-card h3 {
    font-size: 1.25rem;
    margin-top: 18px;
}

.module-card p {
    color: var(--muted);
    min-height: 72px;
}

.module-card > span:last-child {
    color: var(--primary);
    font-weight: 700;
}

.module-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    background: #eef2ff;
    font-size: 1.5rem;
}

.learning-path {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.learning-path > div {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafbff;
}

.learning-path strong {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
}

.stat-card {
    padding: 24px;
    border-radius: 20px;
}

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

.stat-card span { font-size: 1.5rem; }
.stat-card strong { font-size: 2rem; margin: 8px 0 2px; }
.stat-card small { color: var(--muted); }

.admin-tile {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafbff;
    font-weight: 700;
}

@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .brand-panel { min-height: auto; padding: 44px 28px; }
    .login-panel { padding: 44px 28px; }
    .learning-path { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 576px) {
    .hero-card {
        align-items: flex-start;
        flex-direction: column;
    }
    .learning-path { grid-template-columns: 1fr; }
    .login-shell { border-radius: 22px; }
}


.lesson-card {
    display: block;
    height: 100%;
    padding: 28px;
    color: inherit;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(32, 48, 80, .07);
    transition: transform .2s ease, box-shadow .2s ease;
}

.lesson-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 50px rgba(32, 48, 80, .12);
}

.lesson-number {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 15px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 800;
}

.lesson-card h2 {
    margin-top: 10px;
    font-size: 1.35rem;
    letter-spacing: -.03em;
}

.lesson-card p {
    color: var(--muted);
    min-height: 74px;
}

.lesson-link {
    color: var(--primary);
    font-weight: 700;
}

.lesson-reader {
    max-width: 920px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--surface);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: var(--shadow);
}

.lesson-reader-head {
    padding: 42px 46px 30px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #fff, #f3f6ff);
}

.lesson-reader-head h1 {
    margin-top: 10px;
    letter-spacing: -.04em;
}

.lesson-reader-head p {
    color: var(--muted);
    font-size: 1.05rem;
    margin-bottom: 0;
}

.lesson-content {
    padding: 42px 46px;
    font-size: 1.05rem;
    line-height: 1.8;
}

.lesson-content h2,
.lesson-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: -.03em;
}

.lesson-content ul,
.lesson-content ol {
    padding-left: 1.4rem;
}

.lesson-reader-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 46px 42px;
}

.lesson-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9rem;
}

.admin-list {
    display: grid;
    gap: 12px;
}

.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafbff;
}

.admin-tile-link {
    display: flex;
    justify-content: space-between;
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease;
}

.admin-tile-link:hover {
    transform: translateY(-2px);
    border-color: #c8d2ff;
}

@media (max-width: 576px) {
    .lesson-reader-head,
    .lesson-content {
        padding-left: 24px;
        padding-right: 24px;
    }

    .lesson-reader-footer {
        padding: 22px 24px 30px;
        flex-direction: column;
    }

    .admin-list-item {
        align-items: flex-start;
        flex-direction: column;
    }
}


.hw-stats {
    display: flex;
    gap: 12px;
}

.hw-stats > div {
    min-width: 100px;
    padding: 14px 16px;
    text-align: center;
    border-radius: 16px;
    background: #eef2ff;
}

.hw-stats strong,
.hw-stats span {
    display: block;
}

.hw-stats strong {
    color: var(--primary);
    font-size: 1.3rem;
}

.hw-stats span {
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}

.hardware-activity-card {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    overflow: hidden;
    background: var(--surface);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: var(--shadow);
}

.hardware-image-wrap {
    min-height: 470px;
    display: grid;
    place-items: center;
    padding: 34px;
    background: linear-gradient(145deg, #eef2ff, #f9faff);
}

.hardware-image-wrap img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 20px;
}

.hardware-placeholder {
    width: 180px;
    height: 180px;
    display: grid;
    place-items: center;
    border-radius: 32px;
    background: #fff;
    color: var(--primary);
    font-size: 5rem;
    font-weight: 800;
    box-shadow: 0 20px 40px rgba(49,94,251,.12);
}

.hardware-question {
    padding: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hardware-question h2 {
    margin-top: 10px;
    letter-spacing: -.04em;
}

.choice-grid {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.choice-option {
    cursor: pointer;
}

.choice-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-option span {
    display: block;
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fff;
    font-weight: 700;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.choice-option span:hover {
    transform: translateY(-1px);
    border-color: #bdc9ff;
}

.choice-option input:checked + span {
    border-color: var(--primary);
    background: #eef2ff;
    color: var(--primary);
}

.feedback-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    padding: 38px;
    border-radius: 26px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: var(--surface);
}

.feedback-correct {
    border-color: #bce7ce;
}

.feedback-wrong {
    border-color: #f1c5c5;
}

.feedback-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    font-size: 2rem;
    font-weight: 900;
    background: #eef2ff;
    color: var(--primary);
}

.feedback-correct .feedback-icon {
    background: #eaf8ef;
    color: #198754;
}

.feedback-wrong .feedback-icon {
    background: #fff0f0;
    color: #dc3545;
}

.explanation-box {
    margin-top: 14px;
    padding: 16px 18px;
    background: #f8faff;
    border-radius: 15px;
    color: var(--muted);
}

.hardware-admin-grid {
    display: grid;
    gap: 12px;
}

.hardware-admin-item {
    display: grid;
    grid-template-columns: 76px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #fafbff;
}

.hardware-admin-thumb {
    width: 76px;
    height: 64px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 800;
}

.hardware-admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hardware-admin-info strong,
.hardware-admin-info small {
    display: block;
}

.hardware-admin-info small {
    margin-top: 3px;
    color: var(--muted);
}

.admin-image-preview {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafbff;
}

.admin-image-preview img {
    display: block;
    width: 100%;
    max-height: 230px;
    object-fit: contain;
}

@media (max-width: 900px) {
    .hardware-activity-card {
        grid-template-columns: 1fr;
    }

    .hardware-image-wrap {
        min-height: 330px;
    }
}

@media (max-width: 576px) {
    .hw-stats {
        width: 100%;
    }

    .hw-stats > div {
        flex: 1;
    }

    .hardware-question {
        padding: 28px 22px 32px;
    }

    .feedback-card {
        grid-template-columns: 1fr;
        padding: 28px 22px;
    }

    .hardware-admin-item {
        grid-template-columns: 64px 1fr;
    }

    .hardware-admin-item > .d-flex {
        grid-column: 1 / -1;
    }
}


.quiz-form {
    display: grid;
    gap: 18px;
}

.quiz-question-card {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 18px;
    padding: 28px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: 0 14px 40px rgba(32, 48, 80, .06);
}

.quiz-question-number,
.question-bank-number {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 800;
}

.quiz-question-main h2 {
    font-size: 1.2rem;
    line-height: 1.45;
    letter-spacing: -.02em;
    margin-bottom: 18px;
}

.quiz-options {
    display: grid;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: stretch;
    cursor: pointer;
}

.quiz-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quiz-letter {
    width: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    background: #f8faff;
    font-weight: 800;
    color: var(--primary);
}

.quiz-text {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 0 14px 14px 0;
    background: #fff;
}

.quiz-option input:checked ~ .quiz-letter,
.quiz-option input:checked ~ .quiz-text {
    border-color: var(--primary);
    background: #eef2ff;
}

.quiz-submit-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.quiz-result-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 28px;
    padding: 34px;
    border-radius: 26px;
    background: linear-gradient(135deg, #ffffff, #f2f5ff);
    box-shadow: var(--shadow);
}

.score-ring {
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: #315efb;
    color: white;
    box-shadow: 0 16px 40px rgba(49,94,251,.25);
}

.score-ring strong {
    font-size: 2.2rem;
    line-height: 1;
}

.score-ring span {
    margin-top: 8px;
    color: rgba(255,255,255,.8);
    font-weight: 700;
}

.quiz-review-list {
    display: grid;
    gap: 16px;
}

.quiz-review-item {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 18px;
    padding: 26px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.review-status {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 1.35rem;
    font-weight: 900;
}

.review-correct .review-status {
    background: #eaf8ef;
    color: #198754;
}

.review-wrong .review-status {
    background: #fff0f0;
    color: #dc3545;
}

.quiz-review-item h2 {
    font-size: 1.1rem;
    line-height: 1.45;
    margin: 8px 0 14px;
}

.review-answer-line {
    margin-top: 6px;
}

.question-bank {
    display: grid;
    gap: 12px;
}

.question-bank-item {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafbff;
}

.question-bank-content strong,
.question-bank-content small {
    display: block;
}

.question-bank-content small {
    color: var(--muted);
    margin-top: 4px;
}

.results-table-wrap {
    overflow-x: auto;
}

.score-chip {
    display: inline-block;
    min-width: 64px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: .85rem;
}

.score-good {
    background: #eaf8ef;
    color: #198754;
}

.score-mid {
    background: #fff8e6;
    color: #a56a00;
}

.score-low {
    background: #fff0f0;
    color: #c83434;
}

@media (max-width: 700px) {
    .quiz-question-card {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .quiz-submit-card {
        align-items: stretch;
        flex-direction: column;
    }

    .quiz-result-hero {
        grid-template-columns: 1fr;
    }

    .score-ring {
        width: 120px;
        height: 120px;
    }

    .quiz-review-item {
        grid-template-columns: 1fr;
    }

    .question-bank-item {
        grid-template-columns: 42px 1fr;
    }

    .question-bank-item > .d-flex {
        grid-column: 1 / -1;
    }
}


.tutor-orb {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: #eef2ff;
    font-size: 2.3rem;
    box-shadow: inset 0 0 0 1px #dce4ff;
}

.ai-mode-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.ai-mode-live {
    background: #eaf8ef;
    color: #198754;
}

.ai-mode-demo {
    background: #fff8e6;
    color: #9a6500;
}

.ai-chat-shell {
    max-width: 980px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.ai-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: #fafbff;
}

.ai-chat-head strong,
.ai-chat-head small {
    display: block;
}

.ai-chat-head small {
    color: var(--muted);
    margin-top: 3px;
}

.ai-chat-messages {
    height: 520px;
    overflow-y: auto;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 10%, rgba(49,94,251,.05), transparent 22rem),
        #ffffff;
}

.chat-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.student-row {
    justify-content: flex-end;
}

.tutor-row {
    justify-content: flex-start;
    align-items: flex-end;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #315efb;
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.chat-bubble {
    max-width: min(720px, 80%);
    padding: 13px 16px;
    border-radius: 18px;
    line-height: 1.55;
}

.student-bubble {
    background: #315efb;
    color: #fff;
    border-bottom-right-radius: 5px;
}

.tutor-bubble {
    background: #f2f5fb;
    color: var(--text);
    border-bottom-left-radius: 5px;
}

.chat-error {
    background: #fff0f0;
    color: #b02a37;
}

.quick-prompts {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 20px 0;
    border-top: 1px solid var(--border);
    background: #fafbff;
}

.quick-prompts button {
    flex: 0 0 auto;
    border: 1px solid #dbe2f3;
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: .82rem;
}

.quick-prompts button:hover {
    border-color: #b9c7ff;
    color: var(--primary);
}

.ai-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px 20px;
    background: #fafbff;
}

.ai-chat-form textarea {
    resize: none;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 12px 14px;
    outline: none;
    font: inherit;
}

.ai-chat-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(49,94,251,.10);
}

.ai-chat-form .btn {
    min-width: 88px;
}

.ai-chat-note {
    padding: 0 20px 16px;
    background: #fafbff;
    color: var(--muted);
    font-size: .78rem;
}

.thinking-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-height: 18px;
}

.thinking-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #98a2b3;
    animation: tutorDot 1.1s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .30s; }

@keyframes tutorDot {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.config-code-card {
    margin-top: 16px;
    padding: 18px;
    background: #f8faff;
    border: 1px solid var(--border);
    border-radius: 16px;
}

@media (max-width: 576px) {
    .ai-chat-messages {
        height: 480px;
        padding: 18px 14px;
    }

    .chat-bubble {
        max-width: 87%;
    }

    .ai-chat-form {
        grid-template-columns: 1fr;
        padding: 12px 14px;
    }

    .quick-prompts {
        padding-left: 14px;
        padding-right: 14px;
    }
}


.completion-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eaf8ef;
    color: #198754;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.lesson-card-complete {
    border-color: #cdebd8;
    background: linear-gradient(145deg, #ffffff, #f4fbf7);
}

.modern-progress {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9edf5;
}

.modern-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #315efb, #5d7cff);
    transition: width .3s ease;
}

.next-step-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fafbff;
}

.mini-activity-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 10px 28px rgba(32,48,80,.05);
}

.mini-activity-card strong,
.mini-activity-card span {
    display: block;
}

.mini-activity-card strong {
    font-size: 1.55rem;
    color: var(--primary);
}

.mini-activity-card span {
    margin-top: 3px;
    color: var(--muted);
    font-size: .85rem;
}

.report-note {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8faff;
    color: var(--muted);
    font-size: .9rem;
}

.report-table small {
    line-height: 1.3;
}


.research-rule-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fafbff;
}

.research-rule-card strong {
    width: 100%;
}

.research-rule-card span {
    color: var(--muted);
    font-size: .9rem;
}

.research-assessment-card,
.research-control-card {
    height: 100%;
    padding: 28px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.9);
    background: var(--surface);
    box-shadow: 0 14px 40px rgba(32,48,80,.07);
}

.research-assessment-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.research-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 900;
}

.research-assessment-card h2,
.research-control-card h2 {
    margin: 4px 0 0;
    letter-spacing: -.03em;
}

.research-assessment-card p,
.research-control-card p {
    color: var(--muted);
}

.assessment-status {
    display: block;
    margin: 16px 0;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 800;
}

.assessment-open {
    background: #eaf8ef;
    color: #198754;
}

.assessment-closed {
    background: #f2f4f7;
    color: #667085;
}

.assessment-done {
    background: #eef2ff;
    color: var(--primary);
}

.research-part-title {
    margin: 16px 0 2px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #172033;
    color: #fff;
    font-weight: 800;
    letter-spacing: -.01em;
}

.research-test-label {
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 800;
}

.research-complete-card {
    max-width: 700px;
    padding: 48px 34px;
    text-align: center;
    border-radius: 28px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: var(--shadow);
}

.research-complete-icon {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    margin: 0 auto 22px;
    border-radius: 26px;
    background: #eaf8ef;
    color: #198754;
    font-size: 2.4rem;
    font-weight: 900;
}

.research-complete-card h1 {
    margin-top: 10px;
    letter-spacing: -.04em;
}

.research-complete-card p {
    max-width: 560px;
    margin: 14px auto 24px;
    color: var(--muted);
}

.research-group-chip {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
}

.research-group-experimental {
    background: #eef2ff;
    color: #315efb;
}

.research-group-control {
    background: #fff8e6;
    color: #9a6500;
}

.research-group-unassigned {
    background: #f2f4f7;
    color: #667085;
}

.research-module-card {
    border-color: #d8e0ff;
}

@media (max-width: 576px) {
    .research-test-body .quiz-question-card {
        padding: 20px;
    }
}


.likert-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.likert-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f6f8fc;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: .82rem;
}

.likert-legend strong {
    color: var(--primary);
}

.engagement-form {
    display: grid;
    gap: 16px;
}

.engagement-item-card {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 18px;
    padding: 26px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: 0 12px 34px rgba(32,48,80,.06);
}

.engagement-item-number {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 900;
}

.engagement-item-main h2 {
    margin-bottom: 18px;
    font-size: 1.08rem;
    line-height: 1.5;
    letter-spacing: -.01em;
}

.likert-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.likert-option {
    cursor: pointer;
}

.likert-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.likert-option > span {
    display: block;
}

.likert-number {
    padding: 9px 10px 4px;
    text-align: center;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    background: #f8faff;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 900;
}

.likert-text {
    min-height: 58px;
    display: grid !important;
    place-items: center;
    padding: 7px 9px 10px;
    text-align: center;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    background: #fff;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.25;
}

.likert-option input:checked ~ .likert-number,
.likert-option input:checked ~ .likert-text {
    border-color: var(--primary);
    background: #eef2ff;
}

.likert-option input:checked ~ .likert-text {
    color: var(--primary);
    font-weight: 700;
}

@media (max-width: 760px) {
    .engagement-item-card {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .likert-options {
        grid-template-columns: 1fr 1fr;
    }

    .likert-number,
    .likert-text {
        border: 1px solid var(--border);
    }

    .likert-number {
        border-radius: 12px 12px 0 0;
    }

    .likert-text {
        border-top: 0;
        border-radius: 0 0 12px 12px;
    }
}

@media (max-width: 420px) {
    .likert-options {
        grid-template-columns: 1fr;
    }
}


/* ===== Phase 9 Responsive Login & Dashboards ===== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

.login-page {
    min-height: 100%;
}

.login-main {
    padding: clamp(16px, 3vw, 40px);
}

.login-stage {
    min-height: calc(100vh - clamp(32px, 6vw, 80px));
    display: grid;
    place-items: center;
}

.login-width {
    width: min(1180px, 100%);
    min-width: 0;
}

.login-shell {
    width: 100%;
    min-width: 0;
}

.brand-panel,
.login-panel {
    min-width: 0;
}

.login-panel {
    padding: clamp(32px, 5vw, 64px);
}

.brand-panel {
    padding: clamp(40px, 5vw, 64px);
}

.brand-panel h1 {
    font-size: clamp(2rem, 4.2vw, 4.4rem);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 78px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    transform: translateY(-50%);
    min-width: 58px;
    min-height: 40px;
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 700;
}

.password-toggle:focus-visible,
.module-card:focus-visible,
.admin-tile-link:focus-visible,
.btn:focus-visible,
.form-control:focus-visible {
    outline: 3px solid rgba(49,94,251,.25);
    outline-offset: 2px;
}

.dashboard-main {
    padding-top: clamp(22px, 4vw, 48px);
    padding-bottom: clamp(32px, 5vw, 64px);
}

.dashboard-navbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: nowrap;
}

.dashboard-brand {
    min-width: 0;
    margin-right: 0;
    white-space: nowrap;
}

.dashboard-user-actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.dashboard-user-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: .9rem;
}

.hero-card > div:first-child {
    min-width: 0;
}

.hero-card h1 {
    overflow-wrap: anywhere;
    font-size: clamp(1.65rem, 3.2vw, 2.5rem);
}

.hero-card p {
    max-width: 70ch;
}

.dashboard-module-grid > [class*="col-"],
.dashboard-stat-grid > [class*="col-"],
.dashboard-activity-grid > [class*="col-"],
.admin-module-grid > [class*="col-"] {
    min-width: 0;
}

.module-card,
.stat-card,
.mini-activity-card,
.admin-tile-link {
    height: 100%;
}

.module-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.module-card p {
    min-height: 0;
    flex: 1 1 auto;
}

.stat-card strong {
    overflow-wrap: anywhere;
}

.admin-tile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 68px;
}

.results-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.results-table-wrap table {
    min-width: 680px;
}

.content-card,
.hero-card {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .login-stage {
        min-height: auto;
        display: block;
    }

    .login-width {
        width: min(760px, 100%);
        margin-inline: auto;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: 0;
    }

    .brand-panel h1 {
        max-width: 720px;
        font-size: clamp(2rem, 7vw, 3.35rem);
    }

    .feature-strip {
        margin-top: 18px;
    }

    .hero-card {
        align-items: flex-start;
    }

    .dashboard-user-name {
        max-width: 160px;
    }
}

@media (max-width: 767.98px) {
    .login-main {
        padding: 0;
    }

    .login-width {
        width: 100%;
    }

    .login-shell {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        background: var(--bg);
    }

    .brand-panel {
        padding: 32px 22px 28px;
        border-radius: 0 0 28px 28px;
    }

    .brand-mark {
        width: 58px;
        height: 58px;
        margin-bottom: 18px;
        border-radius: 18px;
        font-size: 1.35rem;
    }

    .brand-panel h1 {
        margin: 12px 0;
        font-size: clamp(1.8rem, 8.4vw, 2.6rem);
        line-height: 1.08;
    }

    .brand-panel p {
        margin-bottom: 0;
        font-size: .96rem;
    }

    .feature-strip span {
        padding: 7px 10px;
        font-size: .76rem;
    }

    .login-panel {
        padding: 30px 22px 36px;
    }

    .login-panel h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .form-control,
    .form-control-lg {
        min-height: 52px;
        font-size: 16px;
    }

    .login-submit {
        min-height: 52px;
    }

    .demo-box {
        font-size: .82rem;
        overflow-wrap: anywhere;
    }

    .dashboard-navbar-inner {
        min-height: 60px;
        gap: 8px;
    }

    .dashboard-user-name {
        display: none;
    }

    .dashboard-brand {
        font-size: .95rem;
    }

    .dashboard-brand .mini-mark {
        width: 31px;
        height: 31px;
        flex: 0 0 auto;
    }

    .dashboard-logout {
        min-height: 40px;
        padding-inline: 12px;
    }

    .dashboard-main {
        padding-top: 20px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero-card,
    .content-card {
        padding: 22px;
        border-radius: 20px;
    }

    .hero-card {
        flex-direction: column;
        gap: 16px;
    }

    .progress-badge {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 13px 15px;
    }

    .progress-badge span,
    .progress-badge strong {
        display: inline-block;
        margin: 0;
    }

    .progress-badge strong {
        font-size: 1.05rem;
    }

    .module-card {
        padding: 22px;
        border-radius: 19px;
    }

    .module-card h3 {
        margin-top: 14px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card strong {
        font-size: 1.65rem;
    }

    .mini-activity-card {
        padding: 18px;
    }

    .admin-tile-link {
        min-height: 60px;
    }

    .next-step-card .btn,
    .content-card .btn {
        min-height: 44px;
    }
}

@media (max-width: 575.98px) {
    .dashboard-module-grid > [class*="col-"],
    .dashboard-stat-grid > [class*="col-"],
    .dashboard-activity-grid > [class*="col-"],
    .admin-module-grid > [class*="col-"] {
        width: 100%;
    }

    .module-card {
        min-height: 0;
    }

    .module-icon {
        width: 48px;
        height: 48px;
        border-radius: 15px;
    }

    .hero-card h1 {
        font-size: 1.65rem;
    }

    .content-card h2,
    .hero-card h2 {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 374.98px) {
    .brand-panel,
    .login-panel {
        padding-left: 16px;
        padding-right: 16px;
    }

    .brand-panel h1 {
        font-size: 1.72rem;
    }

    .feature-strip {
        gap: 6px;
    }

    .feature-strip span {
        font-size: .72rem;
    }

    .dashboard-main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .dashboard-brand {
        font-size: .86rem;
    }

    .dashboard-logout {
        padding-inline: 9px;
        font-size: .78rem;
    }

    .hero-card,
    .content-card,
    .module-card,
    .stat-card {
        padding: 18px;
    }
}

@media (min-width: 1200px) {
    .dashboard-main {
        max-width: 1320px;
    }
}

@media (min-width: 1440px) {
    .login-width {
        width: min(1260px, 100%);
    }

    .dashboard-main {
        max-width: 1400px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===== Phase 10 Responsive Learning, Research & Admin Pages ===== */

/*
 * Shared responsive shell
 * Covers student learning modules, research instruments, and admin CRUD/report pages.
 */
.responsive-page {
    min-width: 0;
}

.responsive-page .responsive-main,
.responsive-page .responsive-navbar-inner {
    width: 100%;
    min-width: 0;
}

.responsive-page .responsive-main {
    padding-top: clamp(20px, 3.5vw, 48px) !important;
    padding-bottom: clamp(28px, 4.5vw, 64px) !important;
}

.responsive-page .responsive-navbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.responsive-page .responsive-brand {
    min-width: 0;
    max-width: 68%;
    margin-right: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.responsive-page .app-navbar .d-flex {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.responsive-page .app-navbar .btn,
.responsive-page .app-navbar .ai-mode-chip,
.responsive-page .app-navbar .research-test-label {
    flex: 0 0 auto;
}

.responsive-page .row > [class*="col-"],
.responsive-page .content-card > *,
.responsive-page .hero-card > *,
.responsive-page .research-control-card > *,
.responsive-page .research-assessment-card > * {
    min-width: 0;
}

.responsive-page h1,
.responsive-page h2,
.responsive-page h3,
.responsive-page p,
.responsive-page small,
.responsive-page label,
.responsive-page .alert,
.responsive-page .report-note,
.responsive-page .admin-list-item,
.responsive-page .question-bank-content,
.responsive-page .hardware-admin-info {
    overflow-wrap: anywhere;
}

.responsive-page .form-control,
.responsive-page .form-select,
.responsive-page textarea,
.responsive-page input,
.responsive-page select {
    min-width: 0;
    max-width: 100%;
}

.responsive-page textarea {
    resize: vertical;
}

.responsive-page .content-card,
.responsive-page .hero-card,
.responsive-page .lesson-card,
.responsive-page .lesson-reader,
.responsive-page .hardware-activity-card,
.responsive-page .feedback-card,
.responsive-page .quiz-question-card,
.responsive-page .quiz-result-hero,
.responsive-page .quiz-review-item,
.responsive-page .ai-chat-shell,
.responsive-page .research-assessment-card,
.responsive-page .research-control-card,
.responsive-page .engagement-item-card,
.responsive-page .research-complete-card {
    min-width: 0;
    max-width: 100%;
}

.responsive-page form > .d-flex.gap-2 {
    flex-wrap: wrap;
}

.responsive-page .results-table-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
}

.responsive-page .results-table-wrap table {
    margin-bottom: 0;
}

.responsive-page .report-table th,
.responsive-page .report-table td {
    vertical-align: middle;
}

/* Lessons */
.responsive-page .lesson-card {
    min-height: 0;
}

.responsive-page .lesson-card p {
    min-height: 0;
}

.responsive-page .lesson-content {
    overflow-wrap: anywhere;
}

.responsive-page .lesson-content img,
.responsive-page .lesson-content video,
.responsive-page .lesson-content iframe {
    max-width: 100%;
}

.responsive-page .lesson-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.responsive-page .lesson-content pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 14px;
    border-radius: 12px;
    background: #f7f9fc;
}

/* Hardware identification */
.responsive-page .hardware-image-wrap,
.responsive-page .hardware-question {
    min-width: 0;
}

.responsive-page .choice-option,
.responsive-page .choice-option span {
    min-width: 0;
}

.responsive-page .choice-option span {
    overflow-wrap: anywhere;
}

/* Quiz and review */
.responsive-page .quiz-question-main,
.responsive-page .quiz-text,
.responsive-page .quiz-review-item > div:last-child {
    min-width: 0;
}

.responsive-page .quiz-text {
    overflow-wrap: anywhere;
}

.responsive-page .quiz-submit-card .btn {
    flex: 0 0 auto;
}

/* AI Tutor */
.responsive-page .ai-chat-shell {
    width: min(100%, 1080px);
}

.responsive-page .ai-chat-head > div {
    min-width: 0;
}

.responsive-page .ai-chat-head small {
    overflow-wrap: anywhere;
}

.responsive-page .ai-chat-messages {
    height: 520px;
    min-height: 320px;
}

.responsive-page .chat-bubble {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.responsive-page .quick-prompts {
    scrollbar-width: thin;
}

.responsive-page .quick-prompts button {
    min-height: 40px;
}

.responsive-page .ai-chat-form textarea {
    min-height: 52px;
    font-size: 16px;
}

/* Research and engagement */
.responsive-page .research-assessment-head,
.responsive-page .research-control-card > .d-flex:first-child {
    min-width: 0;
}

.responsive-page .research-assessment-head > div:last-child,
.responsive-page .research-control-card > .d-flex:first-child > div:first-child {
    min-width: 0;
}

.responsive-page .research-part-title {
    overflow-wrap: anywhere;
}

.responsive-page .likert-option {
    min-width: 0;
}

.responsive-page .likert-text {
    overflow-wrap: anywhere;
}

/* Admin CRUD lists */
.responsive-page .admin-list-item,
.responsive-page .hardware-admin-item,
.responsive-page .question-bank-item {
    min-width: 0;
}

.responsive-page .hardware-admin-info,
.responsive-page .question-bank-content {
    min-width: 0;
}

.responsive-page .hardware-admin-item > .d-flex,
.responsive-page .question-bank-item > .d-flex,
.responsive-page .admin-list-item > .d-flex {
    flex-wrap: wrap;
}

.responsive-page .config-code-card {
    overflow-wrap: anywhere;
}

.responsive-page .config-code-card code,
.responsive-page .config-code-card pre {
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 991.98px) {
    .responsive-page .responsive-main {
        padding-left: 18px;
        padding-right: 18px;
    }

    .responsive-page .hero-card {
        align-items: flex-start;
    }

    .responsive-page .hardware-activity-card {
        grid-template-columns: 1fr;
    }

    .responsive-page .hardware-image-wrap {
        min-height: 320px;
        padding: 28px;
    }

    .responsive-page .hardware-question {
        padding: 34px;
    }

    .responsive-page .lesson-reader {
        width: 100%;
    }

    .responsive-page .ai-chat-messages {
        height: 500px;
    }

    .responsive-page .research-control-card,
    .responsive-page .research-assessment-card {
        padding: 24px;
    }

    .responsive-page .likert-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .responsive-page .responsive-navbar-inner {
        min-height: 58px;
        gap: 8px;
    }

    .responsive-page .responsive-brand {
        max-width: 60%;
        font-size: .94rem;
    }

    .responsive-page .responsive-brand .mini-mark {
        width: 31px;
        height: 31px;
        flex: 0 0 31px;
    }

    .responsive-page .app-navbar .btn {
        min-height: 40px;
        padding: 7px 11px;
    }

    .responsive-page .app-navbar .d-flex {
        gap: 6px !important;
    }

    .responsive-page .ai-mode-chip {
        font-size: .66rem;
        padding: 6px 8px;
    }

    .responsive-page .research-test-label {
        font-size: .7rem;
        padding: 6px 8px;
    }

    .responsive-page .responsive-main {
        padding-top: 20px !important;
        padding-left: 14px;
        padding-right: 14px;
        padding-bottom: 36px !important;
    }

    .responsive-page .hero-card,
    .responsive-page .content-card {
        padding: 21px;
        border-radius: 20px;
    }

    .responsive-page .hero-card {
        flex-direction: column;
        gap: 15px;
    }

    .responsive-page .hero-card h1,
    .responsive-page .content-card h1 {
        font-size: clamp(1.55rem, 7vw, 2rem);
        line-height: 1.12;
    }

    .responsive-page .progress-badge {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 13px 15px;
        text-align: left;
    }

    .responsive-page .progress-badge span,
    .responsive-page .progress-badge strong {
        display: inline-block;
        margin: 0;
    }

    .responsive-page .progress-badge strong {
        font-size: 1.08rem;
    }

    .responsive-page .hw-stats {
        width: 100%;
    }

    .responsive-page .hw-stats > div {
        flex: 1 1 0;
        min-width: 0;
    }

    .responsive-page .lesson-card {
        padding: 21px;
        border-radius: 19px;
    }

    .responsive-page .lesson-number {
        width: 42px;
        height: 42px;
        margin-bottom: 18px;
        border-radius: 13px;
    }

    .responsive-page .lesson-reader {
        border-radius: 20px;
    }

    .responsive-page .lesson-reader-head,
    .responsive-page .lesson-content {
        padding: 24px 21px;
    }

    .responsive-page .lesson-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .responsive-page .lesson-reader-footer {
        padding: 20px 21px 26px;
        flex-direction: column;
    }

    .responsive-page .lesson-reader-footer > .btn,
    .responsive-page .lesson-reader-footer > .d-flex,
    .responsive-page .lesson-reader-footer > .d-flex .btn,
    .responsive-page .lesson-reader-footer form,
    .responsive-page .lesson-reader-footer form .btn {
        width: 100%;
    }

    .responsive-page .hardware-image-wrap {
        min-height: 250px;
        padding: 20px;
    }

    .responsive-page .hardware-image-wrap img {
        max-height: 280px;
    }

    .responsive-page .hardware-placeholder {
        width: 130px;
        height: 130px;
        font-size: 3.8rem;
        border-radius: 24px;
    }

    .responsive-page .hardware-question {
        padding: 25px 21px 28px;
    }

    .responsive-page .feedback-card {
        grid-template-columns: 1fr;
        padding: 24px 21px;
        gap: 18px;
    }

    .responsive-page .feedback-icon {
        width: 56px;
        height: 56px;
        border-radius: 17px;
    }

    .responsive-page .choice-option span {
        min-height: 48px;
        display: flex;
        align-items: center;
        padding: 13px 15px;
    }

    .responsive-page .quiz-question-card {
        grid-template-columns: 1fr;
        padding: 21px;
        gap: 14px;
    }

    .responsive-page .quiz-question-number,
    .responsive-page .question-bank-number {
        width: 42px;
        height: 42px;
    }

    .responsive-page .quiz-question-main h2 {
        font-size: 1.05rem;
    }

    .responsive-page .quiz-letter {
        width: 44px;
        flex-basis: 44px;
    }

    .responsive-page .quiz-text {
        padding: 13px 14px;
    }

    .responsive-page .quiz-submit-card {
        align-items: stretch;
        flex-direction: column;
    }

    .responsive-page .quiz-submit-card .btn {
        width: 100%;
        min-height: 48px;
    }

    .responsive-page .quiz-result-hero {
        grid-template-columns: 1fr;
        padding: 24px 21px;
        gap: 20px;
    }

    .responsive-page .score-ring {
        width: 112px;
        height: 112px;
    }

    .responsive-page .score-ring strong {
        font-size: 1.8rem;
    }

    .responsive-page .quiz-review-item {
        grid-template-columns: 1fr;
        padding: 21px;
    }

    .responsive-page .ai-chat-shell {
        border-radius: 20px;
    }

    .responsive-page .ai-chat-head {
        align-items: flex-start;
        padding: 15px 14px;
    }

    .responsive-page .ai-chat-head .btn {
        min-height: 40px;
        white-space: nowrap;
    }

    .responsive-page .ai-chat-messages {
        height: 430px;
        padding: 18px 13px;
    }

    .responsive-page .chat-avatar {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }

    .responsive-page .chat-bubble {
        max-width: 88%;
        padding: 11px 13px;
        font-size: .94rem;
    }

    .responsive-page .quick-prompts {
        padding: 10px 13px 0;
    }

    .responsive-page .ai-chat-form {
        grid-template-columns: 1fr;
        padding: 12px 13px;
    }

    .responsive-page .ai-chat-form .btn {
        width: 100%;
        min-height: 46px;
    }

    .responsive-page .ai-chat-note {
        padding: 0 13px 14px;
    }

    .responsive-page .tutor-orb {
        width: 62px;
        height: 62px;
        border-radius: 19px;
        font-size: 1.8rem;
    }

    .responsive-page .research-rule-card {
        padding: 16px;
    }

    .responsive-page .research-assessment-card,
    .responsive-page .research-control-card {
        padding: 21px;
        border-radius: 19px;
    }

    .responsive-page .research-assessment-head {
        align-items: flex-start;
    }

    .responsive-page .research-control-card > .d-flex:first-child {
        flex-wrap: wrap;
    }

    .responsive-page .research-control-card > .d-flex:first-child .assessment-status {
        margin: 0;
    }

    .responsive-page .research-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 15px;
    }

    .responsive-page .research-part-title {
        margin-top: 12px;
        padding: 12px 14px;
    }

    .responsive-page .research-complete-card {
        padding: 38px 21px;
        border-radius: 22px;
    }

    .responsive-page .research-complete-icon {
        width: 72px;
        height: 72px;
        border-radius: 22px;
    }

    .responsive-page .engagement-item-card {
        grid-template-columns: 1fr;
        padding: 21px;
        gap: 14px;
    }

    .responsive-page .likert-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .responsive-page .likert-option {
        min-width: 0;
    }

    .responsive-page .likert-number {
        padding-top: 8px;
    }

    .responsive-page .likert-text {
        min-height: 52px;
    }

    .responsive-page .admin-list-item {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px;
    }

    .responsive-page .hardware-admin-item,
    .responsive-page .question-bank-item {
        grid-template-columns: 56px minmax(0, 1fr);
        align-items: start;
        padding: 13px;
    }

    .responsive-page .hardware-admin-thumb {
        width: 56px;
        height: 56px;
    }

    .responsive-page .hardware-admin-item > .d-flex,
    .responsive-page .question-bank-item > .d-flex {
        grid-column: 1 / -1;
        width: 100%;
    }

    .responsive-page .hardware-admin-item > .d-flex .btn,
    .responsive-page .question-bank-item > .d-flex .btn,
    .responsive-page .hardware-admin-item > .d-flex form,
    .responsive-page .question-bank-item > .d-flex form {
        flex: 1 1 auto;
    }

    .responsive-page form > .d-flex.gap-2 > .btn,
    .responsive-page form > .d-flex.gap-2 > a.btn {
        flex: 1 1 150px;
        min-height: 44px;
    }

    .responsive-page .results-table-wrap {
        margin-inline: -4px;
        width: calc(100% + 8px);
        padding-bottom: 4px;
    }

    .responsive-page .results-table-wrap table {
        min-width: 700px;
        font-size: .88rem;
    }

    .responsive-page .results-table-wrap .form-select,
    .responsive-page .results-table-wrap .btn {
        min-height: 38px;
    }

    .responsive-page .report-note {
        font-size: .84rem;
    }
}

@media (max-width: 575.98px) {
    .responsive-page .responsive-navbar-inner {
        padding-left: 12px;
        padding-right: 12px;
    }

    .responsive-page .responsive-brand {
        max-width: 57%;
        font-size: .88rem;
    }

    .responsive-page .app-navbar .btn {
        font-size: .78rem;
        padding-inline: 9px;
    }

    .responsive-page .responsive-main {
        padding-left: 11px;
        padding-right: 11px;
    }

    .responsive-page .hero-card,
    .responsive-page .content-card,
    .responsive-page .lesson-card,
    .responsive-page .quiz-question-card,
    .responsive-page .quiz-review-item,
    .responsive-page .research-assessment-card,
    .responsive-page .research-control-card,
    .responsive-page .engagement-item-card {
        padding: 18px;
    }

    .responsive-page .hw-stats {
        gap: 8px;
    }

    .responsive-page .hw-stats > div {
        padding: 12px 10px;
    }

    .responsive-page .ai-chat-messages {
        height: 400px;
    }

    .responsive-page .chat-bubble {
        max-width: 91%;
    }

    .responsive-page .likert-legend {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .responsive-page .likert-legend span {
        justify-content: center;
        text-align: center;
    }

    .responsive-page .results-table-wrap table {
        min-width: 660px;
    }
}

@media (max-width: 419.98px) {
    .responsive-page .responsive-brand {
        max-width: 52%;
        font-size: .82rem;
    }

    .responsive-page .responsive-brand .mini-mark {
        width: 29px;
        height: 29px;
        flex-basis: 29px;
        margin-right: 6px;
    }

    .responsive-page .app-navbar .d-flex .ai-mode-chip {
        display: none;
    }

    .responsive-page .hero-card h1,
    .responsive-page .content-card h1 {
        font-size: 1.5rem;
    }

    .responsive-page .likert-options,
    .responsive-page .likert-legend {
        grid-template-columns: 1fr;
    }

    .responsive-page .quiz-letter {
        width: 40px;
        flex-basis: 40px;
    }

    .responsive-page .quiz-text {
        font-size: .92rem;
    }

    .responsive-page .ai-chat-messages {
        height: 370px;
    }

    .responsive-page .ai-chat-head {
        flex-direction: column;
    }

    .responsive-page .ai-chat-head .btn {
        width: 100%;
    }

    .responsive-page .research-assessment-head {
        flex-direction: column;
    }

    .responsive-page .results-table-wrap table {
        min-width: 620px;
    }
}

@media (min-width: 1400px) {
    .responsive-page .responsive-main,
    .responsive-page .responsive-navbar-inner {
        max-width: 1400px;
    }
}

@media (min-width: 1700px) {
    .responsive-page .responsive-main,
    .responsive-page .responsive-navbar-inner {
        max-width: 1500px;
    }
}


/* Phase 12 hardware sequence */
.hardware-activity-progress {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.hardware-activity-progress span {
    color: var(--muted);
    font-size: .9rem;
}

.hardware-progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9edf5;
}

.hardware-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width .25s ease;
}

.hardware-sequence-card .hardware-image-wrap img {
    max-height: 430px;
    width: 100%;
    object-fit: contain;
}

.hardware-sequence-choice span {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hardware-result-note {
    color: var(--muted);
    font-size: .88rem;
}

.hardware-result-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    padding: clamp(24px, 4vw, 42px);
    border-radius: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.hardware-result-score {
    min-width: 180px;
    padding: 20px 24px;
    text-align: center;
    border-radius: 20px;
    background: #f5f7fb;
    border: 1px solid var(--border);
}

.hardware-result-score span,
.hardware-result-score small {
    display: block;
    color: var(--muted);
}

.hardware-result-score strong {
    display: block;
    margin: 4px 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.hardware-review-list {
    display: grid;
    gap: 18px;
}

.hardware-review-card {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 24px;
    padding: 22px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.hardware-review-card.is-correct {
    border-left: 5px solid #198754;
}

.hardware-review-card.is-wrong {
    border-left: 5px solid #dc3545;
}

.hardware-review-image {
    min-height: 180px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
}

.hardware-review-image img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.hardware-review-content {
    min-width: 0;
}

.hardware-review-content h2 {
    margin: 8px 0 16px;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.hardware-answer-status {
    font-weight: 800;
}

.hardware-review-card.is-correct .hardware-answer-status {
    color: #198754;
}

.hardware-review-card.is-wrong .hardware-answer-status {
    color: #dc3545;
}

.hardware-answer-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    margin-bottom: 14px;
}

.hardware-answer-lines p {
    margin: 0;
}

.hardware-answer-lines span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

@media (max-width: 760px) {
    .hardware-result-summary {
        grid-template-columns: 1fr;
    }

    .hardware-result-score {
        width: 100%;
    }

    .hardware-review-card {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .hardware-review-image {
        min-height: 150px;
    }
}


/* Phase 12.1 hardware result polish */
.hardware-review-card {
    grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
}

.hardware-review-image {
    min-height: 120px;
    max-height: 150px;
    padding: 10px;
}

.hardware-review-image img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
}

@media (max-width: 760px) {
    .hardware-review-image {
        min-height: 110px;
        max-height: 140px;
    }

    .hardware-review-image img {
        max-height: 110px;
    }
}


/* =========================================================
   Phase 13 - Public Welcome Page
   ========================================================= */

html {
    scroll-behavior: smooth;
}

.public-page {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 6% 4%, rgba(49,94,251,.13), transparent 28rem),
        radial-gradient(circle at 92% 22%, rgba(91,122,255,.10), transparent 26rem),
        #f7f9fc;
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247,249,252,.88);
    border-bottom: 1px solid rgba(229,233,242,.9);
    backdrop-filter: blur(18px);
}

.public-nav-wrap {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.public-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--text);
    text-decoration: none;
}

.public-brand > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.public-brand strong {
    font-size: .98rem;
    line-height: 1.1;
    letter-spacing: -.02em;
}

.public-brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: .68rem;
    line-height: 1.2;
}

.public-menu {
    display: flex;
    align-items: center;
    gap: 26px;
}

.public-menu > a:not(.btn) {
    color: #4c5870;
    text-decoration: none;
    font-size: .91rem;
    font-weight: 650;
}

.public-menu > a:not(.btn):hover {
    color: var(--primary);
}

.public-nav-cta {
    padding-left: 20px;
    padding-right: 20px;
}

.public-menu-toggle {
    width: 46px;
    height: 46px;
    display: none;
    place-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
}

.public-menu-toggle span {
    width: 21px;
    height: 2px;
    display: block;
    margin: 3px auto;
    border-radius: 99px;
    background: var(--text);
    transition: transform .2s ease, opacity .2s ease;
}

.public-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.public-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.public-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.public-hero {
    padding: clamp(58px, 8vw, 108px) 0 clamp(54px, 7vw, 92px);
}

.public-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, .95fr);
    gap: clamp(44px, 6vw, 86px);
    align-items: center;
}

.public-hero-copy,
.public-hero-visual {
    min-width: 0;
}

.public-kicker {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid #dce3ff;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--primary);
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.public-hero h1 {
    max-width: 780px;
    margin: 22px 0 22px;
    font-size: clamp(2.8rem, 5.7vw, 5.8rem);
    line-height: .98;
    letter-spacing: -.062em;
}

.public-hero h1 span {
    display: block;
    color: var(--primary);
}

.public-hero-lead {
    max-width: 690px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.75;
}

.public-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.public-hero-actions .btn {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 24px;
    padding-right: 24px;
}

.public-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 30px;
}

.public-trust-row span {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    color: var(--muted);
    font-size: .77rem;
    font-weight: 650;
}

.public-hero-visual {
    position: relative;
}

.public-device-card {
    position: relative;
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid rgba(255,255,255,.94);
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.97), rgba(249,251,255,.96));
    box-shadow: 0 30px 80px rgba(40,55,100,.15);
}

.public-device-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(
        145deg,
        rgba(49,94,251,.28),
        rgba(255,255,255,.1),
        rgba(49,94,251,.08)
    );
}

.public-device-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.public-device-top h2 {
    max-width: 340px;
    margin: 5px 0 0;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    letter-spacing: -.035em;
}

.public-live-pill {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #067647;
    font-size: .72rem;
    font-weight: 800;
}

.public-device-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.public-mini-module {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.public-module-index {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #eef2ff;
    color: var(--primary);
    font-size: .75rem;
    font-weight: 900;
}

.public-mini-module div {
    min-width: 0;
}

.public-mini-module strong,
.public-mini-module small {
    display: block;
}

.public-mini-module strong {
    font-size: .9rem;
}

.public-mini-module small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-hardware-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.public-hardware-preview img {
    width: 100%;
    height: 86px;
    padding: 8px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
}

.public-floating-card {
    position: absolute;
    right: -28px;
    bottom: -34px;
    max-width: 230px;
    padding: 14px 17px;
    border: 1px solid rgba(255,255,255,.92);
    border-radius: 17px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 20px 50px rgba(40,55,100,.14);
}

.public-floating-card span,
.public-floating-card strong {
    display: block;
}

.public-floating-card span {
    color: var(--muted);
    font-size: .68rem;
}

.public-floating-card strong {
    margin-top: 4px;
    font-size: .85rem;
}

.public-section {
    padding: clamp(64px, 8vw, 104px) 0;
}

.public-section-heading {
    max-width: 760px;
    margin: 0 auto 42px;
    text-align: center;
}

.public-section-heading-left {
    margin-left: 0;
    text-align: left;
}

.public-section-heading h2,
.public-about-grid h2,
.public-cta-card h2 {
    margin: 10px 0 14px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -.05em;
}

.public-section-heading p,
.public-about-grid p,
.public-cta-card p {
    color: var(--muted);
    line-height: 1.75;
}

.public-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.public-feature-card {
    position: relative;
    min-width: 0;
    padding: 26px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 23px;
    background: rgba(255,255,255,.84);
}

.public-feature-number {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #c8d0e1;
    font-size: .7rem;
    font-weight: 900;
}

.public-feature-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 28px;
    border-radius: 15px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 900;
}

.public-feature-card h3 {
    margin-bottom: 11px;
    font-size: 1.1rem;
    letter-spacing: -.025em;
}

.public-feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: .91rem;
    line-height: 1.7;
}

.public-hardware-section {
    border-top: 1px solid rgba(229,233,242,.7);
    border-bottom: 1px solid rgba(229,233,242,.7);
    background: rgba(255,255,255,.55);
}

.public-hardware-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 13px;
}

.public-hardware-card {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.public-hardware-image {
    height: 125px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 13px;
    background: #fafbfe;
}

.public-hardware-image img {
    width: 100%;
    max-height: 110px;
    padding: 7px;
    object-fit: contain;
}

.public-hardware-card strong {
    display: block;
    overflow: hidden;
    font-size: .83rem;
    text-overflow: ellipsis;
}

.public-steps {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.public-step {
    min-width: 0;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 21px;
    background: rgba(255,255,255,.8);
}

.public-step > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: .8rem;
    font-weight: 900;
}

.public-step h3 {
    margin-bottom: 7px;
    font-size: 1.06rem;
}

.public-step p {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.65;
}

.public-about-section {
    background: #fff;
}

.public-about-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: clamp(38px, 7vw, 90px);
    align-items: center;
}

.public-about-grid p {
    font-size: 1rem;
}

.public-cta-section {
    padding: 72px 0;
}

.public-cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: clamp(28px, 5vw, 54px);
    overflow: hidden;
    border-radius: 30px;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,.2), transparent 18rem),
        linear-gradient(145deg, #1f3473, #315efb);
}

.public-cta-card .eyebrow,
.public-cta-card p {
    color: rgba(255,255,255,.78);
}

.public-cta-card h2 {
    margin-bottom: 8px;
}

.public-cta-card p {
    max-width: 680px;
    margin-bottom: 0;
}

.public-cta-card .btn-light {
    flex: 0 0 auto;
    min-width: 145px;
    color: var(--primary);
    font-weight: 800;
}

.public-footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    background: #fff;
}

.public-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
}

.public-footer p {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
}

.public-footer-brand .mini-mark {
    box-shadow: none;
    border: 1px solid #dfe5f0;
}

.login-home-link {
    position: absolute;
    top: 28px;
    left: 34px;
    color: rgba(255,255,255,.86);
    text-decoration: none;
    font-size: .86rem;
    font-weight: 650;
}

.brand-panel {
    position: relative;
}

.login-access-note {
    padding: 15px 17px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #f8faff;
    color: var(--muted);
    font-size: .87rem;
}

.login-access-note strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.login-mobile-home {
    display: none;
    margin-top: 20px;
    color: var(--primary);
    text-align: center;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
    .public-feature-card,
    .public-hardware-card,
    .public-step {
        transition:
            transform .18s ease,
            box-shadow .18s ease,
            border-color .18s ease;
    }

    .public-feature-card:hover,
    .public-hardware-card:hover,
    .public-step:hover {
        transform: translateY(-4px);
        border-color: #cfd8f5;
        box-shadow: 0 18px 44px rgba(40,55,100,.08);
    }
}

@media (max-width: 1199px) {
    .public-hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
        gap: 45px;
    }

    .public-feature-grid {
        grid-template-columns: 1fr 1fr;
    }

    .public-hardware-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .public-steps {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 860px) {
    .public-nav-wrap {
        min-height: 70px;
        position: relative;
    }

    .public-menu-toggle {
        display: block;
        flex: 0 0 auto;
    }

    .public-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 12px;
        right: 12px;
        display: none;
        align-items: stretch;
        gap: 4px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: rgba(255,255,255,.98);
        box-shadow: 0 20px 50px rgba(40,55,100,.14);
    }

    .public-menu.is-open {
        display: flex;
        flex-direction: column;
    }

    .public-menu > a:not(.btn) {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 8px 12px;
        border-radius: 11px;
    }

    .public-nav-cta {
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 5px;
    }

    .public-hero-grid {
        grid-template-columns: 1fr;
    }

    .public-hero-copy {
        text-align: center;
    }

    .public-hero h1,
    .public-hero-lead {
        margin-left: auto;
        margin-right: auto;
    }

    .public-hero-actions,
    .public-trust-row {
        justify-content: center;
    }

    .public-hero-visual {
        max-width: 650px;
        width: 100%;
        margin: 0 auto;
    }

    .public-floating-card {
        right: 16px;
    }

    .public-about-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .public-brand small {
        display: none;
    }

    .public-hero {
        padding-top: 48px;
    }

    .public-hero h1 {
        font-size: clamp(2.4rem, 13vw, 4rem);
    }

    .public-hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .public-hero-actions .btn {
        width: 100%;
    }

    .public-device-grid {
        grid-template-columns: 1fr;
    }

    .public-hardware-preview {
        grid-template-columns: 1fr 1fr;
    }

    .public-hardware-preview img {
        height: 100px;
    }

    .public-floating-card {
        position: static;
        max-width: none;
        margin-top: 12px;
    }

    .public-feature-grid,
    .public-steps {
        grid-template-columns: 1fr;
    }

    .public-hardware-grid {
        grid-template-columns: 1fr 1fr;
    }

    .public-hardware-image {
        height: 118px;
    }

    .public-section-heading,
    .public-section-heading-left {
        text-align: left;
    }

    .public-cta-card {
        align-items: stretch;
        flex-direction: column;
        gap: 24px;
    }

    .public-cta-card .btn-light {
        width: 100%;
    }

    .public-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .login-home-link {
        display: none;
    }

    .login-mobile-home {
        display: block;
    }
}

@media (max-width: 380px) {
    .public-nav-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }

    .public-brand strong {
        font-size: .9rem;
    }

    .public-hardware-grid {
        grid-template-columns: 1fr;
    }

    .public-hardware-image {
        height: 140px;
    }
}

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

    .public-feature-card,
    .public-hardware-card,
    .public-step,
    .public-menu-toggle span {
        transition: none !important;
    }
}


/* =========================================================
   Phase 13.1 - Eye-Catching Public UI Refresh
   ========================================================= */

:root {
    --public-blue: #2563eb;
    --public-indigo: #4f46e5;
    --public-cyan: #06b6d4;
    --public-ink: #0f172a;
    --public-soft: #64748b;
}

.public-page {
    color: var(--public-ink);
    background:
        radial-gradient(circle at 8% 6%, rgba(37,99,235,.17), transparent 26rem),
        radial-gradient(circle at 92% 18%, rgba(79,70,229,.14), transparent 24rem),
        radial-gradient(circle at 52% 72%, rgba(6,182,212,.07), transparent 34rem),
        linear-gradient(180deg, #f8fbff 0%, #f6f8fd 48%, #fbfcff 100%);
}

.public-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: .42;
    background-image:
        linear-gradient(rgba(37,99,235,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37,99,235,.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 82%);
}

.public-header {
    background: rgba(248,251,255,.80);
    border-color: rgba(203,213,225,.55);
    box-shadow: 0 1px 0 rgba(255,255,255,.9);
}

.public-nav-wrap {
    min-height: 80px;
}

.public-brand .mini-mark {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.75);
    background: linear-gradient(145deg, var(--public-blue), var(--public-indigo));
    box-shadow:
        0 10px 26px rgba(37,99,235,.26),
        inset 0 1px 0 rgba(255,255,255,.30);
}

.public-brand .mini-mark::after {
    content: "";
    position: absolute;
    inset: -30%;
    transform: translateX(-90%) rotate(25deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
    animation: publicLogoShine 4.6s ease-in-out infinite;
}

.public-brand strong {
    font-size: 1.02rem;
    letter-spacing: -.025em;
}

.public-menu > a:not(.btn) {
    position: relative;
    padding: 8px 1px;
}

.public-menu > a:not(.btn)::after {
    content: "";
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: 1px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--public-blue), var(--public-cyan));
    transition: left .18s ease, right .18s ease;
}

.public-menu > a:not(.btn):hover::after {
    left: 0;
    right: 0;
}

.public-nav-cta,
.public-hero-actions .btn-primary {
    border: 0;
    background: linear-gradient(135deg, var(--public-blue), var(--public-indigo));
    box-shadow: 0 12px 30px rgba(37,99,235,.24);
}

.public-nav-cta:hover,
.public-hero-actions .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    box-shadow: 0 16px 38px rgba(37,99,235,.30);
}

.public-hero {
    position: relative;
    isolation: isolate;
    padding-top: clamp(62px, 8.5vw, 116px);
}

.public-hero::before,
.public-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 999px;
    pointer-events: none;
}

.public-hero::before {
    width: 290px;
    height: 290px;
    top: 50px;
    right: 7%;
    background: radial-gradient(circle, rgba(37,99,235,.16), transparent 68%);
}

.public-hero::after {
    width: 210px;
    height: 210px;
    left: 5%;
    bottom: 20px;
    background: radial-gradient(circle, rgba(6,182,212,.11), transparent 70%);
}

.public-kicker {
    gap: 8px;
    border-color: rgba(37,99,235,.18);
    background: linear-gradient(135deg, rgba(239,246,255,.92), rgba(238,242,255,.92));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.public-kicker-dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34,197,94,.11);
    animation: publicPulse 2.2s ease-in-out infinite;
}

.public-hero h1 {
    max-width: 860px;
    text-wrap: balance;
}

.public-hero h1 span {
    color: transparent;
    background: linear-gradient(100deg, var(--public-blue) 0%, var(--public-indigo) 56%, var(--public-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.public-hero-lead {
    color: #526078;
}

.public-signature-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    color: #61708c;
    font-size: .73rem;
    font-weight: 850;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.public-signature-line i {
    width: 28px;
    height: 1px;
    display: inline-block;
    background: linear-gradient(90deg, var(--public-blue), var(--public-cyan));
}

.public-hero-actions .btn {
    border-radius: 14px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.public-hero-actions .btn-outline-primary {
    border-color: rgba(37,99,235,.25);
    background: rgba(255,255,255,.62);
    backdrop-filter: blur(8px);
}

.public-trust-row span {
    border-color: rgba(203,213,225,.75);
    background: rgba(255,255,255,.68);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.public-device-card {
    overflow: hidden;
    border-color: rgba(255,255,255,.95);
    background:
        radial-gradient(circle at 88% 8%, rgba(37,99,235,.11), transparent 13rem),
        linear-gradient(160deg, rgba(255,255,255,.98), rgba(245,248,255,.96));
    box-shadow:
        0 35px 90px rgba(24,39,75,.17),
        0 3px 0 rgba(255,255,255,.95) inset;
}

.public-device-card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    top: -110px;
    left: -80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6,182,212,.18), transparent 68%);
}

.public-live-pill {
    border: 1px solid rgba(22,163,74,.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.public-mini-module {
    position: relative;
    overflow: hidden;
    border-color: rgba(226,232,240,.95);
    background: rgba(255,255,255,.88);
}

.public-mini-module::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    opacity: .7;
    background: linear-gradient(90deg, var(--public-blue), transparent);
}

.public-module-index {
    background: linear-gradient(145deg, #eff6ff, #eef2ff);
    box-shadow: inset 0 0 0 1px rgba(37,99,235,.08);
}

.public-hardware-preview img {
    filter: saturate(1.04) contrast(1.02);
    box-shadow: 0 5px 16px rgba(15,23,42,.055);
}

.public-floating-card {
    border-color: rgba(255,255,255,.96);
    background: rgba(255,255,255,.89);
    backdrop-filter: blur(14px);
    box-shadow: 0 22px 55px rgba(24,39,75,.16);
}

.public-floating-card::before {
    content: "";
    position: absolute;
    top: 14px;
    left: -4px;
    width: 4px;
    height: calc(100% - 28px);
    border-radius: 999px;
    background: linear-gradient(var(--public-blue), var(--public-cyan));
}

.public-stats-band {
    position: relative;
    z-index: 3;
    margin-top: -6px;
    padding: 0 0 24px;
}

.public-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(203,213,225,.72);
    border-radius: 24px;
    background: rgba(255,255,255,.74);
    box-shadow: 0 20px 60px rgba(24,39,75,.09);
    backdrop-filter: blur(15px);
}

.public-stat {
    position: relative;
    min-width: 0;
    padding: 24px 20px;
    text-align: center;
}

.public-stat + .public-stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 1px;
    background: rgba(203,213,225,.75);
}

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

.public-stat strong {
    color: transparent;
    background: linear-gradient(135deg, var(--public-blue), var(--public-indigo));
    -webkit-background-clip: text;
    background-clip: text;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1;
    letter-spacing: -.04em;
}

.public-stat span {
    margin-top: 7px;
    color: #64748b;
    font-size: .76rem;
    font-weight: 700;
}

.public-feature-card {
    isolation: isolate;
    border-color: rgba(203,213,225,.68);
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(250,252,255,.86));
    box-shadow: 0 12px 35px rgba(15,23,42,.045);
}

.public-feature-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--public-blue), var(--public-indigo), var(--public-cyan));
    opacity: .88;
}

.public-feature-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 100px;
    height: 100px;
    right: -42px;
    bottom: -46px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,.09), transparent 68%);
}

.public-feature-tag {
    display: inline-block;
    margin: -5px 0 8px;
    color: var(--public-blue);
    font-size: .61rem;
    font-weight: 900;
    letter-spacing: .14em;
}

.public-hardware-section {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 90% 15%, rgba(37,99,235,.08), transparent 22rem),
        linear-gradient(180deg, rgba(255,255,255,.72), rgba(248,250,255,.90));
}

.public-hardware-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(203,213,225,.72);
    box-shadow: 0 10px 30px rgba(15,23,42,.045);
}

.public-hardware-card::after {
    content: "";
    position: absolute;
    inset: auto 16px 0;
    height: 2px;
    border-radius: 99px 99px 0 0;
    background: linear-gradient(90deg, var(--public-blue), var(--public-cyan));
    opacity: .65;
}

.public-hardware-image {
    border: 1px solid rgba(226,232,240,.9);
    background: radial-gradient(circle at center, #fff, #f7f9fd);
}

.public-hardware-image img {
    transition: transform .22s ease;
}

.public-hardware-type {
    display: block;
    margin: 1px 0 3px;
    color: var(--public-blue);
    font-size: .56rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.public-steps {
    position: relative;
}

.public-steps::before {
    content: "";
    position: absolute;
    top: 44px;
    left: 10%;
    right: 10%;
    height: 2px;
    z-index: 0;
    background: linear-gradient(90deg, rgba(37,99,235,.12), rgba(37,99,235,.55), rgba(6,182,212,.30));
}

.public-step {
    position: relative;
    z-index: 1;
    border-color: rgba(203,213,225,.70);
    background: rgba(255,255,255,.86);
    box-shadow: 0 10px 30px rgba(15,23,42,.045);
}

.public-step > span {
    border: 5px solid #fff;
    background: linear-gradient(145deg, var(--public-blue), var(--public-indigo));
    box-shadow: 0 8px 20px rgba(37,99,235,.21);
}

.public-about-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(105deg, #ffffff 0%, #f8fbff 65%, #eff6ff 100%);
}

.public-about-section::after {
    content: "AI";
    position: absolute;
    right: 5%;
    bottom: -56px;
    color: rgba(37,99,235,.035);
    font-size: clamp(11rem, 25vw, 23rem);
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

.public-cta-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 85% 10%, rgba(255,255,255,.20), transparent 15rem),
        radial-gradient(circle at 12% 100%, rgba(6,182,212,.25), transparent 18rem),
        linear-gradient(130deg, #172554 0%, #1d4ed8 48%, #4f46e5 100%);
    box-shadow: 0 32px 80px rgba(37,99,235,.22);
}

.public-cta-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .16;
    background-image: radial-gradient(circle, #fff 1px, transparent 1.4px);
    background-size: 24px 24px;
}

.public-cta-card .btn-light {
    border: 0;
    box-shadow: 0 12px 34px rgba(15,23,42,.18);
}

.public-footer {
    border-top: 1px solid rgba(203,213,225,.7);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.public-footer-top {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 18px 0;
}

.public-footer-branding {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px 12px;
}

.public-trademark {
    display: inline-flex;
    min-height: 33px;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid rgba(37,99,235,.14);
    border-radius: 999px;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    color: var(--public-blue);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .10em;
}

.public-powered {
    color: #64748b;
    font-size: .76rem;
    font-weight: 700;
}

.public-powered strong {
    color: #0f172a;
    letter-spacing: .08em;
}

.public-footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0 24px;
    border-top: 1px solid rgba(226,232,240,.85);
}

.public-footer-bottom p {
    margin: 0;
    color: #7b879b;
    font-size: .72rem;
}

.signin-powered-brand {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.18);
}

.signin-powered-brand strong,
.signin-powered-brand span {
    display: block;
}

.signin-powered-brand strong {
    color: #fff;
    font-size: .72rem;
    letter-spacing: .10em;
}

.signin-powered-brand span {
    margin-top: 3px;
    color: rgba(255,255,255,.65);
    font-size: .69rem;
    font-weight: 650;
    letter-spacing: .06em;
}

@media (hover: hover) and (pointer: fine) {
    .public-hardware-card:hover .public-hardware-image img {
        transform: scale(1.075);
    }

    .public-feature-card:hover {
        box-shadow: 0 24px 55px rgba(37,99,235,.10);
    }

    .public-step:hover {
        box-shadow: 0 20px 50px rgba(15,23,42,.08);
    }
}

@media (max-width: 860px) {
    .public-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .public-stat:nth-child(3)::before {
        display: none;
    }

    .public-stat:nth-child(n+3) {
        border-top: 1px solid rgba(203,213,225,.72);
    }

    .public-steps::before {
        display: none;
    }

    .public-footer-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-footer-branding {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .public-signature-line {
        justify-content: center;
        font-size: .64rem;
    }

    .public-stats-grid {
        grid-template-columns: 1fr;
    }

    .public-stat + .public-stat::before {
        top: 0;
        left: 18%;
        right: 18%;
        bottom: auto;
        width: auto;
        height: 1px;
    }

    .public-stat:nth-child(3)::before {
        display: block;
    }

    .public-stat:nth-child(n+3) {
        border-top: 0;
    }

    .public-footer-bottom {
        flex-direction: column;
        gap: 6px;
    }
}

@keyframes publicPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(.78); opacity: .72; }
}

@keyframes publicLogoShine {
    0%, 68%, 100% { transform: translateX(-110%) rotate(25deg); }
    82% { transform: translateX(110%) rotate(25deg); }
}

@media (prefers-reduced-motion: reduce) {
    .public-kicker-dot,
    .public-brand .mini-mark::after {
        animation: none !important;
    }

    .public-hardware-image img {
        transition: none !important;
    }
}


/* =========================================================
   Phase 13.2 - Thesis-Grounded Public Welcome Page
   ========================================================= */

.paper-public-page {
    --paper-blue: #0f5f9b;
    --paper-cyan: #1b9ac6;
    --paper-green: #27853a;
    --paper-purple: #8a3b8f;
    --paper-yellow: #d6a314;
    --paper-ink: #10213a;
    --paper-muted: #63728a;
}

.paper-hero .public-kicker {
    color: #0e5d93;
    background: linear-gradient(135deg, rgba(231,247,253,.96), rgba(237,245,255,.95));
    border-color: rgba(15,95,155,.18);
}

.paper-hero-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.paper-hero-subjects span {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid rgba(100,116,139,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    color: #53637b;
    font-size: .72rem;
    font-weight: 750;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.92);
}

.paper-framework-card {
    position: relative;
    padding: clamp(20px, 3vw, 30px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.94);
    border-radius: 30px;
    background:
        radial-gradient(circle at 90% 6%, rgba(27,154,198,.12), transparent 13rem),
        linear-gradient(165deg, rgba(255,255,255,.98), rgba(246,250,255,.97));
    box-shadow: 0 34px 86px rgba(25,47,78,.16);
}

.paper-framework-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--paper-green),
        var(--paper-blue),
        var(--paper-purple),
        var(--paper-yellow)
    );
}

.paper-framework-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.paper-framework-head h2 {
    max-width: 390px;
    margin: 5px 0 0;
    font-size: clamp(1.18rem, 2.1vw, 1.55rem);
    line-height: 1.18;
    letter-spacing: -.035em;
}

.paper-research-badge {
    min-width: 54px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 6px 9px;
    border: 1px solid rgba(15,95,155,.13);
    border-radius: 999px;
    background: #eaf6fd;
    color: var(--paper-blue);
    font-size: .72rem;
    font-weight: 900;
}

.paper-framework-flow {
    display: grid;
    gap: 10px;
}

.paper-framework-layer {
    padding: 15px 17px;
    border: 1px solid rgba(148,163,184,.22);
    border-radius: 17px;
    text-align: center;
}

.paper-layer-udl {
    background: linear-gradient(135deg, rgba(224,245,228,.96), rgba(239,250,241,.96));
}

.paper-layer-outcome {
    background: linear-gradient(135deg, rgba(255,248,204,.96), rgba(252,243,255,.96));
}

.paper-flow-label {
    display: block;
    margin-bottom: 3px;
    color: #67768c;
    font-size: .58rem;
    font-weight: 900;
    letter-spacing: .13em;
}

.paper-framework-layer strong {
    font-size: .85rem;
}

.paper-flow-arrow {
    color: var(--paper-blue);
    text-align: center;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1;
}

.paper-framework-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.paper-framework-features > div {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid rgba(148,163,184,.20);
    border-radius: 14px;
    background: #fff;
}

.paper-framework-features span {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #e8f5fb;
    color: var(--paper-blue);
    font-size: .68rem;
    font-weight: 900;
}

.paper-framework-features strong {
    min-width: 0;
    font-size: .72rem;
    line-height: 1.25;
}

.paper-preview-images {
    margin-top: 14px;
}

.paper-research-band {
    margin-top: 0;
}

.paper-research-band .public-stat strong {
    background: linear-gradient(135deg, #0f5f9b, #1b9ac6);
    -webkit-background-clip: text;
    background-clip: text;
}

.paper-research-section {
    position: relative;
}

.paper-research-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.paper-research-card {
    min-width: 0;
    padding: 26px;
    border: 1px solid rgba(203,213,225,.72);
    border-radius: 22px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 12px 32px rgba(15,23,42,.045);
}

.paper-card-kicker {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--paper-blue);
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.paper-research-card h3,
.paper-outcome-main h3,
.paper-outcome-secondary h3 {
    margin-bottom: 10px;
    font-size: 1.18rem;
    letter-spacing: -.028em;
}

.paper-research-card p,
.paper-outcome-secondary p {
    margin: 0;
    color: var(--paper-muted);
    font-size: .9rem;
    line-height: 1.72;
}

.paper-study-note {
    max-width: 980px;
    margin: 22px auto 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid rgba(15,95,155,.16);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(239,248,255,.92), rgba(248,251,255,.92));
}

.paper-study-note-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--paper-blue);
    color: #fff;
    font-weight: 900;
}

.paper-study-note strong {
    display: block;
    margin-bottom: 4px;
}

.paper-study-note p {
    margin: 0;
    color: var(--paper-muted);
    font-size: .86rem;
    line-height: 1.65;
}

.paper-feature-grid .public-feature-card:nth-child(1)::before {
    background: linear-gradient(90deg, #0f5f9b, #1b9ac6);
}

.paper-feature-grid .public-feature-card:nth-child(2)::before {
    background: linear-gradient(90deg, #27853a, #55a768);
}

.paper-feature-grid .public-feature-card:nth-child(3)::before {
    background: linear-gradient(90deg, #9a6a0a, #d6a314);
}

.paper-feature-grid .public-feature-card:nth-child(4)::before {
    background: linear-gradient(90deg, #783a84, #a55aad);
}

.paper-udl-section {
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(203,213,225,.58);
    border-bottom: 1px solid rgba(203,213,225,.58);
    background:
        radial-gradient(circle at 8% 12%, rgba(39,133,58,.08), transparent 21rem),
        radial-gradient(circle at 92% 78%, rgba(15,95,155,.08), transparent 22rem),
        #fbfdff;
}

.paper-udl-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.paper-udl-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid rgba(203,213,225,.72);
    border-radius: 21px;
    background: rgba(255,255,255,.90);
    box-shadow: 0 12px 32px rgba(15,23,42,.042);
}

.paper-udl-card > span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 12px;
    background: linear-gradient(145deg, #eaf8ed, #eef7ff);
    color: var(--paper-green);
    font-size: .73rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(39,133,58,.08);
}

.paper-udl-card h3 {
    min-height: 52px;
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.35;
    letter-spacing: -.018em;
}

.paper-udl-card p {
    margin: 0;
    color: var(--paper-muted);
    font-size: .84rem;
    line-height: 1.68;
}

.paper-hardware-disclaimer {
    max-width: 900px;
    margin: 18px 0 0;
    color: #7a8799;
    font-size: .76rem;
    line-height: 1.55;
}

.paper-outcomes-section {
    position: relative;
}

.paper-outcomes-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr);
    gap: 18px;
}

.paper-outcome-main,
.paper-outcome-secondary {
    min-width: 0;
    padding: clamp(24px, 4vw, 34px);
    border: 1px solid rgba(203,213,225,.70);
    border-radius: 24px;
    background: rgba(255,255,255,.90);
    box-shadow: 0 14px 38px rgba(15,23,42,.05);
}

.paper-engagement-dimensions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.paper-engagement-dimensions > div {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(203,213,225,.62);
    border-radius: 16px;
    background: #f9fbff;
}

.paper-engagement-dimensions span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    margin-bottom: 13px;
    border-radius: 10px;
    background: #eaf3fb;
    color: var(--paper-blue);
    font-size: .75rem;
    font-weight: 900;
}

.paper-engagement-dimensions strong,
.paper-engagement-dimensions small {
    display: block;
}

.paper-engagement-dimensions strong {
    font-size: .88rem;
}

.paper-engagement-dimensions small {
    margin-top: 5px;
    color: var(--paper-muted);
    font-size: .72rem;
    line-height: 1.45;
}

.paper-assessment-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 22px;
}

.paper-assessment-flow span {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 8px 11px;
    border: 1px solid rgba(15,95,155,.15);
    border-radius: 999px;
    background: #f1f8fd;
    color: var(--paper-blue);
    font-size: .72rem;
    font-weight: 850;
}

.paper-assessment-flow i {
    color: #94a3b8;
    font-style: normal;
}

.paper-academic-chip {
    display: inline-flex;
    flex-direction: column;
    margin-top: 18px;
    padding: 12px 14px;
    border-left: 3px solid var(--paper-blue);
    background: rgba(240,248,255,.74);
}

.paper-academic-chip span {
    color: var(--paper-blue);
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .10em;
}

.paper-academic-chip strong {
    margin-top: 2px;
    font-size: .86rem;
}

.paper-researchers {
    display: grid;
    gap: 4px;
    margin: 20px 0;
    padding: 18px;
    border: 1px solid rgba(203,213,225,.66);
    border-radius: 17px;
    background: rgba(255,255,255,.68);
}

.paper-researchers > span {
    margin-bottom: 4px;
    color: var(--paper-blue);
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.paper-researchers strong {
    font-size: .84rem;
}

.paper-public-safety-note {
    padding-left: 14px;
    border-left: 3px solid rgba(15,95,155,.28);
    font-size: .83rem !important;
}

.paper-footer .public-trademark {
    color: var(--paper-blue);
    background: linear-gradient(135deg, #eaf6fd, #eef4ff);
}

@media (hover: hover) and (pointer: fine) {
    .paper-research-card,
    .paper-udl-card,
    .paper-outcome-main,
    .paper-outcome-secondary {
        transition:
            transform .18s ease,
            box-shadow .18s ease,
            border-color .18s ease;
    }

    .paper-research-card:hover,
    .paper-udl-card:hover,
    .paper-outcome-main:hover,
    .paper-outcome-secondary:hover {
        transform: translateY(-3px);
        border-color: rgba(15,95,155,.20);
        box-shadow: 0 22px 50px rgba(15,95,155,.08);
    }
}

@media (max-width: 1199px) {
    .paper-udl-grid {
        grid-template-columns: 1fr 1fr;
    }

    .paper-research-grid {
        grid-template-columns: 1fr 1fr;
    }

    .paper-research-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .paper-outcomes-grid {
        grid-template-columns: 1fr;
    }

    .paper-framework-card {
        max-width: 690px;
        margin: 0 auto;
    }

    .paper-hero-subjects {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .paper-framework-features {
        grid-template-columns: 1fr;
    }

    .paper-research-grid,
    .paper-udl-grid,
    .paper-engagement-dimensions {
        grid-template-columns: 1fr;
    }

    .paper-research-card:last-child {
        grid-column: auto;
    }

    .paper-study-note {
        align-items: flex-start;
    }

    .paper-udl-card h3 {
        min-height: 0;
    }

    .paper-assessment-flow {
        align-items: stretch;
        flex-direction: column;
    }

    .paper-assessment-flow span {
        justify-content: center;
    }

    .paper-assessment-flow i {
        text-align: center;
        transform: rotate(90deg);
    }
}
