:root {
    --nav-accent: #3474e6;
    --nav-accent-soft: #edf4ff;
    --nav-ink: #26364d;
    --nav-muted: #8793a3;
    --nav-border: #e8edf3;
}

body.app-body {
    display: flex;
    align-items: flex-start;
    min-width: 320px;
    min-height: 100vh;
    background: #f7f9fc;
    color: #283447;
    font-family: "DM Sans", "Segoe UI", sans-serif;
}

.app-sidebar {
    --bs-offcanvas-width: 264px;
    width: 264px;
    min-width: 264px;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    position: fixed;
    top: 0;
    left: 0;
    padding: 21px 15px 13px;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow: hidden;
    background: #fff;
    border-right: 1px solid var(--nav-border);
    color: var(--nav-ink);
    z-index: 1045;
}

.sidebar-brand-row { min-height: 46px; padding: 0 7px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-brand { display: inline-flex; align-items: center; gap: 10px; color: #26364d; text-decoration: none; }
.sidebar-brand:hover { color: var(--nav-accent); }
.sidebar-logo { width: 35px; height: 35px; display: grid; place-items: center; color: #fff; background: var(--nav-accent); border-radius: 10px; font-size: 18px; box-shadow: 0 4px 10px #3474e629; }
.sidebar-brand-name { font-family: Manrope, "Segoe UI", sans-serif; font-weight: 800; font-size: 16px; letter-spacing: -.45px; }
.sidebar-caption { margin: 36px 10px 10px; color: #a0aab7; font-size: 10px; letter-spacing: 1.1px; font-weight: 700; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 11px; border-radius: 9px; color: #657286; text-decoration: none; font-size: 13px; font-weight: 600; transition: color .15s ease, background-color .15s ease; }
.sidebar-link:hover { color: var(--nav-accent); background: #f5f8fd; }
.sidebar-link.active { color: var(--nav-accent); background: var(--nav-accent-soft); font-weight: 700; }
.sidebar-link.active::before { position: absolute; content: ""; left: -15px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--nav-accent); }
.sidebar-link-icon { width: 19px; text-align: center; font-size: 16px; }
.sidebar-link-disabled { cursor: default; color: #99a4b2; }
.sidebar-link-disabled:hover { color: #99a4b2; background: transparent; }
.coming-soon { margin-left: auto; padding: 3px 6px; border-radius: 5px; background: #f3f5f8; color: #8793a3; font-size: 9px; font-weight: 600; white-space: nowrap; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 13px 5px 5px; border-top: 1px solid #eef1f5; }
.profile-avatar { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #dae7fb; border-radius: 50%; background: #edf4ff; color: #3474e6; font-size: 13px; font-weight: 700; }
.profile-copy { min-width: 0; display: grid; gap: 2px; }
.profile-name { color: #334259; font-size: 11px; font-weight: 700; }
.profile-role { color: #929dad; font-size: 10px; }
.logout-form { margin-left: auto; }
.logout-button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #8793a3; font-size: 17px; }
.logout-button:hover { background: #fff0ef; color: #c2514d; }

.app-main { flex: 1 1 auto; width: calc(100% - 264px); min-width: 0; min-height: 100vh; margin-left: 264px; }
.app-topbar { min-height: 66px; padding: 0 26px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid #e9edf3; background: #fff; }
.app-topbar-title { color: #2c3b52; font-family: Manrope, "Segoe UI", sans-serif; font-size: 15px; font-weight: 700; }
.app-topbar-actions { margin-left: auto; }
.app-menu-toggle { width: 37px; height: 36px; padding: 0; color: #56657a; font-size: 20px; border: 1px solid #e4e9f0; }
.sidebar-backdrop { display: none; }
.app-page { min-width: 0; padding: 22px; }
.topbar-actions { gap: 9px; }

.course-workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 110px); overflow: hidden; border: 1px solid #e7ecf2; border-radius: 13px; background: #fff; box-shadow: 0 5px 18px #26364d08; }
.course-navigator { min-width: 0; padding: 23px 14px 15px 18px; display: flex; flex-direction: column; border-right: 1px solid #e9edf2; background: #fbfcfe; }
.course-navigator .sidebar-heading { padding: 0 4px; }
.course-navigator .sidebar-hint { margin-bottom: 17px; }
.course-navigator #course-tree { max-height: calc(100vh - 265px); overflow: auto; }
.course-navigator .tree-row { min-width: 0; }
.course-navigator .tree-toggle { flex: 0 0 19px; }
.course-navigator .tree-add { min-height: 24px; padding: 0 4px; font-size: 9px; }
.course-navigator .tree-move { width: 16px; flex: 0 0 16px; }
.course-workspace .content { padding: clamp(22px, 4vw, 48px); }
.course-workspace .welcome-card { padding-top: 34px; }
.course-workspace .sidebar-footer { padding-top: 13px; }
.course-workspace .tree-empty-branch { padding-left: 3px; }

.management-page { width: 100%; max-width: 1080px; margin: 0 auto; }
.management-heading { margin-bottom: 23px; }
.management-heading .eyebrow { color: #8390a2; }
.management-heading h1 { margin: 0 0 7px; color: #27364c; font: 700 clamp(23px, 3vw, 30px)/1.2 Manrope, "Segoe UI", sans-serif; letter-spacing: -.75px; }
.management-heading p { max-width: 650px; margin: 0; color: #7c899b; font-size: 13px; line-height: 1.65; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.stat-card, .management-card { padding: 20px; border: 1px solid #e8edf3; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px #26364d06; }
.stat-card { display: flex; align-items: center; gap: 13px; }
.stat-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: 11px; background: #edf4ff; color: var(--nav-accent); font-size: 18px; }
.stat-card:nth-child(2) .stat-icon { background: #eef7f2; color: #42906b; }
.stat-card:nth-child(3) .stat-icon { background: #fff5e9; color: #c48336; }
.stat-value { display: block; color: #2d3d54; font: 700 23px Manrope, sans-serif; }
.stat-label { display: block; color: #8390a1; font-size: 11px; margin-top: 2px; }
.management-card { margin-top: 16px; }
.management-card h2 { color: #2c3b52; font: 700 15px Manrope, sans-serif; margin: 0 0 7px; }
.management-card p { color: #7b899a; font-size: 12px; line-height: 1.65; margin: 0; }
.primary-link { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; margin-top: 16px; padding: 0 13px; border-radius: 8px; background: var(--nav-accent); color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; }
.primary-link:hover { color: #fff; background: #2863ca; }
.chapter-table { width: 100%; border-collapse: collapse; }
.chapter-table th { padding: 10px; color: #8793a3; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .8px; border-bottom: 1px solid #edf0f4; }
.chapter-table td { padding: 13px 10px; color: #536176; font-size: 12px; border-bottom: 1px solid #f0f2f6; }
.chapter-table tr:last-child td { border-bottom: 0; }
.chapter-title { color: #2f3f55; font-weight: 700; }
.table-empty { padding: 34px 12px !important; color: #8793a3 !important; text-align: center; }
.management-card .settings-row { display: flex; justify-content: space-between; gap: 18px; padding: 13px 0; border-bottom: 1px solid #f0f2f6; color: #526176; font-size: 12px; }
.settings-row:last-child { border-bottom: 0; }
.settings-row span:last-child { color: #8390a1; }

.catalog-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; }
.catalog-summary { display: flex; align-items: center; gap: 8px; margin: 22px 2px 13px; color: #8793a3; font-size: 11px; }
.catalog-summary-dot { width: 4px; height: 4px; border-radius: 50%; background: #c2cad4; }
.chapter-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 17px; }
.catalog-action { flex: 0 0 auto; margin: 0 0 3px; border: 0; cursor: pointer; }
.catalog-section { margin-top: 24px; }
.catalog-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.catalog-section-heading .eyebrow { margin-bottom: 3px; color: #8a96a6; }
.catalog-section-heading h2 { margin: 0; color: #2c3b52; font: 700 19px Manrope, sans-serif; }
.catalog-count { color: #8390a1; font-size: 11px; }
.course-gallery { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.course-card-container { position: relative; min-width: 0; }
.course-card-container .course-card-link { height: 100%; }
.course-delete-button { position: absolute; z-index: 2; top: 9px; right: 9px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #ffffffb8; border-radius: 9px; background: #fff; color: #a43a32; box-shadow: 0 2px 8px #1c2c431a; cursor: pointer; }
.course-delete-button:hover { border-color: #f1c5c1; background: #fff5f4; color: #8f241d; }
.course-delete-button:disabled { cursor: wait; opacity: .65; }
.course-delete-error { margin: 13px 0 0; color: #b42318; font-size: 12px; }
.topic-quiz-help, .topic-quiz-no-available { margin: -4px 0 14px; color: #8190a3; font-size: 11px; line-height: 1.6; }
.topic-quiz-empty { min-height: 0; margin: 0 0 14px; padding: 18px; display: flex; align-items: center; gap: 12px; text-align: left; }
.topic-quiz-empty .catalog-empty-icon { width: 40px; height: 40px; flex: 0 0 40px; margin: 0; font-size: 18px; }
.topic-quiz-empty h3 { margin: 0 0 3px; color: #2c3b52; font: 700 13px Manrope, sans-serif; }
.topic-quiz-empty p { margin: 0; color: #8390a1; font-size: 11px; }
.topic-assigned-quizzes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 16px; }
.topic-assigned-quiz { min-width: 0; padding: 11px; display: flex; align-items: center; gap: 10px; border: 1px solid #e7ecf2; border-radius: 10px; background: #fff; box-shadow: 0 4px 14px #26364d06; }
.topic-assigned-quiz .quiz-card-icon { flex: 0 0 36px; width: 36px; height: 36px; }
.topic-assigned-quiz-copy { min-width: 0; flex: 1; }
.topic-assigned-quiz-copy strong, .topic-assigned-quiz-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-assigned-quiz-copy strong { color: #34445b; font-size: 11px; }
.topic-assigned-quiz-copy small { margin-top: 3px; color: #8793a3; font-size: 10px; }
.topic-assigned-quiz-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.topic-assigned-quiz-action { min-height: 30px; padding: 0 9px; border-radius: 7px; font-size: 10px; }
.topic-quiz-delete-button { min-height: 30px; padding: 0 9px; border: 1px solid #f0c5c4; border-radius: 7px; background: #fff5f4; color: #b42318; font-size: 10px; font-weight: 700; cursor: pointer; }
.topic-quiz-delete-button:hover { background: #feeceb; }
.topic-unassign-quiz { width: 29px; height: 29px; flex: 0 0 29px; border: 0; border-radius: 7px; background: transparent; color: #8995a5; cursor: pointer; }
.topic-unassign-quiz:hover { background: #fff0ef; color: #a43a32; }
.topic-quiz-assign-form { display: flex; align-items: flex-end; gap: 10px; max-width: 600px; }
.topic-quiz-select-wrap { min-width: 0; flex: 1; }
.topic-quiz-select-wrap .course-name-input { width: 100%; }
.topic-quiz-assign-form .primary-link { flex: 0 0 auto; margin: 0; border: 0; cursor: pointer; }
.topic-quiz-assign-form .primary-link:disabled, .topic-unassign-quiz:disabled { cursor: wait; opacity: .6; }
.topic-quiz-no-available a { margin-left: 4px; color: #3474e6; font-weight: 700; }
.topic-quiz-error { margin: 12px 0 0; color: #b42318; font-size: 11px; }
.course-card-link { display: block; color: inherit; text-decoration: none; }
.course-card-link:hover { color: inherit; }
.chapter-card-item { display: flex; flex-direction: column; gap: 8px; }
.course-card-link .chapter-card { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.course-card-link:hover .chapter-card { border-color: #c7d8f4; box-shadow: 0 10px 24px #26364d12; transform: translateY(-2px); }
.chapter-card-actions { display: flex; justify-content: flex-end; gap: 8px; }
.chapter-card-action { min-height: 30px; padding: 0 10px; border-radius: 7px; font-size: 10px; }
.node-delete-button { min-height: 30px; padding: 0 10px; border: 1px solid #f0c5c4; border-radius: 7px; background: #fff5f4; color: #b42318; font-size: 10px; font-weight: 700; cursor: pointer; }
.node-delete-button:hover { background: #feeceb; }
.course-back-link { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 20px; color: #63738a; text-decoration: none; font-size: 12px; font-weight: 600; }
.course-back-link:hover { color: #4779cf; }
.course-detail-heading { display: flex; align-items: center; gap: 21px; padding: 18px; border: 1px solid #e7ecf2; border-radius: 13px; background: #fff; box-shadow: 0 4px 14px #26364d06; }
.course-detail-thumbnail { width: 190px; height: 125px; flex: 0 0 190px; border-radius: 10px; }
.course-detail-copy .eyebrow { margin-bottom: 5px; color: #8390a2; }
.course-detail-copy h1 { margin: 0 0 7px; color: #27364c; font: 700 clamp(22px, 3vw, 29px)/1.2 Manrope, "Segoe UI", sans-serif; letter-spacing: -.6px; }
.course-detail-copy > p:last-child { margin: 0; color: #7c899b; font-size: 12px; }
.course-card-open { display: inline-flex; align-items: center; gap: 5px; color: #4779cf; font-size: 10px; font-weight: 700; }
.quiz-library-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin: 22px 0 27px; }
.quiz-summary-card { min-height: 78px; padding: 15px 17px; display: flex; align-items: center; gap: 13px; border: 1px solid #e8edf3; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px #26364d06; }
.quiz-summary-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 11px; background: #edf4ff; color: #4779cf; font-size: 17px; }
.quiz-summary-icon-green { background: #eef7f2; color: #42906b; }
.quiz-summary-card strong, .quiz-summary-card small { display: block; }
.quiz-summary-card strong { color: #2d3d54; font: 700 18px Manrope, sans-serif; }
.quiz-summary-card small { margin-top: 2px; color: #8390a1; font-size: 10px; }
.quiz-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 15px; }
.quiz-card { min-width: 0; padding: 17px; border: 1px solid #e7ecf2; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px #26364d06; }
.quiz-card-top { display: flex; align-items: center; justify-content: space-between; }
.quiz-card-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: #edf4ff; color: #4779cf; font-size: 17px; }
.quiz-more-button { width: 31px; height: 31px; border: 0; border-radius: 8px; background: transparent; color: #93a0b0; }
.quiz-more-button:hover { background: #fff0ef; color: #b42318; }
.quiz-card h3 { overflow: hidden; margin: 13px 0 9px; color: #2c3b52; font: 700 15px/1.4 Manrope, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.quiz-card-meta { display: flex; flex-wrap: wrap; gap: 11px; color: #8592a3; font-size: 10px; }
.quiz-topic-chips { min-height: 29px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 12px; }
.quiz-topic-chip { max-width: 150px; overflow: hidden; padding: 4px 7px; border-radius: 5px; background: #f1f5fb; color: #65758b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quiz-unlinked { color: #a0a9b5; font-size: 10px; font-style: italic; }
.quiz-card-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; margin-top: 15px; }
.quiz-edit-button, .quiz-take-button { min-height: 35px; border: 1px solid #e1e7ef; border-radius: 7px; background: #fff; color: #5e6f85; font-size: 11px; font-weight: 600; }
.quiz-take-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none; }
.quiz-edit-button:hover { border-color: #c6d7f3; color: #3474e6; background: #f7faff; }
.quiz-take-button { border-color: #3474e6; background: #3474e6; color: #fff; }
.quiz-take-button:hover { border-color: #2863ca; background: #2863ca; }
.quiz-attempts-button { width: 100%; margin-top: 11px; padding: 10px 0 0; display: flex; align-items: center; justify-content: space-between; border: 0; border-top: 1px solid #eef1f5; background: transparent; color: #8190a3; font-size: 10px; text-align: left; }
.quiz-attempts-button:hover { color: #3474e6; }
.quiz-page-error { margin-top: 14px; color: #b42318; font-size: 12px; }
.quiz-dialog { width: min(610px, calc(100% - 28px)); }
.quiz-editor-dialog { width: min(760px, calc(100% - 28px)); }
.quiz-prompt-page .management-heading { margin-bottom: 22px; }
.quiz-prompt-card { max-width: 850px; margin-top: 17px; padding: 22px; border: 1px solid #e7ecf2; border-radius: 13px; background: #fff; box-shadow: 0 4px 14px #26364d06; }
.quiz-prompt-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.quiz-prompt-card-heading h2 { margin: 0; color: #2c3b52; font: 700 16px Manrope, sans-serif; }
.quiz-prompt-card-heading p { margin: 4px 0 0; color: #8390a1; font-size: 11px; line-height: 1.6; }
.quiz-prompt-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.quiz-prompt-form .course-name-input { width: 100%; }
.quiz-prompt-help { display: block; margin-top: 6px; color: #8390a1; font-size: 10px; }
.quiz-prompt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 19px; }
.quiz-prompt-actions .primary-link { margin: 0; border: 0; cursor: pointer; }
.quiz-prompt-actions .primary-link:disabled { cursor: wait; opacity: .7; }
.quiz-prompt-empty p { margin: 0 0 14px; color: #6f7d90; font-size: 12px; }
.quiz-prompt-empty .primary-link { margin: 0; }
.quiz-prompt-errors { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #f2c9c5; border-radius: 8px; background: #fff7f6; color: #a43a32; font-size: 11px; }
.quiz-prompt-errors p { margin: 0 0 5px; font-weight: 700; }
.quiz-prompt-errors ul { margin: 0; padding-left: 18px; }
.quiz-prompt-result { margin-top: 18px; }
.quiz-prompt-textarea { width: 100%; min-height: 360px; resize: vertical; padding: 13px; border: 1px solid #e1e7ef; border-radius: 8px; background: #fbfcfe; color: #45546a; font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.quiz-prompt-copy-status { color: #42906b; font-size: 11px; }
.quiz-json-label { display: block; margin-top: 17px; }
.quiz-json-textarea { min-height: 280px; }
.quiz-json-import .quiz-prompt-actions { margin-bottom: 0; }
.quiz-json-error { margin: 11px 0 0; color: #b42318; font-size: 11px; }
.quiz-json-success { margin: 11px 0 0; color: #39856a; font-size: 11px; }
.quiz-json-success a { margin-left: 4px; color: #3474e6; font-weight: 700; }
.quiz-json-library-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 13px; border: 1px solid #e1e7ef; border-radius: 8px; color: #5e6f85; font-size: 12px; font-weight: 600; text-decoration: none; }
.quiz-json-library-link:hover { border-color: #c6d7f3; color: #3474e6; }
.quiz-question-explanation { margin: 10px 0 0; padding: 9px 10px; border-radius: 6px; background: #f5f8fc; color: #66758a; font-size: 11px; line-height: 1.6; }
@media (max-width: 600px) {
    .quiz-prompt-card { padding: 17px; }
    .quiz-prompt-fields { grid-template-columns: 1fr; gap: 13px; }
    .topic-quiz-assign-form { align-items: stretch; flex-direction: column; }
    .topic-quiz-assign-form .primary-link { align-self: flex-start; }
}
.quiz-topic-picker { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.quiz-picker-help { margin: -3px 0 9px; color: #8b97a7; font-size: 10px; }
.quiz-topic-options { max-height: 175px; display: grid; gap: 5px; overflow: auto; padding: 7px; border: 1px solid #e6ebf1; border-radius: 8px; background: #fbfcfe; }
.quiz-topic-choice { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 6px; color: #526176; cursor: pointer; font-size: 11px; }
.quiz-topic-choice:hover { background: #f0f5fd; }
.quiz-topic-choice input { flex: 0 0 auto; accent-color: #3474e6; }
.quiz-topic-choice span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-topic-type { flex: 0 0 auto; margin-left: auto; color: #94a0ae; font-size: 8px; font-weight: 700; }
.quiz-no-topics, .quiz-no-questions { margin: 0; padding: 13px; color: #8491a2; font-size: 11px; }
.quiz-editor-dialog #quiz-details-form > .course-dialog-actions { margin-top: 12px; }
.quiz-question-editor { margin-top: 22px; padding-top: 18px; border-top: 1px solid #edf0f4; }
.quiz-question-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.quiz-question-heading h3 { margin: 0; color: #2c3b52; font: 700 14px Manrope, sans-serif; }
.quiz-question-heading .secondary-action { min-height: 32px; font-size: 10px; }
.quiz-question-list { display: grid; gap: 9px; }
.quiz-question-card { padding: 12px; border: 1px solid #e8edf3; border-radius: 9px; background: #fff; }
.quiz-question-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.quiz-question-number { color: #8a97a8; font-size: 9px; font-weight: 700; letter-spacing: .65px; }
.quiz-question-actions { display: flex; gap: 5px; }
.quiz-question-action { padding: 4px 7px; border: 0; border-radius: 5px; background: #f2f5f9; color: #65758a; font-size: 9px; }
.quiz-question-action.is-danger { background: #fff3f1; color: #b54742; }
.quiz-question-card-prompt { margin: 9px 0; color: #36465c; font-size: 12px; font-weight: 600; white-space: pre-wrap; }
.quiz-question-answer { display: flex; align-items: center; gap: 8px; margin-top: 5px; color: #78869a; font-size: 10px; }
.quiz-question-answer .question-option-letter { width: 19px; height: 19px; }
.quiz-question-answer.is-correct { color: #37805b; }
.correct-answer-label { margin-left: auto; color: #37805b; font-size: 9px; font-weight: 700; }
.question-dialog { width: min(620px, calc(100% - 28px)); }
.question-textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.question-options { display: grid; gap: 8px; margin: 17px 0 0; padding: 0; border: 0; }
.question-options legend span { color: #919dad; font-weight: 400; }
.question-option-row { display: grid; grid-template-columns: 18px 26px minmax(0, 1fr); align-items: center; gap: 8px; }
.question-option-row > input[type="radio"] { accent-color: #3474e6; }
.question-option-letter { width: 23px; height: 23px; flex: 0 0 23px; display: inline-grid; place-items: center; border-radius: 7px; background: #eff4fc; color: #577bb6; font-size: 9px; font-weight: 700; }
.question-option-row .course-name-input { height: 36px; font-size: 11px; }
.quiz-play-dialog { width: min(640px, calc(100% - 28px)); }
.quiz-play-question { margin: 10px 0 18px; color: #2d3d54; font: 700 18px/1.5 Manrope, sans-serif; white-space: pre-wrap; }
.quiz-play-options { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.quiz-play-option { min-height: 47px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid #e5eaf1; border-radius: 9px; color: #53647a; cursor: pointer; font-size: 12px; }
.quiz-play-option:hover, .quiz-play-option.is-selected { border-color: #9ab6e7; background: #f5f8fe; }
.quiz-play-option input { accent-color: #3474e6; }
.quiz-play-option-text { flex: 1; }
.quiz-play-actions { display: flex; justify-content: space-between; gap: 9px; margin-top: 20px; }
.quiz-play-actions button { margin: 0; }
.quiz-play-actions .primary-link { border: 0; cursor: pointer; }
.quiz-result-summary { margin: 7px 0 17px; padding: 16px; display: flex; align-items: baseline; gap: 12px; border-radius: 10px; background: #edf4ff; color: #3474e6; }
.quiz-result-summary strong { font: 700 25px Manrope, sans-serif; }
.quiz-result-summary span { color: #65758a; font-size: 12px; }
.quiz-result-answer { margin-top: 10px; padding: 13px; border: 1px solid #e5eaf1; border-left: 3px solid #d18b42; border-radius: 8px; }
.quiz-result-answer.is-correct { border-left-color: #43936e; }
.quiz-result-status { color: #bd813c; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.quiz-result-answer.is-correct .quiz-result-status { color: #39856a; }
.quiz-result-answer h3 { margin: 7px 0 9px; color: #394960; font: 600 12px/1.5 "DM Sans", sans-serif; }
.quiz-result-choice { margin: 4px 0; color: #8491a2; font-size: 10px; }
.quiz-result-choice.is-answer-key { color: #37805b; font-weight: 700; }
.quiz-result-choice.is-your-answer:not(.is-answer-key) { color: #b54742; text-decoration: underline; }
.quiz-result-close { margin-top: 14px; border: 0; cursor: pointer; }
.quiz-attempt-list { display: grid; gap: 8px; }
.quiz-attempt-row { display: grid; grid-template-columns: 1fr 50px 1.6fr; align-items: center; gap: 9px; padding: 12px; border: 1px solid #e8edf3; border-radius: 8px; color: #728197; font-size: 10px; }
.quiz-attempt-score { color: #33445b; font-size: 12px; }
.quiz-attempt-row time { text-align: right; }
.course-thumb-blue { background: linear-gradient(135deg, #e9f0ff, #dfeaff); color: #4779cf; }
.course-thumb-green { background: linear-gradient(135deg, #e5f4ef, #cfe9dd); color: #39856a; }
.course-thumb-amber { background: linear-gradient(135deg, #fff1df, #f8dfbd); color: #bd813c; }
.course-thumb-violet { background: linear-gradient(135deg, #f1eaff, #dfd4f7); color: #7862b4; }
.course-thumb-teal { background: linear-gradient(135deg, #e4f2f7, #cce5ed); color: #39819b; }
.course-thumbnail.course-thumb-blue .thumbnail-shape,
.course-thumbnail.course-thumb-green .thumbnail-shape,
.course-thumbnail.course-thumb-amber .thumbnail-shape,
.course-thumbnail.course-thumb-violet .thumbnail-shape,
.course-thumbnail.course-thumb-teal .thumbnail-shape { color: inherit; }
.catalog-empty-compact { min-height: 80px; padding: 16px 20px; }
.catalog-empty-compact p { text-align: center; }
.course-dialog { width: min(520px, calc(100% - 28px)); max-width: 520px; max-height: calc(100% - 28px); padding: 25px; overflow: auto; border: 1px solid #e5eaf1; border-radius: 16px; background: #fff; color: #2c3b52; box-shadow: 0 24px 70px #1b2a4033; }
.course-dialog::backdrop { background: #17263b80; backdrop-filter: blur(2px); }
.course-dialog-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
.course-dialog-heading .eyebrow { margin-bottom: 6px; color: #4e7fd2; font-size: 10px; font-weight: 700; letter-spacing: .9px; }
.course-dialog-heading h2 { margin: 0 0 6px; font: 700 21px Manrope, sans-serif; }
.course-dialog-heading p:last-child { margin: 0; color: #8390a1; font-size: 12px; }
.dialog-close { width: 32px; height: 32px; flex: 0 0 32px; border: 0; border-radius: 9px; background: #f2f5f9; color: #65748a; }
.course-form-label { display: block; margin-bottom: 8px; color: #4d5d73; font-size: 11px; font-weight: 700; }
.course-name-input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #dfe5ed; border-radius: 8px; outline: 0; color: #2d3d54; font-size: 13px; }
.course-name-input:focus { border-color: #79a0e6; box-shadow: 0 0 0 3px #4779cf1a; }
.thumbnail-picker { min-width: 0; margin: 21px 0 0; padding: 0; border: 0; }
.thumbnail-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.thumbnail-option { min-width: 0; display: grid; justify-items: center; gap: 6px; color: #738197; cursor: pointer; font-size: 10px; }
.thumbnail-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.thumbnail-option-preview { width: 100%; height: 64px; display: grid; place-items: center; border: 2px solid transparent; border-radius: 9px; font-size: 21px; transition: border-color .15s ease, transform .15s ease; }
.thumbnail-option input:checked + .thumbnail-option-preview { border-color: currentColor; transform: translateY(-2px); }
.thumbnail-option input:focus-visible + .thumbnail-option-preview { outline: 2px solid #4779cf; outline-offset: 2px; }
.course-form-error { margin: 15px 0 0; color: #b42318; font-size: 12px; }
.course-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.course-dialog-actions .primary-link { margin: 0; border: 0; cursor: pointer; }
.course-dialog-actions .primary-link:disabled { cursor: wait; opacity: .65; }
.secondary-action { min-height: 38px; padding: 0 13px; border: 1px solid #dfe5ed; border-radius: 8px; background: #fff; color: #607086; font-size: 12px; font-weight: 600; }
.thumbnail-upload-label { display: inline-flex; align-items: center; gap: 7px; width: fit-content; margin-top: 13px; padding: 9px 11px; border: 1px dashed #cbd5e2; border-radius: 8px; color: #53647a; cursor: pointer; font-size: 11px; font-weight: 600; }
.thumbnail-upload-label:hover { border-color: #7fa2e0; color: #3474e6; background: #f7faff; }
.thumbnail-upload-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.thumbnail-upload-input:focus-visible + .thumbnail-upload-label { outline: 2px solid #4779cf; outline-offset: 2px; }
.thumbnail-upload-help { margin: 6px 0 0; color: #8b97a7; font-size: 10px; }
.thumbnail-upload-preview { max-width: 100%; max-height: 120px; margin-top: 10px; border: 1px solid #e5eaf1; border-radius: 8px; object-fit: cover; }
.chapter-thumbnail.has-image { background: #eef2f7; }
.chapter-thumbnail.has-image > img { width: 100%; height: 100%; object-fit: cover; }
.course-detail-thumbnail.has-image { overflow: hidden; }
.course-detail-thumbnail.has-image > img { width: 100%; height: 100%; object-fit: cover; }
.chapter-card { overflow: hidden; border: 1px solid #e7ecf2; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px #26364d06; }
.chapter-thumbnail { position: relative; height: 152px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #e9f0ff, #dfeaff); }
.thumbnail-1 { background: linear-gradient(135deg, #e5f4ef, #cfe9dd); }
.thumbnail-2 { background: linear-gradient(135deg, #fff1df, #f8dfbd); }
.thumbnail-3 { background: linear-gradient(135deg, #f1eaff, #dfd4f7); }
.thumbnail-4 { background: linear-gradient(135deg, #e4f2f7, #cce5ed); }
.thumbnail-orbit { position: absolute; display: block; width: 190px; height: 190px; border: 1px solid #ffffff9c; border-radius: 50%; }
.orbit-one { top: -116px; right: -35px; }
.orbit-two { bottom: -148px; left: -47px; width: 235px; height: 235px; border-color: #ffffff80; }
.thumbnail-shape { position: relative; width: 69px; height: 69px; display: grid; place-items: center; border: 1px solid #ffffffb8; border-radius: 21px 21px 21px 7px; background: #ffffffa8; color: #4779cf; font-size: 30px; transform: rotate(-5deg); box-shadow: 0 11px 25px #324f7d17; }
.thumbnail-1 .thumbnail-shape { color: #39856a; }
.thumbnail-2 .thumbnail-shape { color: #bd813c; }
.thumbnail-3 .thumbnail-shape { color: #7862b4; }
.thumbnail-4 .thumbnail-shape { color: #39819b; }
.thumbnail-number { position: absolute; right: 13px; bottom: 10px; color: #ffffffc9; font: 700 29px Manrope, sans-serif; letter-spacing: -1px; }
.chapter-card-body { padding: 15px 16px 13px; }
.chapter-course-label { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow: hidden; color: #8090a5; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chapter-course-label i { color: #5583d2; }
.chapter-card h2 { overflow: hidden; margin: 8px 0 15px; color: #2c3b52; font: 700 15px/1.35 Manrope, "Segoe UI", sans-serif; letter-spacing: -.2px; text-overflow: ellipsis; white-space: nowrap; }
.chapter-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid #eff2f6; color: #8995a5; font-size: 10px; }
.catalog-empty { min-height: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.catalog-empty-icon { width: 53px; height: 53px; margin-bottom: 15px; display: grid; place-items: center; border-radius: 15px; background: #edf4ff; color: #4b7fe0; font-size: 23px; }
.catalog-empty h2 { margin: 0 0 7px; color: #2e3d53; font: 700 17px Manrope, sans-serif; }
.catalog-empty p { margin: 0; color: #8793a3; font-size: 12px; }

@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; top: 0; bottom: 0; left: -264px; height: 100vh; height: 100dvh; border-right: 0; box-shadow: 10px 0 30px #23334a18; }
    .app-sidebar.is-open { left: 0; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1040; display: none; border: 0; background: #17263b80; opacity: 0; }
    .sidebar-backdrop.is-visible { display: block; opacity: 1; }
    body.sidebar-open { overflow: hidden; }
    .app-topbar { min-height: 58px; padding: 0 15px; }
    .app-page { padding: 14px; }
    .app-main { width: 100%; margin-left: 0; }
    .course-workspace { grid-template-columns: minmax(0, 1fr); min-height: unset; }
    .course-navigator { border-right: 0; border-bottom: 1px solid #e9edf2; padding: 18px 15px 13px; }
    .course-navigator #course-tree { max-height: 32vh; }
    .course-workspace .content { min-height: 340px; padding: 24px 17px; }
    .course-workspace .welcome-card { padding-top: 10px; }
}
@media (max-width: 575.98px) {
    .app-page { padding: 10px; }
    .app-topbar-actions .saved-indicator { display: none; }
    .app-topbar-actions .button { min-height: 34px; padding: 0 9px; font-size: 10px; }
    .course-workspace .detail-header { gap: 12px; }
    .course-workspace .header-actions { flex-wrap: wrap; }
    .stat-grid { grid-template-columns: 1fr; gap: 9px; }
    .stat-card { padding: 13px; }
    .management-card { padding: 14px; overflow-x: auto; }
    .chapter-table { min-width: 420px; }
    .chapter-gallery { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
    .chapter-thumbnail { height: 118px; }
    .chapter-card-body { padding: 12px; }
    .chapter-card h2 { margin: 7px 0 11px; }
    .course-dialog { padding: 20px 16px; }
    .thumbnail-options { gap: 5px; }
    .thumbnail-option-preview { height: 54px; }
    .course-detail-heading { align-items: flex-start; flex-direction: column; padding: 13px; }
    .course-detail-thumbnail { width: 100%; height: 145px; flex-basis: 145px; }
    .quiz-library-summary { grid-template-columns: 1fr; gap: 8px; }
    .quiz-card-grid { grid-template-columns: 1fr; }
    .quiz-attempt-row { grid-template-columns: 1fr 42px; }
    .quiz-attempt-row time { grid-column: 1 / -1; text-align: left; }
}
