/* Kalami – Learning Admin · plain CSS, no build step.
   Look: white dot-grid paper, cobalt blue ink and highlighter marks in yellow and pink; a top bar whose highlighter
   stroke slides under the current page, and a "today" rail on the right.
   Sections: fonts · tokens · base · top bar + navigation · menus · flash cards · frame + rail · layout · dashboard ·
   courses · builder · students · grading · quizzes · settings · forms · overlays · login · responsive · print */

/* fonts (SIL Open Font License, see assets/fonts/OFL.txt) */
@font-face { font-family: "Wix Madefor Display"; font-weight: 400; font-display: swap; src: url("../fonts/wix-madefor-display-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Wix Madefor Display"; font-weight: 400; font-display: swap; src: url("../fonts/wix-madefor-display-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Wix Madefor Display"; font-weight: 400; font-display: swap; src: url("../fonts/wix-madefor-display-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Wix Madefor Display"; font-weight: 600; font-display: swap; src: url("../fonts/wix-madefor-display-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Wix Madefor Display"; font-weight: 600; font-display: swap; src: url("../fonts/wix-madefor-display-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Wix Madefor Display"; font-weight: 600; font-display: swap; src: url("../fonts/wix-madefor-display-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Wix Madefor Display"; font-weight: 800; font-display: swap; src: url("../fonts/wix-madefor-display-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Wix Madefor Display"; font-weight: 800; font-display: swap; src: url("../fonts/wix-madefor-display-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Wix Madefor Display"; font-weight: 800; font-display: swap; src: url("../fonts/wix-madefor-display-cyrillic-800-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Martian Mono"; font-weight: 400; font-display: swap; src: url("../fonts/martian-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Martian Mono"; font-weight: 400; font-display: swap; src: url("../fonts/martian-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Martian Mono"; font-weight: 400; font-display: swap; src: url("../fonts/martian-mono-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-400-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-600-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 800; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-800-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }

/* tokens */
:root {
    --font: "Wix Madefor Display", "Noto Sans Georgian", system-ui, sans-serif;
    --mono: "Martian Mono", "Wix Madefor Display", "Noto Sans Georgian", ui-monospace, monospace;
    --r: 16px; --r-s: 10px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #fbfbf8; --dot: #dcdde6; --card: #fff; --soft: #f2f3f8; --line: #e3e4ee; --line-2: #cfd1e0;
    --text: #14162b; --muted: #5d6079; --faint: #9598ae;
    --blue: #1d3bd1; --blue-ink: #1730ad; --blue-soft: #e6eaff; --yellow: #ffe14d; --yellow-soft: #fff6c4; --pink: #ff8fbf; --pink-soft: #ffe4f0;
    --mint: #6ddcb8; --mint-ink: #0e8a63; --mint-soft: #dcf7ee; --red: #d93a4a; --red-soft: #fde5e8; --orange: #f08a24;
    --shadow: 0 18px 40px -26px rgba(20, 22, 60, .35), 0 1px 3px rgba(20, 22, 60, .06);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1021; --dot: #23264a; --card: #161935; --soft: #1d2142; --line: #282c52; --line-2: #343963;
    --text: #eceefb; --muted: #a3a7c8; --faint: #6f739a;
    --blue: #7d93ff; --blue-ink: #a9b7ff; --blue-soft: rgba(125, 147, 255, .16); --yellow: #f4d23c; --yellow-soft: rgba(244, 210, 60, .16); --pink: #ff8fbf; --pink-soft: rgba(255, 143, 191, .15);
    --mint: #5fd3ae; --mint-ink: #6fe2bd; --mint-soft: rgba(95, 211, 174, .14); --red: #ff7b88; --red-soft: rgba(255, 123, 136, .14); --orange: #ffa552;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, .8);
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.i18n-wait body { visibility: hidden; }
body { margin: 0; min-height: 100vh; font: 400 15px/1.55 var(--font); color: var(--text); background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1.4px) 0 0 / 22px 22px; }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.15; letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.flag { stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--blue); color: #fff; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 50%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
/* the highlighter stroke behind headings */
.hl { padding: 0 .12em; background: linear-gradient(100deg, transparent 0 2%, var(--yellow) 2% 97%, transparent 97%) 0 72% / 100% 46% no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl.pink { background-image: linear-gradient(100deg, transparent 0 2%, var(--pink) 2% 97%, transparent 97%); }
[data-theme="dark"] .hl { background-image: linear-gradient(100deg, transparent 0 2%, color-mix(in srgb, var(--yellow) 55%, transparent) 2% 97%, transparent 97%); }

/* top bar + navigation */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1.5px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top-row { display: flex; align-items: center; gap: 14px; max-width: 1600px; margin: 0 auto; padding: 12px 22px 6px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--blue); color: #fff; box-shadow: 0 4px 0 -1px var(--yellow); transform: rotate(-4deg); }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 2.2; }
.brand-word { font-weight: 800; font-size: 20px; line-height: 1.1; letter-spacing: -.02em; }
.brand-word small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; letter-spacing: 0; }
.search { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 420px; min-width: 0; margin-left: 12px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--faint); text-align: left; }
.search:hover { border-color: var(--line-2); }
.search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { padding: 1px 7px; border: 1.5px solid var(--line); border-radius: 6px; font: 400 11px var(--mono); color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: none; color: var(--muted); }
.icon-btn:hover { background: var(--soft); color: var(--text); }
.rail-btn[aria-expanded="true"] { background: var(--blue-soft); color: var(--blue); }
.dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--pink); }
[data-theme="dark"] .t-sun, [data-theme="light"] .t-moon { display: none; }
.me { padding: 0; border: 0; background: none; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: hsl(var(--h, 230) 80% 92%); color: hsl(var(--h, 230) 55% 30%); font-weight: 800; font-size: 13px; flex: none; }
[data-theme="dark"] .avatar { background: hsl(var(--h, 230) 35% 28%); color: hsl(var(--h, 230) 80% 86%); }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }
.nav { position: relative; display: flex; gap: 4px; max-width: 1600px; margin: 0 auto; padding: 0 22px; overflow-x: auto; scrollbar-width: none; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav a svg { width: 18px; height: 18px; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav-mark { position: absolute; bottom: 8px; left: 0; z-index: 0; height: 12px; border-radius: 3px 8px 3px 8px; background: var(--yellow); opacity: .85; transform: skewX(-8deg); transition: left .35s var(--ease), width .35s var(--ease); pointer-events: none; }
[data-theme="dark"] .nav-mark { opacity: .45; }
.nav-badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--pink); color: #2a0b1a; font-size: 11.5px; font-weight: 800; line-height: 20px; text-align: center; }

/* menus */
.dd { position: relative; }
.menu { position: absolute; z-index: 50; min-width: 210px; padding: 6px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.menu > a, .menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: none; text-align: left; text-decoration: none; }
.menu > a:hover, .menu > button:hover { background: var(--soft); }
.me-menu { right: 0; top: calc(100% + 8px); }
.me-who { padding: 8px 12px 10px; border-bottom: 1.5px solid var(--line); margin-bottom: 4px; }
.me-who b { display: block; }
.me-who small { color: var(--muted); }
.me-theme { display: none !important; }
.bell-menu { right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 28px)); padding: 0; }
.bell-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1.5px solid var(--line); }
.bell-list { max-height: 360px; margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.bell-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 10px; border-radius: 10px; font-size: 14px; }
.bell-list li.is-new { background: var(--yellow-soft); }
.bell-list small { display: block; color: var(--muted); font-size: 12.5px; }
.bell-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: var(--ic); }
.bell-ico svg { width: 17px; height: 17px; }
.link { padding: 0; border: 0; background: none; color: var(--blue); font-size: 13.5px; font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* language switch: flash cards that turn over */
.flash { position: relative; display: inline-block; width: 64px; height: 44px; perspective: 400px; flex: none; }
.flash.mini { width: 34px; height: 24px; perspective: none; }
.flash-front, .flash-back { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 7px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .5s var(--ease); box-shadow: 0 0 0 1.5px var(--line-2), 0 4px 8px -4px rgba(0, 0, 0, .3); }
.flash-front .flag { width: 100%; height: 100%; }
.flash-back { transform: rotateY(180deg); background: var(--yellow); color: #14162b; font-size: 11px; font-weight: 800; }
.card-opt:hover .flash-front, .card-opt:focus-visible .flash-front { transform: rotateY(-180deg); }
.card-opt:hover .flash-back, .card-opt:focus-visible .flash-back { transform: rotateY(0); }
.card-btn { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 7px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
.card-btn:hover { border-color: var(--line-2); }
.card-code { font: 400 11.5px var(--mono); letter-spacing: .05em; }
.card-menu { right: 0; top: calc(100% + 10px); width: 300px; padding: 14px; }
.card-head { margin: 0 0 12px 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.card-deck { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-opt { display: grid; justify-items: center; gap: 8px; padding: 12px 6px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--soft); }
.card-opt:nth-child(odd) { transform: rotate(-1.5deg); } .card-opt:nth-child(even) { transform: rotate(1.5deg); }
.card-opt:hover { border-color: var(--line-2); }
.card-opt[aria-current="true"] { border-color: var(--blue); background: var(--blue-soft); }
.card-name { font-size: 13.5px; font-weight: 600; }

/* page frame + today rail */
.wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; max-width: 1600px; margin: 0 auto; padding: 26px 22px 30px; align-items: start; }
.rail-hidden .wrap { grid-template-columns: minmax(0, 1fr); }
.rail-hidden .rail { display: none; }
.main { min-width: 0; outline: none; }
.rail { position: sticky; top: 118px; display: grid; gap: 16px; max-height: calc(100vh - 140px); padding: 18px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); overflow-y: auto; }
.rail-head { display: flex; justify-content: space-between; align-items: flex-start; }
.rail-head h2 { font-size: 22px; }
.rail-day { color: var(--muted); font-size: 13px; }
.rail-close, .rail-scrim { display: none !important; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.week button { display: grid; gap: 1px; padding: 6px 0; border: 0; border-radius: 10px; background: none; font-size: 11px; color: var(--muted); }
.week button b { color: var(--text); font-size: 15px; }
.week button i { width: 5px; height: 5px; margin: 2px auto 0; border-radius: 50%; background: var(--pink); }
.week button[aria-pressed="true"] { background: var(--blue); color: #dfe4ff; }
.week button[aria-pressed="true"] b { color: #fff; }
.agenda { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.agenda li { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 12px; background: var(--soft); border-left: 4px solid var(--ac, var(--blue)); }
.agenda time { font: 400 11.5px var(--mono); color: var(--muted); padding-top: 2px; }
.agenda b { display: block; font-size: 14px; line-height: 1.3; }
.agenda small { color: var(--muted); font-size: 12.5px; }
.agenda .empty { grid-template-columns: 1fr; border-left-color: var(--line-2); color: var(--muted); }
.rail-note { padding: 12px; border: 1.5px dashed var(--line-2); border-radius: 12px; font-size: 13px; color: var(--muted); }
.rail-note .hl { display: inline-block; margin-bottom: 4px; color: var(--text); font-weight: 800; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; margin-top: 34px; padding-top: 16px; border-top: 1.5px solid var(--line); color: var(--faint); font-size: 12.5px; }

/* layout */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.eyebrow { margin-bottom: 8px; color: var(--blue); font: 400 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.page-head > div:first-child { min-width: 0; max-width: 100%; }
.page-head h1 { font-size: clamp(28px, 3.6vw, 44px); overflow-wrap: anywhere; }
.lead { max-width: 64ch; margin-top: 10px; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.card { min-width: 0; padding: 20px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.card-head h2 { font-size: 18px; }
.card-head p { margin-top: 3px; color: var(--muted); font-size: 13.5px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.keys > span { display: inline-flex; align-items: center; gap: 6px; }
.keys i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.empty { padding: 28px 12px; color: var(--muted); text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 20px; background: var(--c, var(--soft)); color: var(--ic, var(--text)); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--bc, var(--blue)); }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { position: relative; display: grid; gap: 2px; padding: 18px 18px 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.stat-ico { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--c) 28%, transparent); color: var(--text); transform: rotate(6deg); }
.stat-ico svg { width: 19px; height: 19px; }
.stat small { color: var(--muted); font-size: 13px; padding-right: 44px; }
.stat b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stat span[data-e] { color: var(--muted); font-size: 12.5px; }
.chart { position: relative; height: 260px; }
.chart > svg { width: 100%; height: 100%; overflow: visible; stroke: none; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .axis { fill: var(--faint); font: 400 10px var(--mono); }
.chart .bar-a { fill: var(--blue); }
.chart .bar-b { fill: var(--mint-ink); }
.chart .is-hover { filter: brightness(1.15); }
.chart .hit { fill: transparent; }
.tip { position: absolute; z-index: 5; min-width: 140px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; }
.tip b { display: block; }
.tip div { display: flex; justify-content: space-between; gap: 14px; }
.dist { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 10px; height: 220px; }
.dist div { display: grid; align-content: end; justify-items: center; gap: 6px; height: 100%; }
.dist i { width: 100%; max-width: 46px; border-radius: 10px 10px 4px 4px; background: var(--gc); min-height: 4px; transition: height .5s var(--ease); }
.dist b { font-size: 18px; }
.dist small { color: var(--muted); font: 400 11px var(--mono); }
.progress-list, .people { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.progress-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.progress-list b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-list small { color: var(--muted); font-size: 12.5px; }
.progress-list .pct { font: 400 13px var(--mono); }
.cover-mini { width: 44px; height: 44px; border-radius: 12px; }
.people li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.people b { display: block; }
.people small { color: var(--muted); font-size: 12.5px; }
.feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin: 0; padding: 0; list-style: none; }
.feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1.5px dashed var(--line); font-size: 14px; }
.feed small { color: var(--faint); font: 400 11px var(--mono); }
.feed-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--c); }
.feed-ico svg { width: 16px; height: 16px; }

/* course covers */
.cover { position: relative; overflow: hidden; background-color: var(--cc); }
.cover.p0 { background-image: radial-gradient(circle at 30% 120%, rgba(255, 255, 255, .35) 0 30%, transparent 31%), radial-gradient(circle at 90% -10%, rgba(0, 0, 0, .14) 0 35%, transparent 36%); }
.cover.p1 { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .18) 0 10px, transparent 10px 22px); }
.cover.p2 { background-image: radial-gradient(rgba(255, 255, 255, .35) 2px, transparent 2.5px); background-size: 14px 14px; }
.cover.p3 { background-image: linear-gradient(90deg, rgba(0, 0, 0, .12) 50%, transparent 50%), linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%); background-size: 40px 40px; }
.cover.p4 { background-image: repeating-radial-gradient(circle at 100% 100%, rgba(255, 255, 255, .22) 0 6px, transparent 6px 16px); }
.cover.p5 { background-image: conic-gradient(from 30deg at 70% 40%, rgba(255, 255, 255, .25) 0 25%, transparent 25% 50%, rgba(0, 0, 0, .1) 50% 75%, transparent 75%); }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.course { display: flex; flex-direction: column; min-width: 0; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s var(--ease); }
.course:hover { transform: translateY(-3px); }
.course .cover { height: 110px; }
.course .cover .pill { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .92); color: #14162b; }
.course .cover .lvl { position: absolute; right: 12px; top: 12px; padding: 2px 8px; border-radius: 6px; background: rgba(20, 22, 43, .55); color: #fff; font: 400 10.5px var(--mono); }
.course-body { display: grid; gap: 8px; padding: 16px; flex: 1; }
.course-body h3 { font-size: 17px; }
.course-body p { color: var(--muted); font-size: 13.5px; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12.5px; }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-meta svg { width: 15px; height: 15px; }
.course-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1.5px solid var(--line); }
.course-foot .btn { flex: 1; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches label { position: relative; width: 38px; height: 38px; border-radius: 10px; background: var(--cc); cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--text); }
.swatches label:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 4px; }

/* builder */
.summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.summary span { padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); font-size: 13.5px; }
.summary b { font-weight: 800; }
.builder { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.tree { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.module { border: 1.5px solid var(--line); border-radius: 14px; background: var(--soft); }
.module-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; }
.module-head input { flex: 1; width: 0; min-width: 0; padding: 4px 6px; border: 1.5px solid transparent; border-radius: 8px; background: none; font-weight: 800; }
.module-head input:hover, .module-head input:focus { border-color: var(--line-2); background: var(--card); outline: none; }
.module-head .mono { color: var(--faint); font-size: 11px; }
.lessons { display: grid; gap: 4px; min-height: 12px; margin: 0; padding: 0 8px 8px; list-style: none; }
.lesson { display: grid; grid-template-columns: 22px 28px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 7px 8px; border: 1.5px solid transparent; border-radius: 10px; background: var(--card); font-size: 14px; cursor: pointer; }
.lesson:hover { border-color: var(--line-2); }
.lesson[aria-selected="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.lesson.is-dragging { opacity: .9; box-shadow: var(--shadow); position: relative; z-index: 5; }
.lesson.is-draft .l-title { color: var(--faint); }
.lesson .l-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson .l-min { color: var(--faint); font: 400 11px var(--mono); }
.handle { display: grid; place-items: center; width: 22px; height: 28px; padding: 0; border: 0; background: none; color: var(--faint); cursor: grab; touch-action: none; }
.handle svg { width: 16px; height: 16px; }
.l-type { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--tc); color: #14162b; }
.l-type svg { width: 15px; height: 15px; }
.l-moves { display: flex; }
.l-moves button { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--faint); }
.l-moves button:hover { background: var(--soft); color: var(--text); }
.l-moves svg { width: 15px; height: 15px; }
.drop-line { height: 3px; margin: -1px 6px; border-radius: 2px; background: var(--blue); }
.add-lesson { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 10px; }
.editor-card { position: sticky; top: 130px; }
.editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.editor-head h2 { font-size: 18px; flex: 1; }
.type-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.type-pick label { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: center; }
.type-pick label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.type-pick input { position: absolute; opacity: 0; }
.type-pick label:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }

/* students */
.table-wrap { position: relative; overflow-x: auto; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 11px 14px; border-bottom: 1.5px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12.5px; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--soft); }
tr.is-selected td { background: var(--yellow-soft) !important; }
td.num, th.num { text-align: right; }
.tick-col { width: 42px; padding-right: 0; }
.tick { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); vertical-align: middle; }
.sort { padding: 0; border: 0; background: none; font: inherit; color: inherit; }
.sort::after { content: " ↕"; opacity: .4; }
.sort[data-dir="asc"]::after { content: " ↑"; opacity: 1; }
.sort[data-dir="desc"]::after { content: " ↓"; opacity: 1; }
.who { display: flex; align-items: center; gap: 10px; }
.who button { padding: 0; border: 0; background: none; text-align: left; font-weight: 600; }
.who button:hover { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 4px; text-underline-offset: -1px; }
.who small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--cc); }
.prog { display: grid; grid-template-columns: 110px auto; align-items: center; gap: 10px; }
.prog .mono { font-size: 12px; color: var(--muted); }
.grade { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--gc, var(--soft)); color: #14162b; font-weight: 800; font-size: 13px; }
.bulk { position: sticky; top: 112px; z-index: 10; display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-bottom: 12px; padding: 10px 14px; border-radius: 14px; background: var(--blue); color: #fff; box-shadow: var(--shadow); }
.bulk > b { align-self: center; }
.bulk .mini-field span { color: #cdd5ff; }
.bulk .btn { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12); color: #fff; }
.bulk .btn-primary { background: var(--yellow); border-color: var(--yellow); color: #14162b; }
.pager { margin-top: 10px; color: var(--muted); font-size: 13px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; display: flex; flex-direction: column; width: min(440px, 100vw); background: var(--card); border-left: 1.5px solid var(--line); box-shadow: var(--shadow); animation: slide .25s var(--ease); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 1.5px solid var(--line); }
.drawer-head .who b { font-size: 18px; }
.drawer-body { display: grid; gap: 18px; padding: 20px; overflow-y: auto; }
.drawer-body h3 { font-size: 14px; color: var(--muted); font-weight: 600; }
.enrol { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--soft); border-left: 5px solid var(--cc); }
.enrol-top { display: flex; justify-content: space-between; gap: 10px; }
.enrol small { color: var(--muted); font-size: 12.5px; }
.drawer-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(14, 16, 33, .4); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* grading */
.split { display: grid; grid-template-columns: minmax(260px, 4fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.queue-card { padding: 8px; }
.queue { display: grid; gap: 4px; max-height: 70vh; margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.queue button { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1.5px solid transparent; border-radius: 12px; background: none; text-align: left; }
.queue button:hover { background: var(--soft); }
.queue button[aria-current="true"] { border-color: var(--blue); background: var(--blue-soft); }
.queue b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.queue small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.queue time { color: var(--faint); font: 400 10.5px var(--mono); text-align: right; }
.late { color: var(--red); font-weight: 600; }
.viewer { display: grid; gap: 18px; }
.viewer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.viewer-head > div { flex: 1; min-width: 180px; }
.viewer-head h2 { font-size: 19px; }
.viewer-head p { color: var(--muted); font-size: 13.5px; }
.answer { padding: 16px 18px; border-radius: 12px; background: var(--soft); line-height: 1.7; white-space: pre-line; }
.file { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1.5px dashed var(--line-2); border-radius: 10px; font: 400 12px var(--mono); }
.rubric { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rubric li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.rubric small { display: block; color: var(--muted); font-size: 12.5px; }
.points { display: flex; gap: 4px; }
.points button { width: 34px; height: 34px; padding: 0; border: 1.5px solid var(--line); border-radius: 9px; background: var(--card); font: 400 12px var(--mono); }
.points button:hover { border-color: var(--line-2); }
.points button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.score { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--yellow-soft); }
.score b { font-size: 28px; }
.score .grade { min-width: 44px; height: 40px; font-size: 18px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { padding: 4px 10px; border: 1.5px solid var(--line); border-radius: 20px; background: none; font-size: 12.5px; }
.quick button:hover { border-color: var(--blue); color: var(--blue); }
.back-btn { display: none !important; }

/* quizzes */
.qz { display: grid; grid-template-columns: minmax(220px, 3fr) minmax(0, 8fr); gap: 20px; align-items: start; }
.qz-list-card { padding: 8px; }
.qz-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.qz-list button { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 1.5px solid transparent; border-radius: 12px; background: none; text-align: left; }
.qz-list button:hover { background: var(--soft); }
.qz-list button[aria-current="true"] { border-color: var(--blue); background: var(--blue-soft); }
.qz-list small { color: var(--muted); font-size: 12.5px; }
.qz-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.qz-stats span { padding: 6px 12px; border-radius: 10px; background: var(--soft); font-size: 13px; }
.qz-stats b { font-family: var(--mono); font-weight: 400; }
.questions { display: grid; gap: 14px; margin: 16px 0; padding: 0; list-style: none; counter-reset: q; }
.question { display: grid; gap: 10px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--soft); counter-increment: q; }
.q-top { display: flex; gap: 8px; align-items: flex-start; }
.q-top::before { content: counter(q); display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin-top: 6px; border-radius: 8px; background: var(--yellow); color: #14162b; font-weight: 800; font-size: 13px; }
.q-top textarea { flex: 1; min-height: 44px; resize: vertical; }
.options { display: grid; gap: 6px; margin: 0; padding: 0 0 0 36px; list-style: none; }
.options li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.options input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--mint-ink); }
.options li.is-right .input { border-color: var(--mint-ink); background: var(--mint-soft); }
.q-foot { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 36px; }
.qz-settings { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.take { display: grid; gap: 16px; }
.take fieldset { display: grid; gap: 8px; margin: 0; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; }
.take legend { padding: 0 6px; font-weight: 800; }
.take label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--soft); cursor: pointer; }
.take label.is-right { background: var(--mint-soft); box-shadow: inset 0 0 0 1.5px var(--mint-ink); }
.take label.is-wrong { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red); }
.take input { accent-color: var(--blue); }
.result { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--yellow-soft); }
.result b { font-size: 26px; }

/* settings */
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-panels { display: grid; gap: 20px; min-width: 0; }
.set-nav { position: sticky; top: 130px; display: grid; gap: 4px; }
.set-nav button { padding: 10px 14px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 600; text-align: left; }
.set-nav button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: inset 4px 0 0 var(--yellow), 0 0 0 1.5px var(--line); }
.scale { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.scale li { display: grid; grid-template-columns: 44px 120px minmax(0, 1fr); align-items: center; gap: 12px; }
.scale .input { text-align: right; }
.scale small { color: var(--muted); font-size: 13px; }
.scale-bar { display: flex; height: 14px; margin-bottom: 14px; border-radius: 7px; overflow: hidden; }
.scale-bar i { height: 100%; background: var(--gc); }
.cert { display: grid; justify-items: center; gap: 6px; padding: 28px 20px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); background-image: radial-gradient(var(--dot) 1px, transparent 1.4px); background-size: 18px 18px; text-align: center; }
.cert .seal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--yellow); color: #14162b; transform: rotate(-8deg); }
.cert h3 { font-size: 22px; }
.cert small { color: var(--muted); }
.switches { display: grid; margin: 0; padding: 0; list-style: none; }
.switches li { border-bottom: 1.5px solid var(--line); }
.switches li:last-child { border-bottom: 0; }
.switches label { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; cursor: pointer; }
.switches b { display: block; font-weight: 600; }
.switches small { color: var(--muted); font-size: 13px; }
.switch { -webkit-appearance: none; appearance: none; position: relative; width: 46px; height: 26px; margin: 0; border-radius: 13px; background: var(--line-2); transition: background .2s; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 7px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch:checked { background: var(--blue); }
.switch:checked::after { transform: translateX(20px); }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.danger-zone h2 { font-size: 17px; }
.danger-zone p { color: var(--muted); font-size: 13.5px; }

/* forms + buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; transition: border-color .2s, background .2s, transform .1s; }
.btn:hover { border-color: var(--line-2); background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 4px 0 -1px var(--yellow); }
.btn-primary:hover { border-color: var(--blue-ink); background: var(--blue-ink); }
[data-theme="dark"] .btn-primary { color: #0e1021; }
.btn-danger { border-color: var(--red); background: var(--red); color: #fff; }
.btn-danger:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 85%, #000); }
.btn-ghost { border-color: transparent; background: none; }
.btn-sm { min-height: 32px; padding: 4px 11px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .field > label { color: var(--muted); font-size: 13px; font-weight: 600; }
.input, .select { width: 100%; min-width: 0; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--card); outline: none; transition: border-color .2s, box-shadow .2s; }
textarea.input { resize: vertical; line-height: 1.5; }
.select { -webkit-appearance: none; appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.field.is-invalid .input, .field.is-invalid .select, .input.is-invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12.5px; font-weight: 600; }
.field-search { position: relative; }
.field-search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; color: var(--faint); pointer-events: none; }
.field-search .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; margin-bottom: 16px; }
.tools .field-search { flex: 1 1 220px; max-width: 340px; }
.mini-field { display: grid; gap: 3px; min-width: 0; }
.mini-field > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.mini-field .select, .mini-field .input { padding-top: 7px; padding-bottom: 7px; }
.seg { display: inline-flex; max-width: 100%; padding: 3px; overflow-x: auto; scrollbar-width: none; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
.seg button { padding: 6px 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--yellow); color: #14162b; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--muted); }
.row-actions button:hover { background: var(--soft); color: var(--text); }
.row-actions svg { width: 17px; height: 17px; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }

/* overlays */
dialog.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1.5px solid var(--line); border-radius: 20px; background: var(--card); color: var(--text); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(14, 16, 33, .45); }
dialog.modal[open] { animation: pop .2s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.modal-head h2 { font-size: 20px; }
.modal-body { display: grid; gap: 14px; padding: 18px 22px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }
.palette { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 14vh 12px 12px; background: rgba(14, 16, 33, .4); }
.palette-box { width: min(600px, 100%); border: 1.5px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; animation: pop .18s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1.5px solid var(--line); }
.palette-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; }
.palette-list { max-height: 52vh; margin: 0; padding: 6px; list-style: none; overflow-y: auto; }
.palette-list li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.palette-list li[aria-selected="true"] { background: var(--yellow-soft); }
.palette-list li small { margin-left: auto; color: var(--muted); font: 400 11px var(--mono); }
.palette-list .avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }
.palette-group { padding: 8px 12px 4px; color: var(--faint); font: 400 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: default !important; }
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 95; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 14px; animation: pop .25s var(--ease); }
.toast span { flex: 1; }
.toast svg { width: 18px; height: 18px; color: var(--yellow); }
[data-theme="dark"] .toast svg { color: var(--blue); }
.toast button { padding: 4px 10px; border: 0; border-radius: 8px; background: var(--yellow); color: #14162b; font-weight: 600; font-size: 13px; }
.toast.is-out { opacity: 0; transform: translateY(10px); transition: .25s; }

/* login + 404 */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(980px, 100%); border: 1.5px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.auth-form { display: grid; align-content: center; gap: 22px; padding: clamp(24px, 4.5vw, 52px); }
.auth-form h1 { font-size: 34px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-art { position: relative; display: grid; align-content: end; padding: 40px; background: var(--blue); color: #fff; overflow: hidden; }
.notes { position: absolute; inset: 0; }
.note { position: absolute; width: 150px; height: 120px; border-radius: 6px; box-shadow: 0 14px 24px -12px rgba(0, 0, 0, .5); }
.note::after { content: ""; position: absolute; left: 18px; right: 30px; top: 30px; height: 8px; border-radius: 4px; background: rgba(20, 22, 43, .18); box-shadow: 0 18px 0 rgba(20, 22, 43, .18), 0 36px 0 rgba(20, 22, 43, .12); }
.n1 { left: 40px; top: 40px; background: var(--yellow); transform: rotate(-7deg); }
.n2 { left: 190px; top: 70px; background: var(--pink); transform: rotate(5deg); }
.n3 { left: 110px; top: 170px; background: #8ff0cf; transform: rotate(-2deg); }
.doodle { position: absolute; left: 40px; top: 290px; width: 62%; height: auto; stroke: rgba(255, 255, 255, .6); stroke-width: 3; stroke-dasharray: 8 8; }
.doodle circle { fill: var(--yellow); stroke: none; }
.auth-quote { position: relative; font-size: 19px; font-weight: 800; line-height: 1.4; }
.auth-quote small { display: block; margin-top: 10px; color: #cdd5ff; font-size: 13px; font-weight: 400; }
.auth-top .brand { color: var(--text); }
.pw { position: relative; }
.pw .input { padding-right: 46px; }
.pw button { position: absolute; right: 4px; top: 50%; display: grid; place-items: center; width: 36px; height: 36px; margin-top: -18px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--muted); }
.small { font-size: 13px; }
.lost { display: grid; place-items: center; min-height: 100vh; padding: 70px 16px 30px; }
.lost-card { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 16px; width: min(560px, 100%); padding: clamp(24px, 5vw, 48px); border: 1.5px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); text-align: center; }
.lost-no { font-size: clamp(72px, 16vw, 120px); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.lost h1 { font-size: clamp(24px, 4vw, 30px); }
.lost p { max-width: 420px; color: var(--muted); }
.lost .btn { white-space: normal; }
.lost-lang { position: fixed; top: 16px; right: 16px; z-index: 5; }

/* responsive */
@media (max-width: 1320px) {
    .wrap { grid-template-columns: minmax(0, 1fr); }
    .rail { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(320px, 88vw); max-height: none; border-radius: 0; border-width: 0 0 0 1.5px; transform: translateX(105%); transition: transform .3s var(--ease); }
    .rail-open .rail { transform: none; }
    .rail-hidden .rail { display: grid; }
    .rail-close { display: inline-grid !important; }
    .rail-scrim { display: block !important; position: fixed; inset: 0; z-index: 65; background: rgba(14, 16, 33, .4); }
    .rail-scrim[hidden] { display: none !important; }
    .rail-btn[aria-expanded="true"] { background: none; color: var(--muted); }
}
@media (max-width: 1180px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
    .builder, .qz { grid-template-columns: minmax(0, 1fr); }
    .editor-card { position: static; }
    .feed { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .top-row { padding: 10px 14px 4px; gap: 8px; }
    .search { margin-left: auto; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; justify-content: center; }
    .search span, .search kbd { display: none; }
    .top-actions { margin-left: 0; gap: 2px; }
    .nav { padding: 0 10px; }
    .wrap { padding: 20px 14px 30px; }
    .split { grid-template-columns: minmax(0, 1fr); }
    .split .viewer { display: none; }
    .split.is-open .viewer { display: grid; }
    .split.is-open .queue-card { display: none; }
    .back-btn { display: inline-flex !important; justify-self: start; }
    .settings { grid-template-columns: minmax(0, 1fr); }
    .set-nav { position: static; display: flex; overflow-x: auto; }
    .set-nav button { white-space: nowrap; }
    .auth-box { grid-template-columns: minmax(0, 1fr); }
    .auth-art { display: none; }
    .qz-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qz-settings .field:first-child { grid-column: 1 / -1; }
    .bulk { top: 100px; }
}
@media (max-width: 640px) {
    .brand-word small { display: none; }
    .top-theme { display: none !important; }
    .me-theme { display: flex !important; }
    .top-row { gap: 6px; }
    .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
    .top .menu { position: fixed; left: 12px; right: 12px; top: 62px; width: auto; }
    .card-code { display: none; }
    .icon-btn { width: 36px; height: 36px; }
    .stats { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .stat b { font-size: 26px; }
    .card { padding: 16px; }
    .page-head .head-actions { width: 100%; }
    .page-head .head-actions .btn, .page-head .head-actions .mini-field { flex: 1; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .tools .mini-field { flex: 1 1 150px; }
    .tools .seg { width: 100%; }
    .dist { height: 180px; }
    .lesson { grid-template-columns: 22px 28px minmax(0, 1fr) auto; }
    .lesson .l-min { display: none; }
    .type-pick { grid-template-columns: repeat(2, 1fr); }
    .scale li { grid-template-columns: 40px 100px minmax(0, 1fr); }
    .options { padding-left: 0; }
    .q-foot { padding-left: 0; }
    .rubric li { grid-template-columns: minmax(0, 1fr); }
    .points button { width: 100%; flex: 1; }
    .points { width: 100%; }
    .toasts { right: 12px; width: calc(100vw - 24px); }
    .chart { height: 220px; }
}
@media (max-width: 380px) {
    .top-theme { display: none !important; }
    .me-theme { display: flex !important; }
    .brand-word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
    body { background: #fff; }
    .top, .rail, .foot, .toasts, .head-actions, .tools { display: none !important; }
    .wrap { display: block; padding: 0; }
    .card { box-shadow: none; break-inside: avoid; }
}
