/* Learn v2 "Fluent" — the Learn layer on top of the CostusWorx Fluent kit.
   Load order: styles.css (legacy) → fluent-kit/fluent-core.css (tokens + v6- shell)
   → this file. It aliases Learn's legacy variables to kit tokens and maps Learn's legacy
   classes onto the Dynamics 365 look (DealerPulse metrics). Tokens only outside TOKENS:
   php ../costusworx-fluent-kit/tools/check_layer.php assets/css/fluent.css */

/* ===== TOKENS ===== */
:root {
  /* legacy remap: Learn's v1 names are aliases of kit tokens, so old markup follows the kit */
  --bg: var(--v6-canvas); --surface: var(--v6-surface); --card: var(--v6-surface); --cardAlt: var(--v6-surface-alt);
  --border: var(--v6-row); --borderG: var(--v6-divider);
  --gold: var(--v6-action); --goldL: var(--v6-action-h); --goldBg: var(--v6-sel);
  --navy: var(--v6-t1); --navyL: var(--v6-t2); --ltblue: var(--v6-sel); --ltblueBg: var(--v6-sel);
  --text: var(--v6-t1); --textM: var(--v6-t3); --textD: var(--v6-t4);
  --green: var(--v6-ok); --greenL: var(--v6-ok-h); --greenBg: var(--v6-ok-bg);
  --amber: var(--v6-warn); --amberBg: var(--v6-warn-bg); --red: var(--v6-bad); --redBg: var(--v6-bad-bg);
  --radius: var(--v6-r-md); --shadow: var(--v6-sh2); --shadowM: var(--v6-sh4);
  /* Learn-only tokens */
  --learn-chart-1: #0F6CBD; --learn-chart-2: #2886DE; --learn-chart-3: #62ABF5;
  --learn-chart-4: #96C6FA; --learn-chart-5: #C7DFF7; --learn-chart-6: #0F548C;
  --chart-1: var(--learn-chart-1); --chart-2: var(--learn-chart-2); --chart-3: var(--learn-chart-3);
  --chart-4: var(--learn-chart-4); --chart-5: var(--learn-chart-5); --chart-6: var(--learn-chart-6);
  --learn-demo-edge: #F5A524;        /* demo-mode toast edge (matches the demo CTA bar) */
  --learn-fs-score: 40px;            /* quiz result score: the one hero numeral in Learn */
  --learn-thumb: 56px;               /* course thumbnail */
}

/* ===== BASE ===== */
/* One typeface everywhere, as in D365. Legacy rules set Bebas Neue / DM Sans / JetBrains Mono. */
body, body *:not(svg):not(path):not(.v6-mono) { font-family: var(--v6-font) !important; }
.mono { font-family: var(--v6-font-mono); font-size: var(--v6-fs-cap); font-variant-numeric: tabular-nums; }
td, .stat-val, .kpi-val { font-variant-numeric: tabular-nums; }

/* ── Legacy shell → kit shell (index.php header/nav keep .hdr/.nav/.nav-tab for JS) ── */
#screen-app.active { height: 100vh; min-height: 0; }
.hdr.v6-hdr { justify-content: flex-start; position: relative; box-shadow: none; padding: 0 8px 0 0; }
.hdr-brand.v6-hdr-brand { font-size: var(--v6-fs-sub2); letter-spacing: 0; }
.hdr-brand.v6-hdr-brand span { color: var(--v6-surface); }
.hdr-logo.v6-hdr-logo { margin: 0; }
.nav.v6-sitemap { padding: 0; border-bottom: 0; box-shadow: none; overflow: hidden; }
.nav-tab.v6-nav-item { padding: 0 8px 0 10px; border-bottom: 0; font-size: var(--v6-fs-body); letter-spacing: 0; text-transform: none; transition: none; }
.nav-tab.v6-nav-item.active { border-bottom: 0; }
.main.v6-main { max-width: none; margin: 0; padding: 0 24px 24px; overflow-y: auto; }
.footer { display: none; }

