/*
   revU HPC - Holistic Progress Card
   Shares the bhuskU design tokens and theme engine with revU Performance Intelligence.
*/

/* =========================================================================
   1. TOKENS & THEMES - bhusku family system (same tokens as schedU)
   Ink-first: ink for text, lavender for things you touch, gold only for the
   knob and rare highlights, paper/mist for surfaces. No page-wide gradients.
   ========================================================================= */
:root {
    --radius-sm: 6px;
    --radius-md: 9px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(19, 17, 30, 0.05);
    --shadow-md: 0 4px 10px -2px rgba(19, 17, 30, 0.08);
    --shadow-lg: 0 10px 24px -6px rgba(19, 17, 30, 0.14);
    --shadow-xl: 0 20px 40px -10px rgba(19, 17, 30, 0.28);
    --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', 'Noto Sans Devanagari', 'Noto Sans Oriya', system-ui, sans-serif;
    --font-mono: 'DM Mono', 'Courier New', monospace;
    --sidebar-width: 236px;
    --header-h: 56px;

    /* family constants */
    --ink: #13111E;
    --gold: #D4920E;
    --paper: #FAF9F5;
    --brand: #685DBC;
}

body.theme-light {
    --bg-main: #F5F3FF;          /* brand-100: app canvas, as in schedU */
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #FAFAFE;
    --bg-input: #ffffff;
    --bg-sunken: #F8F7FF;
    --border-color: #ECEAFB;     /* brand-line */
    --border-strong: #C9C3EC;    /* brand-line-2 */
    --border-color-focus: rgba(124, 111, 224, 0.45);
    --text-primary: #13111E;
    --text-muted: #4B5275;
    --text-subtle: #6B7079;
    --nav-head: #777489;
    --nav-text: #4B5563;
    --nav-icon: #6D6A8A;
    --color-primary: #685DBC;    /* --brand: buttons, links, active */
    --color-primary-strong: #4B41C4;
    --color-primary-hover: #6358C4;
    --color-primary-soft: #EDE9FF;
    --color-primary-glow: rgba(124, 111, 224, 0.22);
    --color-accent: #4B41C4;
    --color-accent-soft: #F5F3FF;
    --color-gold: #D4920E;
    --color-gold-soft: #FBF3E2;
    --color-gold-line: #EBCB8B;
    --color-gold-ink: #8A5A00;
    --color-success: #15803d;
    --color-success-soft: #dcfce7;
    --color-warning: #b45309;
    --color-warning-soft: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-soft: #fee2e2;
    /* data series: teacher / self / parent (validated on light surface) */
    --series-1: #685DBC;
    --series-2: #0e8a7a;
    --series-3: #c47a0c;
    /* level ramp - sequential lavender */
    --lvl-1: #EDE9FF; --lvl-1-ink: #4B41C4;
    --lvl-2: #C9C3EC; --lvl-2-ink: #2A2363;
    --lvl-3: #7C6FE0; --lvl-3-ink: #ffffff;
    --lvl-4: #4B41C4; --lvl-4-ink: #ffffff;
}

body.theme-dark {
    --bg-main: #0F0E17;
    --bg-sidebar: #16141F;
    --bg-header: #16141F;
    --bg-card: #1B1926;
    --bg-card-hover: #232031;
    --bg-input: #13111E;
    --bg-sunken: #13111E;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-color-focus: rgba(155, 142, 245, 0.55);
    --text-primary: #EEEDF7;
    --text-muted: #B9B6CF;
    --text-subtle: #8C88A6;
    --nav-head: #8C88A6;
    --nav-text: #B9B6CF;
    --nav-icon: #8C88A6;
    --color-primary: #9B8EF5;
    --color-primary-strong: #C4B5FD;
    --color-primary-hover: #8A7DE8;
    --color-primary-soft: rgba(155, 142, 245, 0.16);
    --color-primary-glow: rgba(155, 142, 245, 0.25);
    --color-accent: #C4B5FD;
    --color-accent-soft: rgba(155, 142, 245, 0.10);
    --color-gold: #E3A53A;
    --color-gold-soft: rgba(212, 146, 14, 0.14);
    --color-gold-line: rgba(212, 146, 14, 0.45);
    --color-gold-ink: #F0C26B;
    --color-success: #4ade80;
    --color-success-soft: rgba(74, 222, 128, 0.12);
    --color-warning: #fbbf24;
    --color-warning-soft: rgba(251, 191, 36, 0.14);
    --color-danger: #f87171;
    --color-danger-soft: rgba(248, 113, 113, 0.14);
    --series-1: #8a7de8;
    --series-2: #1f9e8c;
    --series-3: #c4801c;
    --lvl-1: #2A2550; --lvl-1-ink: #D8D2FF;
    --lvl-2: #3E3680; --lvl-2-ink: #EDE9FF;
    --lvl-3: #8A7DE8; --lvl-3-ink: #0F0E17;
    --lvl-4: #C4B5FD; --lvl-4-ink: #0F0E17;
}

