@charset "UTF-8";

@font-face {
    font-family: 'UTM Avo';
    src: url('../fonts/utm_avo/UTMAvo.woff2') format('woff2'), url('../fonts/utm_avo/UTMAvo.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'UTM Avo';
    src: url('../fonts/utm_avo/UTMAvoBold.woff2') format('woff2'), url('../fonts/utm_avo/UTMAvoBold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

:root {
    --fmit-red: #960000;
    --fmit-red-dark: #7a0000;
    --fmit-red-soft: #f9f5f5;
    --fmit-red-tint: #fdf8f8;
    --fmit-red-line: #e8d4d4;
    --fmit-text: #2d2d2d;
    --fmit-heading: #1a365d;
    --fmit-muted: #64748b;
    --fmit-border: #e5e7eb;
    --fmit-green: #2e7d32;
    --fmit-blue: #1a365d;
    --fmit-warning: #b8860b;
    --fmit-bg: #f3f4f6;
    --fmit-card-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --fmit-radius: 12px;
    --nexus-header-h: 64px;
    --nexus-bottom-nav-h: 58px;
    --nexus-safe-bottom: env(safe-area-inset-bottom, 0px);
    --nexus-safe-top: env(safe-area-inset-top, 0px);
    --nexus-ios-viewport-gap: 0px;
    --nexus-bottom-nav-total: calc(var(--nexus-bottom-nav-h) + var(--nexus-safe-bottom) + var(--nexus-ios-viewport-gap, 0px));
    --nexus-ease-out: cubic-bezier(.22, 1, .36, 1);
    --nexus-duration-fast: .2s;
    --nexus-duration-med: .32s;
    --nexus-duration-slow: .45s;
}

body.nexus-app {
    font-family: 'UTM Avo', Arial, sans-serif;
    background: var(--fmit-bg);
    color: var(--fmit-text);
    padding-bottom: 0;
}
body.nexus-app.has-bottom-nav {
    padding-bottom: 0;
}

a { color: var(--fmit-red); }
a:hover, a:focus { color: var(--fmit-red-dark); }

/* ── Top bar ── */
.nexus-topbar {
    background: #fff;
    border-bottom: 1px solid var(--fmit-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nexus-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--nexus-header-h);
    gap: 12px;
}
.nexus-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    flex-shrink: 0;
}
.nexus-brand img:not(.nexus-brand-logo--desktop) {
    height: 40px;
    width: auto;
    max-width: 140px;
}
.nexus-brand-logo--desktop {
    height: 48px;
    width: 48px;
    max-width: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(150, 0, 0, .15);
}
.nexus-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.nexus-brand-text strong {
    color: var(--fmit-red);
    font-size: 15px;
    letter-spacing: .02em;
}
.nexus-brand-text small {
    color: var(--fmit-muted);
    font-size: 11px;
    font-weight: normal;
}
.nexus-nav-main {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nexus-nav-main a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--fmit-text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.nexus-nav-main a:hover,
.nexus-nav-main a.is-active {
    background: var(--fmit-red-soft);
    color: var(--fmit-red-dark);
}
.nexus-nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.nexus-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--fmit-red);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nexus-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--fmit-border);
    border-radius: 999px;
    padding: 4px 12px 4px 4px;
    cursor: pointer;
    max-width: 200px;
}
.nexus-user-toggle span.name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--fmit-text);
}
.nexus-user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--fmit-border);
    border-radius: var(--fmit-radius);
    box-shadow: var(--fmit-card-shadow);
    padding: 6px 0;
    z-index: 1100;
}
.nexus-user-menu.is-open { display: block; }
.nexus-user-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--fmit-text);
    text-decoration: none;
    font-size: 14px;
}
.nexus-user-menu a:hover { background: var(--fmit-red-soft); color: var(--fmit-red); }
.nexus-user-menu hr { margin: 6px 0; border-color: #eee; }
.nexus-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--fmit-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--fmit-red);
}

/* Welcome strip */
.nexus-welcome {
    background: #fff;
    border-bottom: 1px solid var(--fmit-border);
    padding: 10px 0;
    margin-bottom: 20px;
}
.nexus-welcome-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
}
.nexus-welcome-inner strong { color: var(--fmit-heading); }
.nexus-welcome-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nexus-pill {
    background: #fff;
    border: 1px solid var(--fmit-border);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--fmit-muted);
}
.nexus-pill strong { color: var(--fmit-text); }
.nexus-welcome--compact {
    padding: 6px 0;
    margin-bottom: 12px;
}
.nexus-welcome-inner--compact {
    justify-content: center;
    gap: 6px;
}
.nexus-pathway-card--archived {
    opacity: .88;
    border: 1px dashed var(--fmit-border);
}
.nexus-bottom-nav-continue.is-active .ico { color: var(--fmit-red); }

/* ── Cards & layout ── */
.nexus-main { padding-top: 4px; }
.nexus-card {
    background: #fff;
    border-radius: var(--fmit-radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--fmit-border);
    box-shadow: var(--fmit-card-shadow);
}
.nexus-card h2, .nexus-card h3, .nexus-card h4 {
    margin-top: 0;
    color: var(--fmit-heading);
    font-weight: bold;
}
.nexus-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.nexus-card-head h2, .nexus-card-head h3 { margin: 0; color: var(--fmit-heading); }
.nexus-card-head-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.nexus-exam-format-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.nexus-format-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    border: 1px solid var(--fmit-border);
    background: #f8fafc;
    color: var(--fmit-muted);
}
.nexus-format-pill--pro { border-color: #f0d9a8; background: #fffbf0; color: #8a6d1a; }
.nexus-format-pill--expert { border-color: #c5d9f5; background: #f0f6ff; color: var(--fmit-blue); }
.nexus-format-pill--mastery { border-color: #e8d4d4; background: var(--fmit-red-tint); color: var(--fmit-red-dark); }

.nexus-profile-mastery-teaser {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--fmit-red-tint);
    border: 1px solid var(--fmit-red-line);
}

/* Profile page — form sections */
.nexus-profile-form .nexus-profile-section {
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--fmit-border);
}
.nexus-profile-form .nexus-profile-section:last-of-type {
    border-bottom: none;
    padding-bottom: 4px;
    margin-bottom: 12px;
}
.nexus-profile-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--fmit-heading);
    margin: 0 0 14px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.nexus-profile-section--account {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px 4px;
    margin-bottom: 22px;
}
.nexus-profile-section--account .nexus-profile-section-title {
    margin-bottom: 6px;
}
.nexus-profile-sca-tier__card {
    padding: 14px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: #fafafa;
    max-width: 520px;
}
.nexus-profile-sca-tier__plan { margin: 0 0 6px; font-size: 15px; }
.nexus-profile-sca-tier__meta { margin: 0 0 6px; font-size: 13px; color: #444; }
.nexus-profile-sca-tier__org { margin: 0 0 8px; font-size: 13px; }
.nexus-profile-sca-tier__links { margin: 0; font-size: 13px; }
.nexus-profile-sca-tier__links a { color: #8b2942; }
.nexus-profile-sca-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
    font-size: 13px;
    line-height: 1.45;
}
.nexus-profile-sca-strip--card { max-width: 100%; }
.nexus-profile-sca-tier { margin-bottom: 0; }
.nexus-profile-sca-tier .nexus-profile-section-title { margin-bottom: 10px; }
.nexus-profile-sca-strip__kicker {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #8b2942;
}
.nexus-profile-sca-strip__name { color: #1a1a1a; }
.nexus-profile-sca-strip__meta { color: #555; flex: 1 1 auto; min-width: 0; }
.nexus-profile-sca-strip__actions { white-space: nowrap; flex-shrink: 0; }
.nexus-profile-sca-strip__actions a {
    color: #8b2942;
    font-weight: 600;
    margin-left: 10px;
}
.nexus-profile-sca-strip__actions a:first-child { margin-left: 0; }
@media (max-width: 640px) {
    .nexus-profile-sca-strip { flex-direction: column; align-items: flex-start; gap: 6px; }
    .nexus-profile-sca-strip__meta { flex: 0 0 auto; width: 100%; }
    .nexus-profile-sca-strip__actions { white-space: normal; margin-top: 2px; }
}
.nexus-profile-section--plain {
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--fmit-border);
}
.nexus-profile-email-hint {
    font-size: 12px;
    color: var(--fmit-muted);
    margin: 0 0 12px;
    line-height: 1.45;
}
.nexus-profile-form .form-group {
    margin-bottom: 14px;
}
.nexus-profile-form .form-group .help-block {
    margin-top: 6px;
    margin-bottom: 0;
}

.nexus-profile-form .form-group.has-error .help-block {
    color: #c62828;
}

.nexus-profile-error-list {
    margin: 8px 0 0;
    padding-left: 18px;
}
.nexus-profile-engagement-prefs {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
}
.nexus-profile-email-prefs {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.nexus-profile-email-prefs-note {
    font-size: 12px;
    margin: 10px 0 0;
    line-height: 1.5;
}
.nexus-profile-streak-card {
    margin: 20px 0 8px;
    padding: 14px 16px;
    border: 1px solid var(--fmit-border);
    border-radius: 8px;
    background: #fff;
}
.nexus-profile-streak-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.nexus-profile-streak-head .nexus-profile-section-title {
    margin: 0;
}
.nexus-profile-streak-link {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.nexus-profile-streak-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}
.nexus-profile-streak-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.nexus-profile-streak-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--fmit-red);
    line-height: 1;
}
.nexus-profile-streak-label {
    font-size: 14px;
    color: var(--fmit-heading);
    font-weight: 600;
}
.nexus-profile-streak-note {
    font-size: 12px;
    margin: 0;
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
}
.nexus-profile-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    margin: 0;
    line-height: 1.45;
}
.nexus-profile-check input {
    margin-top: 3px;
    flex-shrink: 0;
}
.nexus-profile-engagement-note {
    font-size: 12px;
    margin: 10px 0 0;
    line-height: 1.5;
}
.nexus-profile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding-top: 4px;
}
.nexus-profile-head-email {
    font-size: 13px;
    color: var(--fmit-muted);
    word-break: break-all;
}
.nexus-profile-secondary {
    margin-top: 28px;
    padding-top: 4px;
    border-top: 2px solid var(--fmit-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.nexus-profile-secondary > .nexus-profile-section {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.nexus-profile-payments-note {
    font-size: 12px;
    margin: 10px 0 0;
    line-height: 1.45;
}
.nexus-profile-details {
    border: 1px solid var(--fmit-border);
    border-radius: 8px;
    background: #fafbfc;
    overflow: hidden;
}
.nexus-profile-details > summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--fmit-heading);
    list-style: none;
    user-select: none;
}
.nexus-profile-details > summary::-webkit-details-marker {
    display: none;
}
.nexus-profile-details > summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    color: var(--fmit-muted);
    transition: transform 0.15s ease;
}
.nexus-profile-details[open] > summary::before {
    transform: rotate(90deg);
}
.nexus-profile-details[open] > summary {
    border-bottom: 1px solid var(--fmit-border);
    background: #fff;
}
.nexus-profile-details-body {
    padding: 14px 16px;
}
.nexus-profile-details-body.nexus-profile-mastery-teaser {
    border: none;
    border-radius: 0;
    background: transparent;
}
.nexus-profile-details-body.nexus-pwa-profile-card {
    padding: 14px 16px;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.nexus-breadcrumb {
    background: none;
    padding: 0 0 12px;
    margin: 0;
    font-size: 13px;
}
.nexus-breadcrumb a { color: var(--fmit-muted); }
.nexus-breadcrumb .active { color: var(--fmit-text); }

/* Progress */
.nexus-progress {
    height: 10px;
    background: #edf1f5;
    border-radius: 999px;
    overflow: hidden;
}
.nexus-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--fmit-green), #43a047);
    border-radius: 999px;
    transition: width .35s ease;
}
.nexus-progress-lg { height: 14px; }
.nexus-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--fmit-muted);
}
.nexus-progress-label strong { color: var(--fmit-text); }