/* ── Page head → command bar + title (each tab pane already has .pg-head/.pg-actions) ── */
.pg-head { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; margin: 0 -24px 16px; }
.pg-head > div:not(.pg-actions), .pg-head > .pg-title { padding: 16px 24px 0; }
.pg-head .pg-actions { order: -1; min-height: 44px; padding: 6px 16px; gap: 2px; background: var(--v6-surface); border-bottom: var(--v6-card-w) solid var(--v6-edge-strong); position: sticky; top: 0; z-index: 20; }
.pg-head .pg-actions .btn { background: transparent; border: 0; color: var(--v6-t1); font-weight: 400; height: var(--v6-ctl-h); min-height: var(--v6-ctl-h); padding: 0 8px; margin: 0; font-size: var(--v6-fs-body); }
.pg-head .pg-actions .btn:hover { background: var(--v6-surface-2); }
.pg-head .pg-actions .btn .v6-ic { color: var(--v6-action); }
.pg-title { font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); font-weight: 600; letter-spacing: 0; color: var(--v6-t1); }
.pg-sub { margin-top: 2px; }
.learn-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 12px; }
.learner-header { background: transparent; border: 0; border-radius: 0; padding: 16px 0 4px; margin-bottom: 16px; }
.learner-header .welcome { font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); font-weight: 600; letter-spacing: 0; color: var(--v6-t1); }
.learner-header .meta { font-size: var(--v6-fs-cap); letter-spacing: 0; color: var(--v6-t3); margin-top: 2px; }
.section-head h2 { font-size: var(--v6-fs-sub2); line-height: var(--v6-lh-sub2); font-weight: 600; letter-spacing: 0; color: var(--v6-t1); }

/* ── Buttons ── */
.btn { font-size: var(--v6-fs-body); font-weight: 600; text-transform: none; letter-spacing: 0; border-radius: var(--v6-r-sm); min-height: var(--v6-ctl-h); height: var(--v6-ctl-h); line-height: 1; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .1s; }
.btn-primary, .btn-gold, .btn-navy { background: var(--v6-action); color: var(--v6-surface); border: 0; }
.btn-primary:hover:not(:disabled), .btn-gold:hover:not(:disabled), .btn-navy:hover:not(:disabled) { background: var(--v6-action-h); }
.btn-secondary, .btn-outline { background: var(--v6-surface); border: var(--v6-line) solid var(--v6-stroke2); color: var(--v6-t1); }
.btn-secondary:hover:not(:disabled), .btn-outline:hover:not(:disabled) { background: var(--v6-surface-2); }
.btn-ghost { background: transparent; border: 0; color: var(--v6-t1); font-weight: 400; }
.btn-ghost:hover:not(:disabled) { background: var(--v6-surface-2); color: var(--v6-t1); border-color: transparent; }
.btn-danger { background: var(--v6-surface); border: var(--v6-line) solid var(--v6-bad-line); color: var(--v6-bad); }
.btn-danger:hover:not(:disabled) { background: var(--v6-bad-bg); }
.btn-sm { height: 24px; min-height: 24px; padding: 0 8px; font-size: var(--v6-fs-cap); }
.btn-full { width: 100%; height: 40px; }
.btn:disabled { background: var(--v6-disabled-bg); color: var(--v6-disabled-fg); border-color: transparent; opacity: 1; cursor: default; }

/* ── Forms (32px controls, 8px side padding, bottom-stroke focus) ── */
.field label, .fg label { font-size: var(--v6-fs-body); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--v6-t2); }
.field input, .field select, .field textarea, .fg input, .fg select, .fg textarea, .input-sm,
.main input[type=text], .main input[type=number], .main input[type=date], .main input[type=email], .main input[type=url], .main input[type=search], .main input[type=password], .main select, .main textarea {
  font-size: var(--v6-fs-body); color: var(--v6-t1); background-color: var(--v6-surface);
  border: var(--v6-line) solid var(--v6-stroke2); border-bottom-color: var(--v6-t3); border-radius: var(--v6-r-sm); box-shadow: none; box-sizing: border-box; }