/* =========================================================================
   2. BASE & SHELL
   ========================================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex-shrink: 0; }
a { color: var(--color-primary); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: #EDE9FF; color: #2A2363; }
* { scrollbar-width: thin; scrollbar-color: #C9C3EC transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #D8D2FF; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

.app-shell { display: flex; height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* The family mark: Fader U on its lavender tile, gold knob */
.bm-tile {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    background: linear-gradient(145deg, color-mix(in oklab, var(--brand) 86%, white) 0%, var(--brand) 55%, color-mix(in oklab, var(--brand) 84%, black) 100%);
    box-shadow: 0 1px 2px rgba(19, 17, 30, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.bm-tile svg { display: block; overflow: visible; }
.bm-knob { transform-box: fill-box; transform-origin: center; transition: transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1); }
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.brand-lockup:hover .bm-knob { transform: translateY(4px); }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); line-height: 1; white-space: nowrap; }
.brand-name span { color: var(--color-primary); }
.brand-sub { font-size: 11px; font-weight: 600; color: var(--text-subtle); white-space: nowrap; }

/* Sidebar - white, as in schedU */
.app-sidebar {
    width: var(--sidebar-width); background: var(--bg-sidebar); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
}
.sb-brand { height: var(--header-h); flex-shrink: 0; display: flex; align-items: center; gap: 9px; padding: 0 14px; border-bottom: 1px solid var(--bg-main); }
.sb-school { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-bottom: 1px solid var(--bg-main); font-size: 12.5px; font-weight: 700; color: var(--text-primary); min-width: 0; }
.sb-school .ss-mono { width: 26px; height: 26px; border-radius: 7px; background: var(--color-primary-soft); color: var(--color-primary-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.sb-school .ss-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 8px 0; display: flex; flex-direction: column; }
.nav-section-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--nav-head); padding: 12px 10px 4px; user-select: none; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 2px; border-radius: 9px;
    color: var(--nav-text); text-decoration: none; font-weight: 500; font-size: 13.5px; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; white-space: nowrap;
    transition: background .13s, color .13s;
}
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--nav-icon); }
.nav-item:hover { background: var(--border-color); }
.nav-item.active { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 700; }
.nav-item.active svg { color: var(--color-primary); }
.nav-item .nav-count { margin-left: auto; font-size: 11px; background: var(--color-primary); color: #fff; border-radius: var(--radius-full); padding: 0 7px; font-weight: 700; }

.sb-user { border-top: 1px solid var(--bg-main); padding: 10px 12px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; background: var(--color-primary); color: #fff; flex-shrink: 0; }
.user-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-by { padding: 0 14px 12px; font-size: 11px; color: var(--text-subtle); line-height: 1.4; flex-shrink: 0; }
.sb-by b { font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }

/* Top bar */
.app-topbar {
    height: var(--header-h); flex-shrink: 0; background: var(--bg-header); border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 12px; padding: 0 20px; z-index: 30;
}
.app-topbar .spacer { flex: 1; }
.topbar-ctx { font-size: 12px; font-weight: 600; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-ctx b { color: var(--text-primary); }
.persona-wrap { display: flex; align-items: center; gap: 8px; }
.persona-wrap label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nav-head); white-space: nowrap; }
.persona-wrap .select { max-width: 250px; background-color: var(--bg-sunken); border-color: var(--border-strong); font-weight: 600; }
.theme-switcher-pill { display: flex; background: var(--bg-sunken); border: 1px solid var(--border-color); border-radius: var(--radius-full); padding: 3px; }
.theme-pill-btn { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-subtle); padding: 5px 10px; border-radius: var(--radius-full); cursor: pointer; font-size: 12px; font-weight: 600; }
.theme-pill-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.theme-pill-btn.active { background: var(--bg-card); color: var(--color-primary); box-shadow: var(--shadow-sm); }

