/* Independent September design study. Original document styles remain intact. */
:root {
  --page-bg: #f4f8fd;
  --surface: #fff;
  --surface-muted: #f4f8fd;
  --border: #dfe8f2;
  --primary: #3269ad;
  --primary-soft: #e8f1fc;
  --text: #26384d;
  --muted: #66788e;
  --ui-title: 24px;
  --ui-section: 18px;
  --ui-body: 14px;
  --ui-control: 13px;
  --ui-caption: 12px;
  --ui-nav-primary: 16px;
  --ui-weight-heading: 600;
  --ui-weight-body: 400;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
}
html, body { min-width: 0; background: var(--page-bg); }
.app-shell { min-height: 100dvh; background: var(--page-bg); }
.app-shell:not(.function-sidebar-collapsed) { grid-template-columns: 192px minmax(0, 1fr); }
.app-shell .function-sidebar { background: #f4f8fd !important; border-right: 1px solid var(--border); box-shadow: none; padding: 20px 12px; }
.function-sidebar .brand { padding: 0 8px 22px; gap: 9px; border-bottom: 1px solid var(--border); }
.function-sidebar .brand-mark { background: transparent; height: 48px; width: 144px; box-shadow: none; }
.function-sidebar .brand-mark img { object-fit: contain; }
.function-sidebar .brand-name { color: #26384d; font-size: 18px; font-weight: 650; letter-spacing: .5px; }
.function-sidebar .function-sidebar-toggle { background: #fff; color: #66788e; border: 1px solid var(--border); box-shadow: none; border-radius: 5px; }
.function-nav { gap: 22px; padding-top: 20px; }
.function-group { padding: 0; background: transparent !important; }
.function-group-title { min-height: 36px; color: #66788e; }
.function-group-title strong { font-size: 12px !important; font-weight: 600; }
.function-group-title > span, .function-link > span { background: transparent !important; color: #6d83a0; box-shadow: none; }
.function-group-items { margin-top: 4px; gap: 4px; }
.function-link { min-height: 40px; border-radius: 6px; color: #4e637c; }
.function-link b { font-size: 13px; font-weight: 500; }
.app-shell:not(.function-sidebar-collapsed) .function-group-title > strong,
.app-shell:not(.function-sidebar-collapsed) .function-link > b { left: 43px; }
.function-group-direct { min-height: 42px; border-radius: 6px; }
.function-group-direct strong { font-size: 14px !important; }
.function-group-direct[aria-current="page"], .function-link.active { background: #e5effc !important; color: #3269ad !important; }
.function-group-direct[aria-current="page"] > span, .function-link.active > span { color: #3269ad !important; }
.function-link:hover, .function-group-direct:hover { background: #edf4fc; }
.app-content { min-width: 0; }
.app-content[data-route="editor-lab"]:has(.editor-lab:not(.is-preview-mode)) { height: 100dvh; overflow: hidden; }
.editor-lab:not(.is-preview-mode) { height: 100dvh; min-height: 0 !important; display: flex; flex-direction: column; padding: 0 !important; background: #edf3fa !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-header { flex: 0 0 auto; min-height: 76px !important; padding: 12px 162px 12px 24px !important; gap: 14px !important; border-bottom: 1px solid var(--border) !important; box-shadow: none !important; }
.editor-lab .editor-lab-header h1 { font-size: 17px !important; color: #26384d; font-weight: 650; }
.editor-lab-heading { gap: 10px !important; }
.editor-lab-document-identity small { color: #66788e; font-size: 11px; }
.editor-lab-status { gap: 10px !important; }
.editor-lab-status small[data-editor-lab-save-status] { min-width: 0; font-size: 11px !important; color: #66788e !important; }
.editor-lab-status > [data-preview-entry] { min-height: 36px !important; border-radius: 6px !important; padding: 0 14px !important; background: #3269ad !important; border-color: #3269ad !important; box-shadow: none !important; font-size: 13px; }
.editor-lab-status .editor-lab-exit-menu > button { min-height: 36px !important; padding: 0 12px; border-radius: 6px !important; box-shadow: none; }
.editor-lab:not(.is-preview-mode) .editor-lab-toolbar { flex: 0 0 auto; min-height: 0 !important; padding: 0 24px !important; background: #fff !important; box-shadow: none !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-primary-actions { min-height: 54px !important; flex-wrap: wrap !important; gap: 6px !important; padding: 9px 0 !important; border-bottom: 1px solid var(--border) !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-primary-actions::before,
.editor-lab:not(.is-preview-mode) .editor-lab-format-label { width: 42px !important; flex-basis: 42px !important; padding-left: 0 !important; color: #66788e !important; font-size: 11px !important; font-weight: 500 !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-primary-actions button { height: 32px !important; min-height: 32px !important; padding: 0 12px !important; background: #f2f7fe !important; color: #3f648e !important; border: 1px solid #dce7f5 !important; border-radius: 5px !important; font-size: 12px !important; font-weight: 500 !important; box-shadow: none !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-primary-actions button:hover { background: #e4effd !important; border-color: #a9c5e8 !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-format-row { height: auto !important; min-height: 70px !important; padding: 10px 0 !important; align-items: flex-start !important; gap: 6px !important; }
.editor-lab-format-label { padding-top: 20px; }
.editor-lab-format-groups { flex-wrap: wrap; gap: 10px 12px !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-ribbon-group { border-color: var(--border) !important; padding-right: 12px !important; }
.editor-lab-insert-group { flex: 1 1 220px !important; height: auto; min-height: 56px; }
.editor-lab-insert-group .editor-lab-ribbon-subrow { min-width: 0; flex-wrap: wrap; gap: 5px !important; }
.editor-lab .editor-lab-toolbar select,
.editor-lab .editor-lab-format-row button,
.editor-lab .editor-lab-format-row summary { color: #4e637c !important; border-color: #dfe8f2 !important; background: #fff; box-shadow: none !important; border-radius: 4px !important; }
.editor-lab .editor-lab-format-row button:hover { background: #edf3fb !important; }
.editor-lab .editor-lab-format-row button.is-active { background: #e5effc !important; color: #3269ad !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-body { flex: 1 1 auto; min-height: 0; display: flex; margin: 0 !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-editor-column { min-height: 0; width: 100%; flex: 1; display: flex; flex-direction: column; border: 0 !important; }
.editor-lab:not(.is-preview-mode) .editor-version-bar { flex: 0 0 auto; padding: 10px 24px !important; gap: 12px !important; background: #f9fbfe !important; border-top: 1px solid var(--border) !important; border-bottom: 1px solid var(--border) !important; box-shadow: none !important; }
.editor-lab.is-lecture-common .editor-lecture-mode-bar { grid-template-columns: minmax(160px, 1fr) auto auto !important; grid-template-areas: "copy mode versions" !important; }
.editor-version-mode-copy strong { color: #4e637c; font-size: 12px !important; font-weight: 600; }
.editor-version-mode-copy small { color: #66788e !important; font-size: 11px; }
.editor-lecture-mode-switch { border: 1px solid #dce6f3; background: #edf3fb; border-radius: 6px; padding: 3px; }
.editor-lecture-mode-switch button { min-height: 29px; border-radius: 4px; padding: 0 12px; font-size: 12px; font-weight: 500; color: #66788e; }
.editor-lecture-mode-switch button.active { color: #3269ad; background: #fff; box-shadow: none; }
.editor-common-mode-status { gap: 6px; }
.editor-common-mode-status strong { color: #536c89 !important; font-weight: 500; }
.editor-lab:not(.is-preview-mode) .editor-lab-paper-viewport { flex: 1 1 auto; min-height: 0; overflow: auto; background: #edf3fa !important; padding: 32px 24px 72px !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-paper { box-shadow: 0 2px 12px rgb(38 67 108 / 4%) !important; border: 1px solid #dfe8f2; }
.editor-document-status { position: relative !important; inset: auto !important; flex: 0 0 auto; width: 100% !important; min-height: 42px !important; padding: 6px 24px !important; background: #f9fbfe !important; border-top: 1px solid var(--border) !important; box-shadow: none !important; color: #66788e; }
.editor-document-status button, .editor-document-status select { border-color: #dfe8f2 !important; box-shadow: none !important; border-radius: 4px !important; }
.editor-document-status strong { color: #496b93 !important; }
.lecture-home { background: #f9fbfe !important; }
.lecture-home :is(.lecture-home-card, .lecture-export-card, .lecture-file-panel) { box-shadow: none !important; border-color: var(--border) !important; border-radius: 8px !important; }
.lecture-home :is(h1, h2, h3) { color: #26384d; }
.lecture-home :is(.lecture-file-row, .lecture-export-row) { border-color: #e3ebf4 !important; }
:is(button, a, select, input, summary):focus-visible { outline: 2px solid #467ebf !important; outline-offset: 3px; }
:is(button, a) { transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
@media (max-width: 1100px) {
  .app-shell:not(.function-sidebar-collapsed) { grid-template-columns: 172px minmax(0, 1fr); }
  .editor-lab:not(.is-preview-mode) .editor-lab-header { flex-wrap: wrap; padding-right: 146px !important; }
  .editor-lab-status { flex-wrap: nowrap !important; }
  .editor-lab.is-lecture-common .editor-lecture-mode-bar { grid-template-columns: minmax(0, 1fr) auto !important; grid-template-areas: "copy mode" "versions versions" !important; }
}
@media (max-width: 720px) {
  .app-shell:not(.function-sidebar-collapsed) { grid-template-columns: 64px minmax(0, 1fr); }
  .function-sidebar { padding: 12px 5px !important; }
  .function-sidebar :is(.brand-name, .function-group-title strong, .function-link b, .brand-mark, .function-sidebar-toggle) { display: none; }
  .function-sidebar .brand { min-height: 16px; padding: 0; }
  .function-group-title, .function-link { justify-content: center; }
  .editor-lab:not(.is-preview-mode) .editor-lab-header { padding-left: 14px !important; }
  .editor-lab:not(.is-preview-mode) .editor-lab-toolbar { padding: 0 12px !important; max-height: 32dvh; overflow: auto; }
  .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions::before, .editor-lab-format-label { display: none !important; }
  .editor-version-mode-copy small { display: none; }
  .editor-lab:not(.is-preview-mode) .editor-version-bar { padding: 8px 12px !important; }
  .editor-document-status { padding: 6px 12px !important; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { :is(button, a) { transition: none; } }
.app-shell .app-content .editor-lab:not(.is-preview-mode) .editor-lab-body { align-items: stretch !important; overflow: hidden; }
.app-shell .app-content .editor-lab:not(.is-preview-mode) .editor-lab-editor-column { align-self: stretch; height: 100%; overflow: hidden; }
.app-shell .app-content .editor-lab:not(.is-preview-mode) .editor-lab-header { background: #fff !important; }
.app-shell .app-content .editor-lab [data-preview-entry] { background: #3269ad !important; border-color: #3269ad !important; color: #fff !important; box-shadow: none !important; }
.app-shell .app-content .editor-lab [data-editor-document-mode] { min-height: 32px !important; padding: 0 16px !important; border-radius: 4px !important; font-size: 12px; color: #66788e !important; box-shadow: none !important; }
.app-shell .app-content .editor-lab [data-editor-document-mode][aria-pressed="true"] { color: #3269ad !important; background: #fff !important; }
.app-shell .function-sidebar .function-group-direct[aria-current="page"] strong { color: #3269ad !important; }
.editor-lab:not(.is-preview-mode) .editor-lab-insert-group { grid-template-rows: auto !important; }
.editor-version-view-tabs { background: #edf3fb !important; border-color: #dce6f3 !important; border-radius: 6px !important; padding: 3px !important; }
.editor-version-view-tabs button { color: #536c89 !important; border-radius: 4px !important; box-shadow: none !important; font-weight: 500 !important; }
.editor-version-view-tabs button.active { color: #3269ad !important; background: #fff !important; }
.app-shell .app-content .editor-lab:not(.is-preview-mode) .editor-lab-header .editor-document-type { background: #edf3fb !important; border: 1px solid #dce6f3 !important; box-shadow: none !important; border-radius: 6px !important; padding: 3px !important; min-height: 0 !important; }
.app-shell .function-sidebar .brand { width: 100%; max-width: 100%; }
.app-shell .function-sidebar .brand-mark { max-width: 100%; }
.app-shell .function-sidebar .brand-mark img { max-width: 100%; }
.app-shell .lecture-home .lecture-home-shell { border: 0; border-radius: 0; box-shadow: none; }
.app-shell .lecture-home .lecture-home-sidebar { background: #f4f8fe; border-color: var(--border); padding: 20px 16px; }
.app-shell .lecture-home .lecture-home-new { background: #3269ad; border-color: #3269ad; border-radius: 6px; min-height: 42px; box-shadow: none; font-size: 14px; }
.app-shell .lecture-home .lecture-home-nav { color: #536c89; min-height: 40px; border-radius: 5px; font-size: 13px; font-weight: 500; }
.app-shell .lecture-home .lecture-home-nav.active { background: #e5effc; color: #3269ad; }
.app-shell .lecture-home .lecture-home-heading h1 { font-size: 25px; font-weight: 650; }
.app-shell .lecture-home .lecture-home-filters { background: #f5f9fe; border-color: #dfe8f2; border-radius: 6px; }
.app-shell .lecture-home .lecture-home-filters :is(label, input, select, button) { color: #4e637c; font-weight: 400; }
.app-shell .lecture-home .lecture-home-filters :is(input, select, button) { border-radius: 5px; border-color: #dfe8f2; box-shadow: none; }
.app-shell .lecture-home .lecture-home-list-head { background: #f0f5fc; border-color: #dfe8f2; color: #536c89; font-size: 12px; font-weight: 500; }
.app-shell .lecture-home .lecture-home-row { border-bottom: 1px solid #e7eef7; border-radius: 0; box-shadow: none; }
.app-shell .lecture-home .lecture-home-row:hover { background: #f7faff; }
.app-shell .lecture-home .lecture-home-name strong { color: #26384d; font-weight: 600; }
.app-shell .lecture-home .lecture-home-icon { color: #527baa; background: #edf4fd; border-radius: 6px; }
.app-shell .lecture-home :is(.lecture-home-mode, .lecture-home-state) { border-radius: 4px; font-weight: 500; }
.app-shell .lecture-home .lecture-home-link { color: #3269ad; border-radius: 4px; border-color: #dce7f5; }
/* Interface hierarchy only; editable document typography keeps its own settings. */
.app-shell .function-sidebar .brand-name { font-size: 20px !important; line-height: 1.4; font-weight: 600; color: #294564 !important; }
.app-shell .function-sidebar .function-group-title strong { font-size: var(--ui-nav-primary) !important; line-height: 1.5; font-weight: 600; color: #26384d; }
.app-shell .function-sidebar .function-group-direct strong { font-size: var(--ui-nav-primary) !important; font-weight: 600; }
.app-shell .function-sidebar .function-link b { font-size: var(--ui-body) !important; line-height: 1.5; font-weight: 400; color: #4e637c; }
.app-shell .function-sidebar .function-link.active b { color: #3269ad !important; font-weight: 600; }
.app-shell .lecture-home .lecture-home-heading h1 { font-size: var(--ui-title) !important; line-height: 1.4; font-weight: 600; }
.app-shell .lecture-home .lecture-home-nav { font-size: var(--ui-body); }
.app-shell .lecture-home .lecture-home-nav { gap: 6px; padding-left: 8px; padding-right: 8px; }
.app-shell .lecture-home .lecture-home-nav b { white-space: nowrap; font-weight: 400; }
.app-shell .lecture-home .lecture-home-nav.active b { font-weight: 600; }
.app-shell .lecture-home .lecture-home-nav em { padding: 2px 5px; }
.app-shell .lecture-home .lecture-home-list { overflow-x: auto; }
.app-shell .lecture-home .lecture-home-list-head,
.app-shell .lecture-home .lecture-home-row { min-width: 730px; }
.app-shell .lecture-home .lecture-home-nav-title { font-size: var(--ui-caption); color: #66788e; }
.app-shell .lecture-home .lecture-home-filters label { font-size: var(--ui-caption); font-weight: 500; }
.app-shell .lecture-home .lecture-home-filters :is(input, select, button) { font-size: var(--ui-control); }
.app-shell .lecture-home .lecture-home-list-head { font-size: var(--ui-control); font-weight: 600; line-height: 1.5; }
.app-shell .lecture-home .lecture-home-name strong { font-size: var(--ui-body); line-height: 1.5; font-weight: 400; }
.app-shell .lecture-home .lecture-home-name :is(small, p),
.app-shell .lecture-home .lecture-home-cell { font-size: var(--ui-caption); line-height: 1.5; color: #66788e; }
.app-shell .lecture-home .lecture-home-icon.sync { color: #527baa !important; background: #edf4fd !important; }
.app-shell .lecture-home .lecture-home-new:hover { background: #2b5e9e; }
.app-shell .editor-lab .editor-lab-header h1 { font-size: var(--ui-section) !important; line-height: 1.4; font-weight: 600; }
.app-shell .editor-lab .editor-lab-document-identity small,
.app-shell .editor-lab .editor-lab-status small[data-editor-lab-save-status] { font-size: var(--ui-caption) !important; line-height: 1.5; }
.app-shell .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions button { font-size: var(--ui-control) !important; }
.app-shell .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions::before,
.app-shell .editor-lab:not(.is-preview-mode) .editor-lab-format-label { font-size: var(--ui-caption) !important; }
.app-shell .editor-lab .editor-version-mode-copy strong { font-size: var(--ui-control) !important; }
.app-shell .editor-lab .editor-version-mode-copy small,
.app-shell .editor-lab .editor-common-mode-status :is(strong, span),
.app-shell .editor-lab .editor-document-status { font-size: var(--ui-caption) !important; }
.app-shell .editor-lab .editor-lab-status [data-preview-entry]:hover { background: #2b5e9e !important; }
/* Same semantic roles across management pages; never target document headings. */
.app-shell .app-content[data-route="s04"] h2 { font-size: var(--ui-section) !important; line-height: 1.5; font-weight: 600 !important; color: #26384d; }
.app-shell .app-content[data-route="s04"] .qm-knowledge-root h3 { font-size: var(--ui-nav-primary) !important; line-height: 1.5; font-weight: 600; }
.app-shell .app-content[data-route="s04"] .qm-list-item > strong { font-size: var(--ui-body); font-weight: 400; line-height: 1.5; }
.app-shell .app-content[data-route="s04"] .qm-list-item.selected > strong { font-weight: 600; }
.app-shell .app-content[data-route="s01"] .import-upload-heading h2,
.app-shell .app-content[data-route="s01"] h1.panel-title { font-size: var(--ui-title) !important; line-height: 1.4; font-weight: 600; color: #26384d; }
.app-shell .app-content[data-route="s01"] .import-record-section-copy h2,
.app-shell .app-content[data-route="s01"] .task-panel-heading h2,
.app-shell .app-content[data-route="s01"] .current-batch-heading h2 { font-size: var(--ui-section) !important; line-height: 1.5; font-weight: 600; color: #26384d; }
.app-shell .lecture-home :is(.lecture-home-new, .lecture-home-filters button),
.app-shell .editor-lab .editor-lab-header :is(button, select) { font-size: var(--ui-body) !important; font-weight: 500 !important; }
.app-shell .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions button { font-weight: 500 !important; }
.app-shell .editor-lab .editor-version-mode-copy strong { font-size: var(--ui-body) !important; font-weight: 600 !important; }
.app-shell .editor-lab .editor-common-mode-status :is(strong, span),
.app-shell .editor-lab .editor-document-status :is(strong, span) { font-size: var(--ui-caption) !important; font-weight: 400 !important; }
@media (max-width: 1100px) {
  .app-shell .app-content .editor-lab:not(.is-preview-mode) .editor-lab-header { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; padding-right: 24px !important; gap: 10px !important; }
  .editor-lab:not(.is-preview-mode) .editor-lab-heading { grid-column: 1 / -1; width: auto !important; padding-right: 136px; }
  .editor-lab:not(.is-preview-mode) .editor-document-type { justify-self: start; }
  .editor-lab:not(.is-preview-mode) .editor-lab-status { width: auto !important; }
}

/* Editor controls: one primary action, quiet formatting, explicit interaction states.
   Scoped to the editor route; document content and navigation are unaffected. */
.app-content[data-route="editor-lab"] .editor-lab {
  --editor-control-border: #d7e4f3;
  --editor-control-hover: #e7f1fe;
  --editor-control-active: #dceafe;
  --editor-control-ink: #385676;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-header {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
  border-bottom-color: #e7edf5 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-back {
  width: 36px !important; height: 36px !important;
  min-width: 36px; display: grid; place-items: center;
  border: 1px solid #e1e9f3 !important; border-radius: 8px !important;
  background: #fff !important; color: #526b86 !important; box-shadow: none !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-back:hover { background: #edf5ff !important; border-color: #b7cde8 !important; }
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-header .editor-document-type {
  padding: 3px !important; border-radius: 8px !important;
  border-color: #e3ebf6 !important; background: #f0f5fc !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-header .editor-document-type button {
  min-height: 32px !important; padding: 0 22px !important; border-radius: 5px !important;
  color: #60758f !important; font-size: 13px !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-header .editor-document-type button[aria-pressed="true"] {
  color: #275f9f !important; background: #fff !important; font-weight: 600 !important;
  box-shadow: 0 1px 3px rgb(37 76 120 / 5%) !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-preview-entry],
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-direct-export] {
  min-height: 38px !important; padding: 0 18px !important;
  border: 1px solid #3269ad !important; border-radius: 8px !important;
  background: #3269ad !important; color: #fff !important; font-size: 14px !important; font-weight: 600 !important;
  box-shadow: 0 2px 4px rgb(38 86 149 / 8%) !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-preview-entry]:hover,
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-direct-export]:hover {
  background: #285e9f !important; border-color: #285e9f !important; filter: none !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-editor-more],
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-preview-mode] {
  min-height: 38px !important; padding: 0 14px !important;
  color: #4e6580 !important; background: #fff !important;
  border: 1px solid #dce6f2 !important; border-radius: 8px !important; box-shadow: none !important;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions {
  min-height: 56px !important; padding: 10px 0 !important; gap: 8px !important;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions button {
  height: 36px !important; min-height: 36px !important;
  padding: 0 14px !important; border-radius: 7px !important;
  background: #edf5ff !important; border-color: #d8e7f8 !important;
  color: #315e90 !important; font-size: 13px !important; font-weight: 500 !important;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions :is([data-editor-command="textBox"], [data-insert-temp-question], [data-insert-temp-knowledge]) {
  color: #4c637e !important; background: #fff !important; border-color: #dce5ef !important;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions button:hover {
  background: #e0edff !important; border-color: #adc9ec !important; color: #24588f !important;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-format-row {
  padding: 10px 0 !important; gap: 8px !important;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-format-label {
  padding-top: 22px; color: #5d7490 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-format-groups { gap: 10px 14px !important; align-items: flex-start; }
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-group {
  height: 64px; grid-template-rows: repeat(2, 30px); gap: 4px;
  padding-right: 14px !important; border-right-color: #e5edf7 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-history-group { grid-template-rows: 30px; align-content: center; }
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-insert-group {
  height: auto; min-height: 64px; align-content: center; grid-template-rows: auto !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-subrow { gap: 4px; }
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-subrow :is(button, select),
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-color-control {
  height: 30px !important; min-height: 30px !important; border-radius: 5px !important;
  font-size: 13px !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-subrow button {
  min-width: 30px !important; padding: 0 8px !important;
  border: 1px solid #e0e8f2 !important; background: #fff !important; color: #354e6a !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-subrow button b { font-weight: 700 !important; }
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-subrow select {
  background: #f8fbff !important; border: 1px solid #dce7f5 !important; color: #405976 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-color-control summary {
  height: 30px; padding: 0 7px; border: 1px solid transparent !important;
  border-radius: 5px !important; background: transparent !important; color: #405976 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-subrow button:hover,
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-color-control summary:hover {
  background: #e7f1fe !important; border-color: #c6daf2 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-subrow button:is(.active, .is-active, [aria-pressed="true"]),
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-color-control[open] summary {
  background: #dceafe !important; border-color: #a7c6ed !important; color: #23568f !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch {
  padding: 3px; border-radius: 8px; border-color: #dce7f5; background: #edf4fd;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button {
  min-height: 32px; padding: 0 14px; border-radius: 5px; font-size: 13px; color: #5c728c;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button.active {
  background: #fff; color: #2b609f; font-weight: 600; box-shadow: 0 1px 3px rgb(37 76 120 / 5%);
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs {
  padding: 0 !important; gap: 6px; background: transparent !important; border: 0 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button {
  min-height: 38px; border: 1px solid transparent !important; border-radius: 6px !important;
  background: transparent !important; color: #60758f !important; padding: 6px 12px !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button strong { font-size: 13px; font-weight: 500; color: inherit; }
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button :is(span, b, i) { font-size: 11px; font-weight: 400; color: #677e99; }
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button.active {
  border-color: #bdd4f0 !important; background: #e8f2ff !important; color: #285f9f !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button.active strong { font-weight: 600; }
.app-content[data-route="editor-lab"] .editor-lab .editor-document-status { min-height: 46px !important; background: #fff !important; }
.app-content[data-route="editor-lab"] .editor-lab .editor-document-status :is(button, select) {
  height: 30px !important; min-height: 30px !important; border-radius: 6px !important;
  color: #526d8d; background: #f8fbff; border: 1px solid #dce7f5 !important;
}
.app-content[data-route="editor-lab"] .editor-lab :is(.editor-lab-header, .editor-lab-toolbar, .editor-version-bar, .editor-document-status) :is(button, a, summary, select) {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.app-content[data-route="editor-lab"] .editor-lab :is(.editor-lab-header, .editor-lab-toolbar, .editor-version-bar, .editor-document-status) :is(button, a, summary):active {
  transform: none; box-shadow: inset 0 1px 3px rgb(32 68 110 / 12%);
}
.app-content[data-route="editor-lab"] .editor-lab :is(.editor-lab-header, .editor-lab-toolbar, .editor-version-bar, .editor-document-status) :is(button, a, summary, select):focus-visible {
  outline: 2px solid #3c78bf !important; outline-offset: 2px;
}
.app-content[data-route="editor-lab"] .editor-lab button:disabled {
  opacity: .45; cursor: not-allowed; transform: none !important;
}
.app-content[data-route="editor-lab"] .editor-lab :is(.editor-lab-exit-popover, .editor-lab-color-menu) {
  border: 1px solid #d8e5f5; border-radius: 8px;
  padding: 8px; background: #fff; box-shadow: 0 4px 16px rgb(44 78 119 / 8%);
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button:not(.active):hover,
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button:not(.active):hover,
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-editor-more]:hover,
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-editor-more][aria-expanded="true"],
.app-content[data-route="editor-lab"] .editor-lab .editor-document-status button:not(:disabled):hover {
  background: #e7f1fe !important; color: #2b609f !important; border-color: #bed4ef !important;
}
.app-content[data-route="editor-lab"] #editor-lab-handout-picker > form {
  border: 1px solid #dce7f5; border-radius: 12px; background: #fff;
}
.app-content[data-route="editor-lab"] #editor-lab-handout-picker .handout-picker-filters :is(input, select),
.app-content[data-route="editor-lab"] #editor-lab-handout-picker input[type="search"] {
  min-height: 36px; border: 1px solid #dce7f5; border-radius: 7px; background: #f8fbff;
}
.app-content[data-route="editor-lab"] #editor-lab-handout-picker .editor-handout-picker-item {
  border-color: #e3ebf6; border-radius: 8px; box-shadow: none;
}
.app-content[data-route="editor-lab"] #editor-lab-handout-picker .editor-handout-picker-item button {
  border: 1px solid #d1e2f7; border-radius: 7px; background: #edf5ff; color: #315e90; font-weight: 500;
}
.app-content[data-route="editor-lab"] #editor-lab-handout-picker .editor-handout-picker-item button:hover { background: #dfeeff; border-color: #a9c6ec; }
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-exit-popover button:not([data-discard-session]) {
  color: #3d5c80 !important; background: #fff !important; border-color: transparent !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-exit-popover button:not([data-discard-session]):hover { background: #edf5ff !important; }
.app-content[data-route="editor-lab"] #editor-lab-handout-picker .editor-handout-picker-item strong { font-size: 14px; font-weight: 500; }
.app-content[data-route="editor-lab"] #editor-lab-handout-picker .handout-picker-filters :is(input, select, button) { font-size: 13px; font-weight: 400; }
@media (max-width: 1100px) {
  .app-content[data-route="editor-lab"] .editor-lab .editor-lab-insert-group {
    flex-basis: 100% !important; min-height: 32px; height: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-content[data-route="editor-lab"] .editor-lab :is(button, a, summary, select) { transition: none !important; transform: none !important; }
}

/* UI UX Pro Max: restrained desktop editor hierarchy and grouped controls. */
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-header h1 {
  font-size: 20px !important; line-height: 1.45; font-weight: 600; letter-spacing: 0;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-toolbar {
  background: #f8fafd !important; border-bottom: 1px solid #dce6f1;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-format-groups {
  column-gap: 10px !important; row-gap: 8px !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-ribbon-group {
  border-right: 0 !important; padding-right: 0 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-font-group {
  padding: 0 10px !important; border-left: 1px solid #dbe5f0 !important;
  border-right: 1px solid #dbe5f0 !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-history-group {
  width: 34px; min-width: 34px; grid-template-rows: 1fr;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-history-tools { flex-direction: column; gap: 4px; }
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-color-control summary {
  background: #fff !important; border: 1px solid #e0e8f2 !important; font-size: 12px;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-version-bar {
  padding-top: 10px !important; padding-bottom: 0 !important; background: #fff !important; gap: 8px !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-mode-copy strong { font-size: 14px !important; color: #334b66; }
.app-content[data-route="editor-lab"] .editor-lab .editor-version-mode-copy span { font-size: 12px; color: #64748b; }
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs { gap: 20px; justify-content: flex-start; }
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button {
  flex: 0 1 auto; min-width: 120px; min-height: 40px; padding: 8px 12px !important;
  border-radius: 0 !important; border-bottom: 2px solid transparent !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button.active {
  background: #f1f7ff !important; border-color: transparent !important; border-bottom-color: #3269ad !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button :is(span,b,i) { font-size: 12px; color: #64748b; }
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-paper-viewport {
  padding-top: 24px !important; background: #eaf0f7 !important;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-paper {
  box-shadow: 0 3px 14px rgb(39 64 94 / 7%) !important;
}
.app-content[data-route="editor-lab"] .editor-lab :is(.editor-lab-toolbar,.editor-lab-header,.editor-version-bar) :is(button,summary) { cursor: pointer; }
@media (max-width: 720px) {
  .app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs { gap: 4px; flex-wrap: wrap; }
  .app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button { min-width: 100px; }
  .app-content[data-route="editor-lab"] .editor-lab .editor-lab-header h1 { font-size: 18px !important; }
}

/* Compact lecture mode selector beside its label. */
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-bar {
  grid-template-columns: max-content max-content minmax(0, 1fr) !important;
  grid-template-areas: "copy mode versions" !important;
  column-gap: 14px !important; align-items: center;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-mode-copy span { display: none; }
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch {
  justify-self: start; gap: 2px; padding: 3px;
  border: 1px solid #d7e4f2; border-radius: 7px; background: #edf3fa;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button {
  min-height: 30px; padding: 0 14px; border: 1px solid transparent;
  border-radius: 4px; background: transparent; color: #526780;
  font-size: 13px; font-weight: 400; line-height: 1.4;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button.active {
  color: #285f9f; background: #fff; border-color: #dbe6f2;
  font-weight: 600; box-shadow: 0 1px 2px rgb(36 65 100 / 6%);
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button:not(.active):hover {
  background: #e2ecf8 !important; color: #285f9f !important; border-color: transparent !important;
}
@media (max-width: 1380px) {
  .app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-bar {
    grid-template-areas: "copy mode ." "versions versions versions" !important;
  }
}

/* Requested control polish; scoped to editor chrome, never document content. */
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button {
  border-radius: 8px !important;
  transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease, box-shadow 240ms ease !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button.active {
  animation: editor-version-select 240ms ease-out;
}
@keyframes editor-version-select {
  from { background-color: #fff; box-shadow: inset 0 -2px 0 transparent; }
  to { background-color: #f1f7ff; box-shadow: inset 0 -2px 0 #3269ad; }
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch {
  padding: 0; gap: 0; background: #fff; border: 1px solid #cbdced;
  border-radius: 8px; overflow: visible; box-shadow: none;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button {
  min-height: 32px; padding: 0 16px; margin: 0; border: 0;
  border-radius: 7px 0 0 7px; color: #1f2329; box-shadow: none;
  transition: background-color 220ms ease, color 220ms ease !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button + button {
  border-left: 1px solid #cbdced; border-radius: 0 7px 7px 0;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button.active {
  background: #dfedfc; color: #245b96; box-shadow: none;
}
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions::before,
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-format-label {
  color: #1f2329 !important; font-weight: 600 !important;
}
.app-content[data-route="editor-lab"] .editor-lab :is(.editor-lab-document-identity small,.editor-lab-status small,.editor-version-view-tabs button:not(.active),.editor-version-view-tabs button span,.editor-version-view-tabs button b,.editor-version-view-tabs button i,.editor-common-mode-status span,.editor-document-status),
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-format-row :is(button,select,summary),
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-header .editor-document-type button:not([aria-pressed="true"]),
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-status [data-editor-more],
.app-content[data-route="editor-lab"] .editor-lab .editor-lab-primary-actions :is([data-editor-command="textBox"],[data-insert-temp-question]) {
  color: #1f2329 !important;
}
@media (prefers-reduced-motion: reduce) {
  .app-content[data-route="editor-lab"] .editor-lab .editor-version-view-tabs button,
  .app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-switch button {
    animation: none !important; transition: none !important;
  }
}

/* Consistent section labels and document type control. */
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions::before,
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-format-label {
  font-size: 14px !important; font-weight: 600 !important;
}
.app-shell .app-content[data-route="editor-lab"] .editor-lab .editor-lab-header .editor-document-type {
  padding: 0 !important; gap: 0 !important; border: 1px solid #cbdced !important;
  border-radius: 8px !important; background: #fff !important; box-shadow: none !important;
}
.app-shell .app-content[data-route="editor-lab"] .editor-lab .editor-lab-header .editor-document-type button {
  margin: 0; min-height: 32px !important; padding: 0 22px !important;
  border: 0 !important; border-radius: 7px 0 0 7px !important; box-shadow: none !important;
  background: transparent !important; font-weight: 400;
}
.app-shell .app-content[data-route="editor-lab"] .editor-lab .editor-lab-header .editor-document-type button + button {
  border-left: 1px solid #cbdced !important; border-radius: 0 7px 7px 0 !important;
}
.app-shell .app-content[data-route="editor-lab"] .editor-lab .editor-lab-header .editor-document-type button[aria-pressed="true"] {
  background: #dfedfc !important; color: #245b96 !important; font-weight: 600 !important;
}
/* Preview header: title row followed by compact, aligned selectors. */
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-lab-header {
  background: #f8fbff !important; border-bottom: 1px solid #dce6f1 !important;
  padding: 18px 170px 18px 24px !important; align-items: center !important;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-identity-row {
  display: flex !important; flex-direction: column; align-items: flex-start !important; gap: 12px !important;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-classification {
  margin: 0 !important; gap: 18px !important; overflow: visible;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select {
  gap: 8px !important; padding: 0 !important; height: auto !important;
  border: 0 !important; background: transparent !important; box-shadow: none !important;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select::after,
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select > span::after { content: none !important; }
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select > span {
  color: #1f2329 !important; font-weight: 600 !important; font-size: 14px !important;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select select {
  appearance: base-select; display: flex; align-items: center; justify-content: space-between;
  min-width: 112px; height: 34px !important; padding: 0 10px !important;
  border: 1px solid #cbdced !important; border-radius: 7px !important;
  background: #fff !important; color: #1f2329 !important; font: inherit; font-size: 13px !important;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select select::picker-icon { color: #3269ad; }
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select select::picker(select) {
  appearance: base-select; position-area: bottom span-right;
  top: anchor(bottom); left: anchor(left); right: auto; bottom: auto;
  position-try-fallbacks: none; margin: 6px 0 0; min-width: anchor-size(width);
  border: 1px solid #d5e1ef; border-radius: 8px; padding: 4px;
  background: #fff; box-shadow: 0 6px 20px rgb(36 65 100 / 12%); color: #1f2329;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select option {
  padding: 9px 12px; border-radius: 5px; font-size: 13px;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select option:checked { background: #e5f0fd; color: #245b96; }
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-file-select option:hover { background: #f0f6fd; }

.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-lab-header h1 {
  max-width: none !important; white-space: normal !important; overflow: visible !important;
}

/* Account and title share the same sticky containing block in preview. */
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-lab-header {
  position: sticky !important; top: 0 !important;
}
.app-content[data-route="editor-lab"] .editor-lab.is-preview-mode .editor-lab-header > .page-account {
  position: absolute !important; top: 18px !important; right: 26px !important;
  margin: 0 !important; z-index: 45 !important;
}

/* A persistent edge toggle keeps the collapsed mode bar discoverable. */
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lecture-mode-bar {
  position: relative; padding-right: 64px !important;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-mode-collapse {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%) !important;
  display: grid; place-items: center; width: 28px; height: 28px;
  padding: 0; border: 1px solid #d7e4f2; border-radius: 6px;
  background: #f5f9ff; color: #3269ad; cursor: pointer;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-mode-collapse:hover { background: #e2eefd; }
.app-content[data-route="editor-lab"] .editor-lab .editor-mode-collapse svg { transition: transform 180ms ease; }
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lecture-mode-bar.is-mode-collapsed {
  min-height: 0 !important; height: 0 !important; max-height: 0 !important;
  padding: 0 !important; margin: 0 !important; border: 0 !important;
  flex: 0 0 0 !important; gap: 0 !important; overflow: visible !important; z-index: 12;
}
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-bar.is-mode-collapsed > :not(.editor-mode-collapse) { display: none !important; }
.app-content[data-route="editor-lab"] .editor-lab .is-mode-collapsed .editor-mode-collapse svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .app-content[data-route="editor-lab"] .editor-lab .editor-mode-collapse svg { transition: none; }
}

/* Collapsed bar occupies no row; the restore handle overlays the canvas edge. */
.app-content[data-route="editor-lab"] .editor-lab .editor-lecture-mode-bar.is-mode-collapsed > .editor-mode-collapse {
  top: 5px; right: 16px; transform: none !important;
  box-shadow: 0 1px 4px rgb(36 65 100 / 10%);
}

/* Shared sidebar hierarchy, matching the supplied navigation reference. */
.app-shell:not(.function-sidebar-collapsed) .function-sidebar .function-group-title strong {
  font-size: 16px !important; font-weight: 600 !important; color: #111827 !important; line-height: 1.5;
}
.app-shell:not(.function-sidebar-collapsed) .function-sidebar .function-link b {
  font-size: 14px !important; font-weight: 400 !important; color: #111827 !important; line-height: 1.5;
}
.app-shell .function-sidebar .function-link.active,
.app-shell .function-sidebar .function-group-direct[aria-current="page"] {
  background: #e4effd !important; border-radius: 7px;
}
.app-shell .function-sidebar .function-link.active b,
.app-shell:not(.function-sidebar-collapsed) .function-sidebar .function-group-direct[aria-current="page"] strong {
  color: #3269ad !important; font-weight: 600 !important;
}
.app-shell .function-sidebar .function-group.active > .function-group-title > span { color: #3275de !important; }
.app-shell:not(.function-sidebar-collapsed) .function-sidebar .brand {
  align-items: center; gap: 5px; padding: 0 0 20px; border-bottom: 1px solid #dce7f3;
}
.app-shell:not(.function-sidebar-collapsed) .function-sidebar .brand-mark {
  width: 100%; height: 62px; background: transparent !important;
  padding: 0 !important; border: 0; border-radius: 0;
}
.app-shell:not(.function-sidebar-collapsed) .function-sidebar .brand-mark img {
  width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply;
}
.app-shell:not(.function-sidebar-collapsed) .function-sidebar .brand-name {
  font-size: 18px !important; font-weight: 600 !important; line-height: 1.5;
  letter-spacing: 1px; color: #1e3652 !important;
}



/* Navigation must not inherit geometry or typography from route snapshots. */
.app-shell > .function-sidebar {
  box-sizing: border-box; position: sticky !important; top: 0 !important;
  height: 100dvh !important; padding: 20px 12px !important;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif !important;
}
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .brand {
  display: flex !important; flex-direction: column !important; align-items: center !important;
  min-height: 0 !important; height: 115px !important; box-sizing: border-box;
  margin: 0 !important; padding: 0 0 20px !important; gap: 5px !important;
}
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .brand-mark {
  display: grid !important; width: 100% !important; height: 62px !important; flex: 0 0 62px !important;
}
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .brand-name {
  margin: 0 !important; font-size: 18px !important; line-height: 27px !important;
  font-weight: 600 !important; letter-spacing: 1px !important;
}
.app-shell > .function-sidebar .function-nav {
  display: grid !important; gap: 22px !important; margin: 18px 0 0 !important; padding: 20px 0 0 !important;
}
.app-shell > .function-sidebar .function-group { padding: 0 !important; margin: 0 !important; }
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .function-group-title {
  display: flex !important; align-items: center !important; height: 36px !important; min-height: 36px !important;
  padding: 0 6px !important; margin: 0 !important; gap: 12px !important;
}
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .function-group-direct { height: 42px !important; min-height: 42px !important; }
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .function-group-title strong {
  font-size: 16px !important; line-height: 24px !important; font-weight: 600 !important; letter-spacing: 0 !important;
}
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .function-group-items {
  display: grid !important; margin: 4px 0 0 !important; padding: 0 !important; gap: 4px !important;
}
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .function-link {
  display: flex !important; align-items: center !important; min-height: 40px !important; height: 40px !important;
  padding: 6px !important; box-sizing: border-box; margin: 0 !important;
}
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar .function-link b {
  font-size: 14px !important; line-height: 21px !important; letter-spacing: 0 !important;
}
.app-shell:not(.function-sidebar-collapsed) > .function-sidebar :is(.function-link > b,.function-group-title > strong) {
  position: absolute !important; left: 43px !important; right: 2px !important;
}
/* File workspace text and filter-label emphasis. */
.app-shell .lecture-home :is(h1,.lecture-home-nav,.lecture-home-nav b,.lecture-home-nav em,.lecture-home-nav-title,
.lecture-home-name strong,.lecture-home-name small,.lecture-home-cell,.lecture-home-list-head,
.lecture-home-list-head button,.lecture-home-mode,.lecture-home-state,.lecture-home-link,
.lecture-home-filters label,.lecture-home-filters input,.lecture-home-filters select,.lecture-home-filters button) {
  color: #1f2329 !important;
}
.app-shell .lecture-home .lecture-home-filters label > span { color: #1f2329 !important; font-weight: 600 !important; }
.app-shell .lecture-home .lecture-home-filters input::placeholder { color: #1f2329 !important; opacity: 1; }
.app-shell .lecture-home .lecture-home-nav-title { font-size: 14px !important; font-weight: 600 !important; }

/* Match the supplied file-list reference and emphasize insert actions. */
.app-content[data-route="editor-lab"] .editor-lab:not(.is-preview-mode) .editor-lab-primary-actions button {
  font-weight: 600 !important;
}
.app-shell .lecture-home .lecture-home-name strong {
  color: #162c47 !important; font-weight: 700 !important;
}
.app-shell .lecture-home .lecture-home-name small { color: #758095 !important; }
.app-shell .lecture-home :is(.lecture-home-list-head,.lecture-home-list-head button) {
  color: #48627f !important; font-weight: 700 !important;
}
.app-shell .lecture-home .lecture-home-row { border-radius: 8px; }
.app-shell .lecture-home .lecture-home-icon.sync {
  color: #2c6be5 !important; background: #edf3ff !important;
}
.app-shell .lecture-home :is(.lecture-home-mode,.lecture-home-state) {
  border-radius: 999px; font-weight: 700;
}
.app-shell .lecture-home .lecture-home-mode.sync { color: #286be6 !important; }
.app-shell .lecture-home .lecture-home-mode.pack { color: #996000 !important; }
.app-shell .lecture-home .lecture-home-mode.is-layered { color: #8056b4 !important; }
.app-shell .lecture-home .lecture-home-state.pending { color: #c15b0b !important; background: #ffead5 !important; }
.app-shell .lecture-home .lecture-home-state.changed { color: #967017 !important; background: #fff5cc !important; }
.app-shell .lecture-home .lecture-home-state.synced { color: #087c61 !important; background: #e8f7f2 !important; }

/* Keep question difficulty and knowledge tags in one metadata row. */
.editor-temp-question-editor .editor-temp-question-meta-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.editor-temp-question-editor .editor-temp-question-meta-row > label {
  grid-column: auto !important;
  min-width: 0;
}

.app-shell .lecture-home .lecture-home-new { font-weight: 600 !important; }
.history-preview-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
[data-lecture-assets-content] > header { gap: 16px; }
[data-lecture-assets-content] > header h2 { min-width: 0; }
[data-lecture-assets-content] .history-preview-edit {
  flex: 0 0 auto; width: auto; height: 32px; padding: 0 14px;
  border: 0; border-radius: 6px; background: #3269de; color: #fff;
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
[data-lecture-assets-content] .history-preview-close {
  flex: 0 0 32px; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: #1f2329;
  font-size: 24px; cursor: pointer;
}
[data-lecture-assets-content] .history-preview-close:hover { background: #edf3fb; }
.qm-index-layout .qm-knowledge-field > span,
.qm-index-layout .qm-difficulty-select > span { color: #1f2329 !important; font-weight: 700 !important; }
.qm-knowledge-tabs { position: relative; min-width: 0; }
.qm-knowledge-tabbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px;
  padding: 6px; border: 1px solid #d3e1f4; border-radius: 8px; background: #f2f7ff;
}
.qm-knowledge-tab { display: flex; align-items: center; min-width: 0; max-width: 100%; border: 1px solid #dce7f6; border-radius: 7px; background: #fff; }
.qm-knowledge-tab button { border: 0; background: transparent; color: #253953; padding: 7px 10px; cursor: pointer; font: inherit; }
.qm-knowledge-tab [data-qm-path-view] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.qm-knowledge-tab [aria-expanded="true"] { color: #2867b5; background: #e8f1ff; }
.qm-knowledge-tab .qm-tag-remove { flex: 0 0 28px; padding: 4px; font-size: 18px; border-radius: 5px; }
.qm-tag-remove:hover { background: #e8f1ff; }
.qm-knowledge-tabbar .qm-tag-add { width: 30px; height: 30px; flex: 0 0 30px; border: 0; border-radius: 6px; background: transparent; color: #3269ad; font-size: 24px; cursor: pointer; }
.qm-tag-add:hover { background: #deebfc; }
.qm-tag-path { padding: 10px 12px; margin-top: 6px; border: 1px solid #dce7f6; border-radius: 6px; background: #fff; color: #253953; overflow-wrap: anywhere; line-height: 1.6; }
.qm-tag-picker { position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; padding: 5px; max-height: 260px; overflow: auto; z-index: 50; border: 1px solid #d3e1f4; border-radius: 8px; background: #fff; box-shadow: 0 6px 18px #24395420; }
.qm-tag-picker button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 5px; background: #fff; color: #253953; text-align: left; line-height: 1.5; cursor: pointer; }
.qm-tag-picker button:hover { background: #edf4ff; }
.qm-knowledge-tabs [hidden] { display: none !important; }
.qm-knowledge-tabs button:focus-visible { outline: 2px solid #92b9ed; outline-offset: 1px; }
.app-content[data-route="s04"] .qm-index-layout { align-items: start !important; }
.app-content[data-route="s04"] .qm-index-layout :is(.qm-knowledge-field,.qm-difficulty-select) { display: grid; gap: 6px; margin: 0; align-content: start; }
.qm-knowledge-tabbar { box-sizing: border-box; min-height: 42px; padding: 5px; flex-wrap: nowrap; overflow-x: auto; }
.qm-knowledge-tabbar .qm-knowledge-tab { flex: 0 0 auto; }
.app-content[data-route="s04"] .qm-index-layout :is(.qm-knowledge-field,.qm-difficulty-select) > span { margin: 0; line-height: 18px; }
.qm-knowledge-tab { height: 30px; box-sizing: border-box; overflow: hidden; }
.qm-knowledge-tab:has([aria-expanded="true"]) { background: #deebff; border-color: #94b7e9; }
.qm-knowledge-tab:has([aria-expanded="true"]) button { background: transparent; color: #2867b5; }
.qm-knowledge-tab button { height: 28px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; padding-top: 0; padding-bottom: 0; }
.qm-knowledge-tab .qm-tag-remove,.qm-knowledge-tabbar .qm-tag-add { display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.qm-knowledge-tab [data-qm-path-view]:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.qm-tag-picker.qm-path-editor { left: auto; right: 0; width: min(760px, calc(100vw - 48px)); max-height: none; padding: 0; overflow: hidden; }
.qm-path-breadcrumb { padding: 12px 14px; border-bottom: 1px solid #e2eaf5; color: #253953; line-height: 1.5; }
.qm-path-columns { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); height: 220px; }
.qm-path-columns .qm-cascade-column { min-width: 0; overflow-y: auto; }
.qm-path-columns .qm-cascade-option { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px; }
.qm-path-columns .qm-cascade-option.selected { color: #2867b5; background: #e8f1ff; font-weight: 600; }
.qm-path-columns .qm-cascade-option b { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 12px; }
.qm-path-editor footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #e2eaf5; }
.qm-path-editor footer button { width: auto; padding: 6px 16px; border: 1px solid #d3e1f4; }
.qm-path-editor footer [data-path-save] { background: #3269ad; color: #fff; }
.qm-path-editor footer button:disabled { opacity: .45; cursor: default; }
.app-content[data-route="s04"] .qm-index-layout :is(.qm-knowledge-field,.qm-difficulty-select) > span,
.editor-ref-knowledge-row > span { font-size: 14px !important; line-height: 22px !important; font-weight: 700 !important; color: #1f2329 !important; }
.qm-knowledge-tabbar :is(.qm-tag-add,.qm-tag-remove) { display: grid !important; place-items: center !important; align-self: center; padding: 0 !important; line-height: 0 !important; }
.qm-knowledge-tabbar svg { display: block; flex: none; margin: 0; }
.editor-ref-config-panel .qm-knowledge-tabs { font-size: 13px; }
.editor-ref-config-panel .qm-tag-add { width: 30px !important; height: 30px !important; }
.editor-ref-config-panel .qm-tag-remove { width: 28px !important; height: 28px !important; }
.editor-temp-question-editor [data-temp-difficulty] {
  border-radius: 8px !important;
  color: #3269ad !important;
  letter-spacing: 2px;
}
.editor-temp-question-editor [data-temp-difficulty]:focus-visible {
  outline: 2px solid #92b9ed; outline-offset: 2px;
}
@supports (appearance: base-select) {
  .editor-temp-question-editor [data-temp-difficulty]::picker(select) {
    position-area: bottom span-right;
    top: anchor(bottom); left: anchor(left); right: auto; bottom: auto;
    position-try-fallbacks: none;
    width: anchor-size(width); min-width: anchor-size(width); box-sizing: border-box;
    margin: 6px 0 0; padding: 5px;
    border: 1px solid #d5e3f3; border-radius: 9px;
    background: #fff; box-shadow: 0 5px 16px rgb(36 65 100 / 10%);
  }
  .editor-temp-question-editor [data-temp-difficulty] option {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 34px; padding: 7px 12px; border-radius: 5px;
    color: #526b87; font-size: 13px; letter-spacing: 2px;
  }
  .editor-temp-question-editor [data-temp-difficulty] option:checked {
    background: #e8f2ff; color: #2867b5; font-weight: 600;
  }
  .editor-temp-question-editor [data-temp-difficulty] option:hover { background: #f0f6fd; }
  .editor-temp-question-editor [data-temp-difficulty] option::checkmark {
    order: 2; margin-left: auto; color: #2867b5;
  }
}

.editor-ref-config-panel .qm-tag-picker.qm-path-editor { left: 0; right: 0; width: 100%; max-width: 100%; box-sizing: border-box; }
.editor-ref-config-panel .qm-path-columns { grid-template-columns: repeat(5,minmax(0,1fr)); }
.editor-ref-config-panel .qm-cascade-option span { overflow-wrap: anywhere; white-space: normal; }