.field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .field select, .fg input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .fg select, .input-sm,
.main input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=range]), .main select {
  height: var(--v6-ctl-h); min-height: var(--v6-ctl-h); padding: 0 8px; line-height: 30px; }
.field select, .fg select, .main select { padding-right: 28px; }
.field textarea, .fg textarea, .main textarea { padding: 6px 8px; }
.field input:focus, .field select:focus, .field textarea:focus, .fg input:focus, .fg select:focus, .fg textarea:focus, .input-sm:focus,
.main input:focus, .main select:focus, .main textarea:focus { outline: none; border-color: var(--v6-stroke2); border-bottom: 2px solid var(--v6-action); box-shadow: none; }
.field input:read-only, .fg input:read-only { background: var(--v6-surface-2); color: var(--v6-t2); border-color: transparent; }
.main input[type=color] { padding: 2px; width: 64px; height: var(--v6-ctl-h); }
.field input[type=checkbox], .fg input[type=checkbox], .field input[type=radio], .fg input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; flex-shrink: 0; }
.form-sec { font-size: var(--v6-fs-sub2); line-height: var(--v6-lh-body); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--v6-t1); }
.fg-hint, .field-hint { font-size: var(--v6-fs-cap); color: var(--v6-t3); }
input[type=checkbox], input[type=radio] { accent-color: var(--v6-action); }
.alert { border-radius: var(--v6-r-sm); font-size: var(--v6-fs-body); border: 0; }
.alert-error { background: var(--v6-bad-bg); color: var(--v6-bad-h); }
.alert-success { background: var(--v6-ok-bg); color: var(--v6-ok-h); }

/* ── Grids / tables (44px rows) ── */
.tab-pane .table-wrap:not(.card .table-wrap):not(.dash-tile .table-wrap), .report-pane .table-wrap:not(.card .table-wrap):not(.dash-tile .table-wrap) {
  background: var(--v6-surface); border: var(--v6-card-w) solid var(--v6-card-line); border-radius: var(--v6-r-md); box-shadow: var(--v6-raise); padding: 0 8px 4px; margin: 0 4px 16px 0; }
thead tr { background: var(--v6-surface); }
th { font-size: var(--v6-fs-body); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--v6-t2); background: var(--v6-surface); border-bottom: var(--v6-line) solid var(--v6-stroke); height: var(--v6-row-h); padding: 0 8px; }
td { font-size: var(--v6-fs-body); line-height: var(--v6-lh-body); border-bottom: var(--v6-line) solid var(--v6-row); height: var(--v6-row-h); padding: 4px 8px; box-sizing: border-box; }
tbody tr:hover { background: transparent; }
tbody tr:hover td { background: var(--v6-surface-2); }
tfoot tr { background: var(--v6-surface-alt); }
tfoot td { color: var(--v6-t1); border-top: var(--v6-line) solid var(--v6-stroke); }
td .btn { font-size: var(--v6-fs-cap); }
.learn-code { font-size: var(--v6-fs-cap); background: var(--v6-surface-2); padding: 2px 6px; border-radius: var(--v6-r-sm); }

/* ── Status pills ── */
.badge { font-size: var(--v6-fs-cap); font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: var(--v6-r-pill); padding: 2px 8px; border: 0 !important; }
.badge-gold, .badge-navy { background: var(--v6-sel); color: var(--v6-action-ink); }
.badge-green, .badge-complete { background: var(--v6-ok-bg); color: var(--v6-ok-h); }
.badge-red, .badge-overdue { background: var(--v6-bad-bg); color: var(--v6-bad-h); }
.badge-amber, .badge-mandatory { background: var(--v6-warn-bg); color: var(--v6-warn); }
.badge-mandatory, .badge-overdue, .badge-complete { font-size: var(--v6-fs-cap); font-weight: 600; border-radius: var(--v6-r-pill); padding: 2px 8px; }
.unit-type-badge { font-size: var(--v6-fs-cap); letter-spacing: 0; text-transform: none; border-radius: var(--v6-r-pill); padding: 1px 8px; background: var(--v6-sel); color: var(--v6-action-ink); }

