/* ==========================================================================
   ARIORON DESIGN SYSTEM — Vex Classroom
   Loads last. Three layers:
     1. --ar-* tokens (the only values that change between light and dark)
     2. Legacy token remap (core / product-shell / cockpit / polish families
        now point at --ar-* so the existing 27k lines of CSS inherit the palette)
     3. App shell, primitives, page layouts, and targeted component overrides
   ========================================================================== */

/* ---------- 1. TOKENS ---------- */
:root {
    --ar-ink: #161616;
    --ar-ink-soft: #3A3A38;
    --ar-muted: #6B6B68;
    --ar-faint: #6E6E6A; /* was #9A9A96 — 2.5:1, too faint to read */
    --ar-page: #F2F2F0;
    --ar-panel: #F8F8F6;
    --ar-card: #FEFEFD;
    --ar-tile: #EFEFEA;
    --ar-tile-2: #E7E7E2;
    --ar-hover: #E9E9E5;
    --ar-field: #EBEBE7;
    --ar-line: rgba(20, 20, 20, .08);
    --ar-line-hair: rgba(20, 20, 20, .05);
    --ar-line-solid: #E2E2DD;
    --ar-line-strong: #CFCFC9;
    --ar-track: #E5E5E0;

    --ar-primary: #161616;
    --ar-primary-hover: #000000;
    --ar-on-primary: #F7F7F4;

    --ar-side: #0F0F0F;
    --ar-side-card: #181817;
    --ar-side-line: #242423;
    --ar-side-hover: #1A1A19;
    --ar-side-active: #232322;
    --ar-side-text: #F0F0EC;
    --ar-side-muted: #8A8A86;

    --ar-accent: #C4726B;
    --ar-accent-soft: #F3E4E1;
    --ar-success: #4F7A5B;
    --ar-success-soft: #E4ECE5;
    --ar-warning: #A3763A;
    --ar-warning-soft: #F2EADD;
    --ar-danger: #B4524A;
    --ar-danger-soft: #F4E2DF;

    --ar-shadow-sm: 0 2px 8px -2px rgba(28, 28, 28, .10);
    --ar-shadow-md: 0 18px 40px -24px rgba(28, 28, 28, .28);
    --ar-shadow-lg: 0 30px 70px -30px rgba(28, 28, 28, .38);

    --ar-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ar-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --ar-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --ar-r-card: 16px;
    --ar-r-inner: 12px;
    --ar-r-btn: 9px;
    --ar-side-w: 262px;
    --ar-rail-w: 76px;
    --ar-top-h: 66px;
    --ar-gutter: 28px;
    --ar-ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-theme="dark"] {
    --ar-ink: #EFEFEA;
    --ar-ink-soft: #CFCFCA;
    --ar-muted: #9C9C97;
    --ar-faint: #85857F; /* was #6F6F6B — 3.8:1 */
    --ar-page: #0E0E0D;
    --ar-panel: #141413;
    --ar-card: #1A1A19;
    --ar-tile: #222220;
    --ar-tile-2: #2A2A28;
    --ar-hover: #1F1F1E;
    --ar-field: #1C1C1B;
    --ar-line: rgba(255, 255, 255, .08);
    --ar-line-hair: rgba(255, 255, 255, .05);
    --ar-line-solid: #2A2A28;
    --ar-line-strong: #3A3A37;
    --ar-track: #2C2C2A;

    --ar-primary: #EFEFEA;
    --ar-primary-hover: #FFFFFF;
    --ar-on-primary: #121211;

    --ar-side: #080808;
    --ar-side-card: #121211;
    --ar-side-line: #1E1E1D;
    --ar-side-hover: #151514;
    --ar-side-active: #1D1D1C;

    --ar-accent: #D58A82;
    --ar-accent-soft: #3A2624;
    --ar-success: #8DB596;
    --ar-success-soft: #1E2A21;
    --ar-warning: #D0A56A;
    --ar-warning-soft: #2E261B;
    --ar-danger: #E08C82;
    --ar-danger-soft: #36201E;

    --ar-shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .5);
    --ar-shadow-md: 0 18px 40px -24px rgba(0, 0, 0, .7);
    --ar-shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .8);
}

/* ---------- 2. LEGACY TOKEN REMAP ----------
   Values are var() references, so this block is theme-independent. The selector
   list out-ranks every legacy declaration site (max (1,1,1) in the old files). */
:root:root,
html body,
html[data-theme] body #view-portal,
html[data-theme] body #view-dashboard,
html[data-theme] body #view-account,
html[data-theme] body .landing-page {
    /* core / product-shell */
    --page-bg: var(--ar-page);
    --surface: var(--ar-card);
    --surface-2: var(--ar-tile);
    --surface-3: var(--ar-tile-2);
    --text: var(--ar-ink);
    --ink-soft: var(--ar-ink-soft);
    --muted: var(--ar-muted);
    --muted-2: var(--ar-faint);
    --border: var(--ar-line-solid);
    --border-strong: var(--ar-line-strong);
    --blue: var(--ar-primary);
    --blue-dark: var(--ar-primary-hover);
    --blue-soft: var(--ar-tile);
    --green: var(--ar-success);
    --green-soft: var(--ar-success-soft);
    --amber: var(--ar-warning);
    --amber-soft: var(--ar-warning-soft);
    --red: var(--ar-danger);
    --red-soft: var(--ar-danger-soft);
    --violet: var(--ar-ink-soft);
    --pink: var(--ar-accent);
    --pink-soft: var(--ar-accent-soft);
    --shadow: var(--ar-shadow-md);
    --shadow-soft: var(--ar-shadow-sm);
    --radius: var(--ar-r-card);
    --radius-sm: var(--ar-r-inner);
    --control-radius: var(--ar-r-btn);
    --font-sans: var(--ar-sans);
    --font-display: var(--ar-serif);

    /* learning cockpit (fc-*) */
    --fc-bg: var(--ar-page);
    --fc-surface: var(--ar-card);
    --fc-surface-2: var(--ar-panel);
    --fc-surface-3: var(--ar-tile);
    --fc-ink: var(--ar-ink);
    --fc-muted: var(--ar-muted);
    --fc-muted-2: var(--ar-faint);
    --fc-line: var(--ar-line-solid);
    --fc-line-strong: var(--ar-line-strong);
    --fc-blue: var(--ar-primary);
    --fc-blue-strong: var(--ar-primary-hover);
    --fc-blue-soft: var(--ar-tile);
    --fc-green: var(--ar-success);
    --fc-green-soft: var(--ar-success-soft);
    --fc-amber: var(--ar-warning);
    --fc-amber-soft: var(--ar-warning-soft);
    --fc-red: var(--ar-danger);
    --fc-red-soft: var(--ar-danger-soft);
    --fc-violet: var(--ar-ink-soft);
    --fc-shadow: var(--ar-shadow-sm);
    --fc-font: var(--ar-sans);
    --fc-display: var(--ar-serif);

    /* course pages (course-*) */
    --course-bg: var(--ar-page);
    --course-surface: var(--ar-card);
    --course-surface-soft: var(--ar-panel);
    --course-surface-warm: var(--ar-tile);
    --course-ink: var(--ar-ink);
    --course-muted: var(--ar-muted);
    --course-line: var(--ar-line-solid);
    --course-line-strong: var(--ar-line-strong);
    --course-blue: var(--ar-primary);
    --course-green: var(--ar-success);
    --course-amber: var(--ar-warning);
    --course-red: var(--ar-danger);
    --course-shadow: var(--ar-shadow-sm);

    /* beta-polish (ui-* / beta-*) */
    --ui-canvas: var(--ar-page);
    --ui-surface: var(--ar-card);
    --ui-surface-2: var(--ar-tile);
    --ui-ink: var(--ar-ink);
    --ui-text: var(--ar-ink);
    --ui-muted: var(--ar-muted);
    --ui-border: var(--ar-line-solid);
    --ui-blue: var(--ar-primary);
    --beta-blue-soft: var(--ar-tile);
    --beta-green-soft: var(--ar-success-soft);
    --beta-amber-soft: var(--ar-warning-soft);
    --beta-red-soft: var(--ar-danger-soft);
    --beta-shadow-sm: var(--ar-shadow-sm);
    --beta-shadow-md: var(--ar-shadow-md);

    /* landing (hero-*) */
    --hero-ink: var(--ar-ink);
    --hero-muted: var(--ar-muted);
    --hero-line: var(--ar-line-solid);
    --hero-soft: var(--ar-tile);
    --hero-blue: var(--ar-primary);
    --hero-blue-strong: var(--ar-primary-hover);
    --hero-green: var(--ar-success);
    --hero-coral: var(--ar-accent);
    --hero-yellow: var(--ar-warning-soft);
}

/* ---------- 3. BASE ---------- */
html {
    /* Instrument Serif ships one weight: never synthesise bold, so legacy 700/800
       display headings render as clean serif instead of smeared faux-bold. */
    font-synthesis-weight: none;
    background: var(--ar-page);
}
html body {
    background: var(--ar-page);
    color: var(--ar-ink);
    font-family: var(--ar-sans);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01" 0;
}
html body,
html body button,
html body input,
html body textarea,
html body select {
    font-family: var(--ar-sans);
}
::selection { background: color-mix(in srgb, var(--ar-accent) 28%, transparent); }
:focus-visible { outline: 2px solid var(--ar-ink); outline-offset: 2px; }
html body ::-webkit-scrollbar { width: 10px; height: 10px; }
html body ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ar-ink) 16%, transparent); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
html body ::-webkit-scrollbar-track { background: transparent; }
code, kbd, pre, samp { font-family: var(--ar-mono); }

/* Serif display roles */
.ar-display,
.ar-title,
.ar-panel-head h2,
.ar-serif {
    font-family: var(--ar-serif);
    font-weight: 400;
    letter-spacing: -.01em;
}

/* ---------- 4. APP SHELL ---------- */
body.ar-app #app-container,
body.ar-app #main-content { min-height: 100vh; }
body.ar-app #main-content:focus { outline: none; }

.ar-shell {
    display: flex;
    min-height: 100vh;
    background: var(--ar-page);
}

/* Sidebar */
.ar-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--ar-side-w);
    flex-shrink: 0;
    background: var(--ar-side);
    color: var(--ar-side-text);
    display: flex;
    flex-direction: column;
    padding: 22px 0 0;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    transition: width .28s var(--ar-ease), transform .3s var(--ar-ease);
}
.ar-sidebar::-webkit-scrollbar { display: none; }
.ar-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 14px 0 22px;
    margin-bottom: 28px;
    min-height: 40px;
}
.ar-logo-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.ar-logo-v { font-family: var(--ar-serif); font-size: 32px; line-height: 1; transform: translateY(-1px); flex-shrink: 0; width: 22px; text-align: center; }
.ar-logo-text { display: block; min-width: 0; white-space: nowrap; }
.ar-logo-text strong { font-family: var(--ar-serif); font-weight: 400; font-size: 19.5px; letter-spacing: .01em; display: block; line-height: 1.15; }
.ar-logo-text small { font-size: 10.5px; color: var(--ar-side-muted); letter-spacing: .04em; }
.ar-collapse-btn {
    width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
    color: var(--ar-side-muted); background: transparent; border: 0; flex-shrink: 0;
    transition: background .18s, color .18s;
}
.ar-collapse-btn:hover { background: var(--ar-side-hover); color: var(--ar-side-text); }
.ar-collapse-btn svg { width: 17px; height: 17px; stroke-width: 1.7; transition: transform .28s var(--ar-ease); }

.ar-nav { padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.ar-nav-item {
    display: flex; align-items: center; gap: 12px; height: 41px; padding: 0 12px; border-radius: 10px;
    color: var(--ar-side-muted); font-size: 14px; font-weight: 500; width: 100%; text-align: left;
    background: transparent; border: 0; white-space: nowrap; position: relative;
    transition: background .18s, color .18s;
}
.ar-nav-item svg { width: 18px; height: 18px; stroke-width: 1.7; flex-shrink: 0; }
.ar-nav-item:hover { background: var(--ar-side-hover); color: #DCDCD7; }
.ar-nav-item.active { background: var(--ar-side-active); color: var(--ar-side-text); }
.ar-nav-item.active::before {
    content: ''; position: absolute; left: -12px; top: 11px; bottom: 11px; width: 2px; border-radius: 2px; background: var(--ar-accent);
}
.ar-nav-div { height: 1px; background: var(--ar-side-line); margin: 14px 12px; }

.ar-side-promo {
    margin: 18px 12px 0; background: var(--ar-side-card); border: 1px solid var(--ar-side-line); border-radius: 14px;
    padding: 18px 16px 0; overflow: hidden; position: relative; flex-shrink: 0;
}
.ar-side-promo h4 { font-family: var(--ar-serif); font-weight: 400; font-size: 17px; line-height: 1.3; letter-spacing: .01em; margin: 0; }
.ar-side-promo p { font-size: 11.5px; color: var(--ar-side-muted); line-height: 1.5; margin: 8px 0 14px; }
.ar-side-promo svg { display: block; width: calc(100% + 32px); height: 74px; margin: 0 -16px; position: relative; bottom: -2px; }
.ar-side-foot { margin-top: auto; padding: 22px 22px 22px; white-space: nowrap; }
.ar-side-foot strong { font-family: var(--ar-serif); font-weight: 400; font-size: 21px; display: block; line-height: 1; }
.ar-side-foot span { font-size: 9px; letter-spacing: .32em; color: var(--ar-side-muted); display: block; margin-top: 5px; }

/* Collapsed rail (desktop) */
body.ar-rail .ar-sidebar { width: var(--ar-rail-w); }
body.ar-rail .ar-logo { padding: 0; justify-content: center; flex-direction: column; gap: 14px; margin-bottom: 18px; }
body.ar-rail .ar-logo-text,
body.ar-rail .ar-nav-item span,
body.ar-rail .ar-side-promo,
body.ar-rail .ar-side-foot span { display: none; }
body.ar-rail .ar-collapse-btn svg { transform: scaleX(-1); }
body.ar-rail .ar-nav { padding: 0 14px; }
body.ar-rail .ar-nav-item { justify-content: center; padding: 0; }
body.ar-rail .ar-nav-item.active::before { left: -14px; }
body.ar-rail .ar-nav-div { margin: 12px 8px; }
body.ar-rail .ar-side-foot { padding: 18px 0; text-align: center; }
body.ar-rail .ar-side-foot strong { font-size: 0; }
body.ar-rail .ar-side-foot strong::first-letter { font-size: 22px; }

/* Main column */
.ar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
/* Legacy page wrappers sized themselves to the viewport; inside the shell they follow the column. */
body.ar-app :is(.catalog-page, .account-shell, .dashboard-shell, .creator-page) { width: auto !important; max-width: none !important; }
.ar-topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--ar-top-h); flex-shrink: 0;
    display: flex; align-items: center; gap: 14px; padding: 0 var(--ar-gutter);
    background: color-mix(in srgb, var(--ar-page) 86%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
body.ar-scrolled .ar-topbar { border-bottom-color: var(--ar-line); }
.ar-content { flex: 1; padding: 0 var(--ar-gutter) 36px; min-width: 0; }

.ar-icon-btn {
    width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
    color: var(--ar-ink-soft); background: transparent; border: 0; position: relative;
    transition: background .18s, color .18s;
}
.ar-icon-btn:hover { background: var(--ar-hover); color: var(--ar-ink); }
.ar-icon-btn svg { width: 19px; height: 19px; stroke-width: 1.7; }
.ar-menu-btn { display: none; }

.ar-search {
    flex: 1; max-width: 640px; height: 41px; background: var(--ar-field); border: 1px solid transparent; border-radius: 11px;
    display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; color: var(--ar-faint); margin: 0;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.ar-search:focus-within { background: var(--ar-card); border-color: var(--ar-line); box-shadow: var(--ar-shadow-sm); }
.ar-search svg { width: 16px; height: 16px; stroke-width: 1.8; flex-shrink: 0; }
.ar-search input {
    border: 0; outline: 0; background: transparent; font: 400 13.5px/1 var(--ar-sans); color: var(--ar-ink); width: 100%; min-width: 0; padding: 0;
    box-shadow: none;
}
.ar-search input::placeholder { color: var(--ar-faint); }
.ar-search input::-webkit-search-cancel-button { display: none; }
.ar-kbd {
    font: 500 10.5px/1 var(--ar-mono); color: var(--ar-faint); border: 1px solid var(--ar-line); border-radius: 5px;
    padding: 4px 6px; background: var(--ar-card);
}
.ar-search:focus-within .ar-kbd { display: none; }

.ar-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ar-muted); }
.ar-crumbs button, .ar-crumbs a { color: var(--ar-muted); background: none; border: 0; padding: 0; font: inherit; white-space: nowrap; }
.ar-crumbs button:hover { color: var(--ar-ink); }
.ar-crumbs .sep { color: var(--ar-faint); }
.ar-crumbs strong { color: var(--ar-ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ar-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ar-user-wrap { position: relative; }
.ar-user {
    display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border-radius: 12px; background: transparent; border: 0; color: var(--ar-ink);
    transition: background .18s;
}
.ar-user:hover, .ar-user[aria-expanded="true"] { background: var(--ar-hover); }
.ar-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--ar-primary); color: var(--ar-on-primary);
    font-size: 12.5px; font-weight: 600; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; letter-spacing: .02em;
}
.ar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ar-user-name { font-size: 13.5px; font-weight: 600; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-user > svg { width: 15px; height: 15px; color: var(--ar-faint); stroke-width: 1.8; }
.ar-user-menu {
    position: absolute; right: 0; top: calc(100% + 8px); width: 236px; z-index: 60;
    background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 14px; box-shadow: var(--ar-shadow-lg);
    padding: 6px; animation: arPop .16s var(--ar-ease);
}
.ar-user-menu.hidden { display: none; }
.ar-user-menu-head { padding: 10px 12px 10px; border-bottom: 1px solid var(--ar-line-hair); margin-bottom: 4px; }
.ar-user-menu-head strong { display: block; font-size: 13.5px; font-weight: 600; }
.ar-user-menu-head span { display: block; font-size: 11.5px; color: var(--ar-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-user-menu button {
    display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
    color: var(--ar-ink-soft); background: transparent; border: 0;
}
.ar-user-menu button:hover { background: var(--ar-tile); color: var(--ar-ink); }
.ar-user-menu-div { height: 1px; background: var(--ar-line-hair); margin: 4px 0; }
@keyframes arPop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.ar-scrim { display: none; }

/* ---------- 5. PRIMITIVES ---------- */
.ar-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    height: 42px; padding: 0 20px; border-radius: var(--ar-r-btn); font-size: 13.5px; font-weight: 600; line-height: 1;
    border: 1px solid transparent; background: transparent; color: var(--ar-ink); white-space: nowrap; text-decoration: none;
    transition: transform .15s, background .18s, box-shadow .18s, color .18s, border-color .18s;
}
.ar-btn svg { width: 15px; height: 15px; stroke-width: 2; flex-shrink: 0; }
.ar-btn:active { transform: translateY(1px); }
.ar-btn:disabled { opacity: .5; cursor: not-allowed; }
.ar-btn-dark { background: var(--ar-primary); color: var(--ar-on-primary); box-shadow: var(--ar-shadow-sm); }
.ar-btn-dark:hover { background: var(--ar-primary-hover); }
.ar-btn-dark svg { transition: transform .18s; }
.ar-btn-dark:hover svg { transform: translateX(2px); }
.ar-btn-ghost { color: var(--ar-ink-soft); padding: 0 10px; }
.ar-btn-ghost:hover { color: var(--ar-ink); background: var(--ar-hover); }
.ar-btn-outline { border-color: var(--ar-line-strong); background: var(--ar-card); color: var(--ar-ink); }
.ar-btn-outline:hover { border-color: var(--ar-ink-soft); }
.ar-btn-sm { height: 36px; padding: 0 16px; font-size: 12.5px; border-radius: 8px; }
.ar-btn-ghost.ar-btn-sm { padding: 0 10px; }
.ar-btn-block { width: 100%; }

.ar-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
    background: var(--ar-tile); color: var(--ar-ink-soft); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.ar-chip-mono { font-family: var(--ar-mono); font-weight: 500; }
.ar-link {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ar-ink-soft);
    background: none; border: 0; padding: 0; text-decoration: none;
}
.ar-link:hover { color: var(--ar-ink); }
.ar-link svg { width: 13px; height: 13px; stroke-width: 2; transition: transform .18s; }
.ar-link:hover svg { transform: translateX(3px); }

.ar-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ar-muted); margin: 0; }
.ar-sub { font-size: 15px; color: var(--ar-muted); margin: 0; line-height: 1.5; }
.ar-title { font-size: clamp(34px, 3.6vw, 46px); line-height: 1.05; margin: 8px 0 6px; color: var(--ar-ink); }

.ar-panel {
    background: var(--ar-panel); border: 1px solid var(--ar-line-hair); border-radius: var(--ar-r-card); padding: 20px; min-width: 0;
}
.ar-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.ar-panel-head h2 { font-size: 23px; margin: 0; color: var(--ar-ink); line-height: 1.15; }
.ar-panel-head-tight { margin-bottom: 4px; }
.ar-panel-sub { font-size: 12.5px; color: var(--ar-muted); margin: 0 0 14px; }
.ar-panel-sub strong { color: var(--ar-ink); font-weight: 600; }
.ar-empty-inline { font-size: 13px; color: var(--ar-muted); margin: 0; line-height: 1.55; }