/* Review switch - Staff | Students, shared look with the staff app */
.review-switch { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-sunken); border: 1px solid var(--border-color); border-radius: var(--radius-full); padding: 3px; flex-shrink: 0; }
.review-switch .rs-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--nav-head); padding: 0 8px 0 9px; }
.review-switch a { font-size: 12.5px; font-weight: 700; color: var(--text-muted); text-decoration: none; padding: 5px 13px; border-radius: var(--radius-full); }
.review-switch a:hover { color: var(--color-primary); }
.review-switch a.on { background: var(--color-primary); color: #fff; }
@media (max-width: 600px) { .review-switch .rs-label { display: none; } .review-switch a { padding: 5px 10px; } }

.app-content { flex: 1; overflow-y: auto; padding: 24px 28px 48px; min-width: 0; outline: none; }
.sidebar-scrim { display: none; }
.mobile-only { display: none; }
.icon-btn { border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-muted); cursor: pointer; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.modal .icon-btn { border: 0; background: none; }
.icon-btn.mobile-only, .brand-lockup.mobile-only { display: none; }

/* =========================================================================
   3. COMPONENTS
   ========================================================================= */
.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-header h2 { font-size: 24px; font-weight: 700; }
.view-header .subtitle { color: var(--text-subtle); font-size: 13.5px; display: block; margin-top: 2px; max-width: 720px; }
.view-header .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 12px; font-weight: 600; color: var(--text-subtle); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.crumb a { color: var(--text-subtle); text-decoration: none; }
.crumb a:hover { color: var(--color-primary); }

.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.card-head h3 { font-size: 15.5px; }
.card-head .hint { font-size: 12px; color: var(--text-subtle); }
.card-body { padding: 16px 20px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 340px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.muted { color: var(--text-subtle); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-md);
    border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-primary); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.btn:focus-visible, .select:focus-visible, .input:focus-visible, .nav-item:focus-visible, .lvl-cell:focus-visible, .chip:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-strong); border-color: var(--color-primary-strong); }
.btn-accent { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.1); background: var(--color-accent); }
.btn-soft { background: var(--color-primary-soft); border-color: transparent; color: var(--color-primary-strong); }
.btn-soft:hover { background: var(--color-primary-soft); border-color: var(--border-strong); filter: brightness(0.97); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--color-danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.select, .input, .textarea {
    background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 7px 11px; font-size: 13px; color: var(--text-primary); outline: none; min-width: 0;
}
.select { cursor: pointer; padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.textarea { width: 100%; min-height: 80px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-glow); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.field .help { font-size: 11.5px; color: var(--text-subtle); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--color-primary); width: 15px; height: 15px; }

.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); margin-bottom: 16px; }
.toolbar .field { min-width: 150px; }
.toolbar .spacer { flex: 1; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.badge-green { background: var(--color-primary-soft); color: var(--color-primary-strong); }
body.theme-dark .badge-green { color: var(--color-primary); }
.badge-blue { background: var(--color-accent-soft); color: var(--color-accent); }
.badge-yellow { background: var(--color-gold-soft); color: var(--color-gold-ink); }
.badge-warn { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-gray { background: var(--bg-sunken); color: var(--text-muted); border-color: var(--border-color); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--radius-full); border: 1px solid var(--border-color); background: var(--bg-card); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-muted); }
.chip:hover { border-color: var(--color-primary); }
.chip.on { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--text-subtle); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg-sunken); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 3px; gap: 2px; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font-weight: 600; font-size: 12.5px; color: var(--text-subtle); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* Default for inline icons inside content (zero specificity so component rules win) */
:where(.app-content, .modal, .chart-tip) svg:where(:not(.chart-svg):not(.brand-logo)) { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* Stat tiles */
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .k { font-size: 12px; font-weight: 600; color: var(--text-subtle); }
.stat .v { font-family: var(--font-heading); font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--text-subtle); }
.progress { height: 8px; background: var(--bg-sunken); border-radius: var(--radius-full); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--color-primary); border-radius: var(--radius-full); }