/* Badges */
.nexus-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.nexus-badge-muted { background: #eee; color: #555; }
.nexus-badge-success { background: #e8f5e9; color: var(--fmit-green); }
.nexus-badge-warning { background: #fff8e1; color: #b8860b; }
.nexus-badge-expert { background: var(--fmit-red-soft); color: var(--fmit-red); }

/* Buttons */
.btn-primary {
    background: var(--fmit-red);
    border-color: var(--fmit-red);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--fmit-red-dark);
    border-color: var(--fmit-red-dark);
}
.btn-outline-fmit {
    color: var(--fmit-red);
    border-color: var(--fmit-red);
    background: #fff;
}
.btn-outline-fmit:hover {
    background: var(--fmit-red-soft);
    color: var(--fmit-red-dark);
}

/* Hero continue — nền sáng, đỏ làm accent (dễ đọc, học thuật) */
.nexus-hero {
    background: linear-gradient(165deg, #ffffff 0%, var(--fmit-red-tint) 55%, var(--fmit-red-soft) 100%);
    color: var(--fmit-text);
    border: 1px solid var(--fmit-border);
    border-left: 4px solid var(--fmit-red);
    position: relative;
    overflow: hidden;
    box-shadow: var(--fmit-card-shadow);
}
.nexus-hero::after {
    content: '';
    position: absolute;
    right: -24px;
    top: -24px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(150, 0, 0, .06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.nexus-hero .row { position: relative; z-index: 1; }
.nexus-hero h2 {
    color: var(--fmit-heading);
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 6px;
}
.nexus-hero h3 { color: var(--fmit-heading); }
.nexus-hero p { color: var(--fmit-muted); margin-bottom: 12px; }
.nexus-hero .nexus-progress { background: #e8ecf0; }
.nexus-hero .nexus-progress > span { background: linear-gradient(90deg, var(--fmit-green), #43a047); }
.nexus-hero .nexus-progress-label { color: var(--fmit-muted) !important; }
.nexus-hero .nexus-progress-label strong { color: var(--fmit-text); }
.nexus-hero .btn-primary {
    background: var(--fmit-red);
    border-color: var(--fmit-red);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(150, 0, 0, .2);
}
.nexus-hero .btn-primary:hover {
    background: var(--fmit-red-dark);
    border-color: var(--fmit-red-dark);
    color: #fff;
}
.nexus-hero .nexus-badge {
    background: #fff !important;
    color: var(--fmit-blue) !important;
    border: 1px solid var(--fmit-border);
}

/* Pathway cards */
.nexus-pathway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.nexus-pathway-card {
    border: 1px solid var(--fmit-border);
    border-radius: var(--fmit-radius);
    padding: 16px;
    background: #fff;
    transition: box-shadow .2s, border-color .2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nexus-pathway-card:hover {
    border-color: #d0c8c8;
    box-shadow: var(--fmit-card-shadow);
}
.nexus-pathway-card h4 {
    margin: 0;
    font-size: 16px;
    color: var(--fmit-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}
.nexus-pathway-card-foot {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.nexus-pathway-card-title-link {
    color: inherit;
    text-decoration: none;
}
.nexus-pathway-card-title-link:hover {
    color: var(--fmit-red);
    text-decoration: underline;
}
.nexus-pathway-card-terms-hint {
    margin: -4px 0 0;
    font-size: 12px;
    line-height: 1.4;
}
.nexus-pathway-card-foot .btn {
    width: auto;
    min-width: 0;
}
.nexus-pathway-card > .btn {
    align-self: flex-end;
    width: auto;
}
.nexus-more-pathways {
    margin-top: 12px;
}
.nexus-more-pathways > summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--fmit-muted);
    user-select: none;
    list-style: none;
    display: inline-block;
    padding: 4px 0;
}
.nexus-more-pathways > summary:hover {
    color: var(--fmit-red);
}
.nexus-more-pathways[open] > summary {
    color: var(--fmit-text);
    font-weight: 600;
}
.nexus-more-pathways > summary::-webkit-details-marker {
    display: none;
}
.nexus-more-pathways-grid {
    margin-top: 12px;
}

/* Sidebar widgets */
.nexus-widget { margin-bottom: 16px; }
.nexus-widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.nexus-mastery-ring {
    text-align: center;
    padding: 8px 0;
}
.nexus-mastery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 0;
}
.nexus-mastery-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    display: inline-block;
}
.nexus-mastery-dots span.is-on { background: var(--fmit-red); }

/* Mastery page — hero + field cards */
.nexus-mastery-page { padding-bottom: 8px; }
.nexus-mastery-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
    margin: 0 0 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8eaed;
}
.nexus-mastery-hero-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: var(--fmit-navy, #1a2744);
}
.nexus-mastery-hero-sub {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--fmit-muted, #6b7280);
    max-width: 36em;
    line-height: 1.45;
}
.nexus-mastery-hero-status {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.nexus-mastery-hero-status.is-ready { color: #15803d; }
.nexus-mastery-hero-score {
    text-align: center;
    min-width: 100px;
}
.nexus-mastery-hero-num {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--fmit-red);
}
.nexus-mastery-hero-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--fmit-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nexus-mastery-next {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 18px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.nexus-mastery-next-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fmit-red);
}
.nexus-mastery-next-text {
    flex: 1 1 180px;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}
.nexus-mastery-section-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--fmit-navy, #1a2744);
}
.nexus-mastery-section-hint {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--fmit-muted, #6b7280);
    line-height: 1.45;
}
.nexus-mastery-field-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nexus-mastery-field-card {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}
.nexus-mastery-field-card.is-pro-ready {
    border-color: #f0c4c4;
    background: #fffafa;
}
.nexus-mastery-field-card.is-expert {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.nexus-mastery-field-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    margin-bottom: 8px;
}
.nexus-mastery-field-name {
    font-size: 14px;
    color: var(--fmit-navy, #1a2744);
}
.nexus-mastery-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
}
.nexus-mastery-pill.is-ready {
    background: #fff5f5;
    color: var(--fmit-red);
}
.nexus-mastery-pill.is-done {
    background: #dcfce7;
    color: #166534;
}
.nexus-mastery-field-pro-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    margin-bottom: 4px;
    color: #6b7280;
}
.nexus-mastery-field-pro-meta strong {
    font-size: 13px;
    color: #111827;
}
.nexus-mastery-field-bar {
    height: 6px;
}
.nexus-mastery-field-bar > span {
    background: linear-gradient(90deg, var(--fmit-red), #c0392b);
}
.nexus-mastery-field-expert {
    margin: 8px 0 0;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
}
.nexus-mastery-field-actions {
    margin-top: 8px;
}
.nexus-mastery-exam {
    margin: 0 0 16px;
}
.nexus-mastery-exam:empty { display: none; }
.nexus-mastery-more {
    margin: 0;
}
.nexus-mastery-more .nexus-disclosure-body {
    padding-top: 10px;
}

.nexus-timeline { list-style: none; padding: 0; margin: 0; }
.nexus-timeline li {
    position: relative;
    padding: 0 0 14px 30px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--fmit-muted);
}
.nexus-timeline li:last-child { padding-bottom: 0; }
.nexus-timeline li strong { color: var(--fmit-text); font-weight: 600; }
.nexus-timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccc;
    z-index: 1;
}
.nexus-timeline li.is-done::before { background: var(--fmit-green); box-shadow: 0 0 0 1px var(--fmit-green); }
.nexus-timeline li.is-current::before { background: var(--fmit-red); box-shadow: 0 0 0 1px var(--fmit-red); }
.nexus-timeline li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.nexus-mini-search .form-control {
    border-radius: 999px 0 0 999px;
    border-right: 0;
}
.nexus-mini-search .btn {
    border-radius: 0 999px 999px 0;
}

/* Empty state */
.nexus-empty {
    text-align: center;
    padding: 32px 16px;
}
.nexus-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--fmit-red-soft);
    color: var(--fmit-red);
    font-size: 32px;
    line-height: 72px;
}
.nexus-empty h4 { color: var(--fmit-text); margin-bottom: 8px; }
.nexus-empty p { color: var(--fmit-muted); max-width: 360px; margin: 0 auto 16px; }
.nexus-steps {
    text-align: left;
    max-width: 320px;
    margin: 0 auto 20px;
    padding: 0;
    list-style: none;
    counter-reset: nexus-step;
}
.nexus-steps li {
    counter-increment: nexus-step;
    padding: 6px 0 6px 32px;
    position: relative;
    font-size: 14px;
    color: var(--fmit-muted);
}
.nexus-steps li::before {
    content: counter(nexus-step);
    position: absolute;
    left: 0;
    top: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--fmit-red);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 22px;
}