.ar-page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    padding: 30px 0 24px;
}
.ar-page-head .ar-sub { max-width: 620px; }
.ar-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ar-page { animation: arFade .35s var(--ar-ease); }
/* Legacy views painted grid backgrounds and a fixed tinted ::before wash; the shell owns the canvas now. */
html body #ar-content > .ar-page {
    background: transparent !important;
    background-image: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
    border: 0 !important;
}
html body #ar-content > .ar-page::before,
html body #ar-content > .ar-page::after { content: none !important; display: none !important; }
.ar-page.hidden { display: none !important; }
@keyframes arFade { from { opacity: 0; transform: translateY(6px); } }

.ar-bar { flex: 1; height: 5px; border-radius: 99px; background: var(--ar-track); overflow: hidden; }
.ar-bar i { display: block; height: 100%; background: var(--ar-primary); border-radius: 99px; width: var(--w); animation: arGrow 1.1s .2s var(--ar-ease) both; }
.ar-bar.is-failed i { background: var(--ar-danger); }
.ar-bar.is-generating i { background: repeating-linear-gradient(-45deg, var(--ar-ink-soft) 0 6px, var(--ar-muted) 6px 12px); background-size: 200% 100%; animation: arGrow 1.1s .2s var(--ar-ease) both, arStripe 1.2s linear infinite; }
@keyframes arGrow { from { width: 0; } }
@keyframes arStripe { to { background-position: -34px 0; } }
.ar-pct { font-family: var(--ar-mono); font-size: 11.5px; color: var(--ar-muted); min-width: 34px; text-align: right; }
.ar-progress-row { display: flex; align-items: center; gap: 12px; }

/* ---------- 6. HOME ---------- */
.ar-hero { position: relative; padding: 34px 0 28px; min-height: 226px; isolation: isolate; }
.ar-hero-art { position: absolute; inset: -8px calc(var(--ar-gutter) * -1) 0 auto; width: 64%; pointer-events: none; z-index: -1; }
.ar-hero-art svg { width: 100%; height: 100%; display: block; }
.ar-hero-art .m1 { fill: #CDCDC9; }
.ar-hero-art .m2 { fill: #8F8F8B; }
.ar-hero-art .m3 { fill: #3B3B38; }
.ar-hero-art .snow { fill: #E9E9E5; }
.ar-hero-art::after {
    content: ''; position: absolute; inset: 0;
    background:
        linear-gradient(90deg, var(--ar-page) 0%, color-mix(in srgb, var(--ar-page) 0%, transparent) 42%),
        linear-gradient(0deg, var(--ar-page) 4%, color-mix(in srgb, var(--ar-page) 0%, transparent) 40%);
}
html[data-theme="dark"] .ar-hero-art .m1 { fill: #2A2A28; }
html[data-theme="dark"] .ar-hero-art .m2 { fill: #1E1E1C; }
html[data-theme="dark"] .ar-hero-art .m3 { fill: #141413; }
html[data-theme="dark"] .ar-hero-art .snow { fill: #4A4A47; }
.ar-hero-quote {
    position: absolute; top: 34px; right: 2px; text-align: right; font-family: var(--ar-serif);
    font-size: 15.5px; line-height: 1.45; color: var(--ar-ink-soft); max-width: 260px; margin: 0;
}
.ar-hero-quote span { display: block; font-family: var(--ar-sans); font-size: 11px; color: var(--ar-faint); margin-top: 7px; letter-spacing: .03em; }
.ar-hero .ar-display { font-size: clamp(44px, 4.8vw, 64px); line-height: 1.02; letter-spacing: -.02em; margin: 10px 0 8px; color: var(--ar-ink); }
.ar-hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.ar-hero-actions .ar-btn-dark { margin-right: 6px; }

.ar-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 4px 0 22px; }
.ar-stat {
    background: var(--ar-card); border: 1px solid var(--ar-line-hair); border-radius: 14px; padding: 18px;
    display: flex; align-items: center; gap: 14px; box-shadow: var(--ar-shadow-sm); min-width: 0;
}
.ar-stat-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--ar-tile); color: var(--ar-ink-soft); display: grid; place-items: center; flex-shrink: 0; }
.ar-stat-ic svg { width: 19px; height: 19px; stroke-width: 1.7; }
.ar-stat strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; display: block; line-height: 1.2; color: var(--ar-ink); }
.ar-stat strong small { font-size: 12px; font-weight: 500; color: var(--ar-muted); letter-spacing: 0; }
.ar-stat > div > span { font-size: 12.5px; color: var(--ar-muted); }

.ar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 20px; align-items: start; }
.ar-col-main, .ar-col-rail { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ar-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Continue card */
.ar-continue {
    background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: var(--ar-r-inner);
    padding: 14px; display: grid; grid-template-columns: 224px minmax(0, 1fr) auto; gap: 22px; align-items: center;
    transition: box-shadow .2s, transform .2s;
}
.ar-continue:hover { box-shadow: var(--ar-shadow-md); transform: translateY(-1px); }
/* The CTA keeps the legacy .active-course-cta hook, which carries a legacy grid-area. */
html body #ar-content .ar-continue > * { grid-area: auto !important; grid-column: auto !important; grid-row: auto !important; }
.ar-continue .ar-thumb { height: 128px; }
.ar-continue h3 { font-family: var(--ar-serif); font-weight: 400; font-size: 23px; margin: 3px 0 4px; letter-spacing: -.01em; color: var(--ar-ink); line-height: 1.15; }
.ar-continue .ar-progress-row { margin-top: 14px; max-width: 480px; }
.ar-tag { font-size: 12px; color: var(--ar-muted); font-weight: 500; margin: 0; display: flex; align-items: center; gap: 8px; }
.ar-tag .ar-chip { height: 22px; font-size: 10.5px; }
.ar-meta { font-size: 12.5px; color: var(--ar-muted); margin: 0; }
.ar-meta i { font-style: normal; color: var(--ar-faint); }

/* Thumbs */
.ar-thumb { border-radius: 10px; overflow: hidden; background: #141414; position: relative; height: 104px; flex-shrink: 0; }
.ar-thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ar-thumb-badge {
    position: absolute; left: 8px; top: 8px; z-index: 2; height: 22px; padding: 0 9px; border-radius: 99px;
    background: rgba(250, 250, 247, .92); color: #161616; font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.ar-thumb-badge.is-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ar-accent); animation: arPulse 1.4s ease-in-out infinite; }
@keyframes arPulse { 50% { opacity: .3; } }

/* Course grid */
.ar-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.ar-course {
    background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: var(--ar-r-inner); padding: 10px;
    display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; position: relative; min-width: 0;
}
.ar-course:hover { box-shadow: var(--ar-shadow-md); transform: translateY(-2px); }
.ar-course .ar-thumb { margin-bottom: 12px; border-radius: 8px; }
.ar-course h3 {
    font-family: var(--ar-serif); font-weight: 400; font-size: 18px; line-height: 1.2; padding: 0 4px; margin: 0; color: var(--ar-ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ar-course .ar-meta { margin: 5px 0 10px; padding: 0 4px; font-size: 11.5px; }
.ar-course .ar-progress-row { margin: auto 4px 0; }
.ar-course .ar-btn { margin: 12px 4px 4px; }
.ar-course-del {
    position: absolute; top: 16px; right: 16px; z-index: 3; width: 28px; height: 28px; border-radius: 8px; border: 0;
    display: grid; place-items: center; background: rgba(250, 250, 247, .9); color: #3A3A38;
    opacity: 0; transition: opacity .18s, background .18s, color .18s;
}
.ar-course:hover .ar-course-del, .ar-course-del:focus-visible { opacity: 1; }
.ar-course-del:hover { background: #fff; color: var(--ar-danger); }
.ar-course-del svg { width: 14px; height: 14px; stroke-width: 1.9; }
.ar-course.is-hidden { display: none; }
@media (hover: none) { .ar-course-del { opacity: 1; } }

/* Empty */
.ar-empty { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center; background: var(--ar-card); border: 1px dashed var(--ar-line-strong); border-radius: var(--ar-r-inner); padding: 14px; }
.ar-empty.hidden { display: none; }
.ar-empty-art { height: 120px; border-radius: 10px; overflow: hidden; }
.ar-empty-art svg { width: 100%; height: 100%; display: block; }
.ar-empty h3 { font-family: var(--ar-serif); font-weight: 400; font-size: 22px; margin: 0 0 4px; color: var(--ar-ink); }
.ar-empty p { font-size: 13px; color: var(--ar-muted); margin: 0; }
.ar-empty-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* Rows (today's plan) */
.ar-rows { display: flex; flex-direction: column; }
.ar-row {
    display: flex; align-items: flex-start; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--ar-line-hair);
    background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; color: inherit; border-radius: 0;
}
.ar-row:first-child { border-top: 0; padding-top: 2px; }
button.ar-row:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ar-line-strong); }
.ar-row-ic { width: 31px; height: 31px; border-radius: 50%; background: var(--ar-tile); color: var(--ar-ink-soft); display: grid; place-items: center; flex-shrink: 0; }
.ar-row-ic svg { width: 15px; height: 15px; stroke-width: 1.8; }
.ar-row.is-done .ar-row-ic { background: var(--ar-primary); color: var(--ar-on-primary); }
.ar-row.is-done b { color: var(--ar-faint); text-decoration: line-through; }
.ar-row b { font-size: 13px; font-weight: 600; display: block; line-height: 1.35; color: var(--ar-ink); }
.ar-row .ar-meta { margin-top: 3px; font-size: 11.5px; }

/* Up next (date tiles) */
.ar-dl { display: flex; align-items: center; gap: 13px; padding: 12px 2px; border-top: 1px solid var(--ar-line-hair); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; }
.ar-dl:first-child { border-top: 0; padding-top: 2px; }
.ar-dl:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ar-line-strong); }
.ar-date { width: 46px; height: 46px; border-radius: 10px; background: var(--ar-tile); flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ar-date em { font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: .1em; color: var(--ar-muted); }
.ar-date strong { font-size: 15px; font-weight: 700; line-height: 1; color: var(--ar-ink); font-family: var(--ar-sans); }
.ar-dl.is-today .ar-date { background: var(--ar-primary); }
.ar-dl.is-today .ar-date em, .ar-dl.is-today .ar-date strong { color: var(--ar-on-primary); }
.ar-dl b { font-size: 13px; font-weight: 600; display: block; color: var(--ar-ink); }
.ar-dl .ar-meta { margin-top: 3px; font-size: 11.5px; }
.ar-dl .ar-meta code { font-family: var(--ar-mono); font-size: 10.5px; color: var(--ar-muted); background: none; padding: 0; }

/* Tutor quick actions */
.ar-tutor-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ar-tutor-btn {
    display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
    background: var(--ar-tile); border: 1px solid transparent; border-radius: 9px; padding: 11px 13px;
    font-size: 13px; font-weight: 500; color: var(--ar-ink-soft); transition: background .18s, border-color .18s, color .18s;
}
.ar-tutor-btn:hover { background: var(--ar-tile-2); border-color: var(--ar-line-hair); color: var(--ar-ink); }
.ar-tutor-btn svg { width: 16px; height: 16px; stroke-width: 1.7; color: var(--ar-muted); flex-shrink: 0; }

.ar-btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Quote card */
.ar-quote-card {
    background: #141413; border-radius: var(--ar-r-card); padding: 24px 22px 0; color: #F2F2ED;
    position: relative; overflow: hidden; min-height: 160px; border: 1px solid #1F1F1E;
}
.ar-quote-card p { font-family: var(--ar-serif); font-size: 18.5px; line-height: 1.4; letter-spacing: .005em; position: relative; z-index: 2; margin: 0; }
.ar-quote-card span { display: block; font-size: 11px; color: #8B8B86; margin-top: 10px; position: relative; z-index: 2; }
.ar-quote-card svg { position: absolute; left: 0; right: 0; bottom: -2px; z-index: 1; width: 100%; height: 92px; }

/* Materials preview rows inside the home panel */
.ar-portal #portal-materials-preview { display: flex; flex-direction: column; gap: 8px; }

/* ---------- 7. COURSE WORKSPACE SHELL ---------- */
.ar-course-head {
    display: flex; align-items: center; gap: 14px; padding: 20px 0 18px;
}
.ar-back { background: var(--ar-card); border: 1px solid var(--ar-line); }
.ar-course-head-title { min-width: 0; flex: 1; }
.ar-course-head-title span { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ar-muted); }
.ar-course-head-title h1 {
    font-family: var(--ar-serif); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 2px 0 0; color: var(--ar-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em;
}
.ar-course-page .dashboard-shell { padding: 0; margin: 0; max-width: none; }
/* The course command bar is the course hero; the shell header only keeps its IDs alive for the
   controller (title/progress text) and is hidden on wide screens where breadcrumbs cover "back". */
.ar-course-page .ar-course-head { display: none; }
.ar-course-page .dashboard-shell { padding-top: 22px; }
html body #view-dashboard .course-command-bar { padding: 26px 28px 22px; }
html body #view-dashboard .course-command-copy .course-kicker { font-size: 11px; font-weight: 600; text-transform: uppercase; }
html body #view-dashboard .course-command-copy h2 { font-size: clamp(30px, 3vw, 42px); line-height: 1.06; margin: 6px 0 6px; }
html body #view-dashboard .course-command-copy .course-subtitle { font-size: 14.5px; color: var(--ar-muted); }

/* ---------- 8. LEGACY COMPONENT OVERRIDES ---------- */
/* Buttons */
/* Legacy dark-mode rules force white text on primaries with !important; the primary is
   near-white in dark mode, so these colours must win at the same priority. */
html body .btn-primary,
html body .course-action-btn.primary,
html body .resume-course-btn,
html body .calendar-complete,
html body .catalog-enroll-btn:not(.secondary),
html body .active-course-cta,
html[data-theme] body :is(#ar-shell, #view-dashboard, #auth-modal) :is(.btn-primary, .course-action-btn.primary, .resume-course-btn, .calendar-complete, .catalog-enroll-btn:not(.secondary), .active-course-cta) {
    background: var(--ar-primary) !important;
    border-color: var(--ar-primary) !important;
    color: var(--ar-on-primary) !important;
    box-shadow: var(--ar-shadow-sm);
    border-radius: var(--ar-r-btn);
    font-weight: 600;
}
html body .btn-primary:hover,
html body .course-action-btn.primary:hover,
html body .resume-course-btn:hover,
html body .calendar-complete:hover,
html body .catalog-enroll-btn:not(.secondary):hover,
html[data-theme] body :is(#ar-shell, #view-dashboard, #auth-modal) :is(.btn-primary, .course-action-btn.primary, .resume-course-btn, .calendar-complete, .catalog-enroll-btn:not(.secondary)):hover {
    background: var(--ar-primary-hover) !important;
    border-color: var(--ar-primary-hover) !important;
    color: var(--ar-on-primary) !important;
}
html body .btn-primary:disabled,
html body .resume-course-btn:disabled { opacity: .5; }
html body #view-dashboard .lesson-player-strip .is-active strong { color: var(--ar-on-primary) !important; }
.ar-btn-ghost { border-color: transparent !important; box-shadow: none !important; }
html body .btn-secondary,
html body .icon-button,
html body .course-action-btn:not(.primary),
html body .catalog-enroll-btn.secondary {
    background: var(--ar-card);
    border-color: var(--ar-line-strong);
    color: var(--ar-ink);
    border-radius: var(--ar-r-btn);
    font-weight: 600;
    box-shadow: none;
}
html body .btn-secondary:hover,
html body .icon-button:hover,
html body .course-action-btn:not(.primary):hover {
    background: var(--ar-tile);
    border-color: var(--ar-ink-soft);
}

/* Fields */
html body .input-field,
html body input[type="text"].input-field,
html body textarea.input-field,
html body select.input-field {
    background: var(--ar-card);
    border: 1px solid var(--ar-line-strong);
    color: var(--ar-ink);
    border-radius: 10px;
    box-shadow: none;
}
html body .input-field:focus {
    border-color: var(--ar-ink);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ar-ink) 10%, transparent);
    outline: none;
}
html body .input-field::placeholder { color: var(--ar-faint); }

/* Legacy page chrome now provided by the shell */
body.ar-app .workspace-header,
body.ar-app .workspace-beta-strip { display: none; }
body.ar-app .workspace-page { background: transparent; min-height: 0; padding: 0; }

/* Toasts & loader */
html body #toast-container > * {
    background: var(--ar-card);
    color: var(--ar-ink);
    border: 1px solid var(--ar-line);
    border-radius: 12px;
    box-shadow: var(--ar-shadow-lg);
    font-family: var(--ar-sans);
}

/* Tailwind blue utilities used by JS-rendered markup */
html body .text-blue-600, html body .text-blue-500, html body .text-blue-700,
html body .dark\:text-blue-300, html body .text-indigo-600 { color: var(--ar-ink-soft); }
html body .bg-blue-600, html body .bg-indigo-600 { background-color: var(--ar-primary); color: var(--ar-on-primary); }
html body .bg-blue-50, html body .bg-indigo-50 { background-color: var(--ar-tile); }
html body .border-blue-200, html body .border-blue-500 { border-color: var(--ar-line-strong); }

/* ---------- 9. COURSE WORKSPACE (learning cockpit) ---------- */
html body #view-dashboard .course-workspace { background: transparent; padding: 0; }
html body #view-dashboard .course-topbar,
html body #view-dashboard .course-command-bar {
    background: var(--ar-panel);
    border: 1px solid var(--ar-line-hair);
    border-radius: var(--ar-r-card);
    box-shadow: none;
}
html body #view-dashboard .course-topbar h2,
html body #view-dashboard .course-command-copy h2 {
    font-family: var(--ar-serif);
    font-weight: 400;
    letter-spacing: -.015em;
    color: var(--ar-ink);
}
html body #view-dashboard .course-kicker,
html body #view-dashboard .sidebar-section-label,
html body #view-dashboard .course-sidebar-head span {
    color: var(--ar-muted);
    letter-spacing: .14em;
}
html body #view-dashboard .course-progress-track,
html body #view-dashboard .sidebar-progress-mini {
    background: var(--ar-track);
}
html body #view-dashboard .course-progress-track > span,
html body #view-dashboard .sidebar-progress-mini > span {
    background: var(--ar-primary);
}
html body #view-dashboard .course-sidebar,
html body #view-dashboard .course-map {
    background: var(--ar-panel);
    border: 1px solid var(--ar-line-hair);
    border-radius: var(--ar-r-card);
    box-shadow: none;
}
html body #view-dashboard .sidebar-current-card {
    background: #141413;
    border: 1px solid #1F1F1E;
    color: #F2F2ED;
    border-radius: var(--ar-r-inner);
    box-shadow: none;
}
html body #view-dashboard .sidebar-current-card h3 { font-family: var(--ar-serif); font-weight: 400; color: #F2F2ED; font-size: 19px; }
html body #view-dashboard .sidebar-current-card span,
html body #view-dashboard .sidebar-current-card p,
html body #view-dashboard .sidebar-current-card em { color: #9A9A95; }
html body #view-dashboard .sidebar-current-card strong { color: #F2F2ED; }
html body #view-dashboard .sidebar-current-card .sidebar-progress-mini { background: #2C2C2A; }
html body #view-dashboard .sidebar-current-card .sidebar-progress-mini > span { background: #F2F2ED; }
html body #view-dashboard .sidebar-current-card .sidebar-stat-strip span { background: #1E1E1D; border-color: #2A2A28; }
html body #view-dashboard .course-nav-item.active,
html body #view-dashboard .course-nav-item[aria-current="page"] {
    background: var(--ar-primary);
    border-color: var(--ar-primary);
    color: var(--ar-on-primary);
}
html body #view-dashboard .course-nav-item.active em,
html body #view-dashboard .course-nav-item.active strong { color: var(--ar-on-primary); }
html body #view-dashboard .lesson-row-active,
html body #view-dashboard .course-lesson[aria-current="page"] {
    background: var(--ar-card);
    border-color: var(--ar-ink);
    box-shadow: var(--ar-shadow-sm);
}
html body #view-dashboard .lesson-day {
    background: var(--ar-tile);
    color: var(--ar-ink);
    font-family: var(--ar-mono);
    font-weight: 500;
}
html body #view-dashboard .lesson-row-active .lesson-day { background: var(--ar-primary); color: var(--ar-on-primary); }
html body #view-dashboard .lesson-state.ready { background: var(--ar-ink-soft); }
html body #view-dashboard .lesson-state.mastered { background: var(--ar-success); }
html body #view-dashboard .course-panel,
html body #view-dashboard .lesson-panel,
html body #view-dashboard .course-page > section,
html body #view-dashboard .course-page .course-panel {
    border-color: var(--ar-line-hair);
    border-radius: var(--ar-r-card);
}

/* Lesson reading typography */
html body #view-dashboard .lesson-panel h1,
html body #view-dashboard .lesson-panel h2,
html body #view-dashboard .lesson-content h1,
html body #view-dashboard .lesson-content h2,
html body #view-dashboard .course-page h2 {
    font-family: var(--ar-serif);
    font-weight: 400;
    letter-spacing: -.01em;
    color: var(--ar-ink);
}
html body #view-dashboard .lesson-content p,
html body #view-dashboard .lesson-content li { color: var(--ar-ink-soft); }
html body #view-dashboard .lesson-content blockquote {
    border-left: 2px solid var(--ar-accent);
    background: var(--ar-tile);
    color: var(--ar-ink-soft);
}
/* Inline maths must sit in the line of text. A global reset makes every <svg> a block,
   which broke "typically $0.5\ \mu m$ to $5\ \mu m$" onto five separate lines. */