/* Tables */
.table-wrap { overflow: auto; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-card); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border-color); text-align: left; vertical-align: middle; }
.table th { font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: var(--bg-sunken); position: sticky; top: 0; z-index: 2; white-space: nowrap; }
.table tbody tr:hover td { background: var(--bg-card-hover); }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.table .sticky-col { position: sticky; left: 0; background: var(--bg-card); z-index: 1; }
.table th.sticky-col { z-index: 3; background: var(--bg-sunken); }

/* Pipeline (what's left) */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.pipe-step { padding: 12px 14px; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pipe-step:last-child { border-right: 0; }
.pipe-step .t { font-size: 11.5px; font-weight: 700; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.pipe-step .n { font-family: var(--font-heading); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.pipe-step .n small { font-size: 12px; color: var(--text-subtle); font-weight: 600; }
.pipe-step .btn { align-self: flex-start; }
.step-dot { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; background: var(--bg-sunken); color: var(--text-muted); border: 1px solid var(--border-color); }
.step-dot.done { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Level chips & cells */
.lvl { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.lvl svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.lvl-0 { background: var(--lvl-1); color: var(--lvl-1-ink); }
.lvl-1 { background: var(--lvl-2); color: var(--lvl-2-ink); }
.lvl-2 { background: var(--lvl-3); color: var(--lvl-3-ink); }
.lvl-3 { background: var(--lvl-4); color: var(--lvl-4-ink); }
.lvl-none { background: var(--bg-sunken); color: var(--text-subtle); border: 1px dashed var(--border-strong); }
.lvl-cell { width: 100%; min-width: 96px; border: 0; background: transparent; cursor: pointer; padding: 2px; border-radius: var(--radius-sm); }
.lvl-cell .lvl { width: 100%; justify-content: center; }
.lvl-cell.suggest .lvl-none { border-color: var(--color-accent); color: var(--color-accent); }

/* Marks grid */
.marks-table th, .marks-table td { padding: 5px 6px; text-align: center; }
.marks-table th.sec { background: var(--color-accent-soft); color: var(--color-accent); font-size: 11px; }
.marks-table th.sec.add { background: var(--color-gold-soft); color: var(--color-gold-ink); }
.marks-table th.q { font-size: 11px; }
.marks-table th.q .max { display: block; font-weight: 600; color: var(--text-subtle); font-size: 10px; }
.marks-table td.name, .marks-table th.name { text-align: left; min-width: 170px; }
.marks-table input.mk { width: 46px; padding: 4px 4px; text-align: center; border: 1px solid var(--border-color); border-radius: 5px; background: var(--bg-input); font-variant-numeric: tabular-nums; font-size: 13px; }
.marks-table input.mk:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-glow); }
.marks-table input.mk.err { border-color: var(--color-danger); background: var(--color-danger-soft); }
.marks-table input.mk.ab { color: var(--color-warning); font-weight: 700; }
.marks-table td.sub, .marks-table th.sub { background: var(--bg-sunken); font-weight: 700; font-variant-numeric: tabular-nums; }
.marks-table td.tot, .marks-table th.tot { background: var(--color-primary-soft); font-weight: 800; color: var(--color-primary-strong); font-variant-numeric: tabular-nums; }
body.theme-dark .marks-table td.tot, body.theme-dark .marks-table th.tot { color: var(--color-primary); }
.marks-table td.comp, .marks-table th.comp { background: var(--color-gold-soft); font-weight: 800; font-variant-numeric: tabular-nums; }
.marks-table th .lock { width: 10px; height: 10px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 2.5; }

/* Paper builder */
.breakdown { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-family: var(--font-heading); font-weight: 700; font-size: 16px; }
.breakdown .plus { color: var(--text-subtle); font-weight: 500; }
.breakdown .part { padding: 3px 10px; border-radius: var(--radius-md); background: var(--color-primary-soft); color: var(--color-primary-strong); }
.breakdown .part.add { background: var(--color-gold-soft); color: var(--color-gold-ink); }
body.theme-dark .breakdown .part { color: var(--color-primary); }
.breakdown .ref { font-size: 12px; color: var(--text-subtle); font-family: var(--font-body); font-weight: 600; margin-left: 6px; }
.section-card { border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-card); margin-bottom: 14px; overflow: hidden; }
.section-card.add { border-color: var(--color-gold-line); }
body.theme-dark .section-card.add { border-color: rgba(255, 218, 13, 0.4); }
.section-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--bg-sunken); border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.section-card.add .section-head { background: var(--color-gold-soft); }
.section-head .input.title { font-weight: 700; font-size: 14px; flex: 1; min-width: 160px; }
.q-row { display: grid; grid-template-columns: 44px minmax(0,1fr) 120px; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border-color); align-items: start; }
.q-row:last-child { border-bottom: 0; }
.q-num { font-weight: 800; font-family: var(--font-heading); font-size: 15px; padding-top: 6px; }
.q-body .rich { min-height: 38px; }
.q-meta { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.q-parts { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; padding-left: 12px; border-left: 2px solid var(--border-color); }
.q-part { display: grid; grid-template-columns: 26px minmax(0,1fr) 64px 28px; gap: 8px; align-items: center; }
.lo-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.lo-tag { font-size: 10.5px; font-weight: 700; background: var(--color-accent-soft); color: var(--color-accent); padding: 1px 7px; border-radius: var(--radius-full); cursor: default; }
.lo-tag.missing { background: var(--color-warning-soft); color: var(--color-warning); cursor: pointer; }
.src-tag { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-full); background: var(--bg-sunken); color: var(--text-subtle); border: 1px solid var(--border-color); }
.rich { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 7px 10px; background: var(--bg-input); outline: none; line-height: 1.6; }
.rich:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-glow); }
.rich:empty::before { content: attr(data-placeholder); color: var(--text-subtle); }
.sym-bar { display: flex; gap: 3px; flex-wrap: wrap; }
.sym-bar button { border: 1px solid var(--border-color); background: var(--bg-card); border-radius: 5px; min-width: 28px; height: 26px; cursor: pointer; font-size: 13px; padding: 0 6px; }
.sym-bar button:hover { border-color: var(--color-primary); color: var(--color-primary); }
.q-img { margin-top: 8px; display: flex; gap: 8px; align-items: flex-start; }
.q-img img { border-radius: 6px; border: 1px solid var(--border-color); }
.img-s { max-width: 140px; } .img-m { max-width: 260px; } .img-l { max-width: 420px; }
.mcq-opts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; margin-top: 8px; }
.mcq-opts .opt { display: flex; gap: 6px; align-items: center; }
.mcq-opts .opt b { width: 18px; }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; border: 1px solid; }
.alert svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; margin-top: 1px; }
.alert-warn { background: var(--color-warning-soft); border-color: rgba(217, 119, 6, .35); color: var(--color-warning); }
.alert-info { background: var(--color-accent-soft); border-color: rgba(104, 93, 188, .25); color: var(--color-accent); }
.alert-ok { background: var(--color-primary-soft); border-color: rgba(49, 133, 82, .3); color: var(--color-primary-strong); }
body.theme-dark .alert-ok { color: var(--color-primary); }
.alert-danger { background: var(--color-danger-soft); border-color: rgba(220, 38, 38, .3); color: var(--color-danger); }
.alert .body { color: var(--text-primary); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border-color); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .sub { font-size: 12px; color: var(--text-subtle); }
.s-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0; }
.empty { padding: 36px 20px; text-align: center; color: var(--text-subtle); }
.empty h4 { color: var(--text-primary); margin-bottom: 4px; font-size: 15px; }

