:root {
  --ink: #17233c;
  --muted: #69758c;
  --line: rgba(71, 88, 123, .14);
  --surface: rgba(255, 255, 255, .9);
  --primary: #3157d5;
  --primary-dark: #223fa8;
  --shadow: 0 22px 55px rgba(29, 45, 83, .11);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f5f7fc;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: linear-gradient(135deg, #f7f9ff 0%, #f4f7fb 46%, #f7fbf9 100%); overflow-x: hidden; }
a { color: inherit; }
button, input { font: inherit; }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(2px); opacity: .6; pointer-events: none; }
.ambient-one { width: 420px; height: 420px; top: -180px; right: -100px; background: radial-gradient(circle, rgba(90, 112, 255, .22), rgba(90, 112, 255, 0)); }
.ambient-two { width: 360px; height: 360px; bottom: -180px; left: 12%; background: radial-gradient(circle, rgba(72, 195, 164, .14), rgba(72, 195, 164, 0)); }
.topbar { height: 76px; padding: 0 38px; display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, .78); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: white; background: linear-gradient(145deg, #4368eb, #2747bb); font-size: 12px; font-weight: 700; letter-spacing: .06em; box-shadow: 0 10px 24px rgba(49, 87, 213, .25); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; font-weight: 650; }
.brand small { color: var(--muted); margin-top: 2px; }
.account-chip { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px 8px 7px 14px; border: 1px solid var(--line); background: rgba(255,255,255,.72); border-radius: 16px; }
.account-chip span small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.account-dot { width: 8px; height: 8px; border-radius: 50%; background: #33b78d; box-shadow: 0 0 0 4px rgba(51,183,141,.12); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f1f4fa; color: #4b5871; cursor: pointer; }
.icon-button:hover { background: #e7ecf8; color: #263d84; }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 32px; min-height: calc(100vh - 132px); }
.footer { height: 56px; padding: 0 38px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; }
.status-pill i { width: 7px; height: 7px; background: #efae37; border-radius: 50%; }
.page-heading { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 28px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin: 7px 0 8px; font-size: clamp(28px, 3vw, 43px); line-height: 1.08; letter-spacing: -.035em; font-weight: 670; }
.page-heading p { margin: 0; color: var(--muted); max-width: 720px; line-height: 1.6; }
.eyebrow { display: inline-block; color: #3657be; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.eyebrow.warning { color: #a46408; }
.stage-badge { flex: 0 0 auto; min-width: 235px; padding: 15px 17px; border: 1px solid rgba(49,87,213,.16); border-radius: 16px; background: rgba(255,255,255,.72); }
.stage-badge small, .stage-badge strong { display: block; }
.stage-badge small { color: var(--muted); margin-bottom: 4px; }
.stage-badge strong { font-size: 13px; letter-spacing: .035em; color: #3157d5; }
.workspace-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.workspace-card { min-height: 215px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 36px rgba(29,45,83,.06); transition: transform .2s ease, box-shadow .2s ease; text-decoration: none; }
.workspace-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; font-size: 20px; margin-bottom: 20px; background: #eef2ff; color: #3157d5; }
.card-copy h2 { margin: 0 0 8px; font-size: 18px; font-weight: 650; }
.card-copy p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.52; }
.coming-soon { margin-top: auto; padding-top: 17px; color: #798398; font-size: 11px; }
.color-violet .card-icon { color: #7454d7; background: #f1edff; }
.color-green .card-icon { color: #188869; background: #e8f8f2; }
.color-orange .card-icon { color: #ba6b16; background: #fff2df; }
.color-cyan .card-icon { color: #1682a2; background: #e7f7fb; }
.color-rose .card-icon { color: #b94f6b; background: #fdebf0; }
.color-indigo .card-icon { color: #5142bb; background: #eeecff; }
.color-slate .card-icon { color: #596880; background: #edf1f6; }
.technical-card { border-style: dashed; }
.auth-layout { min-height: calc(100vh - 222px); display: grid; grid-template-columns: 1.2fr .8fr; gap: 64px; align-items: center; }
.auth-story h1 { max-width: 790px; margin: 14px 0 20px; font-size: clamp(38px, 5vw, 64px); line-height: 1.02; letter-spacing: -.05em; font-weight: 680; }
.auth-story > p { max-width: 680px; color: var(--muted); line-height: 1.7; font-size: 17px; }
.feature-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.feature-row span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.66); color: #536079; font-size: 13px; }
.auth-card, .center-card { border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.auth-card { padding: 32px; }
.auth-card h2 { margin: 18px 0 8px; font-size: 27px; }
.auth-card > p { color: var(--muted); line-height: 1.55; }
.auth-icon, .success-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 17px; background: #edf1ff; color: #3157d5; font-size: 24px; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 10px 16px; border: 0; border-radius: 12px; text-decoration: none; cursor: pointer; font-weight: 600; }
.primary-button { color: white; background: linear-gradient(135deg, #4166e5, #294aba); }
.primary-button:hover { background: linear-gradient(135deg, #3659cf, #213d9e); }
.primary-button.disabled { width: 100%; margin-top: 9px; background: #a8b1c6; pointer-events: none; }
.secondary-button { color: #3157d5; border: 1px solid rgba(49,87,213,.2); background: white; }
.auth-note { margin-top: 23px; padding: 16px; border-radius: 16px; background: #f6f8fc; }
.auth-note strong, .auth-note span, .auth-note a { display: block; }
.auth-note span { margin: 5px 0 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.auth-note a { color: #3157d5; font-size: 13px; font-weight: 600; }
.center-card { max-width: 560px; margin: 9vh auto; padding: 42px; text-align: center; }
.center-card .success-mark { margin: 0 auto; background: #e8f8f2; color: #188869; }
.center-card h1 { margin: 20px 0 10px; }
.center-card p { color: var(--muted); line-height: 1.6; }
.center-card .primary-button { margin-top: 10px; }
.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.role-card { padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.9); box-shadow: 0 14px 35px rgba(29,45,83,.06); }
.role-card h2 { min-height: 48px; margin: 17px 0 5px; font-size: 18px; }
.role-card p { margin: 0 0 20px; color: var(--muted); }
.role-card .primary-button { width: 100%; }
.role-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: #eef2ff; color: #3157d5; font-weight: 700; }
.error-banner, .message { padding: 13px 16px; margin: 0 0 18px; border-radius: 13px; background: #fff0f2; color: #a33248; }
.messages { margin-bottom: 16px; }
.empty-state { grid-column: 1 / -1; padding: 30px; border: 1px dashed var(--line); border-radius: 20px; text-align: center; color: var(--muted); }

.breadcrumbs { display: flex; align-items: center; gap: 8px; margin: -9px 0 24px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: #3157d5; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.heading-actions, .heading-labels, .inline-actions, .row-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.heading-actions { justify-content: flex-end; }
.back-button { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 13px; color: #4c5a74; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.76); text-decoration: none; font-weight: 600; }
.back-button:hover { color: #294aba; background: white; }
.notice { display: grid; gap: 5px; margin: 0 0 20px; padding: 15px 17px; border: 1px solid rgba(49,87,213,.14); border-radius: 15px; background: #f4f7ff; color: #34466f; }
.notice span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.notice-warning { border-color: rgba(195,125,22,.2); background: #fff7e9; color: #8b5709; }
.registry-tabs { display: flex; align-items: flex-end; gap: 4px; padding: 0 5px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.registry-tabs a { flex: 0 0 auto; padding: 11px 15px 10px; border-bottom: 3px solid transparent; color: #647089; text-decoration: none; font-size: 13px; font-weight: 600; }
.registry-tabs a[aria-current="page"] { border-color: #3157d5; color: #284bbd; }
.registry-toolbar { display: flex; align-items: end; gap: 10px; margin: 17px 0; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.78); }
.registry-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .03em; }
.search-field { flex: 1 1 420px; }
.size-field { flex: 0 0 88px; }
.form-control, .inline-actions input, .action-panel input { width: 100%; min-width: 0; max-width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid rgba(71,88,123,.2); border-radius: 10px; background: #fff; color: var(--ink); outline: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.form-control:focus, .inline-actions input:focus, .action-panel input:focus { border-color: rgba(49,87,213,.6); box-shadow: inset 0 0 0 1px rgba(49,87,213,.28), 0 0 0 3px rgba(49,87,213,.08); }
.password-control { position: relative; width: 100%; }
.password-control .form-control { padding-right: 46px; }
.password-visibility-toggle { position: absolute; top: 50%; right: 5px; display: grid; width: 34px; height: 32px; padding: 0; transform: translateY(-50%); place-items: center; border: 0; border-radius: 8px; background: transparent; color: #66748e; cursor: pointer; }
.password-visibility-toggle:hover { background: #edf2ff; color: #3157d5; }
.password-visibility-toggle:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #3157d5; }
.password-visibility-toggle[aria-pressed="true"] { background: #e7edff; color: #294bb8; }
.password-visibility-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
textarea.form-control { resize: vertical; line-height: 1.5; }
select.form-control { padding-right: 28px; }
.compact-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 12px; border: 1px solid rgba(49,87,213,.2); border-radius: 10px; background: #eef2ff; color: #294bab; text-decoration: none; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.compact-button:hover { background: #e1e8ff; }
.compact-button.warning { border-color: rgba(188,118,13,.22); background: #fff3df; color: #945b08; }
.compact-button.danger, .icon-action.danger { border-color: rgba(190,64,83,.18); background: #fff0f2; color: #ae354b; }
.compact-button.success { border-color: rgba(31,145,108,.2); background: #e9f8f2; color: #14785c; }
.table-panel { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.9); box-shadow: 0 12px 32px rgba(29,45,83,.045); }
.table-panel:focus { box-shadow: inset 0 0 0 2px rgba(49,87,213,.18), 0 12px 32px rgba(29,45,83,.045); outline: 0; }
.data-table { width: 100%; border-collapse: collapse; min-width: 880px; }
.data-table th { padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f6f8fc; color: #6b768d; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(71,88,123,.09); vertical-align: middle; font-size: 13px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(244,247,255,.72); }
.data-table td > small { display: block; max-width: 410px; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.data-table code, .metric-strip code, .object-reference code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; color: #536079; overflow-wrap: anywhere; }
.code-chip { display: inline-flex; padding: 5px 8px; border-radius: 8px; background: #edf1ff; color: #3157d5; font-size: 12px; font-weight: 700; }
.actions-cell, .row-actions { white-space: nowrap; }
.actions-cell { min-width: 0; }
.actions-cell form, .row-actions form, .inline-actions form { display: inline-flex; margin: 0; }
.icon-action { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #f7f9fd; color: #40506b; text-decoration: none; font: inherit; font-size: 17px; line-height: 1; cursor: pointer; }
.icon-action:hover { border-color: rgba(49,87,213,.24); background: #eaf0ff; color: #294aba; }
.icon-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.course-row-actions { display: inline-flex; align-items: center; gap: 5px; }
.course-action-placeholder:disabled { opacity: .58; cursor: not-allowed; filter: saturate(.65); }
.course-action-placeholder:disabled:hover { border-color: var(--line); background: #f7f9fd; color: #40506b; }
.course-action-placeholder.danger:disabled:hover { border-color: rgba(190,64,83,.18); background: #fff0f2; color: #ae354b; }
.course-registry-table { min-width: 760px; }
.icon-action:focus-visible, .compact-button:focus-visible, .back-button:focus-visible, .primary-button:focus-visible, .secondary-button:focus-visible, .workspace-card:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #3157d5, 0 0 0 3px rgba(49,87,213,.13); }
.table-empty { padding: 28px; text-align: center; color: var(--muted); }
.status-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 999px; background: #edf1f6; color: #596880; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-active, .status-published { background: #e7f7f1; color: #18795d; }
.status-blocked, .status-suspended { background: #fff0e5; color: #a45f0f; }
.status-archived, .status-retired, .status-completed { background: #eef1f5; color: #687287; }
.status-draft, .status-planned { background: #edf1ff; color: #3657be; }
.status-review { background: #f3edff; color: #7350c5; }
.status-lms-subject { background: #e8efff; color: #3157b8; }
.status-additional { background: #e9f8f2; color: #14785c; }
.muted { color: var(--muted); }
.pagination, .registry-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; color: var(--muted); font-size: 12px; }
.pagination div { display: flex; align-items: center; gap: 9px; }
.pagination a { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 9px; background: white; color: #3157d5; text-decoration: none; }
.form-shell { max-width: 920px; margin: 0 auto; }
.editor-form { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: 0 16px 45px rgba(29,45,83,.07); }
.form-grid { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; padding: 23px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { color: #43506a; font-size: 12px; font-weight: 700; }
.field small { color: var(--muted); font-size: 11px; }
.field-message, .form-errors { color: #a63249; font-size: 12px; }
.field-error .form-control { border-color: rgba(190,64,83,.55); background: #fffafb; }
.form-errors { margin: 20px 23px 0; padding: 12px 14px; border-radius: 11px; background: #fff0f2; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding: 15px 23px; border-top: 1px solid var(--line); background: #f8f9fc; }
.metric-strip { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 1px; margin: 0 0 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--line); }
.metric-strip > div { min-width: 0; padding: 15px; background: rgba(255,255,255,.9); }
.metric-strip small, .metric-strip strong, .metric-strip code { display: block; }
.metric-strip small { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.metric-strip strong { font-size: 20px; }
.metric-strip .metric-note { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.action-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.84); }
.inline-actions { justify-content: flex-end; }
.inline-actions form { align-items: center; gap: 7px; }
.inline-actions input { width: 210px; min-height: 38px; font-size: 12px; }
.content-panel { margin-top: 23px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 11px; }
.section-heading h2 { margin: 4px 0 0; font-size: 20px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.learning-objectives { margin-bottom: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.82); color: #43506a; line-height: 1.55; }
.learning-objectives .eyebrow { display: block; margin-bottom: 7px; }
.learning-objectives p { margin: 6px 0; }
.course-outline { display: grid; gap: 16px; }
.outline-section { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: 0 12px 32px rgba(29,45,83,.045); }
.outline-section > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #f8f9fc; }
.outline-section > header > div:first-child { display: flex; gap: 13px; align-items: flex-start; }
.outline-section h2 { margin: 1px 0 4px; font-size: 18px; }
.outline-section header small { color: #3157d5; font-weight: 700; }
.outline-section header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.section-index { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; background: #e9efff; color: #3157d5; font-weight: 750; }
.material-list { display: grid; gap: 1px; background: rgba(71,88,123,.08); }
.material-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 13px; align-items: start; padding: 16px 20px; background: white; }
.material-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #eef2ff; color: #3157d5; font-size: 12px; font-weight: 800; }
.material-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.material-title span { color: var(--muted); font-size: 11px; }
.material-body > p { margin: 6px 0; color: var(--muted); font-size: 13px; }
.material-text { margin-top: 11px; padding: 13px 15px; border-radius: 12px; background: #f7f8fb; color: #34425d; line-height: 1.55; }
.material-text p { margin: 5px 0; }
.safe-resource-link { display: inline-flex; margin-top: 8px; color: #3157d5; font-weight: 650; font-size: 13px; }
.object-reference { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 11px; margin-top: 9px; padding: 11px 13px; border-radius: 11px; background: #f6f7fa; color: var(--muted); font-size: 12px; }
.object-reference .compact-button { margin-left: auto; }
.object-safety { padding: 4px 7px; border-radius: 999px; background: #fff3df; color: #945b08; font-weight: 650; }
.material-body details { margin-top: 10px; color: #536079; font-size: 13px; }
.material-body summary { cursor: pointer; color: #3157d5; font-weight: 650; }
.outline-empty { padding: 22px; background: white; color: var(--muted); text-align: center; font-size: 13px; }
.archived-item { opacity: .66; }
.notice-preview { border-color: rgba(90, 78, 201, .18); background: #f4f1ff; color: #5a4ec9; }
.review-boundary-note { border-color: rgba(90,78,201,.18); background: linear-gradient(135deg,#f7f4ff,#f2f6ff); color: #5547b0; }
.publication-state { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 14px; align-items: start; margin: 0 0 20px; padding: 16px 18px; border: 1px solid rgba(49,87,213,.15); border-radius: 17px; background: rgba(247,249,255,.92); }
.publication-state-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #e8edff; color: #3157d5; font-size: 20px; font-weight: 750; }
.publication-state h2 { margin: 3px 0 4px; color: #263b70; font-size: 17px; }
.publication-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.publication-state-review { border-color: rgba(115,80,197,.2); background: #f7f3ff; }
.publication-state-review .publication-state-mark { background: #ebe3ff; color: #7350c5; }
.publication-state-published { border-color: rgba(31,145,108,.2); background: #f1fbf7; }
.publication-state-published .publication-state-mark { background: #ddf4eb; color: #14785c; }
.compact-notice { margin: 0; }
.viewer-shell { max-width: 1180px; margin: 0 auto; }
.viewer-heading { margin-bottom: 18px; }
.viewer-heading h1 { font-size: clamp(27px, 3vw, 39px); }
.viewer-meta { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1px; margin-bottom: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.viewer-meta span { min-width: 0; padding: 12px 14px; overflow-wrap: anywhere; background: rgba(255,255,255,.94); color: #40506b; font-size: 12px; }
.viewer-meta small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; }
.viewer-stage { overflow: hidden; min-height: 420px; border: 1px solid var(--line); border-radius: 22px; background: #202536; box-shadow: 0 18px 50px rgba(29,45,83,.13); }
.document-frame { display: block; width: 100%; height: min(72vh, 860px); min-height: 560px; border: 0; background: white; }
.text-frame { background: #fff; }
.viewer-shell[data-media-viewer] { position: relative; display: grid; width: 100%; max-width: 100%; margin-top: 12px; overflow: hidden; border: 1px solid rgba(71,88,123,.18); border-radius: 16px; background: #111725; box-shadow: 0 12px 30px rgba(20,29,49,.12); }
.viewer-shell[data-media-viewer] .media-surface { position: relative; display: grid; width: 100%; min-width: 0; min-height: 0; max-height: min(68dvh, 720px); aspect-ratio: var(--video-aspect-ratio, 16 / 9); place-items: center; overflow: hidden; background: #0e1421; }
.viewer-shell[data-media-viewer] .course-video { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; background: #0e1421; }
.viewer-shell[data-media-viewer] .media-controls { position: static; display: flex; width: 100%; min-width: 0; align-items: center; flex-wrap: wrap; gap: 8px; box-sizing: border-box; padding: 9px 11px; border: 0; border-top: 1px solid rgba(255,255,255,.1); border-radius: 0; background: #1a2233; color: white; }
.viewer-shell[data-media-viewer] .media-controls progress { flex: 1 1 180px; min-width: 100px; height: 6px; overflow: hidden; border: 0; border-radius: 999px; accent-color: #7d9aff; }
.viewer-shell[data-media-viewer] [data-media-time] { flex: 0 0 auto; min-width: 94px; color: rgba(255,255,255,.78); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.viewer-shell[data-media-viewer] .media-status { flex: 1 0 100%; padding: 2px 1px 0; color: #ffd5a6; font-size: 11px; line-height: 1.4; }
.viewer-shell[data-media-viewer] [data-media-transcript] { margin: 0; border: 0; border-top: 1px solid rgba(71,88,123,.14); border-radius: 0; }
.viewer-shell[data-media-viewer]:fullscreen { width: 100vw; height: 100dvh; max-width: none; grid-template-rows: minmax(0,1fr) auto auto; border: 0; border-radius: 0; }
.viewer-shell[data-media-viewer]:fullscreen .media-surface { max-height: none; aspect-ratio: auto; }
.viewer-icon { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: rgba(255,255,255,.09); color: white; font: inherit; font-size: 17px; cursor: pointer; }
.viewer-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.viewer-icon:hover, .viewer-icon:focus-visible { background: rgba(255,255,255,.2); outline: 0; }
.media-timeline input { width: 100%; accent-color: #6c8cff; cursor: pointer; }
.media-time { min-width: 102px; font-variant-numeric: tabular-nums; font-size: 11px; text-align: center; }
.media-speed { min-height: 40px; padding: 0 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: #2f3548; color: white; }
.course-image { display: block; max-width: 100%; max-height: min(78vh, 900px); margin: auto; object-fit: contain; }
.transcript-panel { padding: 15px 18px; border-top: 1px solid rgba(255,255,255,.12); background: #fff; color: #43506a; line-height: 1.55; }
.transcript-panel summary { cursor: pointer; color: #3157d5; font-weight: 650; }
.viewer-policy { max-width: 900px; margin: 14px auto 0; color: var(--muted); font-size: 11px; line-height: 1.55; text-align: center; }
.viewer-fallback { padding: 30px; color: white; text-align: center; }
.revision-history { margin: 0 0 17px; }
.revision-history > summary { display: inline-flex; margin-bottom: 9px; color: #3157d5; cursor: pointer; font-size: 13px; font-weight: 650; }
.revision-table { min-width: 760px; }
.revision-table .current-revision { background: #f2fbf7; }
.course-create-shell { max-width: 980px; }
.course-create-form { min-width: 0; overflow: hidden; }
.course-kind-fieldset { width: 100%; min-width: 0; margin: 0; padding: 22px 23px 23px; border: 0; border-bottom: 1px solid var(--line); }
.course-kind-fieldset legend { padding: 0; color: #43506a; font-size: 12px; font-weight: 700; }
.course-kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; margin-top: 12px; }
.course-kind-card { position: relative; display: grid; grid-template-columns: 44px minmax(0,1fr) 18px; gap: 13px; align-items: center; min-height: 92px; padding: 15px; border: 1px solid rgba(71,88,123,.16); border-radius: 17px; background: #fafbfe; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.course-kind-card:hover { border-color: rgba(49,87,213,.28); background: #f6f8ff; }
.course-kind-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.course-kind-card:focus-within { border-color: #3157d5; box-shadow: 0 0 0 3px rgba(49,87,213,.12); }
.course-kind-card.is-selected { border-color: rgba(49,87,213,.5); background: #f0f4ff; box-shadow: inset 0 0 0 1px rgba(49,87,213,.12); }
.course-kind-card.is-disabled { opacity: .58; cursor: not-allowed; }
.course-kind-card strong, .course-kind-card small { display: block; }
.course-kind-card strong { margin-bottom: 5px; color: #263b70; font-size: 14px; }
.course-kind-card small { color: var(--muted); font-size: 11px; line-height: 1.42; }
.course-kind-card > i { width: 15px; height: 15px; border: 1px solid rgba(71,88,123,.28); border-radius: 50%; background: white; }
.course-kind-card.is-selected > i { border: 4px solid #3157d5; }
.course-kind-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: #e9efff; color: #3157d5; font-size: 20px; font-style: normal; }
.course-kind-icon.additional { background: #e9f8f2; color: #168064; }
.course-create-body { display: grid; min-width: 0; gap: 0; }
.course-mode-panel { min-width: 0; border-bottom: 1px solid var(--line); }
.course-mode-panel[hidden] { display: none !important; }
.panel-heading-inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 23px 0; }
.panel-heading-inline h2 { margin: 4px 0 0; font-size: 19px; }
.source-lock { display: inline-flex; max-width: 100%; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: #e8f8f2; color: #18795d; font-size: 11px; font-weight: 700; text-align: right; }
.source-lock.neutral { background: #eef1f6; color: #596880; }
.compact-grid { padding-top: 17px; }
.selected-subject-summary { min-height: 44px; padding: 12px 14px; border: 1px dashed rgba(49,87,213,.23); border-radius: 12px; background: #f5f7ff; color: #405487; font-size: 12px; line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .workspace-grid, .role-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-layout { gap: 34px; }
  .authenticated-layout .course-create-shell .form-grid,
  .authenticated-layout .form-shell .form-grid { grid-template-columns: 1fr; }
  .authenticated-layout .course-create-shell .field-wide,
  .authenticated-layout .form-shell .field-wide { grid-column: auto; }
  .course-create-shell .course-kind-grid { grid-template-columns: 1fr; }
  .course-create-shell .panel-heading-inline { align-items: flex-start; flex-direction: column; }
  .course-create-shell .source-lock { text-align: left; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 18px; }
  .page-shell { width: min(100% - 30px, 1240px); padding-top: 26px; }
  .footer { padding: 0 18px; }
  .auth-layout { grid-template-columns: 1fr; padding: 24px 0; }
  .auth-story h1 { font-size: 40px; }
  .page-heading { display: block; }
  .stage-badge { margin-top: 18px; }
  .account-chip > span:not(.account-dot) { display: none; }
  .heading-actions { justify-content: flex-start; margin-top: 16px; }
  .registry-toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .action-panel, .section-heading { align-items: flex-start; flex-direction: column; }
  .inline-actions { justify-content: flex-start; }
  .material-card { grid-template-columns: 38px minmax(0,1fr); }
  .material-card > .row-actions { grid-column: 2; }
  .viewer-meta { grid-template-columns: 1fr 1fr; }
  .document-frame { min-height: 480px; }
  .viewer-shell[data-media-viewer] .media-surface { min-height: 0; }
  .viewer-shell[data-media-viewer] .media-controls { gap: 6px; padding: 8px; }
  .viewer-icon { width: 38px; height: 38px; }
  .course-kind-grid { grid-template-columns: 1fr; }
  .panel-heading-inline { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .workspace-grid, .role-grid { grid-template-columns: 1fr; }
  .workspace-card { min-height: 190px; }
  .footer { font-size: 11px; }
  .metric-strip { grid-template-columns: 1fr; }
  .inline-actions form { width: 100%; flex-wrap: wrap; }
  .inline-actions input { width: 100%; }
  .viewer-meta { grid-template-columns: 1fr; }
  .document-frame { min-height: 430px; height: 68vh; }
  .viewer-shell[data-media-viewer] .media-controls { position: static; }
  .media-timeline { grid-column: 1 / -1; grid-row: 1; }
  .media-time { grid-column: 1 / -1; }
  .media-speed { width: 100%; }
}

/* Course-focused application shell. */
:root {
  --sidebar-width: 17.5rem;
  --sidebar-compact-width: 4.75rem;
  --app-topbar-height: 4.5rem;
  --app-statusbar-height: 2.5rem;
}
.authenticated-layout { background: #f5f7fb; }
.app-shell { min-height: 100dvh; }
.app-sidebar {
  position: fixed;
  z-index: 60;
  inset-block: 0;
  inset-inline-start: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: var(--sidebar-width);
  overflow: hidden;
  border-inline-end: 1px solid rgba(61, 76, 108, .11);
  background: rgba(250, 251, 255, .96);
  box-shadow: 18px 0 48px rgba(35, 47, 78, .06);
  backdrop-filter: blur(18px);
  transition: width .2s ease, transform .2s ease;
}
.sidebar-brand-row { display: flex; align-items: center; gap: 8px; min-height: var(--app-topbar-height); padding: 10px 11px 10px 13px; border-bottom: 1px solid var(--line); }
.sidebar-brand { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.sidebar-brand-mark { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #4167e6, #2747b7); color: #fff; box-shadow: 0 10px 22px rgba(49, 87, 213, .23); font-size: 18px; font-weight: 700; }
.sidebar-brand-copy { display: grid; min-width: 0; line-height: 1.2; }
.sidebar-brand-copy > span { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.sidebar-collapse, .mobile-menu-button, .sidebar-logout { display: grid; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; place-items: center; border: 0; border-radius: 11px; background: #eef2f9; color: #52617b; cursor: pointer; }
.sidebar-collapse:hover, .sidebar-collapse:focus-visible, .mobile-menu-button:hover, .mobile-menu-button:focus-visible, .sidebar-logout:hover, .sidebar-logout:focus-visible { background: #e3e9f6; color: #3157d5; outline: 0; }
.sidebar-collapse svg, .mobile-menu-button svg, .sidebar-logout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-collapse svg { transition: transform .2s ease; }
.sidebar-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 14px 10px 18px; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-group { display: grid; gap: 5px; margin-top: 14px; }
.sidebar-group-title { margin: 0; padding: 0 11px 5px; overflow: hidden; color: #8a94a7; font-size: 10px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.sidebar-link { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 46px; padding: 4px 9px 4px 6px; border: 1px solid transparent; border-radius: 13px; color: #526079; text-decoration: none; }
.sidebar-link:hover { border-color: rgba(64, 84, 128, .1); background: #f1f4fa; color: #263c70; }
.sidebar-link.is-active { border-color: rgba(49, 87, 213, .14); background: #eaf0ff; color: #294bb8; box-shadow: inset 3px 0 #3157d5; }
.sidebar-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #edf1f7; color: #5a6881; }
.sidebar-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-color-blue .sidebar-icon { background: #e9efff; color: #3157d5; }
.nav-color-violet .sidebar-icon { background: #f0ebff; color: #7353d4; }
.nav-color-green .sidebar-icon { background: #e6f7f0; color: #168163; }
.nav-color-orange .sidebar-icon { background: #fff1dc; color: #b96b16; }
.nav-color-cyan .sidebar-icon { background: #e4f5fa; color: #167f9e; }
.nav-color-rose .sidebar-icon { background: #fce8ee; color: #b94f6b; }
.sidebar-label { overflow: hidden; font-size: 13px; font-weight: 500; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account { display: grid; grid-template-columns: 38px minmax(0, 1fr) 36px; gap: 9px; align-items: center; min-height: 67px; padding: 10px 11px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .72); }
.sidebar-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #dfe7ff, #edf7f2); color: #3157d5; font-size: 14px; font-weight: 700; }
.sidebar-account-copy { display: grid; min-width: 0; line-height: 1.25; }
.sidebar-account-copy span, .sidebar-account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-copy span { font-size: 12px; font-weight: 650; }
.sidebar-account-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.app-workspace { min-height: 100dvh; margin-inline-start: var(--sidebar-width); transition: margin-inline-start .2s ease; }
.app-topbar { position: fixed; z-index: 40; inset-block-start: 0; inset-inline: var(--sidebar-width) 0; display: flex; height: var(--app-topbar-height); align-items: center; justify-content: space-between; gap: 18px; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .88); backdrop-filter: blur(18px); transition: inset-inline-start .2s ease; }
.mobile-menu-button { display: none; }
.topbar-title { display: grid; line-height: 1.2; }
.topbar-title span { font-size: 14px; font-weight: 650; }
.topbar-title small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 9px; margin-inline-start: auto; }
.topbar-lms-link { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(49, 87, 213, .14); border-radius: 11px; background: #eaf0ff; color: #3157d5; text-decoration: none; }
.topbar-lms-link:hover { border-color: rgba(49, 87, 213, .28); background: #dfe8ff; color: #294bb8; }
.topbar-lms-link:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #3157d5, 0 0 0 3px rgba(49,87,213,.13); }
.topbar-lms-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar-account { display: flex; align-items: center; gap: 10px; color: #4f5d75; font-size: 12px; }
.authenticated-layout .page-shell { width: min(1340px, calc(100% - 48px)); min-height: 100dvh; padding-block: calc(var(--app-topbar-height) + 28px) calc(var(--app-statusbar-height) + 28px); }
.app-statusbar { position: fixed; z-index: 35; inset-inline: var(--sidebar-width) 0; inset-block-end: 0; display: flex; height: var(--app-statusbar-height); align-items: center; justify-content: space-between; gap: 16px; padding: 0 26px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .92); color: var(--muted); font-size: 11px; backdrop-filter: blur(16px); transition: inset-inline-start .2s ease; }
.sidebar-backdrop { display: none; }
.sidebar-compact .app-sidebar { width: var(--sidebar-compact-width); }
.sidebar-compact .app-workspace { margin-inline-start: var(--sidebar-compact-width); }
.sidebar-compact .app-topbar, .sidebar-compact .app-statusbar { inset-inline-start: var(--sidebar-compact-width); }
.sidebar-compact .sidebar-brand-row { justify-content: center; padding-inline: 8px; }
.sidebar-compact .sidebar-brand { flex: 0 0 auto; }
.sidebar-compact .sidebar-brand-copy, .sidebar-compact .sidebar-label, .sidebar-compact .sidebar-group-title, .sidebar-compact .sidebar-account-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.sidebar-compact .sidebar-collapse { position: absolute; inset-block-start: 53px; inset-inline-start: 48px; width: 24px; height: 24px; border: 1px solid var(--line); background: #fff; box-shadow: 0 5px 14px rgba(29, 45, 83, .12); }
.sidebar-compact .sidebar-collapse svg { width: 13px; transform: rotate(180deg); }
.sidebar-compact .sidebar-scroll { padding-inline: 10px; }
.sidebar-compact .sidebar-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sidebar-compact .sidebar-link { grid-template-columns: 38px; justify-content: center; padding-inline: 7px; }
.sidebar-compact .sidebar-account {
  grid-template-columns: 38px;
  grid-template-rows: repeat(2, 38px);
  justify-content: center;
}
.sidebar-compact .sidebar-account form {
  display: block;
  grid-column: 1;
  grid-row: 2;
}
.login-scope-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 22px 0 18px; padding: 4px; border-radius: 13px; background: #eef2f8; }
.login-scope-tabs button { min-height: 38px; padding: 7px 10px; border: 0; border-radius: 10px; background: transparent; color: #657188; cursor: pointer; font-size: 12px; font-weight: 600; }
.login-scope-tabs button[aria-selected="true"] { background: #fff; color: #294bb8; box-shadow: 0 4px 14px rgba(29, 45, 83, .09); }
.login-scope-panel[hidden] { display: none; }
.external-login-form {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}
.external-login-form h3 { margin: 4px 0 6px; font-size: 17px; line-height: 1.3; }
.external-login-form label { margin-top: 2px; color: #35415a; font-size: 12px; font-weight: 650; }
.external-login-form .field-message { margin-top: -6px; }
.external-login-form .primary-button { width: 100%; margin-top: 4px; }
.external-login-form small { color: var(--muted); line-height: 1.5; }
.course-kind-tabs { margin-bottom: 8px; }
.course-dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.course-dashboard-grid .workspace-card { min-height: 225px; }
.dashboard-metric { display: flex; align-items: baseline; gap: 6px; margin-top: auto; padding-top: 18px; color: #263d84; font-size: 27px; font-weight: 680; }
.dashboard-metric small { color: var(--muted); font-size: 11px; font-weight: 550; }

@media (max-width: 820px) {
  .app-sidebar { width: min(18rem, calc(100vw - 3.25rem)); transform: translateX(-105%); box-shadow: 24px 0 64px rgba(24, 34, 61, .2); }
  .app-workspace { margin-inline-start: 0; }
  .app-topbar, .app-statusbar, .sidebar-compact .app-topbar, .sidebar-compact .app-statusbar { inset-inline-start: 0; }
  .app-topbar { padding-inline: 16px; }
  .mobile-menu-button { display: grid; }
  .topbar-account { margin-inline-start: auto; }
  .sidebar-collapse { display: none; }
  .sidebar-backdrop { position: fixed; z-index: 50; inset: 0; display: block; border: 0; background: rgba(21, 29, 50, .35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .sidebar-modal-open { overflow: hidden; }
  .authenticated-layout .page-shell { width: min(100% - 28px, 1340px); padding-top: calc(var(--app-topbar-height) + 20px); }
  .app-statusbar { padding-inline: 16px; }
  .course-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .topbar-title small, .topbar-account .account-dot { display: none; }
  .topbar-account { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-statusbar > span:first-child { display: none; }
  .app-statusbar { justify-content: flex-end; }
  .login-scope-tabs { grid-template-columns: 1fr; }
  .course-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
  .app-topbar { gap: 10px; padding-inline: 12px; }
  .topbar-title { display: none; }
  .topbar-account { max-width: calc(100vw - 146px); }
  .authenticated-layout .page-shell { width: min(100% - 20px, 1340px); }
  .course-kind-fieldset, .form-grid, .form-actions { padding-inline: 15px; }
  .panel-heading-inline { padding-inline: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-sidebar, .app-workspace, .app-topbar, .app-statusbar, .sidebar-backdrop, .sidebar-collapse svg { transition: none; }
}

/* Course builder and learner workspace. Isolated from registry/form layouts. */
.course-builder-shell,
.learning-shell {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: minmax(14.5rem, 270px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.course-builder-shell > *,
.learning-shell > *,
.builder-canvas,
.builder-block-list,
.builder-block-card,
.unit-card { min-width: 0; max-width: 100%; }
.course-tree,
.module-nav {
  position: sticky;
  top: calc(var(--app-topbar-height) + 18px);
  display: grid;
  max-height: calc(100dvh - var(--app-topbar-height) - var(--app-statusbar-height) - 36px);
  gap: 10px;
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 32px rgba(29,45,83,.05);
  scrollbar-gutter: stable;
}
.course-tree-header,
.module-nav-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 1px 2px 9px;
  border-bottom: 1px solid var(--line);
}
.course-tree-header h2,
.module-nav-header h2 { min-width: 0; margin: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.course-tree-list,
.course-tree-children,
.module-nav-list { display: grid; min-width: 0; gap: 5px; margin: 0; padding: 0; list-style: none; }
.course-tree-children { margin: 4px 0 2px 17px; padding-left: 9px; border-left: 1px solid rgba(71,88,123,.14); }
.course-tree-item,
.module-nav-item {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 28px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #46536d;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.course-tree-item:hover,
.module-nav-item:hover { border-color: rgba(49,87,213,.13); background: #f5f7fc; color: #294bab; }
.course-tree-item.is-active,
.course-tree-item[aria-current="true"],
.module-nav-item.is-active,
.module-nav-item[aria-current="step"] { border-color: rgba(49,87,213,.22); background: #edf2ff; color: #294bab; }
.course-tree-item > span,
.module-nav-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-tree-item svg,
.module-nav-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.course-tree-index,
.module-nav-index { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 9px; background: #eef2f8; color: #65718a; font-size: 11px; font-weight: 750; }
.builder-canvas {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 16px 42px rgba(29,45,83,.06);
}
.builder-toolbar {
  position: sticky;
  z-index: 8;
  top: calc(var(--app-topbar-height) + 8px);
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(250,251,254,.96);
  backdrop-filter: blur(12px);
}
.builder-toolbar > div { display: flex; min-width: 0; align-items: center; gap: 7px; }
.builder-toolbar-title { min-width: 0; overflow: hidden; color: #2b3853; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.builder-block-list { display: grid; gap: 11px; padding: 18px; }
.builder-block-card,
.unit-card {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 13px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(29,45,83,.035);
}
.builder-block-card:hover { border-color: rgba(49,87,213,.2); }
.builder-block-icon,
.unit-card-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: #edf2ff;
  color: #3157d5;
}
.builder-block-icon svg,
.unit-card-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.builder-block-copy,
.unit-card-copy { min-width: 0; }
.builder-block-copy h3,
.unit-card-copy h3 { margin: 1px 0 5px; overflow-wrap: anywhere; color: #2b3853; font-size: 14px; }
.builder-block-copy p,
.unit-card-copy p { margin: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; line-height: 1.5; }
.builder-block-actions,
.unit-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.content-type-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
  padding: 13px 18px 18px;
  border-top: 1px solid var(--line);
  background: #fafbfe;
}
.content-type-picker button,
.content-type-picker a {
  display: grid;
  min-width: 0;
  min-height: 66px;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(71,88,123,.15);
  border-radius: 12px;
  background: #fff;
  color: #41506a;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.content-type-picker button:hover,
.content-type-picker a:hover { border-color: rgba(49,87,213,.28); background: #f1f5ff; color: #294bab; }
.content-type-picker svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.content-type-picker span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 650; }
.course-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(90,78,201,.2);
  border-radius: 14px;
  background: linear-gradient(135deg,#f6f3ff,#f2f6ff);
  color: #5547b0;
  font-size: 12px;
}
.course-preview-banner strong { font-size: 13px; }
.course-preview-banner p { margin: 2px 0 0; color: #7367a8; line-height: 1.45; }
.simple-modal {
  width: min(640px, calc(100vw - 32px));
  max-width: 100%;
  max-height: min(82dvh, 760px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(71,88,123,.18);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 26px 80px rgba(22,32,56,.24);
}
.simple-modal::backdrop { background: rgba(20,29,49,.42); backdrop-filter: blur(3px); }
.simple-modal-shell { display: grid; max-height: inherit; grid-template-rows: auto minmax(0,1fr) auto; }
.simple-modal-header,
.simple-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; }
.simple-modal-header { border-bottom: 1px solid var(--line); }
.simple-modal-header h2 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 18px; }
.simple-modal-body { min-width: 0; padding: 17px; overflow: auto; }
.simple-modal-footer { flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--line); background: #f8f9fc; }
.rich-text-editor { min-width: 0; overflow: hidden; border: 1px solid rgba(71,88,123,.2); border-radius: 14px; background: #fff; }
.rich-text-toolbar {
  display: flex;
  min-width: 0;
  gap: 5px;
  padding: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #f7f9fc;
  scrollbar-width: thin;
}
.rich-text-toolbar button { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #45536c; cursor: pointer; }
.rich-text-toolbar button:hover,
.rich-text-toolbar button[aria-pressed="true"] { border-color: rgba(49,87,213,.17); background: #e9efff; color: #294bab; }
.rich-text-toolbar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rich-text-content { min-height: 260px; max-height: 58dvh; padding: 17px; overflow: auto; color: #2e3b55; line-height: 1.65; overflow-wrap: anywhere; }
.rich-text-content:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #3157d5; }
.rich-text-content a { color: #3157d5; text-underline-offset: 2px; }
.assessment-badge,
.practice-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.assessment-badge { background: #f0ebff; color: #6d4fc2; }
.practice-badge { background: #e8f8f2; color: #14785c; }
.learning-content { min-width: 0; }
.unit-card { margin-bottom: 11px; }
.unit-card.is-locked,
.unit-card[data-state="locked"],
.course-tree-item.is-locked,
.module-nav-item.is-locked { color: #7b8496; background: #f3f5f8; }
.unit-card.is-locked,
.unit-card[data-state="locked"] { border-style: dashed; box-shadow: none; }
.unit-card.is-locked .unit-card-copy,
.unit-card[data-state="locked"] .unit-card-copy { opacity: .72; }
.unit-card.is-completed,
.unit-card[data-state="completed"] { border-color: rgba(31,145,108,.24); background: #f5fcf9; }
.course-tree-item.is-completed .course-tree-index,
.module-nav-item.is-completed .module-nav-index { background: #ddf4eb; color: #14785c; }
.builder-empty-state { padding: 38px 22px; text-align: center; color: var(--muted); }
.builder-empty-state h2 { margin: 0 0 7px; color: #2f3d58; font-size: 18px; }
.builder-empty-state p { max-width: 520px; margin: 0 auto 15px; line-height: 1.55; }
.course-builder-shell button:disabled,
.learning-shell button:disabled,
.content-type-picker [aria-disabled="true"] { opacity: .52; cursor: not-allowed; filter: saturate(.55); }
.course-tree-item:focus-visible,
.module-nav-item:focus-visible,
.content-type-picker button:focus-visible,
.content-type-picker a:focus-visible,
.builder-toolbar button:focus-visible,
.builder-toolbar a:focus-visible,
.builder-block-card button:focus-visible,
.builder-block-card a:focus-visible,
.simple-modal button:focus-visible,
.simple-modal a:focus-visible,
.rich-text-toolbar button:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px #3157d5, 0 0 0 3px rgba(49,87,213,.13);
}

@media (max-width: 900px) {
  .course-builder-shell,
  .learning-shell { grid-template-columns: minmax(0,1fr); }
  .course-tree,
  .module-nav { position: static; max-height: min(42dvh, 430px); }
  .builder-toolbar { top: var(--app-topbar-height); flex-wrap: wrap; align-items: flex-start; }
  .builder-toolbar > div { flex-wrap: wrap; }
  .course-preview-banner { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .builder-block-list { padding: 13px; }
  .builder-block-card,
  .unit-card { grid-template-columns: 38px minmax(0,1fr); padding: 13px; }
  .builder-block-icon,
  .unit-card-icon { width: 36px; height: 36px; }
  .builder-block-actions,
  .unit-card-actions { grid-column: 2; justify-content: flex-start; }
  .simple-modal { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
  .simple-modal-header,
  .simple-modal-body,
  .simple-modal-footer { padding-inline: 13px; }
}
@media (max-width: 390px) {
  .course-builder-shell,
  .learning-shell { gap: 11px; }
  .course-tree,
  .module-nav { padding: 10px; border-radius: 14px; }
  .builder-canvas { border-radius: 15px; }
  .builder-toolbar { padding: 10px; }
  .builder-toolbar-title { flex-basis: 100%; }
  .content-type-picker { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 10px 13px 13px; }
  .content-type-picker button,
  .content-type-picker a { min-height: 58px; grid-template-columns: 26px minmax(0,1fr); padding: 8px; }
  .builder-block-card,
  .unit-card { grid-template-columns: 34px minmax(0,1fr); gap: 9px; padding: 11px; }
  .builder-block-icon,
  .unit-card-icon { width: 32px; height: 32px; border-radius: 10px; }
  .rich-text-content { min-height: 220px; padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .course-tree-item,
  .module-nav-item,
  .builder-block-card,
  .content-type-picker button,
  .content-type-picker a { scroll-behavior: auto; transition: none; }
}

/* Shared PDF modal viewer. Download and print actions are intentionally not rendered. */
.pdf-viewer-modal {
  width: min(1180px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(71,88,123,.18);
  border-radius: 20px;
  background: #202536;
  color: #fff;
  box-shadow: 0 30px 90px rgba(16,24,43,.32);
}
.pdf-viewer-modal::backdrop { background: rgba(18,26,45,.5); backdrop-filter: blur(4px); }
.pdf-viewer-shell { display: grid; width: 100%; height: 100%; min-width: 0; min-height: 0; grid-template-rows: auto minmax(0,1fr) auto; }
.pdf-viewer-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px 10px 17px;
  border-bottom: 1px solid rgba(255,255,255,.11);
  background: #2b3144;
}
.pdf-viewer-header > div { min-width: 0; }
.pdf-viewer-header h2 { margin: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer-header p { margin: 3px 0 0; overflow: hidden; color: rgba(255,255,255,.66); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer-close,
.pdf-viewer-fullscreen,
.pdf-viewer-toolbar button {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
}
.pdf-viewer-close:hover,
.pdf-viewer-fullscreen:hover,
.pdf-viewer-toolbar button:hover { background: rgba(255,255,255,.17); }
.pdf-viewer-close svg,
.pdf-viewer-fullscreen svg,
.pdf-viewer-toolbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pdf-viewer-stage {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: flex-start;
  justify-content: center;
  padding: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  background: radial-gradient(circle at 50% 0, #394157, #1c2130 70%);
  scrollbar-gutter: stable;
}
.pdf-viewer-page {
  flex: 0 0 auto;
  width: var(--pdf-page-width, auto);
  max-width: none;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  line-height: 0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,.24);
}
.pdf-viewer-page canvas { display: block; max-width: none; background: #fff; }
.pdf-viewer-empty { align-self: center; display: grid; max-width: 420px; justify-items: center; gap: 12px; padding: 26px; color: rgba(255,255,255,.8); text-align: center; }
.pdf-viewer-empty[hidden] { display: none; }
.pdf-viewer-empty-icon { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 17px; background: rgba(255,255,255,.08); color: #dce5ff; font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.pdf-viewer-empty p { margin: 0; font-size: 13px; line-height: 1.5; }
.pdf-viewer-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: 58px;
  padding: 9px 12px;
  overflow-x: auto;
  border-top: 1px solid rgba(255,255,255,.11);
  background: #2b3144;
  scrollbar-width: thin;
}
.pdf-viewer-toolbar-group { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.pdf-viewer-toolbar-output,
.pdf-viewer-page-number,
.pdf-viewer-zoom { flex: 0 0 auto; min-width: 72px; color: rgba(255,255,255,.84); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; }
.pdf-viewer-toolbar-output { flex: 1 1 180px; min-width: 120px; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.pdf-viewer-toolbar-output[data-state="error"] { color: #ffd1d1; }
.pdf-viewer-toolbar-output[data-state="loading"] { color: #dce5ff; }
.pdf-viewer-modal:fullscreen { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; }
.pdf-viewer-modal [data-pdf-action="download"],
.pdf-viewer-modal [data-pdf-action="print"] { display: none !important; }
.pdf-viewer-close:focus-visible,
.pdf-viewer-fullscreen:focus-visible,
.pdf-viewer-toolbar button:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #8ea6ff, 0 0 0 3px rgba(142,166,255,.22); }

@media (max-width: 900px) {
  .pdf-viewer-modal { width: calc(100vw - 20px); height: calc(100dvh - 20px); border-radius: 16px; }
  .pdf-viewer-stage { padding: 14px; }
  .pdf-viewer-toolbar { justify-content: flex-start; flex-wrap: wrap; }
  .pdf-viewer-toolbar-output { flex-basis: 100%; order: 3; text-align: left; }
}
@media (max-width: 390px) {
  .pdf-viewer-modal { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .pdf-viewer-header { min-height: 52px; padding: 7px 8px 7px 12px; }
  .pdf-viewer-header p { display: none; }
  .pdf-viewer-stage { padding: 8px; }
  .pdf-viewer-toolbar { min-height: 52px; flex-wrap: wrap; padding: 7px 8px; }
  .pdf-viewer-close,
  .pdf-viewer-fullscreen,
  .pdf-viewer-toolbar button { flex-basis: 36px; width: 36px; height: 36px; }
}

/* Assessment question editor. The aqe prefix intentionally isolates the component. */
.aqe-modal {
  width: min(1080px, calc(100vw - 32px));
  max-width: 100%;
  max-height: min(90dvh, 920px);
}
.aqe-modal .simple-modal-shell { max-height: inherit; }
.aqe-modal .simple-modal-body { min-height: 0; padding: 0; overflow: hidden; }
.assessment-composer-body { background: #f5f7fb; }
.assessment-composer-layout {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(205px, 230px) minmax(0, 1fr);
}
.assessment-settings-pane {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 14px;
  padding: 15px 14px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f7f9fd, #f2f5fb);
  scrollbar-gutter: stable;
}
.assessment-question-pane { min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.assessment-range-field { display: grid; min-width: 0; gap: 8px; }
.assessment-range-field > span { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; color: #46536d; font-size: 11px; font-weight: 700; }
.assessment-range-field output { flex: 0 0 auto; color: #3157d5; font-size: 13px; font-variant-numeric: tabular-nums; }
.assessment-range-field input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.assessment-range-field input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: linear-gradient(90deg, #3157d5 0 var(--range-progress, 0%), #dfe5f1 var(--range-progress, 0%) 100%); }
.assessment-range-field input[type="range"]::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -5.5px; appearance: none; border: 3px solid #fff; border-radius: 50%; background: #3157d5; box-shadow: 0 1px 5px rgba(36,59,128,.34); }
.assessment-range-field input[type="range"]::-moz-range-track { height: 5px; border-radius: 999px; background: #dfe5f1; }
.assessment-range-field input[type="range"]::-moz-range-progress { height: 5px; border-radius: 999px; background: #3157d5; }
.assessment-range-field input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 3px solid #fff; border-radius: 50%; background: #3157d5; box-shadow: 0 1px 5px rgba(36,59,128,.34); }
.assessment-range-field input[type="range"]:focus-visible { outline: 0; filter: drop-shadow(0 0 3px rgba(49,87,213,.5)); }
.assessment-score-summary { display: grid; gap: 7px; margin-top: 2px; padding: 10px 11px; border: 1px solid rgba(49,87,213,.13); border-radius: 12px; background: rgba(255,255,255,.86); }
.assessment-score-summary > span,
.assessment-score-summary > strong { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; color: #5d6980; font-size: 11px; }
.assessment-score-summary > strong { color: #2b3853; font-size: 12px; }
.assessment-score-summary output { color: #3157d5; font-size: 15px; font-variant-numeric: tabular-nums; }
.assessment-format-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.assessment-format-chips span { padding: 5px 8px; border: 1px solid rgba(49,87,213,.13); border-radius: 999px; background: #edf2ff; color: #294bab; font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.aqe-editor {
  display: grid;
  min-width: 0;
  min-height: min(560px, 66dvh);
  max-height: min(680px, 70dvh);
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #f7f9fd;
}
.aqe-commandbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.aqe-commandbar-copy { display: flex; min-width: 0; align-items: baseline; gap: 8px; }
.aqe-commandbar-copy strong { color: #2b3853; font-size: 14px; }
.aqe-commandbar-copy span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #edf2ff;
  color: #3157d5;
  font-size: 11px;
  font-weight: 750;
}
.aqe-add-question,
.aqe-add-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(49,87,213,.22);
  border-radius: 10px;
  background: #edf2ff;
  color: #294bab;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.aqe-add-question:hover,
.aqe-add-item:hover { border-color: rgba(49,87,213,.36); background: #e3eaff; }
.aqe-add-question:disabled,
.aqe-add-item:disabled { opacity: .5; cursor: not-allowed; }
.aqe-add-question svg,
.aqe-add-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.aqe-status {
  min-height: 34px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8f9fc;
  color: #66728a;
  font-size: 11px;
  line-height: 1.45;
}
.aqe-status[data-state="error"] { background: #fff3f4; color: #aa354b; }
.aqe-status[data-state="success"] { background: #edf9f4; color: #14785c; }
.aqe-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
}
.aqe-question-pane {
  min-width: 0;
  min-height: 0;
  padding: 10px;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f5f7fb;
  scrollbar-gutter: stable;
}
.aqe-question-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.aqe-question-item {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px;
  align-items: stretch;
  border-radius: 11px;
}
.aqe-question-drag { align-self: center; width: 30px; height: 32px; border-color: transparent; background: transparent; color: #77839a; cursor: grab; }
.aqe-question-drag:active { cursor: grabbing; }
.aqe-question-drag svg { stroke-width: 3.2; stroke-linecap: round; }
.aqe-question-item.is-dragging { opacity: .42; }
.aqe-question-item.is-drop-before::before,
.aqe-question-item.is-drop-after::after { position: absolute; right: 0; left: 0; z-index: 2; height: 2px; border-radius: 999px; background: #3157d5; content: ""; }
.aqe-question-item.is-drop-before::before { top: -3px; }
.aqe-question-item.is-drop-after::after { bottom: -3px; }
.aqe-question-row {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #45526b;
  text-align: left;
  cursor: pointer;
}
.aqe-question-row:hover { border-color: rgba(49,87,213,.14); background: #fff; }
.aqe-question-row.is-active { border-color: rgba(49,87,213,.24); background: #edf2ff; color: #294bab; }
.aqe-question-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: #e8edf5;
  color: #65718a;
  font-size: 11px;
  font-weight: 750;
}
.aqe-question-row.is-active .aqe-question-number { background: #dce6ff; color: #294bab; }
.aqe-question-copy { display: grid; min-width: 0; gap: 2px; }
.aqe-question-copy strong,
.aqe-question-copy small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aqe-question-copy strong { font-size: 12px; font-weight: 700; }
.aqe-question-copy small { color: #778197; font-size: 10px; }
.aqe-detail-pane { min-width: 0; min-height: 0; overflow: auto; background: #fff; scrollbar-gutter: stable; }
.aqe-detail-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.aqe-detail-header h3 { min-width: 0; margin: 0; overflow: hidden; color: #2b3853; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.aqe-detail-actions,
.aqe-item-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.aqe-icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fd;
  color: #40506b;
  cursor: pointer;
}
.aqe-icon-button:hover { border-color: rgba(49,87,213,.24); background: #eaf0ff; color: #294aba; }
.aqe-icon-button:disabled { opacity: .42; cursor: not-allowed; }
.aqe-icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aqe-icon-button.aqe-danger { border-color: rgba(190,64,83,.18); background: #fff0f2; color: #ae354b; }
.aqe-detail-body { display: grid; min-width: 0; gap: 14px; padding: 15px; }
.aqe-common-grid,
.aqe-two-column { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(120px, .34fr); gap: 12px; }
.aqe-field { display: grid; min-width: 0; gap: 6px; color: #46536d; font-size: 11px; font-weight: 700; }
.aqe-field-wide { grid-column: 1 / -1; }
.aqe-field-label { min-width: 0; overflow-wrap: anywhere; }
.aqe-control {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(71,88,123,.22);
  border-radius: 10px;
  background: #fff;
  color: #25324b;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
}
.aqe-control:focus-visible {
  outline: 0;
  border-color: #6f88e5;
  box-shadow: inset 0 0 0 1px #6f88e5, 0 0 0 3px rgba(49,87,213,.10);
}
.aqe-textarea { resize: vertical; line-height: 1.5; }
.aqe-check-field { display: flex; align-items: center; gap: 8px; }
.aqe-check-field .aqe-control { width: 18px; min-height: 18px; }
.aqe-help { margin: 0; padding: 9px 11px; border-radius: 10px; background: #f3f6fc; color: #64718a; font-size: 11px; line-height: 1.5; }
.aqe-item-list { display: grid; min-width: 0; gap: 7px; }
.aqe-item-row {
  display: grid;
  min-width: 0;
  grid-template-columns: 25px auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}
.aqe-item-index { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; background: #edf1f6; color: #68748a; font-size: 10px; font-weight: 750; }
.aqe-item-row > input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: #3157d5; }
.aqe-pair-row,
.aqe-classification-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.aqe-gap-card { display: grid; min-width: 0; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #f9fafd; }
.aqe-gap-header { display: flex; min-width: 0; align-items: end; justify-content: space-between; gap: 10px; }
.aqe-gap-header .aqe-field { max-width: 220px; }
.aqe-empty { display: grid; min-height: 220px; place-content: center; gap: 6px; padding: 24px; color: #6c778d; text-align: center; }
.aqe-empty strong { color: #35435d; font-size: 15px; }
.aqe-empty p { max-width: 420px; margin: 0; font-size: 12px; line-height: 1.55; }
.aqe-add-question:focus-visible,
.aqe-add-item:focus-visible,
.aqe-icon-button:focus-visible,
.aqe-question-row:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #3157d5, 0 0 0 3px rgba(49,87,213,.13); }

@media (max-width: 760px) {
  .aqe-modal { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .assessment-composer-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .assessment-settings-pane { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 190px; border-right: 0; border-bottom: 1px solid var(--line); }
  .assessment-settings-pane > .field,
  .assessment-settings-pane > .assessment-score-summary { grid-column: 1 / -1; }
  .aqe-editor { min-height: 0; max-height: calc(100dvh - 150px); }
  .aqe-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(110px, 30dvh) minmax(260px, 1fr); }
  .aqe-question-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .aqe-common-grid,
  .aqe-two-column { grid-template-columns: minmax(0, 1fr); }
  .aqe-pair-row,
  .aqe-classification-row { grid-template-columns: minmax(0, 1fr); }
  .aqe-pair-row .aqe-item-actions,
  .aqe-classification-row .aqe-item-actions { justify-content: flex-end; }
}

@media (max-width: 420px) {
  .aqe-modal { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .aqe-commandbar { align-items: stretch; flex-direction: column; }
  .aqe-add-question { width: 100%; }
  .aqe-detail-header { align-items: flex-start; }
  .aqe-item-row { grid-template-columns: 25px auto minmax(0, 1fr); }
  .aqe-item-row .aqe-item-actions { grid-column: 2 / -1; justify-content: flex-end; }
  .aqe-gap-header { align-items: stretch; flex-direction: column; }
  .aqe-gap-header .aqe-field { max-width: none; }
  .assessment-settings-pane { grid-template-columns: minmax(0,1fr); max-height: 230px; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .aqe-question-row,
  .aqe-icon-button,
  .aqe-add-question,
  .aqe-add-item { transition: none; }
}

/* Hierarchical course constructor: sections -> topics, with service-only course tools. */
.builder-system-panel {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(71,88,123,.15);
  border-radius: 18px;
  background: linear-gradient(135deg,rgba(248,250,255,.98),rgba(255,255,255,.98));
  box-shadow: 0 12px 32px rgba(29,45,83,.045);
}
.builder-system-header { display: flex; min-width: 0; align-items: start; justify-content: space-between; gap: 12px; }
.builder-system-header h2 { margin: 3px 0 2px; color: #2b3853; font-size: 17px; }
.builder-system-header p,
.builder-system-group-heading p,
.builder-service-heading p,
.builder-panel-header > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.builder-system-grid { display: grid; min-width: 0; grid-template-columns: minmax(260px,.8fr) minmax(320px,1.2fr); gap: 10px; }
.builder-system-group,
.builder-section-service {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(71,88,123,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
}
.builder-system-required { border-color: rgba(109,79,194,.2); background: #fbf9ff; }
.builder-system-group-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; }
.builder-system-group-heading h3,
.builder-service-heading h3 { margin: 0 0 2px; color: #35425d; font-size: 13px; }
.builder-system-group-heading .compact-button { flex: 0 0 auto; min-height: 34px; }
.builder-system-file-list { display: grid; min-width: 0; gap: 7px; }
.builder-system-group .builder-block-card,
.builder-section-service .builder-block-card {
  grid-template-columns: 34px minmax(0,1fr) auto;
  gap: 9px;
  padding: 10px;
  border-radius: 12px;
  box-shadow: none;
}
.builder-system-group .builder-block-icon,
.builder-section-service .builder-block-icon { width: 32px; height: 32px; border-radius: 10px; }
.builder-system-group .builder-block-copy h3,
.builder-section-service .builder-block-copy h3 { margin-bottom: 2px; font-size: 12px; }
.builder-system-group .builder-block-copy p,
.builder-section-service .builder-block-copy p { font-size: 10px; }
.course-builder-shell { grid-template-columns: minmax(300px, 330px) minmax(0, 1fr); }
.builder-workspace {
  min-width: 0;
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 16px 42px rgba(29,45,83,.055);
}
.builder-workspace > section[hidden],
.course-preview-panel > section[hidden] { display: none !important; }
.builder-panel-header {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafbfe;
}
.builder-panel-header h2 { margin: 2px 0 0; overflow-wrap: anywhere; color: #2b3853; font-size: 17px; }
.builder-section-service-grid { display: grid; min-width: 0; grid-template-columns: minmax(0,1fr); gap: 10px; padding: 14px; }
.builder-section-assessment { border-color: rgba(109,79,194,.18); background: #fbf9ff; }
.builder-section-files { background: #fafbfd; }
.course-tree-header-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; }
.course-tree-list > li { min-width: 0; }
.course-tree-row {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 4px;
  align-items: center;
}
.course-tree-row > .course-tree-item { flex: 1 1 auto; }
.course-tree-row > form,
.builder-block-actions > form,
.course-row-actions > form { display: contents; }
.course-topic-list,
.preview-nav-section > ol {
  display: grid;
  min-width: 0;
  gap: 4px;
  margin: 5px 0 7px 17px;
  padding: 0 0 0 9px;
  list-style: none;
  border-left: 1px solid rgba(71,88,123,.14);
}
.course-topic-list[hidden] { display: none !important; }
.course-tree-topic { min-height: 37px; padding-block: 5px; }
.course-tree-topic .course-tree-index { width: 23px; height: 23px; border-radius: 7px; }
.section-collapse-toggle,
.builder-drag-handle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #728098;
  cursor: pointer;
}
.section-collapse-toggle:hover,
.builder-drag-handle:hover { border-color: rgba(49,87,213,.16); background: #edf2ff; color: #294bab; }
.section-collapse-toggle svg,
.builder-drag-handle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.section-collapse-toggle svg { transition: transform .16s ease; }
.section-collapse-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.builder-drag-handle { cursor: grab; touch-action: none; }
.builder-drag-handle:active,
.builder-drag-handle[aria-pressed="true"] { cursor: grabbing; }
.section-collapse-toggle:focus-visible,
.builder-drag-handle:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px #3157d5, 0 0 0 3px rgba(49,87,213,.13); }
[data-reorder-item].is-dragging { opacity: .46; }
[data-reorder-list].is-reorder-active { border-color: rgba(49,87,213,.28); }
[data-reorder-list][aria-busy="true"] { cursor: progress; }
.builder-reorder-node { display: grid; min-width: 0; grid-template-columns: 32px minmax(0,1fr); gap: 7px; align-items: start; }
.builder-reorder-card { min-width: 0; }
.builder-reorder-card > .builder-block-card { width: 100%; }
.builder-unit-drag-handle { margin-top: 12px; }
.tree-add-menu { position: relative; width: 32px; height: 32px; }
.tree-add-menu > summary { list-style: none; }
.tree-add-menu > summary::-webkit-details-marker { display: none; }
.tree-add-popover {
  position: fixed;
  z-index: 90;
  display: grid;
  width: 220px;
  gap: 3px;
  margin: 0;
  padding: 7px;
  border: 1px solid rgba(71,88,123,.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(22,32,56,.18);
}
.tree-add-popover-wide { grid-template-columns: repeat(2, minmax(0,1fr)); width: 286px; }
.tree-add-popover button {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #3b4964;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.tree-add-popover button:hover { background: #edf2ff; color: #294bab; }
.tree-add-popover svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tree-add-popover span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-pdf-popover { width: min(330px, calc(100vw - 20px)); }
.course-pdf-popover > button:first-child { border-bottom: 1px solid rgba(71,88,123,.1); border-radius: 8px 8px 3px 3px; color: #294bab; font-weight: 750; }
.course-pdf-popover-item { display: grid; min-width: 0; grid-template-columns: 27px minmax(0,1fr) 32px; gap: 7px; align-items: center; min-height: 38px; padding: 4px 5px; border-radius: 9px; }
.course-pdf-popover-item:hover { background: #f5f7fc; }
.course-pdf-popover-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: #eef2ff; color: #3157d5; }
.course-pdf-popover-icon svg { width: 15px; height: 15px; }
.course-pdf-popover-title { min-width: 0; overflow: hidden; color: #3b4964; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.course-pdf-popover-item .icon-action { display: inline-grid; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; place-items: center; border: 1px solid transparent; }
.course-tree-final-node { display: grid; min-width: 0; grid-template-columns: 32px minmax(0,1fr) 32px; gap: 7px; align-items: center; margin-top: 8px; padding: 8px; border: 1px solid rgba(109,79,194,.18); border-radius: 12px; background: #f8f5ff; color: #4f3e8f; }
.course-tree-final-node strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.course-tree-final-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: #ece5ff; color: #6d4fc2; }
.course-tree-final-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.course-preview-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 16px 42px rgba(29,45,83,.055); }
.preview-nav-section > .module-nav-item { font-weight: 650; }
.preview-nav-topic { min-height: 36px; padding-block: 5px; }
.course-preview-panel .builder-block-list { padding: 16px; }

@media (max-width: 900px) {
  .builder-system-grid { grid-template-columns: minmax(0,1fr); }
  .course-builder-shell { grid-template-columns: minmax(0,1fr); }
  .tree-add-popover,
  .tree-add-popover-wide { position: fixed; right: auto; width: min(286px, calc(100vw - 20px)); margin-left: 0; }
}
@media (max-width: 520px) {
  .builder-system-panel { padding: 10px; border-radius: 14px; }
  .builder-system-group-heading { align-items: stretch; flex-direction: column; }
  .builder-system-group-heading .compact-button { align-self: start; }
  .builder-section-service-grid { grid-template-columns: minmax(0,1fr); padding: 10px; }
  .builder-panel-header { align-items: start; flex-direction: column; padding: 12px; }
  .course-tree-row { gap: 2px; }
  .section-collapse-toggle,
  .builder-drag-handle { width: 30px; height: 30px; flex-basis: 30px; }
  .builder-reorder-node { grid-template-columns: 30px minmax(0,1fr); gap: 5px; }
  .tree-add-menu { width: 30px; height: 30px; }
  .tree-add-popover-wide { grid-template-columns: minmax(0,1fr); }
}