mjx-container:not([display="true"]) { display: inline-block; margin: 0 .08em; max-width: 100%; }
mjx-container:not([display="true"]) > svg { display: inline-block; max-width: none; }
html body #view-dashboard mjx-container[display="true"] {
    background: var(--ar-panel);
    border: 1px solid var(--ar-line-hair);
    border-radius: 10px;
    padding: 14px 10px;
}

/* AI tutor drawer */
html body .ai-pane-shell .ai-pane {
    background: var(--ar-card);
    border-left: 1px solid var(--ar-line);
    box-shadow: var(--ar-shadow-lg);
}
html body .ai-pane-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border-bottom: 1px solid var(--ar-line-hair);
}
html body .ai-pane-head h2 { font-family: var(--ar-serif); font-weight: 400; font-size: 24px; margin: 2px 0 0; color: var(--ar-ink); }
html body .ai-pane-head .ar-eyebrow { font-size: 11px; }
html body .ai-message.user,
html body .ai-message-row.user .ai-message {
    background: var(--ar-tile);
    color: var(--ar-ink);
    border: 1px solid var(--ar-line-hair);
}
html body .ai-message.assistant,
html body .ai-message-row.assistant .ai-message {
    background: transparent;
    color: var(--ar-ink-soft);
    border: 0;
    box-shadow: none;
}
html body .ai-message.assistant strong:first-child { color: var(--ar-ink); }
html body .ai-input-row { border-top: 1px solid var(--ar-line-hair); gap: 8px; }
html body .ai-input-row .ar-send { width: 40px; padding: 0; flex-shrink: 0; }

/* ---------- 10. ACCOUNT (ac-*) ---------- */
#view-account { max-width: 1080px; margin: 0 auto; color: var(--ar-ink); }
#view-account :is(h1, h2, h3) { color: var(--ar-ink); }
#view-account .ac-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0 24px; }
#view-account .ac-profile { display: flex; align-items: center; gap: 18px; min-width: 0; }
#view-account .ac-profile-copy { min-width: 0; }
#view-account .ac-profile h1 { margin: 4px 0 4px; font-family: var(--ar-serif); font-weight: 400; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.05; }
#view-account .ac-profile p:not(.ar-eyebrow) { margin: 0; font-size: 14.5px; color: var(--ar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }
#view-account .ac-avatar, #view-account .ac-avatar.account-avatar { display: grid !important; place-items: center; width: 64px !important; height: 64px !important; flex-shrink: 0; border-radius: 50% !important; overflow: hidden; background: var(--ar-primary) !important; color: var(--ar-on-primary) !important; font: 500 22px var(--ar-sans) !important; border: 0 !important; box-shadow: none !important; }
#view-account .ac-avatar img { width: 100%; height: 100%; object-fit: cover; }
#view-account .ac-avatar-lg { width: 84px !important; height: 84px !important; font-size: 28px !important; }
#view-account .ac-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--ar-line-solid); margin-bottom: 28px; }
#view-account .ac-tab { position: relative; padding: 12px 14px 14px; font: 500 14px var(--ar-sans); color: var(--ar-muted); background: none; border: 0; white-space: nowrap; cursor: pointer; }
#view-account .ac-tab::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
#view-account .ac-tab:hover, #view-account .ac-tab.active { color: var(--ar-ink); }
#view-account .ac-tab.active::after { background: var(--ar-ink); }
#view-account .ac-quiet { color: var(--ar-muted); font-size: 14px; }
#view-account .ac-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 36px; }
#view-account .ac-stats > div { padding: 18px 20px; border-radius: 16px; background: var(--ar-card); border: 1px solid var(--ar-line); }
#view-account .ac-stats strong { display: block; font-family: var(--ar-serif); font-weight: 400; font-size: 34px; line-height: 1; }
#view-account .ac-stats small { font-family: var(--ar-sans); font-size: 14px; color: var(--ar-faint); }
#view-account .ac-stats span { display: block; margin-top: 8px; font-size: 13px; color: var(--ar-muted); }
#view-account .ac-section + .ac-section { margin-top: 36px; }
#view-account .ac-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#view-account .ac-section-head h2 { margin: 0; font: 600 15.5px var(--ar-sans); letter-spacing: -.005em; }
#view-account .ac-count { margin-left: 6px; font: 500 12px var(--ar-mono); color: var(--ar-faint); }
#view-account .ar-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ar-ink); background: none; border: 0; cursor: pointer; }
#view-account .ac-list { background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; overflow: hidden; }
#view-account .ac-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 18px; text-align: left; background: none; border: 0; font: inherit; color: inherit; }
#view-account .ac-row + .ac-row { border-top: 1px solid var(--ar-line-hair); }
#view-account button.ac-row { cursor: pointer; }
#view-account button.ac-row:hover { background: var(--ar-panel); }
#view-account .ac-row-thumb { width: 72px; height: 48px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--ar-tile); }
#view-account .ac-row-thumb svg { display: block; width: 100%; height: 100%; }
#view-account .ac-row-ic { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: var(--ar-tile); color: var(--ar-ink); }
#view-account .ac-row-ic svg { width: 18px; height: 18px; }
#view-account .ac-row-ic.is-award { background: var(--ar-accent-soft); color: var(--ar-accent); }
#view-account .ac-row-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
#view-account .ac-row-copy strong { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-account .ac-row-copy em { font-style: normal; font-size: 13px; color: var(--ar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-account .ac-row-copy .ar-progress-row { max-width: 320px; margin-top: 4px; }
#view-account .ac-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
#view-account .ac-empty { padding: 44px 24px; text-align: center; border: 1px dashed var(--ar-line-strong); border-radius: 16px; background: var(--ar-card); }
#view-account .ac-empty strong { display: block; font-family: var(--ar-serif); font-weight: 400; font-size: 24px; }
#view-account .ac-empty p { margin: 6px auto 16px; max-width: 380px; font-size: 14px; color: var(--ar-muted); }
#view-account .ac-preview:not(:empty) { margin-top: 28px; }

#view-account .ac-form { display: grid; gap: 18px; max-width: 860px; }
#view-account .ac-form-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: 24px; border-radius: 16px; background: var(--ar-card); border: 1px solid var(--ar-line); }
#view-account .ac-form-group h2 { margin: 0 0 4px; font: 600 15px var(--ar-sans); }
#view-account .ac-form-group header p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ar-muted); }
#view-account .ac-form-body { display: grid; gap: 16px; min-width: 0; }
#view-account .ac-form-grid { grid-template-columns: 1fr 1fr; }
#view-account .ac-field { display: grid; gap: 6px; min-width: 0; }
#view-account .ac-field-wide { grid-column: 1 / -1; }
#view-account .ac-field span { font-size: 12.5px; font-weight: 600; color: var(--ar-ink-soft); }
#view-account .ac-field :is(input, textarea) { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ar-line-strong) !important; background: var(--ar-card) !important; color: var(--ar-ink) !important; font: 14.5px var(--ar-sans); box-shadow: none !important; outline: none; }
#view-account .ac-field input { height: 42px; }
#view-account .ac-field :is(input, textarea):focus { border-color: var(--ar-ink) !important; box-shadow: 0 0 0 3px var(--ar-hover) !important; }
#view-account .ac-avatar-row { display: flex; align-items: center; gap: 18px; }
#view-account .ac-avatar-actions { display: flex; gap: 8px; }
#view-account .ac-form-actions { display: flex; justify-content: flex-end; }
@media (max-width: 760px) {
    #view-account .ac-head { flex-direction: column; align-items: flex-start; }
    #view-account .ac-stats { grid-template-columns: 1fr 1fr; }
    #view-account .ac-row { flex-wrap: wrap; }
    #view-account .ac-row-thumb { display: none; }
    #view-account .ac-row-actions { width: 100%; justify-content: flex-end; }
    #view-account .ac-form-group { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
    #view-account .ac-form-grid { grid-template-columns: 1fr; }
}

/* ---------- 11. CATALOG (ex-*) ---------- */
@keyframes arShimmer { to { background-position: -200% 0; } }
#view-course-catalog { max-width: 1180px; margin: 0 auto; color: var(--ar-ink); }
#view-course-catalog .ex-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 18px 0 22px; }
#view-course-catalog .ex-search { display: flex; align-items: center; gap: 10px; max-width: 420px; height: 44px; padding: 0 14px; margin-bottom: 24px; border-radius: 12px; background: var(--ar-card); border: 1px solid var(--ar-line-strong); color: var(--ar-muted); }
#view-course-catalog .ex-search:focus-within { border-color: var(--ar-ink); }
#view-course-catalog .ex-search svg { width: 17px; height: 17px; stroke-width: 1.7; }
#view-course-catalog .ex-search input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none; padding: 0 !important; font: 14.5px var(--ar-sans); color: var(--ar-ink); }
#view-course-catalog .ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
#view-course-catalog .ex-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--ar-card); border: 1px solid var(--ar-line); transition: transform .2s var(--ar-ease), box-shadow .2s, border-color .2s; }
#view-course-catalog .ex-card:hover { transform: translateY(-3px); box-shadow: var(--ar-shadow-md); border-color: var(--ar-line-strong); }
#view-course-catalog .ex-card.is-loading { min-height: 320px; background: linear-gradient(90deg, var(--ar-tile) 0%, var(--ar-panel) 50%, var(--ar-tile) 100%); background-size: 200% 100%; animation: arShimmer 1.4s linear infinite; }
#view-course-catalog .ex-thumb { height: 150px; background: var(--ar-tile); }
#view-course-catalog .ex-thumb svg { display: block; width: 100%; height: 100%; }
#view-course-catalog .ex-body { flex: 1; padding: 18px 20px 6px; }
#view-course-catalog .ex-tag { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ar-muted); }
#view-course-catalog .ex-card h3 { margin: 0 0 8px; font-family: var(--ar-serif); font-weight: 400; font-size: 24px; line-height: 1.15; color: var(--ar-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#view-course-catalog .ex-desc { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--ar-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#view-course-catalog .ex-meta { margin: 0; font-size: 13px; color: var(--ar-ink-soft); }
#view-course-catalog .ex-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 18px; }
#view-course-catalog .ex-owned { font-size: 12.5px; color: var(--ar-muted); }
#view-course-catalog .ex-empty { padding: 56px 24px; text-align: center; border: 1px dashed var(--ar-line-strong); border-radius: 18px; background: var(--ar-card); }
#view-course-catalog .ex-empty strong { display: block; font-family: var(--ar-serif); font-weight: 400; font-size: 26px; }
#view-course-catalog .ex-empty p, #view-course-catalog .ex-quiet { margin: 8px auto 0; max-width: 420px; font-size: 14px; color: var(--ar-muted); }
#view-course-catalog .hidden { display: none !important; }
@media (max-width: 760px) {
    #view-course-catalog .ex-head { flex-direction: column; align-items: flex-start; gap: 14px; }
    #view-course-catalog .ex-search { max-width: none; }
}

/* ---------- 12. COURSE BUILDER (cr-*) ---------- */
#view-course-creator .hidden { display: none !important; }
#view-course-creator .cr { max-width: 720px; margin: 0 auto; padding: 40px 20px 72px; display: grid; gap: 20px; }
#view-course-creator .cr-head { display: grid; gap: 6px; }
#view-course-creator .cr-title { font-family: var(--ar-serif); font-weight: 400; font-size: clamp(32px, 5vw, 44px); line-height: 1.08; letter-spacing: -.015em; color: var(--ar-ink); margin: 2px 0 0; }
#view-course-creator .cr-step-label { font-family: var(--ar-mono); font-size: 12px; color: var(--ar-faint); margin: 0; }
#view-course-creator .cr-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#view-course-creator .cr-step-dot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ar-faint); }
#view-course-creator .cr-step-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ar-line-strong); flex: none; transition: all .2s var(--ar-ease); }
#view-course-creator .cr-step-dot.is-on { color: var(--ar-ink); font-weight: 500; }
#view-course-creator .cr-step-dot.is-on::before { background: var(--ar-accent); border-color: var(--ar-accent); }
#view-course-creator .cr-step-dot.is-done { color: var(--ar-muted); }
#view-course-creator .cr-step-dot.is-done::before { background: var(--ar-ink); border-color: var(--ar-ink); }
#view-course-creator .cr-progress { height: 3px; border-radius: 3px; background: var(--ar-track); overflow: hidden; margin-top: 6px; }
#view-course-creator .cr-progress span { display: block; height: 100%; background: var(--ar-ink); border-radius: inherit; transition: width .35s var(--ar-ease); }

#view-course-creator .cr-card { background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: var(--ar-r-card); box-shadow: var(--ar-shadow-sm); padding: 28px; display: grid; gap: 24px; }
#view-course-creator .cr-panel { display: grid; gap: 12px; animation: cr-in .25s var(--ar-ease); }
@keyframes cr-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#view-course-creator .cr-label { display: block; font-size: 14px; font-weight: 600; color: var(--ar-ink); margin: 0; }
#view-course-creator .cr-label em { font-style: normal; font-weight: 400; color: var(--ar-faint); margin-left: 4px; }
#view-course-creator .cr-label-sm { font-size: 13px; font-weight: 500; color: var(--ar-muted); margin-top: 8px; }
#view-course-creator .cr-input { width: 100%; background: var(--ar-field); border: 1px solid transparent; border-radius: var(--ar-r-inner); padding: 12px 14px; font: 15px/1.5 var(--ar-sans); color: var(--ar-ink); transition: border-color .15s, background .15s; box-shadow: none; }
#view-course-creator .cr-input:focus { outline: none; background: var(--ar-card); border-color: var(--ar-ink); }
#view-course-creator .cr-input::placeholder { color: var(--ar-faint); }
#view-course-creator .cr-textarea { min-height: 116px; resize: vertical; font-size: 16px; }
#view-course-creator .cr-hint { font-size: 13px; color: var(--ar-muted); margin: 0; }
#view-course-creator .cr-error { font-size: 13px; color: var(--ar-danger); margin: 0; }
#view-course-creator .cr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#view-course-creator .cr-chips button { appearance: none; border: 1px solid var(--ar-line-solid); background: var(--ar-card); color: var(--ar-ink-soft); border-radius: 999px; padding: 7px 14px; font: 500 13px var(--ar-sans); cursor: pointer; transition: all .15s; box-shadow: none; }
#view-course-creator .cr-chips button:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
#view-course-creator .cr-chips button:is(.active, .selected, [aria-pressed="true"]) { background: var(--ar-ink); color: var(--ar-on-primary); border-color: var(--ar-ink); }

#view-course-creator .cr-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#view-course-creator .cr-options-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#view-course-creator .cr-option { position: relative; display: block; cursor: pointer; }
#view-course-creator .cr-option input { position: absolute; opacity: 0; pointer-events: none; }
#view-course-creator .cr-option > span { display: grid; gap: 3px; height: 100%; padding: 14px 16px; border: 1px solid var(--ar-line-solid); border-radius: var(--ar-r-inner); background: var(--ar-card); transition: all .15s; }
#view-course-creator .cr-option strong { font-size: 15px; font-weight: 600; color: var(--ar-ink); }
#view-course-creator .cr-option em { font-style: normal; font-size: 13px; color: var(--ar-muted); }
#view-course-creator .cr-option:hover > span { border-color: var(--ar-line-strong); background: var(--ar-panel); }
#view-course-creator .cr-option input:checked + span { border-color: var(--ar-ink); box-shadow: inset 0 0 0 1px var(--ar-ink); background: var(--ar-card); }
#view-course-creator .cr-option input:focus-visible + span { outline: 2px solid var(--ar-accent); outline-offset: 2px; }

#view-course-creator .cr-duration { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 12px; }
#view-course-creator #duration-display { font-family: var(--ar-serif); font-weight: 400; font-size: 28px; color: var(--ar-ink); }
#view-course-creator .cr-range { width: 100%; accent-color: var(--ar-ink); height: 4px; }
#view-course-creator .cr-duration-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--ar-muted); flex-wrap: wrap; }
#view-course-creator .cr-days-input { display: inline-flex; align-items: center; gap: 8px; }
#view-course-creator .cr-days-input input { width: 76px; background: var(--ar-field); border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; font: 14px var(--ar-mono); color: var(--ar-ink); }
#view-course-creator .cr-days-input input:focus { outline: none; border-color: var(--ar-ink); }
#view-course-creator .cr-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
#view-course-creator .cr-field { display: grid; gap: 8px; }

#view-course-creator .cr-review { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ar-line); border-radius: var(--ar-r-inner); overflow: hidden; }
#view-course-creator .cr-review li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; font-size: 14px; border-top: 1px solid var(--ar-line-hair); }
#view-course-creator .cr-review li:first-child { border-top: 0; }
#view-course-creator .cr-review li span { color: var(--ar-muted); }
#view-course-creator .cr-review li strong { color: var(--ar-ink); font-weight: 500; text-align: right; }
#view-course-creator .cr-yield { font-size: 14px; color: var(--ar-muted); margin: 4px 0 0; }
#view-course-creator .cr-yield span { color: var(--ar-ink); font-weight: 600; }

#view-course-creator .cr-actions { display: flex; align-items: center; gap: 10px; padding-top: 20px; border-top: 1px solid var(--ar-line-hair); }
#view-course-creator .cr-actions-gap { flex: 1; }

#view-course-creator .cr-materials { background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: var(--ar-r-card); }
#view-course-creator .cr-materials > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; }
#view-course-creator .cr-materials > summary::-webkit-details-marker { display: none; }
#view-course-creator .cr-materials > summary span { display: grid; gap: 2px; }
#view-course-creator .cr-materials > summary strong { font-size: 15px; font-weight: 600; color: var(--ar-ink); }
#view-course-creator .cr-materials > summary em { font-style: normal; font-size: 13px; color: var(--ar-muted); }
#view-course-creator .cr-materials > summary svg { width: 18px; height: 18px; stroke-width: 1.8; color: var(--ar-muted); transition: transform .2s; flex: none; }
#view-course-creator .cr-materials[open] > summary svg { transform: rotate(180deg); }
#view-course-creator .cr-materials.is-focus { box-shadow: 0 0 0 2px var(--ar-accent); }
#view-course-creator .cr-upload { display: grid; gap: 12px; padding: 0 22px 18px; }
#view-course-creator .cr-drop { display: grid; gap: 4px; place-items: center; text-align: center; padding: 28px 16px; border: 1.5px dashed var(--ar-line-strong); border-radius: var(--ar-r-inner); background: var(--ar-panel); cursor: pointer; transition: all .15s; }
#view-course-creator .cr-drop:hover, #view-course-creator .cr-drop.drag-over { border-color: var(--ar-ink); background: var(--ar-hover); }
#view-course-creator .cr-drop span { font-size: 14px; font-weight: 500; color: var(--ar-ink); }
#view-course-creator .cr-drop em { font-style: normal; font-size: 12px; color: var(--ar-faint); }
#view-course-creator .cr-upload-row { display: flex; gap: 10px; }
#view-course-creator .cr-upload-row .cr-input { flex: 1; padding: 9px 12px; font-size: 14px; }
#view-course-creator .cr-mat-list { padding: 0 22px 20px; font-size: 13px; color: var(--ar-muted); display: grid; gap: 8px; }

@media (max-width: 640px) {
    #view-course-creator .cr { padding: 24px 16px 56px; }
    #view-course-creator .cr-card { padding: 20px; }
    #view-course-creator .cr-options, #view-course-creator .cr-options-3, #view-course-creator .cr-fields { grid-template-columns: 1fr; }
    #view-course-creator .cr-step-dot span { display: none; }
    #view-course-creator .cr-steps { display: flex; gap: 6px; }
    #view-course-creator #wizard-cancel { display: none; }
}