/* Charts */
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg .grid-line { stroke: var(--border-color); stroke-width: 1; fill: none; }
.chart-svg .axis-label { fill: var(--text-muted); font-size: 11px; font-family: var(--font-body); font-weight: 600; }
.chart-svg .tick-label { fill: var(--text-subtle); font-size: 10px; font-family: var(--font-body); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.legend .sw { width: 14px; height: 3px; border-radius: 2px; display: inline-block; margin-right: 6px; vertical-align: middle; }
.legend .sw.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; height: 2px; }
.chart-tip { position: fixed; pointer-events: none; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); box-shadow: var(--shadow-lg); border-radius: var(--radius-md); padding: 8px 10px; font-size: 12px; z-index: 1000; max-width: 260px; }
.chart-tip .tt { font-weight: 700; margin-bottom: 3px; }
.stacked-bar { display: flex; height: 14px; gap: 2px; border-radius: 4px; overflow: hidden; }
.stacked-bar > span { display: block; height: 100%; }
.stacked-bar > span:first-child { border-radius: 4px 0 0 4px; }
.stacked-bar > span:last-child { border-radius: 0 4px 4px 0; }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(9, 13, 22, 0.55); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { width: min(980px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 8px; }
.modal .icon-btn { color: var(--text-muted); }

/* Toast */
#toast-root { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1100; }
.toast { background: #13111E; color: #fff; padding: 10px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-xl); font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; border-left: 4px solid var(--color-primary); animation: toastIn .2s ease; max-width: 380px; }
.toast.ok { border-left-color: #9B8EF5; }
.toast.err { border-left-color: #f87171; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* LO library */
.lo-tree .comp { border-bottom: 1px solid var(--border-color); padding: 12px 20px; }
.lo-tree .comp:last-child { border-bottom: 0; }
.lo-tree .comp-title { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lo-tree .lo { display: flex; gap: 10px; padding: 5px 0 5px 14px; font-size: 13px; align-items: baseline; }
.lo-tree .lo code, .code { font-size: 11px; font-weight: 700; color: var(--color-accent); background: var(--color-accent-soft); padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }

/* Self assessment (student-facing) */
.self-q { padding: 14px 18px; border-bottom: 1px solid var(--border-color); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.self-q:last-child { border-bottom: 0; }
.self-q .stmt { font-weight: 600; font-size: 14px; }
.self-q .dom { font-size: 11.5px; color: var(--text-subtle); font-weight: 600; }
.face-opts { display: flex; gap: 6px; }
.face { border: 1px solid var(--border-color); background: var(--bg-card); border-radius: var(--radius-lg); padding: 6px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.face svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.face.on { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary-strong); box-shadow: 0 0 0 2px var(--color-primary-glow); }
body.theme-dark .face.on { color: var(--color-primary); }

/* How it works (guide) */
.gd-flow { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.gd-step { flex: 1; min-width: 104px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 10px 12px; text-decoration: none; color: var(--text-primary); display: flex; flex-direction: column; gap: 1px; }
.gd-step:hover { border-color: var(--color-primary); }
.gd-step b { width: 22px; height: 22px; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; margin-bottom: 4px; }
.gd-step span { font-weight: 800; font-size: 13.5px; }
.gd-step small { color: var(--text-subtle); font-size: 11.5px; }
.gd-arrow { align-self: center; color: var(--text-subtle); font-weight: 700; }
.gd-num { width: 28px; height: 28px; border-radius: 50%; background: #13111E; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
body.theme-dark .gd-num { background: var(--text-primary); color: var(--bg-main); }
.gd-way { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-sunken); border: 1px solid var(--border-color); }
.gd-way span { color: var(--text-muted); font-size: 13px; }
.gd-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.gd-skill { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.gd-why { padding: 8px 10px; border-left: 3px solid var(--color-primary); background: var(--bg-sunken); border-radius: 0 8px 8px 0; margin-bottom: 6px; }
.gd-why.next { border-left-color: var(--color-gold); }
.gd-downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.gd-dl { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-card); text-decoration: none; color: var(--text-primary); text-align: left; cursor: pointer; font: inherit; }
.gd-dl:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.gd-dl svg { width: 20px; height: 20px; color: var(--color-primary); }
.gd-dl span { color: var(--text-subtle); font-size: 12.5px; }
@media (max-width: 900px) { .gd-arrow { display: none; } }

/* =========================================================================
   4. PROGRESS REPORT - one A4 sheet (front + back), print-first
   Always light: it is a paper document. Sizes are tuned so a typical
   class report fits on two A4 sides.
   ========================================================================= */
.rp {
    --rp-ink: #13111E; --rp-muted: #4B5275; --rp-subtle: #6B7079; --rp-line: #E4E1F5; --rp-tint: #F8F7FF;
    --rp-brand: #685DBC; --rp-brand-strong: #4B41C4; --rp-gold: #D4920E;
    --rp-l0: #EDE9FF; --rp-l1: #C9C3EC; --rp-l2: #7C6FE0; --rp-l3: #4B41C4;
    background: #fff; color: var(--rp-ink); width: 100%; max-width: 794px; margin: 0 auto 24px; padding: 30px 32px 22px;
    border: 1px solid #E4E1F5; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 11.5px; line-height: 1.45;
}
.rp h3 { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--rp-brand-strong); margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rp h3 small { font-size: 10px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--rp-subtle); }
.rp-sec { margin-top: 11px; break-inside: avoid; }

.rp-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--rp-brand); }
.rp-school { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rp-mono { width: 38px; height: 38px; border-radius: 10px; background: var(--rp-l0); color: var(--rp-brand-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.rp-school b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.rp-school small { color: var(--rp-subtle); font-size: 11px; }
.rp-title { text-align: right; }
.rp-title span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--rp-subtle); text-transform: uppercase; }
.rp-title b { font-size: 15px; font-weight: 800; }
.rp-title b i { font-style: normal; color: var(--rp-gold); }

.rp-student { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 4px 14px; margin-top: 10px; padding: 8px 12px; background: var(--rp-tint); border-radius: 8px; }
.rp-student div { min-width: 0; }
.rp-student small { display: block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--rp-subtle); }
.rp-student b { font-weight: 700; }

.rp-glance { display: grid; grid-template-columns: 0.9fr 1.2fr 1.9fr; gap: 10px; margin-top: 10px; }
.rp-box { border: 1px solid var(--rp-line); border-radius: 8px; padding: 9px 11px; min-width: 0; }
.rp-box > small { display: block; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--rp-subtle); margin-bottom: 3px; }
.rp-grade { display: flex; align-items: baseline; gap: 6px; }
.rp-grade b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--rp-brand-strong); }
.rp-grade span { font-size: 13px; font-weight: 700; color: var(--rp-muted); }
.rp-spread { display: flex; height: 10px; gap: 2px; border-radius: 5px; overflow: hidden; margin: 5px 0 6px; }
.rp-spread span { display: block; height: 100%; }
.rp-keys { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 10.5px; color: var(--rp-muted); }
.rp-keys b { color: var(--rp-ink); }
.rp-sn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-sn ul { list-style: none; padding: 0; margin: 0; }
.rp-sn li { position: relative; padding-left: 12px; margin: 1px 0; }
.rp-sn li::before { content: ""; position: absolute; left: 0; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--rp-l2); }
.rp-sn .next li::before { background: var(--rp-gold); }
.rp-sn li em { font-style: normal; color: var(--rp-subtle); }

