:root {
  --navy: #172b3a;
  --navy-soft: #213d50;
  --paper: #f7f6f2;
  --surface: #ffffff;
  --red: #cb3d32;
  --red-deep: #b83229;
  --red-soft: #fff2f0;
  --ink: #172b3a;
  --muted: #6c7983;
  --subtle: #98a3aa;
  --line: #dfe5e8;
  --line-soft: #edf0f1;
  --green: #2b8a57;
  --green-soft: #eaf7ef;
  --blue: #377da5;
  --blue-soft: #edf6fb;
  --amber: #b87718;
  --amber-soft: #fff7e6;
  --sidebar: 228px;
  --topbar: 68px;
  --shadow: 0 8px 24px rgb(23 43 58 / 5%);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 1024px; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { color: inherit; font: inherit; }
button { border: 0; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgb(203 61 50 / 22%); outline-offset: 2px; }
svg { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: var(--sidebar); flex-direction: column; color: #fff; background: var(--navy); }
.brand { display: flex; height: 96px; align-items: center; gap: 12px; padding: 0 22px; color: #fff; text-decoration: none; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.brand-mark { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; color: #fff; background: var(--red); border-radius: 9px; box-shadow: 0 5px 14px rgb(0 0 0 / 14%); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 17px; font-weight: 680; letter-spacing: .02em; white-space: nowrap; }
.brand-copy small { display: block; margin-top: 2px; color: #9eb0ba; font-size: 10px; letter-spacing: .18em; }

.side-nav { min-height: 0; flex: 1; padding: 20px 13px; overflow-y: auto; }
.side-nav a { position: relative; display: flex; height: 49px; align-items: center; gap: 13px; margin: 3px 0; padding: 0 13px; color: #c5d1d7; border-radius: 8px; text-decoration: none; transition: color .16s ease, background .16s ease, transform .16s ease; }
.side-nav a::before { position: absolute; top: 10px; bottom: 10px; left: -13px; width: 3px; content: ""; background: transparent; border-radius: 0 3px 3px 0; }
.side-nav a:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.side-nav a:active { transform: translateY(1px); }
.side-nav a.active { color: #fff; background: rgb(203 61 50 / 21%); }
.side-nav a.active::before { background: var(--red); }
.side-nav a svg { width: 21px; height: 21px; flex: 0 0 21px; }
.side-nav a span { flex: 1; font-size: 14px; font-weight: 540; }
.nav-badge { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; color: #fff; background: var(--red); border-radius: 10px; font-size: 11px; line-height: 20px; }

.sidebar-footer { margin-top: auto; padding: 0 18px 22px; }
.sidebar-footer p { margin: 12px 8px 0; padding-top: 16px; color: #728893; border-top: 1px solid rgb(255 255 255 / 8%); font-size: 10px; line-height: 1.7; letter-spacing: .08em; }

.workspace { width: calc(100% - var(--sidebar)); min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; height: var(--topbar); align-items: center; justify-content: flex-end; padding: 0 27px; background: rgb(255 255 255 / 96%); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.chevron { width: 15px; height: 15px; color: var(--muted); }
.top-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; }
.certificate-switch { position: relative; display: flex; min-width: 214px; min-height: 44px; align-items: center; padding: 0 35px 0 12px; background: #f6f9fb; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.certificate-switch select { width: 100%; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: 2px; appearance: none; cursor: pointer; font-size: 13px; font-weight: 650; line-height: 19px; }
.certificate-switch > .chevron { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); pointer-events: none; }
.certificate-switch:focus-within { background: #fff; border-color: #9bb4c7; }
.preview-state { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; padding: 5px 10px; color: #667780; background: #f4f6f6; border-radius: 14px; font-size: 11px; }
.preview-state i { width: 6px; height: 6px; background: #98a4aa; border-radius: 50%; }
.preview-state.live { color: var(--green); background: var(--green-soft); }
.preview-state.live i { background: var(--green); box-shadow: 0 0 0 3px rgb(43 138 87 / 12%); }
.icon-button { position: relative; display: grid; width: 40px; height: 40px; place-items: center; color: var(--muted); background: transparent; border-radius: 8px; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: #f5f7f7; }
.icon-button:disabled { color: #aab3b8; cursor: not-allowed; }
.icon-button svg { width: 21px; height: 21px; }
.account-button { display: flex; height: 48px; align-items: center; gap: 10px; padding: 0 8px; background: transparent; border-radius: 9px; cursor: pointer; }
.account-button:hover { background: #f5f7f7; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; color: #fff; background: #466a7e; border-radius: 50%; font-size: 13px; font-weight: 650; }
.account-copy { min-width: 70px; text-align: left; }
.account-copy strong, .account-copy small { display: block; }
.account-copy strong { font-size: 13px; }
.account-copy small { margin-top: 1px; color: var(--subtle); font-size: 10px; }

.main-content { min-height: calc(100vh - var(--topbar)); padding: 26px 27px 34px; }
.page { max-width: 1450px; margin: 0 auto; animation: page-in .2s ease both; }
.section-back { display: flex; max-width: 1450px; align-items: center; gap: 14px; margin: 0 auto 16px; }
.section-back .button { flex: 0 0 auto; min-height: 34px; padding: 0 11px; font-size: 12px; }
.section-back .button svg { transform: rotate(180deg); }
.section-back > span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
@keyframes page-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; min-height: 56px; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.title-group { min-width: 0; }
.overline { margin: 0 0 3px; color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .17em; }
.page-heading h1 { margin: 0; font-size: 30px; font-weight: 690; line-height: 1.2; letter-spacing: -.035em; }
.page-heading p:not(.overline) { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 9px; padding-top: 7px; }

.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-weight: 560; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease; }
.button:hover { border-color: #b8c3c8; box-shadow: 0 3px 10px rgb(23 43 58 / 7%); }
.button:active { transform: translateY(1px); }
.button svg { width: 17px; height: 17px; }
.button.primary { color: #fff; background: var(--red); border-color: var(--red); }
.button.primary:hover { background: var(--red-deep); border-color: var(--red-deep); }
.button.dark { color: #fff; background: var(--navy); border-color: var(--navy); }
.button.ghost { background: transparent; }
.button.danger-ghost { color: var(--red); background: #fff; border-color: #e6bbb7; }
.button.small { min-height: 32px; padding: 0 11px; font-size: 12px; }
.button.full { width: 100%; }
.button.is-loading { position: relative; }
.button.is-loading::before { width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .75s linear infinite; content: ''; flex: 0 0 auto; }
.button.is-loading > svg { display: none; }
.button:disabled { color: #9aa5aa; background: #eef1f2; border-color: #e3e7e9; cursor: not-allowed; box-shadow: none; }
.text-button { display: inline-flex; align-items: center; gap: 3px; padding: 3px; color: var(--red); background: none; cursor: pointer; font-weight: 570; }
.text-button svg { width: 15px; height: 15px; }
.text-button.muted { color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.panel-header { display: flex; min-height: 61px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); }
.panel-header h2 { margin: 0; font-size: 16px; font-weight: 660; }
.panel-header h2 small { margin-left: 7px; color: var(--subtle); font-size: 12px; font-weight: 450; }
.panel-body { padding: 19px 20px; }
.stack { display: grid; gap: 14px; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, .85fr); gap: 16px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.metric-card { position: relative; display: flex; min-height: 108px; align-items: center; gap: 15px; padding: 18px 19px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.metric-icon { display: grid; width: 45px; height: 45px; flex: 0 0 45px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.metric-icon svg { width: 23px; height: 23px; }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-copy small, .metric-copy strong, .metric-copy span { display: block; }
.metric-copy small { color: var(--muted); font-size: 12px; }
.metric-copy strong { margin-top: 3px; font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
.metric-copy strong em { margin-left: 2px; font-size: 13px; font-style: normal; font-weight: 500; }
.metric-copy span { margin-top: 4px; color: var(--subtle); font-size: 10px; }
.metric-copy span.up { color: var(--green); }

.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 12px; color: var(--muted); background: #f7f9f9; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 560; text-align: left; white-space: nowrap; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfc; }
.data-table strong { font-weight: 620; }
.cell-title { display: flex; align-items: center; gap: 9px; }
.cell-icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 6px; }
.cell-icon svg { width: 16px; height: 16px; }
.cell-sub { display: block; margin-top: 2px; color: var(--subtle); font-size: 10px; }
.status { display: inline-flex; min-height: 22px; align-items: center; gap: 5px; padding: 0 8px; color: #64747d; background: #f1f4f4; border-radius: 11px; font-size: 10px; font-weight: 560; white-space: nowrap; }
.status::before { width: 5px; height: 5px; content: ""; background: currentColor; border-radius: 50%; }
.status.success { color: var(--green); background: var(--green-soft); }
.status.pending { color: var(--amber); background: var(--amber-soft); }
.status.danger { color: var(--red); background: var(--red-soft); }
.status.info { color: var(--blue); background: var(--blue-soft); }

.todo-list { padding: 2px 18px 7px; }
.todo-section-title { display: flex; align-items: center; justify-content: space-between; margin: 17px 1px 7px; }
.todo-section-title strong { font-size: 12px; }
.todo-section-title span { color: var(--subtle); font-size: 10px; }
.todo-item { display: grid; width: 100%; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; color: inherit; background: transparent; border-bottom: 1px solid var(--line-soft); text-align: left; cursor: pointer; }
.todo-item:last-child { border-bottom: 0; }
.todo-number { display: grid; width: 27px; height: 27px; place-items: center; color: var(--red); background: var(--red-soft); border-radius: 6px; font-size: 11px; font-weight: 650; }
.todo-number.amber { color: var(--amber); background: var(--amber-soft); }
.todo-copy strong { display: block; font-size: 12px; font-weight: 600; }
.todo-copy span { display: block; margin-top: 2px; color: var(--subtle); font-size: 10px; }
.todo-item .chevron { width: 14px; height: 14px; }
.todo-item.static-item { cursor: default; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-card { display: flex; min-height: 84px; align-items: center; gap: 12px; padding: 14px; color: inherit; background: #fbfcfc; border: 1px solid var(--line-soft); border-radius: 8px; text-align: left; cursor: pointer; }
.quick-card:hover { background: #fff; border-color: #cbd4d8; box-shadow: 0 4px 12px rgb(23 43 58 / 5%); }
.quick-card .metric-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 8px; }
.quick-card .metric-icon svg { width: 20px; height: 20px; }
.quick-card strong { display: block; font-size: 12px; }
.quick-card span { display: block; margin-top: 3px; color: var(--subtle); font-size: 10px; }

/* Course import */
.course-import-layout { display: grid; grid-template-columns: 316px minmax(0, 1fr); gap: 16px; }
.course-form { padding: 20px; }
.form-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; }
.field, .select-field, .textarea-field { width: 100%; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 7px; outline: none; transition: border .15s ease, box-shadow .15s ease; }
.field, .select-field { height: 40px; padding: 0 11px; }
.textarea-field { min-height: 92px; padding: 10px 11px; resize: vertical; }
.field:focus, .select-field:focus, .textarea-field:focus { border-color: #9aaeb9; box-shadow: 0 0 0 3px rgb(55 125 165 / 10%); }
.form-group { margin-bottom: 15px; }
.field-help { margin: 6px 0 0; color: var(--subtle); font-size: 10px; }
.progress-steps { display: grid; grid-template-columns: repeat(4, 1fr); padding: 20px 26px 18px; border-bottom: 1px solid var(--line-soft); }
.progress-step { position: relative; text-align: center; }
.progress-step::after { position: absolute; top: 14px; left: calc(50% + 20px); width: calc(100% - 40px); height: 1px; content: ""; background: var(--line); }
.progress-step:last-child::after { display: none; }
.step-dot { position: relative; z-index: 1; display: grid; width: 29px; height: 29px; margin: 0 auto 7px; place-items: center; color: #88969e; background: #fff; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; font-weight: 650; }
.progress-step.active .step-dot { color: #fff; background: var(--red); border-color: var(--red); }
.progress-step.done .step-dot { color: var(--green); background: var(--green-soft); border-color: #b9ddc8; }
.progress-step span:last-child { color: var(--muted); font-size: 10px; }
.progress-step.active span:last-child { color: var(--red); font-weight: 600; }
.dropzone { display: grid; width: calc(100% - 40px); min-height: 148px; margin: 20px; place-items: center; padding: 20px; color: var(--muted); background: #fbfcfc; border: 1px dashed #bcc8cd; border-radius: 8px; text-align: center; cursor: pointer; transition: background .15s ease, border .15s ease; }
.dropzone:hover, .dropzone.dragover { background: var(--red-soft); border-color: var(--red); }
.dropzone:disabled { cursor: progress; opacity: .72; }
.dropzone:disabled:hover { background: #fbfcfc; border-color: #bcc8cd; }
.dropzone-icon { display: grid; width: 42px; height: 42px; margin: 0 auto 9px; place-items: center; color: var(--red); background: var(--red-soft); border-radius: 50%; }
.dropzone-icon svg { width: 22px; height: 22px; }
.dropzone strong { display: block; color: var(--ink); font-size: 12px; }
.dropzone p { margin: 4px 0 0; color: var(--subtle); font-size: 10px; }
.file-list { margin: 0 20px 18px; border: 1px solid var(--line-soft); border-radius: 8px; }
.file-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) 100px 80px; align-items: center; gap: 10px; min-height: 54px; padding: 8px 11px; border-bottom: 1px solid var(--line-soft); }
.file-row:last-child { border-bottom: 0; }
.file-type { display: grid; width: 29px; height: 29px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 6px; }
.file-type.audio { color: var(--amber); background: var(--amber-soft); }
.file-type.sheet { color: var(--green); background: var(--green-soft); }
.file-type svg { width: 16px; height: 16px; }
.file-name strong { display: block; overflow: hidden; font-size: 11px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }
.file-name small { color: var(--subtle); font-size: 9px; }
.panel-footer { display: flex; min-height: 61px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line-soft); }
.panel-footer p { margin: 0; color: var(--subtle); font-size: 10px; }
.inline-actions { display: flex; align-items: center; gap: 8px; }
.compact-select { display: flex; min-height: 39px; align-items: center; gap: 8px; padding: 0 11px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.compact-select span { color: var(--subtle); font-size: 10px; }
.compact-select select { min-width: 150px; background: transparent; border: 0; outline: 0; font-size: 11px; font-weight: 600; }
.course-create-panel { max-width: 720px; }
.course-create-panel .course-form { max-width: 620px; }
.lesson-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.lesson-list span { padding: 4px 7px; color: #526d7c; background: #eef4f6; border-radius: 5px; font-size: 9px; }
.lesson-create { padding: 11px; background: #f7f9f9; border: 1px solid var(--line-soft); border-radius: 7px; }
.lesson-create-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.lesson-create-head strong { font-size: 11px; }
.lesson-create .field, .lesson-create .textarea-field { margin-bottom: 9px; }
.lesson-create .textarea-field.compact { min-height: 64px; }

/* Knowledge review */
.knowledge-layout { display: grid; grid-template-columns: 235px minmax(430px, 1fr) minmax(340px, .8fr); gap: 12px; height: calc(100vh - 169px); min-height: 650px; }
.knowledge-layout > .panel { min-height: 0; overflow: hidden; }
.folder-tree { padding: 10px 8px; }
.tree-item { display: flex; min-height: 38px; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); border-radius: 6px; cursor: pointer; }
.tree-item:hover { background: #f6f8f8; }
.tree-item.active { color: var(--red); background: var(--red-soft); font-weight: 600; }
.tree-item.child { padding-left: 31px; font-size: 12px; }
.tree-item svg { width: 16px; height: 16px; }
.knowledge-scroll, .source-scroll { height: calc(100% - 61px); overflow-y: auto; }
.knowledge-scroll { padding: 14px; }
.knowledge-split { display: grid; height: calc(100% - 61px); grid-template-columns: minmax(190px, .8fr) minmax(260px, 1.2fr); }
.knowledge-split .question-list { height: 100%; border-right: 1px solid var(--line-soft); }
.knowledge-split .question-item { grid-template-columns: 22px minmax(0, 1fr) auto; }
.knowledge-split .question-item input { accent-color: var(--red); }
.point-editor { padding: 17px; overflow-y: auto; }
.point-editor .textarea-field { min-height: 150px; margin-bottom: 13px; }
.point-editor .field { margin-bottom: 13px; }
.knowledge-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.mini-stat { padding: 12px; background: #f7f9f9; border-radius: 7px; }
.mini-stat span { color: var(--subtle); font-size: 10px; }
.mini-stat strong { display: block; margin-top: 2px; font-size: 18px; }
.knowledge-card { margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.knowledge-card.pending { border-color: #eccd9e; background: #fffdf8; }
.knowledge-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.knowledge-card-header strong { font-size: 13px; }
.knowledge-card p { margin: 8px 0; color: var(--muted); font-size: 11px; }
.keyword-row { display: flex; flex-wrap: wrap; gap: 5px; }
.keyword { padding: 3px 7px; color: #59717f; background: #eff4f6; border-radius: 4px; font-size: 9px; }
.source-scroll { padding: 22px; background: #fcfcfb; font: 12px/1.9 Georgia, "Songti SC", serif; }
.source-scroll h3 { margin: 0 0 13px; color: var(--ink); font-family: var(--font); font-size: 15px; }
.source-scroll p { margin: 0 0 14px; color: #52636c; }
.source-scroll mark { padding: 2px 1px; color: inherit; background: #fff0a8; }

/* Generate */
.generator-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .72fr); gap: 16px; }
.config-section { padding: 20px; border-bottom: 1px solid var(--line-soft); }
.config-section:last-child { border-bottom: 0; }
.section-title { display: flex; align-items: center; gap: 9px; margin: 0 0 15px; font-size: 14px; }
.section-number { display: grid; width: 23px; height: 23px; place-items: center; color: var(--red); background: var(--red-soft); border-radius: 50%; font-size: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.choice-card { position: relative; display: flex; min-height: 64px; align-items: center; gap: 10px; padding: 11px; background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.choice-card:hover { border-color: #b7c5cc; }
.choice-card.selected { background: var(--red-soft); border-color: #e0a29c; }
.choice-card.preview-only { cursor: default; opacity: .82; }
.choice-card input { accent-color: var(--red); }
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { font-size: 11px; }
.choice-card small { margin-top: 2px; color: var(--subtle); font-size: 9px; }
.segmented { display: flex; gap: 7px; }
.segment { flex: 1; min-height: 38px; background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 11px; }
.segment.active { color: var(--red); background: var(--red-soft); border-color: #e1aaa5; font-weight: 600; }
.segment:disabled { color: #98a3aa; background: #f3f5f5; border-color: #e6eaec; cursor: not-allowed; }
.range-row { display: grid; grid-template-columns: 1fr 60px; align-items: center; gap: 14px; }
input[type="range"] { width: 100%; accent-color: var(--red); }
.count-value { height: 36px; padding: 7px; background: #f6f8f8; border-radius: 6px; text-align: center; font-weight: 650; }
.generate-summary { padding: 22px; }
.summary-hero { padding: 18px; color: #fff; background: var(--navy); border-radius: 8px; }
.summary-hero small { color: #b8c7cf; }
.summary-hero strong { display: block; margin: 5px 0 2px; font-size: 19px; }
.summary-list { margin: 15px 0; }
.summary-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); }
.generate-note { display: flex; gap: 8px; padding: 11px; color: #61737d; background: #f3f7f8; border-radius: 7px; font-size: 10px; }
.generate-note svg { width: 16px; height: 16px; flex: 0 0 16px; }
.section-gap { margin-top: 15px; }

/* Question review */
.chapter-question-toolbar { display: grid; grid-template-columns: minmax(0, 380px) auto; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 16px; }
.chapter-question-toolbar label { display: grid; min-width: 0; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.chapter-question-toolbar select { min-width: 0; font-size: 14px; font-weight: 400; text-overflow: ellipsis; }
.chapter-question-toolbar .button { white-space: nowrap; }
.review-progress { display: flex; min-width: 360px; align-items: center; gap: 14px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.review-progress-copy { min-width: 94px; }
.review-progress-copy strong, .review-progress-copy span { display: block; }
.review-progress-copy strong { font-size: 11px; }
.review-progress-copy span { margin-top: 2px; color: var(--subtle); font-size: 9px; }
.progress-track { flex: 1; height: 6px; overflow: hidden; background: #edf0f1; border-radius: 3px; }
.progress-track i { display: block; height: 100%; background: var(--red); border-radius: inherit; transition: width .3s ease; }
.review-progress > strong { color: var(--red); font-size: 20px; }
.question-review-layout { display: grid; grid-template-columns: clamp(220px, 18%, 245px) minmax(0, 1.25fr) minmax(230px, .8fr); gap: 12px; height: calc(100vh - 170px); min-height: 650px; }
.question-review-layout > .panel { min-height: 0; overflow: hidden; }
.question-list { height: calc(100% - 61px); padding: 8px; overflow-y: auto; }
.question-item { display: grid; width: 100%; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 53px; padding: 7px 8px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 7px; text-align: left; cursor: pointer; }
.question-item:hover { background: #f8fafa; }
.question-item.active { background: var(--blue-soft); border-color: #9bc7df; }
.question-index { display: grid; width: 27px; height: 27px; place-items: center; color: var(--muted); background: #f0f3f4; border-radius: 5px; font-size: 10px; }
.question-item.active .question-index { color: var(--blue); background: #dceef8; }
.question-name { overflow: hidden; font-size: 11px; font-weight: 570; text-overflow: ellipsis; white-space: nowrap; }
.question-name small { display: block; margin-top: 2px; color: var(--subtle); font-size: 9px; font-weight: 500; }
.review-editor { height: calc(100% - 61px); padding: 17px 18px; overflow-y: auto; }
.editable-block { position: relative; margin-bottom: 15px; padding: 13px; background: #f8fafa; border: 1px solid var(--line-soft); border-radius: 7px; }
.editable-block label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 600; }
.editable-block p { margin: 0; font-size: 12px; }
.edit-corner { position: absolute; top: 10px; right: 10px; display: grid; width: 27px; height: 27px; place-items: center; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.edit-corner svg { width: 14px; height: 14px; }
.rubric-table input { width: 52px; height: 29px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; }
.rubric-table input.rubric-name { width: 100%; min-width: 150px; }
.rubric-total { color: var(--red); font-weight: 700; }
.review-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-top: 14px; }
.source-info { padding: 17px; }
.source-meta { padding: 12px; background: #f6f8f8; border-radius: 7px; }
.source-meta div { display: grid; grid-template-columns: 57px 1fr; padding: 5px 0; font-size: 10px; }
.source-meta span { color: var(--subtle); }
.source-quote { margin-top: 13px; padding: 12px 13px; color: #536771; background: #fcfaf7; border-left: 3px solid var(--red); font: 11px/1.85 Georgia, "Songti SC", serif; }

/* Public question bank */
.course-mapping-fields { display: grid; gap: 9px; padding: 12px; background: #f7f9f9; border: 1px solid var(--line-soft); border-radius: 8px; }
.bank-scope-bar { display: grid; grid-template-columns: minmax(240px, 1fr) auto minmax(300px, 1.4fr); align-items: end; gap: 12px; margin-bottom: 12px; padding: 13px 16px; }
.bank-scope-bar > div:first-child { display: grid; gap: 5px; }
.bank-scope-actions { display: flex; gap: 7px; }
.scope-summary, .scope-warning { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.scope-warning { display: flex; align-items: center; justify-content: flex-end; gap: 9px; color: var(--red); }
.bank-filter-panel { margin-bottom: 12px; }
.bank-filter-bar { display: grid; grid-template-columns: minmax(150px, 1.25fr) repeat(4, minmax(110px, 1fr)) minmax(190px, 1.7fr) auto; align-items: end; gap: 12px; padding: 16px; }
.bank-filter-control { display: grid; min-width: 0; gap: 6px; }
.bank-filter-control > span { color: var(--muted); font-size: 11px; font-weight: 560; }
.bank-filter-bar .field, .bank-filter-bar .select-field { width: 100%; min-width: 0; height: 39px; }
.bank-filter-actions { display: flex; align-items: center; gap: 8px; }
.bank-filter-actions .button { white-space: nowrap; }
.bank-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 12px; min-height: 650px; }
.bank-list-panel, .bank-editor { display: flex; min-height: 0; flex-direction: column; overflow: hidden; }
.bank-question-list { flex: 1; padding: 7px; overflow-y: auto; }
.bank-question-item { display: grid; width: 100%; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 67px; padding: 8px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 7px; text-align: left; cursor: pointer; }
.bank-question-item:hover { background: #f8fafa; }
.bank-question-item.active { background: var(--blue-soft); border-color: #9bc7df; }
.bank-question-index { color: var(--subtle); font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.bank-question-copy { min-width: 0; }
.bank-question-copy strong, .bank-question-copy small { display: block; }
.bank-question-copy strong { overflow: hidden; font-size: 11px; font-weight: 590; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.bank-question-copy small { margin-top: 3px; overflow: hidden; color: var(--subtle); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.bank-editor .review-editor { height: auto; flex: 1; }
.bank-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-bottom: 15px; padding: 10px 12px; color: var(--muted); background: #f7f9f9; border-radius: 7px; font-size: 10px; }
.bank-meta strong { color: var(--ink); }
.bank-stem { min-height: 100px; }
.field-help { margin: 3px 0 8px; color: var(--subtle); font-size: 9px; }
.bank-options { display: grid; gap: 7px; }
.bank-option-row { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; }
.answer-choice { display: flex; height: 39px; align-items: center; justify-content: center; gap: 6px; background: #f7f9f9; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.answer-choice input { accent-color: var(--red); }
.bank-review-controls { display: grid; grid-template-columns: minmax(180px, .6fr) 1fr; align-items: end; gap: 12px; margin-top: 15px; }
.bank-enabled { display: flex; min-height: 39px; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.bank-enabled input { accent-color: var(--red); }
.bank-source { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px 12px; padding: 11px 18px; color: var(--muted); background: #f8fafa; border-top: 1px solid var(--line-soft); font-size: 10px; }
.bank-source code { grid-column: 1 / -1; overflow: hidden; color: var(--subtle); text-overflow: ellipsis; white-space: nowrap; }
.bank-source a { color: var(--blue); text-decoration: none; }
.bank-source a:hover { text-decoration: underline; }
.bank-list-panel .panel-footer { min-height: 51px; }
.bank-batch-header { align-items: center; }
.bank-batch-header > div:first-child { display: grid; gap: 5px; }
.bank-batch-header label { color: var(--muted); font-size: 9px; font-weight: 500; }
.bank-list-panel .pagination button { padding: 0 9px; }
.bank-list-panel .pagination button:disabled { cursor: not-allowed; opacity: .45; }

.mock-paper-directory-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 16px; }
.mock-paper-directory-header h2 { margin: 0; font-size: 18px; }
.mock-paper-directory-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.mock-paper-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mock-paper-card { min-width: 0; padding: 22px; }
.mock-paper-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mock-paper-number { display: grid; width: 42px; height: 46px; place-items: center; color: var(--blue); background: var(--blue-soft); border: 1px solid var(--line); border-radius: 8px; font: 650 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.mock-paper-card h2 { margin: 18px 0 12px; font-size: 18px; }
.mock-paper-count { display: flex; align-items: baseline; gap: 6px; margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.mock-paper-count > strong { color: var(--ink); font-size: 32px; line-height: 1.2; }
.mock-paper-count > small { margin-left: auto; font-size: 11px; }
.mock-paper-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 13px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.mock-paper-types > span { display: grid; gap: 4px; color: var(--muted); font-size: 11px; text-align: center; }
.mock-paper-types > span + span { border-left: 1px solid var(--line-soft); }
.mock-paper-types strong { color: var(--ink); font-size: 18px; }
.mock-paper-stats { display: grid; gap: 7px; margin: 17px 0; font-size: 12px; }
.mock-paper-stats > div { display: flex; justify-content: space-between; gap: 12px; }
.mock-paper-stats dt { color: var(--muted); }
.mock-paper-stats dd { margin: 0; }
.mock-paper-card > footer { padding-top: 2px; }
.mock-paper-card > footer .button { width: 100%; justify-content: center; }

.form-fields { display: grid; gap: 10px; }
.form-fields.two { grid-template-columns: 1fr 1fr; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination button { min-width: 26px; height: 26px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-size: 10px; }
.pagination button.active { color: #fff; background: var(--navy); border-color: var(--navy); }

/* Class enrollment */
.enrollment-learners-panel { min-width: 0; overflow: hidden; }
.enrollment-learner-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 18px; }
.enrollment-learner-toolbar .course-search { flex: 1 1 260px; min-width: 0; margin: 0; }
.enrollment-learner-select { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.enrollment-learner-select > span { white-space: nowrap; }
.enrollment-learner-select .select-field { min-width: 0; }
.enrollment-learner-class { flex: 0 1 300px; min-width: 0; }
.enrollment-learner-note { margin: 0 18px 14px; color: var(--muted); font-size: 12px; }
.enrollment-classes-panel { overflow: hidden; }
.enrollment-classes-table td { overflow-wrap: anywhere; }
.enrollment-class-links { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.enrollment-table th, .enrollment-table td { white-space: nowrap; }
.authorization-phone { font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.enrollment-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; color: var(--ink); overflow: auto; }
.enrollment-dialog::backdrop { background: rgb(19 48 72 / 38%); }
.enrollment-dialog .panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.enrollment-form { padding: 20px; }
.class-learner-picker { min-width: 0; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.class-learner-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.class-learner-toolbar label { display: flex; align-items: center; gap: 8px; }
.class-learner-toolbar strong { color: var(--blue); }
.class-learner-list { max-height: min(310px, 45vh); overflow-y: auto; }
.class-learner-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12px; overflow-wrap: anywhere; }
.class-learner-row + .class-learner-row { border-top: 1px solid var(--line); }
.class-learner-row:hover { background: var(--blue-soft); }
.class-learner-picker input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.enrollment-dialog-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.enrollment-feedback { margin: 0 0 14px; color: var(--ink); font-size: 12px; }
.enrollment-roster { margin-top: 18px; border-top: 1px solid var(--line); }
.enrollment-roster h3 { margin: 15px 0 8px; font-size: 13px; }
.enrollment-roster h3 small { color: var(--muted); font-weight: 400; }

/* Progress */
.filters { display: flex; align-items: center; gap: 8px; }
.filter-control { display: flex; align-items: center; gap: 7px; padding: 0 10px; height: 37px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.filter-control span { color: var(--subtle); font-size: 10px; }
.filter-control select { min-width: 120px; background: transparent; border: 0; outline: 0; font-size: 11px; font-weight: 570; }
.progress-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, .75fr); gap: 16px; }
.progress-page .filters { flex-wrap: wrap; }
.progress-learners-panel { margin-bottom: 16px; }
.progress-learners-panel .panel-header > small { color: var(--muted); }
.progress-learners-table { min-width: 760px; }
.progress-learners-table td:nth-child(2) { min-width: 210px; }
.progress-learners-table .cell-sub { white-space: nowrap; }
.mastery-chart { padding: 20px; }
.bar-chart { display: grid; gap: 17px; }
.bar-row { display: grid; grid-template-columns: 104px 1fr 37px; align-items: center; gap: 10px; font-size: 11px; }
.bar-track { position: relative; height: 10px; background: repeating-linear-gradient(90deg, #edf1f2 0 1px, transparent 1px 20%), #f7f9f9; border-radius: 5px; }
.bar-track i { display: block; height: 100%; background: #4a8eb6; border-radius: 5px; box-shadow: inset 0 -1px rgb(0 0 0 / 8%); }
.bar-row strong { color: var(--blue); font-size: 11px; }
.student-progress { display: flex; align-items: center; gap: 7px; }
.student-progress .progress-track { min-width: 80px; height: 5px; }
.student-progress .progress-track i { background: var(--blue); }
.weakness { color: var(--red); }
.today-groups { padding: 3px 17px 15px; }
.today-group { margin-top: 14px; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.today-group-title { display: flex; align-items: center; justify-content: space-between; min-height: 39px; padding: 0 11px; background: var(--red-soft); }
.today-group-title.amber { background: var(--amber-soft); }
.today-group-title strong { font-size: 11px; }
.today-group-title button { color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; }
.today-group .todo-list { padding-bottom: 3px; }

/* Response review */
.response-layout { display: grid; grid-template-columns: minmax(310px, .85fr) minmax(430px, 1.15fr) minmax(300px, .78fr); gap: 12px; }
.student-answer { padding: 18px; }
.student-header { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.student-header .avatar { width: 42px; height: 42px; flex-basis: 42px; background: #6d8795; }
.student-header strong, .student-header span { display: block; }
.student-header span { margin-top: 2px; color: var(--subtle); font-size: 10px; }
.student-header .status { margin-left: auto; }
.question-box { padding: 13px; background: #f7f9f9; border-radius: 7px; }
.question-box label { color: var(--subtle); font-size: 9px; }
.question-box p { margin: 4px 0 0; font-size: 11px; }
.audio-player { margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.native-audio audio { display: block; width: 100%; height: 38px; }
.audio-head { display: flex; align-items: center; gap: 9px; }
.play-button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; color: #fff; background: var(--red); border-radius: 50%; cursor: pointer; }
.play-button svg { width: 16px; height: 16px; }
.waveform { display: flex; height: 32px; flex: 1; align-items: center; gap: 2px; overflow: hidden; }
.waveform i { display: block; width: 2px; height: var(--h); background: #b8c5ca; border-radius: 2px; }
.waveform i.played { background: var(--red); }
.audio-time { display: flex; justify-content: space-between; margin: 6px 0 0 43px; color: var(--subtle); font-size: 9px; }
.transcript { padding: 13px; background: #fffdf8; border: 1px solid #efe6d6; border-radius: 7px; }
.transcript h3 { margin: 0 0 7px; font-size: 11px; }
.transcript p { margin: 0; color: #596a73; font-size: 10px; line-height: 1.85; }
.score-panel .panel-header { border-left: 4px solid var(--navy); }
.score-table-wrap { padding: 16px; }
.score-select { width: 58px; height: 31px; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; }
.score-total { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 4px 0; }
.score-total strong { color: var(--red); font-size: 22px; }
.review-warning { display: flex; gap: 8px; margin-top: 13px; padding: 10px; color: var(--red); background: var(--red-soft); border-radius: 7px; font-size: 10px; }
.review-warning svg { width: 15px; height: 15px; flex: 0 0 15px; }
.appeal { margin-top: 14px; padding: 12px; background: var(--amber-soft); border-radius: 7px; }
.appeal h3 { margin: 0 0 6px; color: var(--amber); font-size: 11px; }
.appeal p { margin: 0; color: #6b624f; font-size: 10px; }
.comment-panel { display: grid; grid-template-columns: 1fr 270px; align-items: end; gap: 15px; margin-top: 12px; padding: 16px 18px; }
.comment-label { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; font-size: 11px; font-weight: 600; }
.comment-label svg { width: 16px; height: 16px; }
.comment-panel .textarea-field { min-height: 70px; }
.comment-panel .button { min-height: 46px; }

/* Empty, modal, toast */
.empty-state { display: grid; min-height: 220px; place-items: center; padding: 32px; text-align: center; }
.empty-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 10px; place-items: center; color: var(--muted); background: #f0f3f4; border-radius: 50%; }
.empty-icon svg { width: 23px; height: 23px; }
.empty-state strong { display: block; font-size: 14px; }
.empty-state p { margin: 5px 0 14px; color: var(--muted); font-size: 11px; }
.loading-state { display: grid; min-height: 300px; place-items: center; align-content: center; gap: 12px; color: var(--muted); text-align: center; }
.loading-state strong { font-size: 12px; font-weight: 570; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid #e3e8ea; border-top-color: var(--red); border-radius: 50%; animation: spin .75s linear infinite; }
.loading-lines { display: grid; width: 210px; gap: 7px; }
.loading-lines i { height: 7px; background: linear-gradient(90deg, #eef1f2 25%, #fafbfb 50%, #eef1f2 75%); background-size: 200% 100%; border-radius: 5px; animation: shimmer 1.25s infinite; }
.loading-lines i:nth-child(2) { width: 82%; }
.loading-lines i:nth-child(3) { width: 62%; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 12px; background: linear-gradient(90deg, #eef1f2 25%, #f8f9f9 50%, #eef1f2 75%); background-size: 200% 100%; border-radius: 6px; animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
html:has(.login-page:not([hidden])) { min-width: 0; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 32px 20px; background: radial-gradient(ellipse at top, var(--red-soft), transparent 60%), var(--paper); }
.login-dialog { width: min(410px, 100%); padding: 29px 32px 26px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); text-align: center; }
.login-check { display: grid; justify-items: center; gap: 12px; padding: 24px 0; color: var(--muted); }
.login-check p { margin: 0; font-size: 12px; }
.login-cancel { margin-top: 14px; }
.login-brand .brand-mark { margin: 0 auto 15px; }
.login-dialog h2 { margin: 0; font-size: 23px; }
.login-dialog > p:not(.overline):not(.dialog-hint) { margin: 7px 0 20px; color: var(--muted); font-size: 12px; }
.login-qr-frame { display: grid; width: min(220px, 100%); aspect-ratio: 1; place-items: center; margin: 0 auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 12px; overflow: hidden; }
.login-qr-frame img { display: block; width: 100%; height: auto; }
.login-qr-frame span { padding: 12px; }
.login-qr-status { min-height: 1.5em; margin: 12px 0 8px; color: var(--muted); font-size: 12px; }
.login-qr-status[data-status="error"] { color: var(--red); }
#loginQrRefresh:disabled { color: var(--subtle); cursor: default; }
.form-error { margin: 0 0 10px; padding: 8px 10px; color: var(--red); background: var(--red-soft); border-radius: 6px; font-size: 10px; }
.dialog-hint { display: flex; align-items: flex-start; gap: 6px; margin: 14px 0 0; color: var(--subtle); font-size: 9px; text-align: left; }
.dialog-hint svg { width: 14px; height: 14px; flex: 0 0 14px; }
.popover { position: fixed; z-index: 60; width: 218px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 14px 36px rgb(23 43 58 / 16%); }
.account-popover { top: 60px; right: 25px; }
.account-popover > div { display: flex; align-items: center; gap: 9px; padding: 9px; border-bottom: 1px solid var(--line-soft); }
.account-popover p { margin: 0; }
.account-popover p strong, .account-popover p small { display: block; }
.account-popover p small { color: var(--subtle); font-size: 9px; }
.account-popover button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 9px; background: transparent; border-radius: 6px; cursor: pointer; font-size: 11px; text-align: left; }
.account-popover button:hover { background: #f5f7f7; }
.account-popover button svg { width: 16px; height: 16px; }
.toast-stack { position: fixed; right: 25px; bottom: 24px; z-index: 120; display: grid; width: 330px; gap: 8px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 9px; padding: 12px 14px; color: #fff; background: var(--navy); border-radius: 8px; box-shadow: 0 10px 28px rgb(23 43 58 / 23%); animation: toast-in .22s ease both; }
.toast.success { background: #236f49; }
.toast.error { background: #a9342b; }
.toast svg { width: 19px; height: 19px; }
.toast strong { display: block; font-size: 11px; }
.toast p { margin: 2px 0 0; color: rgb(255 255 255 / 75%); font-size: 9px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

/* Reference-led visual refresh */
:root {
  --navy: #0b2948;
  --navy-soft: #183d5f;
  --paper: #f4f8fb;
  --surface: #ffffff;
  --red: #f04438;
  --red-deep: #d9362d;
  --red-soft: #fff0ee;
  --ink: #102c49;
  --muted: #667b8f;
  --subtle: #93a3b3;
  --line: #dde7ee;
  --line-soft: #edf2f5;
  --green: #1eaa6d;
  --green-soft: #e9f8f1;
  --blue: #2587d9;
  --blue-soft: #eaf5fe;
  --amber: #e58b18;
  --amber-soft: #fff6e7;
  --sidebar: 226px;
  --topbar: 70px;
  --shadow: 0 10px 28px rgb(28 57 82 / 6%);
}

html { background: var(--paper); }
body { background: radial-gradient(circle at 89% 2%, rgb(240 68 56 / 5%), transparent 25%), var(--paper); }

.sidebar {
  color: var(--ink);
  background: linear-gradient(180deg,#fff 0%,#fbfdff 72%,#fff9f8 100%);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 30px rgb(35 64 88 / 4%);
}
.brand { height: 94px; padding: 0 20px; color: var(--ink); border-bottom-color: var(--line-soft); }
.brand-mark { width: 42px; height: 42px; flex-basis: 42px; color: #fff; background: linear-gradient(145deg,#ff6657,#ec3f35); border-radius: 11px; box-shadow: 0 8px 20px rgb(240 68 56 / 22%); }
.brand-mark svg { width: 27px; height: 27px; }
.brand-copy strong { color: var(--ink); font-size: 18px; font-weight: 720; letter-spacing: -.01em; }
.brand-copy small { margin-top: 3px; color: #8192a2; font-size: 10px; font-weight: 560; letter-spacing: .12em; }

.side-nav { padding: 16px 14px; }
.side-nav a { height: 52px; gap: 13px; margin: 4px 0; padding: 0 15px; color: #6c8398; border-radius: 11px; }
.side-nav a::before { display: none; }
.side-nav a:hover { color: var(--navy); background: #f4f8fb; }
.side-nav a.active { color: var(--red); background: linear-gradient(90deg,#fff0ed,#ffe9e6); box-shadow: inset 0 0 0 1px rgb(240 68 56 / 6%); }
.side-nav a svg { width: 22px; height: 22px; }
.side-nav a span { font-size: 14px; font-weight: 610; }
.nav-badge { color: #fff; background: var(--red); }

.sidebar-footer { padding: 0 15px 18px; }
.sidebar-motto { display: flex; align-items: flex-end; gap: 11px; margin-top: 8px; padding: 18px 10px 6px; color: rgb(240 68 56 / 27%); border-top: 1px solid var(--line-soft); }
.sidebar-motto svg { width: 55px; height: 55px; flex: 0 0 55px; }
.sidebar-motto p { margin: 0 0 3px; padding: 0; color: #9a7d7a; border: 0; font: 11px/1.7 Georgia,"Songti SC",serif; letter-spacing: .1em; }
.sidebar-motto p span { color: #ad918e; }

.topbar { height: var(--topbar); gap: 20px; padding: 0 31px; background: rgb(255 255 255 / 92%); border-bottom-color: var(--line); box-shadow: 0 5px 20px rgb(27 54 78 / 4%); backdrop-filter: blur(18px); }
.preview-state { color: #708394; background: #f1f5f7; }
.preview-state.live { color: var(--green); background: var(--green-soft); }
.icon-button { width: 42px; height: 42px; color: #6e8295; border-radius: 50%; }
.icon-button:hover { color: var(--navy); background: #f1f6f8; }
.icon-button:disabled { color: #71869a; background: transparent; opacity: 1; }
.account-button { height: 50px; padding: 0 9px; border-radius: 11px; }
.avatar { background: linear-gradient(145deg,#67a5cc,#3e718f); box-shadow: 0 5px 13px rgb(40 90 120 / 15%); }
.account-copy strong { color: var(--ink); font-weight: 650; }

.main-content { min-height: calc(100vh - var(--topbar)); padding: 24px 30px 38px; }
.page { max-width: 1450px; }
.page-heading { min-height: 74px; margin-bottom: 18px; }
.page-heading h1 { color: #0b2948; font-size: 32px; font-weight: 730; letter-spacing: -.035em; }
.page-heading p:not(.overline) { margin-top: 7px; color: #718496; font-size: 13px; }
.overline { margin-bottom: 5px; color: #ef5145; font-size: 10px; letter-spacing: .16em; }
.dashboard-page > .page-heading { position: relative; min-height: 106px; align-items: flex-start; padding: 9px 16px 12px 4px; overflow: hidden; border-radius: 16px; background-color: rgb(255 255 255 / 36%); background-image: url("assets/dashboard-firefighter.png"); background-repeat: no-repeat; background-position: right 54%; background-size: 720px auto; }
.dashboard-page > .page-heading .title-group, .dashboard-page > .page-heading .heading-actions { position: relative; z-index: 1; }
.dashboard-page > .page-heading .heading-actions { padding-top: 13px; }

.button { min-height: 40px; border-color: var(--line); border-radius: 9px; font-weight: 600; }
.button:hover { border-color: #b9c9d4; box-shadow: 0 5px 16px rgb(24 54 78 / 8%); }
.button.primary { background: linear-gradient(135deg,#ff594b,#ee3f35); border-color: #ed4438; box-shadow: 0 8px 20px rgb(240 68 56 / 20%); }
.button.primary:hover { background: linear-gradient(135deg,#f34c40,#db352c); border-color: #da372e; box-shadow: 0 10px 24px rgb(240 68 56 / 25%); }
.dashboard-page .heading-actions .button { min-height: 46px; padding: 0 22px; font-size: 14px; }

.panel { border-color: var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.panel-header { min-height: 62px; padding: 0 21px; border-bottom-color: var(--line-soft); }
.panel-header h2 { color: var(--ink); font-size: 16px; font-weight: 680; }
.panel-header h2 small { color: #8fa0af; }
.dashboard-panel-title { display: flex; align-items: center; gap: 10px; }
.dashboard-panel-title > svg { width: 21px; height: 21px; color: var(--red); }
.dashboard-panel-title > span { display: inline-flex; align-items: baseline; }

.metric-grid { gap: 15px; margin-bottom: 16px; }
.metric-card { min-height: 112px; gap: 17px; padding: 20px 22px; border-color: var(--line); border-radius: 13px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgb(28 57 82 / 9%); }
.metric-icon { width: 54px; height: 54px; flex-basis: 54px; color: var(--blue); background: var(--blue-soft); border-radius: 13px; }
.metric-icon svg { width: 27px; height: 27px; }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-copy { position: relative; z-index: 1; }
.metric-copy small { color: #657b8f; font-size: 12px; }
.metric-copy strong { margin-top: 4px; color: #0c2b49; font-size: 29px; }
.metric-copy span { color: #97a6b4; }
.metric-watermark { position: absolute; top: 50%; right: 24px; display: grid; width: 58px; height: 58px; place-items: center; color: #6f8ba0; opacity: .1; transform: translateY(-50%); }
.metric-watermark svg { width: 48px; height: 48px; }

.two-column { grid-template-columns: minmax(0,1.78fr) minmax(330px,.92fr); gap: 16px; }
.stack { gap: 16px; }
.dashboard-page .two-column > .stack { align-content: start; }
.data-table th { padding: 11px 14px; color: #788c9e; background: #f6f9fb; border-bottom-color: var(--line); font-size: 11px; }
.data-table td { padding: 14px; border-bottom-color: var(--line-soft); font-size: 12px; }
.data-table tbody tr:hover { background: #fbfdfe; }
.data-table strong { color: #17354f; font-weight: 650; }
.cell-title { gap: 11px; }
.cell-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 8px; }
.course-cell-icon { color: var(--red); background: var(--red-soft); }
.cell-sub { margin-top: 3px; color: #96a5b3; }
.text-button { color: #f04438; font-weight: 620; }
.text-button.muted { color: #61798d; }
.text-button.muted:hover { color: var(--red); }

.status { min-height: 23px; padding: 0 9px; font-weight: 600; }
.todo-list { padding: 3px 20px 9px; }
.todo-item { grid-template-columns: 34px minmax(0,1fr) auto; gap: 11px; padding: 13px 0; }
.todo-number { width: 31px; height: 31px; color: var(--red); background: var(--red-soft); border-radius: 8px; font-size: 11px; }
.todo-copy strong { color: #183650; font-size: 12px; font-weight: 650; }
.todo-copy span { color: #95a5b3; }
.dashboard-page .empty-cell { padding: 0; }
.dashboard-page .empty-state { min-height: 164px; padding: 22px; }
.dashboard-page .todo-list .empty-state { min-height: 146px; padding: 20px; }
.empty-icon { width: 54px; height: 54px; color: #6f879a; background: linear-gradient(145deg,#eff6fa,#e7f0f5); box-shadow: 0 6px 18px rgb(35 78 108 / 7%); }
.empty-icon svg { width: 25px; height: 25px; }
.empty-state strong { color: #183650; font-weight: 680; }
.empty-state p { color: #8395a4; }

.login-dialog, .popover { border-color: var(--line); border-radius: 14px; box-shadow: 0 24px 80px rgb(19 48 72 / 22%); }

/* Course management workspace */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.courses-page > .page-heading .heading-actions { padding-top: 10px; }
.course-manager-layout { display: grid; grid-template-columns: 286px minmax(0,1fr); align-items: start; gap: 16px; }
.course-directory { position: sticky; top: calc(var(--topbar) + 18px); display: flex; max-height: calc(100vh - var(--topbar) - 42px); flex-direction: column; overflow: hidden; }
.course-directory-header { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line-soft); }
.course-directory-header > div > span, .course-directory-header > div > strong { display: block; }
.course-directory-header > div > span { color: #173650; font-size: 15px; font-weight: 690; }
.course-directory-header > div > strong { margin-top: 2px; color: #60788b; font-size: 11px; font-weight: 560; }
.course-directory-header .button { min-height: 32px; padding: 0 10px; }
.course-search { position: relative; display: flex; align-items: center; margin: 13px 14px 10px; color: #8396a6; }
.course-search > svg { position: absolute; left: 11px; z-index: 1; width: 16px; height: 16px; pointer-events: none; }
.course-search input { width: 100%; height: 38px; padding: 0 11px 0 34px; color: var(--ink); background: #f6f9fb; border: 1px solid #e3ebf0; border-radius: 9px; outline: 0; font-size: 12px; }
.course-search input::placeholder { color: #6e8393; }
.course-search input:focus { background: #fff; border-color: #a8bdca; box-shadow: 0 0 0 3px rgb(37 135 217 / 9%); }
.course-directory-list { min-height: 160px; padding: 0 9px 10px; overflow-y: auto; }
.course-directory-item { position: relative; display: grid; width: 100%; grid-template-columns: 38px minmax(0,1fr) auto 14px; align-items: center; gap: 10px; min-height: 68px; margin: 3px 0; padding: 9px 10px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 10px; text-align: left; cursor: pointer; transition: background .16s ease,border-color .16s ease,transform .16s ease; }
.course-directory-item:hover { background: #f6f9fb; border-color: #e8eef2; }
.course-directory-item:active { transform: translateY(1px); }
.course-directory-item.active { background: linear-gradient(100deg,#fff2f0,#fff8f7); border-color: #ffd9d5; box-shadow: 0 5px 16px rgb(240 68 56 / 7%); }
.course-directory-icon { display: grid; width: 38px; height: 38px; place-items: center; color: #607f96; background: #edf4f8; border-radius: 9px; }
.course-directory-icon svg { width: 20px; height: 20px; }
.course-directory-item.active .course-directory-icon { color: var(--red); background: #ffe4e0; }
.course-directory-copy { min-width: 0; }
.course-directory-copy strong, .course-directory-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-directory-copy strong { color: #183650; font-size: 12px; font-weight: 660; }
.course-directory-copy small { margin-top: 3px; color: #60788b; font-size: 10px; }
.course-directory-meta { min-width: 30px; text-align: center; }
.course-directory-meta strong, .course-directory-meta small { display: block; }
.course-directory-meta strong { color: #38576f; font-size: 12px; }
.course-directory-meta small { color: #60788b; font-size: 10px; }
.course-directory-item > .chevron { width: 14px; height: 14px; color: #a7b4bd; }
.course-directory-item.active > .chevron { color: var(--red); }
.course-search-empty { padding: 34px 16px; color: #8295a4; font-size: 11px; text-align: center; }

.course-workspace { display: grid; min-width: 0; gap: 16px; }
.course-overview { display: grid; grid-template-columns: minmax(250px,1fr) auto auto; align-items: center; gap: 22px; min-height: 126px; padding: 22px 24px; background: linear-gradient(120deg,#102f4c 0%,#173e5f 63%,#224d69 100%); border: 1px solid rgb(16 47 76 / 12%); border-radius: 14px; box-shadow: 0 13px 30px rgb(20 54 80 / 13%); }
.course-overview-main { display: flex; min-width: 0; align-items: center; gap: 15px; color: #fff; }
.course-overview-icon { display: grid; width: 52px; height: 52px; flex: 0 0 52px; place-items: center; color: #fff; background: linear-gradient(145deg,#ff6558,#ec4036); border-radius: 13px; box-shadow: 0 9px 22px rgb(0 0 0 / 17%); }
.course-overview-icon svg { width: 28px; height: 28px; }
.course-overview-main > div { min-width: 0; }
.course-overview-eyebrow { display: flex; align-items: center; gap: 8px; }
.course-overview-eyebrow > span:first-child { color: #bfd0dc; font-size: 10px; font-weight: 560; }
.course-overview .status { min-height: 20px; padding: 0 7px; background: rgb(255 255 255 / 13%); }
.course-overview .status.success { color: #7de0ae; }
.course-overview .status.pending { color: #ffd287; }
.course-overview .status.info { color: #8fd0ff; }
.course-overview h2 { overflow: hidden; margin: 5px 0 3px; font-size: 23px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.course-overview p { overflow: hidden; margin: 0; color: #aebfcb; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.course-overview-stats { display: grid; grid-template-columns: repeat(3,64px); gap: 4px; padding: 0 10px; border-right: 1px solid rgb(255 255 255 / 13%); border-left: 1px solid rgb(255 255 255 / 13%); }
.course-overview-stats div { text-align: center; }
.course-overview-stats strong, .course-overview-stats span { display: block; }
.course-overview-stats strong { color: #fff; font-size: 20px; font-weight: 710; }
.course-overview-stats span { margin-top: 2px; color: #9fb4c3; font-size: 9px; }
.course-overview-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.course-overview-actions .button { min-height: 35px; padding: 0 11px; color: #dce8ef; background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 16%); font-size: 11px; box-shadow: none; }
.course-overview-actions .button:hover { color: #fff; background: rgb(255 255 255 / 14%); border-color: rgb(255 255 255 / 28%); box-shadow: none; }
.course-overview-actions .button.dark { color: #17344b; background: #fff; border-color: #fff; }
.course-overview-actions .button:disabled { color: #7e98aa; background: rgb(255 255 255 / 5%); border-color: rgb(255 255 255 / 10%); }

.course-config-grid { display: grid; grid-template-columns: minmax(0,1.18fr) minmax(310px,.82fr); align-items: start; gap: 16px; }
.course-settings-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; padding: 20px 21px; }
.course-settings-form .form-group { margin: 0; }
.course-settings-form > .course-mapping-fields, .course-settings-form > .course-description-field, .course-settings-form > .course-form-actions { grid-column: 1 / -1; }
.course-settings-form .course-mapping-fields { padding: 15px; background: #f7fafb; border-color: #e6edf1; }
.course-settings-form .textarea-field { min-height: 84px; }
.course-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 2px; }
.course-form-actions p { margin: 0; color: #60788b; font-size: 11px; }
.course-form-actions .button { min-width: 158px; }
.course-lessons-panel { min-width: 0; overflow: hidden; }
.course-lessons-panel .loading-state, .course-lessons-panel > .empty-state { min-height: 260px; }
.course-lesson-list { max-height: 346px; padding: 7px 14px; overflow-y: auto; }
.course-lesson-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto auto; align-items: center; gap: 10px; min-height: 61px; padding: 9px 3px; border-bottom: 1px solid var(--line-soft); }
.course-lesson-item:last-child { border-bottom: 0; }
.course-lesson-index { display: grid; width: 31px; height: 31px; place-items: center; color: #53758e; background: #edf4f8; border-radius: 8px; font-size: 10px; font-weight: 650; }
.course-lesson-copy { min-width: 0; }
.course-lesson-copy strong, .course-lesson-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-lesson-copy strong { color: #1a3952; font-size: 11px; font-weight: 650; }
.course-lesson-copy small { margin-top: 3px; color: #60788b; font-size: 10px; }
.course-lesson-actions { display: grid; justify-items: end; gap: 4px; }
.course-lesson-actions > .text-button { font-size: 11px; white-space: nowrap; }
.course-lesson-duration { color: #526e82; font-size: 10px; white-space: nowrap; }
.video-metadata-toolbar { padding: 14px 17px; border-bottom: 1px solid var(--line-soft); background: #f8fbfc; }
.video-metadata-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.video-metadata-time { display: flex; align-items: center; gap: 7px; color: #254b61; font-size: 11px; }
.video-metadata-time .field { width: 76px; height: 34px; padding: 0 8px; }
.video-metadata-actions .button { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.video-metadata-counts { display: flex; flex-wrap: wrap; gap: 6px 13px; color: #60788b; font-size: 11px; }
.video-metadata-counts strong { margin-left: 3px; color: #254b61; font-variant-numeric: tabular-nums; }
.video-metadata-toolbar p { margin: 9px 0 0; color: #60788b; font-size: 11px; line-height: 1.65; }
.video-metadata-toolbar .failed, .video-metadata-counts .failed strong, .course-lesson-media .failed, .video-metadata-toolbar .video-metadata-error { color: #b84238; }
.video-metadata-error .text-button { margin-left: 7px; font-size: 11px; }
.course-lesson-media { display: flex; align-items: center; gap: 8px; }
.course-lesson-media > img { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; background: #eaf0f4; }
.course-lesson-media > span { min-width: 65px; color: #526e82; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.course-lesson-media small, .course-lesson-media > span > span { display: block; }
.course-lesson-media small { margin-bottom: 3px; color: #71899a; font-size: 10px; }
.course-lesson-media .saved { color: #25815b; }
.course-lesson-item.has-video { grid-template-columns: 34px minmax(0,1fr) auto; row-gap: 7px; padding-top: 12px; padding-bottom: 12px; }
.course-lesson-item.has-video .course-lesson-index { grid-row: 1 / span 2; }
.course-lesson-item.has-video .course-lesson-media { grid-column: 2 / -1; }
.course-lesson-footer { padding: 12px 17px 16px; border-top: 1px solid var(--line-soft); }
.course-lesson-footer .button { width: 100%; }
.course-lessons-empty { display: grid; min-height: 190px; place-items: center; align-content: center; padding: 26px; color: #7890a2; text-align: center; }
.course-lessons-empty > svg { width: 31px; height: 31px; margin-bottom: 10px; color: #8aa3b5; }
.course-lessons-empty strong { color: #38566d; font-size: 12px; }
.course-lessons-empty p { margin: 4px 0 0; font-size: 10px; }
.course-lesson-editor { padding: 17px; }
.course-lesson-editor .field, .course-lesson-editor .textarea-field { margin-bottom: 10px; }
.course-lesson-editor .textarea-field.compact { min-height: 61px; }
.course-lesson-editor .form-fields .field { margin-bottom: 0; }
.course-lesson-editor > .button { margin-top: 12px; }
.course-lesson-editor .lesson-create-head { margin-bottom: 13px; }
.course-lesson-editor .lesson-create-head > div strong, .course-lesson-editor .lesson-create-head > div span { display: block; }
.course-lesson-editor .lesson-create-head > div span { margin-top: 2px; color: #8a9aa7; font-size: 9px; }

.course-materials-panel { min-width: 0; overflow: hidden; }
.course-materials-panel .loading-state, .course-materials-panel > .empty-state { min-height: 250px; }
.course-materials-panel .progress-steps { padding-top: 17px; padding-bottom: 15px; }
.course-workflow-note { display: flex; min-height: 38px; margin: 0 20px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; color: #60788b; background: #f4f8fa; border: 1px solid #e3ebef; border-radius: 7px; font-size: 11px; }
.course-workflow-note.danger { color: #8f3933; background: #fff5f3; border-color: #f3d8d3; }
.course-workflow-note .button { min-height: 28px; }
.course-materials-panel .step-dot svg { width: 14px; height: 14px; }
.course-materials-panel .dropzone { min-height: 118px; margin-top: 17px; margin-bottom: 17px; }
.course-materials-panel .dropzone p, .course-materials-panel .file-name small, .course-materials-panel .panel-footer p { color: #60788b; font-size: 11px; }
.course-materials-panel .file-list { max-height: 300px; overflow-y: auto; }
.course-create-panel { width: 100%; max-width: 880px; }
.course-create-panel .panel-header { min-height: 76px; }
.course-create-panel .panel-header > div h2 { margin: 0; }
.course-create-panel .panel-header > div p { margin: 4px 0 0; color: #60788b; font-size: 11px; }
.course-create-panel .course-form { width: 100%; max-width: none; }
.course-create-form .textarea-field { min-height: 112px; }
.course-settings-form .field-help { color: #60788b; font-size: 11px; line-height: 1.55; }

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

@media (max-width: 1280px) {
  .mock-paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --sidebar: 212px; }
  .main-content { padding-right: 20px; padding-left: 20px; }
  .topbar { padding-right: 20px; padding-left: 20px; }
  .bank-filter-bar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bank-search-control { grid-column: 1 / 4; }
  .bank-filter-actions { grid-column: 4 / -1; justify-content: flex-end; }
  .bank-scope-bar { grid-template-columns: 1fr auto; }
  .bank-scope-bar > p { grid-column: 1 / -1; }
  .bank-layout { grid-template-columns: minmax(340px, .95fr) minmax(380px, 1.05fr); }
  .response-layout { grid-template-columns: 300px minmax(410px, 1.15fr) 290px; }
  .course-manager-layout { grid-template-columns: 252px minmax(0,1fr); }
  .course-config-grid { grid-template-columns: minmax(0,1.15fr) minmax(275px,.85fr); }
  .course-settings-form { grid-template-columns: 1fr; }
  .course-overview { grid-template-columns: minmax(260px,1fr) auto; }
  .course-overview-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .course-overview-stats { border-right: 0; }
}

@media (max-width: 1100px) {
  :root { --sidebar: 196px; }
  .brand { gap: 10px; padding-right: 14px; padding-left: 14px; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .brand-copy strong { font-size: 16px; }
  .main-content { padding-right: 16px; padding-left: 16px; }
  .topbar { padding-right: 16px; padding-left: 16px; }
  .top-actions { gap: 8px; }
  .preview-state { margin-right: 0; }
  .account-copy { display: none; }
  .bank-filter-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bank-search-control { grid-column: 2 / 4; }
  .bank-filter-actions { grid-column: 4; }
  .bank-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .bank-question-list { max-height: 410px; }
  .course-manager-layout { grid-template-columns: 220px minmax(0,1fr); gap: 12px; }
  .course-directory-item { min-height: 72px; grid-template-columns: minmax(0,1fr) auto 12px; gap: 8px; padding-right: 8px; padding-left: 10px; }
  .course-directory-icon { display: none; }
  .course-directory-copy strong { display: -webkit-box; overflow: hidden; line-height: 1.35; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .course-config-grid { grid-template-columns: 1fr; }
  .course-overview { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .course-overview-stats { grid-column: 1; grid-template-columns: repeat(3,1fr); padding: 14px 0 0; border-top: 1px solid rgb(255 255 255 / 13%); border-left: 0; }
  .course-overview-actions { grid-column: 1; }
}

@media print {
  .sidebar, .topbar, .heading-actions, .toast-stack { display: none !important; }
  .workspace { width: 100%; margin: 0; }
  .main-content { padding: 0; }
  .panel { box-shadow: none; }
}


/* Learning analytics: separate function and learner views. */
.side-nav-group { margin-top: 5px; }
.side-nav-group-title { display: flex; height: 46px; align-items: center; gap: 13px; padding: 0 13px; color: #668298; font-weight: 540; }
.side-nav-group-title svg { width: 21px; height: 21px; }
.side-nav-group > a { height: 39px; margin: 2px 0; padding-left: 47px; font-size: 13px; }
.analytics-module-tabs { display: flex; gap: 8px; margin-bottom: 20px; padding: 5px; background: #eaf0f4; border-radius: 12px; }
.analytics-module-tab { min-height: 46px; flex: 1; padding: 10px 18px; color: var(--muted); background: transparent; border-radius: 8px; cursor: pointer; font-weight: 600; }
.analytics-module-tab.active { color: var(--red); background: #fff; box-shadow: 0 2px 7px rgb(30 61 83 / 8%); }
.analytics-module-tab:hover { color: var(--red); }
.analytics-detail-panel { margin-bottom: 18px; overflow: hidden; }
#analyticsFeatureDetail { scroll-margin-top: calc(var(--topbar) + 20px); }
.analytics-records-table { min-width: 610px; }
.analytics-records-table td:first-child { min-width: 180px; max-width: 360px; white-space: normal; }
.analytics-records-table .student-progress { min-width: 140px; }
.analytics-learner-layout { display: grid; grid-template-columns: 245px minmax(0, 1fr); align-items: start; gap: 18px; }
.analytics-learner-directory { position: sticky; top: calc(var(--topbar) + 20px); overflow: hidden; }
#analyticsLearnerList { max-height: calc(100vh - 260px); overflow: auto; }
.analytics-learner-row { display: flex; width: 100%; min-height: 76px; align-items: center; gap: 11px; padding: 12px 15px; text-align: left; background: #fff; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.analytics-learner-row > span:nth-child(2) { min-width: 0; flex: 1; }
.analytics-learner-row strong, .analytics-learner-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-learner-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.analytics-learner-row.active, .analytics-learner-row:hover { background: #fff4f1; }
.analytics-learner-row.active strong { color: var(--red); }
.analytics-learner-row .avatar { width: 35px; height: 35px; flex: 0 0 35px; }
.analytics-learner-content { min-width: 0; }
.analytics-student-heading { display: flex; align-items: center; gap: 13px; margin: 0 0 20px; }
.analytics-student-heading h2 { margin: 0; font-size: 21px; }
.analytics-student-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.analytics-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.analytics-summary-card { padding: 18px; }
.analytics-summary-card h3 { margin: 0 0 13px; font-size: 15px; }
.analytics-summary-card .cell-sub { display: block; margin-top: 8px; font-size: 11px; }
.analytics-summary-card p { margin: 12px 0 0; color: var(--muted); font-size: 11px; }
@media (max-width: 1100px) {
  .analytics-learner-layout { grid-template-columns: 210px minmax(0,1fr); gap: 12px; }
  .analytics-summary-card { padding: 15px; }
  .analytics-summary-card .cell-sub { white-space: normal; }
}

.analytics-progress-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }

.home-banner-intro { margin-bottom: 20px; }
.home-banner-intro h2 { margin: 0 0 7px; font-size: 21px; }
.home-banner-intro p, .home-banner-help { color: var(--muted); font-size: 12px; line-height: 1.7; }
.home-banner-intro p { margin: 0; }
.home-banner-layout { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(350px, 1.15fr); align-items: start; gap: 20px; }
.home-banner-list, .home-banner-editor { min-width: 0; overflow: hidden; }
.home-banner-list-body { padding: 16px; }
.home-banner-card { overflow: hidden; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; }
.home-banner-card:last-child { margin-bottom: 0; }
.home-banner-card.active { border-color: var(--red); }
.home-banner-preview { display: flex; width: 100%; aspect-ratio: 700 / 246; align-items: center; justify-content: center; overflow: hidden; background: #edf2f6; border-radius: 8px; }
.home-banner-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-banner-placeholder { padding: 15px; color: var(--subtle); font-size: 12px; text-align: center; }
.home-banner-card .home-banner-preview { border-radius: 0; }
.home-banner-card-body { padding: 14px; }
.home-banner-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.home-banner-card-heading strong { overflow-wrap: anywhere; }
.home-banner-card-heading .status { flex: 0 0 auto; }
.home-banner-card-body p { margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.home-banner-help { margin: 8px 0 14px; }
.home-banner-fields { display: grid; gap: 14px; min-width: 0; margin: 20px 0; padding: 0; border: 0; }
.home-banner-fields > label { min-width: 0; }
.home-banner-fields .form-label { display: block; margin-bottom: 7px; }
.home-banner-fields .home-banner-help { margin-bottom: 0; }
.home-banner-enabled { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.home-banner-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.home-banner-project-preview { display: flex; align-items: center; gap: 18px; width: 100%; height: 100%; padding: 18px; background: #fff7f5; }
.home-banner-project-logo { display: flex; align-items: center; justify-content: center; width: 36%; height: 100%; flex-shrink: 0; }
.home-banner-project-logo img { object-fit: contain; }
.home-banner-project-preview > strong { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--red); font-size: 16px; }
.home-banner-project-preview > strong svg { width: 16px; height: 16px; flex-shrink: 0; }
.home-banner-cover { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.home-banner-cover-preview { aspect-ratio: 16 / 9; }
.home-banner-cover-controls .button { margin-top: 8px; }
.home-banner-sections { min-width: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.home-banner-sections > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.home-banner-sections h3 { margin: 0; font-size: 15px; }
.home-banner-section { position: relative; display: grid; gap: 14px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.home-banner-drag-handle { display: flex; align-items: center; justify-content: center; width: 36px; height: 40px; padding: 0; flex: 0 0 auto; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: var(--paper); cursor: grab; touch-action: none; }
.home-banner-drag-handle span { font-size: 26px; line-height: 1; }
.home-banner-drag-handle:hover { color: var(--red); border-color: var(--red); }
.home-banner-drag-handle:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.home-banner-drag-handle:disabled { opacity: .4; cursor: default; }
.home-banner-section.is-dragging { opacity: .5; }
.home-banner-section.home-banner-drop-before::before, .home-banner-section.home-banner-drop-after::after { position: absolute; right: 0; left: 0; height: 3px; border-radius: 2px; background: var(--red); content: ''; }
.home-banner-section.home-banner-drop-before::before { top: -10px; }
.home-banner-section.home-banner-drop-after::after { bottom: -10px; }
.home-banner-reordering, .home-banner-reordering * { cursor: grabbing !important; user-select: none !important; }
.home-banner-section-heading { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.home-banner-section-heading label { flex: 1; min-width: 150px; }
.home-banner-section textarea { width: 100%; min-height: 140px; resize: vertical; line-height: 1.7; }
@media (max-width: 1100px) {
  .home-banner-layout { grid-template-columns: minmax(0, 1fr); }
}

.account-management-intro h1 { margin: 0 0 6px; font-size: 23px; }
.account-management-intro p, .account-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.account-management-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.account-management-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-form { display: grid; min-width: 0; gap: 12px; margin: 0; padding: 0; border: 0; }
.account-form label { min-width: 0; }
.account-import-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.account-import-file span { overflow-wrap: anywhere; }
.account-table { overflow: hidden; }
.account-table-wrap { max-height: 460px; overflow: auto; }
.account-table-wrap th { position: sticky; top: 0; }
.operation-log-table { min-width: 600px; }
.operation-log-table .operation-log-time { white-space: nowrap; }
.operation-log-table code { overflow-wrap: anywhere; }