/* material rows (builder, home preview, course materials tab) */
.mt-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ar-line); border-radius: var(--ar-r-inner); background: var(--ar-card); }
.mt-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--ar-tile); color: var(--ar-ink-soft); display: grid; place-items: center; flex: none; font: 600 10px var(--ar-mono); letter-spacing: .02em; text-transform: uppercase; }
.mt-copy { display: grid; gap: 1px; min-width: 0; flex: 1; }
.mt-copy strong { font-size: 14px; font-weight: 500; color: var(--ar-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-copy em { font-style: normal; font-size: 12px; color: var(--ar-muted); }
.mt-actions { display: flex; gap: 6px; flex: none; }
html body .mt-actions button { appearance: none; height: auto !important; min-height: 0 !important; width: auto !important; padding: 6px 10px !important; white-space: nowrap; display: inline-flex !important; align-items: center; box-shadow: none !important; background: var(--ar-card) !important; border: 1px solid var(--ar-line-solid) !important; color: var(--ar-ink-soft) !important; border: 1px solid var(--ar-line-solid); background: var(--ar-card); color: var(--ar-ink-soft); border-radius: 8px; padding: 6px 10px; font: 500 12px var(--ar-sans); cursor: pointer; box-shadow: none; }
html body .mt-actions button:hover { border-color: var(--ar-ink) !important; color: var(--ar-ink) !important; border-color: var(--ar-ink); color: var(--ar-ink); }
html body .mt-actions .material-delete:hover { border-color: var(--ar-danger) !important; color: var(--ar-danger) !important; border-color: var(--ar-danger); color: var(--ar-danger); }
.mt-list { display: grid; gap: 8px; }
.mt-empty { display: grid; gap: 10px; justify-items: start; padding: 4px 0; font-size: 13px; color: var(--ar-muted); }
.mt-empty p { margin: 0; }

/* ---------- 13. RESPONSIVE ---------- */
@media (max-width: 1320px) {
    .ar-layout { grid-template-columns: minmax(0, 1fr) 332px; }
}
@media (max-width: 1140px) {
    .ar-layout { grid-template-columns: 1fr; }
    .ar-col-rail { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
    .ar-quote-card { grid-column: 1 / -1; }
    .ar-hero-quote { display: none; }
}
@media (max-width: 960px) {
    :root { --ar-gutter: 20px; }
    .ar-sidebar {
        position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); width: var(--ar-side-w) !important;
        box-shadow: none;
    }
    body.ar-rail .ar-sidebar .ar-logo-text,
    body.ar-rail .ar-sidebar .ar-nav-item span,
    body.ar-rail .ar-sidebar .ar-side-foot span { display: revert; }
    body.ar-rail .ar-sidebar .ar-side-promo { display: block; }
    body.ar-rail .ar-sidebar .ar-nav-item { justify-content: flex-start; padding: 0 12px; }
    body.ar-rail .ar-sidebar .ar-logo { flex-direction: row; padding: 0 14px 0 22px; justify-content: space-between; }
    body.ar-rail .ar-sidebar .ar-side-foot strong { font-size: 21px; }
    body.ar-side-open .ar-sidebar { transform: none; box-shadow: var(--ar-shadow-lg); }
    .ar-collapse-btn { display: none; }
    .ar-scrim {
        display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 10, 10, .42); border: 0;
        opacity: 0; pointer-events: none; transition: opacity .25s;
    }
    body.ar-side-open .ar-scrim { opacity: 1; pointer-events: auto; }
    .ar-menu-btn { display: grid; }
    .ar-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ar-duo, .ar-col-rail { grid-template-columns: 1fr; }
    .ar-continue { grid-template-columns: 1fr; gap: 14px; }
    .ar-continue .ar-thumb { height: 150px; }
    .ar-continue > .ar-btn { justify-self: start; }
    .ar-user-name, .ar-user > svg { display: none; }
    .ar-hero-art { width: 80%; opacity: .7; }
    .ar-kbd { display: none; }
}
@media (max-width: 600px) {
    :root { --ar-gutter: 16px; }
    .ar-topbar { gap: 8px; }
    .ar-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ar-stat { padding: 14px; gap: 10px; }
    .ar-stat-ic { width: 36px; height: 36px; }
    .ar-course-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ar-empty { grid-template-columns: 1fr; }
    .ar-hero { padding-top: 22px; min-height: 0; }
    .ar-hero-art { width: 100%; opacity: .45; }
    .ar-course-head-title h1 { font-size: 24px; }
    .ar-page-head { padding: 22px 0 18px; }
}
@media (max-width: 400px) {
    .ar-course-grid { grid-template-columns: 1fr; }
    .ar-stat strong { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
    .ar-page, .ar-bar i, .ar-user-menu { animation: none !important; }
    .ar-sidebar, .ar-course, .ar-continue { transition: none !important; }
}
@media print {
    .ar-sidebar, .ar-topbar, .ar-scrim, .ar-course-head { display: none !important; }
    .ar-content { padding: 0 !important; }
}

/* ---------- 14. COURSE WORKSPACE v2 (cw-*) ----------
   One calm header, one row of underlined tabs, a slide-over lesson drawer, and a reader that
   behaves like a book page. Everything is ID-scoped so the legacy cockpit sheet can't leak in. */
#view-dashboard .dashboard-shell { padding-top: 6px; }
#view-dashboard .cw { max-width: 1180px; margin: 0 auto; padding-bottom: 72px; color: var(--ar-ink); }
#view-dashboard .cw :is(h1, h2, h3, h4) { color: var(--ar-ink); }
#view-dashboard .cw :where(button:not(.ar-btn)) { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
#view-dashboard .cw button:disabled { cursor: not-allowed; }
#view-dashboard .cw svg { stroke-width: 1.7; flex-shrink: 0; }

/* header */
#view-dashboard .cw-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 18px 0 22px; }
#view-dashboard .cw-head-main { min-width: 0; flex: 1; }
#view-dashboard .cw-title { font-family: var(--ar-serif); font-weight: 400; font-size: clamp(32px, 3.4vw, 44px); line-height: 1.05; letter-spacing: -.015em; margin: 6px 0 14px; overflow-wrap: anywhere; }
#view-dashboard .cw-head-progress { max-width: 340px; }
#view-dashboard .cw-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
#view-dashboard .cw-head-actions .ar-btn svg { width: 16px; height: 16px; }
#view-dashboard .cw-head-actions .ar-btn-outline { background: var(--ar-card); border: 1px solid var(--ar-line-strong); }

/* tabs */
#view-dashboard .cw-tabs {
    position: sticky; top: var(--ar-top-h); z-index: 30;
    display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--ar-line-solid);
    background: color-mix(in srgb, var(--ar-page) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
#view-dashboard .cw-tabs::-webkit-scrollbar { display: none; }
#view-dashboard .cw .cw-tab {
    position: relative; padding: 13px 14px 14px; font-size: 14px; font-weight: 500; color: var(--ar-muted);
    white-space: nowrap; transition: color .15s;
}
#view-dashboard .cw .cw-tab::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
#view-dashboard .cw .cw-tab:hover { color: var(--ar-ink); }
#view-dashboard .cw .cw-tab.active { color: var(--ar-ink); }
#view-dashboard .cw .cw-tab.active::after { background: var(--ar-ink); }

/* drawer */
#view-dashboard .cw-drawer-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(12, 12, 12, .36); opacity: 0; pointer-events: none; transition: opacity .25s var(--ar-ease); }
#view-dashboard .cw-drawer {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 91; width: min(400px, 92vw);
    display: flex; flex-direction: column; background: var(--ar-card); border-right: 1px solid var(--ar-line);
    box-shadow: var(--ar-shadow-lg); transform: translateX(-104%); transition: transform .32s var(--ar-ease); visibility: hidden;
}
#view-dashboard .cw.contents-open .cw-drawer { transform: none; visibility: visible; }
#view-dashboard .cw.contents-open .cw-drawer-scrim { opacity: 1; pointer-events: auto; }
#view-dashboard .cw-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 20px 14px; }
#view-dashboard .cw-drawer-head strong { display: block; font-family: var(--ar-serif); font-weight: 400; font-size: 24px; line-height: 1.15; margin-top: 4px; }
#view-dashboard .cw-search { display: flex; align-items: center; gap: 8px; margin: 0 20px 10px; padding: 0 12px; height: 40px; border-radius: 10px; background: var(--ar-field); color: var(--ar-muted); }
#view-dashboard .cw-search svg { width: 16px; height: 16px; }
#view-dashboard .cw-search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none; font-size: 14px; color: var(--ar-ink); padding: 0 !important; height: 100%; }
#view-dashboard .cw-search button { font-size: 12.5px !important; font-weight: 600 !important; color: var(--ar-ink) !important; }
#view-dashboard .cw-units { flex: 1; overflow-y: auto; padding: 4px 10px 28px; }
#view-dashboard .cw-unit { border-bottom: 1px solid var(--ar-line-hair); }
#view-dashboard .cw .cw-unit-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 10px; text-align: left; border-radius: 10px; }
#view-dashboard .cw .cw-unit-toggle:hover { background: var(--ar-hover); }
#view-dashboard .cw-unit-num { font-family: var(--ar-mono); font-size: 12px; color: var(--ar-faint); }
#view-dashboard .cw-unit-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
#view-dashboard .cw-unit-count { font-family: var(--ar-mono); font-size: 11.5px; color: var(--ar-muted); }
#view-dashboard .cw-chev { width: 16px; height: 16px; color: var(--ar-faint); transition: transform .2s; }
#view-dashboard .cw-unit.is-collapsed .cw-chev { transform: rotate(-90deg); }
#view-dashboard .cw-unit.is-collapsed .cw-unit-lessons { display: none; }
#view-dashboard .cw-unit-lessons { display: grid; gap: 2px; padding: 0 0 12px; }
#view-dashboard .cw .cw-lesson-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; color: var(--ar-ink-soft); }
#view-dashboard .cw .cw-lesson-row:hover:not(:disabled) { background: var(--ar-hover); color: var(--ar-ink); }
#view-dashboard .cw .cw-lesson-row.lesson-row-active { background: var(--ar-tile-2); color: var(--ar-ink); }
#view-dashboard .cw .cw-lesson-row.is-locked { color: var(--ar-faint); }
#view-dashboard .cw-lesson-mark { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--ar-line-strong); font-family: var(--ar-mono); font-size: 11.5px; color: var(--ar-muted); }
#view-dashboard .cw-lesson-mark svg { width: 13px; height: 13px; }
#view-dashboard .cw-lesson-row.is-mastered .cw-lesson-mark { background: var(--ar-ink); border-color: var(--ar-ink); color: var(--ar-on-primary); }
#view-dashboard .cw-lesson-row.lesson-row-active .cw-lesson-mark { border-color: var(--ar-ink); color: var(--ar-ink); }
#view-dashboard .cw-lesson-row.lesson-row-active.is-mastered .cw-lesson-mark { color: var(--ar-on-primary); }
#view-dashboard .cw-lesson-title { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
#view-dashboard .cw-lesson-row.hidden, #view-dashboard .cw-unit.hidden { display: none; }

/* stage + page heads */
#view-dashboard .cw-stage { padding-top: 30px; }
#view-dashboard .cw-page { animation: cwIn .35s var(--ar-ease) both; }
@keyframes cwIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#view-dashboard .cw-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
#view-dashboard .cw-page-head h2 { font-family: var(--ar-serif); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0 0 6px; letter-spacing: -.01em; }
#view-dashboard .cw-page-head p { margin: 0; max-width: 560px; font-size: 15px; line-height: 1.55; color: var(--ar-muted); }
#view-dashboard .cw-section { margin-top: 36px; }
#view-dashboard .cw-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
#view-dashboard .cw-section-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; }
#view-dashboard .cw-subhead { margin: 34px 0 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ar-muted); }
#view-dashboard .cw .ar-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ar-ink); }
@media (max-width: 760px) { #view-dashboard .cw .cw-section-head .ar-link { min-height: 40px; padding: 0 2px; } }
#view-dashboard .cw .ar-link svg { width: 15px; height: 15px; transition: transform .15s; }
#view-dashboard .cw .ar-link:hover svg { transform: translateX(2px); }
#view-dashboard .cw-quiet { margin: 0; padding: 18px; font-size: 14px; line-height: 1.55; color: var(--ar-muted); }
#view-dashboard .cw-quiet-sm { margin: 0; font-size: 12.5px; color: var(--ar-faint); }

/* overview hero */
#view-dashboard .cw-hero {
    position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px;
    padding: 36px 40px 56px; border-radius: 20px; background: #161616; color: #EEEEEA;
}
html[data-theme="dark"] #view-dashboard .cw-hero { background: #1B1B1A; box-shadow: inset 0 0 0 1px #2A2A28; }
#view-dashboard .cw-hero-copy { position: relative; z-index: 1; max-width: 560px; }
#view-dashboard .cw-hero-eyebrow { margin: 0 0 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #9A9A95; }
#view-dashboard .cw .cw-hero h2 { margin: 0 0 10px; font-family: var(--ar-serif); font-weight: 400; font-size: clamp(28px, 3vw, 38px); line-height: 1.1; color: #F4F4F0; }
#view-dashboard .cw-hero-copy > p { margin: 0; font-size: 15px; line-height: 1.6; color: #B4B4AF; }
#view-dashboard .cw-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
#view-dashboard .cw .cw-hero-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; background: #F4F4F0; color: #161616; font-size: 14px; font-weight: 600; transition: transform .15s, background .15s; }
#view-dashboard .cw .cw-hero-btn:hover { background: #fff; transform: translateY(-1px); }
#view-dashboard .cw .cw-hero-btn svg { width: 16px; height: 16px; }
#view-dashboard .cw .cw-hero-ghost { height: 42px; padding: 0 16px; border-radius: 10px; color: #EEEEEA; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); font-size: 14px; font-weight: 500; }
#view-dashboard .cw .cw-hero-ghost:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
#view-dashboard .cw-ring { position: relative; z-index: 1; width: 128px; height: 128px; }
#view-dashboard .cw-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#view-dashboard .cw-ring circle { fill: none; stroke-width: 5; }
#view-dashboard .cw-ring-track { stroke: rgba(255,255,255,.1); }
#view-dashboard .cw-ring-fill { stroke: var(--ar-accent); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ar-ease); }
#view-dashboard .cw-ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
#view-dashboard .cw-ring strong { font-family: var(--ar-serif); font-weight: 400; font-size: 30px; line-height: 1; color: #F4F4F0; }
#view-dashboard .cw-ring em { font-style: normal; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #8F8F8A; margin-top: 4px; }
#view-dashboard .cw-hero-terrain { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 64px; pointer-events: none; }

/* cards: quick links + generator choices */
#view-dashboard .cw-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
#view-dashboard .cw-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
#view-dashboard .cw .cw-quick-card,
#view-dashboard .cw .cw-choice {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px 20px 20px; text-align: left;
    background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; transition: border-color .15s, transform .15s, box-shadow .15s;
}
#view-dashboard .cw .cw-quick-card:hover,
#view-dashboard .cw .cw-choice:hover { border-color: var(--ar-line-strong); transform: translateY(-2px); box-shadow: var(--ar-shadow-md); }
#view-dashboard .cw-choice-ic { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 10px; border-radius: 11px; background: var(--ar-tile); color: var(--ar-ink); }
#view-dashboard .cw-choice-ic svg { width: 18px; height: 18px; }
#view-dashboard :is(.cw-quick-card, .cw-choice) strong { font-size: 15px; font-weight: 600; }
#view-dashboard :is(.cw-quick-card, .cw-choice) > span:not(.cw-choice-ic) { font-size: 13.5px; line-height: 1.45; color: var(--ar-muted); }
#view-dashboard .cw-choice em { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-style: normal; font-size: 13px; font-weight: 600; color: var(--ar-ink); }
#view-dashboard .cw-choice em svg { width: 14px; height: 14px; transition: transform .15s; }
#view-dashboard .cw-choice:hover em svg { transform: translateX(3px); }
#view-dashboard .cw-quick-card.is-award .cw-choice-ic { background: var(--ar-accent-soft); color: var(--ar-accent); }

/* lists */
#view-dashboard .cw-list { background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; overflow: hidden; }
#view-dashboard .cw-list:empty { display: none; }
#view-dashboard .cw .cw-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; text-align: left; transition: background .15s; }
#view-dashboard .cw .cw-row + .cw-row { border-top: 1px solid var(--ar-line-hair); }
#view-dashboard .cw .cw-row:hover:not(:disabled) { background: var(--ar-panel); }
#view-dashboard .cw .cw-row:disabled { opacity: .55; }
#view-dashboard .cw-row-day { display: grid; justify-items: center; width: 42px; flex-shrink: 0; line-height: 1; }
#view-dashboard .cw-row-day em { font-style: normal; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ar-faint); }
#view-dashboard .cw-row-day strong { font-family: var(--ar-serif); font-weight: 400; font-size: 22px; margin-top: 3px; }
#view-dashboard .cw-row-ic { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--ar-tile); }
#view-dashboard .cw-row-ic svg { width: 17px; height: 17px; }
#view-dashboard .cw-row-copy { flex: 1; min-width: 0; display: grid; gap: 3px; }
#view-dashboard .cw-row-copy strong { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-dashboard .cw-row-copy em { font-style: normal; font-size: 13px; color: var(--ar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-dashboard .cw-row-copy em:empty { display: none; }
#view-dashboard .cw-row-chev { width: 16px; height: 16px; color: var(--ar-faint); }
#view-dashboard .cw-row-lock svg { width: 15px; height: 15px; color: var(--ar-faint); }
#view-dashboard .ar-chip-new { background: var(--ar-accent-soft); color: var(--ar-accent); border-color: transparent; }

/* exams feature */
#view-dashboard .cw-feature { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 24px 26px; border-radius: 16px; background: var(--ar-panel); border: 1px solid var(--ar-line); }
#view-dashboard .cw-feature h3 { margin: 4px 0 6px; font-family: var(--ar-serif); font-weight: 400; font-size: 26px; }
#view-dashboard .cw-feature p:not(.ar-eyebrow) { margin: 0; max-width: 520px; font-size: 14px; line-height: 1.55; color: var(--ar-muted); }
#view-dashboard .cw-feature .ar-btn svg, #view-dashboard .cw-page-head .ar-btn svg { width: 15px; height: 15px; }

/* progress stats */
#view-dashboard .cw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
#view-dashboard .cw-stats > div { padding: 20px 22px; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; }
#view-dashboard .cw-stats strong { display: block; font-family: var(--ar-serif); font-weight: 400; font-size: 36px; line-height: 1; }
#view-dashboard .cw-stats small { font-size: 18px; color: var(--ar-faint); }
#view-dashboard .cw-stats span { display: block; margin-top: 8px; font-size: 13px; color: var(--ar-muted); }

/* toolkit */
#view-dashboard .cw-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#view-dashboard .cw-tool { padding: 20px 22px; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; }
#view-dashboard .cw-tool .cw-list { border: 0; border-radius: 0; margin: 0 -22px; background: transparent; }
#view-dashboard .cw-tool .cw-quiet { padding: 0; }
#view-dashboard .cw-tool-actions { display: flex; gap: 8px; margin-top: 16px; }
#view-dashboard .cw-timer-face { margin: 18px 0 4px; font-family: var(--ar-mono); font-size: 54px; font-weight: 400; letter-spacing: -.02em; line-height: 1; }
#view-dashboard .cw-textarea {
    display: block; width: 100%; padding: 12px 14px; resize: vertical; border: 1px solid transparent !important; border-radius: 12px;
    background: var(--ar-field) !important; color: var(--ar-ink) !important; font: 14.5px/1.6 var(--ar-sans); box-shadow: none !important; outline: none;
}
#view-dashboard .cw-textarea:focus { border-color: var(--ar-line-strong) !important; background: var(--ar-card) !important; }

/* settings */
#view-dashboard .cw-settings { display: grid; gap: 28px; max-width: 760px; }
#view-dashboard .cw-setting-group h3 { margin: 0 0 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ar-muted); }
#view-dashboard .cw-setting-group { display: flex; flex-direction: column; }
#view-dashboard .cw-setting-group > :is(.cw-setting-row) { background: var(--ar-card); border: 1px solid var(--ar-line); border-top-width: 0; }
#view-dashboard .cw-setting-group > h3 + .cw-setting-row { border-top-width: 1px; border-radius: 14px 14px 0 0; }
#view-dashboard .cw-setting-group > .cw-setting-row:last-child { border-radius: 0 0 14px 14px; }
#view-dashboard .cw-setting-group > h3 + .cw-setting-row:last-child { border-radius: 14px; }
#view-dashboard .cw .cw-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 16px 20px; text-align: left; }
#view-dashboard .cw button.cw-setting-row:hover { background: var(--ar-panel); }
#view-dashboard .cw-setting-row > span { display: grid; gap: 3px; min-width: 0; }
#view-dashboard .cw-setting-row strong { font-size: 14.5px; font-weight: 500; }
#view-dashboard .cw-setting-row em { font-style: normal; font-size: 13px; color: var(--ar-muted); }
#view-dashboard .cw-select { height: 36px; padding: 0 32px 0 12px; border: 0 !important; border-radius: 9px; background-color: var(--ar-field) !important; color: var(--ar-ink) !important; font: 500 14px var(--ar-sans); box-shadow: none !important; }
#view-dashboard .cw-segment { display: inline-flex; flex-shrink: 0; padding: 3px; border-radius: 10px; background: var(--ar-field); }
#view-dashboard .cw .cw-segment button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ar-muted); }
#view-dashboard .cw .cw-segment button.active { background: var(--ar-card); color: var(--ar-ink); box-shadow: var(--ar-shadow-sm); }
#view-dashboard .os-action-output:not(.hidden) { padding: 16px 20px; border-radius: 14px; background: var(--ar-panel); border: 1px solid var(--ar-line); font-size: 14px; color: var(--ar-ink-soft); }

/* schedule */
#view-dashboard .cw-sched-summary { max-width: 420px; margin-bottom: 18px; }
#view-dashboard .cw-sched-summary p { margin: 8px 0 0; font-size: 13px; color: var(--ar-muted); }
#view-dashboard .cw-days { list-style: none; margin: 0; padding: 0; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; overflow: hidden; }
#view-dashboard .cw-day { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; padding: 18px 22px; }
#view-dashboard .cw-day + .cw-day { border-top: 1px solid var(--ar-line-hair); }
#view-dashboard .cw-day-label strong { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; }
#view-dashboard .cw-day-label span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ar-muted); }
#view-dashboard .cw-day.is-today { background: var(--ar-panel); }
#view-dashboard .cw-day.is-today .cw-day-label strong::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ar-accent); }
#view-dashboard .cw-day.is-done .cw-day-label { opacity: .55; }
#view-dashboard .cw-day-tasks { display: grid; gap: 10px; }
#view-dashboard .cw-task { display: flex; align-items: center; gap: 12px; min-width: 0; }
#view-dashboard .cw .cw-check { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--ar-line-strong); color: var(--ar-on-primary); transition: border-color .15s, background .15s; }
#view-dashboard .cw .cw-check svg { width: 12px; height: 12px; stroke-width: 2.4; opacity: 0; transition: opacity .15s; }
#view-dashboard .cw button.cw-check:hover { border-color: var(--ar-ink); }
#view-dashboard .cw button.cw-check:hover svg { opacity: .35; color: var(--ar-ink); }
#view-dashboard .cw .cw-check.is-on { background: var(--ar-ink); border-color: var(--ar-ink); }
#view-dashboard .cw .cw-check.is-on svg { opacity: 1; }
#view-dashboard .cw-task-copy { min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-dashboard .cw-task-copy strong { font-weight: 500; }
#view-dashboard .cw-task-copy em { font-style: normal; color: var(--ar-muted); margin-left: 8px; }
#view-dashboard .cw-task.is-done .cw-task-copy { color: var(--ar-faint); }
#view-dashboard .cw-task.is-done .cw-task-copy strong { text-decoration: line-through; text-decoration-color: var(--ar-line-strong); }

