:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1d2230;
    --muted: #616a7d;
    --border: #d9dde5;
    --accent: #2f5fd0;
    --accent-text: #ffffff;
    --ok: #1f7a4d;
    --ok-bg: #e6f4ec;
    --warn: #8a5a00;
    --warn-bg: #fdf3dc;
    --bad: #b42318;
    --bad-bg: #fde8e6;
    --info-bg: #e8eefc;
    --sidebar-bg: #1b2333;
    --sidebar-text: #d6dbe6;
    --sidebar-active: #2f5fd0;
    --radius: 8px;
    color-scheme: light;
}
/* Dark: follows the system unless the person chose light; or chosen explicitly. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #14171f;
        --surface: #1c202a;
        --text: #e6e9f0;
        --muted: #9aa3b5;
        --border: #313746;
        --accent: #7aa2ff;
        --accent-text: #0d1220;
        --ok: #6fd49f;
        --ok-bg: #173527;
        --warn: #f1c46b;
        --warn-bg: #3a2f14;
        --bad: #ff8a80;
        --bad-bg: #3d1c1a;
        --info-bg: #1d2a4a;
        --sidebar-bg: #11141b;
        --sidebar-text: #c9cfdb;
        --sidebar-active: #253252;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
        --bg: #14171f;
        --surface: #1c202a;
        --text: #e6e9f0;
        --muted: #9aa3b5;
        --border: #313746;
        --accent: #7aa2ff;
        --accent-text: #0d1220;
        --ok: #6fd49f;
        --ok-bg: #173527;
        --warn: #f1c46b;
        --warn-bg: #3a2f14;
        --bad: #ff8a80;
        --bad-bg: #3d1c1a;
        --info-bg: #1d2a4a;
        --sidebar-bg: #11141b;
        --sidebar-text: #c9cfdb;
        --sidebar-active: #253252;
        color-scheme: dark;
}
.area-super { --accent: #8a3fd1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .area-super { --accent: #c49bff; } }
:root[data-theme="dark"] .area-super { --accent: #c49bff; }
/* The platform console: teal, with a deep teal sidebar, so it's never mistaken for a site's Admin. */
.portal-platform, .area-platform { --accent: #0f766e; --accent-text: #ffffff; --sidebar-bg: #0c2b29; --sidebar-text: #d3ebe8; --sidebar-active: #0f766e; --info-bg: #e3f4f1; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .portal-platform, :root:not([data-theme="light"]) .area-platform { --accent: #5eead4; --accent-text: #042f2e; --sidebar-bg: #081615; --sidebar-text: #c8e3df; --sidebar-active: #115e59; --info-bg: #0f2e2b; }
}
:root[data-theme="dark"] .portal-platform, :root[data-theme="dark"] .area-platform { --accent: #5eead4; --accent-text: #042f2e; --sidebar-bg: #081615; --sidebar-text: #c8e3df; --sidebar-active: #115e59; --info-bg: #0f2e2b; }
.portal-platform .brand-mark .brand-icon { width: 1.25rem; height: 1.25rem; }

* { box-sizing: border-box; }
body {
    margin: 0;
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
code { font-size: .9em; }

.topbar {
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    padding: .75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { text-decoration: none; }
.topbar nav a[aria-current="page"] { font-weight: 600; text-decoration: underline; }
.account { display: flex; align-items: center; gap: .75rem; }
.who { color: var(--muted); }

.page { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.hero { padding: 1rem 0 1.5rem; }
.muted { color: var(--muted); }
.links { margin-top: 1rem; }

.stack { display: flex; flex-direction: column; gap: .9rem; }
.row { display: flex; gap: .9rem; flex-wrap: wrap; }
.row > label { flex: 1 1 160px; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
label small { font-weight: 400; color: var(--muted); }
input, select {
    font: inherit;
    padding: .55rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    width: 100%;
}
input:disabled { opacity: .7; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button {
    font: inherit; font-weight: 600;
    display: inline-block;
    padding: .55rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-text);
    cursor: pointer;
    text-decoration: none;
}
button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 400; text-decoration: underline; }
form.inline { display: inline; }
.secondary-action { margin-top: 1rem; }

.flash { padding: .7rem .9rem; border-radius: 6px; margin-bottom: 1rem; background: var(--info-bg); overflow-wrap: anywhere; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }

.heading-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.heading-row h1 { margin: 0; }
.filters { display: flex; gap: .5rem; margin: 1rem 0 .5rem; flex-wrap: wrap; }
.filters input { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

.badge { font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; background: var(--info-bg); }
.badge-active { background: var(--ok-bg); color: var(--ok); }
.badge-invited, .badge-provisioning { background: var(--warn-bg); color: var(--warn); }
.badge-disabled, .badge-suspended { background: var(--bad-bg); color: var(--bad); }
/* Platform console: site and invoice states */
.badge-failed, .badge-overdue { background: var(--bad-bg); color: var(--bad); }
.badge-paid { background: var(--ok-bg); color: var(--ok); }
.badge-due, .badge-part-paid, .badge-awaiting_payment { background: var(--warn-bg); color: var(--warn); }
.badge-cancelled { background: var(--info-bg); color: var(--text); }
.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin: .5rem 0 1.5rem; }
.stat-card { border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; background: var(--surface); }
.stat-card dt { font-size: .85rem; color: var(--muted); }
.stat-card dd { margin: .2rem 0 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-box { border: 2px solid var(--accent, currentColor); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.tile-value { font-size: 1.8rem; font-weight: 700; }
.tile-label { color: var(--muted); }
.tile-note { font-size: .85rem; color: var(--warn); }
.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
pre.detail { white-space: pre-wrap; background: var(--bg); padding: .75rem; border-radius: 6px; }

/* ---------- shared helpers ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.small { font-size: .875rem; }
.req { color: var(--bad); }
.field-label { font-weight: 600; }
.field-error { color: var(--bad); font-weight: 600; font-size: .9rem; }
[aria-invalid="true"] { border-color: var(--bad); outline: 1px solid var(--bad); }
button.small, .button.small { padding: .3rem .65rem; font-size: .875rem; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.link.danger, .link.danger { color: var(--bad); }
button.link.danger { background: none; border: 0; }
.row-tight { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row-tight input[type=text], .row-tight select { width: auto; flex: 1 1 200px; }
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: .5rem 1rem; border-radius: 6px; }
.crumbs { margin: 0 0 .5rem; font-size: .9rem; }
.save-status { font-size: .9rem; color: var(--muted); min-height: 1.2em; }
.save-status[data-kind="ok"] { color: var(--ok); }
.save-status[data-kind="error"] { color: var(--bad); font-weight: 600; }
.badge-draft, .badge-state-never { background: var(--info-bg); }
.badge-archived { background: var(--bad-bg); color: var(--bad); }
.badge-state-changed { background: var(--warn-bg); color: var(--warn); }
.badge-state-published { background: var(--ok-bg); color: var(--ok); }
td.actions { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; white-space: normal; }

/* ---------- course designer ---------- */
body.is-admin .page { max-width: 1400px; }
.course-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.course-head h1 { margin: 0; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin: 1rem 0 1.25rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; text-decoration: none; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; }
.tabs a[aria-current="page"] { background: var(--surface); border-color: var(--border); font-weight: 600; margin-bottom: -1px; }
.inline-create { max-width: 640px; }
.wide-form { max-width: 900px; }
.repeater, .grid { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem 1rem; }
.repeater > legend, .grid > legend { font-weight: 600; padding: 0 .3rem; }
.repeater-item { border: 1px dashed var(--border); border-radius: 6px; padding: .5rem .75rem; margin: 0 0 .75rem; display: flex; flex-direction: column; gap: .5rem; }
.repeater-item > legend { font-size: .85rem; color: var(--muted); }
.repeater-actions { display: flex; gap: 1rem; }
.grid-wrap { overflow-x: auto; }
.grid-table td { padding: .2rem; border: 0; min-width: 9rem; }
.grid-table textarea { width: 100%; font: inherit; font-size: .9rem; padding: .35rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); }
.grid-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.field-check { flex-direction: row; display: flex; align-items: center; gap: .5rem; }
.field-check input { width: auto; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-rich > label { font-weight: 600; }
.rte { background: var(--bg); border-radius: 6px; }
.rte .ql-toolbar.ql-snow, .rte .ql-container.ql-snow { border-color: var(--border); }
.rte .ql-editor { min-height: 8rem; font-size: 1rem; color: var(--text); }
.rte .ql-snow .ql-stroke { stroke: var(--text); }
.rte .ql-snow .ql-fill { fill: var(--text); }
.rte .ql-snow .ql-picker { color: var(--text); }
.rte .ql-snow .ql-picker-options { background: var(--surface); }

/* outline */
.outline, .outline-pages { list-style: none; padding: 0; margin: 0; }
.outline-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin-bottom: 1rem; }
.outline-section-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.outline-section-head h2 { margin: 0; font-size: 1.1rem; flex: 1 1 auto; }
.outline-page { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .45rem .5rem; border-top: 1px solid var(--border); }
.outline-page-title { font-weight: 600; flex: 1 1 14rem; }
.outline-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.drag-handle { cursor: grab; color: var(--muted); user-select: none; }
.is-dragging { opacity: .5; }
.inline-details { position: relative; }
.inline-details > summary { cursor: pointer; color: var(--accent); font-size: .875rem; }
.inline-details[open] > form, .inline-details[open] > p { margin-top: .4rem; }
.danger-zone > summary { color: var(--bad); }
.danger-zone[open] { background: var(--bad-bg); padding: .5rem; border-radius: 6px; }
.add-row { margin-top: .75rem; }

/* page editor */
.page-head { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.page-title-form input { font-size: 1.15rem; font-weight: 600; }
.page-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.editor-layout { display: grid; grid-template-columns: clamp(200px, 16vw, 260px) minmax(0, 1fr) clamp(320px, 26vw, 420px); gap: 1.25rem; align-items: start; }
body.is-admin .page:has(.editor-layout) { max-width: 1720px; }

/* section/page sidebar in the page editor */
.editor-outline { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; font-size: .925rem; }
.editor-outline > details > summary { cursor: pointer; list-style: none; }
.editor-outline > details > summary::-webkit-details-marker { display: none; }
.editor-outline > details > summary h2 { display: inline; font-size: 1rem; margin: 0; }
.editor-outline > details > summary::before { content: "▾ "; color: var(--muted); }
.editor-outline > details:not([open]) > summary::before { content: "▸ "; }
.eo-sections, .eo-pages { list-style: none; margin: 0; padding: 0; }
.eo-sections > li { margin-top: .75rem; }
.eo-section { display: block; font-weight: 700; padding: 0 .3rem .2rem; }
.eo-pages a { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem .4rem; border-radius: 4px; text-decoration: none; color: var(--text); }
.eo-pages a:hover { background: var(--bg); }
.eo-pages a[aria-current="page"] { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.eo-title { overflow: hidden; text-overflow: ellipsis; }
.eo-count { color: var(--muted); font-size: .8rem; flex-shrink: 0; }
.eo-pages a[aria-current="page"] .eo-count { color: inherit; }
.eo-add { margin: .2rem .4rem 0; }
.eo-add > summary { cursor: pointer; color: var(--accent); font-size: .85rem; }
.eo-add form { margin-top: .3rem; }
.eo-manage { margin: 1rem .3rem 0; font-size: .85rem; }
.element-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .75rem; }
.element-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.element-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.element-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem .75rem; border-bottom: 1px solid var(--border); background: var(--bg); border-radius: var(--radius) var(--radius) 0 0; }
.element-type { font-weight: 700; font-size: .9rem; }
.element-summary { flex: 1 1 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.element-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.element-preview { padding: .75rem 1rem; }
.editor-panel { position: sticky; top: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.editor-panel h2 { font-size: 1.15rem; }
.form-foot { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; position: sticky; bottom: -1rem; background: var(--surface); padding: .5rem 0; }
.issues ul, .issues-list ul { padding-left: 1.2rem; }
.issue-error { color: var(--bad); }
.issue-warning { color: var(--warn); }
.undo-bar { display: flex; gap: .75rem; align-items: center; }
.add-element h3 { margin-top: 0; font-size: 1rem; }
.add-element select { width: auto; flex: 1 1 220px; }

/* ---------- learner content (elements) ---------- */
.learner-content { line-height: 1.6; }
.learner-content img { max-width: 100%; height: auto; }
.el-subheading { color: var(--muted); margin-top: -.4rem; }
.el-figure { margin: 1rem 0; }
.el-figure figcaption { color: var(--muted); font-size: .9rem; }
.el-video { margin: 0; } /* a <figure>: drop the browser's 40px side margins */
.el-video video { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: 6px; }
.el-video-title { font-weight: 700; font-size: 1.1rem; margin-bottom: .4rem; }
/* Vimeo: their player in a 16:9 frame */
.el-vimeo-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; }
.el-vimeo-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.el-transcript { margin-top: .5rem; }
.el-bio { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; padding: 1.5rem; margin: 0 0 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.el-bio-photo { flex: none; width: 140px; height: 140px; object-fit: cover; object-position: center 20%; border-radius: 50%; margin: 0; }
.el-bio-text { flex: 1 1 260px; min-width: 0; }
.el-bio-text h3 { margin: 0 0 .5rem; }
.el-bio-text > :last-child, .el-bio-text > div > :last-child { margin-bottom: 0; }
@media (max-width: 560px) { .el-bio { padding: 1.25rem; } .el-bio-photo { width: 112px; height: 112px; } }
.el-bio-role { color: var(--muted); margin: .2rem 0 .6rem; }
/* Website pages (e.g. Our presenters): bigger portraits than in courses. */
.site-page .el-bio-photo { width: 220px; height: 220px; }
@media (max-width: 560px) { .site-page .el-bio-photo { width: 160px; height: 160px; } }
.el-notes textarea { width: 100%; font: inherit; padding: .5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.el-table-wrap { overflow-x: auto; margin: 1rem 0; }
.el-table { border: 1px solid var(--border); }
.el-table caption { text-align: left; font-weight: 700; padding: .4rem 0; }
.el-table th, .el-table td { white-space: normal; vertical-align: top; border: 1px solid var(--border); }
.el-table th { background: var(--bg); color: var(--text); font-size: 1rem; }
.el-placeholder { border: 2px dashed var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.el-placeholder-label { font-weight: 700; margin-top: 0; }
.el-placeholder-note, .el-missing { color: var(--muted); font-style: italic; }

/* ---------- learner course layout (preview now, learner site in milestone 3) ---------- */
.preview-banner { background: var(--warn-bg); color: var(--warn); padding: .5rem 1rem; text-align: center; }
.course-name { color: var(--muted); }
.course-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 2rem; max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
@media (max-width: 800px) { .course-layout { grid-template-columns: 1fr; } }
.course-outline ol { list-style: none; padding-left: 0; }
.course-outline ol ol { padding-left: .75rem; margin: .25rem 0 .75rem; }
.course-outline a { display: block; padding: .2rem .4rem; border-radius: 4px; text-decoration: none; }
.course-outline a[aria-current="page"] { background: var(--accent); color: var(--accent-text); }
.outline-section-title { font-weight: 700; }
.course-page { max-width: 46rem; }
.course-page .el { margin-bottom: 1.25rem; }
.page-section { margin-bottom: .25rem; }
.pager-nav { display: flex; justify-content: space-between; margin-top: 2rem; }

/* ---------- milestone 3: learner site ---------- */
.course-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.course-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.course-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.course-card-body { padding: 1rem; }
.course-card-body h3 { margin: 0 0 .25rem; }
.course-card-text { font-size: .95rem; }
.my-courses { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.my-course h3 { margin-top: 0; }
.progress-row { display: flex; align-items: center; gap: .75rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
progress { width: 12rem; height: .9rem; accent-color: var(--accent); }
.course-detail { max-width: 52rem; }
.course-banner { width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); }
.lead { font-size: 1.2rem; color: var(--muted); }
.key-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding-left: 1.2rem; }
.course-contents li { margin: .2rem 0; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.site-footer { max-width: 1040px; margin: 0 auto; padding: 1rem; border-top: 1px solid var(--border); font-size: .9rem; }
.narrow-wide { max-width: 720px; }
.course-progress { margin-left: auto; }
.course-flash { max-width: 1200px; margin: 1rem auto 0; }
.course-outline .tick { display: inline-block; width: 1.1rem; color: var(--ok); font-weight: 700; }
.course-outline a[aria-current="page"] .tick { color: inherit; }
.el-notes-label { font-weight: 600; display: block; margin: .5rem 0 .25rem; }
.privacy h2 { margin-top: 1.5rem; }

/* ---------- designer: hover borders, right-click menus, clipboard ---------- */
/* With JavaScript, elements have no boxes: an outline appears on hover/focus,
   with a small type label. Without JavaScript the plain button bars remain. */
html.js .element-list { gap: .35rem; }
html.js .element-card { position: relative; border: 0; background: transparent; border-radius: 6px; outline: 2px solid transparent; outline-offset: 2px; cursor: pointer; transition: outline-color .1s; }
html.js .element-card:hover { outline: 2px dashed var(--accent); }
html.js .element-card:focus-visible { outline: 3px solid var(--accent); }
html.js .element-card.is-selected { outline: 2px solid var(--accent); background: var(--surface); }
html.js .element-card .element-preview { padding: .5rem .75rem; }
html.js .element-bar { display: none; position: absolute; top: -.85rem; left: .75rem; z-index: 3; padding: .1rem .55rem; gap: .4rem; border: 0; border-radius: 4px; background: var(--accent); color: var(--accent-text); font-size: .75rem; }
html.js .element-card:hover > .element-bar,
html.js .element-card:focus-visible > .element-bar,
html.js .element-card.is-selected > .element-bar { display: flex; }
html.js .element-bar .element-type { font-size: .75rem; }
html.js .element-bar .element-summary,
html.js .element-bar .drag-handle,
html.js .element-actions { display: none; }
html.js .element-flags { position: absolute; top: .35rem; right: .5rem; z-index: 2; display: flex; gap: .3rem; }
.card-menu-btn { display: none; }
@media (pointer: coarse) {
    /* Touch screens have no right-click: show the label and a menu button. */
    html.js .element-bar { display: flex; }
    html.js .card-menu-btn { display: inline-block; background: none; border: 0; color: inherit; padding: 0 .3rem; font-size: 1rem; line-height: 1; }
}
.ctx-menu { position: fixed; z-index: 1000; min-width: 15rem; padding: .3rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.ctx-menu [role=menuitem] { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 4px; padding: .45rem .8rem; color: var(--text); font: inherit; font-weight: 400; cursor: pointer; }
.ctx-menu [role=menuitem]:hover, .ctx-menu [role=menuitem]:focus { background: var(--accent); color: var(--accent-text); outline: none; }
.ctx-menu [role=menuitem][aria-disabled="true"] { color: var(--muted); cursor: default; }
.ctx-menu [role=menuitem][aria-disabled="true"]:hover, .ctx-menu [role=menuitem][aria-disabled="true"]:focus { background: var(--bg); color: var(--muted); }
.ctx-menu [role=menuitem].danger { color: var(--bad); }
.ctx-menu [role=menuitem].danger:focus, .ctx-menu [role=menuitem].danger:hover { background: var(--bad); color: #fff; }
.ctx-menu [role=separator] { height: 1px; margin: .3rem .2rem; background: var(--border); }
.eo-section[data-menu], .outline-section-head h2[data-menu] { cursor: pointer; border-radius: 4px; user-select: none; }
.eo-section[data-menu]:focus-visible, .outline-section-head h2[data-menu]:focus-visible { outline: 3px solid var(--accent); }
.editor-outline li[data-section-id], .editor-outline li[data-page-id] { cursor: grab; }
.editor-outline li.is-dragging { opacity: .4; }
.editor-outline li.is-drop-target > a { outline: 2px dashed var(--accent); outline-offset: 1px; background: var(--info-bg); }
.clipboard-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: space-between; }
html:not(.js) .js-only { display: none; }

/* ---------- portals: Learn shell ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header-inner { max-width: 1200px; margin: 0 auto; padding: .7rem 1rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.site-header .brand { font-size: 1.15rem; }
.site-nav { display: flex; gap: 1.1rem; flex: 1; flex-wrap: wrap; }
.site-nav a { text-decoration: none; padding: .25rem 0; border-bottom: 3px solid transparent; color: var(--text); }
.site-nav a:hover { border-bottom-color: var(--border); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }
.site-account { display: flex; align-items: center; gap: .75rem; }
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; }
.site-footer-inner { max-width: 1200px; margin: 0 auto; padding: 1rem; display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .9rem; }
.page { max-width: 1200px; }
.theme-choice select { width: auto; padding: .3rem .5rem; font-size: .875rem; }

/* account menu (both shells) */
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .25rem .5rem; border-radius: 999px; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover { background: var(--bg); }
.avatar { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: .9rem; }
.account-menu-panel { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 50; min-width: 14rem; display: flex; flex-direction: column; gap: .15rem; padding: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.account-menu-panel a, .account-menu-panel button.link { display: block; padding: .4rem .6rem; border-radius: 4px; text-decoration: none; color: var(--text); text-align: left; width: 100%; }
.account-menu-panel a:hover, .account-menu-panel button.link:hover { background: var(--bg); }
.account-menu-panel p { margin: .1rem .6rem .4rem; overflow-wrap: anywhere; }

/* ---------- portals: staff shell (Designer, Admin) ---------- */
body.staff { min-height: 100vh; }
.staff-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.staff-sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); padding: 1rem .75rem; display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.staff-brand { display: flex; flex-direction: column; text-decoration: none; color: #fff; padding: .25rem .5rem; }
.staff-brand-site { font-weight: 700; font-size: 1.05rem; }
.staff-brand-portal { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.staff-portals { display: flex; flex-direction: column; gap: .25rem; }
.staff-portal { display: flex; flex-direction: column; padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--sidebar-text); border: 1px solid transparent; }
.staff-portal:hover { background: rgba(255, 255, 255, .06); }
.staff-portal.is-current { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); }
.staff-portal-name { font-weight: 600; color: #fff; }
.staff-portal-desc { font-size: .78rem; opacity: .85; }
.staff-sections-title { margin: 0 .6rem .3rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.staff-sections ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.staff-sections a { display: block; padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--sidebar-text); }
.staff-sections a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.staff-sections a[aria-current="page"] { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.staff-sidebar a:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
.staff-main { display: flex; flex-direction: column; min-width: 0; }
.staff-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem; padding: .55rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.staff-menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); padding: .3rem .6rem; }
.staff-crumbs { flex: 1; min-width: 0; }
.staff-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: .4rem; flex-wrap: wrap; font-size: .9rem; }
.staff-crumbs li + li::before { content: "›"; margin-right: .4rem; color: var(--muted); }
.staff-crumbs li[aria-current] { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.staff-tools { display: flex; align-items: center; gap: .75rem; }
.staff-content { padding: 1.25rem 1.5rem 3rem; width: 100%; max-width: 1720px; }
.staff-content:focus { outline: none; }
@media (max-width: 900px) {
    .staff-shell { grid-template-columns: 1fr; }
    .staff-menu-toggle { display: inline-block; }
    .staff-sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 24px rgba(0, 0, 0, .3); }
    body.staff-nav-open .staff-sidebar { transform: none; }
    .staff-tools .theme-choice { display: none; }
    .staff-content { padding: 1rem; }
}

/* expand / collapse sections */
.sec-toggle { background: none; border: 0; padding: .15rem .3rem; color: inherit; cursor: pointer; border-radius: 4px; line-height: 1; }
.sec-toggle:hover { background: var(--bg); }
.sec-chevron::before { content: "▾"; display: inline-block; transition: transform .15s; }
.sec-toggle[aria-expanded="false"] .sec-chevron::before { transform: rotate(-90deg); }
.eo-section-row { display: flex; align-items: center; gap: .15rem; }
.eo-section-row .eo-section { flex: 1; padding-left: 0; }
.collapse-all { display: flex; gap: 1rem; margin: .5rem .3rem 0; }
li.is-collapsed .eo-section, li.is-collapsed .outline-section-head h2 { opacity: .9; }

/* page layouts: columns (learner pages, preview, designer canvas) */
.cols { display: grid; gap: 1.5rem; align-items: start; }
.cols-two { grid-template-columns: 1fr 1fr; }
.cols-wide-left { grid-template-columns: 2fr 1fr; }
.cols-wide-right { grid-template-columns: 1fr 2fr; }
.cols-three { grid-template-columns: 1fr 1fr 1fr; }
.cols > .col { min-width: 0; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.course-page:has(.cols) { max-width: 64rem; }
.layout-form select { width: auto; flex: 0 1 auto; }
.canvas-cols { display: grid; gap: 1rem; align-items: start; }
.canvas-two { grid-template-columns: 1fr 1fr; }
.canvas-wide-left { grid-template-columns: 2fr 1fr; }
.canvas-wide-right { grid-template-columns: 1fr 2fr; }
.canvas-three { grid-template-columns: 1fr 1fr 1fr; }
.canvas-col { min-width: 0; }
.canvas-cols:not(.canvas-one) .canvas-col { border: 1px dashed var(--border); border-radius: 8px; padding: .5rem .5rem 1rem; }
.canvas-col-label { margin: 0 0 .75rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.canvas-col .element-list { min-height: 4rem; }
@media (max-width: 1100px) { .canvas-cols { grid-template-columns: 1fr; } }
.undo-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.badge-learners { background: var(--info-bg); color: var(--text); }

/* ---------- editor layout (kept late so it wins) ---------- */
/* The element form slides in from the right at every width. */
.editor-layout { grid-template-columns: clamp(200px, 18vw, 270px) minmax(0, 1fr); }
.editor-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(480px, 94vw); max-height: none; border-radius: 0; border-width: 0 0 0 1px;
    transform: translateX(105%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; box-shadow: -8px 0 28px rgba(0, 0, 0, .18); }
.editor-panel.is-open { transform: none; visibility: visible; transition: transform .2s ease; }
.panel-close { display: inline-grid; place-items: center; position: absolute; top: .6rem; right: .7rem; width: 2rem; height: 2rem; border-radius: 50%; text-decoration: none; font-size: 1.4rem; color: var(--text); }
.panel-close:hover { background: var(--bg); }
.editor-panel h2 { padding-right: 2.5rem; }
@media (prefers-reduced-motion: reduce) { .editor-panel { transition: none; } }
@media (max-width: 1100px) {
    .editor-layout { grid-template-columns: 1fr; }
    .editor-outline { position: static; max-height: none; }
}

/* page editor header: title on its own line, tools on one row */
.page-head { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 1.5rem; row-gap: .6rem; }
.page-head > .crumbs, .page-head > .page-title-form { flex-basis: 100%; }
.page-head > .page-nav { margin-left: auto; }
.inline-details > summary, .eo-add > summary { min-height: 24px; display: inline-flex; align-items: center; padding: .1rem 0; }

/* action dropdown (course list) */
.action-menu { position: relative; display: inline-block; }
.action-menu > summary { list-style: none; cursor: pointer; display: inline-flex; gap: .35rem; align-items: center; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-panel { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 30; min-width: 12rem; display: flex; flex-direction: column; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); }
.action-menu-panel a, .action-menu-panel button.link { display: block; width: 100%; text-align: left; padding: .45rem .7rem; border-radius: 4px; text-decoration: none; color: var(--text); font-weight: 400; }
.action-menu-panel a:hover, .action-menu-panel button.link:hover, .action-menu-panel a:focus-visible, .action-menu-panel button.link:focus-visible { background: var(--bg); }
.action-menu-panel button.link.danger { color: var(--bad); }
.action-menu-panel form { margin: 0; }
td.actions { white-space: nowrap; }

/* staff sidebar: icons, and the narrow icon rail (html.sidebar-compact) */
.nav-icon { flex-shrink: 0; }
.staff-portal { flex-direction: row; align-items: flex-start; gap: .6rem; }
.staff-portal .nav-icon { margin-top: .1rem; }
.nav-text { display: flex; flex-direction: column; min-width: 0; }
.staff-sections a { display: flex; align-items: center; gap: .6rem; }
.sidebar-toggle { margin-top: auto; display: flex; align-items: center; gap: .6rem; background: none; border: 1px solid rgba(255, 255, 255, .2); color: var(--sidebar-text); padding: .45rem .6rem; border-radius: 6px; font-weight: 400; }
.sidebar-toggle:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-toggle:focus-visible { outline: 3px solid #fff; }
@media (min-width: 901px) {
    html.sidebar-compact .staff-shell { grid-template-columns: 64px minmax(0, 1fr); }
    html.sidebar-compact .staff-sidebar { padding: 1rem .5rem; align-items: center; }
    html.sidebar-compact .nav-text, html.sidebar-compact .staff-sections-title, html.sidebar-compact .staff-brand-site, html.sidebar-compact .staff-brand-portal { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    html.sidebar-compact .staff-portal, html.sidebar-compact .staff-sections a, html.sidebar-compact .sidebar-toggle { justify-content: center; padding: .55rem; }
    html.sidebar-compact .sidebar-toggle .nav-icon { transform: rotate(180deg); }
    html.sidebar-compact .staff-brand { align-items: center; padding: 0; }
}
@media (max-width: 900px) { .sidebar-toggle { display: none; } }

/* brand mark: the tenant's logo, or a monogram */
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-mark { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; flex-shrink: 0; border-radius: 8px; background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: .95rem; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.staff-brand { flex-direction: row; align-items: center; gap: .65rem; }
.staff-brand-text { display: flex; flex-direction: column; }

/* ---------- media library ---------- */
.media-path ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 .75rem; font-size: .9rem; }
.media-path li + li::before { content: "›"; margin-right: .4rem; color: var(--muted); }
.media-path a.is-drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.media-toolbar { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-bottom: 1rem; }
.media-search input[type=search] { min-width: 14rem; }
.media-drop { border: 2px dashed var(--border); text-align: center; }
.media-drop.is-over { border-color: var(--accent); background: var(--info-bg); }
.media-drop-text { margin: .25rem 0 .5rem; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.media-drop label.button { cursor: pointer; }
.media-drop:focus-within label.button { outline: 3px solid var(--accent); outline-offset: 2px; }
.upload-list { list-style: none; padding: 0; margin: .75rem auto 0; max-width: 32rem; text-align: left; }
.upload-list li { display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .2rem 0; font-size: .9rem; }
.upload-list .upload-done { color: var(--ok); }
.upload-list .upload-error { color: var(--bad); }
.media-bulk { margin: .5rem 0 1rem; }
.media-bulk select { width: auto; }
.media-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .9rem; }
.media-tile { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.media-tile > a, .media-tile > button { display: flex; flex-direction: column; gap: .2rem; padding: .5rem; text-decoration: none; color: var(--text); width: 100%; background: none; border: 0; text-align: left; font-weight: 400; cursor: pointer; }
.media-tile:hover { border-color: var(--accent); }
.media-tile.is-drop-target { outline: 3px dashed var(--accent); }
.media-pick { position: absolute; top: .45rem; left: .45rem; width: 1.2rem; height: 1.2rem; z-index: 2; }
.media-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--bg); border-radius: 4px; overflow: hidden; color: var(--muted); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-kind-icon { font-size: 1.8rem; }
.media-folder > a, .media-folder > button { align-items: center; text-align: center; padding: 1rem .5rem; }
.media-folder-icon { font-size: 2.2rem; }
.media-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-empty { grid-column: 1 / -1; padding: 1rem 0; }
.media-item-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .media-item-layout { grid-template-columns: 1fr; } }
.media-preview img, .media-preview video { max-width: 100%; max-height: 60vh; display: block; margin: 0 auto; border-radius: 6px; }
.media-preview audio { width: 100%; }
.crop-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; margin-bottom: 1rem; user-select: none; }
.crop-stage img { max-width: 100%; max-height: 55vh; display: block; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); outline: 1px solid #000; cursor: move; touch-action: none; }
.crop-box:focus-visible { outline: 3px solid var(--accent); }
.crop-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; background: #fff; border: 2px solid #000; border-radius: 3px; cursor: nwse-resize; }
.crop-numbers .field { flex: 1 1 5rem; }
.media-pick-btn { align-self: flex-start; }
.media-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: .4rem; }
.media-quick [hidden] { display: none; }
.media-quick-thumb { width: 4.5rem; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.media-quick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-dialog-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .75rem 0 .25rem; }
.media-dialog-tools form { flex: 1 1 260px; margin: 0; }
.media-dialog-tools input[type=search] { width: 100%; }
.media-upload-btn { cursor: pointer; }
.media-dialog-tools input[type=file]:focus-visible + .media-upload-btn, .media-dialog-tools:has(input[type=file]:focus-visible) .media-upload-btn { outline: 3px solid var(--accent); outline-offset: 2px; }
.media-upload-status:empty { display: none; }
.media-upload-status[data-kind="error"] { color: var(--bad); }
.media-dialog.is-over { outline: 3px dashed var(--accent); outline-offset: -6px; }
.media-tile.is-current { border: 2px solid var(--accent); }
.media-grid-small .media-title { overflow-wrap: anywhere; }
.media-path [aria-current] { font-weight: 600; }
.media-views { display: flex; gap: .35rem; margin: .5rem 0; }
.media-views [aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.media-dialog { width: min(900px, 94vw); max-height: 86vh; border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; background: var(--surface); color: var(--text); }
.media-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.media-dialog-head { display: flex; justify-content: space-between; align-items: center; }
.media-dialog-head h2 { margin: 0; font-size: 1.15rem; }
.media-dialog-head [data-close] { font-size: 1.6rem; text-decoration: none; }
.media-dialog form { margin: .75rem 0; }
.media-grid-small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 55vh; overflow-y: auto; }
.logo-row { display: flex; gap: 1rem; align-items: flex-start; }
.logo-row .field { flex: 1; }
.brand-mark-large { width: 4rem; height: 4rem; font-size: 1.4rem; }
.crop-stage { overflow: hidden; }
.media-search input[type=search] { width: auto; flex: 1 1 240px; }
.media-search select { width: auto; flex: 0 1 auto; }
.media-pick { width: 1.5rem; height: 1.5rem; }

/* ======================================================================
   Polish layer (kept last so it wins): type, tokens, controls, surfaces.
   ====================================================================== */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url(/assets/fonts/atkinson-hyperlegible-latin-400-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 700; font-display: swap; src: url(/assets/fonts/atkinson-hyperlegible-latin-700-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Atkinson Hyperlegible draws 0 with a slash. Digits come from the device's standard sans serif instead
   (declared last, so these win for 0-9); if none is installed, Atkinson's own digits are used. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; src: local("Helvetica Neue"), local("HelveticaNeue"), local("Arial"), local("ArialMT"), local("Segoe UI"), local("Roboto"); unicode-range: U+0030-0039; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; src: local("Helvetica Neue Bold"), local("HelveticaNeue-Bold"), local("Arial Bold"), local("Arial-BoldMT"), local("Segoe UI Bold"), local("Roboto Bold"); unicode-range: U+0030-0039; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; src: local("Helvetica Neue Italic"), local("HelveticaNeue-Italic"), local("Arial Italic"), local("Arial-ItalicMT"), local("Segoe UI Italic"), local("Roboto Italic"); unicode-range: U+0030-0039; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 700; src: local("Helvetica Neue Bold Italic"), local("HelveticaNeue-BoldItalic"), local("Arial Bold Italic"), local("Arial-BoldItalicMT"), local("Segoe UI Bold Italic"), local("Roboto Bold Italic"); unicode-range: U+0030-0039; }

:root {
    --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bg: #f5f6f8;
    --surface-2: #f9fafb;
    --hover: #eef1f6;
    --border-strong: #c3c9d4;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 12px 32px -6px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .08);
    --ring: 0 0 0 3px rgba(47, 95, 208, .28);
    --bad-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #12151c;
        --surface-2: #181c25;
        --hover: #242a36;
        --border-strong: #454d5f;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 1px 3px rgba(0, 0, 0, .45);
        --shadow-lg: 0 16px 36px -8px rgba(0, 0, 0, .6);
        --ring: 0 0 0 3px rgba(122, 162, 255, .35);
        --bad-text: #2a0b08;
    }
}
:root[data-theme="dark"] {
    --bg: #12151c;
    --surface-2: #181c25;
    --hover: #242a36;
    --border-strong: #454d5f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 36px -8px rgba(0, 0, 0, .6);
    --ring: 0 0 0 3px rgba(122, 162, 255, .35);
    --bad-text: #2a0b08;
}

/* type */
body { font-family: var(--font); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--info-bg); }

/* controls */
input, select, textarea { border-color: var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
:where(input[type=checkbox], input[type=radio]) { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
select { padding-right: 2rem; }
button, .button { border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); line-height: 1.3; transition: background-color .12s, border-color .12s, box-shadow .12s, filter .12s;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
button:hover, .button:hover { filter: brightness(1.07); }
button:active, .button:active { filter: brightness(.96); }
button:focus-visible, .button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.secondary:hover, .button.secondary:hover { filter: none; background: var(--hover); }
button.link { box-shadow: none; display: inline; filter: none; }
button.danger { box-shadow: var(--shadow-sm); color: var(--bad-text); }
button:disabled { opacity: .45; cursor: default; filter: none; }
.btn-icon { flex-shrink: 0; }
.icon-button { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; padding: 0; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text); box-shadow: none; text-decoration: none; }
.icon-button:hover { background: var(--hover); filter: none; }
.icon-button:disabled, .icon-button.is-disabled { opacity: .35; background: transparent; }

/* cards, flashes, badges */
.card { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--border); }
.flash { border-radius: var(--radius-sm); border: 1px solid transparent; border-left-width: 4px; padding: .65rem .9rem; }
.flash-info { border-color: color-mix(in srgb, var(--accent) 30%, transparent); border-left-color: var(--accent); }
.flash-success { border-color: color-mix(in srgb, var(--ok) 30%, transparent); border-left-color: var(--ok); }
.flash-error { border-color: color-mix(in srgb, var(--bad) 30%, transparent); border-left-color: var(--bad); }
.flash-warning { background: var(--warn-bg); color: var(--text); border-color: color-mix(in srgb, var(--warn) 30%, transparent); border-left-color: var(--warn); }
.flash-warning p { margin: 0 0 .6rem; }
/* Terms (agree page, public page, sign-up provider line) */
.terms-provider { margin: .25rem 0 .5rem; }
.terms-agree { max-width: 46rem; margin-inline: auto; }
.terms-agree .terms-text { max-height: 50vh; overflow-y: auto; margin: 1rem 0; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.terms-agree .terms-text:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.terms-signout { margin-top: .75rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; padding: .12rem .55rem; line-height: 1.5; letter-spacing: .01em; white-space: nowrap; }
.badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .75; }
.element-flags .badge::before, .badge-learners::before { display: none; }
.tile { border-radius: var(--radius); box-shadow: var(--shadow); }
.tile-value { font-size: 2rem; letter-spacing: -.02em; }

/* page header used by list pages */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; }
.page-header-sub { margin: .2rem 0 0; color: var(--muted); }
.new-course { display: flex; gap: .5rem; flex: 0 1 30rem; }
.new-course input { flex: 1; min-width: 12rem; }
.new-course button { white-space: nowrap; }

/* segmented filter */
.seg { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: .9rem; background: var(--hover); border-radius: 8px; }
.seg a { padding: .3rem .8rem; border-radius: 6px; font-size: .9rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.seg a:hover { color: var(--text); }
.seg a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* tables */
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow); }
th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding-top: .7rem; padding-bottom: .7rem; }
td { padding-top: .75rem; padding-bottom: .75rem; vertical-align: middle; }
tbody tr { transition: background-color .1s; }
tbody tr:hover { background: var(--surface-2); }
.data-table td.cell-main { white-space: normal; min-width: 16rem; }
.row-title { font-weight: 700; color: var(--text); text-decoration: none; }
.row-title:hover { color: var(--accent); text-decoration: underline; }
.row-sub { display: block; color: var(--muted); font-size: .85rem; }
.cell-who { display: flex; align-items: center; gap: .6rem; }
.who-name { display: block; }
.avatar-small { width: 1.75rem; height: 1.75rem; font-size: .8rem; flex-shrink: 0; background: var(--info-bg); color: var(--accent); }
.empty-row { padding: 2rem; text-align: center; color: var(--muted); white-space: normal; }
td.actions { display: table-cell; text-align: right; width: 1%; }

/* dropdown menus (Actions, account) */
.caret { width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.action-menu[open] > summary { background: var(--hover); }
.action-menu-panel, .account-menu-panel { z-index: 80; min-width: 13.5rem; padding: .35rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); text-align: left; }
.action-menu-panel a, .action-menu-panel button.link, .account-menu-panel a, .account-menu-panel button.link { padding: .5rem .75rem; border-radius: var(--radius-sm); font-size: .95rem; text-decoration: none; }
.action-menu-panel a:hover, .action-menu-panel button.link:hover, .action-menu-panel a:focus-visible, .action-menu-panel button.link:focus-visible,
.account-menu-panel a:hover, .account-menu-panel button.link:hover { background: var(--hover); outline: none; text-decoration: none; }
.action-menu-panel a:focus-visible, .action-menu-panel button.link:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.action-menu-panel hr { border: 0; border-top: 1px solid var(--border); margin: .3rem .2rem; }
.action-menu-panel a.danger { color: var(--bad); }
.action-menu-panel a.danger:hover { background: var(--bad-bg); }

/* staff shell */
.staff-sidebar { gap: 1.5rem; padding: .9rem .75rem 1rem; border-right: 1px solid rgba(255, 255, 255, .06); }
.staff-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.staff-brand { min-width: 0; padding: .2rem .25rem; border-radius: var(--radius-sm); }
/* Long site names wrap (up to two lines) rather than being cut off. */
.staff-brand-text { min-width: 0; }
.staff-brand-site { line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.staff-sidebar .brand-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.sidebar-toggle { margin: 0; flex-shrink: 0; color: var(--sidebar-text); border: 0; }
.sidebar-toggle:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-toggle .when-compact { display: none; }
.staff-portal, .staff-sections a { transition: background-color .12s, color .12s; }
.staff-portal.is-current { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }
.staff-sections a[aria-current="page"] { box-shadow: inset 3px 0 0 #fff; }
.staff-topbar { padding: .5rem 1.5rem; min-height: 3.5rem; box-shadow: var(--shadow-sm); }
.staff-menu-toggle { padding: .35rem; line-height: 0; }
.staff-content { padding: 1.5rem 2rem 3rem; }
@media (min-width: 901px) {
    html.sidebar-compact .staff-sidebar-head { flex-direction: column; gap: .75rem; }
    html.sidebar-compact .sidebar-toggle { padding: 0; }
    html.sidebar-compact .sidebar-toggle .nav-icon { transform: none; }
    html.sidebar-compact .sidebar-toggle .when-full { display: none; }
    html.sidebar-compact .sidebar-toggle .when-compact { display: inline; }
    html.sidebar-compact .staff-sections a[aria-current="page"] { box-shadow: none; }
}
@media (max-width: 900px) { .staff-content { padding: 1rem; } }
.account-menu > summary { border: 1px solid transparent; font-weight: 600; }
.account-menu[open] > summary, .account-menu > summary:hover { background: var(--hover); }

/* course header (designer): back, title, state, tabs in one band */
.course-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap; margin: -.25rem 0 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.course-bar-title { display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 1 1 22rem; flex-wrap: wrap; }
.course-bar h1 { margin: 0; font-size: 1.3rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.back-button { margin-left: -.4rem; color: var(--muted); }
.course-bar .tabs { margin: 0; border: 0; gap: 2px; padding: 3px; background: var(--hover); border-radius: 8px; }
.course-bar .tabs a { border: 0; border-radius: 6px; padding: .35rem .85rem; font-size: .92rem; font-weight: 600; color: var(--muted); }
.course-bar .tabs a:hover { color: var(--text); }
.course-bar .tabs a[aria-current="page"] { margin: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* page editor: one toolbar row, then the canvas */
.editor-toolbar { display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .85rem; padding: .4rem .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.editor-toolbar .page-title-form { display: flex; align-items: center; gap: .4rem; flex: 1 1 18rem; min-width: 0; }
.editor-toolbar .page-title-form input { font-size: 1.1rem; font-weight: 700; border-color: transparent; background: transparent; padding: .35rem .5rem; box-shadow: none; }
.editor-toolbar .page-title-form input:hover { border-color: var(--border); }
.editor-toolbar .page-title-form input:focus { border-color: var(--accent); background: var(--surface); box-shadow: var(--ring); }
.toolbar-group { display: flex; align-items: center; gap: .75rem; padding: 0 .25rem; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.editor-toolbar .layout-form { display: flex; align-items: center; gap: .35rem; }
.editor-toolbar .layout-form select { padding: .3rem 2rem .3rem .5rem; font-size: .9rem; width: auto; }
.toolbar-label { color: var(--muted); flex-direction: row; }
.editor-toolbar .undo-tools { gap: .15rem; }
.editor-toolbar .undo-tools .save-status { min-height: 0; margin-left: .3rem; font-size: .85rem; }
.editor-toolbar .page-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.editor-toolbar .page-nav .button { margin: 0 .25rem; }
.page-title-form button[hidden], .layout-form button[hidden] { display: none; }
.clipboard-bar, .undo-bar { padding: .4rem .75rem; margin-bottom: .75rem; font-size: .92rem; }
.editor-outline { border-radius: var(--radius); box-shadow: var(--shadow-sm); top: 4.25rem; max-height: calc(100vh - 5.25rem); }
.editor-outline > details > summary h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.eo-pages a { border-radius: var(--radius-sm); }
.eo-pages a:hover { background: var(--hover); }
.add-element { box-shadow: none; border-style: dashed; background: var(--surface-2); }
.editor-panel { box-shadow: var(--shadow-lg); }
.empty-page { padding: 2rem 1rem; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius); }
@media (max-width: 1100px) { .toolbar-group { border: 0; padding: 0; } }

/* learn site */
.site-header { box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 30; }
.site-header-inner { min-height: 3.75rem; }
.site-header .brand { font-size: 1.1rem; }
.site-nav a { font-weight: 600; color: var(--muted); }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); }
.hero { padding: 2.5rem 0 2rem; }
.hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); letter-spacing: -.02em; }
.hero p { font-size: 1.1rem; color: var(--muted); }
.course-card { border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.course-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.course-card-body h3 a { color: var(--text); text-decoration: none; }
.course-card-body h3 a:hover { color: var(--accent); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .course-card, .course-card:hover { transition: none; transform: none; } }
progress { border-radius: 999px; }

/* sign-in and other single-card pages */
.card.narrow { margin-top: 2.5rem; padding: 2rem; box-shadow: var(--shadow-lg); }
.card.narrow h1 { font-size: 1.5rem; }
.card.narrow button[type=submit] { width: 100%; padding: .7rem 1rem; }
.links { color: var(--muted); font-size: .95rem; }

/* tabs elsewhere */
.tabs a { font-weight: 600; color: var(--muted); }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); }

/* text element styles (visual only; no labels) */
.tone-accent { --tone: var(--accent); --tone-bg: var(--info-bg); }
.tone-green { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.tone-amber { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.tone-red { --tone: var(--bad); --tone-bg: var(--bad-bg); }
.tone-grey { --tone: var(--muted); --tone-bg: var(--hover); }
.el-text > :first-child { margin-top: 0; }
.el-text > :last-child { margin-bottom: 0; }
.el-text-lead { font-size: 1.22rem; line-height: 1.55; color: var(--text); }
.el-text-shaded { background: var(--tone-bg); padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1rem 0; }
.el-text-bar { border-left: 4px solid var(--tone); padding: .35rem 0 .35rem 1.1rem; margin: 1rem 0; }
.el-text-box { border: 1px solid var(--border-strong); border-top: 4px solid var(--tone); background: var(--surface); padding: 1rem 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); margin: 1rem 0; }
.el-text-quote { margin: 1.25rem 0; padding: .25rem 0 .25rem 2.75rem; position: relative; font-size: 1.15rem; font-style: italic; }
.el-text-quote::before { content: "\201C"; position: absolute; left: 0; top: -.6rem; font-size: 3.5rem; line-height: 1; font-style: normal; color: var(--accent); opacity: .6; }
.el-text-small { font-size: .875rem; color: var(--muted); }
.element-preview > .el-text:first-child, .element-preview > :first-child > .el-text:first-child { margin-top: 0; }
.element-preview > .el-text:last-child { margin-bottom: 0; }

/* ---------- small screens (kept last) ---------- */
.table-wrap { position: relative; } /* keeps hidden labels inside the scroll box */
.row-tight input[type=text], .row-tight select { min-width: 0; }
.staff-sidebar { box-shadow: none; }
body.staff-nav-open .staff-sidebar { box-shadow: 0 0 24px rgba(0, 0, 0, .3); }
@media (max-width: 1100px) {
    .editor-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .staff-topbar { padding: .5rem 1rem; gap: .6rem; }
    .staff-crumbs ol { flex-wrap: nowrap; min-width: 0; }
    .staff-crumbs li { white-space: nowrap; }
    .staff-crumbs li[aria-current] { min-width: 0; max-width: none; }
    .account-menu > summary { padding: .25rem; }
}
@media (max-width: 640px) {
    h1 { font-size: 1.4rem; }
    .staff-crumbs li:first-child:not(:last-child) { display: none; }
    .staff-crumbs li + li::before { display: none; }
    .account-menu > summary > :not(.avatar) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .account-menu > summary { font-size: 0; }
    .account-menu > summary .avatar { font-size: .9rem; }

    /* list page header: create form goes full width */
    .page-header { align-items: stretch; }
    .new-course { flex: 1 1 100%; }
    .new-course input { min-width: 0; }

    /* course list as stacked rows */
    .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .data-table, .data-table tbody { display: block; }
    .data-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
    .data-table tbody tr:last-child { border-bottom: 0; }
    .data-table td { display: block; padding: 0; border: 0; white-space: normal; }
    .data-table td.cell-main { flex: 1 1 calc(100% - 8.5rem); min-width: 0; order: 0; }
    .data-table td.actions { order: 1; width: auto; flex: 0 0 auto; align-self: flex-start; }
    .data-table td.cell-status, .data-table td.cell-site { order: 2; }
    .data-table td.cell-edited { order: 3; flex-basis: 100%; }
    .data-table .row-title { overflow-wrap: anywhere; }
    .data-table .cell-who { font-size: .9rem; }
    .data-table .cell-who .row-sub { display: inline; margin-left: .35rem; }
    .data-table .cell-who .who-name { display: inline; }
    .data-table .empty-row { flex-basis: 100%; }

    /* course header: tabs scroll sideways instead of wrapping */
    .course-bar { margin-top: 0; }
    .course-bar h1 { white-space: normal; font-size: 1.2rem; }
    .course-bar-title { flex-basis: 100%; }
    .course-bar .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
    .course-bar .tabs a { white-space: nowrap; flex-shrink: 0; }

    /* editor toolbar */
    .editor-toolbar { gap: .4rem; }
    .editor-toolbar .page-title-form { flex-basis: 100%; }
    .toolbar-group { border: 0; padding: 0; gap: .4rem; flex: 1 1 auto; }
    .editor-toolbar .layout-form select { max-width: 11rem; }
    .clipboard-bar { font-size: .875rem; }
    .canvas-cols:not(.canvas-one) .canvas-col { padding: .4rem .4rem .75rem; }

    /* forms: inputs take the row, buttons follow */
    .row-tight input[type=text], .row-tight select { flex: 1 1 100%; }
    .logo-row { flex-direction: column; }
    .card { padding: 1rem; }
    .card.narrow { margin-top: 1rem; padding: 1.25rem; box-shadow: var(--shadow); }
    .media-toolbar { gap: .75rem; }

    /* learn site header */
    .site-header-inner { gap: .5rem 1rem; padding: .6rem 1rem; }
    .site-nav { order: 3; flex-basis: 100%; gap: 1rem; overflow-x: auto; }
    .site-nav a { white-space: nowrap; }
    .site-account { margin-left: auto; }
    .hero { padding: 1.25rem 0 1rem; }
    .el-text-quote { padding-left: 2rem; font-size: 1.05rem; }
    .el-text-shaded, .el-text-box { padding: .85rem 1rem; }
}

/* ---------- M5: quizzes, polls, locked pages, groups ---------- */
section.el-quiz, section.el-poll { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.25rem; margin: 1.25rem 0; box-shadow: var(--shadow-sm); }
.el-quiz-title, .el-poll-q { margin: 0 0 .35rem; font-size: 1.2rem; }
.el-quiz-meta { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.el-quiz-question { border: 0; padding: 0; margin: 0 0 1.25rem; }
.el-quiz-question legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.el-quiz-n { color: var(--muted); }
.el-quiz-hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
.el-quiz-answer, .el-poll-option { display: flex; align-items: flex-start; gap: .6rem; padding: .45rem .6rem; border-radius: var(--radius-sm); border: 1px solid transparent; }
.el-quiz-answer:hover, .el-poll-option:hover { background: var(--surface-2); border-color: var(--border); }
.el-quiz-answer input, .el-poll-option input { margin-top: .2rem; width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.el-quiz-answer label, .el-poll-option label { font-weight: 400; display: block; cursor: pointer; }
.el-poll-form fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.el-quiz-result { border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; border-left: 4px solid var(--warn); background: var(--warn-bg); }
.el-quiz-result.is-pass { border-left-color: var(--ok); background: var(--ok-bg); }
.el-quiz-score { margin: 0; }
.el-quiz-review, .el-quiz-key { padding-left: 1.25rem; }
.el-quiz-review > li, .el-quiz-key > li { margin-bottom: 1rem; }
.el-quiz-q { font-weight: 700; margin: 0 0 .35rem; }
.el-quiz-review ul, .el-quiz-key ul { list-style: none; padding-left: 0; margin: 0; }
.el-quiz-review ul li, .el-quiz-key ul li { padding: .2rem .5rem; border-radius: 4px; }
.el-quiz-review li.is-correct, .el-quiz-key li.is-correct { background: var(--ok-bg); }
.el-quiz-review li.is-mine:not(.is-correct) { background: var(--bad-bg); }
.el-quiz-note { color: var(--muted); font-size: .875rem; }
.el-quiz-explain { margin: .4rem 0 0; padding: .5rem .75rem; background: var(--surface-2); border-radius: var(--radius-sm); font-size: .95rem; }
.el-poll-results { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .5rem; }
.el-poll-results li { display: grid; grid-template-columns: minmax(7rem, 14rem) 1fr 6.5rem; gap: .75rem; align-items: center; }
.el-poll-results li.is-mine .el-poll-label { font-weight: 700; }
.el-poll-bar { -webkit-appearance: none; appearance: none; width: 100%; height: .75rem; border: 0; border-radius: 999px; background: var(--hover); overflow: hidden; }
.el-poll-bar::-webkit-progress-bar { background: var(--hover); border-radius: 999px; }
.el-poll-bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.el-poll-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.el-poll-pct { text-align: right; }
.el-poll-pct { font-variant-numeric: tabular-nums; white-space: nowrap; }
.locked-page { text-align: center; padding: 2.5rem 1rem; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.locked-page p { margin: .35rem 0; }
.locked-icon { font-size: 2rem; }
.course-outline a.is-locked { color: var(--muted); }
.visibility-form { min-width: min(28rem, 80vw); margin-top: .4rem; }
.inline-details summary code { font-size: .85em; background: var(--info-bg); padding: .05rem .3rem; border-radius: 4px; }
.new-group { margin-bottom: 1rem; }
.new-group > summary { cursor: pointer; min-height: 24px; }
.new-group[open] > summary { margin-bottom: .75rem; }
.group-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .group-layout { grid-template-columns: 1fr; } }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.cell-wrap { white-space: normal; }
@media (max-width: 640px) { .el-poll-results li { grid-template-columns: 1fr auto; } .el-poll-bar { grid-column: 1 / -1; grid-row: 2; } }
textarea { font: inherit; line-height: 1.5; }
.outline-actions .inline-details[open] { flex-basis: 100%; order: 10; }
.outline-actions { row-gap: .4rem; }

/* ---------- M6: certificates ---------- */
section.el-certificate { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.25rem; margin: 1.25rem 0; box-shadow: var(--shadow-sm); }
.el-cert-title { margin: 0 0 .5rem; font-size: 1.2rem; }
.el-cert-form { margin-top: .5rem; }
.el-cert-form .field-label { flex-basis: 100%; }
.el-cert-locked { color: var(--muted); }
.verify { margin-top: 2rem; }
.verify-result { border-radius: var(--radius-sm); padding: 1rem 1.25rem; border-left: 4px solid var(--muted); background: var(--surface-2); }
.verify-result.is-valid { border-left-color: var(--ok); background: var(--ok-bg); }
.verify-result.is-revoked { border-left-color: var(--bad); background: var(--bad-bg); }
.verify-badge { font-weight: 700; font-size: 1.15rem; margin: 0 0 .5rem; }
.verify-facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.verify-facts dt { color: var(--muted); }
.verify-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 640px) { .verify-facts { grid-template-columns: 1fr; } .verify-facts dd { margin-bottom: .4rem; } }
input, select, textarea { font-weight: 400; }
.editor-toolbar .page-title-form input { font-weight: 700; }

/* ---------- M10: reports ---------- */
.charts { display: block; } /* one column, so chart text isn't scaled down */
.chart-card { margin-bottom: 1.25rem; overflow-x: auto; }
.chart { max-width: 100%; height: auto; display: block; font-family: var(--font); }
.chart-label { fill: var(--text); font-size: 13px; }
.chart-value { fill: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-track { fill: var(--hover); }
.chart-bar { fill: var(--accent); }
.chart-data { margin-top: .5rem; }
.chart-data > summary { cursor: pointer; color: var(--accent); min-height: 24px; }
.small-heading { font-size: 1rem; margin: 1rem 0 .5rem; }
.meter-row { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.meter-row progress { width: 6rem; height: .6rem; accent-color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- M9: emails ---------- */
.email-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .email-layout { grid-template-columns: 1fr; } }
.email-preview { width: 100%; height: 30rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.email-sample { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.25rem; background: var(--surface-2); }
.email-sample-subject { margin: 0 0 .75rem; }
.email-sample-body { overflow-wrap: anywhere; }
.announce-form { max-width: 48rem; margin-bottom: 1.5rem; }

/* ---------- M8: website ---------- */
.site-page { display: flow-root; }
.site-page img:not(.el-banner-img):not(.el-card-img):not(.course-card-img):not(.el-banner-side):not(.el-banner-logo img):not(.el-bio-photo) { max-width: 100%; height: auto; max-height: 30rem; object-fit: cover; display: block; border-radius: var(--radius-sm, 6px); margin: 1rem 0; }
.site-page-title { margin-top: .5rem; }
section.el-banner, div.el-carousel-slide.el-banner { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--info-bg); padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 3.5rem); margin: 0 0 1.5rem; }
section.el-banner.has-image, div.el-carousel-slide.el-banner.has-image { background: #10131a; color: #fff; }
.el-banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.el-banner-body { position: relative; max-width: 44rem; }
.el-banner-heading { font-size: clamp(1.8rem, 4.5vw, 2.8rem); letter-spacing: -.02em; margin: 0 0 .75rem; }
.el-banner-text { font-size: 1.15rem; margin: 0 0 1.25rem; }
.el-banner.has-image .el-banner-heading, .el-banner.has-image .el-banner-text { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.el-banner .button { padding: .7rem 1.25rem; font-size: 1.05rem; }
ul.el-cards { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (min-width: 900px) { ul.el-cards.cols-2 { grid-template-columns: repeat(2, 1fr); } ul.el-cards.cols-3 { grid-template-columns: repeat(3, 1fr); } ul.el-cards.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.el-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; position: relative; }
.el-card:has(a):hover { box-shadow: var(--shadow-lg); }
.el-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.el-card-body { padding: 1rem 1.1rem 1.2rem; }
.el-card-title { margin: 0 0 .4rem; font-size: 1.1rem; }
.el-card-title a { color: var(--text); text-decoration: none; }
.el-card-title a::after { content: ""; position: absolute; inset: 0; }
.el-card-title a:hover { color: var(--accent); text-decoration: underline; }
.el-card:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.el-card-body p { margin: 0; color: var(--muted); }
section.el-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; border-radius: var(--radius); padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem); margin: 1.5rem 0; }
section.el-cta.is-brand { background: var(--accent); color: var(--accent-text); }
.el-cta.is-brand .el-cta-heading { color: var(--accent-text); }
.el-cta.is-brand .button { background: var(--accent-text); color: var(--accent); border-color: var(--accent-text); }
.el-cta.is-brand .button:focus-visible { outline-color: var(--accent-text); }
section.el-cta.is-subtle { background: var(--info-bg); }
.el-cta-heading { margin: 0 0 .25rem; font-size: 1.4rem; }
.el-cta-text p { margin: 0; }
.el-cta .button { padding: .7rem 1.25rem; white-space: nowrap; }
section.el-catalogue { margin: 1.5rem 0; }
.el-catalogue-search { margin-bottom: 1rem; max-width: 30rem; }
section.el-contact { max-width: 40rem; margin: 1.5rem 0; }
.el-contact-form .row > label { flex: 1 1 200px; }
.nav-drop { position: relative; }
.nav-drop > summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--muted); padding: .25rem 0; display: inline-flex; align-items: center; gap: .3rem; border-bottom: 3px solid transparent; }
.nav-drop > summary::-webkit-details-marker { display: none; }
.nav-drop > summary::after { content: ""; width: .4rem; height: .4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.nav-drop[open] > summary, .nav-drop > summary:hover { color: var(--text); }
.nav-drop-panel { position: absolute; top: calc(100% + .35rem); left: -.5rem; z-index: 40; min-width: 12rem; display: flex; flex-direction: column; padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.site-nav .nav-drop-panel a { padding: .45rem .7rem; border-radius: var(--radius-sm); border-bottom: 0; color: var(--text); }
.site-nav .nav-drop-panel a:hover { background: var(--hover); }
.site-header .site-nav .nav-drop-panel a { color: var(--text); }
.site-footer-about { flex: 1 1 18rem; }
.site-footer-about p { margin: 0 0 .4rem; }
.site-footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 0; margin: 0; }
.theme-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .theme-layout { grid-template-columns: 1fr; } }
.swatches { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.swatch-label { font-weight: 700; margin: 0 0 .3rem; }
.swatch-svg { max-width: 100%; height: auto; }
.messages { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.message.is-new { border-left: 4px solid var(--accent); }
.message-head p { margin: 0 0 .2rem; }
.message-body { white-space: normal; overflow-wrap: anywhere; }
.preview-banner a { color: inherit; font-weight: 700; }
.num-input { width: 6rem; flex: 0 0 auto; }

/* ---------- M11: organisations ---------- */
.org-bar { margin-top: 0; }
.org-tools { margin: 0 0 1rem; gap: 1rem; }
.org-member { margin-bottom: 1rem; }
.org-member-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.org-member-head h2 { margin: 0; font-size: 1.1rem; }
.org-items { list-style: none; padding: 0; margin: .75rem 0; display: grid; gap: .4rem; }
.org-item { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; padding: .45rem .75rem; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 4px solid var(--border-strong); }
.org-item-title { flex: 1 1 14rem; font-weight: 600; }
.org-item.state-done { border-left-color: var(--ok); }
.org-item.state-done .org-state { background: var(--ok-bg); color: var(--ok); }
.org-item.state-overdue, .org-item.state-expired { border-left-color: var(--bad); }
.org-item.state-overdue .org-state, .org-item.state-expired .org-state { background: var(--bad-bg); color: var(--bad); }
.org-item.state-expiring { border-left-color: var(--warn); }
.org-item.state-expiring .org-state { background: var(--warn-bg); color: var(--warn); }
.org-item.state-in_progress { border-left-color: var(--accent); }
.org-invite-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.team-input { width: 10rem; }
.plan-form { max-width: 48rem; margin-top: 1.25rem; }
.org-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.consent { border-left: 4px solid var(--accent); background: var(--info-bg); padding: .75rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.consent h2 { font-size: 1rem; margin: 0 0 .35rem; }
.consent p { margin: 0; }
.my-plan { margin-bottom: 1.5rem; }
.org-tools .row-tight select { flex: 0 1 auto; width: auto; }

/* ---------- M12: forms ---------- */
section.el-form { max-width: 44rem; margin: 1.5rem 0; }
.el-form-choices { border: 0; padding: 0; margin: 0; }
.el-form-choices legend { padding: 0; margin-bottom: .35rem; }
.form-response.is-new { border-left: 4px solid var(--accent); }
.form-response .facts dd { overflow-wrap: anywhere; }
.el-form .field-check label { display: inline; font-weight: 400; }

/* CRM (M13) */
.page-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crm-list { list-style: none; margin: 0; padding: 0; }
.crm-list > li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.crm-list > li:last-child { border-bottom: 0; }
.crm-list form.inline { margin-left: .4rem; }
.crm-timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border); }
.crm-timeline > li { position: relative; padding: 0 0 1rem .25rem; }
.crm-timeline > li::before { content: ""; position: absolute; left: -1.4rem; top: .45rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); }
.crm-timeline > li.crm-tl-system::before { background: var(--muted); }
.crm-tl-head, .crm-tl-text { margin: 0; }
.crm-tl-text { white-space: normal; overflow-wrap: anywhere; }
.crm-details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.crm-details dt { color: var(--muted); }
.crm-details dd { margin: 0; overflow-wrap: anywhere; }
.crm-tasks { list-style: none; margin: 0; padding: 0; }
.crm-tasks > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.crm-tasks > li.is-done .crm-task-text { text-decoration: line-through; color: var(--muted); }
.crm-task-text { flex: 1 1 12rem; overflow-wrap: anywhere; }
.row-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row-inline input[type="text"] { width: auto; flex: 1 1 10rem; }
.crm-list-actions { display: flex; gap: 1rem 1.5rem; align-items: baseline; flex-wrap: wrap; margin: .25rem 0 1rem; }
.crm-filters select { max-width: 16rem; }
.filter-date { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.filter-date input { width: auto; }
.card-danger { border-color: var(--bad); }
.card-danger h2 { color: var(--bad); }
.button-link { align-self: center; }
@media (max-width: 600px) { .crm-details { grid-template-columns: 1fr; } .crm-details dd { margin-bottom: .4rem; } .crm-filters select { max-width: none; } }

/* Media (M7) */
.el-video-quality { display: inline-flex; align-items: center; gap: .5rem; margin-top: .5rem; font-size: .9rem; color: var(--muted); }
.el-video-quality select { width: auto; }
.el-audio audio { width: 100%; }
.el-audio-title { font-weight: 700; margin-bottom: .4rem; }
.media-status { padding: .6rem .8rem; border-radius: var(--radius-sm, 6px); background: var(--info-bg); }
.media-status.is-failed { background: var(--bad-bg); color: var(--bad); }
.caption-editor textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; min-height: 16rem; }
.media-files { list-style: none; padding: 0; margin: 0; }
.media-files li { padding: .3rem 0; border-bottom: 1px solid var(--border); }

/* Website page list: Actions menus and their dialogs */
.outline-page .page-address { font-size: .85rem; color: var(--muted); }
.row-dialog { flex-basis: 100%; margin: .5rem 0 .5rem 1.5rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); }
.row-dialog-title { font-size: 1rem; margin: 0 0 .5rem; }
.js [data-row-dialog]:not(dialog [data-row-dialog]) { display: none; }
.row-dialog-modal { width: min(32rem, 92vw); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.row-dialog-modal::backdrop { background: rgba(0, 0, 0, .45); }
.row-dialog-modal .row-dialog { display: block; margin: 0; padding: 0; border: 0; }
.row-dialog-modal .row-dialog-title { font-size: 1.15rem; margin-bottom: .75rem; }
.row-dialog-modal { position: relative; }
.row-dialog-modal [data-dialog-close] { position: absolute; top: 1.3rem; right: 1.25rem; }
.row-dialog-modal .row-dialog-title { padding-right: 4.5rem; }
.action-menu-panel button.link.danger { color: var(--bad); }

/* CRM emails: steps, designer, preview, progress */
.crm-steps ol { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.crm-steps a { display: flex; flex-direction: column; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--surface); text-decoration: none; color: var(--text); height: 100%; }
.crm-steps a:hover { border-color: var(--accent); }
.crm-steps .is-current a { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.crm-step-label { font-weight: 700; }
.crm-step-hint { font-size: .85rem; color: var(--muted); }
@media (max-width: 700px) { .crm-steps ol { grid-template-columns: 1fr; } }
.email-designer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .email-designer { grid-template-columns: 1fr; } }
.email-preview { width: 100%; height: 34rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: #f5f6f8; }
.audience-count { font-size: 1.25rem; margin: 0; }
.send-progress { width: 100%; height: 1rem; }

/* Links inside the rich text editor follow the theme (Quill's default blue is too dark in dark mode). */
.rte .ql-editor a { color: var(--accent); }

.field-end { display: flex; align-items: flex-end; }

.email-from > summary { list-style: none; cursor: pointer; }
.email-from > summary::-webkit-details-marker { display: none; }
.email-from-change { margin-left: .5rem; color: var(--accent); text-decoration: underline; font-size: .9rem; }
.email-from[open] > form { margin-top: .5rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); }

/* The rich text editor sits inside a <label>: keep its text normal weight, with paragraph spacing. */
.rte, .rte .ql-editor { font-weight: 400; }
.rte .ql-editor p { margin: 0 0 .6em; }

/* ===== Learner course pages (header, contents panel, reading column) ===== */
.learner-course { background: var(--bg); }
.lc-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: .75rem 1rem; padding: .55rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 1px 8px rgba(16, 24, 40, .06); }
.lc-menu-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .65rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.lc-menu-btn:hover { background: var(--bg); }
.lc-menu-btn[aria-expanded="true"] { background: var(--info-bg); border-color: var(--accent); }
.lc-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); font-weight: 700; }
.lc-brand .brand-mark { width: 2rem; height: 2rem; font-size: .85rem; }
.lc-course { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; padding-left: 1rem; border-left: 1px solid var(--border); }
.lc-course-title { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-course-title:hover { text-decoration: underline; }
.lc-progress { display: flex; align-items: center; gap: .6rem; }
.lc-progress progress { width: min(18rem, 40vw); height: .45rem; appearance: none; border: 0; border-radius: 999px; background: var(--border); overflow: hidden; }
.lc-progress progress::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
.lc-progress progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.lc-progress progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.lc-progress-text { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.lc-links { display: flex; gap: 1rem; }
.lc-links a { color: var(--muted); font-weight: 600; text-decoration: none; font-size: .95rem; }
.lc-links a:hover { color: var(--text); text-decoration: underline; }

.lc-layout { display: grid; grid-template-columns: 20rem minmax(0, 1fr); align-items: start; }
.lc-outline { position: sticky; top: 3.6rem; max-height: calc(100vh - 3.6rem); overflow-y: auto; padding: 1rem .75rem 2rem; background: var(--surface); border-right: 1px solid var(--border); min-height: calc(100vh - 3.6rem); }
.lc-outline-head { display: flex; align-items: baseline; gap: .5rem; padding: 0 .5rem .75rem; }
.lc-outline-head h2 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.lc-outline-count { margin-left: auto; }
.lc-close { display: none; }
.lc-sections, .lc-pages { list-style: none; margin: 0; padding: 0; }
.lc-section { border-radius: 10px; margin-bottom: .25rem; }
.lc-section > summary { list-style: none; display: flex; align-items: center; gap: .6rem; padding: .6rem .5rem; border-radius: 10px; cursor: pointer; font-weight: 650; }
.lc-section > summary::-webkit-details-marker { display: none; }
.lc-section > summary:hover { background: var(--bg); }
.lc-section[open] > summary { background: var(--bg); }
.lc-sec-status { flex: 0 0 1.6rem; height: 1.6rem; display: inline-grid; place-items: center; border-radius: 50%; background: var(--info-bg); color: var(--accent); font-size: .8rem; font-weight: 700; }
.lc-section.is-complete .lc-sec-status { background: var(--ok-bg); color: var(--ok); }
.lc-section.is-current .lc-sec-status { background: var(--accent); color: var(--accent-text); }
.lc-sec-title { flex: 1; line-height: 1.3; }
.lc-sec-count { font-size: .78rem; font-weight: 600; color: var(--muted); }
.lc-chevron { display: inline-flex; color: var(--muted); transition: transform .15s; }
.lc-section[open] .lc-chevron { transform: rotate(90deg); }
.lc-pages { margin: .15rem 0 .5rem 1.3rem; border-left: 2px solid var(--border); }
.lc-pages a { display: flex; align-items: flex-start; gap: .5rem; padding: .4rem .6rem .4rem .75rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--text); text-decoration: none; font-size: .93rem; line-height: 1.35; border-radius: 0 8px 8px 0; }
.lc-pages a:hover { background: var(--bg); border-left-color: var(--muted); }
.lc-pages a.is-current { background: var(--info-bg); border-left-color: var(--accent); color: var(--accent); font-weight: 650; }
.lc-pages a.is-seen:not(.is-current) .lc-page-title { color: var(--muted); }
.lc-pages a.is-locked { color: var(--muted); }
.lc-page-dot { flex: 0 0 1rem; display: inline-flex; justify-content: center; margin-top: .15rem; color: var(--ok); }
.lc-pages a.is-locked .lc-page-dot { color: var(--muted); }
.lc-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(10, 14, 25, .45); }

.lc-main { max-width: 52rem; width: 100%; margin: 0 auto; padding: 2rem 2rem 4rem; }
.lc-main:focus { outline: none; }
.lc-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: .85rem; }
.lc-crumb-section { padding: .15rem .6rem; border-radius: 999px; background: var(--info-bg); color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.lc-crumb-pos { color: var(--muted); }
.lc-title { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 1.5rem; }
.lc-main .el + .el { margin-top: 1.25rem; }
.lc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.lc-pager-link { display: flex; flex-direction: column; gap: .25rem; padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.lc-pager-link:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.lc-next { text-align: right; align-items: flex-end; grid-column: 2; }
.lc-next.is-finish, .lc-next { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.lc-next .lc-pager-dir { color: inherit; opacity: .9; }
.lc-pager-dir { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lc-pager-title { font-weight: 650; line-height: 1.3; }
.locked-page { text-align: center; padding: 2.5rem 1.5rem; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface); }
.locked-icon { color: var(--muted); margin: 0 0 .5rem; }

/* Wide screens: the contents button hides the sidebar. */
body.lc-outline-hidden .lc-layout { grid-template-columns: minmax(0, 1fr); }
body.lc-outline-hidden .lc-outline { display: none; }

/* Small screens: the contents become a drawer opened from the menu button. */
@media (max-width: 960px) {
    .lc-header { padding: .5rem .75rem; gap: .6rem; }
    .lc-brand-name, .lc-links { display: none; }
    .lc-course { padding-left: .6rem; }
    .lc-menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
    .lc-menu-btn { padding: .45rem; }
    .lc-layout, body.lc-outline-hidden .lc-layout { grid-template-columns: minmax(0, 1fr); }
    html.js .lc-outline, html.js body.lc-outline-hidden .lc-outline { display: block; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(22rem, 88vw); max-height: none; min-height: 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); visibility: hidden; }
    /* Also when the sidebar was hidden on a wide screen (lc-outline-hidden is remembered). */
    html.js .lc-outline.is-open, html.js body.lc-outline-hidden .lc-outline.is-open { transform: none; visibility: visible; }
    html.js .lc-close { display: inline-flex; margin-left: .25rem; padding: .35rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
    html.js .lc-close:hover { background: var(--bg); }
    html:not(.js) .lc-outline { position: static; max-height: none; min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
    body.lc-drawer-open { overflow: hidden; }
    .lc-main { padding: 1.25rem 1rem 3rem; }
    /* Previous and Next stay side by side on phones, as compact buttons. */
    .lc-pager { grid-template-columns: auto auto; justify-content: space-between; gap: .75rem; margin-top: 2rem; padding-top: 1rem; }
    .lc-pager-link { padding: .55rem .85rem; border-radius: 10px; }
    .lc-pager-dir { font-size: .75rem; letter-spacing: .04em; }
    .lc-next { grid-column: 2; }
    .lc-progress progress { width: 100%; }
}
/* Phones: lesson videos run edge to edge (out through the 1rem page padding). */
@media (max-width: 640px) {
    .lc-main .el-video video, .lc-main .el-vimeo-frame { width: calc(100% + 2rem); max-width: none; margin-inline: -1rem; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { html.js .lc-outline, .lc-chevron, .lc-pager-link { transition: none; } }

/* ===== Course landing page ===== */
.cd { max-width: 72rem; margin: 0 auto; }
.cd-eyebrow { margin: 0 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.cd-eyebrow a { color: inherit; text-decoration: none; }
.cd-eyebrow a:hover { text-decoration: underline; }
.cd-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 2.5rem 2.25rem; background: linear-gradient(135deg, var(--info-bg), var(--surface)); border: 1px solid var(--border); }
.cd-hero.has-image { color: #fff; border: 0; background: #1b2333; min-height: 18rem; display: flex; align-items: flex-end; }
.cd-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.cd-hero.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 16, 28, .1), rgba(12, 16, 28, .8)); }
.cd-hero-text { position: relative; z-index: 1; max-width: 46rem; }
.cd-hero.has-image .cd-eyebrow { color: #fff; opacity: .9; }
.cd-hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5rem; }
.cd-tagline { font-size: 1.2rem; margin: 0 0 1rem; opacity: .9; }
.cd-hero:not(.has-image) .cd-tagline { color: var(--muted); }
.cd-facts { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; }
.cd-facts li { padding: .3rem .75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .88rem; font-weight: 600; }
.cd-hero.has-image .cd-facts li { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; backdrop-filter: blur(4px); }
.cd-body { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; margin-top: 2rem; align-items: start; }
.cd-action { position: sticky; top: 5rem; padding: 1.5rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(16, 24, 40, .08); text-align: center; }
.cd-action h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
.cd-action p { margin: .5rem 0; }
.cd-action .cd-cta { width: 100%; justify-content: center; padding: .8rem 1rem; font-size: 1.05rem; }
.cd-buttons { display: flex; flex-direction: column; gap: .5rem; }
.cd-ring { display: block; margin: .5rem auto; }
.cd-ring-track { stroke: var(--border); }
.cd-ring-value { stroke: var(--accent); }
.cd-ring-text { fill: var(--text); font-size: 20px; font-weight: 700; }
.cd-progress-text { color: var(--muted); }
.cd-description { font-size: 1.05rem; }
.cd-contents h2 { margin-top: 2rem; }
.cd-sections { list-style: none; margin: 1rem 0 0; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.cd-sections > li + li { border-top: 1px solid var(--border); }
.cd-sections summary { list-style: none; display: flex; align-items: center; gap: .75rem; padding: .9rem 1.1rem; cursor: pointer; font-weight: 650; }
.cd-sections summary::-webkit-details-marker { display: none; }
.cd-sections summary:hover { background: var(--bg); }
.cd-sec-num { flex: 0 0 1.8rem; height: 1.8rem; display: inline-grid; place-items: center; border-radius: 50%; background: var(--info-bg); color: var(--accent); font-size: .85rem; }
.cd-sec-title { flex: 1; }
.cd-sec-count { color: var(--muted); font-size: .85rem; font-weight: 500; }
.cd-chevron { display: inline-flex; color: var(--muted); transition: transform .15s; }
details[open] > summary .cd-chevron { transform: rotate(90deg); }
.cd-pages { margin: 0; padding: .25rem 1.1rem 1rem 3.7rem; color: var(--muted); }
.cd-pages li { padding: .15rem 0; }
@media (max-width: 900px) { .cd-body { grid-template-columns: 1fr; } .cd-action { position: static; order: -1; } .cd-hero { padding: 1.75rem 1.25rem; } }

/* ===== My learning ===== */
.my-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; padding: 1.75rem 1.75rem; border-radius: 18px; background: linear-gradient(135deg, var(--info-bg), var(--surface)); border: 1px solid var(--border); }
.my-hero h1 { margin: 0 0 .25rem; font-size: clamp(1.7rem, 3vw, 2.3rem); }
.my-hero p { margin: 0; }
.my-empty { text-align: center; padding: 2.5rem 1.5rem; border: 1px dashed var(--border); border-radius: 16px; background: var(--surface); color: var(--muted); }
.my-empty strong { color: var(--text); }
.my-empty p { margin: .4rem 0; }
.my-course { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem; border-radius: 14px; transition: box-shadow .15s, transform .15s; }
.my-course:hover { box-shadow: 0 10px 28px rgba(16, 24, 40, .1); transform: translateY(-2px); }
.my-course h3 a { text-decoration: none; color: var(--text); }
.my-course h3 a:hover { text-decoration: underline; }
.my-course .progress-row progress { flex: 1; height: .5rem; appearance: none; border: 0; border-radius: 999px; background: var(--border); overflow: hidden; }
.my-course .progress-row progress::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
.my-course .progress-row progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.my-course .progress-row progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.my-course .button { align-self: flex-start; margin-top: auto; }

/* Catalogue cards lift a little on hover. */
.course-card:hover { box-shadow: 0 12px 30px rgba(16, 24, 40, .12); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .my-course, .course-card, .cd-chevron { transition: none; } .my-course:hover, .course-card:hover { transform: none; } }

/* ===== Site header: burger menu on small screens ===== */
.site-menu-btn { display: none; margin-left: auto; padding: .45rem; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.site-menu-btn .when-open { display: none; }
.site-menu-btn[aria-expanded="true"] .when-open { display: inline; }
.site-menu-btn[aria-expanded="true"] .when-closed { display: none; }
@media (max-width: 760px) {
    html.js .site-header-inner { flex-wrap: wrap; }
    html.js .site-menu-btn { display: inline-flex; order: 2; }
    html.js .site-account { order: 1; margin-left: auto; }
    html.js .site-header .site-menu-btn { margin-left: .25rem; }
    html.js .site-nav { display: none; order: 3; flex-basis: 100%; flex-direction: column; gap: 0; padding: .5rem 0 .25rem; border-top: 1px solid var(--border); }
    html.js .site-nav.is-open { display: flex; }
    html.js .site-nav > a, html.js .site-nav .nav-drop > summary { padding: .7rem .25rem; border-bottom: 1px solid var(--border); }
    html.js .site-nav a[aria-current="page"] { border-bottom-color: var(--border); box-shadow: inset 3px 0 0 var(--accent); padding-left: .75rem; }
    html.js .site-nav .nav-drop-panel { position: static; box-shadow: none; border: 0; padding: 0 0 .25rem 1rem; }
}

/* My learning cards: the progress line stacks under the bar. */
.my-course .progress-row { flex-direction: column; align-items: stretch; gap: .35rem; }
.my-course .progress-row span { font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) { html.js .site-nav .nav-drop { width: 100%; } html.js .site-nav .nav-drop > summary { display: flex; } }

.pref { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.pref p { margin: .25rem 0 0 1.8rem; }
.signup-marketing { padding: .6rem .8rem; border-radius: 8px; background: var(--info-bg); }

/* Tick-box labels read as one line of text (links inside them stay inline). */
.field-check > label { display: block; }

/* Course card footer: price, location, effort */
.course-card-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.course-card .course-card-img { display: block; margin: 0; border-radius: 0; }
.course-card-action { margin: auto 0 0; padding-top: 1rem; text-align: center; }
.course-card-action .button { display: inline-block; min-width: 80%; padding: .6rem 1.25rem; }
.course-card-foot { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: 0; padding: .7rem 1rem; border-top: 1px solid var(--border); font-size: .875rem; color: var(--muted); }
.course-card-foot > div { display: flex; align-items: center; gap: .35rem; }
.course-card-foot dt { display: flex; color: var(--accent); }
.course-card-foot dd { margin: 0; }

/* Carousel: banner slides that take turns */
.el-carousel { position: relative; margin: 0 0 1.5rem; }
.el-carousel .el-carousel-slide { margin: 0 0 1rem; min-height: clamp(16rem, 34vw, 24rem); display: flex; align-items: center; }
html.js .el-carousel[data-carousel] .el-carousel-slide { margin: 0; }
html.js .el-carousel[data-carousel] .el-carousel-slide:not(.is-current) { display: none; }
html.js .el-carousel[data-carousel] .el-carousel-slide.is-current { animation: el-carousel-in .5s ease; }
@keyframes el-carousel-in { from { opacity: .35; } to { opacity: 1; } }
.el-carousel-controls { position: absolute; right: 1rem; bottom: 1rem; display: flex; align-items: center; gap: .4rem; background: rgba(16, 19, 26, .72); border-radius: 999px; padding: .3rem .45rem; }
.el-carousel-controls[hidden] { display: none; }
.el-carousel-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 50%; border: 0; background: transparent; color: #fff; }
.el-carousel-btn:hover { background: rgba(255, 255, 255, .18); }
.el-carousel-btn:focus-visible, .el-carousel-dot:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.el-carousel-btn .el-carousel-icon-play, .el-carousel.is-paused .el-carousel-icon-pause { display: none; }
.el-carousel.is-paused .el-carousel-icon-play { display: inline-flex; }
.el-carousel-icon-pause { display: inline-flex; }
.el-carousel-dots { display: flex; gap: .15rem; }
.el-carousel-dot { width: 1.5rem; height: 1.5rem; padding: 0; border: 0; background: transparent; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.el-carousel-dot::before { content: ""; width: .65rem; height: .65rem; border-radius: 50%; border: 2px solid #fff; }
.el-carousel-dot[aria-current="true"]::before { background: #fff; }
@media (max-width: 700px) { .el-carousel-controls { position: static; justify-content: center; margin: .5rem auto 0; width: max-content; } }
@media (prefers-reduced-motion: reduce) { html.js .el-carousel[data-carousel] .el-carousel-slide.is-current { animation: none; } }

/* Carousel slides: the picture at full strength; the words sit in a
   semi-transparent box so they stay readable on any picture. */
.el-carousel .el-carousel-slide.has-image .el-banner-img { opacity: 1; }
.el-carousel .el-carousel-slide.has-image .el-banner-body {
    max-width: 26rem; padding: clamp(.85rem, 1.8vw, 1.15rem) clamp(1rem, 2.2vw, 1.4rem);
    background: rgba(10, 14, 26, .68); border-radius: 14px; backdrop-filter: blur(3px);
}
.el-carousel .el-carousel-slide.has-image .el-banner-heading { font-size: clamp(1.15rem, 2.2vw, 1.6rem); margin-bottom: .35rem; }
.el-carousel .el-carousel-slide.has-image .el-banner-text { font-size: clamp(.92rem, 1.3vw, 1.02rem); margin-bottom: .8rem; }
.el-carousel .el-carousel-slide.has-image .el-banner-button { padding: .5rem 1.1rem; font-size: .95rem; }
/* the box sits near the bottom of the picture, clear of the controls */
.el-carousel .el-carousel-slide.has-image { align-items: flex-end; padding: 1rem; }
.el-carousel .el-carousel-slide.has-image .el-banner-body > :last-child { margin-bottom: 0; }
.el-carousel .el-carousel-slide.has-image .el-banner-heading, .el-carousel .el-carousel-slide.has-image .el-banner-text { text-shadow: none; }

/* Banner: logo, picture beside the text, two buttons */
.el-banner-buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.el-banner-logo { display: block; width: 84px; height: 84px; margin: 0 0 1rem; border-radius: 50%; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.el-banner-logo img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #fff; background: #fff; }
.el-banner.has-side-image { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(1.25rem, 4vw, 3rem); align-items: center; }
.el-banner-side { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; }
@media (max-width: 760px) { .el-banner.has-side-image { grid-template-columns: minmax(0, 1fr); } }

/* Course settings: audience with its step number */
/* ---- audiences: each has a colour (stripe, badge, group heading, course hero), chosen in Designer › Audiences ---- */
.aud-everyone  { --aud: var(--lx-hero-bg); --aud-ink: var(--lx-hero-base); --aud-bg: var(--info-bg); --aud-hero: var(--lx-hero-bg); } /* the brand colour */
.aud-c-orange  { --aud: #c2410c; --aud-ink: #9a3412; --aud-bg: #ffedd5; --aud-hero: #9a3412; }
.aud-c-teal    { --aud: #0f766e; --aud-ink: #115e59; --aud-bg: #d5f5ef; --aud-hero: #0f766e; }
.aud-c-blue    { --aud: #1d4ed8; --aud-ink: #1e40af; --aud-bg: #dbeafe; --aud-hero: #1e40af; }
.aud-c-violet  { --aud: #7c3aed; --aud-ink: #6d28d9; --aud-bg: #ede9fe; --aud-hero: #6d28d9; }
.aud-c-wine    { --aud: #be123c; --aud-ink: #9f1239; --aud-bg: #ffe4e6; --aud-hero: #9f1239; }
.aud-c-green   { --aud: #15803d; --aud-ink: #166534; --aud-bg: #dcfce7; --aud-hero: #166534; }
.aud-c-gold    { --aud: #a16207; --aud-ink: #854d0e; --aud-bg: #fef9c3; --aud-hero: #854d0e; }
.aud-c-pink    { --aud: #be185d; --aud-ink: #9d174d; --aud-bg: #fce7f3; --aud-hero: #9d174d; }
.aud-c-cyan    { --aud: #0e7490; --aud-ink: #155e75; --aud-bg: #cffafe; --aud-hero: #155e75; }
.aud-c-slate   { --aud: #475569; --aud-ink: #334155; --aud-bg: #e2e8f0; --aud-hero: #334155; }
.aud-other     { --aud: #6b7280; --aud-ink: #4b5563; --aud-bg: #f1f2f4; --aud-hero: #4b5563; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .aud-everyone  { --aud-ink: var(--accent); --aud-bg: var(--info-bg); }
    :root:not([data-theme="light"]) .aud-c-orange  { --aud-ink: #fdba74; --aud-bg: rgba(194, 65, 12, .22); }
    :root:not([data-theme="light"]) .aud-c-teal    { --aud-ink: #5eead4; --aud-bg: rgba(15, 118, 110, .25); }
    :root:not([data-theme="light"]) .aud-c-blue    { --aud-ink: #93c5fd; --aud-bg: rgba(29, 78, 216, .25); }
    :root:not([data-theme="light"]) .aud-c-violet  { --aud-ink: #c4b5fd; --aud-bg: rgba(124, 58, 237, .25); }
    :root:not([data-theme="light"]) .aud-c-wine    { --aud-ink: #fda4af; --aud-bg: rgba(190, 18, 60, .25); }
    :root:not([data-theme="light"]) .aud-c-green   { --aud-ink: #86efac; --aud-bg: rgba(21, 128, 61, .25); }
    :root:not([data-theme="light"]) .aud-c-gold    { --aud-ink: #fde047; --aud-bg: rgba(161, 98, 7, .25); }
    :root:not([data-theme="light"]) .aud-c-pink    { --aud-ink: #f9a8d4; --aud-bg: rgba(190, 24, 93, .25); }
    :root:not([data-theme="light"]) .aud-c-cyan    { --aud-ink: #67e8f9; --aud-bg: rgba(14, 116, 144, .25); }
    :root:not([data-theme="light"]) .aud-c-slate   { --aud-ink: #cbd5e1; --aud-bg: rgba(71, 85, 105, .25); }
    :root:not([data-theme="light"]) .aud-other     { --aud-ink: #d1d5db; --aud-bg: rgba(107, 114, 128, .25); }
}
:root[data-theme="dark"] .aud-everyone  { --aud-ink: var(--accent); --aud-bg: var(--info-bg); }
:root[data-theme="dark"] .aud-c-orange  { --aud-ink: #fdba74; --aud-bg: rgba(194, 65, 12, .22); }
:root[data-theme="dark"] .aud-c-teal    { --aud-ink: #5eead4; --aud-bg: rgba(15, 118, 110, .25); }
:root[data-theme="dark"] .aud-c-blue    { --aud-ink: #93c5fd; --aud-bg: rgba(29, 78, 216, .25); }
:root[data-theme="dark"] .aud-c-violet  { --aud-ink: #c4b5fd; --aud-bg: rgba(124, 58, 237, .25); }
:root[data-theme="dark"] .aud-c-wine    { --aud-ink: #fda4af; --aud-bg: rgba(190, 18, 60, .25); }
:root[data-theme="dark"] .aud-c-green   { --aud-ink: #86efac; --aud-bg: rgba(21, 128, 61, .25); }
:root[data-theme="dark"] .aud-c-gold    { --aud-ink: #fde047; --aud-bg: rgba(161, 98, 7, .25); }
:root[data-theme="dark"] .aud-c-pink    { --aud-ink: #f9a8d4; --aud-bg: rgba(190, 24, 93, .25); }
:root[data-theme="dark"] .aud-c-cyan    { --aud-ink: #67e8f9; --aud-bg: rgba(14, 116, 144, .25); }
:root[data-theme="dark"] .aud-c-slate   { --aud-ink: #cbd5e1; --aud-bg: rgba(71, 85, 105, .25); }
:root[data-theme="dark"] .aud-other     { --aud-ink: #d1d5db; --aud-bg: rgba(107, 114, 128, .25); }
.aud-setting { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; justify-content: space-between; padding: .3rem 0; border-bottom: 1px solid var(--border); }
.aud-step { display: inline-flex; align-items: center; gap: .4rem; }
.aud-step input { width: 5rem; }

/* Catalogue block: load more as you scroll */
.el-catalogue-more { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: 1.5rem 0 0; min-height: 3rem; }
.el-catalogue-more.is-done { min-height: 0; }
/* The script hides these with the hidden attribute; button styles would otherwise show them. */
.el-catalogue-more [hidden] { display: none !important; }
.el-catalogue-more.is-loading::before { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: el-spin .8s linear infinite; }
@keyframes el-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .el-catalogue-more.is-loading::before { animation: none; } }

/* Colour field: a picker beside the hex box (the picker needs JavaScript) */
.colour-pick { display: flex; gap: .5rem; align-items: center; }
.colour-pick input[type="text"] { width: 8.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.colour-pick input[type="color"] { inline-size: 3rem; block-size: 2.5rem; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--surface); cursor: pointer; }
html:not(.js) .colour-pick input[type="color"] { display: none; }

/* Course list: bulk actions */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 .75rem; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.bulk-bar select { width: auto; }
.bulk-count { margin-right: auto; color: var(--muted); font-size: .95rem; }
.bulk-bar.has-picks { border-color: var(--accent); }
.bulk-bar.has-picks .bulk-count { color: var(--text); font-weight: 700; }
.data-table .cell-pick { width: 2.5rem; text-align: center; }
.data-table .cell-pick input { width: 1.1rem; height: 1.1rem; margin: 0; }

/* Course settings: image field with preview, search as you type and crop */
.image-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem 1.5rem; }
.image-tools { display: grid; grid-template-columns: 160px 1fr; gap: .5rem .75rem; margin-top: .5rem; align-items: start; }
.image-tools-preview { width: 160px; aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--muted, #666); background: var(--surface); }
.image-tools-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-tools-side { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.image-tools-side input[type=search] { width: 100%; }
.image-tools-side [hidden] { display: none !important; }
.image-tools-results { grid-column: 1 / -1; max-height: 320px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.image-tools-results[hidden] { display: none; }
@media (max-width: 520px) { .image-tools { grid-template-columns: 1fr; } .image-tools-preview { width: 100%; } }

/* Learner: quiz state in the contents, and "Still to do" on a locked certificate */
.lc-pages .lc-page-title { flex: 1; }
.lc-quiz { flex: none; align-self: center; font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.lc-quiz.is-todo { color: var(--text); border-color: var(--muted); }
.lc-quiz.is-passed { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.el-cert-todo { margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.el-cert-todo h4 { margin: 0 0 .5rem; font-size: 1.05rem; }
.el-cert-todo-h { margin: .75rem 0 .25rem; font-weight: 700; }
.el-cert-todo-sec { margin: .6rem 0 .15rem; font-size: .9rem; color: var(--muted); font-weight: 650; }
.el-cert-todo-list { margin: 0; padding-left: 1.2rem; }
.el-cert-todo-list li { margin: .2rem 0; }

/* Certificate preview (HTML picture of the PDF, scaled with container units) */
.el-cert-preview { margin: 1rem 0 0; }
.el-cert-preview > summary { cursor: pointer; font-weight: 650; margin-bottom: .6rem; }
.cert-preview { display: grid; gap: .75rem; }
.cert-preview.is-two { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .cert-preview.is-two { grid-template-columns: 1fr; } }
.cert-side { margin: 0; }
.cert-side figcaption { text-align: center; margin-top: .25rem; }
.cert-page { position: relative; container-type: inline-size; overflow: hidden; background: #fff; color: #1d2230; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    font-family: "Atkinson Hyperlegible", system-ui, sans-serif; line-height: 1.25; --cert-serif: "Source Serif 4", Georgia, serif; user-select: none; }
.cert-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.cert-stack { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--mm) * 4); }
.cert-b { margin: 0; font-size: calc(var(--mm) * var(--pt) * 0.3528); }
.cert-text { white-space: nowrap; }
.cert-list-h { margin: 0 0 calc(var(--mm) * 1); font-weight: 700; }
.cert-list ul { margin: 0; padding-left: calc(var(--mm) * 4); }
.cert-list li { font-size: calc(var(--mm) * (var(--pt) - 1) * 0.3528); margin: 0 0 calc(var(--mm) * .6); }
.cert-qr { aspect-ratio: 1; background: repeating-conic-gradient(#1d2230 0 25%, #fff 0 50%) 0 0 / 25% 25%; opacity: .75; }
/* "PREVIEW" corner to corner: atan(210/297) = 35.26deg; portrait atan(297/210) = 54.74deg */
.cert-watermark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-35.26deg); font-family: "Atkinson Hyperlegible", system-ui, sans-serif; font-weight: 700; font-size: 17cqw; letter-spacing: .08em; line-height: 1; white-space: nowrap; color: rgba(180, 35, 24, .16); -webkit-text-stroke: .25cqw rgba(180, 35, 24, .35); pointer-events: none; }
.cert-page.is-portrait .cert-watermark { transform: translate(-50%, -50%) rotate(-54.74deg); font-size: 20cqw; }
.el-cert-test { padding: .5rem .75rem; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: .9rem; }
.cert-qr-img { display: block; aspect-ratio: 1; background: #fff; image-rendering: pixelated; }

/* ---- Display and reading settings (DisplayPrefs: data-* on <html>) ---- */
/* Text size: rem units follow the root size, and the body follows the root. */
html[data-text-size="125"] { font-size: 125%; }
html[data-text-size="150"] { font-size: 150%; }
html[data-text-size="175"] { font-size: 175%; }
html[data-text-size="200"] { font-size: 200%; }
html[data-text-size] body { font-size: 1rem; }
html[data-text-size] img, html[data-text-size] video, html[data-text-size] iframe { max-width: 100%; height: auto; }
html[data-text-size] .page, html[data-text-size] .lc-main { overflow-wrap: anywhere; }

/* High contrast: black on white, strong outlines, underlined links, no faint text. */
html[data-contrast="high"] {
    --bg: #ffffff !important; --surface: #ffffff !important; --text: #000000 !important; --muted: #000000 !important;
    --border: #000000 !important; --accent: #0033cc !important; --accent-text: #ffffff !important;
    --info-bg: #ffffff !important; --ok: #005a2b !important; --ok-bg: #ffffff !important; --warn: #000000 !important; --warn-bg: #ffffff !important;
    --bad: #a00000 !important; --bad-bg: #ffffff !important;
    --hero: #000000 !important; --hero-base: #000000 !important; --lx-hero-bg: #000000 !important;
    color-scheme: light;
}
html[data-contrast="high"] body { background: #fff; color: #000; }
html[data-contrast="high"] a:not(.button) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
html[data-contrast="high"] .muted:not(.button):not(button), html[data-contrast="high"] small, html[data-contrast="high"] .small:not(.button):not(button) { color: #000 !important; opacity: 1 !important; }
/* The learner site's own light/dark colours, forced to black on white. */
html[data-contrast="high"] { --lx-ink: #000000 !important; --lx-bg: #ffffff !important; --lx-muted: #000000 !important; --lx-line: #000000 !important; --lx-card-shadow: none !important; --lx-card-shadow-hover: none !important; }
html[data-contrast="high"] main h1, html[data-contrast="high"] main h2, html[data-contrast="high"] main h3, html[data-contrast="high"] main h4 { color: #000 !important; }
html[data-contrast="high"] .lx-hero, html[data-contrast="high"] .lx-hero h1, html[data-contrast="high"] .lx-hero h2, html[data-contrast="high"] .lx-hero p,
html[data-contrast="high"] .lx-hero a:not(.button), html[data-contrast="high"] .site-footer, html[data-contrast="high"] .site-footer a, html[data-contrast="high"] .site-footer h2 { color: #fff !important; }
/* Buttons: white on dark blue, or dark blue outlined. */
html[data-contrast="high"] button:not(.link), html[data-contrast="high"] .button { background: #0033cc !important; color: #fff !important; border: 2px solid #0033cc !important; }
html[data-contrast="high"] button.secondary, html[data-contrast="high"] .button.secondary { background: #fff !important; color: #0033cc !important; border: 2px solid #0033cc !important; }
html[data-contrast="high"] button.link { color: #0033cc !important; background: transparent !important; text-decoration: underline; }
html[data-contrast="high"] .card, html[data-contrast="high"] input, html[data-contrast="high"] select, html[data-contrast="high"] textarea,
html[data-contrast="high"] button, html[data-contrast="high"] .button, html[data-contrast="high"] details { border-color: #000 !important; }
html[data-contrast="high"] input, html[data-contrast="high"] select, html[data-contrast="high"] textarea { border-width: 2px !important; background: #fff !important; color: #000 !important; }
html[data-contrast="high"] :focus-visible { outline: 4px solid #000 !important; outline-offset: 2px !important; box-shadow: 0 0 0 7px #ffdd00 !important; }
html[data-contrast="high"] .el-cert-preview, html[data-contrast="high"] .cert-watermark { filter: none; }

/* Wider spacing (WCAG 1.4.12 text spacing). */
html[data-spacing="wide"] body { line-height: 1.9; letter-spacing: .08em; word-spacing: .16em; }
html[data-spacing="wide"] p, html[data-spacing="wide"] li { margin-bottom: 1.4em; }
html[data-spacing="wide"] h1, html[data-spacing="wide"] h2, html[data-spacing="wide"] h3 { line-height: 1.4; }

/* Reduce movement. */
html[data-reduce-motion] *, html[data-reduce-motion] *::before, html[data-reduce-motion] *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important;
}

/* Text only: media are drawn as text by the server; hide anything decorative left over. */
html[data-text-only] .el-banner-side img, html[data-text-only] .lx-mycard img, html[data-text-only] .course-card img, html[data-text-only] .el-cert-preview { display: none !important; }

/* The settings link in the header, and the settings page. */
.lx-display-link { display: inline-flex; align-items: center; gap: .3rem; color: inherit; text-decoration: none; font-weight: 600; padding: .3rem .4rem; border-radius: 6px; }
.lx-display-link:hover { text-decoration: underline; }
@media (max-width: 640px) { .lx-display-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.display-settings .dp-group { border: 1px solid var(--border); border-radius: 10px; padding: .75rem 1rem 1rem; margin: 0; }
.display-settings .dp-group legend h2 { margin: 0; font-size: 1.15rem; }
.dp-option { display: flex; gap: .65rem; align-items: flex-start; padding: .45rem 0; }
.dp-option input { width: 1.35rem; height: 1.35rem; margin-top: .15rem; flex: none; }
.dp-option label { display: flex; flex-direction: column; cursor: pointer; }
.dp-option-label { font-weight: 650; }
.dp-option-hint { color: var(--muted); font-size: .92em; }

/* Transcripts and text versions */
.el-transcript summary, .el-image-text summary { cursor: pointer; font-weight: 650; padding: .35rem 0; }
.el-transcript-links { margin: .25rem 0 .75rem; }
.el-image-text { margin-top: .5rem; border-left: 3px solid var(--border); padding-left: .85rem; }
.el-video-text, .el-figure-text { border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1.1rem; margin: 1rem 0; background: var(--surface); }
.el-video-kind { font-weight: 700; }
.el-transcript-text p, .el-image-long p { max-width: 70ch; }
.transcript-page .transcript-body p { max-width: 70ch; }

/* Large text: the course contents become the slide-out drawer at any width (as on phones). */
html[data-text-size="150"] .lc-layout, html[data-text-size="175"] .lc-layout, html[data-text-size="200"] .lc-layout, html[data-text-size="150"] body.lc-outline-hidden .lc-layout, html[data-text-size="175"] body.lc-outline-hidden .lc-layout, html[data-text-size="200"] body.lc-outline-hidden .lc-layout { grid-template-columns: minmax(0, 1fr); }
html[data-text-size="150"].js .lc-outline, html[data-text-size="175"].js .lc-outline, html[data-text-size="200"].js .lc-outline, html[data-text-size="150"].js body.lc-outline-hidden .lc-outline, html[data-text-size="175"].js body.lc-outline-hidden .lc-outline, html[data-text-size="200"].js body.lc-outline-hidden .lc-outline { display: block; position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(26rem, 92vw); max-height: none; min-height: 0; transform: translateX(-105%); box-shadow: 0 0 40px rgba(0, 0, 0, .25); visibility: hidden; }
html[data-text-size="150"].js .lc-outline.is-open, html[data-text-size="175"].js .lc-outline.is-open, html[data-text-size="200"].js .lc-outline.is-open { transform: none; visibility: visible; }
html[data-text-size="150"].js .lc-close, html[data-text-size="175"].js .lc-close, html[data-text-size="200"].js .lc-close { display: inline-flex; margin-left: .25rem; padding: .35rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
html[data-text-size="150"] .lc-brand-name, html[data-text-size="175"] .lc-brand-name, html[data-text-size="200"] .lc-brand-name, html[data-text-size="150"] .lc-progress-text, html[data-text-size="175"] .lc-progress-text, html[data-text-size="200"] .lc-progress-text { display: none; }
html[data-text-size="150"] .lc-main, html[data-text-size="175"] .lc-main, html[data-text-size="200"] .lc-main { padding: 1.25rem 1rem 3rem; }

/* Designer › Audiences */
.aud-edit-legend { padding: 0 .3rem; }
.aud-preview { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .8rem; border-radius: 999px; background: var(--aud-bg); color: var(--aud-ink); font-weight: 700; font-size: 1.05rem; }
.aud-order { max-width: 7rem; }
.aud-pick { border: 0; padding: 0; margin: 0; }
.aud-pick-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.aud-pick-item { position: relative; }
.aud-pick-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aud-pick-item label { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.aud-pick-item input:checked + label { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.aud-pick-item input:focus-visible + label { outline: 3px solid var(--focus, var(--accent)); outline-offset: 2px; }
.aud-swatch { display: block; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--aud); }
@media (forced-colors: active) { .aud-pick-item input:checked + label { border-width: 4px; } }
.mt { margin-top: 2rem; }
.card h2.h3 { font-size: 1.1rem; margin: 0; }
/* A checkbox or radio with its words beside it (platform console). */
label.check { flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 400; }
label.check > input { flex: none; width: 1.1rem; height: 1.1rem; margin-top: .2rem; padding: 0; }
/* The how-to guide (/help, /designer/help, /admin/help, /crm/help, platform /help). */
.help-guide { max-width: 52rem; }
.help-guide h2[id] { scroll-margin-top: 1rem; margin-top: 1.75rem; }
.help-guide .help-contents { padding: .9rem 1.1rem; }
.help-guide .help-contents h2 { margin: 0 0 .4rem; font-size: 1rem; }
.help-guide .help-contents ul { columns: 2 14rem; margin: 0; padding-left: 1.1rem; }
.help-guide li + li { margin-top: .3rem; }
.email-edit-grid { display: grid; gap: 1rem; } @media (min-width: 1100px) { .email-edit-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
/* A count on a sidebar item (platform console: new site requests). */
.staff-sections a { position: relative; }
.nav-count { margin-left: auto; min-width: 1.5rem; padding: 0 .45rem; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: .8rem; font-weight: 700; line-height: 1.5rem; text-align: center; }
.portal-platform .nav-count { background: #5eead4; color: #042f2e; }
html.sidebar-compact .nav-count { position: absolute; top: .1rem; right: .1rem; min-width: 1.1rem; line-height: 1.1rem; padding: 0 .25rem; font-size: .7rem; }

/* Charts (platform console Stats). Series colours: validated categorical slots 1-3, light and dark. */
.portal-platform { --chart-1: #257de0; --chart-2: #f47230; --chart-3: #00b894; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .portal-platform { --chart-1: #338ced; --chart-2: #e76624; --chart-3: #00a888; } }
:root[data-theme="dark"] .portal-platform { --chart-1: #338ced; --chart-2: #e76624; --chart-3: #00a888; }
.chart-section { margin: 1.5rem 0 2rem; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.chart-head h2 { margin: 0; }
.chart-grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); }
.chart-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem .6rem; }
.chart-card figcaption { font-weight: 700; margin-bottom: .3rem; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { stroke: var(--muted); stroke-width: 1; }
.chart-tick { fill: var(--muted); font-size: 12px; }
.chart-row { fill: var(--text); font-size: 13px; }
.chart-label, .chart-value { fill: var(--text); font-size: 12.5px; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.s1, .chart-dot.s1, .chart-bar.s1 { stroke: var(--chart-1); }
.chart-line.s2, .chart-dot.s2, .chart-bar.s2 { stroke: var(--chart-2); }
.chart-line.s3, .chart-dot.s3, .chart-bar.s3 { stroke: var(--chart-3); }
.chart-dot { stroke-width: 2; }
.chart-dot.s1, .chart-bar.s1, .chart-key.s1 { fill: var(--chart-1); }
.chart-dot.s2, .chart-bar.s2, .chart-key.s2 { fill: var(--chart-2); }
.chart-dot.s3, .chart-bar.s3, .chart-key.s3 { fill: var(--chart-3); }
.chart-dot { paint-order: stroke; stroke: var(--surface) !important; stroke-width: 2; }
.chart-bar { stroke: none !important; }
.chart-hit { fill: transparent; }
.chart-hit:hover { fill: var(--border); fill-opacity: .35; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0 0 .4rem; padding: 0; font-size: .85rem; color: var(--muted); }
.chart-swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.chart-swatch.s1 { background: var(--chart-1); } .chart-swatch.s2 { background: var(--chart-2); } .chart-swatch.s3 { background: var(--chart-3); }
@media (forced-colors: active) { .chart-line { stroke: CanvasText !important; } .chart-bar, .chart-dot { fill: CanvasText !important; } }
.chart-stack { display: grid; gap: 1rem; }
.chart-stack .chart-card { max-width: 72rem; }
.chart-tick { font-size: 13px; }
.chart-row { font-size: 14px; }
.chart-label, .chart-value { font-size: 13.5px; }
/* Admin dashboard: the plan and its use (docs/quotas.md). */
.usage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.usage-list li { display: grid; grid-template-columns: minmax(10rem, 1fr) auto; gap: .2rem 1rem; align-items: baseline; }
.usage-list meter { grid-column: 1 / -1; width: 100%; height: .6rem; }
.usage-figure { font-variant-numeric: tabular-nums; color: var(--muted); }
/* Admin › Plan (docs/quotas.md) */
.plan-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.plan-option ul { margin: 0; padding-left: 1.1rem; }
.plan-price { font-size: 1.25rem; font-weight: 700; margin: 0; }
.plan-banner a { font-weight: 700; }
/* Platform › site: media and limits */
.limit-choice { border: 0; padding: 0; margin: 0; flex-wrap: wrap; align-items: center; }
.input-short { width: 7rem; }
/* Platform › Messages › a message */
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
dl.details dt { font-weight: 700; }
dl.details dd { margin: 0; }
.message-text { white-space: normal; line-height: 1.6; border-top: 1px solid var(--border); padding-top: 1rem; overflow-wrap: anywhere; }

/* Admin › Discussions */
.dz-quote { margin: 0; padding: .6rem 1rem; border-left: 3px solid var(--border); background: var(--hover); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.dz-quote p { margin: 0 0 .5rem; }
.dz-quote p:last-child { margin: 0; }
.dz-admin-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.dz-admin-actions form { margin: 0; }
.dz-reports { margin: 0; padding-left: 1.2rem; }
.dz-reports li + li { margin-top: .5rem; }
.dz-excerpt { overflow-wrap: anywhere; }
.inline-form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.dz-check { margin-top: 1.5rem; }
.flash-warning a { color: inherit; text-decoration: underline; }

/* Discussion element (course pages) */
section.el-discussion { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.25rem; margin: 1.25rem 0; box-shadow: var(--shadow-sm); }
section.el-discussion > h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.el-discussion .card { box-shadow: none; margin: .8rem 0; }
.el-discussion .dz-thread { padding: .9rem 1rem; }
.el-discussion-done { color: var(--ok); font-weight: 600; }
.el-discussion-todo { font-weight: 600; }
.el-discussion-more { margin: .8rem 0 0; }

/* Survey element (course pages) and its results */
section.el-survey { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.25rem; margin: 1.25rem 0; box-shadow: var(--shadow-sm); }
section.el-survey > h3 { margin: 0 0 .5rem; font-size: 1.25rem; }
.el-survey-form { gap: 1.4rem; }
.el-survey-q { border: 0; padding: 0; margin: 0; min-width: 0; }
.el-survey-q > legend, .el-survey-q > .field-label { font-weight: 700; font-size: 1.02rem; margin-bottom: .45rem; padding: 0; }
.el-survey-req { color: var(--bad); }
.el-survey-section { margin: .6rem 0 0; padding-top: .8rem; border-top: 1px solid var(--border); font-size: 1.1rem; }
.el-survey-options { display: grid; gap: .25rem; }
.el-survey-option { display: flex; align-items: flex-start; gap: .55rem; padding: .3rem .4rem; border-radius: var(--radius-sm); }
.el-survey-option:hover { background: var(--hover); }
.el-survey-option input, .el-survey-point input { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .2rem; }
.el-survey-specify, .el-survey-follow { margin: .6rem 0 0 1.9rem; max-width: 40rem; }
.el-survey-specify input, .el-survey-follow textarea, .el-survey-q textarea, .el-survey-q input[type=text], .el-survey-q select { width: 100%; }
.el-survey-grid { display: grid; gap: .9rem; }
.el-survey-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .8rem .7rem; margin: 0; min-width: 0; }
.el-survey-row > legend { font-weight: 600; padding: 0 .3rem; max-width: 100%; }
.el-survey-scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .3rem; }
.el-survey-point { display: flex; align-items: flex-start; gap: .45rem; padding: .3rem .35rem; border-radius: var(--radius-sm); }
.el-survey-point:hover { background: var(--hover); }
.el-survey-point label { font-size: .92rem; line-height: 1.3; }
.el-survey-num { display: inline-block; min-width: 1.1rem; font-weight: 700; }
.el-survey-done { color: var(--ok); font-weight: 600; }
.el-survey-todo { font-weight: 600; }
.el-survey-answers dt { font-weight: 600; margin-top: .6rem; }
.el-survey-answers dd { margin: .15rem 0 0; }
.el-survey [hidden] { display: none !important; }
.survey-texts { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; }
.survey-grid th[scope=col] { vertical-align: bottom; }

/* Shared course pages (Learn\SharedPages) */
.share-banner { background: var(--accent-soft, color-mix(in srgb, var(--accent) 10%, var(--surface))); border-bottom: 1px solid var(--border); padding: .6rem 1rem; text-align: center; }
.share-banner p { margin: 0; }
.share-banner a { font-weight: 700; }
.lc-share-auth { display: flex; gap: .75rem; align-items: center; margin-left: auto; white-space: nowrap; }
.lc-share-auth a:not(.button) { font-weight: 600; }
.share-needs-account { border: 1px dashed var(--border); border-radius: 10px; padding: 1rem 1.25rem; background: var(--surface); }
.share-needs-account p { margin: 0 0 .35rem; }
.share-needs-account p:last-child { margin: 0; }
.lc-share { margin: 2rem 0 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.lc-share > summary { cursor: pointer; padding: .7rem 1rem; display: flex; gap: .5rem; align-items: center; font-weight: 600; }
.lc-share-body { padding: 0 1rem 1rem; }
.lc-share-row { display: flex; gap: .5rem; align-items: center; }
.lc-share-row input { flex: 1; min-width: 0; }
.lc-share-targets { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.lc-share-targets [hidden] { display: none; }
@media (max-width: 640px) { .lc-share-auth { display: none; } }
.lc-share [data-copy-status]:empty { display: none; }