/* Pathway sticky header */
.nexus-pathway-sticky {
    position: sticky;
    top: var(--nexus-header-h);
    z-index: 900;
    background: #fff;
    border: 1px solid var(--fmit-border);
    border-radius: var(--fmit-radius);
    padding: 14px 16px;
    margin: -4px 0 16px;
    box-shadow: var(--fmit-card-shadow);
}
.nexus-pathway-sticky-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nexus-pathway-sticky-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.nexus-pathway-sticky h1 {
    margin: 0;
    font-size: 18px;
    color: var(--fmit-heading);
    font-weight: bold;
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}
.nexus-pathway-sticky-actions {
    flex-shrink: 0;
}
.nexus-pathway-sticky-actions form {
    margin: 0;
}
.nexus-pathway-sticky-menu {
    display: block;
    position: relative;
}
.nexus-pathway-sticky-menu summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--fmit-border);
    border-radius: 8px;
    background: #fff;
    color: var(--fmit-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.nexus-pathway-sticky-menu-icon {
    font-size: 16px;
    line-height: 1;
}
.nexus-pathway-sticky-menu summary::-webkit-details-marker { display: none; }
.nexus-pathway-sticky-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 148px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    box-shadow: var(--fmit-card-shadow);
    z-index: 910;
}
.nexus-pathway-sticky-menu-panel form { margin: 0; }
.nexus-pathway-menu-rename { margin-bottom: 8px; }
.nexus-pathway-menu-action { margin-top: 8px; }
.nexus-pathway-sticky-meta {
    width: 100%;
    min-width: 0;
}
.nexus-pathway-sticky.is-compact {
    padding: 8px 12px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
    min-height: var(--nexus-pathway-sticky-expanded-h, auto);
    box-sizing: border-box;
}
.nexus-pathway-sticky.is-compact .nexus-pathway-sticky-head {
    align-items: center;
}
.nexus-pathway-sticky.is-compact .nexus-pathway-sticky-head h1 {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-clamp: unset;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}
.nexus-pathway-sticky.is-compact .nexus-pathway-sticky-meta .nexus-badge {
    display: none;
}
.nexus-pathway-sticky.is-compact .nexus-progress-label {
    font-size: 12px;
    margin-bottom: 4px;
}
.nexus-pathway-sticky.is-compact .nexus-progress-lg {
    height: 6px;
}
#nexus-pathway-terms,
.nexus-term-card {
    scroll-margin-top: calc(var(--nexus-header-h) + var(--nexus-pathway-sticky-h, 80px) + 12px);
}

/* Term cards */
.nexus-term-list { display: flex; flex-direction: column; gap: 10px; }
.nexus-term-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    background: #fff;
    transition: background .2s;
}
.nexus-term-card.is-done {
    background: #f9fbf9;
    opacity: .85;
}
.nexus-term-card.nexus-term-focus-flash,
.nexus-today-item.nexus-term-focus-flash {
    animation: nexus-term-focus-pulse 2.2s ease;
    box-shadow: 0 0 0 2px rgba(150, 0, 0, 0.35);
    border-radius: 10px;
}
@keyframes nexus-term-focus-pulse {
    0%, 100% { background-color: transparent; }
    15%, 45% { background-color: #fdf3f3; }
}
.nexus-term-body { flex: 1; min-width: 180px; }
.nexus-term-en {
    font-style: italic;
    color: var(--fmit-muted);
    font-size: 13px;
    display: block;
}
.nexus-term-vi {
    font-weight: 600;
    color: var(--fmit-text);
    font-size: 15px;
}
.nexus-term-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Collapse panel */
.nexus-panel-toggle {
    width: 100%;
    text-align: left;
    background: var(--fmit-red-soft);
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: bold;
    color: var(--fmit-red);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    transition: background .15s ease, border-color .15s ease;
}
.nexus-panel-toggle:hover,
.nexus-panel-toggle:focus {
    background: #f3e8e8;
    border-color: var(--fmit-red-line);
    outline: none;
}
.nexus-panel-toggle--neutral {
    background: #faf8f8;
    color: var(--fmit-heading);
    font-weight: 600;
}
.nexus-panel-toggle--neutral:hover,
.nexus-panel-toggle--neutral:focus {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.nexus-panel-toggle-inner {
    flex: 1;
    min-width: 0;
}
.nexus-panel-toggle-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.nexus-panel-toggle-hint {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: var(--fmit-muted);
    margin-top: 5px;
    line-height: 1.45;
}
.nexus-panel-toggle[aria-expanded="true"] .nexus-panel-toggle-hint {
    display: none;
}
.nexus-panel-toggle::after {
    content: '▾';
    font-size: 14px;
    transition: transform .2s;
}
.nexus-panel-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

/* Native <details> — mũi tên + hint (fallback / explainer) */
.nexus-disclosure {
    border: 1px solid var(--fmit-border);
    border-radius: 8px;
    background: #fafbfc;
    overflow: hidden;
    margin-bottom: 16px;
}
.nexus-disclosure > summary.nexus-disclosure-summary {
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.nexus-disclosure > summary.nexus-disclosure-summary::-webkit-details-marker {
    display: none;
}
.nexus-disclosure > summary.nexus-disclosure-summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    color: var(--fmit-muted);
    transition: transform 0.15s ease;
    vertical-align: top;
    margin-top: 2px;
}
.nexus-disclosure[open] > summary.nexus-disclosure-summary::before {
    transform: rotate(90deg);
}
.nexus-disclosure-title {
    display: inline;
    font-weight: 600;
    font-size: 14px;
    color: var(--fmit-heading);
}
.nexus-disclosure-hint {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: var(--fmit-muted);
    margin: 4px 0 0 20px;
    line-height: 1.45;
}
.nexus-disclosure-body {
    padding: 14px 16px;
    border-top: 1px solid var(--fmit-border);
    background: #fff;
}
.nexus-disclosure--accent .nexus-disclosure-title {
    color: var(--fmit-red);
}
.nexus-mastery-explainer {
    margin-top: 12px;
}
.nexus-cert-fee-details {
    margin-bottom: 16px;
}

.nexus-panel-body {
    border: 1px solid var(--fmit-border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 16px;
    margin-top: -1px;
}

/* Profile tabs */
.nexus-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid var(--fmit-border);
    margin-bottom: 20px;
}
.nexus-tab {
    padding: 10px 16px;
    border: none;
    background: none;
    font-weight: 600;
    font-size: 14px;
    color: var(--fmit-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
}
.nexus-tab:hover { color: var(--fmit-red); background: var(--fmit-red-soft); }
.nexus-tab.is-active {
    color: var(--fmit-red);
    border-bottom-color: var(--fmit-red);
    background: transparent;
}
.nexus-tab-panel {
    display: none;
    opacity: 0;
}
.nexus-tab-panel.is-active {
    display: block;
    animation: nexus-tab-in var(--nexus-duration-med) var(--nexus-ease-out) forwards;
}
@keyframes nexus-tab-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* Cert cards */
.nexus-cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.nexus-cert-card {
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    padding: 16px;
    background: linear-gradient(135deg, #fff 0%, var(--fmit-red-soft) 100%);
}
.nexus-cert-card h5 {
    margin: 0 0 6px;
    color: var(--fmit-red);
    font-size: 15px;
}
.nexus-cert-card .meta { font-size: 12px; color: var(--fmit-muted); margin-bottom: 10px; }

/* Search page */
.nexus-search-hero {
    text-align: center;
    padding: 8px 0 20px;
}
.nexus-search-hero h2 { margin-bottom: 6px; }
.nexus-search-box { position: relative; max-width: 640px; margin: 0 auto; }
.nexus-search-row {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.nexus-search-row .form-control {
    flex: 1;
    min-width: 0;
    height: 42px;
    box-sizing: border-box;
    padding: 8px 14px;
    font-size: 16px;
    line-height: 1.25;
    border-radius: 999px 0 0 999px;
    border-right: 0;
}
.nexus-search-row .btn {
    flex-shrink: 0;
    height: 42px;
    box-sizing: border-box;
    padding: 0 18px;
    font-size: 14px;
    line-height: 40px;
    border-radius: 0 999px 999px 0;
}
.nexus-mini-search-box { position: relative; }
.nexus-search-suggest-panel,
#nexus-search-suggest {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    padding: 10px 14px;
    max-height: 320px;
    overflow: auto;
    box-shadow: var(--fmit-card-shadow);
    border-radius: 0 0 10px 10px;
}
.nexus-search-suggest-panel.is-open,
#nexus-search-suggest.is-open { display: block; }
.nexus-search-suggest-panel .suggest-pick,
#nexus-search-suggest .suggest-pick {
    color: #333;
    font-weight: 600;
    cursor: pointer;
}
.nexus-search-suggest-panel .suggest-pick mark,
#nexus-search-suggest .suggest-pick mark {
    background: #fde68a;
    padding: 0 1px;
    border-radius: 2px;
}
#nexus-search-input.has-suggest,
#nexus-mini-search-input.has-suggest {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.nexus-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.nexus-search-result-link {
    flex: 1;
    min-width: 0;
    font-weight: 600;
}
.nexus-search-in-pathway {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--fmit-red);
    background: var(--fmit-red-soft);
    border: 1px solid var(--fmit-red-line);
    border-radius: 999px;
    padding: 3px 10px;
    max-width: min(220px, 46vw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nexus-search-result-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nexus-search-pocket.is-saved {
    border-color: #4caf50;
    color: #2e7d32;
    background: #e8f5e9;
}

/* Toast */
#nexus-toast-wrap {
    position: fixed;
    top: calc(var(--nexus-header-h) + 8px);
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
}
.nexus-toast {
    background: #fff;
    border-left: 4px solid var(--fmit-red);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
    padding: 12px 16px;
    font-size: 14px;
    animation: nexus-toast-in .3s ease;
}
.nexus-toast.is-success { border-left-color: var(--fmit-green); }
.nexus-toast.is-danger { border-left-color: #c62828; }
.nexus-toast.is-warning { border-left-color: #f57c00; }
.nexus-toast.is-info { border-left-color: var(--fmit-blue); }
@keyframes nexus-toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Confirm modal */
#nexus-confirm-modal .modal-header { border-bottom-color: var(--fmit-border); }
#nexus-confirm-modal .modal-title { color: var(--fmit-red); font-weight: bold; }

/* Exam focus — ẩn bottom nav, thanh scroll rõ hơn */
body.nexus-exam-active .nexus-bottom-nav { display: none !important; }
body.nexus-exam-active.has-bottom-nav { padding-bottom: 12px; }
body.nexus-exam-active .nexus-welcome { display: none; }
html.nexus-exam-scroll,
body.nexus-exam-active {
    scrollbar-width: auto;
    scrollbar-color: #960000 #e8e0e0;
}
html.nexus-exam-scroll::-webkit-scrollbar,
body.nexus-exam-active::-webkit-scrollbar {
    width: 11px;
}
html.nexus-exam-scroll::-webkit-scrollbar-track,
body.nexus-exam-active::-webkit-scrollbar-track {
    background: #ececec;
}
html.nexus-exam-scroll::-webkit-scrollbar-thumb,
body.nexus-exam-active::-webkit-scrollbar-thumb {
    background: #960000;
    border-radius: 6px;
    border: 2px solid #ececec;
}
html.nexus-exam-scroll::-webkit-scrollbar-thumb:hover,
body.nexus-exam-active::-webkit-scrollbar-thumb:hover {
    background: #7a0000;
}

/* Scroll to top — y hệt #back2top trang từ điển FMIT (style.css + script.js) */
#back2top {
    position: fixed;
    z-index: 1989;
    right: 12px;
    bottom: 35px;
    width: 40px;
    padding: 5px 0;
    text-align: center;
    background: #800000;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: none;
}
#back2top:hover {
    background: #910000;
    -webkit-transition: all .3s ease;
    -moz-transition: all .3s ease;
    transition: all .3s ease;
}
@media (max-width: 991px) {
    body.has-bottom-nav #back2top {
        bottom: calc(var(--nexus-bottom-nav-total) + 14px + var(--nexus-float-extra-bottom, 0px));
        z-index: 1051;
    }
    body.nexus-exam-active #back2top {
        bottom: 18px;
    }
}