/* empty + preparing */
#view-dashboard .cw-empty { padding: 56px 24px; text-align: center; background: var(--ar-card); border: 1px dashed var(--ar-line-strong); border-radius: 16px; }
#view-dashboard .cw-empty strong { display: block; font-family: var(--ar-serif); font-weight: 400; font-size: 26px; }
#view-dashboard .cw-empty p { margin: 8px auto 0; max-width: 420px; font-size: 14.5px; line-height: 1.55; color: var(--ar-muted); }
#view-dashboard .cw-preparing { display: flex; align-items: center; gap: 16px; padding: 24px; border-radius: 16px; background: var(--ar-panel); border: 1px solid var(--ar-line); }
#view-dashboard .cw-preparing strong { font-size: 15px; font-weight: 600; }
#view-dashboard .cw-preparing p { margin: 4px 0 0 !important; font-size: 13.5px !important; color: var(--ar-muted) !important; }
#view-dashboard .cw-spinner { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--ar-track); border-top-color: var(--ar-ink); animation: cwSpin .8s linear infinite; }
@keyframes cwSpin { to { transform: rotate(360deg); } }

/* ---- lesson reader ---- */

#view-dashboard .cw-reader { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 56px; align-items: start; }
#view-dashboard .cw-read { min-width: 0; max-width: 720px; }
#view-dashboard .cw-read-head { padding-bottom: 26px; margin-bottom: 30px; border-bottom: 1px solid var(--ar-line-solid); }
#view-dashboard .cw .cw-read-head h1 { margin: 10px 0 12px; font-family: var(--ar-serif); font-weight: 400; font-size: clamp(34px, 3.6vw, 48px); line-height: 1.06; letter-spacing: -.015em; }
#view-dashboard .cw-read-sum { margin: 0; font-size: 17.5px; line-height: 1.6; color: var(--ar-muted); }
#view-dashboard .cw-read-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
#view-dashboard .cw .cw-tool-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--ar-line-strong); background: var(--ar-card); font-size: 13px; font-weight: 500; color: var(--ar-ink-soft); transition: border-color .15s, color .15s; }
#view-dashboard .cw .cw-tool-btn:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
#view-dashboard .cw .cw-tool-btn svg { width: 15px; height: 15px; }
#view-dashboard .cw .lesson-explain-output:not(.hidden) { margin-bottom: 28px; padding: 18px 20px; border-radius: 14px; background: var(--ar-panel); border: 1px solid var(--ar-line); font-size: 15px; line-height: 1.65; }

html body #view-dashboard .cw-prose { font-family: var(--ar-sans); font-size: 17px; line-height: 1.78; color: var(--ar-ink-soft); max-width: none; }
html body #view-dashboard .cw-prose > :first-child { margin-top: 0; }
html body #view-dashboard .cw-prose :is(h1, h2) { margin: 2.1em 0 .55em; font-family: var(--ar-serif); font-weight: 400; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; color: var(--ar-ink); scroll-margin-top: 140px; border: 0; padding: 0; }
html body #view-dashboard .cw-prose h3 { margin: 1.8em 0 .45em; font-family: var(--ar-sans); font-size: 19px; font-weight: 600; line-height: 1.35; color: var(--ar-ink); scroll-margin-top: 140px; }
html body #view-dashboard .cw-prose h4 { margin: 1.5em 0 .4em; font-size: 16px; font-weight: 600; color: var(--ar-ink); }
html body #view-dashboard .cw-prose p { margin: 0 0 1.15em; }
html body #view-dashboard .cw-prose :is(ul, ol) { margin: 0 0 1.2em; padding-left: 1.35em; }
html body #view-dashboard .cw-prose ul { list-style: disc; }
html body #view-dashboard .cw-prose ol { list-style: decimal; }
html body #view-dashboard .cw-prose li { display: list-item; }
html body #view-dashboard .cw-prose li { margin: .4em 0; padding-left: .2em; }
html body #view-dashboard .cw-prose li::marker { color: var(--ar-faint); }
html body #view-dashboard .cw-prose strong { color: var(--ar-ink); font-weight: 600; }
html body #view-dashboard .cw-prose a { color: var(--ar-ink); text-decoration: underline; text-decoration-color: var(--ar-accent); text-underline-offset: 3px; }
html body #view-dashboard .cw-prose code { font-family: var(--ar-mono); font-size: .86em; padding: .12em .38em; border-radius: 6px; background: var(--ar-tile); color: var(--ar-ink); }
html body #view-dashboard .cw-prose pre { margin: 0 0 1.3em; padding: 16px 18px; overflow-x: auto; border-radius: 12px; background: var(--ar-tile); font-size: 14px; line-height: 1.6; }
html body #view-dashboard .cw-prose pre code { padding: 0; background: none; }
html body #view-dashboard .cw-prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--ar-accent); color: var(--ar-ink-soft); font-style: normal; background: none; }
html body #view-dashboard .cw-prose table { width: 100%; margin: 0 0 1.3em; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
html body #view-dashboard .cw-prose :is(th, td) { padding: 10px 12px; border-bottom: 1px solid var(--ar-line-solid); text-align: left; }
html body #view-dashboard .cw-prose th { font-weight: 600; color: var(--ar-ink); }
html body #view-dashboard .cw-prose hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--ar-line-solid); }
html body #view-dashboard .cw-prose img { max-width: 100%; border-radius: 12px; }
html body.reader-text-large #view-dashboard .cw-prose { font-size: 19px; }
html body.reader-text-small #view-dashboard .cw-prose { font-size: 15.5px; }
html body.reader-density-compact #view-dashboard .cw-prose { line-height: 1.6; }

#view-dashboard .cw-block { margin-top: 52px; }
#view-dashboard .cw .cw-block-title { margin: 0 0 14px; font-family: var(--ar-serif); font-weight: 400; font-size: 28px; }
#view-dashboard .cw-example { padding: 20px 22px; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; }
#view-dashboard .cw-example + .cw-example { margin-top: 12px; }
#view-dashboard .cw .cw-example h4 { margin: 0 0 8px; font-size: 15.5px; font-weight: 600; }
#view-dashboard .cw-example p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--ar-ink-soft); }
#view-dashboard .cw-example details { margin-top: 14px; }
#view-dashboard .cw-example summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; font-weight: 600; list-style: none; }
#view-dashboard .cw-example summary::-webkit-details-marker { display: none; }
#view-dashboard .cw-example summary::before { content: '+'; font-family: var(--ar-mono); color: var(--ar-muted); }
#view-dashboard .cw-example details[open] summary::before { content: '–'; }
#view-dashboard .cw-example pre { margin: 12px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--ar-tile); font: 13.5px/1.65 var(--ar-mono); white-space: pre-wrap; color: var(--ar-ink); }

#view-dashboard .cw-done { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 52px; padding: 22px 24px; border-radius: 16px; background: var(--ar-panel); border: 1px solid var(--ar-line); }
#view-dashboard .cw-done strong { font-size: 16px; font-weight: 600; }
#view-dashboard .cw-done p { margin: 4px 0 0; font-size: 14px; color: var(--ar-muted); }

#view-dashboard .cw-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
#view-dashboard .cw .cw-pager-btn { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 16px 18px; text-align: left; border-radius: 14px; background: var(--ar-card); border: 1px solid var(--ar-line); transition: border-color .15s; }
#view-dashboard .cw .cw-pager-btn:hover:not(:disabled) { border-color: var(--ar-line-strong); }
#view-dashboard .cw .cw-pager-btn:disabled { opacity: .5; }
#view-dashboard .cw .cw-pager-btn.is-next { justify-content: flex-end; text-align: right; }
#view-dashboard .cw-pager-btn svg { width: 18px; height: 18px; color: var(--ar-muted); }
#view-dashboard .cw-pager-btn span { display: grid; gap: 3px; min-width: 0; }
#view-dashboard .cw-pager-btn em { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ar-faint); }
#view-dashboard .cw-pager-btn strong { font-size: 14.5px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

#view-dashboard .cw-rail { position: sticky; top: calc(var(--ar-top-h) + 72px); display: grid; gap: 14px; max-height: calc(100vh - var(--ar-top-h) - 96px); overflow-y: auto; scrollbar-width: none; }
#view-dashboard .cw-rail-card { padding: 18px 18px 20px; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; }
#view-dashboard .cw .cw-rail-card h4 { margin: 0 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ar-muted); }
#view-dashboard .cw-rail .lesson-reading-progress { height: 3px; margin-bottom: 12px; border-radius: 3px; background: var(--ar-track); overflow: hidden; }
html body #view-dashboard .cw-rail .lesson-reading-progress span { display: block; height: 100%; background: var(--ar-ink); border-radius: 3px; transition: width .2s; }
#view-dashboard .cw-rail nav { display: grid; }
html body #view-dashboard .cw-rail nav a { background: none !important; border-radius: 0 !important; margin: 0 !important; box-shadow: none !important; }
#view-dashboard .cw-rail nav a { display: block; padding: 6px 0 6px 12px; border-left: 2px solid var(--ar-line-solid); font-size: 13.5px; line-height: 1.4; color: var(--ar-muted); text-decoration: none; transition: color .15s, border-color .15s; }
#view-dashboard .cw-rail nav a:hover { color: var(--ar-ink); }
html body #view-dashboard .cw-rail nav a.active { color: var(--ar-ink); border-left-color: var(--ar-ink); font-weight: 500; }
#view-dashboard .cw-rail nav a.outline-level-3 { padding-left: 24px; font-size: 13px; }
#view-dashboard .cw-ask-form { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 11px; background: var(--ar-field); }
#view-dashboard .cw-ask-form input { flex: 1; min-width: 0; height: 34px; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none; padding: 0 !important; font-size: 13.5px; color: var(--ar-ink); }
#view-dashboard .cw .cw-ask-form button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--ar-primary); color: var(--ar-on-primary); }
#view-dashboard .cw-ask-form button svg { width: 15px; height: 15px; }
#view-dashboard .cw-ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#view-dashboard .cw .cw-ask-chips button { height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--ar-line-strong); font-size: 12.5px; color: var(--ar-ink-soft); }
#view-dashboard .cw .cw-ask-chips button:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
#view-dashboard .cw-note { min-height: 110px; font-size: 13.5px; }
#view-dashboard .cw-note-state { margin-top: 8px; }

/* mini quiz inside the reader */
#view-dashboard .cw .mini-quiz-list { display: grid; gap: 12px; }
#view-dashboard .cw .mini-quiz-card { padding: 20px 22px; background: var(--ar-card) !important; border: 1px solid var(--ar-line) !important; border-radius: 16px !important; box-shadow: none !important; }

/* focus mode: hide chrome, keep the page */
body.focus-mode-active #view-dashboard :is(.cw-head, .cw-tabs, .cw-rail) { display: none !important; }
body.focus-mode-active #view-dashboard .cw-reader { grid-template-columns: minmax(0, 1fr); justify-items: center; }

/* responsive */
@media (max-width: 1180px) {
    #view-dashboard .cw-reader { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    #view-dashboard .cw-read { max-width: 760px; margin: 0 auto; width: 100%; }
    #view-dashboard .cw-rail { position: static; max-height: none; overflow: visible; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 760px; margin: 0 auto; width: 100%; }
    #view-dashboard .cw-rail .lesson-outline-card { display: none; }
}
@media (max-width: 760px) {
    #view-dashboard .cw-head { flex-direction: column; align-items: stretch; gap: 16px; padding-top: 8px; }
    #view-dashboard .cw-head-actions .ar-btn { flex: 1; justify-content: center; }
    #view-dashboard .cw-head-progress { max-width: none; }
    #view-dashboard .cw-tabs { margin: 0 calc(var(--ar-gutter, 16px) * -1); padding: 0 calc(var(--ar-gutter, 16px) - 12px); }
    #view-dashboard .cw-stage { padding-top: 24px; }
    #view-dashboard .cw-hero { grid-template-columns: 1fr; padding: 26px 22px 50px; gap: 20px; }
    #view-dashboard .cw-ring { display: none; }
    #view-dashboard .cw-choices, #view-dashboard .cw-tools, #view-dashboard .cw-pager { grid-template-columns: 1fr; }
    #view-dashboard .cw-stats { gap: 10px; }
    #view-dashboard .cw-stats > div { padding: 16px; }
    #view-dashboard .cw-stats strong { font-size: 28px; }
    #view-dashboard .cw-page-head, #view-dashboard .cw-feature, #view-dashboard .cw-done { flex-direction: column; align-items: flex-start; }
    #view-dashboard .cw-day { grid-template-columns: 1fr; gap: 10px; padding: 16px 18px; }
    #view-dashboard .cw-setting-row:not(button) { flex-wrap: wrap; }
    html body #view-dashboard .cw-prose { font-size: 16.5px; }
}