/* ── Sub-tabs → pivots ── */
.tab-bar { border-bottom: var(--v6-line) solid var(--v6-stroke) !important; gap: 4px; }
.tab-btn { font-size: var(--v6-fs-body); letter-spacing: 0; text-transform: none; color: var(--v6-t1); padding: 8px 12px; border-bottom: 3px solid transparent; }
.tab-btn:hover { color: var(--v6-t1); background: var(--v6-surface-2); }
.tab-btn.active { color: var(--v6-t1); border-bottom-color: var(--v6-action); font-weight: 600; }
#tab-invite, #tab-invite:hover, #tab-invite.active { color: var(--v6-t1); }
.report-pane { padding-top: 4px; }

/* ── Assign panel: light flyout ── */
.assign-panel { background: var(--v6-surface); color: var(--v6-t1); border-radius: var(--v6-r-md); }
.assign-panel.open { border: var(--v6-card-w) solid var(--v6-card-line); box-shadow: var(--v6-raise); }
.assign-panel-title { font-size: var(--v6-fs-sub2); font-weight: 600; letter-spacing: 0; }
.assign-panel-course, .assign-panel-lookup small { color: var(--v6-t3); }
.assign-panel-sep { background: var(--v6-row); }
.assign-panel select, .assign-panel input[type="text"], .assign-panel input[type="email"], .assign-panel input[type="date"] {
  background: var(--v6-surface); color: var(--v6-t1); border: var(--v6-line) solid var(--v6-stroke2); border-bottom-color: var(--v6-t3); border-radius: var(--v6-r-sm); height: var(--v6-ctl-h); }
.assign-panel select:focus, .assign-panel input:focus { background: var(--v6-surface); border-color: var(--v6-stroke2); border-bottom: 2px solid var(--v6-action); }
.assign-panel select option { background: var(--v6-surface); color: var(--v6-t1); }
.assign-panel input::placeholder { color: var(--v6-t4); }
.assign-panel-label { color: var(--v6-t1); }
.assign-panel-alert { color: var(--v6-bad); }
.assign-panel .btn-close-panel { background: transparent; color: var(--v6-t2); border: 0; }
.assign-panel .btn-close-panel:hover { background: var(--v6-surface-2); }

/* ── Dialogs → right-side panels ── */
.modal-backdrop, .modal-overlay { background: var(--v6-scrim); }
.modal { border-radius: var(--v6-r-md); box-shadow: var(--v6-sh16); }
.modal-head { padding: 20px 24px 12px; border-bottom: 0; }
.modal-head h2 { font-size: var(--v6-fs-sub1); font-weight: 600; letter-spacing: 0; color: var(--v6-t1); }
.modal-body { padding: 8px 24px 24px; }
/* Add/Edit user overlay (open/close JS untouched; matched by id, never by style text) */
#user-form-pane { justify-content: flex-end !important; align-items: stretch !important; padding: 0 !important; background: var(--v6-scrim) !important; overflow: hidden !important; }
#user-form-pane > .card { margin: 0 !important; max-width: min(640px, 100vw) !important; width: 100%; height: 100vh; border: 0 !important; border-radius: 0 !important; box-shadow: var(--v6-sh16) !important; background: var(--v6-surface) !important; overflow-y: auto; padding: 0; }
#user-form-pane .card-header { padding: 16px 20px; border-bottom: var(--v6-line) solid var(--v6-stroke); position: sticky; top: 0; background: var(--v6-surface); z-index: 1; }
#user-form-pane .card-title { margin: 0; font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); }

/* ── Toasts ── */
.toast { font-size: var(--v6-fs-body); letter-spacing: 0; text-transform: none; border-radius: var(--v6-r-sm); box-shadow: var(--v6-sh16); }
.toast.inf, .toast-info, .toast.info { background: var(--v6-t1); }
.toast.demo { background: var(--v6-t1); border-left-color: var(--learn-demo-edge); }