/* Bottom nav (mobile) — bottom cap 100px: iOS visualViewport đôi khi báo gap ảo */
.nexus-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    bottom: min(100px, var(--nexus-ios-viewport-gap, 0px));
    left: 0;
    right: 0;
    height: calc(var(--nexus-bottom-nav-h) + var(--nexus-safe-bottom));
    padding-bottom: var(--nexus-safe-bottom);
    background: #fff;
    border-top: 1px solid var(--fmit-border);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}
.nexus-bottom-nav-inner {
    display: flex;
    height: 100%;
    align-items: stretch;
    justify-content: space-around;
}
.nexus-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none !important;
    color: var(--fmit-muted);
    font-size: 10px;
    font-weight: 600;
    padding: 6px 4px;
}
.nexus-bottom-nav a .ico { font-size: 20px; line-height: 1; }
.nexus-bottom-nav a.is-active { color: var(--fmit-red); }

/* Loading overlay */
#nexus-page-loading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(255, 255, 255, .88);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#nexus-page-loading.is-active { display: flex; }
#nexus-page-loading.is-active p:empty { display: none; }
#nexus-page-loading .nexus-loading-sub {
    margin: 10px 16px 0;
    max-width: 320px;
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    text-align: center;
}
.nexus-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #e8e0e0;
    border-top-color: var(--fmit-red);
    border-radius: 50%;
    animation: nexus-spin .75s linear infinite;
}
@keyframes nexus-spin { to { transform: rotate(360deg); } }