/* in-lesson check questions */
#view-dashboard .cw-mq-list { display: grid; gap: 12px; }
#view-dashboard .cw-mq { padding: 20px 22px; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; }
#view-dashboard .cw-mq-q { display: flex; gap: 12px; margin: 0 0 14px; font-size: 15.5px; font-weight: 500; line-height: 1.5; color: var(--ar-ink); }
#view-dashboard .cw-mq-q span { font-family: var(--ar-mono); font-size: 12px; color: var(--ar-faint); padding-top: 3px; }
#view-dashboard .cw-mq-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#view-dashboard .cw .cw-mq-opt { display: flex; align-items: center; gap: 12px; padding: 11px 14px; text-align: left; border-radius: 11px; border: 1px solid var(--ar-line-strong); background: var(--ar-card); font-size: 14.5px; color: var(--ar-ink-soft); transition: border-color .15s, background .15s; }
#view-dashboard .cw .cw-mq-opt:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
#view-dashboard .cw-mq-opt b { display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; background: var(--ar-tile); font: 600 11.5px var(--ar-mono); color: var(--ar-muted); }
#view-dashboard .cw .cw-mq-opt.is-correct { border-color: var(--ar-success); background: var(--ar-success-soft); color: var(--ar-ink); }
#view-dashboard .cw-mq-opt.is-correct b { background: var(--ar-success); color: #fff; }
#view-dashboard .cw .cw-mq-opt.is-wrong { border-color: var(--ar-danger); background: var(--ar-danger-soft); }
#view-dashboard .cw-mq-opt.is-wrong b { background: var(--ar-danger); color: #fff; }
#view-dashboard .cw-mq.is-answered .cw-mq-opt:not(.is-correct):not(.is-wrong) { opacity: .55; }
#view-dashboard .cw-mq-feedback { margin: 12px 0 0; font-size: 13px; color: var(--ar-muted); }
#view-dashboard .cw-mq-feedback.is-right { color: var(--ar-success); font-weight: 600; }
#view-dashboard .cw-mq-feedback.is-off { color: var(--ar-danger); font-weight: 600; }
#view-dashboard .cw-mq-solution { margin: 8px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--ar-panel); font-size: 14px; line-height: 1.6; color: var(--ar-ink-soft); }
#view-dashboard .cw-mq-input { width: 100%; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--ar-line-strong); background: var(--ar-card); color: var(--ar-ink); }
@media (max-width: 760px) { #view-dashboard .cw-mq-opts { grid-template-columns: 1fr; } }

/* progress: mastery strip + unit rows */
#view-dashboard .weakness-heatmap, #view-dashboard .knowledge-graph-list { display: block !important; background: none !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
#view-dashboard .cw-quiet-card { background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; }
#view-dashboard .cw-mastery { padding: 20px 22px; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 16px; }
#view-dashboard .cw-cells { display: grid; grid-template-columns: repeat(auto-fill, 22px); gap: 6px; }
#view-dashboard .cw-cell { display: inline-block; width: 22px; height: 22px; border-radius: 6px; background: var(--ar-track); }
#view-dashboard .cw-cell.is-strong { background: var(--ar-ink); }
#view-dashboard .cw-cell.is-done { background: color-mix(in srgb, var(--ar-ink) 45%, var(--ar-track)); }
#view-dashboard .cw-cell.is-watch { background: color-mix(in srgb, var(--ar-accent) 45%, var(--ar-track)); }
#view-dashboard .cw-cell.is-weak { background: var(--ar-accent); }
#view-dashboard .cw-cell.is-rest { background: transparent; box-shadow: inset 0 0 0 1px var(--ar-line-strong); }
#view-dashboard .cw-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 12.5px; color: var(--ar-muted); }
#view-dashboard .cw-legend span { display: inline-flex; align-items: center; gap: 6px; }
#view-dashboard .cw-legend .cw-cell { width: 10px; height: 10px; border-radius: 3px; }
#view-dashboard .cw-mastery-note { margin: 12px 0 0; font-size: 13px; color: var(--ar-muted); }
#view-dashboard .cw-weak { margin-top: 24px; }
#view-dashboard .cw-unit-progress .cw-row-copy { gap: 8px; }
#view-dashboard .cw-unit-progress .ar-progress-row { max-width: 360px; }
#view-dashboard .cw-tool .cw-list > .cw-quiet { padding: 0 22px; }
#view-dashboard .cw-tool .cw-list .cw-row { padding-left: 22px; padding-right: 22px; }
#view-dashboard .cw-select { width: auto !important; min-width: 150px; flex-shrink: 0; }
/* Let the lesson drawer escape the view's stacking context so it covers the shell. */
html body #view-dashboard { isolation: auto !important; }
html body #view-dashboard .dashboard-shell { z-index: auto !important; }
#view-dashboard .cw-tabs { z-index: 20; }
@media (max-width: 760px) {
    #view-dashboard .cw-quick { grid-template-columns: 1fr 1fr; gap: 10px; }
    #view-dashboard .cw .cw-quick-card { padding: 14px 16px; }
    #view-dashboard .cw-quick-card > span:not(.cw-choice-ic) { display: none; }
    #view-dashboard .cw-quick-card .cw-choice-ic { width: 32px; height: 32px; margin-bottom: 8px; }
}

/* ---------- 15. QUIZ / EXAM RUNNER (qr-*) ---------- */
#view-dashboard .qr { max-width: 1080px; margin: 0 auto; }

#view-dashboard .qr-top { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; }
#view-dashboard .qr-top-copy { flex: 1; min-width: 0; }
#view-dashboard .cw .qr-top h1 { margin: 4px 0 0; font-family: var(--ar-serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; overflow-wrap: anywhere; }
#view-dashboard .cw .qr-icon-btn { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; border: 1px solid var(--ar-line-strong); background: var(--ar-card); color: var(--ar-ink); }
#view-dashboard .cw .qr-icon-btn:hover { border-color: var(--ar-ink); }
#view-dashboard .qr-icon-btn svg { width: 18px; height: 18px; }
#view-dashboard .qr-timer { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 11px; background: var(--ar-primary); color: var(--ar-on-primary); font: 500 16px var(--ar-mono); letter-spacing: .02em; }
#view-dashboard .qr-timer svg { width: 16px; height: 16px; opacity: .7; }
#view-dashboard .qr-timer:has(.is-low) { background: var(--ar-danger); color: #fff; }
#view-dashboard .qr-progress { display: flex; align-items: center; gap: 14px; padding: 0 0 22px; border-bottom: 1px solid var(--ar-line-solid); margin-bottom: 28px; }
#view-dashboard .qr-progress .ar-bar { max-width: none; }
#view-dashboard .qr-progress .ar-bar i { transition: width .4s var(--ar-ease); animation: none; }
#view-dashboard .qr-progress span { flex-shrink: 0; font-size: 13px; color: var(--ar-muted); }
#view-dashboard .qr-instructions { margin: -8px 0 24px; padding: 14px 18px; border-radius: 14px; background: var(--ar-panel); border: 1px solid var(--ar-line); font-size: 14px; color: var(--ar-ink-soft); }
#view-dashboard .qr-instructions summary { cursor: pointer; font-weight: 600; color: var(--ar-ink); }
#view-dashboard .qr-instructions ol { margin: 10px 0 0; padding-left: 1.2em; list-style: decimal; display: grid; gap: 4px; }

body.assessment-focus-mode #view-dashboard .qr-nav { top: calc(var(--ar-top-h) + 24px); }
#view-dashboard .qr-result:not(.hidden) ~ * , #view-dashboard .qr-body:has(.qr-result:not(.hidden)) { grid-template-columns: minmax(0, 1fr); }
#view-dashboard .qr-body { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 40px; align-items: start; }
#view-dashboard .qr-form { display: grid; gap: 16px; min-width: 0; }
#view-dashboard .qr-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
#view-dashboard .qr-section + .qr-section { margin-top: 24px; }
#view-dashboard .qr-section-head span { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ar-muted); }
#view-dashboard .cw .qr-section-head h2 { margin: 4px 0 2px; font-family: var(--ar-serif); font-weight: 400; font-size: 26px; }
#view-dashboard .qr-section-head em { font-style: normal; font-size: 13px; color: var(--ar-muted); }

#view-dashboard .qr-q, #view-dashboard .qr-rq { min-width: 0; margin: 0; padding: 22px 24px 24px; border-radius: 18px; background: var(--ar-card); border: 1px solid var(--ar-line); scroll-margin-top: 140px; transition: border-color .2s; }
#view-dashboard .qr-q-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; margin-bottom: 12px; float: left; }
#view-dashboard .qr-q-head + * { clear: both; }
#view-dashboard .qr-q-num { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ar-muted); }
#view-dashboard .qr-q-marks { font: 500 11.5px var(--ar-mono); color: var(--ar-faint); }
#view-dashboard .cw .qr-flag { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--ar-muted); }
#view-dashboard .cw .qr-flag:hover { background: var(--ar-hover); color: var(--ar-ink); }
#view-dashboard .qr-flag svg { width: 14px; height: 14px; }
#view-dashboard .cw .qr-flag.is-flagged { color: var(--ar-accent); background: var(--ar-accent-soft); }
#view-dashboard .cw .qr-flag.is-flagged svg { fill: currentColor; }
html body #view-dashboard .qr-q-text { font-size: 16.5px; line-height: 1.65; color: var(--ar-ink); margin-bottom: 18px; }
html body #view-dashboard .qr-q-text p:last-child { margin-bottom: 0; }

#view-dashboard .qr-opts { display: grid; gap: 8px; }
#view-dashboard .qr-opt { position: relative; display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--ar-line-strong); cursor: pointer; font-size: 15px; line-height: 1.5; color: var(--ar-ink-soft); transition: border-color .15s, background .15s; }
#view-dashboard .qr-opt:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
#view-dashboard .qr-opt input { position: absolute; opacity: 0; pointer-events: none; }
#view-dashboard .qr-opt b { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: var(--ar-tile); font: 600 12px var(--ar-mono); color: var(--ar-muted); transition: background .15s, color .15s; }
#view-dashboard .qr-opt.is-selected, #view-dashboard .qr-opt:has(input:checked) { border-color: var(--ar-ink); background: var(--ar-panel); color: var(--ar-ink); box-shadow: inset 0 0 0 1px var(--ar-ink); }
#view-dashboard .qr-opt.is-selected b, #view-dashboard .qr-opt:has(input:checked) b { background: var(--ar-primary); color: var(--ar-on-primary); }
#view-dashboard .qr-opt:has(input:focus-visible) { outline: 2px solid var(--ar-accent); outline-offset: 2px; }
#view-dashboard .qr-answer { display: block; width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--ar-line-strong) !important; background: var(--ar-card) !important; color: var(--ar-ink) !important; font: 15px/1.65 var(--ar-sans); resize: vertical; box-shadow: none !important; outline: none; }
#view-dashboard .qr-answer:focus { border-color: var(--ar-ink) !important; box-shadow: 0 0 0 3px var(--ar-hover) !important; }
#view-dashboard .qr-answer-line { height: 48px; max-width: 420px; }
#view-dashboard .qr-match { display: grid; gap: 8px; }
#view-dashboard .qr-match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--ar-panel); }
#view-dashboard .qr-match-row strong { font-size: 14.5px; font-weight: 500; }
#view-dashboard .qr-match-select { height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--ar-line-strong); background: var(--ar-card); color: var(--ar-ink); font: 14px var(--ar-sans); }
#view-dashboard .qr .question-graph { margin: 0 0 18px; padding: 12px; border-radius: 12px; background: var(--ar-panel); overflow-x: auto; }

#view-dashboard .qr-submit-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 8px; padding: 22px 24px; border-radius: 18px; background: var(--ar-panel); border: 1px dashed var(--ar-line-strong); }
#view-dashboard .qr-submit-card strong { font-size: 16px; font-weight: 600; }
#view-dashboard .qr-submit-card p { margin: 3px 0 0; font-size: 14px; color: var(--ar-muted); }

#view-dashboard .qr-nav { position: sticky; top: calc(var(--ar-top-h) + 72px); padding: 18px; border-radius: 18px; background: var(--ar-card); border: 1px solid var(--ar-line); }
#view-dashboard .qr-nav-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
#view-dashboard .qr-nav-head strong { font-size: 14px; font-weight: 600; }
#view-dashboard .qr-nav-head span { font-size: 12px; color: var(--ar-muted); }
#view-dashboard .qr-nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 50vh; overflow-y: auto; }
#view-dashboard .cw .qr-chip { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--ar-line-strong); font: 500 12.5px var(--ar-mono); color: var(--ar-muted); transition: background .15s, border-color .15s, color .15s; }
#view-dashboard .cw .qr-chip:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
#view-dashboard .cw .qr-chip.is-answered { background: var(--ar-primary); border-color: var(--ar-primary); color: var(--ar-on-primary); }
#view-dashboard .cw .qr-chip.is-current { box-shadow: 0 0 0 2px var(--ar-page), 0 0 0 3.5px var(--ar-ink); }
#view-dashboard .cw .qr-chip.is-flagged::after { content: ''; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--ar-accent); border: 2px solid var(--ar-card); }
#view-dashboard .qr-nav-legend { display: flex; gap: 14px; margin: 14px 0 16px; font-size: 12px; color: var(--ar-muted); }
#view-dashboard .qr-nav-legend span { display: inline-flex; align-items: center; gap: 6px; }
#view-dashboard .qr-nav-legend i { width: 9px; height: 9px; border-radius: 3px; }
#view-dashboard .qr-nav-legend i.is-answered { background: var(--ar-primary); }
#view-dashboard .qr-nav-legend i.is-flagged { background: var(--ar-accent); border-radius: 50%; }

/* score + review */
#view-dashboard .qr-result:not(.hidden) { display: grid; gap: 14px; }
#view-dashboard .qr-score { display: flex; align-items: center; gap: 32px; padding: 28px 32px; border-radius: 20px; background: var(--ar-card); border: 1px solid var(--ar-line); }
#view-dashboard .qr-review .qr-score { margin-bottom: 14px; }
#view-dashboard .qr-ring { position: relative; flex-shrink: 0; }
#view-dashboard .qr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#view-dashboard .qr-ring circle { fill: none; stroke-width: 7; }
#view-dashboard .qr-ring-track { stroke: var(--ar-track); }
#view-dashboard .qr-ring-fill { stroke: var(--ar-ink); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ar-ease); }
#view-dashboard .qr-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; font-family: var(--ar-serif); font-size: 34px; color: var(--ar-ink); }
#view-dashboard .qr-ring small { font-size: 16px; color: var(--ar-muted); }
#view-dashboard .qr-score-copy { min-width: 0; }
#view-dashboard .cw .qr-score h2 { margin: 6px 0 6px; font-family: var(--ar-serif); font-weight: 400; font-size: 32px; line-height: 1.1; }
#view-dashboard .qr-score-copy > p:not(.ar-eyebrow) { margin: 0; font-size: 14.5px; color: var(--ar-muted); }
#view-dashboard .qr-score-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
#view-dashboard .qr-sections .ar-progress-row { max-width: 320px; }
#view-dashboard .qr-sections .cw-row-copy { gap: 8px; }
#view-dashboard .qr-review-list { display: grid; gap: 14px; }
#view-dashboard .qr-review-section { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--ar-muted); }
#view-dashboard .qr-rq { border-left: 3px solid var(--ar-success); }
#view-dashboard .qr-rq.is-off { border-left-color: var(--ar-accent); }
#view-dashboard .qr-rq-mark { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px 10px; border-radius: 99px; font: 600 12px var(--ar-mono); background: var(--ar-accent-soft); color: var(--ar-accent); }
#view-dashboard .qr-rq.is-right .qr-rq-mark { background: var(--ar-success-soft); color: var(--ar-success); }
#view-dashboard .qr-rq-mark svg { width: 13px; height: 13px; stroke-width: 2.4; }
#view-dashboard .qr-rq-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#view-dashboard .qr-rq-answers > div { padding: 14px 16px; border-radius: 12px; background: var(--ar-panel); min-width: 0; }
#view-dashboard .qr-rq-answers span { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ar-muted); }
#view-dashboard .qr-rq-answers p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ar-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
html body #view-dashboard .qr-rq-answers .cw-prose { font-size: 15px; line-height: 1.6; }
html body #view-dashboard .qr-rq-feedback { margin-top: 12px; padding: 2px 0 0 14px; border-left: 2px solid var(--ar-line-strong); font-size: 14.5px; line-height: 1.65; color: var(--ar-ink-soft); }
#view-dashboard .qr-rq-scheme { margin-top: 12px; font-size: 13.5px; }
#view-dashboard .qr-rq-scheme summary { cursor: pointer; font-weight: 600; color: var(--ar-ink); }
#view-dashboard .qr-rq-scheme ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
#view-dashboard .qr-rq-scheme li { display: flex; justify-content: space-between; gap: 14px; padding: 8px 12px; border-radius: 9px; background: var(--ar-panel); color: var(--ar-ink-soft); }
#view-dashboard .qr-rq-scheme b { font-family: var(--ar-mono); font-weight: 500; }

/* distraction-free while a quiz is running */
body.assessment-focus-mode #view-dashboard :is(.cw-head, .cw-tabs) { display: none !important; }
body.assessment-focus-mode #view-dashboard .cw-stage { padding-top: 6px; }

@media (max-width: 960px) {
    #view-dashboard .qr-body { grid-template-columns: minmax(0, 1fr); }
    #view-dashboard .qr-progress { flex-wrap: wrap; gap: 8px; }
    #view-dashboard .qr-progress .ar-bar { flex: 1 0 100%; }
    #view-dashboard .qr-progress span { flex-shrink: 1; }
    #view-dashboard .qr-nav { position: sticky; top: auto; bottom: 12px; order: 2; z-index: 15; padding: 12px; box-shadow: var(--ar-shadow-lg); }
    #view-dashboard .qr-nav-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 38px; overflow-x: auto; max-height: none; padding: 4px 2px; }
    #view-dashboard .qr-nav-legend { display: none; }
    #view-dashboard .qr-nav-head { margin-bottom: 8px; }
    #view-dashboard .qr-nav .qr-submit { height: 40px; margin-top: 10px; }
}
@media (max-width: 760px) {
    #view-dashboard .qr-top { flex-wrap: wrap; }
    #view-dashboard .qr-top-copy { order: 3; flex-basis: 100%; }
    #view-dashboard .qr-timer { margin-left: auto; }
    #view-dashboard .qr-q, #view-dashboard .qr-rq { padding: 18px 16px 20px; border-radius: 16px; }
    #view-dashboard .qr-score { flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px; }
    #view-dashboard .qr-rq-answers { grid-template-columns: 1fr; }
    #view-dashboard .qr-submit-card { flex-direction: column; align-items: stretch; }
    #view-dashboard .qr-match-row { grid-template-columns: 1fr; }
}
#view-dashboard .qr-timer:has(.is-low) { background: var(--ar-danger); color: #fff; }
#view-dashboard .qr-part { display: grid; gap: 8px; margin-top: 12px; }
#view-dashboard .qr-part-head { display: flex; gap: 10px; align-items: baseline; font-size: 15px; color: var(--ar-ink); }
#view-dashboard .qr-part-head b { font: 600 12.5px var(--ar-mono); color: var(--ar-muted); }
#view-dashboard .qr-part-head span { flex: 1; line-height: 1.55; }
#view-dashboard .qr-part-head em { font-style: normal; font: 500 11.5px var(--ar-mono); color: var(--ar-faint); white-space: nowrap; }
#view-dashboard .qr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#view-dashboard .qr-two > :only-child { grid-column: 1 / -1; }
#view-dashboard .qr-bullets { margin: 0; padding-left: 1.1em; list-style: disc; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.55; color: var(--ar-ink-soft); }
@media (max-width: 760px) { #view-dashboard .qr-two { grid-template-columns: 1fr; } }

/* ---------- 16. CERTIFICATE ---------- */
:is(#view-dashboard, #view-account) .cert-page { max-width: 980px; margin: 0 auto; }
:is(#view-dashboard, #view-account) .cert-actions { flex-wrap: wrap; margin-bottom: 8px; }
:is(#view-dashboard, #view-account) .cert {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
    aspect-ratio: 1.414; min-height: 460px; padding: clamp(28px, 5vw, 56px); border-radius: 18px;
    background: #FBFBF8; color: #161616; border: 1px solid #E2E2DD; box-shadow: var(--ar-shadow-md);
}
:is(#view-dashboard, #view-account) .cert::before { content: ''; position: absolute; inset: 14px; border: 1px solid #E7E7E2; border-radius: 10px; pointer-events: none; }
:is(#view-dashboard, #view-account) .cert-art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34%; color: #161616; pointer-events: none; }
:is(#view-dashboard, #view-account) .cert-top, :is(#view-dashboard, #view-account) .cert-body, :is(#view-dashboard, #view-account) .cert-foot { position: relative; z-index: 1; }
:is(#view-dashboard, #view-account) .cert-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
:is(#view-dashboard, #view-account) .cert-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
:is(#view-dashboard, #view-account) .cert-brand b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #161616; color: #F7F7F4; font: 400 18px var(--ar-serif); }
:is(#view-dashboard, #view-account) .cert-brand em { font-style: normal; font-weight: 400; color: #8A8A86; }
:is(#view-dashboard, #view-account) .cert-uid { font: 500 11.5px var(--ar-mono); letter-spacing: .06em; color: #6B6B68; }
:is(#view-dashboard, #view-account) .cert-body { text-align: center; }
:is(#view-dashboard, #view-account) .cert-over { margin: 0 0 18px; font-size: 11.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--ar-accent); }
:is(#view-dashboard, #view-account) .cert-lead { margin: 0; font-size: 15px; color: #6B6B68; }
:is(#view-dashboard, #view-account) .cert .cert-name { margin: 8px 0 12px; font-family: var(--ar-serif); font-weight: 400; font-size: clamp(38px, 5.4vw, 64px); line-height: 1.05; color: #161616; }
:is(#view-dashboard, #view-account) .cert .cert-course { margin: 8px 0 0; font-family: var(--ar-serif); font-weight: 400; font-style: italic; font-size: clamp(22px, 2.6vw, 30px); color: #161616; }
:is(#view-dashboard, #view-account) .cert-foot { display: flex; align-items: flex-end; gap: 32px; }
:is(#view-dashboard, #view-account) .cert-foot div { display: grid; gap: 3px; min-width: 0; }
:is(#view-dashboard, #view-account) .cert-foot b { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8A8A86; }
:is(#view-dashboard, #view-account) .cert-foot span { font-size: 13.5px; color: #161616; overflow-wrap: anywhere; }
:is(#view-dashboard, #view-account) .cert-verify span { font-family: var(--ar-mono); font-size: 11.5px; }
:is(#view-dashboard, #view-account) .cert-seal { display: grid; place-items: center; width: 54px; height: 54px; margin-left: auto; flex-shrink: 0; border-radius: 50%; background: var(--ar-accent); color: #fff; box-shadow: 0 0 0 5px #FBFBF8, 0 0 0 6px var(--ar-accent); }
:is(#view-dashboard, #view-account) .cert-seal svg { width: 24px; height: 24px; stroke-width: 2.2; }
@media (max-width: 760px) {
    :is(#view-dashboard, #view-account) .cert { aspect-ratio: auto; min-height: 0; }
    :is(#view-dashboard, #view-account) .cert-foot { flex-wrap: wrap; gap: 16px 24px; }
    :is(#view-dashboard, #view-account) .cert-top { flex-direction: column; align-items: flex-start; }
}

/* ---------- 17. PRINT for the new reader / runner / certificate ---------- */
@media print {
    body.print-lesson-mode #view-dashboard :is(.cw-head, .cw-tabs, .cw-rail, .cw-read-tools, .cw-done, .cw-pager, .qr-top, .qr-progress, .qr-nav, .qr-submit-card, .qr-flag, .cw-drawer, .cw-drawer-scrim, .cert-actions) { display: none !important; }
    body.print-lesson-mode #view-dashboard .cw-reader, body.print-lesson-mode #view-dashboard .qr-body { display: block !important; }
    body.print-lesson-mode #view-dashboard .cw-read { max-width: none !important; }
    body.print-lesson-mode #view-dashboard :is(.qr-q, .qr-rq, .cw-example, .cw-mq) { break-inside: avoid; box-shadow: none !important; }
    body.print-lesson-mode #active-lesson-panel .cert { page: certificate; aspect-ratio: auto; min-height: 180mm; box-shadow: none; border-radius: 0; break-inside: avoid; }
}

#view-account .qr-top { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; }
#view-account .qr-top-copy { flex: 1; min-width: 0; }
#view-account .qr-top h1 { margin: 4px 0 0; font-family: var(--ar-serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
@media print {
    body.print-account-document-mode #account-print-area .cert-actions { display: none !important; }
    body.print-account-document-mode #account-print-area .cert { page: certificate; aspect-ratio: auto; min-height: 180mm; box-shadow: none; border-radius: 0; }
}
html body #view-account .ac-tab { background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; width: auto !important; margin: 0 !important; }
html body #view-account .ac-tab.active { color: var(--ar-ink) !important; }
html[data-theme] body #view-account .ac-tab.account-nav-item,
html[data-theme] body #view-account .ac-tab.account-nav-item.active,
html[data-theme] body #view-account .ac-tab.account-nav-item:hover { background: none !important; border: 0 !important; box-shadow: none !important; }
html[data-theme] body #view-account .ac-tab.account-nav-item.active { color: var(--ar-ink) !important; }

/* ---------- 18. TRANSCRIPT ---------- */
#view-account .tr { padding: clamp(24px, 4vw, 44px); border-radius: 18px; background: #FBFBF8; color: #161616; border: 1px solid #E2E2DD; box-shadow: var(--ar-shadow-md); }
#view-account .tr .cert-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
#view-account .tr .cert-brand b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #161616; color: #F7F7F4; font: 400 18px var(--ar-serif); }
#view-account .tr .cert-brand em { font-style: normal; font-weight: 400; color: #8A8A86; }
#view-account .tr-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid #E2E2DD; }
#view-account .tr-date { font: 500 12px var(--ar-mono); color: #6B6B68; }
#view-account .tr-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 26px 0 22px; }
#view-account .tr .tr-title h2 { margin: 6px 0 6px; font-family: var(--ar-serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.05; color: #161616; }
#view-account .tr .ar-eyebrow { color: #6B6B68; }
#view-account .tr-student { margin: 0; font-size: 14px; color: #6B6B68; }
#view-account .tr-grade { display: grid; justify-items: center; gap: 2px; min-width: 96px; padding: 14px 16px; border-radius: 14px; border: 1px solid #E2E2DD; }
#view-account .tr-grade strong { font-family: var(--ar-serif); font-weight: 400; font-size: 38px; line-height: 1; }
#view-account .tr-grade span { font-size: 11.5px; color: #6B6B68; }
#view-account .tr-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; border-top: 1px solid #E2E2DD; border-bottom: 1px solid #E2E2DD; }
#view-account .tr-stats div { padding: 14px 14px 14px 0; min-width: 0; }
#view-account .tr-stats div + div { padding-left: 14px; border-left: 1px solid #E2E2DD; }
#view-account .tr-stats dt { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8A8A86; }
#view-account .tr-stats dd { margin: 4px 0 0; font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
#view-account .tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding-top: 24px; }
#view-account .tr h3 { margin: 0 0 10px; font: 600 13px var(--ar-sans); color: #161616; }
#view-account .tr ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
#view-account .tr li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid #ECECE7; font-size: 13.5px; }
#view-account .tr li span { flex-shrink: 0; width: 64px; font: 500 11.5px var(--ar-mono); color: #8A8A86; padding-top: 2px; }
#view-account .tr li b { margin-left: auto; font: 500 12.5px var(--ar-mono); }
#view-account .tr p { margin: 0; font-size: 13.5px; color: #6B6B68; }
#view-account .tr-papers { padding-top: 22px; }
@media (max-width: 760px) {
    #view-account .tr-stats { grid-template-columns: 1fr 1fr; }
    #view-account .tr-stats div + div { border-left: 0; padding-left: 0; }
    #view-account .tr-cols { grid-template-columns: 1fr; }
    #view-account .tr-title { flex-direction: column; align-items: flex-start; }
}
@media print { body.print-account-document-mode #account-print-area .tr { page: transcript; box-shadow: none; border: 0; border-radius: 0; } }

/* ---------- 19. MATERIAL STUDY SESSION ---------- */
.mt-session { margin-top: 16px; padding: 22px; border: 1px solid var(--ar-line); border-radius: var(--ar-r-card); background: var(--ar-card); display: grid; gap: 10px; }
.mt-session h3 { font-family: var(--ar-serif); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0; color: var(--ar-ink); }
.mt-session-sum { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ar-ink-soft); }
.mt-blocks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; }
.mt-blocks li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--ar-line-hair); }
.mt-blocks strong { font-size: 14px; font-weight: 600; color: var(--ar-ink); }
.mt-blocks p { margin: 3px 0 0; font-size: 14px; line-height: 1.55; color: var(--ar-muted); }
.mt-min { font: 500 12px var(--ar-mono); color: var(--ar-accent); padding-top: 2px; }
.mt-session-foot { margin: 0; font-size: 13px; color: var(--ar-muted); }

/* ---------- 20. LANDING (lp-*) ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body:has(#view-landing) { background: var(--ar-page); }
.lp { --lp-w: 1120px; color: var(--ar-ink); font-family: var(--ar-sans); background: var(--ar-page); min-height: 100vh; overflow-x: clip; }
.lp > * { width: min(var(--lp-w), calc(100% - 40px)); margin-inline: auto; }
.lp button { font-family: inherit; }
.lp-nav { display: flex; align-items: center; gap: 24px; height: 76px; }
.lp-brand { display: flex; align-items: center; gap: 10px; color: var(--ar-ink); text-decoration: none; }
.lp-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--ar-ink); color: var(--ar-page); display: grid; place-items: center; font: 22px/1 var(--ar-serif); }
.lp-brand > span:last-child { display: grid; line-height: 1.1; }
.lp-brand strong { font: 400 20px var(--ar-serif); letter-spacing: -.01em; }
.lp-brand em { font-style: normal; font-size: 11px; color: var(--ar-muted); }
.lp-nav-links { display: flex; gap: 24px; margin-left: 16px; }
.lp-nav-links a { color: var(--ar-muted); text-decoration: none; font-size: 14px; transition: color .15s; }
.lp-nav-links a:hover { color: var(--ar-ink); }
.lp-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lp-icon { appearance: none; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--ar-ink-soft); display: grid; place-items: center; cursor: pointer; }
.lp-icon:hover { background: var(--ar-hover); color: var(--ar-ink); }
.lp-icon svg { width: 17px; height: 17px; stroke-width: 1.8; }

.lp-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; padding: 56px 0 96px; isolation: isolate; }
.lp-hero-art { position: absolute; left: 50%; bottom: 0; width: 100vw; height: 300px; transform: translateX(-50%); z-index: -1; pointer-events: none; }
.lp-hero-art svg { width: 100%; height: 100%; display: block; }
.lp-hero-art .m1 { fill: #DEDED9; } .lp-hero-art .m2 { fill: #CACAC4; } .lp-hero-art .m3 { fill: #B4B4AE; } .lp-hero-art .snow { fill: #F2F2F0; }
.lp-hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--ar-page), transparent 45%, transparent 70%, var(--ar-page)); }
html[data-theme="dark"] .lp-hero-art .m1 { fill: #1B1B1A; } html[data-theme="dark"] .lp-hero-art .m2 { fill: #161615; } html[data-theme="dark"] .lp-hero-art .m3 { fill: #121211; } html[data-theme="dark"] .lp-hero-art .snow { fill: #2A2A28; }
.lp-hero h1 { font: 400 clamp(44px, 6vw, 74px)/1.02 var(--ar-serif); letter-spacing: -.025em; margin: 14px 0 18px; color: var(--ar-ink); }
.lp-hero h1 em { font-style: italic; color: var(--ar-muted); }
.lp-lede { font-size: 18px; line-height: 1.6; color: var(--ar-ink-soft); max-width: 540px; margin: 0 0 28px; }
.lp-prompt { display: flex; gap: 6px; padding: 6px; max-width: 560px; background: var(--ar-card); border: 1px solid var(--ar-line-solid); border-radius: 14px; box-shadow: var(--ar-shadow-md); transition: border-color .15s; }
.lp-prompt:focus-within { border-color: var(--ar-ink); }
.lp-prompt input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; font: 16px var(--ar-sans); color: var(--ar-ink); outline: none; box-shadow: none; }
.lp-prompt input::placeholder { color: var(--ar-faint); }
.lp-prompt .ar-btn { height: 46px; }
.lp-try { font-size: 13px; color: var(--ar-muted); margin: 12px 0 0; }
.lp-try button { appearance: none; border: 0; background: none; padding: 0; color: var(--ar-ink); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lp-samples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.lp-samples button { appearance: none; border: 1px solid var(--ar-line-solid); background: color-mix(in srgb, var(--ar-card) 70%, transparent); color: var(--ar-ink-soft); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
.lp-samples button:hover { border-color: var(--ar-ink); color: var(--ar-ink); }

.lp-preview { margin: 0; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 20px; box-shadow: var(--ar-shadow-lg); padding: 24px; display: grid; gap: 18px; }
.lp-preview-head { display: grid; gap: 6px; }
.lp-preview-head strong { font: 400 28px/1.1 var(--ar-serif); color: var(--ar-ink); }
.lp-bar { height: 4px; border-radius: 4px; background: var(--ar-track); margin-top: 8px; overflow: hidden; }
.lp-bar i { display: block; height: 100%; background: var(--ar-ink); border-radius: inherit; }
.lp-preview-list { list-style: none; margin: 0; padding: 0; display: grid; }
.lp-preview-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--ar-line-hair); }
.lp-preview-list li div { display: grid; gap: 2px; }
.lp-preview-list strong { font-size: 14px; font-weight: 600; color: var(--ar-ink); }
.lp-preview-list em { font-style: normal; font-size: 12.5px; color: var(--ar-muted); }
.lp-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--ar-line-strong); flex: none; margin-top: 2px; }
.lp-preview-list .is-done .lp-dot { background: var(--ar-ink); border-color: var(--ar-ink); }
.lp-preview-list .is-done strong { color: var(--ar-muted); text-decoration: line-through; text-decoration-color: var(--ar-line-strong); }
.lp-preview-list .is-now .lp-dot { border-color: var(--ar-accent); box-shadow: inset 0 0 0 3px var(--ar-card), inset 0 0 0 8px var(--ar-accent); }
.lp-preview-tutor { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--ar-tile); font-size: 14px; line-height: 1.5; color: var(--ar-ink-soft); }
.lp-preview-tutor span { display: block; font: 500 11px var(--ar-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ar-accent); margin-bottom: 4px; }

.lp-section { padding: 88px 0 0; }
.lp-section h2, .lp-cta h2 { font: 400 clamp(32px, 4vw, 46px)/1.08 var(--ar-serif); letter-spacing: -.02em; margin: 10px 0 36px; color: var(--ar-ink); max-width: 640px; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-steps li { padding: 24px; border-top: 1px solid var(--ar-ink); }
.lp-steps span { font: 500 13px var(--ar-mono); color: var(--ar-accent); }
.lp-steps h3, .lp-features h3 { font-size: 18px; font-weight: 600; margin: 10px 0 6px; color: var(--ar-ink); }
.lp-steps p, .lp-features p { font-size: 15px; line-height: 1.6; color: var(--ar-muted); margin: 0; }
.lp-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.lp-features article { padding: 26px; background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: var(--ar-r-card); }
.lp-features h3 { margin-top: 0; }
.lp-cta { margin-top: 96px !important; padding: 56px; border-radius: 24px; background: var(--ar-side); color: var(--ar-side-text); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.lp-cta h2 { color: var(--ar-side-text); margin: 0; max-width: 520px; }
.lp-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lp-cta .ar-btn-dark { background: var(--ar-side-text); color: var(--ar-side); }
.lp-cta .ar-btn-outline { background: transparent; color: var(--ar-side-text); border-color: var(--ar-side-line); }
.lp-cta .ar-btn-outline:hover { border-color: var(--ar-side-muted); }
.lp-foot { display: flex; align-items: center; gap: 20px; padding: 32px 0 40px; font-size: 13px; color: var(--ar-muted); }
.lp-foot-quote { margin-left: auto; font: italic 400 15px var(--ar-serif); }
.lp-foot button { appearance: none; border: 0; background: none; padding: 0; font-size: 13px; color: var(--ar-ink); cursor: pointer; }

@media (max-width: 900px) {
    .lp-hero { grid-template-columns: 1fr; gap: 40px; padding: 32px 0 64px; }
    .lp-nav-links { display: none; }
    .lp-steps, .lp-features { grid-template-columns: 1fr; }
    .lp-steps li { padding: 20px 0 4px; }
}
@media (max-width: 560px) {
    .lp > * { width: calc(100% - 32px); }
    .lp-brand em, #landing-login { display: none; }
    .lp-prompt { flex-direction: column; padding: 8px; }
    .lp-prompt input { padding: 10px 8px; }
    .lp-lede { font-size: 16px; }
    .lp-cta { padding: 32px 24px; }
    .lp-foot { flex-wrap: wrap; }
    .lp-foot-quote { margin-left: 0; width: 100%; order: 3; }
}

/* ---------- 21. SIGN-IN MODAL (au-*) ---------- */
#auth-modal.au { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 10, 10, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#auth-modal.au.hidden { display: none; }
.au-dialog { width: min(860px, 100%); max-height: calc(100vh - 40px); overflow: auto; display: grid; grid-template-columns: 340px minmax(0, 1fr); border-radius: 22px; background: #121211; color: #EFEFEA; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7); border: 1px solid #242423; animation: au-in .25s var(--ar-ease); }
@keyframes au-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.au-side { position: relative; overflow: hidden; background: #0B0B0B; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; min-height: 480px; }
.au-mark { width: 38px; height: 38px; border-radius: 10px; background: #EFEFEA; color: #0B0B0B; display: grid; place-items: center; font: 24px/1 var(--ar-serif); position: relative; z-index: 1; }
.au-art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; }
.au-art .m1 { fill: #2A2A28; } .au-art .m2 { fill: #1E1E1C; } .au-art .m3 { fill: #151514; } .au-art .snow { fill: #4A4A47; }
.au-side p { position: relative; z-index: 1; margin: 0; font: italic 400 22px/1.25 var(--ar-serif); color: #EFEFEA; }
.au-main { position: relative; padding: 40px 40px 32px; display: flex; flex-direction: column; gap: 14px; }
.au-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #8A8A86; display: grid; place-items: center; cursor: pointer; }
.au-close:hover { background: #1F1F1E; color: #EFEFEA; }
.au-close svg { width: 18px; height: 18px; stroke-width: 2; }
.au-title { font: 400 38px/1.05 var(--ar-serif); letter-spacing: -.015em; margin: 0; color: #F4F4F0; }
.au-sub { margin: -6px 0 6px; font-size: 14px; color: #9C9C97; }
.au-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 11px; background: #1C1C1B; }
#auth-modal .auth-mode-tab { appearance: none; border: 0; background: transparent; color: #9C9C97; padding: 9px; border-radius: 8px; font: 500 13px var(--ar-sans); cursor: pointer; box-shadow: none; }
#auth-modal .auth-mode-tab.auth-mode-active { background: #2A2A28; color: #F4F4F0; box-shadow: none; }
.au-form { display: grid; gap: 14px; }
.au-form.hidden { display: none; }
.au-field { display: grid; gap: 6px; }
.au-field > span:first-child { font-size: 12.5px; font-weight: 500; color: #CFCFCA; }
.au-field input { width: 100%; height: 46px; padding: 0 14px; border-radius: 11px; border: 1px solid #2A2A28; background: #1A1A19; color: #F4F4F0; font: 15px var(--ar-sans); outline: none; box-shadow: none; transition: border-color .15s; }
.au-field input::placeholder { color: #6F6F6B; }
.au-field input:focus { border-color: #8A8A86; }
.au-pass { position: relative; display: block; }
.au-pass input { padding-right: 46px; }
.au-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #8A8A86; display: grid; place-items: center; cursor: pointer; }
.au-eye:hover { color: #EFEFEA; }
.au-eye svg { width: 17px; height: 17px; stroke-width: 1.8; }
.au-eye svg.hidden { display: none; }
.au-submit { height: 48px; margin-top: 4px; border: 0; border-radius: 11px; background: #F4F4F0; color: #111; font: 600 15px var(--ar-sans); cursor: pointer; transition: background .15s; }
.au-submit:hover { background: #FFFFFF; }
.au-submit:disabled { opacity: .6; cursor: progress; }
.au-or { display: flex; align-items: center; gap: 12px; color: #6F6F6B; font-size: 12px; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: #242423; }
.au-alt { height: 44px; border: 1px solid #2A2A28; border-radius: 11px; background: transparent; color: #EFEFEA; font: 500 14px var(--ar-sans); cursor: pointer; }
.au-alt:hover { background: #1A1A19; }
#auth-modal .auth-message { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; border: 1px solid #2A2A28; background: #1A1A19; color: #CFCFCA; }
#auth-modal .auth-message.hidden { display: none; }
#auth-modal .auth-message-error { border-color: rgba(196, 114, 107, .45); background: rgba(196, 114, 107, .12); color: #E6A8A2; }
#auth-modal .auth-message-success { border-color: rgba(79, 122, 91, .5); background: rgba(79, 122, 91, .14); color: #A9C9B1; }
@media (max-width: 720px) {
    .au-dialog { grid-template-columns: 1fr; }
    .au-side { display: none; }
    .au-main { padding: 32px 22px 24px; }
}
html body #auth-modal .au-field input { background: #1A1A19 !important; color: #F4F4F0 !important; border: 1px solid #2A2A28 !important; box-shadow: none !important; }
html body #auth-modal .au-field input:focus { border-color: #8A8A86 !important; }
html body #auth-modal .au-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #1A1A19 inset !important; -webkit-text-fill-color: #F4F4F0; }
html body #auth-modal.au { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(12, 12, 12, .62) !important; }
html[data-theme="dark"] .lp-cta { background: var(--ar-card); border: 1px solid var(--ar-line); }
html body .lp-prompt input { border: 0 !important; background: transparent !important; box-shadow: none !important; }

/* ---------- 22. GENERIC MODAL ---------- */
html body #modal-container { position: fixed; inset: 0; z-index: 130; display: none; align-items: center; justify-content: center; padding: 20px; }
html body #modal-container.open { display: flex; }
html body #modal-container .modal-backdrop { position: absolute; inset: 0; background: rgba(12, 12, 12, .5); backdrop-filter: none; }
html body #modal-container .modal { position: relative; width: min(440px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--ar-card); color: var(--ar-ink); border: 1px solid var(--ar-line); border-radius: 18px; box-shadow: var(--ar-shadow-lg); padding: 24px; display: grid; gap: 14px; transform: none; opacity: 1; }
html body #modal-container .modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; border: 0; background: none; }
html body #modal-container #modal-title { font: 400 28px/1.1 var(--ar-serif); margin: 0; color: var(--ar-ink); }
html body #modal-container .modal-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ar-muted); font-size: 22px; line-height: 1; cursor: pointer; }
html body #modal-container .modal-close:hover { background: var(--ar-hover); color: var(--ar-ink); }
html body #modal-container .modal-body { padding: 0; color: var(--ar-ink-soft); font-size: 14.5px; line-height: 1.55; }
html body #modal-container .modal-footer { padding: 0; border: 0; background: none; display: flex; justify-content: flex-end; gap: 8px; }
html body #modal-container .modal-footer:empty { display: none; }
.cw-modal-sub { margin: 0 0 16px; font-size: 15px; color: var(--ar-muted); }
.cw-modal-actions { display: grid; gap: 8px; }
.cw-modal-actions .ar-btn { width: 100%; justify-content: center; }
html body #view-dashboard .qr-timer :is(#premium-exam-timer, #assessment-timer) { display: inline !important; min-width: 0 !important; min-height: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; color: inherit !important; padding: 0 !important; font: inherit !important; font-variant-numeric: tabular-nums !important; }

/* ---------- 23. PRINT (authoritative) ----------
   Print only the document: every element that neither is nor contains the print
   root is removed (not just hidden), so no empty shell space or tinted panels print. */
@media screen { .pd-cover { display: none !important; } }
@media print {
    @page { size: A4 portrait; margin: 16mm 16mm 18mm;
        @top-left { content: ""; } @bottom-left { content: ""; }
        @top-right { content: counter(page) " / " counter(pages); font: 500 8pt "JetBrains Mono", monospace; color: #9A9A96; }
    }
    @page certificate { size: A4 landscape; margin: 0;
        @top-right { content: ""; } @top-left { content: ""; } @bottom-left { content: ""; }
    }
    html:root, html:root body, html:root body:is(.print-lesson-mode, .print-account-document-mode, .print-certificate-mode) { background: #fff !important; color: #161616 !important; }
    html body.print-lesson-mode :not(:has(#active-lesson-panel), #active-lesson-panel, #active-lesson-panel *) { display: none !important; }
    html body.print-account-document-mode :not(:has(#account-print-area), #account-print-area, #account-print-area *) { display: none !important; }
    html body.print-lesson-mode :has(#active-lesson-panel),
    html body.print-account-document-mode :has(#account-print-area),
    html:root body #active-lesson-panel#active-lesson-panel, html:root body #account-print-area#account-print-area {
        display: block !important; position: static !important; visibility: visible !important; margin: 0 !important; padding: 0 !important;
        width: auto !important; max-width: none !important; min-height: 0 !important; height: auto !important; overflow: visible !important;
        background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; transform: none !important; filter: none !important; opacity: 1 !important; animation: none !important;
    }
    html body :is(#active-lesson-panel, #account-print-area) * { visibility: visible !important; }
    html body:is(.print-lesson-mode, .print-account-document-mode) :is(#active-lesson-panel, #account-print-area),
    html body:is(.print-lesson-mode, .print-account-document-mode) :is(#active-lesson-panel, #account-print-area) :is(p, li, span, div, td, th, label, strong, em, b, a, textarea, input, dt, dd) { font-family: var(--ar-sans) !important; }
    html body:is(.print-lesson-mode, .print-account-document-mode) :is(#active-lesson-panel, #account-print-area) :is(h1, h2, .cert-name, .cert-course, .tr-title) { font-family: var(--ar-serif) !important; font-weight: 400 !important; }
    html body:is(.print-lesson-mode, .print-account-document-mode) :is(#active-lesson-panel, #account-print-area) :is(code, pre, .qr-q-marks, .cert-uid, .cert-verify span) { font-family: var(--ar-mono) !important; }

    /* chrome that never prints */
    html body #active-lesson-panel :is(.cw-head, .cw-tabs, .cw-rail, .cw-read-tools, .cw-done, .cw-pager, .cw-outline, .cw-mq, .qr-top, .qr-progress, .qr-nav, .qr-submit-card, .qr-submit, .qr-flag, .qr-instructions, .cert-actions, .cw-ask, button),
    html body #account-print-area :is(.qr-top, .cert-actions, button) { display: none !important; }

    /* cover strip */
    html body .pd-cover { display: block !important; margin: 0 0 10mm !important; padding: 0 0 5mm !important; border-bottom: 1px solid #161616 !important; }
    html body .pd-brand { display: flex !important; justify-content: space-between; align-items: baseline; margin: 0 0 4mm; font-size: 9pt; color: #6B6B68; }
    html body .pd-brand strong { font: 400 14pt var(--ar-serif) !important; color: #161616; }
    html body .pd-cover h1 { font-size: 26pt !important; line-height: 1.1; margin: 0 0 2mm !important; color: #161616 !important; }
    html body .pd-meta { margin: 0; font-size: 10pt; color: #6B6B68; }
    html body .pd-fields { display: flex !important; gap: 8mm; margin-top: 6mm; }
    html body .pd-fields span { flex: 1; padding-top: 7mm; border-bottom: 1px solid #9A9A96; font-size: 8pt; color: #6B6B68; }
    html body .pd-fields span:last-child { flex: 0 0 30mm; }

    /* reading */
    html body #active-lesson-panel :is(.cw-reader, .cw-read, .qr, .qr-body, .qr-form, .qr-paper) { display: block !important; max-width: none !important; width: auto !important; padding: 0 !important; margin: 0 !important; background: none !important; box-shadow: none !important; border: 0 !important; }
    html body #active-lesson-panel .cw-prose { font-size: 11pt !important; line-height: 1.6 !important; color: #161616 !important; }
    html body #active-lesson-panel .cw-prose h2 { font-size: 18pt !important; margin: 8mm 0 3mm !important; break-after: avoid; }
    html body #active-lesson-panel .cw-prose h3 { font-size: 12.5pt !important; margin: 5mm 0 2mm !important; break-after: avoid; }
    html body #active-lesson-panel .cw-prose blockquote { border-left: 2px solid #C4726B !important; background: none !important; padding: 1mm 0 1mm 4mm !important; margin: 4mm 0 !important; border-radius: 0 !important; box-shadow: none !important; }
    html body #active-lesson-panel :is(img, svg, figure, table, pre, .qr-q, .qr-rq, .qr-part, .cw-example) { break-inside: avoid; }

    /* questions on paper: plain, ruled answer space */
    html body #active-lesson-panel .qr-section-head { margin: 0 0 4mm !important; }
    html body #active-lesson-panel .qr-q, html body #active-lesson-panel .qr-rq { background: none !important; border: 0 !important; border-top: 1px solid #E2E2DD !important; border-radius: 0 !important; box-shadow: none !important; padding: 5mm 0 2mm !important; margin: 0 !important; }
    html body #active-lesson-panel .qr-opt { border: 0 !important; background: none !important; padding: 1.2mm 0 !important; min-height: 0 !important; box-shadow: none !important; }
    html body #active-lesson-panel .qr-opt input { display: none !important; }
    html body #active-lesson-panel .qr-opt b { background: none !important; border: 1px solid #9A9A96 !important; border-radius: 50% !important; }
    html body #active-lesson-panel#active-lesson-panel .qr-answer.qr-answer { border: 0 !important; border-radius: 0 !important; background: repeating-linear-gradient(transparent 0 8.5mm, #CFCFC9 8.5mm calc(8.5mm + 1px)) !important; min-height: 26mm !important; resize: none !important; color: transparent !important; box-shadow: none !important; }
    html body #active-lesson-panel#active-lesson-panel .qr-answer.qr-answer::placeholder { color: transparent !important; }

    /* certificate: one landscape page */
    html body :is(#active-lesson-panel, #account-print-area) .cert-page { page: certificate; max-width: none !important; margin: 0 !important; }
    html body :is(#active-lesson-panel, #account-print-area) .cert { page: certificate; box-sizing: border-box; width: 297mm !important; height: 205mm !important; min-height: 0 !important; aspect-ratio: auto !important; margin: 0 !important; padding: 18mm 22mm !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; display: flex !important; flex-direction: column; justify-content: space-between; overflow: hidden; break-inside: avoid; break-after: avoid; }
    html body :is(#active-lesson-panel, #account-print-area) .cert::before { inset: 8mm !important; }
    html body :is(#active-lesson-panel, #account-print-area) .cert-art { height: 26% !important; }
    html body :is(#active-lesson-panel, #account-print-area) .cert .cert-name { font-size: 48pt !important; }
    html body :is(#active-lesson-panel, #account-print-area) .cert .cert-course { font-size: 22pt !important; }
    html body :is(#active-lesson-panel, #account-print-area) .cert-foot { display: flex !important; }
    html body :is(#active-lesson-panel, #account-print-area) .cert-seal { display: grid !important; }
    html body :is(#active-lesson-panel, #account-print-area) .tr { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; background: none !important; }
    @page transcript { size: A4 landscape; margin: 14mm 16mm; }
    html body #account-print-area .tr { page: transcript; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
@media print { html body :is(#active-lesson-panel, #account-print-area) .cert-art { background: none !important; border: 0 !important; box-shadow: none !important; } }

/* ---------- 24. SWEEP FIXES ---------- */
#view-dashboard .cw-day-topic { margin: 0; font-size: 14.5px; font-weight: 500; color: var(--ar-ink); width: 100%; }
#view-dashboard .cw-day-tasks:has(> .cw-day-topic) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
#view-dashboard .cw-day-tasks:has(> .cw-day-topic) .cw-task { gap: 8px; }
#view-dashboard .cw-day-tasks:has(> .cw-day-topic) .cw-task-copy { font-size: 13px; color: var(--ar-muted); }
#view-dashboard .cw-day-tasks:has(> .cw-day-topic) .cw-task-copy strong { font-weight: 500; }
html[data-theme="dark"] .ar-art-pale { filter: invert(.9) brightness(.95); }
#dashboard-materials-list .mt-empty { padding: 28px 24px; border: 1.5px dashed var(--ar-line-strong); border-radius: var(--ar-r-card); justify-items: center; text-align: center; font-size: 14px; }
@media (max-width: 560px) {
    #view-portal #portal-materials-shortcut { display: none; }
    .lp-hero { padding-bottom: 40px; }
    .lp-hero-art { height: 200px; }
    .lp-section { padding-top: 56px; }
    .lp-cta { margin-top: 64px !important; }
}
@media (min-width: 761px) and (max-width: 1480px) {
    .ar-continue { grid-template-columns: 200px minmax(0, 1fr); row-gap: 12px; }
    .ar-continue .ar-thumb { height: 116px; }
    html body #ar-content .ar-continue > .active-course-cta { grid-column: 2 !important; justify-self: start; }
    html body #ar-content .ar-continue > .ar-thumb, html body #ar-content .ar-continue > :first-child { grid-row: span 2 !important; }
}

/* ── 25. Real-content fixes ──────────────────────────────────────────────
   Found by rendering real generated lessons/quizzes. */
/* Legacy language label is position:absolute; our pre is static, so every
   label escaped to the page header. The label adds nothing — drop it. */
html body #view-dashboard pre.code-block::before { content: none !important; display: none !important; }
html body #view-dashboard pre.code-block { padding-top: 16px !important; }
/* Sticky tab strip must be opaque — lesson text showed through it. */
html body #view-dashboard .cw-tabs { background: var(--ar-page); backdrop-filter: none; -webkit-backdrop-filter: none; }
/* The current-question ring was clipped by the grid's scroll box. */
html body #view-dashboard .qr-nav-grid { padding: 4px; margin: -4px; }
@media (max-width: 760px) {
    html body #view-dashboard .cw-tabs { box-shadow: -24px 0 0 var(--ar-page), 24px 0 0 var(--ar-page); }
}
/* Mobile quiz navigator: one slim row (chips + submit) so it never hides the question. */
@media (max-width: 960px) {
    html body #view-dashboard .qr-nav { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 14px; }
    html body #view-dashboard .qr-nav .qr-nav-head { display: none; }
    html body #view-dashboard .qr-nav .qr-nav-grid { flex: 1; min-width: 0; margin: 0; grid-auto-columns: 34px; padding: 3px; }
    html body #view-dashboard .qr-nav .qr-submit { flex: none; width: auto; height: 38px; margin: 0; padding: 0 16px; font-size: 14px; white-space: nowrap; }
}
@media (max-width: 560px) {
    html body #view-dashboard .qr-opt { align-items: flex-start; gap: 11px; padding: 12px 12px; font-size: 15px; }
    html body #view-dashboard .qr-opt b { width: 26px; height: 26px; margin-top: -1px; }
}
/* Home › Today's Plan: topic stated once above the task rows. */
#portal-today .ar-today-topic { display: grid; gap: 4px; padding: 2px 0 12px; margin-bottom: 4px; border-bottom: 1px solid var(--ar-line); }
#portal-today .ar-today-topic strong { font: 400 19px/1.25 var(--ar-serif); letter-spacing: -.005em; color: var(--ar-ink); }
#portal-today .ar-today-topic { border-bottom: 0; padding-bottom: 6px; }
/* Narrow home panel: stack the empty-materials message above its button. */
html body #portal-materials-preview .mt-empty { display: grid !important; grid-template-columns: 1fr !important; justify-items: start; gap: 12px; }
/* Short windows (most laptops): the decorative promo card pushed the wordmark off the sidebar. */
.ar-sidebar { overflow-y: auto; scrollbar-width: none; }
.ar-sidebar::-webkit-scrollbar { display: none; }
@media (max-height: 860px) { .ar-side-promo { display: none; } }
/* Phones: the course header repeated on every tab took ~45% of the first screen.
   Tighter title and slimmer buttons give the tab's own content the room. */
@media (max-width: 560px) {
    html body #view-dashboard .cw-head { gap: 12px; padding: 4px 0 14px; }
    html body #view-dashboard .cw-head h1 { font-size: 25px !important; line-height: 1.12 !important; margin-bottom: 8px !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    html body #view-dashboard .cw-head .ar-eyebrow { margin-bottom: 4px; }
    html body #view-dashboard .cw-head-actions .ar-btn { height: 36px; font-size: 13.5px; }
}

/* ── 26. Readability audit fixes (WCAG AA contrast, ≥11px text, ≥24px phone targets) ── */
html body #course-count-badge.ar-chip { background: var(--ar-tile) !important; color: var(--ar-ink-soft) !important; }
html:not([data-theme="dark"]) body #view-dashboard .ar-chip-new { color: #9E4D46; }
.ar-side-foot span { font-size: 10.5px; letter-spacing: .26em; }
.ar-logo-text small { font-size: 11px; }
html body .ar-thumb-badge { font-size: 11.5px; }
@media (max-width: 600px) {
    .ar-crumbs button, .ar-crumbs a { min-height: 32px; display: inline-flex; align-items: center; }
    html body #ar-search { min-height: 36px; }
    html body #view-dashboard .cw .cw-check { width: 26px; height: 26px; }
    html body #landing-secondary-cta { min-height: 32px; padding: 0 2px; }
}
html:not([data-theme="dark"]) .lp-preview-tutor span { color: #9E4D46; }
html body #view-dashboard .cw .cw-segment button:not(.active) { color: var(--ar-ink-soft); }
html body .ar-side-foot span { font-size: 11px; }

/* ── 27. First-run Home: one clear next step ──────────────────────────── */
#view-portal .ar-welcome { display: none; }
#view-portal.is-first-run .ar-welcome {
    display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px 48px; align-items: start;
    padding: 32px 36px; border-radius: var(--ar-r-card, 20px); background: var(--ar-card); border: 1px solid var(--ar-line);
}
#view-portal.is-first-run :is(.ar-stats, .ar-layout, #portal-materials-shortcut, #hero-open-course-creator) { display: none !important; }
#view-portal .ar-welcome h2 { font: 400 30px/1.15 var(--ar-serif); letter-spacing: -.01em; margin: 0 0 8px; color: var(--ar-ink); }
#view-portal .ar-welcome-main > p { margin: 0 0 20px; font-size: 15px; line-height: 1.6; color: var(--ar-muted); max-width: 46ch; }
#view-portal .ar-welcome-form { display: flex; gap: 8px; padding: 6px; border-radius: 14px; background: var(--ar-field); border: 1px solid var(--ar-line); }
#view-portal .ar-welcome-form:focus-within { border-color: var(--ar-ink); }
#view-portal .ar-welcome-form input { flex: 1; min-width: 0; border: 0; background: none; padding: 0 12px; font-size: 15px; color: var(--ar-ink); outline: none; }
#view-portal .ar-welcome-form input::placeholder { color: var(--ar-muted); }
#view-portal .ar-welcome-form .ar-btn { flex: none; }
#view-portal .ar-welcome-form .ar-btn svg { width: 16px; height: 16px; }
#view-portal .ar-welcome-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
#view-portal .ar-welcome-chips > span { font-size: 13px; color: var(--ar-muted); margin-right: 2px; }
#view-portal .ar-welcome-chips button { height: 32px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--ar-line-strong); background: none; font-size: 13px; color: var(--ar-ink-soft); cursor: pointer; transition: border-color .15s, color .15s; }
#view-portal .ar-welcome-chips button:hover { border-color: var(--ar-ink); color: var(--ar-ink); }
#view-portal .ar-welcome-steps { list-style: none; margin: 0; padding: 0 0 0 32px; border-left: 1px solid var(--ar-line); display: grid; gap: 22px; }
#view-portal .ar-welcome-steps li { display: flex; gap: 14px; align-items: flex-start; }
#view-portal .ar-welcome-steps li > span { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--ar-line-strong); font: 500 12px var(--ar-mono); color: var(--ar-ink-soft); }
#view-portal .ar-welcome-steps li:first-child > span { background: var(--ar-primary); border-color: var(--ar-primary); color: var(--ar-on-primary); }
#view-portal .ar-welcome-steps strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--ar-ink); }
#view-portal .ar-welcome-steps em { display: block; margin-top: 2px; font-style: normal; font-size: 13.5px; color: var(--ar-muted); }
#view-portal .ar-welcome-alt { grid-column: 1 / -1; margin: 0; padding-top: 20px; border-top: 1px solid var(--ar-line); font-size: 14px; color: var(--ar-muted); }
#view-portal .ar-welcome-alt button { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ar-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 900px) {
    #view-portal.is-first-run .ar-welcome { grid-template-columns: 1fr; padding: 24px 20px; }
    #view-portal .ar-welcome-steps { padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--ar-line); gap: 16px; }
}
@media (max-width: 560px) {
    #view-portal .ar-welcome h2 { font-size: 26px; }
    #view-portal .ar-welcome-form { flex-direction: column; padding: 8px; }
    #view-portal .ar-welcome-form input { height: 44px; }
    #view-portal .ar-welcome-form .ar-btn { justify-content: center; }
}
/* Skip link: keyboard users only, styled to the design language. */
html body .skip-link { border: 0; background: var(--ar-primary); color: var(--ar-on-primary); font: 600 13px var(--ar-sans, inherit); border-radius: 10px; padding: 10px 14px; box-shadow: var(--ar-shadow-lg); }
html body .skip-link:focus:not(:focus-visible) { transform: translateY(-160%); }
html body .skip-link:focus-visible { transform: translateY(0); outline: 2px solid var(--ar-accent); outline-offset: 2px; }
#view-portal.is-first-run .ar-hero-actions { display: none !important; }

/* ── 28. Top-bar search results ───────────────────────────────────────── */
.ar-search { position: relative; }
.ar-search-pop {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; padding: 6px;
    background: var(--ar-card); border: 1px solid var(--ar-line); border-radius: 14px; box-shadow: var(--ar-shadow-lg);
    max-height: min(420px, 70vh); overflow-y: auto;
}
.ar-search-head { margin: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ar-muted); }
.ar-search-none { margin: 8px 10px 6px; font-size: 13.5px; color: var(--ar-muted); }
.ar-search-opt { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; color: var(--ar-ink); }
.ar-search-opt strong { font-size: 14px; font-weight: 600; }
.ar-search-opt span { font-size: 12.5px; color: var(--ar-muted); }
.ar-search-opt mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--ar-accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.ar-search-opt:hover, .ar-search-opt.is-active { background: var(--ar-tile); }
.ar-search-opt.is-alt { margin-top: 4px; border-top: 1px solid var(--ar-line); border-radius: 0 0 10px 10px; }
.ar-search-opt.is-alt strong { font-weight: 500; color: var(--ar-ink-soft); }
html body #view-dashboard .cw .cw-tool-btn.is-saved { background: var(--ar-primary) !important; border-color: var(--ar-primary) !important; color: var(--ar-on-primary) !important; }
html body #view-dashboard .cw .cw-tool-btn.is-saved :is(span, svg) { color: var(--ar-on-primary) !important; }
.ex-nomatch { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px; border: 1.5px dashed var(--ar-line-strong); border-radius: var(--ar-r-card, 18px); }
.ex-nomatch.hidden { display: none; }
.ex-nomatch p { margin: 0; font-size: 14.5px; color: var(--ar-muted); }
.ex-nomatch strong { color: var(--ar-ink); font-weight: 600; }

/* ── 29. Lesson diagrams: one quiet frame, plain-language actions ─────── */
@media screen {
    html body #view-dashboard .cw-prose .science-visual { margin: 1.6em 0; padding: 0; border: 1px solid var(--ar-line) !important; border-radius: 16px !important; background: var(--ar-card) !important; box-shadow: none !important; overflow: hidden; }
    html body #view-dashboard .cw-prose .science-visual-head { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin: 0 !important; padding: 12px 16px !important; border-bottom: 1px solid var(--ar-line) !important; background: none !important; }
    html body #view-dashboard .cw-prose .science-visual-head > span { display: none !important; }
    html body #view-dashboard .cw-prose .science-visual-head strong { font-size: 13px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--ar-ink-soft) !important; }
    html body #view-dashboard .cw-prose .science-visual-actions { display: flex; gap: 4px; margin: 0 !important; }
    html body #view-dashboard .cw-prose .science-visual-actions button { height: 30px; padding: 0 10px !important; border: 0 !important; border-radius: 8px !important; background: none !important; font: 500 12.5px var(--ar-sans) !important; color: var(--ar-muted) !important; box-shadow: none !important; }
    html body #view-dashboard .cw-prose .science-visual-actions button:hover { background: var(--ar-tile) !important; color: var(--ar-ink) !important; }
    html body #view-dashboard .cw-prose .science-visual-stage { margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; padding: 20px 16px !important; }
    html body #view-dashboard .cw-prose .science-visual figcaption { margin: 0 !important; padding: 0 16px 14px !important; font-size: 13.5px; color: var(--ar-muted); }
}

/* ---------- 30. ACCOUNT DOCUMENT PREVIEWS ON PHONES ---------- */
/* The certificate / transcript preview header: title on its own line, actions in a row beneath. */
@media (max-width: 640px) {
    #view-account .qr-top { flex-wrap: wrap; align-items: flex-start; row-gap: 12px; }
    #view-account .qr-top-copy { flex: 1 1 100%; }
    #view-account .qr-top h1 { font-size: 24px; overflow-wrap: anywhere; }
}
#view-account .tr-grade.is-words { min-width: 0; padding: 10px 14px; }
#view-account .tr-grade.is-words span { font: 400 italic 18px/1.1 var(--ar-serif); color: #161616; }
#view-account .tr-stats dd.tr-uid { font: 500 12px/1.5 var(--ar-mono); white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 640px) {
    #view-account .tr-top { flex-direction: column; align-items: flex-start; gap: 8px; }
    #view-account .tr-top .cert-brand { white-space: nowrap; }
}

/* A graph that couldn't be drawn keeps its caption as a quiet note instead of an empty frame. */
#active-lesson-panel .graph-note, .graph-note { margin: 4px 0 18px; padding: 10px 14px; border-left: 2px solid var(--ar-line-strong); color: var(--ar-ink-soft); font-size: .95em; }

/* Course overview shortcuts on phones: an odd last card takes the full row instead of sitting alone. */
@media (max-width: 760px) {
    #view-dashboard .cw-quick > .cw-quick-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Anatomy card without a picture: just the named parts, full width. */
.anatomy-reference-panel.is-text-only { grid-template-columns: minmax(0, 1fr); }

/* 3D model card: footer link + no-WebGL fallback */
.anatomy-asset-credit { font-weight: 500; color: var(--ar-muted); }
.anatomy-asset-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.anatomy-asset-credit a:hover { color: var(--ar-ink); }
.anatomy-no3d { padding: 16px 18px; border: 1px dashed var(--ar-line); color: var(--ar-ink-soft); border-radius: 10px; font-size: 14px; line-height: 1.5; }
.anatomy-no3d p { margin: 0 0 8px; }
.anatomy-no3d a { color: var(--ar-ink); text-decoration: underline; text-underline-offset: 2px; }
.anatomy-no3d ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; }
@media (max-width: 560px) { .anatomy-no3d ul { columns: 1; } }

/* Flowcharts on phones: trees become an indented outline; other charts scroll sideways at a readable size */
.science-visual-stage.flow-outline-stage { display: block; height: auto; min-height: 0; padding: 14px 4px 6px; }
.flow-outline, .flow-outline ul { list-style: none; margin: 0; padding: 0; }
.flow-outline ul { margin-left: 14px; padding-left: 16px; border-left: 1px solid var(--ar-line-strong); }
.flow-outline li { position: relative; margin: 0 0 10px; }
.flow-outline ul > li::before {
    content: ""; position: absolute; left: -16px; top: 20px; width: 12px; border-top: 1px solid var(--ar-line-strong);
}
.flow-outline ul > li:last-child { margin-bottom: 0; }
.flow-outline > li > ul { margin-top: 10px; }
.flow-outline li > ul { margin-top: 10px; }
.flow-outline-node {
    display: inline-block; max-width: 100%; padding: 9px 12px; border: 1px solid var(--ar-line); border-radius: 10px;
    background: var(--ar-card); color: var(--ar-ink); font-size: 14px; font-weight: 600; line-height: 1.35;
}
.flow-outline > li > .flow-outline-node { background: var(--ar-ink); color: var(--ar-page); border-color: var(--ar-ink); }
.flow-outline-edge { display: block; margin: 0 0 4px; color: var(--ar-muted); font: 500 11px/1.3 var(--ar-mono); letter-spacing: .02em; }
.science-visual-stage.simple-flow-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
.science-visual-stage.simple-flow-scroll > svg { max-width: none; }
html body #view-dashboard .cw-prose .flow-outline,
html body #view-dashboard .cw-prose .flow-outline ul,
html body #view-dashboard .cw-prose .flow-outline li { list-style: none; }
html body #view-dashboard .cw-prose .flow-outline li { display: block; padding-left: 0; }
html body #view-dashboard .cw-prose .flow-outline li::marker { content: none; }
html body #view-dashboard .cw-prose .flow-outline { margin: 0; padding: 0; }
html body #view-dashboard .cw-prose .flow-outline ul { margin: 10px 0 0 14px; padding: 0 0 0 16px; border-left: 1px solid var(--ar-line-strong); }
html body #view-dashboard .cw-prose .flow-outline li { margin: 0 0 10px; }
html body #view-dashboard .cw-prose .flow-outline li:last-child { margin-bottom: 0; }
html body #view-dashboard .cw-prose .flow-outline ul > li::before { left: -17px; width: 15px; top: 19px; }
html body #view-dashboard .cw-prose .flow-outline ul { border-left: 0; }
html body #view-dashboard .cw-prose .flow-outline ul > li::before { left: -16px; width: 14px; }
html body #view-dashboard .cw-prose .flow-outline ul > li::after {
    content: ""; position: absolute; left: -16px; top: -10px; bottom: 0; border-left: 1px solid var(--ar-line-strong);
}
html body #view-dashboard .cw-prose .flow-outline ul > li:last-child::after { bottom: auto; height: 30px; }
@media screen {
    .science-visual .simple-flow-svg-node text { font-family: var(--ar-sans); font-size: 13.5px; font-weight: 600; }
}
.simple-flow-hint { margin: 0; padding: 8px 16px 12px; color: var(--ar-muted); font: 500 11px/1.3 var(--ar-mono); letter-spacing: .02em; text-align: center; }
.science-visual-stage.simple-flow-scroll:focus-visible { outline: 2px solid var(--ar-ink); outline-offset: -2px; }

/* Sign-in: VexID is the only way in */
.au-vexid { display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.au-vexid-mark {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
    background: #111; color: #F4F4F0; font: 400 15px/1 var(--ar-serif);
}
.au-vexid:focus-visible { outline: 2px solid #F4F4F0; outline-offset: 3px; }
.au-note { margin: 2px 0 0; font-size: 12.5px; line-height: 1.55; color: #8E8E89; }
#auth-modal .au-main { justify-content: center; }