/* level swatches (4-step ramp; 3-step sets use steps 0, 1 and 3) */
.rp .lv0 { background: var(--rp-l0); } .rp .lv1 { background: var(--rp-l1); } .rp .lv2 { background: var(--rp-l2); } .rp .lv3 { background: var(--rp-l3); }
.rp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(19,17,30,.12); }

.rp-table { width: 100%; border-collapse: collapse; }
.rp-table th, .rp-table td { border-bottom: 1px solid var(--rp-line); padding: 4px 6px; text-align: left; vertical-align: top; }
.rp-table th { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--rp-subtle); background: var(--rp-tint); border-bottom: 1px solid var(--rp-l1); white-space: nowrap; }
.rp-table th small { font-weight: 700; text-transform: none; letter-spacing: 0; }
.rp-table td.c, .rp-table th.c { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-table td.sub { font-weight: 700; white-space: nowrap; }
.rp-table td.sub small { display: block; font-weight: 500; color: var(--rp-subtle); font-size: 9.5px; }
.rp-table td.tot { font-weight: 800; }
.rp-table td.gr { font-weight: 800; color: var(--rp-brand-strong); }
.rp-table .pend { color: var(--rp-subtle); font-style: italic; font-size: 10px; }
.rp-skills { display: flex; flex-wrap: wrap; gap: 3px 4px; }
.rp-skill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 5px; border-radius: 999px; border: 1px solid var(--rp-line); font-size: 10px; line-height: 1.5; white-space: nowrap; }
.rp-skill.x { border-style: dashed; border-color: #E9CF95; }

.rp-two { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: center; }
.rp-lvl { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.rp-lvl.none { color: var(--rp-subtle); font-weight: 500; }
.rp .chart-svg .grid-line { stroke: #E4E1F5; }
.rp .chart-svg .axis-label { fill: #4B5275; font-size: 10px; }
.rp .legend { color: #4B5275; font-size: 10px; justify-content: center; gap: 10px; }

.rp-voices { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.rp-voice { background: var(--rp-tint); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.rp-voice small { display: block; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--rp-brand-strong); margin-bottom: 2px; }
.rp-note { border-left: 3px solid var(--rp-brand); background: var(--rp-tint); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: 11.5px; }
.rp-note.empty { color: var(--rp-subtle); font-style: italic; }

.rp-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 22px; text-align: center; font-size: 10.5px; color: var(--rp-muted); break-inside: avoid; }
.rp-sign div { border-top: 1px solid #B9B4D6; padding-top: 4px; }
.rp-sign b { display: block; color: var(--rp-ink); }
.rp-legend { margin-top: 12px; padding-top: 7px; border-top: 1px dashed var(--rp-line); font-size: 9.5px; color: var(--rp-subtle); display: flex; flex-wrap: wrap; gap: 3px 14px; }
.rp-legend b { color: var(--rp-muted); }
.rp-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 9px; color: #9A95BC; }

.rp-outcomes { columns: 2; column-gap: 18px; }
.rp-outcomes .grp { break-inside: avoid; margin-bottom: 8px; }
.rp-outcomes .grp > b { display: block; font-size: 10.5px; margin-bottom: 2px; }
.rp-outcomes .o { display: grid; grid-template-columns: 10px 1fr auto; gap: 5px; align-items: baseline; font-size: 10px; padding: 1px 0; }
.rp-outcomes .o span:last-child { color: var(--rp-subtle); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
    .rp { padding: 18px 16px; font-size: 11px; }
    .rp-student { grid-template-columns: 1fr 1fr; }
    .rp-glance, .rp-two, .rp-sn { grid-template-columns: minmax(0, 1fr); }
    .rp-two > div:last-child { max-width: 260px; margin: 0 auto; }
    .rp-table-wrap { overflow-x: auto; }
    .rp-outcomes { columns: 1; }
}

/* Exam paper print preview */
.paper-sheet { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 28px 34px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 14px; }
.paper-sheet .ph { text-align: center; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 12px; }
.paper-sheet .ph h2 { font-size: 20px; color: #111; }
.paper-sheet .pinfo { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; margin-top: 4px; }
.paper-sheet .psec { margin-top: 14px; }
.paper-sheet .psec h4 { font-size: 14px; text-transform: uppercase; color: #111; text-align: center; margin-bottom: 6px; }
.paper-sheet .pq { display: grid; grid-template-columns: 30px 1fr 40px; gap: 6px; margin: 8px 0; break-inside: avoid; }
.paper-sheet .pq .m { text-align: right; font-weight: 600; }
.paper-sheet .ans-space { border-bottom: 1px dotted #999; height: 26px; }
.paper-sheet .mcq-opts { color: #111; }

/* =========================================================================
   5. RESPONSIVE & PRINT
   ========================================================================= */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main-side { grid-template-columns: minmax(0, 1fr); }
    .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pipe-step:nth-child(3) { border-right: 0; }
    .pipe-step:nth-child(-n+3) { border-bottom: 1px solid var(--border-color); }
    .theme-pill-btn span { display: none; }
    .topbar-ctx { display: none; }
}
@media (max-width: 900px) {
    .mobile-only, .icon-btn.mobile-only, .brand-lockup.mobile-only { display: inline-flex; }
    .app-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.28); }
    body.nav-open .app-sidebar { transform: none; }
    body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(19,17,30,.45); z-index: 55; }
    .app-topbar { padding: 0 12px; gap: 10px; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .persona-wrap label { display: none; }
}
@media (max-width: 600px) {
    .app-content { padding: 16px 16px 40px; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
    .pipeline { grid-template-columns: 1fr 1fr; }
    .pipe-step { border-bottom: 1px solid var(--border-color); }
    .theme-switcher-pill { display: none; }
    .persona-wrap .select { max-width: 160px; }
    .topbar-brand .brand-sub { display: none; }
    .q-row { grid-template-columns: 1fr; }
    .mcq-opts { grid-template-columns: 1fr; }
}

@page { size: A4; margin: 10mm; }
@media print {
    body { overflow: visible; background: #fff; }
    .app-topbar, .app-sidebar, .no-print, .view-header, .toolbar, #toast-root, .sidebar-scrim, .crumb { display: none !important; }
    .app-shell, .app-main { display: block; height: auto; }
    .app-content { padding: 0; overflow: visible; }
    .rp, .paper-sheet { box-shadow: none; border: 0; border-radius: 0; max-width: none; padding: 0; margin: 0; }
    .rp + .rp, .print-break { break-before: page; }
    .rp * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