/* ── Learner course cards, progress, units, quiz, certificates ── */
.course-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.course-list > .course-card { padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.course-card-header { display: flex; gap: 14px; align-items: flex-start; }
.course-thumb { width: var(--learn-thumb); height: var(--learn-thumb); border-radius: var(--v6-r-md); background: var(--v6-chrome); color: var(--v6-surface); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-info { min-width: 0; flex: 1; }
.course-title, .course-card-title { font-size: var(--v6-fs-sub2); font-weight: 600; line-height: var(--v6-lh-sub2); letter-spacing: 0; color: var(--v6-t1); }
.course-meta, .course-card-meta { font-size: var(--v6-fs-cap); color: var(--v6-t3); margin-top: 2px; }
.course-card-thumb { background: var(--v6-chrome); }
.course-card-footer { background: var(--v6-surface-alt); border-top: var(--v6-line) solid var(--v6-row); }
.progress-bar { height: 4px; background: var(--v6-hover); border-radius: 2px; }
.progress-bar-fill { background: var(--v6-action); border-radius: 2px; }
.unit-item { border-bottom: var(--v6-line) solid var(--v6-row); }
.unit-item:hover { background: var(--v6-surface-2); }
.unit-item.active { background: var(--v6-sel); border-left: 3px solid var(--v6-action); }
.quiz-question { color: var(--v6-t1); }
.quiz-answer-btn { border: var(--v6-line) solid var(--v6-stroke2); border-radius: var(--v6-r-sm); }
.quiz-answer-btn:hover, .quiz-answer-btn.selected { border-color: var(--v6-action); background: var(--v6-sel); }
.quiz-result-score { font-weight: 600; font-size: var(--learn-fs-score); }
.cert-number, .pager, .spinner { letter-spacing: 0; text-transform: none; font-size: var(--v6-fs-body); }
.spinner::before { border-color: var(--v6-hover); border-top-color: var(--v6-action); }
.empty, .empty-state { color: var(--v6-t3); }
.empty-ico, .empty-state .icon { opacity: 1; color: var(--v6-t4); }
.empty-ico .v6-ic { width: 32px; height: 32px; stroke-width: 1.4; }

/* ── Dashboard text (KPI numerals capped at Subtitle 1, like D365) ── */
.card-title { margin-bottom: 12px; display: block; }
.card-title::after { display: none; }
.stats-strip, .admin-stats { gap: 16px; margin-bottom: 16px; }
.stat, .stat-card { overflow: visible; }
.stat::before, .stat-card::before { top: auto; bottom: 0; height: 3px; border-radius: 0 0 var(--v6-r-md) var(--v6-r-md); }
.stat:hover, .stat-card:hover { transform: none; }
.dash-tile-title { font-size: var(--v6-fs-body); line-height: var(--v6-lh-body); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--v6-t1); margin-bottom: 12px; }
.dash-tile-title .v6-ic { color: var(--v6-warn); }
.kpi .kpi-delta { font-size: var(--v6-fs-cap); }
.kpi::before { top: auto; bottom: 0; border-radius: 0 0 var(--v6-r-md) var(--v6-r-md); }
.gauge-val, .donut-total { font-weight: 600; fill: var(--v6-t1); }
.gauge-sub, .donut-sub { letter-spacing: 0; text-transform: none; font-size: var(--v6-fs-cap2); fill: var(--v6-t3); }
.chart-legend .lg .v, .hbar .hb-val { color: var(--v6-t1); }
.hbar .hb-track { display: block; background: var(--v6-disabled-bg); }
.hbar .hb-fill { display: block; }
#branding-form { padding: 16px; }

/* ── Sign-in (DealerPulse pattern: navy gradient, rounded 3D card) ── */
#screen-login.active { background: linear-gradient(160deg, var(--v6-brand-deep), var(--v6-brand) 60%, var(--v6-brand-line)); }
.login-card { border-radius: var(--v6-r-lg); border: 2px solid var(--v6-brand-ink); background: var(--v6-block-bg); box-shadow: var(--v6-raise-login); color: var(--v6-brand); }
.login-card::before { height: 4px; background: linear-gradient(90deg, var(--v6-chrome), var(--v6-chrome-accent), var(--v6-chrome)); border-radius: var(--v6-r-lg) var(--v6-r-lg) 0 0; }
.login-card label, .login-card .field label { color: var(--v6-brand); font-weight: 600; }
.login-card input:not([type=checkbox]) { color: var(--v6-brand); border: var(--v6-line) solid var(--v6-brand-soft); border-bottom-color: var(--v6-brand); border-radius: 6px; height: var(--v6-ctl-h); padding: 0 8px; }
.login-card input::placeholder { color: var(--v6-brand-muted); }
.login-card .btn-gold, .login-card .btn-primary { background: var(--v6-brand); color: var(--v6-surface); }
.login-card .btn-gold:hover, .login-card .btn-primary:hover { background: var(--v6-brand-deep); }
.login-brand-title { font-size: var(--v6-fs-title3); line-height: var(--v6-lh-title3); font-weight: 600; letter-spacing: 0; color: var(--v6-brand); }
.login-brand-title span { color: var(--v6-brand); font-weight: 400; margin-left: 4px; }
.login-brand-sub { font-size: var(--v6-fs-cap); letter-spacing: 0; text-transform: none; color: var(--v6-t3); }
.login-version-tag { font-size: var(--v6-fs-cap); background: var(--v6-surface); border-color: var(--v6-row); }
.login-version-tag .vtag-label { color: var(--v6-brand); font-weight: 600; }

/* D365's smallest everyday text is Caption 1 (12px); floor the legacy 9-11px labels. */
.stat-lbl, .kpi .kpi-lbl, .course-card-meta, .hdr-user em, .login-version-tag, .text-sm { font-size: var(--v6-fs-cap); letter-spacing: 0; text-transform: none; }

@media (max-width: 768px) {
  .main.v6-main { padding: 0 12px 24px; }
  .pg-head { margin: 0 -12px 12px; }
  .pg-head > div:not(.pg-actions), .pg-head > .pg-title { padding: 12px 12px 0; }
  .course-list { grid-template-columns: 1fr; }
}
@media print {
  #screen-app.active { height: auto; }
  .pg-actions { display: none !important; }
}

/* ===== COMPONENTS ===== */
/* Learn's legacy selectors joining the kit families (same tokens as fluent-core.css). */
/* Large block */
.card, .dash-tile, .course-card, .cert-card, .text-unit, #branding-form {
  border: var(--v6-card-w) solid var(--v6-card-line); border-radius: var(--v6-r-md); box-shadow: var(--v6-raise); background: var(--v6-block-bg); }