/* Hub picker (create pathway) — base; trang create override trong @section style */
.nexus-hub-picker-wrap { margin-bottom: 18px; }
.nexus-hub-selected {
    padding: 12px 14px;
    border: 1px dashed var(--fmit-border);
    border-radius: 10px;
    background: #fafafa;
    margin-bottom: 12px;
    min-height: 46px;
}
.nexus-hub-selected-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.nexus-hub-selected-empty { color: var(--fmit-muted); font-size: 13px; }
.nexus-hub-suggest {
    margin-bottom: 12px;
    padding: 10px 14px;
    font-size: 13px;
}
.nexus-hub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.nexus-hub-tab {
    border: 1px solid var(--fmit-border);
    background: #fff;
    color: var(--fmit-text);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.nexus-hub-tab:hover { border-color: var(--fmit-red); color: var(--fmit-red); }
.nexus-hub-tab.is-active {
    background: var(--fmit-red);
    border-color: var(--fmit-red);
    color: #fff;
}
.nexus-hub-panel { display: none; }
.nexus-hub-panel.is-active { display: block; }
.nexus-hub-panel-desc { font-size: 13px; margin: 0 0 10px; }
.nexus-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.nexus-hub-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.nexus-hub-card:hover {
    border-color: var(--fmit-red);
    background: var(--fmit-red-soft);
    box-shadow: 0 2px 8px rgba(150, 0, 0, .08);
}
.nexus-hub-card.is-selected {
    border-color: var(--fmit-red);
    background: var(--fmit-red-soft);
    box-shadow: inset 0 0 0 1px var(--fmit-red);
}
.nexus-hub-card-title { font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--fmit-text); }
.nexus-hub-card-meta { font-size: 12px; color: var(--fmit-muted); }
.nexus-hub-card-en { font-size: 11px; line-height: 1.2; }
.nexus-hub-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}
.nexus-hub-badge--full { background: #e8f5e9; color: var(--fmit-green); }
.nexus-hub-badge--mini { background: #fff8e1; color: #b8860b; }
.nexus-hub-badge--small { background: #fce4ec; color: #c62828; }
.nexus-hub-badge--explore { background: #eceff1; color: #546e7a; }
.nexus-pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.nexus-pillar-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.nexus-pillar-card:hover {
    border-color: var(--fmit-blue);
    background: #f0f4f8;
}
.nexus-pillar-card-title { font-weight: 700; font-size: 14px; }
.nexus-pillar-card-count { font-size: 12px; color: var(--fmit-muted); }
.nexus-pillar-card-en { font-size: 11px; }

/* Framework / chứng chỉ — chip bar */
.nexus-fw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--fmit-border);
}
.nexus-fw-chips-empty { margin: 0; font-size: 13px; }
.nexus-fw-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 8px 14px;
    border: 1px solid var(--fmit-border);
    border-radius: 8px;
    background: #fff;
    color: var(--fmit-text);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.nexus-fw-chip:hover {
    border-color: var(--fmit-red);
    color: var(--fmit-red);
    box-shadow: 0 1px 4px rgba(150, 0, 0, .08);
}
.nexus-fw-chip.is-active {
    background: var(--fmit-red);
    border-color: var(--fmit-red);
    color: #fff;
    box-shadow: 0 2px 8px rgba(150, 0, 0, .18);
}
.nexus-fw-chip[data-code="PMBOK"].is-active,
.nexus-fw-chip[data-code="Agile"].is-active { background: #1565c0; border-color: #1565c0; }
.nexus-fw-chip[data-code="COSO"].is-active,
.nexus-fw-chip[data-code="IPPF"].is-active { background: #6a1b9a; border-color: #6a1b9a; }
.nexus-fw-chip[data-code="IFRS"].is-active { background: #2e7d32; border-color: #2e7d32; }
.nexus-fw-chip[data-code="SCOR"].is-active,
.nexus-fw-chip[data-code="CPSM"].is-active { background: #ef6c00; border-color: #ef6c00; }
.nexus-fw-chip[data-code="COBIT"].is-active,
.nexus-fw-chip[data-code="ITIL"].is-active { background: #00838f; border-color: #00838f; }
.nexus-fw-chip[data-code="ISO 27001"].is-active { background: #455a64; border-color: #455a64; }

.nexus-fw-body { min-height: 120px; }
.nexus-fw-body-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--fmit-muted);
}
.nexus-fw-body-head { margin-bottom: 12px; }
.nexus-fw-body-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fmit-text);
}
.nexus-fw-body-meta { margin: 0; font-size: 13px; }

.nexus-pillar-back { padding-left: 0; margin-bottom: 4px; }
.nexus-pillar-current { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.nexus-hub-search-row { margin-bottom: 10px; }
.nexus-hub-small-toggle {
    display: block;
    font-size: 13px;
    font-weight: normal;
    margin-bottom: 10px;
    cursor: pointer;
}
.nexus-hub-empty { font-size: 13px; margin-top: 8px; }

/* ── Engagement (streak, chapters, goals, badges) ── */
.nexus-hero-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--fmit-red);
    font-weight: bold;
}
.nexus-hero-hub { font-size: 14px; margin: 0 0 10px; color: var(--fmit-muted) !important; }
.nexus-hero-goals {
    font-size: 13px;
    margin-bottom: 14px;
    color: var(--fmit-muted);
}
.nexus-hero-goals strong { color: var(--fmit-text); }
.nexus-hero-goals .sep { margin: 0 6px; opacity: .5; }
.nexus-hero-goals .is-done { color: var(--fmit-green); font-weight: 600; }

.nexus-streak-panel {
    background: #fff;
    border: 1px solid var(--fmit-border);
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    color: var(--fmit-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.nexus-streak-flame { font-size: 26px; line-height: 1; }
.nexus-streak-num { font-size: 36px; font-weight: bold; line-height: 1.1; margin: 4px 0; color: var(--fmit-red); }
.nexus-streak-label { font-size: 13px; color: var(--fmit-muted); }
.nexus-streak-sub { font-size: 12px; color: var(--fmit-muted); margin-top: 4px; }
.nexus-streak-today {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e8f5e9;
    color: var(--fmit-green);
    font-weight: 600;
}
.nexus-streak-today--pending {
    background: #fff8e1;
    color: #9a7b0a;
}
.nexus-streak-inline { font-size: 15px; }
.nexus-streak-flame-sm { margin-right: 4px; }
.nexus-pill-streak {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}
.nexus-pill-streak strong { color: #b45309; }

.nexus-today-card {
    border-left: 3px solid var(--fmit-red-line);
    background: linear-gradient(90deg, var(--fmit-red-tint) 0%, #fff 12%);
}
.nexus-today-desc { font-size: 13px; margin: 0 0 12px; color: var(--fmit-muted); }
.nexus-today-pathway { font-size: 13px; margin: 0 0 4px; color: var(--fmit-text); }
.nexus-today-pathway strong { font-weight: 600; }
.nexus-today-list { list-style: none; margin: 0; padding: 0; }
.nexus-today-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
}
.nexus-today-item:last-child { border-bottom: none; }
.nexus-today-item.is-done { opacity: .55; }
.nexus-today-vi { display: block; font-weight: 600; font-size: 14px; color: var(--fmit-text); }
.nexus-today-chapter { display: block; font-size: 11px; font-weight: 600; color: var(--fmit-red); margin-bottom: 2px; }
.nexus-today-en { display: block; font-size: 12px; color: var(--fmit-muted); }
.nexus-today-actions { display: flex; gap: 6px; flex-shrink: 0; }
.nexus-today-actions .btn-default {
    color: var(--fmit-blue);
    border-color: var(--fmit-border);
    background: #fff;
}
.nexus-today-actions .btn-primary {
    background: var(--fmit-blue);
    border-color: var(--fmit-blue);
    font-size: 11px;
}
.nexus-today-actions .btn-primary:hover {
    background: #0f2744;
    border-color: #0f2744;
}

.nexus-pathway-terms-nudge {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--fmit-border);
    background: #f8fafc;
}
.nexus-pathway-terms-nudge-text {
    margin: 0;
    font-size: 14px;
    color: var(--fmit-text);
}
.nexus-pathway-terms-nudge-link {
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    vertical-align: baseline;
}
.nexus-pathway-terms-nudge-sub {
    margin: 6px 0 0;
    font-size: 12px;
}

/* Kiểm tra chương — banner ngay sau danh sách term */
.nexus-chapter-quiz-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 10px;
    border: 2px solid #2e7d32;
    background: linear-gradient(135deg, #f1f8f4 0%, #e8f5e9 100%);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.12);
}
.nexus-chapter-quiz-banner.is-dismissed {
    display: none;
}
.nexus-chapter-quiz-banner.nexus-chapter-quiz-banner-highlight {
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.35), 0 4px 16px rgba(46, 125, 50, 0.2);
}
.nexus-chapter-quiz-banner-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    background: #2e7d32;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}
.nexus-chapter-quiz-banner-body {
    flex: 1;
    min-width: 0;
}
.nexus-chapter-quiz-banner-body strong {
    display: block;
    font-size: 16px;
    color: #1b5e20;
    margin-bottom: 4px;
}
.nexus-chapter-quiz-banner-body p {
    margin: 0 0 12px;
    font-size: 13px;
    color: #455a64;
    line-height: 1.5;
}
.nexus-chapter-quiz-banner-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
a.js-nexus-chapter-quiz-cta.is-cooldown,
a.js-nexus-chapter-quiz-cta[aria-disabled="true"] {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.72;
    box-shadow: none;
}
.nexus-chapter-quiz-cooldown-note {
    margin: 10px 0 0;
    padding: 10px 12px;
    background: #fff8e6;
    border: 1px solid #f0d78c;
    border-radius: 8px;
    color: #7a5b00;
    font-size: 13px;
    line-height: 1.45;
    max-width: 420px;
}
.nexus-chapter-quiz-dismiss {
    color: #666 !important;
    padding-left: 4px;
    padding-right: 4px;
}
.nexus-chapter-chip.has-quiz-pending .nexus-chapter-quiz-chip-link {
    color: var(--fmit-red);
    font-weight: 700;
    font-size: 11px;
}
.nexus-chapter-chip.has-quiz-pending.is-done {
    border-color: rgba(150, 0, 0, 0.35);
}
.nexus-chapter-quiz-inline-link {
    font-weight: 600;
    color: var(--fmit-red);
    white-space: nowrap;
}
.nexus-chapter-quiz-done-badge {
    display: inline-block;
    font-weight: 600;
    font-size: 11px;
    color: #2e7d32;
    white-space: nowrap;
}
.nexus-chapter-chip.has-quiz-done .nexus-chapter-quiz-done-badge {
    color: #1b5e20;
}

/* Responsive — phone */
@media (max-width: 767px) {
    .nexus-nav-main { display: none; }
    .nexus-nav-main.is-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--fmit-border);
        padding: 8px;
        box-shadow: var(--fmit-card-shadow);
    }
    .nexus-menu-toggle { display: block; }
    .nexus-topbar-inner { position: relative; flex-wrap: wrap; }
    .nexus-brand-text small { display: none; }
    .nexus-user-toggle span.name { display: none; }
    .nexus-user-toggle {
        padding: 3px;
        border-radius: 50%;
        max-width: none;
    }
    .nexus-avatar {
        width: 34px;
        height: 34px;
        font-size: 12px;
        letter-spacing: 0.02em;
    }
    .nexus-bottom-nav { display: block; }
    body.nexus-app.has-bottom-nav {
        padding-bottom: calc(var(--nexus-bottom-nav-total) + 12px);
    }
    .nexus-search-hero {
        text-align: left;
        padding: 0 0 12px;
    }
    .nexus-search-hero h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }
    .nexus-search-row .form-control {
        height: 38px;
        padding: 6px 12px;
    }
    .nexus-search-row .btn {
        height: 38px;
        padding: 0 14px;
        font-size: 13px;
        min-width: 48px;
    }
    .nexus-pathway-sticky {
        top: var(--nexus-header-h);
        margin-left: -15px;
        margin-right: -15px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    .nexus-pathway-sticky h1 {
        font-size: 15px;
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .nexus-pathway-sticky-menu-label {
        display: none;
    }
    .nexus-pathway-sticky-menu summary {
        padding: 4px 8px;
        min-width: 32px;
        justify-content: center;
    }
    .nexus-pathway-sticky.is-compact .nexus-pathway-sticky-head {
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 0;
    }
    .nexus-pathway-sticky.is-compact .nexus-pathway-sticky-inner {
        gap: 6px;
    }
    #nexus-pathway-terms,
    .nexus-term-card {
        scroll-margin-top: calc(var(--nexus-header-h) + var(--nexus-pathway-sticky-h, 72px) + 12px);
    }
    .nexus-pathway-grid { grid-template-columns: 1fr; }
    .nexus-hero h2 {
        font-size: 18px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        overflow: hidden;
        word-break: break-word;
    }
    .nexus-hero-hub,
    .nexus-today-pathway {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        word-break: break-word;
    }
    .nexus-student-status-body {
        min-width: 0;
        flex: 1;
    }
    .nexus-student-status-detail {
        word-break: break-word;
    }
    .nexus-today-vi,
    .nexus-today-en,
    .nexus-today-chapter {
        word-break: break-word;
    }
    .nexus-chapters-card .nexus-card-head .text-muted {
        display: none;
    }
    .nexus-term-card { flex-direction: column; align-items: stretch; }
    .nexus-term-actions { justify-content: flex-end; }
    .nexus-hub-grid { grid-template-columns: 1fr; }
    .nexus-fw-chips { gap: 6px; }
    .nexus-fw-chip { min-width: 48px; padding: 7px 12px; font-size: 11px; }
    .nexus-pillar-grid { grid-template-columns: 1fr 1fr; }
    .nexus-hub-badge-grid { grid-template-columns: 1fr; }
    .nexus-today-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .nexus-today-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .nexus-card-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .nexus-card-head-meta {
        justify-content: flex-start;
        width: 100%;
    }
    .nexus-tab {
        padding: 8px 11px;
        font-size: 13px;
    }
    .nexus-profile-section--account,
    .nexus-profile-email-prefs {
        padding: 12px;
    }
    .nexus-exam-format-legend {
        width: 100%;
    }
    .nexus-table-stack thead { display: none; }
    .nexus-table-stack tbody tr {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid var(--fmit-border);
    }
    .nexus-table-stack tbody td {
        display: block;
        border: none;
        padding: 2px 0;
    }
    .nexus-table-stack tbody td::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: var(--fmit-muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .02em;
    }
    .nexus-table-stack tbody td:first-child { padding-top: 0; }
}

/* Responsive — tablet (iPad portrait/landscape) */
@media (min-width: 768px) and (max-width: 991px) {
    .nexus-nav-main { display: flex; }
    .nexus-menu-toggle { display: none; }
    .nexus-bottom-nav { display: none; }
    .nexus-brand-text small { display: block; font-size: 10px; }
    .nexus-user-toggle span.name { display: inline; max-width: 120px; }
    .nexus-nav-main a {
        padding: 8px 10px;
        font-size: 13px;
    }
    .nexus-main.container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    .nexus-pathway-sticky h1 {
        font-size: 17px;
    }
    .nexus-pathway-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .nexus-hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .nexus-pillar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .nexus-term-card {
        flex-direction: row;
        align-items: center;
    }
    .nexus-term-actions {
        flex-shrink: 0;
        justify-content: flex-end;
    }
    .nexus-hero h2 { font-size: 22px; }
    .nexus-streak-panel {
        margin-top: 0;
    }
    .nexus-card-head {
        flex-wrap: wrap;
        gap: 8px;
    }
    .nexus-today-item {
        flex-direction: row;
        align-items: center;
    }
    .nexus-today-actions {
        flex-wrap: nowrap;
    }
}

/* Legacy alias — keep grid stacks for narrow tablets in edge cases */
@media (max-width: 991px) {
    .nexus-hub-badge-grid { grid-template-columns: 1fr; }
}

.nexus-dual-goals {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 768px) {
    .nexus-dual-goals {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
}
.nexus-dual-goal {
    padding: 14px;
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    background: #fafafa;
    min-width: 0;
}
.nexus-dual-goal.is-done { border-color: #c8e6c9; background: #f1f8f4; }
.nexus-dual-goal-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}
.nexus-dual-goal-tier {
    font-weight: 700;
    color: var(--fmit-blue);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 11px;
    flex: 1 1 auto;
    min-width: 0;
}
.nexus-dual-goal-head > strong {
    flex: 0 0 auto;
    white-space: nowrap;
}
.nexus-dual-goal-status {
    font-size: 12px;
    color: var(--fmit-muted);
    display: block;
    margin-top: 8px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.nexus-mini-milestones {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.nexus-mini-milestone {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    flex: 1 1 0;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px dashed var(--fmit-border);
    font-size: 11px;
    font-weight: 700;
    color: var(--fmit-muted);
    background: #fff;
    line-height: 1.2;
    text-align: center;
}
@media (min-width: 768px) {
    .nexus-mini-milestone {
        flex: 0 1 auto;
    }
}
.nexus-mini-milestone small {
    display: block;
    font-weight: 500;
    font-size: 9px;
    margin-top: 2px;
    text-transform: none;
}
.nexus-mini-milestone.is-done {
    border-style: solid;
    border-color: var(--fmit-green);
    color: var(--fmit-green);
    background: #e8f5e9;
}

.nexus-chapters-card { overflow: hidden; }
.nexus-chapters-card .nexus-card-head { margin-bottom: 10px; }

.nexus-chapter-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 10px;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(150, 0, 0, .4) #eef0f3;
    cursor: grab;
}
.nexus-chapter-track.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
    -webkit-user-select: none;
}
.nexus-chapter-track.is-dragging .nexus-chapter-chip {
    cursor: grabbing;
}
.nexus-chapter-track::-webkit-scrollbar { height: 6px; }
.nexus-chapter-track::-webkit-scrollbar-track {
    background: #eef0f3;
    border-radius: 999px;
}
.nexus-chapter-track::-webkit-scrollbar-thumb {
    background: rgba(150, 0, 0, .35);
    border-radius: 999px;
}
.nexus-chapter-track::-webkit-scrollbar-thumb:hover { background: rgba(150, 0, 0, .5); }

.nexus-chapter-chip {
    flex: 1 1 0;
    min-width: 160px;
    max-width: none;
    padding: 10px 12px;
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    background: #fff;
    text-decoration: none !important;
    color: var(--fmit-text) !important;
    cursor: grab;
    -webkit-user-drag: none;
    user-select: none;
    transition: border-color .15s, box-shadow .15s;
}
.nexus-chapter-chip:hover { border-color: var(--fmit-red); box-shadow: 0 2px 8px rgba(150, 0, 0, .08); }
.nexus-chapter-chip.is-current { border-color: var(--fmit-red); background: var(--fmit-red-soft); }
.nexus-chapter-chip.is-done { border-color: #c8e6c9; }
.nexus-chapter-chip.is-locked {
    opacity: .55;
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #e0e0e0;
    pointer-events: none;
}
.nexus-chapter-chip-title {
    display: block;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.nexus-chapter-chip-meta { display: block; font-size: 11px; color: var(--fmit-muted); margin: 2px 0 6px; }
.nexus-chapter-page-done a { font-weight: 700; margin-left: 6px; }
.nexus-chapter-scroll-hint {
    display: none;
    margin: -2px 0 8px;
    font-size: 11px;
    color: var(--fmit-muted);
}
@media (max-width: 767px) {
    .nexus-chapter-track {
        overflow-x: scroll;
        scrollbar-width: auto;
        padding-bottom: 12px;
        gap: 8px;
    }
    .nexus-chapter-track::-webkit-scrollbar { height: 8px; }
    .nexus-chapter-chip {
        flex: 0 0 calc(50% - 4px);
        width: calc(50% - 4px);
        min-width: 0;
        max-width: none;
        padding: 8px 10px;
        box-sizing: border-box;
    }
    .nexus-chapter-chip-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
        line-height: 1.3;
        min-height: 2.6em;
    }
    .nexus-chapter-chip-meta {
        margin: 4px 0 0;
    }
    .nexus-chapter-scroll-hint { display: block; }
}
@media (min-width: 768px) and (max-width: 991px) {
    .nexus-chapter-chip {
        min-width: 150px;
    }
}
.nexus-progress-sm { height: 4px; }

.nexus-hub-badge-list { display: flex; flex-direction: column; gap: 8px; }
.nexus-hub-badge-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.nexus-hub-badge-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.nexus-hub-badge--expert { background: #1a365d; color: #fff; }
.nexus-hub-badge--pro { background: #fff3e0; color: #e65100; }
.nexus-hub-badge--pro-done { background: #e8f5e9; color: #2e7d32; }
.nexus-hub-badge--scholar { background: #e3f2fd; color: #1565c0; }
.nexus-hub-badge--explorer { background: #f3e5f5; color: #7b1fa2; }
.nexus-hub-badge--muted { background: #eee; color: #999; }
.nexus-hub-badge-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nexus-hub-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.nexus-hub-badge-card {
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    padding: 14px;
    background: #fafafa;
}
.nexus-hub-badge-card h5 { margin: 8px 0 10px; font-size: 15px; color: var(--fmit-text); }

.nexus-stat-tile {
    text-align: center;
    padding: 14px 8px;
    border: 1px solid var(--fmit-border);
    border-radius: 10px;
    background: #fff;
    margin-bottom: 12px;
}
.nexus-stat-num { font-size: 22px; font-weight: bold; color: var(--fmit-red); }
.nexus-stat-label { font-size: 11px; color: var(--fmit-muted); text-transform: uppercase; letter-spacing: .04em; }

.nexus-timeline-compact li {
    font-size: 12px;
    line-height: 1.45;
    padding: 0 0 10px 30px;
}
.nexus-timeline-compact li:last-child { padding-bottom: 0; }


@media (max-width: 480px) {
    .nexus-card { padding: 16px; }
    .nexus-brand-logo--desktop {
        height: 44px;
        width: 44px;
        max-width: 44px;
    }
    .nexus-brand-text strong { font-size: 14px; }
}

.nexus-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.nexus-zalo-share-slot {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    min-width: 72px;
}
.nexus-zalo-share-slot .zalo-share-button {
    display: inline-block;
    line-height: 0;
}
.nexus-btn-zalo {
    background: #0068ff;
    border-color: #0068ff;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nexus-btn-zalo:hover,
.nexus-btn-zalo:focus {
    background: #0056d6;
    border-color: #0056d6;
    color: #fff;
}
.nexus-zalo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #fff;
    color: #0068ff;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
}

/* Pathway view tabs — Học | Mốc & thi | Luyện tập */
.nexus-pathway-view-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 14px;
    padding: 4px;
    background: #ebebeb;
    border-radius: 10px;
    border: 1px solid var(--fmit-border);
}
.nexus-pathway-view-tab {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    text-align: center;
    display: block;
    line-height: 1.3;
}
a.nexus-pathway-view-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}
button.nexus-pathway-view-tab:hover,
a.nexus-pathway-view-tab:hover {
    color: var(--fmit-red);
    background: rgba(255,255,255,.6);
}
.nexus-pathway-view-tab.is-active {
    background: #fff;
    color: var(--fmit-red);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}
.nexus-pathway-view-panel[hidden] { display: none !important; }

.nexus-pathway-card-hub {
    font-size: 12px;
    margin: -4px 0 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}
.nexus-inline-help-link {
    font-size: 13px;
    white-space: nowrap;
}
.nexus-faq-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--fmit-heading);
    margin: 0 0 12px;
}

/* Onboarding lần đầu — trang lộ trình */
.nexus-onboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.nexus-onboard-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}
.nexus-onboard-kicker {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--fmit-red);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.nexus-onboard-card h3 {
    margin: 0 0 14px;
    font-size: 18px;
    color: var(--fmit-heading);
}
.nexus-onboard-lead {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.55;
    color: #444;
}
.nexus-onboard-actions--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.nexus-onboard-actions--stack .btn {
    width: 100%;
    text-align: center;
}
.nexus-onboard-card--dashboard {
    max-width: 400px;
}
.nexus-onboard-steps {
    margin: 0 0 16px;
    padding-left: 20px;
    line-height: 1.6;
    font-size: 14px;
    color: #444;
}
.nexus-onboard-steps li { margin-bottom: 6px; opacity: .45; }
.nexus-onboard-steps li.is-active { opacity: 1; font-weight: 600; }
.nexus-onboard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.nexus-student-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nexus-student-status-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e8ecf2;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
}
.nexus-student-status-item:last-child { margin-bottom: 0; }
.nexus-student-status-title {
    display: block;
    font-size: 14px;
    color: #111827;
    margin-bottom: 4px;
}
.nexus-student-status-detail {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
}
.nexus-student-status-item--warning {
    border-color: #f0d9b8;
    background: #fffbf5;
}
.nexus-student-status-item--primary {
    border-color: #f3d0d0;
    background: #fef7f7;
}
.nexus-onboard-steps--dashboard li {
    font-size: 13px;
    line-height: 1.45;
}
@media (max-width: 640px) {
    .nexus-student-status-item {
        flex-direction: column;
        align-items: stretch;
    }
    .nexus-student-status-item .btn {
        align-self: flex-start;
    }
}

/* Bảng lệ phí thi / cấp CN */
.nexus-cert-fee-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #faf8f8;
    border: 1px solid #eee;
    border-radius: 8px;
}
.nexus-cert-fee-panel .nexus-cert-fee-box {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}
.nexus-cert-fee-table th,
.nexus-cert-fee-table td {
    font-size: 13px;
    vertical-align: middle;
}
.nexus-cert-fee-table th {
    color: #666;
    font-weight: 600;
    white-space: nowrap;
}
.nexus-cert-fee-table td:first-child {
    font-weight: 600;
    color: #333;
}

/* Coach Nexus — góc trái dưới; mobile: bottom sheet */
.nexus-chatbot-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(0, 0, 0, .35);
}
body.nexus-chatbot-open { overflow: hidden; }
.nexus-chatbot {
    position: fixed;
    left: 14px;
    bottom: 20px;
    z-index: 1002;
    font-family: Arial, Helvetica, sans-serif;
}
.nexus-chatbot-fab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px 0 12px;
    border: none;
    border-radius: 22px;
    background: var(--fmit-red, #960000);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .22);
    cursor: pointer;
}
.nexus-chatbot-fab:active { transform: scale(.96); }
.nexus-chatbot-fab-ico { font-size: 18px; line-height: 1; }
.nexus-chatbot-panel {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    width: min(360px, calc(100vw - 28px));
    max-height: min(70vh, 520px);
    background: #fff;
    border: 1px solid var(--fmit-border, #e8d4d4);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
    overflow: hidden;
    flex-direction: column;
}
.nexus-chatbot.is-open .nexus-chatbot-panel { display: flex; }
.nexus-chatbot-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #fff 0%, #faf6f6 100%);
    border-bottom: 1px solid #eee;
}
.nexus-chatbot-head strong { display: block; color: var(--fmit-red, #960000); font-size: 15px; }
.nexus-chatbot-sub { display: block; font-size: 11px; color: #777; margin-top: 2px; }
.nexus-chatbot-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
}
.nexus-chatbot-quota {
    padding: 6px 14px 0;
    font-size: 11px;
    color: #666;
}
.nexus-chatbot-suggestions {
    padding: 8px 14px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.nexus-chatbot-sug-label {
    font-size: 11px;
    color: #888;
    margin-right: 2px;
}
.nexus-chatbot-sug {
    border: 1px solid #e0c8c8;
    background: #fff;
    color: #7a0000;
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    max-width: 100%;
    text-align: left;
}
.nexus-chatbot-sug:hover { background: #faf6f6; }
.nexus-chatbot-messages {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: 280px;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nexus-chatbot-msg {
    max-width: 92%;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    word-wrap: break-word;
}
.nexus-chatbot-msg.is-user {
    align-self: flex-end;
    background: #f0e8e8;
    color: #333;
}
.nexus-chatbot-msg.is-assistant {
    align-self: flex-start;
    background: #f7f7f7;
    border: 1px solid #eee;
    color: #222;
}
.nexus-chatbot-msg.is-assistant strong {
    color: #1a1a1a;
    font-weight: 600;
}
.nexus-chatbot-msg.is-assistant em {
    color: #444;
}
.nexus-chatbot-msg.is-pending {
    color: #888;
    font-style: italic;
    min-width: 2.5em;
}
.nexus-chatbot-md-ul,
.nexus-chatbot-md-ol {
    margin: 6px 0 4px;
    padding-left: 1.15em;
}
.nexus-chatbot-md-ul li,
.nexus-chatbot-md-ol li {
    margin: 3px 0;
    line-height: 1.42;
}
.nexus-chatbot-md-ol {
    list-style: none;
    padding-left: 0;
}
.nexus-chatbot-md-ol li {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.nexus-chatbot-step {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--fmit-red, #960000);
    min-width: 1.4em;
}
.nexus-chatbot-msg a.nexus-chatbot-link {
    color: var(--fmit-red, #960000);
    text-decoration: underline;
    word-break: break-word;
}
.nexus-chatbot-msg a.nexus-chatbot-link:hover {
    color: #7a0000;
}
.nexus-chatbot-src {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #eee;
    color: #666;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.nexus-chatbot-msg.is-assistant .nexus-chatbot-src--faq { background: #e8f4fc; color: #0369a1; }
.nexus-chatbot-msg.is-assistant .nexus-chatbot-src--openai { background: #f3e8ff; color: #6b21a8; }
.nexus-chatbot-msg.is-assistant .nexus-chatbot-src--feedback { background: #ecfdf5; color: #047857; }
.nexus-chatbot-msg.is-assistant .nexus-chatbot-src--error { background: #fef2f2; color: #b91c1c; }
.nexus-chatbot-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 10px 14px;
    border-top: 1px solid #eee;
    background: #fff;
}
.nexus-chatbot-form textarea {
    flex: 1 1 auto;
    resize: vertical;
    min-height: 38px;
    max-height: 96px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 8px 10px;
}
.nexus-chatbot-form .btn { flex-shrink: 0; min-width: 56px; }
.nexus-chatbot-foot {
    margin: 0;
    padding: 0 14px 10px;
    font-size: 11px;
    color: #888;
    text-align: center;
}
.nexus-chatbot-feedback-slot {
    flex-shrink: 0;
    max-height: min(38vh, 280px);
    overflow-y: auto;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-suggestions {
    display: none;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-messages {
    flex: 0 1 auto;
    max-height: 48px;
    min-height: 0;
    opacity: 0.88;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-panel {
    max-height: min(84vh, 600px);
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-feedback-slot {
    flex: 1 1 auto;
    max-height: none;
    min-height: 340px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 2px solid #e8d4d4;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, .06);
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-feedback-slot .nexus-chatbot-feedback-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px 12px 0;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-feedback-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 0;
    padding-bottom: 8px;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-feedback-detail {
    min-height: 88px;
    resize: vertical;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-feedback-error {
    flex-shrink: 0;
    margin: 0 0 8px;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-feedback-error[hidden] {
    display: none;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-feedback-actions {
    flex-shrink: 0;
    margin: 0;
    padding: 10px 12px 12px;
    background: #fafafa;
    border-top: 1px solid #eee;
}
.nexus-chatbot.is-feedback-open .nexus-chatbot-form {
    display: none;
}
.nexus-chatbot-feedback-slot:not([hidden]) {
    display: block;
}
.nexus-chatbot-feedback-slot .nexus-chatbot-feedback-wrap {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    max-width: 100%;
    align-self: stretch;
    width: 100%;
}
.nexus-chatbot-feedback-wrap {
    max-width: 100%;
    padding: 10px 12px;
}
.nexus-chatbot-feedback-lead {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.45;
    color: #444;
}
.nexus-chatbot-feedback-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}
.nexus-chatbot-feedback-label {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: #666;
}
.nexus-chatbot-feedback-form .form-control {
    font-size: 12px;
    border-radius: 6px;
}
.nexus-chatbot-feedback-send {
    align-self: flex-start;
    margin-top: 4px;
}
.nexus-chatbot-feedback-cancel {
    align-self: flex-start;
    margin-top: 4px;
}
.nexus-chatbot-feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.nexus-chatbot-feedback-error {
    margin: 0 0 8px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #a94442;
    background: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}
.nexus-chatbot-feedback-image-hint {
    margin: 4px 0 8px;
    font-size: 11px;
    line-height: 1.35;
}
.nexus-chatbot-feedback-image-preview {
    margin-bottom: 8px;
}
button.is-loading,
.btn.is-loading,
a.is-loading {
    cursor: wait;
    opacity: 0.9;
    pointer-events: none;
}
.btn.is-loading:not(:empty)::before,
button.is-loading:not(:empty)::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nexus-spin .75s linear infinite;
    vertical-align: -2px;
}
.btn-default.is-loading:not(:empty)::before,
.btn-link.is-loading:not(:empty)::before {
    border-color: rgba(150, 0, 0, 0.2);
    border-top-color: var(--fmit-red, #960000);
}
@media (max-width: 991px) {
    body.has-bottom-nav .nexus-chatbot {
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
    }
    body.has-bottom-nav .nexus-chatbot-fab {
        pointer-events: auto;
        position: fixed;
        left: 14px;
        bottom: calc(var(--nexus-bottom-nav-total) + 14px + var(--nexus-float-extra-bottom, 0px));
        z-index: 1050;
    }
    body.has-bottom-nav.has-nexus-chatbot #back2top {
        bottom: calc(var(--nexus-bottom-nav-total) + 68px + var(--nexus-float-extra-bottom, 0px));
        z-index: 1051;
    }
    .nexus-chatbot-fab-label { display: none; }
    .nexus-chatbot-fab {
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
    .nexus-chatbot.is-open .nexus-chatbot-fab { display: none; }
    .nexus-chatbot.is-open .nexus-chatbot-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: min(78vh, 560px);
        border-radius: 16px 16px 0 0;
        pointer-events: auto;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, .18);
    }
    .nexus-chatbot-messages {
        max-height: min(42vh, 320px);
    }
    .nexus-chatbot.is-feedback-open .nexus-chatbot-messages {
        max-height: 40px;
    }
    .nexus-chatbot.is-feedback-open .nexus-chatbot-panel {
        max-height: min(88vh, 640px);
    }
    .nexus-chatbot.is-feedback-open .nexus-chatbot-feedback-slot {
        min-height: 360px;
    }
    .nexus-chatbot-form {
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
    }
}
@media (min-width: 992px) {
    body.has-nexus-chatbot #back2top {
        bottom: 20px;
    }
}

/* ── Pocket / Bookmark ─────────────────────────────────────────── */
.nexus-pocket-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nexus-pocket-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
}
.nexus-pocket-title {
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nexus-pocket-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.nexus-pocket-date {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}
@media (max-width: 767px) {
    .nexus-pocket-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .nexus-pocket-title {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.45;
    }
    .nexus-pocket-meta {
        width: 100%;
        justify-content: space-between;
    }
}
.btn-pocket-toggle { padding: 1px 5px; line-height: 1.4; opacity: .6; }
.btn-pocket-toggle:hover { opacity: 1; }

/* ── MP Activity Heatmap ─────────────────────────────────────── */
.nexus-heatmap-wrap {
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 4px;
}
.nexus-heatmap-grid {
    display: grid;
    grid-template-rows: repeat(7, 13px);
    grid-auto-flow: column;
    gap: 3px;
    width: max-content;
}
.nexus-heatmap-cell {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    display: block;
}
.nexus-heatmap-pad { background: transparent; }
.nexus-heatmap-lv0 { background: #ebedf0; }
.nexus-heatmap-lv1 { background: #ffd6a5; }
.nexus-heatmap-lv2 { background: #ffab40; }
.nexus-heatmap-lv3 { background: #e65100; }
.nexus-heatmap-lv4 { background: #bf360c; }
.nexus-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
}
.nexus-heatmap-legend .nexus-heatmap-cell {
    width: 12px;
    height: 12px;
}

/* Practice mode */
.nexus-practice-stem {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
    margin: 0 0 14px;
    padding: 14px 16px;
    background: #f8f9fa;
    border-left: 3px solid var(--fmit-red);
    border-radius: 0 6px 6px 0;
}
.nexus-practice-opt:hover:not(:disabled) {
    border-color: var(--fmit-red) !important;
    background: #fff8f8 !important;
}
#practice-progress {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}

/* ── PWA install (mobile app) ─────────────────────────────────── */
.nexus-pwa-install-banner {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--nexus-bottom-nav-total) + 10px);
    z-index: 1040;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 36px 12px 12px;
    background: #fff;
    border: 1px solid var(--fmit-red-line);
    border-radius: var(--fmit-radius);
    box-shadow: 0 8px 28px rgba(15, 23, 42, .14);
}
.nexus-pwa-install-banner-icon {
    flex-shrink: 0;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.nexus-pwa-install-banner-text {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    line-height: 1.45;
}
.nexus-pwa-install-banner-title {
    display: block;
    font-size: 13px;
    color: var(--fmit-heading);
    margin-bottom: 2px;
}
.nexus-pwa-install-banner-desc { display: none; color: var(--fmit-muted); }
.nexus-pwa-install-banner.is-android .nexus-pwa-install-banner-desc--android,
.nexus-pwa-install-banner.is-ios .nexus-pwa-install-banner-desc--ios,
.nexus-pwa-install-banner.is-inapp .nexus-pwa-install-banner-desc--inapp {
    display: block;
}
.nexus-pwa-install-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.nexus-pwa-install-banner-actions .btn { white-space: nowrap; }
.nexus-pwa-install-banner.is-ios .nexus-pwa-install-guide-btn,
.nexus-pwa-install-banner.is-inapp .nexus-pwa-install-guide-btn,
.nexus-pwa-install-banner.is-android .nexus-pwa-install-guide-btn {
    display: none;
}
.nexus-pwa-install-banner-close {
    position: absolute;
    top: 4px;
    right: 6px;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: #94a3b8;
    padding: 4px 6px;
}
.nexus-pwa-install-banner-close:hover { color: #475569; }

body.has-nexus-pwa-banner.has-bottom-nav {
    --nexus-float-extra-bottom: 104px;
}
body.has-nexus-pwa-banner.has-bottom-nav #back2top {
    bottom: calc(var(--nexus-bottom-nav-total) + 14px + var(--nexus-float-extra-bottom, 0px));
    z-index: 1051;
}
body.has-nexus-pwa-banner.has-bottom-nav.has-nexus-chatbot #back2top {
    bottom: calc(var(--nexus-bottom-nav-total) + 68px + var(--nexus-float-extra-bottom, 0px));
}
body.has-nexus-pwa-banner.has-bottom-nav .nexus-chatbot-fab {
    bottom: calc(var(--nexus-bottom-nav-total) + 14px + var(--nexus-float-extra-bottom, 0px));
}

.nexus-pwa-guide-lead { margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.nexus-pwa-guide-block {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #fafafa;
    border: 1px solid var(--fmit-border);
    border-radius: 8px;
}
.nexus-pwa-guide-block h5 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--fmit-heading);
}
.nexus-pwa-guide-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--fmit-red);
    border-radius: 999px;
    vertical-align: middle;
}
.nexus-pwa-guide-badge--warn { background: var(--fmit-warning); color: #1a1a1a; }
.nexus-pwa-guide-steps {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.55;
}
.nexus-pwa-guide-steps li + li { margin-top: 4px; }
.nexus-pwa-guide-note { font-size: 12px; margin: 8px 0 0; }
.nexus-pwa-guide-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--fmit-border);
}
.nexus-pwa-guide-preview-icon { border-radius: 12px; }
.nexus-pwa-guide--compact .nexus-pwa-guide-block--inapp { margin-bottom: 0; }
.nexus-pwa-guide-desktop-note {
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}
@media (max-width: 991px) {
    .nexus-pwa-guide--compact .nexus-pwa-guide-desktop-note,
    .nexus-pwa-guide--compact .nexus-pwa-open-guide-modal {
        display: none;
    }
}
.nexus-pwa-profile-card .nexus-pwa-guide-block {
    background: #fff;
    margin-bottom: 10px;
}

@media (min-width: 992px) {
    .nexus-pwa-install-root {
        display: none !important;
    }
    /* Hồ sơ desktop: không cần hướng dẫn cài từng bước — chỉ ghi chú + nút mở modal */
    .nexus-profile-pwa-details .nexus-pwa-guide-platforms {
        display: none !important;
    }
}
@media (max-width: 991px) {
    .nexus-pwa-install-banner-actions {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: 108px;
    }
}
@media (max-width: 380px) {
    .nexus-pwa-install-banner {
        flex-wrap: wrap;
        padding-right: 32px;
    }
    .nexus-pwa-install-banner-actions {
        width: 100%;
        max-width: none;
        flex-direction: row;
    }
}

/* Thi thử / landing — dùng cả trong master layout (không chỉ trang auth) */
.nexus-auth-landing-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 22px;
    padding: 0 !important;
    list-style: none;
}

.nexus-auth-landing-features li {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 14px 12px;
    list-style: none;
    background: var(--fmit-red-soft, #f9f5f5);
    border: 1px solid var(--fmit-red-line, #e8d4d4);
    border-radius: 10px;
    text-align: center;
}

.nexus-auth-landing-features li::before {
    content: "✓";
    display: block;
    width: 26px;
    height: 26px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: var(--fmit-red, #960000);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
}

.nexus-auth-landing-features li span {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--fmit-red, #960000);
}

.nexus-auth-landing-features li small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--fmit-muted, #64748b);
}

/* ── Global motion & result pages ── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nexus-header-h, 64px) + 12px);
}

html.nexus-scroll-top-active {
    scroll-behavior: auto !important;
}

.nexus-result-wrap {
    max-width: 560px;
    margin: 40px auto;
    padding: 28px;
    text-align: center;
    animation: nexus-result-in var(--nexus-duration-slow) var(--nexus-ease-out) both;
}

.nexus-result-wrap--wide {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px;
}

.nexus-result-wrap h1,
.nexus-result-wrap h2 {
    margin-top: 0;
}

.nexus-result-score {
    font-size: 42px;
    font-weight: bold;
    margin: 12px 0;
    line-height: 1.1;
}

.nexus-result-score--pass { color: var(--fmit-green, #2e7d32); }
.nexus-result-score--fail { color: var(--fmit-red, #960000); }

.nexus-result-actions {
    margin-top: 24px;
}

.nexus-result-alert {
    max-width: 520px;
    margin: 16px auto;
    text-align: left;
}

.nexus-result-meta {
    margin: 0 0 14px;
    font-size: 14px;
    color: #444;
}

.nexus-result-note {
    margin: 0 0 20px;
    font-size: 13px;
    color: #666;
    line-height: 1.55;
}

.nexus-share-msg-reveal {
    animation: nexus-share-msg-in var(--nexus-duration-med) var(--nexus-ease-out) both;
}

@keyframes nexus-result-in {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes nexus-share-msg-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Structured onboarding -------------------------------------------------- */
body.nexus-onboarding-open {
    overflow: hidden;
}

.nexus-onboarding-system [hidden] {
    display: none !important;
}

.nexus-onboarding-modal,
.nexus-onboarding-drawer {
    position: fixed;
    inset: 0;
    z-index: 10080;
}

.nexus-onboarding-backdrop,
.nexus-onboarding-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .66);
}

.nexus-onboarding-dialog {
    position: relative;
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    padding: 28px;
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(17, 24, 39, .28);
    outline: 0;
}

.nexus-onboarding-kicker {
    margin: 0 36px 6px 0;
    color: var(--nexus-primary, #960000);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nexus-onboarding-dialog h2,
.nexus-onboarding-drawer h2,
.nexus-onboarding-coach h2 {
    margin: 0 36px 8px 0;
    color: #111827;
    font-size: 24px;
    line-height: 1.25;
}

.nexus-onboarding-description {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
}

.nexus-onboarding-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #4b5563;
    font-size: 28px;
    line-height: 42px;
}

.nexus-onboarding-close:hover,
.nexus-onboarding-close:focus {
    background: #f3f4f6;
    color: #111827;
    outline: 3px solid rgba(150, 0, 0, .18);
}

.nexus-onboarding-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px;
}

.nexus-onboarding-actions .btn {
    min-height: 44px;
    padding: 10px 16px;
}

.nexus-onboarding-value-list,
.nexus-onboarding-release-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.nexus-onboarding-value-list li,
.nexus-onboarding-release-list li {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
}

.nexus-onboarding-value-list strong,
.nexus-onboarding-value-list span,
.nexus-onboarding-release-list strong,
.nexus-onboarding-release-list span {
    display: block;
}

.nexus-onboarding-value-list span,
.nexus-onboarding-release-list span {
    margin-top: 3px;
    color: #4b5563;
    line-height: 1.5;
}

.nexus-onboarding-goals {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.nexus-onboarding-goals button {
    min-height: 70px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    text-align: left;
}

.nexus-onboarding-goals button:hover,
.nexus-onboarding-goals button:focus {
    border-color: var(--nexus-primary, #960000);
    background: #fff8f8;
    outline: 3px solid rgba(150, 0, 0, .14);
}

.nexus-onboarding-goals strong,
.nexus-onboarding-goals span {
    display: block;
}

.nexus-onboarding-goals span {
    margin-top: 3px;
    color: #4b5563;
    font-size: 14px;
}

.nexus-onboarding-coach {
    position: fixed;
    inset: 0;
    z-index: 10060;
    pointer-events: none;
}

.nexus-onboarding-coach-card {
    position: fixed;
    width: min(370px, calc(100% - 32px));
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(17, 24, 39, .28);
    outline: 0;
    pointer-events: auto;
}

.nexus-onboarding-coach-card h2 {
    font-size: 19px;
}

.nexus-onboarding-coach-card > p:not(.nexus-onboarding-step-count) {
    margin: 0;
    color: #4b5563;
    line-height: 1.55;
}

.nexus-onboarding-step-count {
    margin: 0 36px 5px 0;
    color: var(--nexus-primary, #960000);
    font-size: 12px;
    font-weight: 800;
}

.nexus-onboarding-target {
    position: relative !important;
    z-index: 10050 !important;
    border-radius: 8px;
    outline: 4px solid #fff !important;
    box-shadow:
        0 0 0 8px rgba(150, 0, 0, .88),
        0 0 0 9999px rgba(17, 24, 39, .64) !important;
}

.nexus-onboarding-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(440px, 100%);
    height: 100%;
    padding: 24px;
    overflow: auto;
    background: #fff;
    box-shadow: -18px 0 50px rgba(17, 24, 39, .25);
    outline: 0;
}

.nexus-onboarding-drawer-head {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding-right: 36px;
}

.nexus-onboarding-progress {
    height: 8px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.nexus-onboarding-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--nexus-primary, #960000);
    transition: width .25s ease;
}

.nexus-onboarding-progress-copy {
    margin: 8px 0 0;
    color: #4b5563;
    font-size: 13px;
}

.nexus-onboarding-checklist {
    display: grid;
    gap: 9px;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.nexus-onboarding-checklist li {
    display: flex;
    gap: 10px;
    min-height: 66px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.nexus-onboarding-checklist li.is-complete {
    border-color: #bbdfc6;
    background: #f2fbf4;
}

.nexus-onboarding-check-icon {
    flex: 0 0 26px;
    color: #166534;
    font-size: 22px;
    font-weight: 800;
    line-height: 24px;
    text-align: center;
}

.nexus-onboarding-checklist a {
    display: block;
    color: #111827;
    text-decoration: none;
}

.nexus-onboarding-checklist a:hover strong,
.nexus-onboarding-checklist a:focus strong {
    color: var(--nexus-primary, #960000);
    text-decoration: underline;
}

.nexus-onboarding-checklist strong,
.nexus-onboarding-checklist span {
    display: block;
}

.nexus-onboarding-checklist span {
    margin-top: 3px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.4;
}

.nexus-onboarding-drawer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.nexus-onboarding-help-link {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nexus-onboarding-resume {
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--nexus-safe-bottom, 0px));
    z-index: 10040;
    display: flex;
    width: min(440px, calc(100% - 32px));
    padding: 14px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e4bcbc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(17, 24, 39, .2);
}

.nexus-onboarding-resume[hidden] {
    display: none;
}

.nexus-onboarding-resume strong,
.nexus-onboarding-resume span {
    display: block;
}

.nexus-onboarding-resume span {
    margin-top: 2px;
    color: #4b5563;
    font-size: 13px;
}

.nexus-onboarding-resume-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}

.nexus-onboarding-count {
    min-width: 38px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 767px) {
    .nexus-onboarding-dialog {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 24px);
        margin: 0;
        padding: 24px 18px calc(20px + var(--nexus-safe-bottom, 0px));
        border-radius: 20px 20px 0 0;
    }

    .nexus-onboarding-dialog h2 {
        font-size: 21px;
    }

    .nexus-onboarding-actions {
        flex-wrap: wrap;
    }

    .nexus-onboarding-actions .btn-primary {
        flex: 1 1 140px;
    }

    .nexus-onboarding-coach-card {
        top: auto !important;
        right: 0 !important;
        bottom: 0;
        left: 0 !important;
        width: 100%;
        max-height: min(42vh, 320px);
        overflow: auto;
        padding: 20px 18px calc(18px + var(--nexus-safe-bottom, 0px));
        border-radius: 18px 18px 0 0;
    }

    .nexus-onboarding-drawer-panel {
        top: auto;
        bottom: 0;
        width: 100%;
        height: min(84vh, 720px);
        padding: 22px 18px calc(18px + var(--nexus-safe-bottom, 0px));
        border-radius: 20px 20px 0 0;
    }

    .nexus-onboarding-target {
        scroll-margin-top: calc(var(--nexus-header-h, 56px) + 16px);
        scroll-margin-bottom: min(42vh, 320px);
    }

    .nexus-onboarding-resume {
        right: 12px;
        bottom: calc(var(--nexus-bottom-nav-total, 72px) + 10px);
        left: 12px;
        width: auto;
        align-items: flex-start;
    }

    .nexus-onboarding-resume-actions {
        flex-direction: column;
    }
}

@media (forced-colors: active) {
    .nexus-onboarding-target {
        outline: 4px solid Highlight !important;
    }
}

.nexus-onboarding-dashboard-card[hidden] {
    display: none !important;
}

.nexus-onboarding-dashboard-card {
    display: flex;
    width: 100%;
    min-height: 64px;
    margin-bottom: 16px;
    padding: 14px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #fff 0%, #fff8f8 100%);
    color: #111827;
    text-align: left;
}

.nexus-onboarding-dashboard-card:hover,
.nexus-onboarding-dashboard-card:focus {
    border-color: var(--nexus-primary, #960000);
    outline: 3px solid rgba(150, 0, 0, .12);
}

.nexus-onboarding-dashboard-card strong,
.nexus-onboarding-dashboard-card small {
    display: block;
}

.nexus-onboarding-dashboard-card small {
    margin-top: 3px;
    color: #4b5563;
    font-weight: 400;
}

.nexus-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.nexus-search-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 640px;
    margin: 12px auto 0;
    color: #6b7280;
    font-size: 12px;
}

.nexus-help-onboarding {
    margin: 18px 0 24px;
    padding: 18px;
    border: 1px solid #ead1d1;
    border-radius: 14px;
    background: #fffafa;
}

.nexus-help-onboarding-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.nexus-help-onboarding-head h3,
.nexus-help-onboarding-head p {
    margin: 0;
}

.nexus-help-onboarding-head p {
    margin-top: 4px;
    color: #4b5563;
}

.nexus-help-tour-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.nexus-help-tour-grid a {
    display: block;
    min-height: 64px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    text-decoration: none;
}

.nexus-help-tour-grid a:hover,
.nexus-help-tour-grid a:focus {
    border-color: var(--nexus-primary, #960000);
    outline: 3px solid rgba(150, 0, 0, .12);
}

.nexus-help-tour-grid strong,
.nexus-help-tour-grid span {
    display: block;
}

.nexus-help-tour-grid span {
    margin-top: 3px;
    color: #4b5563;
    font-size: 13px;
}

.nexus-help-search {
    margin: 0 0 24px;
}

.nexus-help-search label {
    margin-bottom: 6px;
}

@media (max-width: 640px) {
    .nexus-help-onboarding-head {
        display: block;
    }

    .nexus-help-onboarding-head .btn {
        margin-top: 12px;
    }

    .nexus-help-tour-grid {
        grid-template-columns: 1fr;
    }
}