.card { padding: 16px; margin: 0 4px 16px 0; }
.course-card:hover { transform: none; box-shadow: var(--v6-raise); }
/* Small tile */
.stat, .stat-card, .dash-tile.kpi {
  border: var(--v6-card-w) solid var(--v6-card-line); border-radius: var(--v6-r-md); box-shadow: var(--v6-raise-sm); background: var(--v6-block-bg); }
.stat, .stat-card { padding: 10px 14px 12px; margin-right: 4px; }
.stat:hover, .stat-card:hover, .dash-tile.kpi:hover { box-shadow: var(--v6-raise); }
/* KPI text */
.stat-lbl, .kpi .kpi-lbl { font-size: var(--v6-fs-cap); line-height: var(--v6-lh-cap); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--v6-t3); margin: 4px 0 0; }
.stat-val, .kpi .kpi-val { font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); font-weight: 600; color: var(--v6-t1); }
/* Section title */
.card-title, .assign-panel-title { font-size: var(--v6-fs-sub2); line-height: var(--v6-lh-sub2); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--v6-t1); }
/* Muted text */
.pg-sub, .fg-hint, .field-hint { font-size: var(--v6-fs-cap); color: var(--v6-t3); }

/* ===== COURSE VIEWER ===== */
/* course.php: chrome bar on top, unit rail, reading canvas */
.course-layout { grid-template-rows: var(--v6-hdr-h) 1fr; height: 100vh; min-height: 0; }
.course-topbar { grid-column: 1 / -1; grid-row: 1; height: var(--v6-hdr-h); padding: 0 12px 0 8px; background: var(--v6-chrome); border-bottom: 3px solid var(--v6-chrome-accent); color: var(--v6-surface); gap: 8px; }
.mobile-menu-btn { display: none; }
.course-topbar .back-btn, .mobile-menu-btn { width: 40px; height: 40px; border-radius: var(--v6-r-sm); color: var(--v6-surface); font-size: var(--v6-fs-sub2); align-items: center; justify-content: center; }
.course-topbar .back-btn { display: flex; }
.course-topbar .back-btn:hover, .mobile-menu-btn:hover { background: var(--v6-on-chrome-hover); }
.mobile-menu-btn .v6-ic { width: 18px; height: 18px; }
.course-topbar-title { font-size: var(--v6-fs-body); font-weight: 600; color: var(--v6-surface); }
.course-sidebar { grid-row: 2; background: var(--v6-rail); border-right: var(--v6-card-w) solid var(--v6-edge-strong); max-height: none; position: static; }
.sidebar-header { background: transparent; color: var(--v6-t1); border-bottom: var(--v6-line) solid var(--v6-row); }
.sidebar-header h2 { font-size: var(--v6-fs-body); font-weight: 600; }
.sidebar-progress-bar { background: var(--v6-hover); height: 4px; }
.sidebar-progress-fill { background: var(--v6-action); }
.sidebar-pct { color: var(--v6-t3); font-size: var(--v6-fs-cap); opacity: 1; }
.course-sidebar .unit-list { padding: 4px 0; }
.course-sidebar .unit-item { margin: 0 4px; border-radius: var(--v6-r-sm); border-left: 0; border-bottom: 0; position: relative; height: auto; min-height: var(--v6-nav-item-h); padding: 10px 12px; }
.course-sidebar .unit-item:hover { background: var(--v6-hover); }
.course-sidebar .unit-item.active { background: var(--v6-sel-strong); color: var(--v6-action-ink); font-weight: 600; }
.course-sidebar .unit-item.active::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 2px; background: var(--v6-action); }
.course-sidebar .unit-item.done { opacity: 1; color: var(--v6-t3); }
.unit-icon { color: var(--v6-t2); display: flex; }
.unit-check { color: var(--v6-ok); }
.course-main { grid-row: 2; padding: 0; background: var(--v6-canvas); }
.course-main > #loading-overlay, .course-main > #unit-error, .course-main > .unit-viewer, .course-main > #screen-complete { margin-top: 24px; }
.unit-viewer { padding: 0 24px 24px; }
.unit-viewer h3 { font-size: var(--v6-fs-sub1); line-height: var(--v6-lh-sub1); font-weight: 600; color: var(--v6-t1); }
.text-unit { color: var(--v6-t1); padding: 24px; }
.complete-bar { background: var(--v6-surface); border-radius: var(--v6-r-md); border: var(--v6-line) solid var(--v6-row); }
.complete-bar.done { background: var(--v6-ok-bg); }
.unit-missing { border-color: var(--v6-stroke2); background: var(--v6-surface); color: var(--v6-t3); }
.unit-missing strong { color: var(--v6-t1); }
#screen-complete h2 { font-size: var(--v6-fs-sub1); font-weight: 600; }
#screen-complete .cert-num { background: var(--v6-sel); color: var(--v6-action-ink); font-weight: 600; }
.course-layout > .v6-msgbar { grid-column: 1 / -1; justify-content: center; }
@media (max-width: 767px) {
  .course-layout { grid-template-rows: var(--v6-hdr-h) auto 1fr; height: auto; }
  .course-sidebar { grid-row: 2; }
  .course-main { grid-row: 3; }
  .mobile-menu-btn { display: flex; }
}
