/* ==========================================================================
   Platforma E-Learning 2.0 — design system
   ========================================================================== */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/poppins-regular.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/poppins-medium.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-weight: 600 700; font-style: normal; font-display: swap; src: url("../fonts/poppins-bold.woff") format("woff"); }

:root {
	--primary: #1d6ff2;
	--primary-600: #155fd8;
	--primary-700: #1450b8;
	--primary-50: #eaf2fe;
	--primary-100: #d6e6fd;
	--success: #12b886;
	--success-600: #0ca678;
	--success-50: #e6f8f1;
	--danger: #ef4444;
	--danger-50: #fdecec;
	--warning: #f59f00;
	--warning-50: #fff5e0;
	--ink: #0f1f3d;
	--ink-2: #33415c;
	--muted: #6b7a93;
	--muted-2: #98a4b8;
	--line: #e4ebf5;
	--line-2: #eef3fa;
	--bg: #eef4fc;
	--surface: #ffffff;
	--surface-2: #f6f9fe;
	--radius-sm: 10px;
	--radius: 14px;
	--radius-lg: 20px;
	--shadow-sm: 0 1px 2px rgba(16, 42, 90, .06);
	--shadow: 0 6px 24px -8px rgba(16, 42, 90, .14), 0 1px 3px rgba(16, 42, 90, .05);
	--shadow-lg: 0 24px 48px -16px rgba(16, 42, 90, .25);
	--font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
	--font-display: "Poppins", var(--font);
	--nav-h: 68px;
	--tabbar-h: 64px;
	--container: 1320px;
	--progress: linear-gradient(90deg, #1d6ff2, #12b886);
	color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.55;
	color: var(--ink);
	background: var(--bg);
	background-image:
		radial-gradient(1200px 600px at 100% -10%, rgba(29, 111, 242, .10), transparent 60%),
		radial-gradient(900px 500px at -10% 110%, rgba(18, 184, 134, .07), transparent 60%);
	background-attachment: fixed;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 3px solid rgba(29, 111, 242, .45); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 8px !important; } .mt-2 { margin-top: 16px !important; } .mt-3 { margin-top: 24px !important; }
.mb-1 { margin-bottom: 8px !important; } .mb-2 { margin-bottom: 16px !important; } .mb-3 { margin-bottom: 24px !important; }
.green { color: var(--success-600); } .red { color: var(--danger); }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.page { padding: 24px 0 48px; }
.grid { display: grid; gap: 20px; }
.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)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.split-left { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- Cards ---------- */
.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	padding: 22px;
	min-width: 0;
}
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; margin: 0; }
.card-link { font-size: .85rem; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.card-link .icon { width: 15px; height: 15px; }
.glass {
	background: rgba(255, 255, 255, .82);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid rgba(255, 255, 255, .7);
}

/* ---------- Buttons ---------- */
.btn {
	--b: var(--primary);
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 42px; padding: 0 18px;
	border-radius: 12px; border: 1px solid transparent;
	font: 600 .92rem/1 var(--font); letter-spacing: .005em;
	cursor: pointer; text-decoration: none; white-space: nowrap;
	transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(29, 111, 242, .6); }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 6px 16px -6px rgba(18, 184, 134, .55); }
.btn-success:hover { background: var(--success-600); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary-100); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-700); background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-soft { background: var(--primary-50); color: var(--primary-700); }
.btn-soft:hover { background: var(--primary-100); color: var(--primary-700); }
.btn-white { background: #fff; color: var(--primary-700); box-shadow: var(--shadow); }
.btn-white:hover { color: var(--primary); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .84rem; border-radius: 10px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; }
.btn-icon.btn-sm { width: 34px; min-height: 34px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 500; color: var(--primary); }
.back-link .icon { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.input, .select, .textarea {
	width: 100%; min-height: 46px;
	padding: 10px 14px;
	font: 400 .95rem/1.4 var(--font); color: var(--ink);
	background: #fff; border: 1px solid #d9e2ef; border-radius: 12px;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none; appearance: none;
}
.textarea { min-height: 110px; resize: vertical; }
.select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.input:hover, .select:hover, .textarea:hover { border-color: #c5d3e6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(29, 111, 242, .14); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 18px; height: 18px; pointer-events: none; }
.input-icon .input { padding-left: 44px; }
.input-icon .input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.input-icon .input-action:hover { background: var(--surface-2); color: var(--ink); }
.input-icon .input-action .icon { width: 18px; height: 18px; }
.checkbox { display: inline-flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
fieldset { border: 0; padding: 0; margin: 0; }
.input-inline { display: flex; gap: 8px; align-items: center; }
.input-inline .input { min-width: 0; }

/* ---------- Badges, pills, progress ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge-primary { background: var(--primary-50); color: var(--primary-700); }
.badge-success { background: var(--success-50); color: var(--success-600); }
.badge-danger { background: var(--danger-50); color: #c92a2a; }
.badge-warning { background: var(--warning-50); color: #b26b00; }
.progress { height: 8px; border-radius: 999px; background: #e7eef8; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--progress); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress-sm { height: 6px; }
.progress-lg { height: 10px; }
.progress-subject > span { background: var(--c, var(--primary)); }
.progress-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.progress-meta strong { color: var(--ink); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); display: inline-block; }

/* ---------- Toasts / flash ---------- */
.toasts { position: fixed; top: calc(var(--nav-h) + 12px); right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.toast {
	display: flex; align-items: flex-start; gap: 10px;
	padding: 14px 14px 14px 16px; border-radius: 14px;
	background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
	font-size: .9rem; color: var(--ink);
	animation: toast-in .35s cubic-bezier(.2,.9,.3,1.2);
}
.toast > .icon { width: 20px; height: 20px; margin-top: 1px; }
.toast span { flex: 1; }
.toast-success > .icon { color: var(--success); }
.toast-error > .icon { color: var(--danger); }
.toast-info > .icon { color: var(--primary); }
.toast-warning > .icon { color: var(--warning); }
.toast-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; display: grid; }
.toast-close .icon { width: 16px; height: 16px; }
.toast.is-leaving { opacity: 0; transform: translateX(16px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--primary-50); color: var(--primary-700); font-size: .9rem; }
.alert .icon { width: 20px; height: 20px; margin-top: 1px; }
.alert-warning { background: var(--warning-50); color: #8a5300; }
.alert-success { background: var(--success-50); color: #087f5b; }
.alert-danger { background: var(--danger-50); color: #b42318; }

/* ==========================================================================
   App shell: top navigation + mobile tab bar
   ========================================================================== */
.topbar {
	position: sticky; top: 0; z-index: 100;
	height: var(--nav-h);
	background: rgba(255, 255, 255, .86);
	-webkit-backdrop-filter: blur(16px) saturate(1.6);
	backdrop-filter: blur(16px) saturate(1.6);
	border-bottom: 1px solid rgba(228, 235, 245, .9);
}
.topbar .container { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--ink); white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; color: var(--primary); display: grid; place-items: center; }
.brand-mark svg { width: 32px; height: 32px; }
.brand small { display: block; font: 400 .72rem/1.2 var(--font); color: var(--muted); letter-spacing: 0; }
.mainnav { display: flex; align-items: stretch; gap: 4px; height: 100%; flex: 1; }
.mainnav a {
	position: relative; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
	padding: 0 14px; font-size: .9rem; font-weight: 500; color: var(--ink-2);
}
.mainnav a .icon { width: 17px; height: 17px; opacity: .75; }
.mainnav a:hover { color: var(--primary); }
.mainnav a.active { color: var(--primary); font-weight: 600; }
.mainnav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn .pip { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 600 .85rem/1 var(--font-display); color: #fff; background: linear-gradient(135deg, #1d6ff2, #12b886); flex: none; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(16,42,90,.2); }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 14px; border: 0; background: transparent; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.user-chip:hover { background: var(--surface-2); }
.user-chip strong { display: block; white-space: nowrap; font-size: .86rem; line-height: 1.2; color: var(--ink); }
.user-chip small { display: block; font-size: .74rem; color: var(--muted); line-height: 1.2; }
.user-chip .icon { width: 16px; height: 16px; color: var(--muted); }

.dropdown { position: relative; }
.dropdown-menu {
	position: absolute; right: 0; top: calc(100% + 8px); z-index: 120;
	min-width: 240px; padding: 8px;
	background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
	opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .16s ease;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-size: .9rem; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.dropdown-menu a:hover, .dropdown-menu button.menu-item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-menu .icon { width: 17px; height: 17px; color: var(--muted); }
.dropdown-menu .menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dropdown-head { padding: 10px 12px 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.notif { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.notif:hover { background: var(--surface-2); color: var(--ink); }
.notif-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--success-50); color: var(--success-600); flex: none; }
.notif-ico.bad { background: var(--danger-50); color: var(--danger); }
.notif-ico .icon { width: 18px; height: 18px; }
.notif small { display: block; color: var(--muted); font-size: .76rem; }
.notif-menu { width: 320px; }

.hamburger { display: none; }

/* mobile bottom tab bar */
.tabbar {
	display: none;
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
	height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
	padding-bottom: env(safe-area-inset-bottom);
	background: rgba(255,255,255,.95);
	-webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
	border-top: 1px solid var(--line);
	box-shadow: 0 -6px 20px -12px rgba(16, 42, 90, .25);
}
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .7rem; font-weight: 500; color: var(--muted); background: none; border: 0; font-family: inherit; cursor: pointer; }
.tabbar .icon { width: 22px; height: 22px; }
.tabbar a.active { color: var(--primary); }
.tabbar a.active .icon { stroke-width: 2.4; }

/* off-canvas drawer (mobile "Więcej") */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 31, 61, .4); z-index: 200; opacity: 0; visibility: hidden; transition: all .2s; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: #fff; z-index: 210; transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; padding: 18px; box-shadow: var(--shadow-lg); overflow-y: auto; }
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.drawer nav a, .drawer nav button { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.drawer nav a.active { background: var(--primary-50); color: var(--primary-700); }
.drawer nav a:hover { background: var(--surface-2); }
.drawer nav .icon { width: 20px; height: 20px; }

.footer { padding: 24px 0 32px; color: var(--muted); font-size: .82rem; }
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ==========================================================================
   Hero banners
   ========================================================================== */
.hero {
	position: relative; overflow: hidden;
	border-radius: var(--radius-lg);
	background: #cfe2fb url("../img/v2/hero-sky.jpg") center 30%/cover no-repeat;
	box-shadow: var(--shadow);
	isolation: isolate;
}
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(255,255,255,.97) 0%, rgba(255,255,255,.9) 32%, rgba(255,255,255,.35) 62%, rgba(255,255,255,0) 100%); }
.hero-plane { position: absolute; z-index: -1; right: 3%; top: 6%; width: min(46%, 560px); transform: rotate(-7deg); filter: drop-shadow(0 22px 22px rgba(20, 50, 100, .28)); animation: plane-float 9s ease-in-out infinite; pointer-events: none; }
@keyframes plane-float { 0%,100% { transform: translate(0,0) rotate(-7deg); } 50% { transform: translate(-10px,-8px) rotate(-6deg); } }
.hero-inner { padding: 22px 28px 26px; display: flex; align-items: center; gap: 22px; min-height: 170px; }
.hero-icon { width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: var(--c, #1d6ff2); background: linear-gradient(140deg, var(--c, #1d6ff2), color-mix(in srgb, var(--c, #1d6ff2) 70%, #000)); box-shadow: 0 14px 26px -12px var(--c, #1d6ff2); flex: none; }
.hero-icon .icon { width: 38px; height: 38px; }
.hero h1 { margin: 0 0 6px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: .9rem; }
.hero-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.hero-progress { margin-left: auto; width: 290px; padding: 16px 18px; border-radius: 16px; }
.hero-progress .label { margin: 0 0 10px; font-size: .84rem; }
.hero-progress .row { gap: 12px; }
.hero-progress .progress { flex: 1; }
.hero .back-link { margin: 18px 28px 0; }

.hero-welcome { background-position: center 60%; color: #fff; }
.hero-welcome::before { background: linear-gradient(100deg, rgba(14, 67, 160, .92) 0%, rgba(29, 111, 242, .78) 38%, rgba(29, 111, 242, .2) 70%, rgba(29, 111, 242, 0) 100%); }
.hero-welcome h1, .hero-welcome p { color: #fff; }
.hero-welcome p { opacity: .92; max-width: 520px; }
.hero-welcome .glass p, .hero-welcome .glass .muted { color: var(--muted); opacity: 1; }
.hero-welcome .glass h3 { color: var(--ink); }
.hero-welcome .hero-inner { align-items: stretch; padding: 28px; min-height: 230px; }
.welcome-progress { margin-top: 18px; max-width: 420px; padding: 16px 18px; border-radius: 16px; color: var(--ink); }
.welcome-progress .value { font: 700 1.6rem/1 var(--font-display); color: var(--ink); }
.next-card { width: 250px; margin-left: auto; align-self: center; padding: 18px; border-radius: 18px; color: var(--ink); }
.next-card .eyebrow { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.next-card .eyebrow span:first-child { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary); color: #fff; }
.next-card .eyebrow .icon { width: 17px; height: 17px; }
.next-card h3 { margin: 0 0 4px; }

.hero-compact .hero-inner { min-height: 0; padding-top: 10px; padding-bottom: 16px; }
.hero-compact .hero-icon { width: 54px; height: 54px; border-radius: 15px; }
.hero-compact .hero-icon .icon { width: 26px; height: 26px; }
.hero-compact h1 { font-size: 1.45rem; margin-bottom: 2px; }
.hero-compact .back-link { margin-top: 14px; }
.hero-compact .hero-plane { width: min(30%, 360px); top: -6%; }
.hero-compact .hero-progress { padding: 12px 16px; }

.card-flush > .hero .hero-plane { width: min(34%, 300px); top: 10%; right: 2%; opacity: .95; }

/* tabs under hero */
.tabs { display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; font-weight: 500; font-size: .9rem; color: var(--ink-2); white-space: nowrap; border: 0; background: none; cursor: pointer; font-family: inherit; }
.tab .icon { width: 18px; height: 18px; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.active { background: var(--primary-50); color: var(--primary-700); font-weight: 600; box-shadow: inset 0 -2px 0 var(--primary); }

/* stepper */
.stepper { display: flex; align-items: center; gap: 12px; padding: 16px 22px; }
.step { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.step.active { color: var(--primary-700); font-weight: 600; }
.step.active .step-num { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 0 0 5px var(--primary-50); }
.step.done .step-num { background: var(--success); color: #fff; border-color: var(--success); }
.step-line { flex: 1; height: 2px; background: var(--line); border-radius: 2px; min-width: 20px; }

/* ==========================================================================
   Lists
   ========================================================================== */
.subject-tile {
	position: relative; display: flex; flex-direction: column; gap: 10px;
	padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line);
	color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s;
	min-width: 0;
}
.subject-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary-100); color: var(--ink); }
.subject-tile .name { font-weight: 600; font-size: .92rem; line-height: 1.3; min-height: 2.6em; }
.subject-tile .pct { font-size: .8rem; font-weight: 700; color: var(--c, var(--primary)); }
.s-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--cbg, var(--primary-50)); color: var(--c, var(--primary)); flex: none; }
.s-icon .icon { width: 20px; height: 20px; }
.s-icon-solid { background: var(--c, var(--primary)); color: #fff; box-shadow: 0 8px 16px -8px var(--c, var(--primary)); }
.s-icon-lg { width: 48px; height: 48px; border-radius: 14px; }
.s-icon-lg .icon { width: 24px; height: 24px; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow strong { display: block; font-size: .92rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.list-item .grow small { display: block; font-size: .8rem; color: var(--muted); }
.list-link { color: inherit; }
.list-link:hover { color: inherit; background: var(--surface-2); }
a.list-item { color: var(--ink); border-radius: 12px; padding-left: 10px; padding-right: 10px; }
a.list-item:hover { background: var(--surface-2); color: var(--ink); }
.list-item .chev { color: var(--muted-2); width: 18px; height: 18px; }

.result-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.result-ico.ok { background: var(--success-50); color: var(--success-600); }
.result-ico.bad { background: var(--danger-50); color: var(--danger); }

/* material rows */
.material {
	display: flex; align-items: center; gap: 14px;
	padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
	background: #fff; transition: border-color .15s, box-shadow .15s, background .15s;
	min-width: 0;
}
.material + .material { margin-top: 10px; }
.material:hover { border-color: var(--primary-100); box-shadow: var(--shadow-sm); }
.file-ico { width: 40px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: #fdecec; color: #e03131; flex: none; position: relative; }
.file-ico .icon { width: 20px; height: 20px; }
.file-ico.video { background: #f1eafe; color: #7c3aed; }
.file-ico.other { background: var(--primary-50); color: var(--primary); }
.material .grow strong { display: block; font-size: .92rem; font-weight: 600; color: var(--ink); word-break: break-word; }
.material .grow small { display: block; font-size: .78rem; color: var(--muted); }
.material .seen { color: var(--success); width: 22px; height: 22px; display: none; }
.material.is-seen .seen { display: block; }
.material.is-active { background: var(--primary); border-color: var(--primary); box-shadow: 0 10px 24px -12px rgba(29,111,242,.8); }
.material.is-active strong, .material.is-active small, .material.is-active .chev { color: #fff; }
.material.is-active .file-ico { background: rgba(255,255,255,.2); color: #fff; }
.material-missing { opacity: .6; }

/* info list */
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.info-list li:last-child { border-bottom: 0; }
.info-list .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.info-list .ico .icon { width: 19px; height: 19px; }
.info-list small { display: block; font-size: .76rem; color: var(--muted); }
.info-list strong { display: block; font-size: .95rem; }

/* quick links */
.quick a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.quick a:hover { background: var(--surface-2); color: var(--ink); }
.quick a .icon:first-child { width: 19px; height: 19px; color: var(--primary); }
.quick a .chev { margin-left: auto; color: var(--muted-2); width: 17px; height: 17px; }

/* stat tiles */
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 16px; }
.stat-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); margin-bottom: 4px; }
.stat-ico .icon { width: 26px; height: 26px; }
.stat-label { font-size: .82rem; color: var(--muted); }
.stat-value { font: 700 1.6rem/1.1 var(--font-display); color: var(--ink); }
.stat-row { flex-direction: row; text-align: left; gap: 14px; padding: 18px; }
.stat-row .stat-ico { margin: 0; width: 48px; height: 48px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-weight: 600; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions form { display: inline; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 32px; height: 32px; font-size: .74rem; box-shadow: none; }
.cell-user strong { display: block; font-weight: 600; }
.cell-user small { color: var(--muted); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: var(--muted-2); margin-bottom: 10px; }
.empty h3 { color: var(--ink-2); }

.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: 10px; font-size: .86rem; font-weight: 600; color: var(--ink-2); border: 1px solid var(--line); background: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { min-height: 42px; width: auto; }
.toolbar .input-icon { flex: 1 1 220px; }
.toolbar .input-icon .input { width: 100%; }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 520px) 1fr; background: #fff; }
.auth-panel { display: flex; flex-direction: column; padding: 40px clamp(24px, 5vw, 64px); min-height: 100vh; }
.auth-panel .brand { font-size: 1.35rem; }
.auth-panel .brand-mark svg { width: 38px; height: 38px; }
.auth-tagline { font-size: .86rem; color: var(--muted); margin: 6px 0 0 48px; }
.auth-form { margin: auto 0; padding: 40px 0; width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 2rem; margin-bottom: 8px; }
.auth-form .lead { color: var(--muted); margin-bottom: 28px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 22px; font-size: .86rem; flex-wrap: wrap; }
.auth-foot { text-align: center; font-size: .88rem; color: var(--muted); margin-top: 22px; }
.auth-copy { font-size: .78rem; color: var(--muted-2); }
.auth-visual { position: relative; overflow: hidden; background: #17528c url("../img/v2/login-sky-ppl.jpg") center/cover no-repeat; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(28px, 5vw, 64px); color: #fff; isolation: isolate; }
.auth-visual::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 50, 104, .05) 0%, rgba(8, 50, 104, 0) 40%, rgba(8, 54, 108, .55) 72%, rgba(6, 40, 86, .82) 100%); }
.auth-visual .hero-plane { top: 14%; right: 8%; width: min(60%, 620px); }
.auth-visual h2 { color: #fff; font-size: clamp(1.6rem, 1rem + 2vw, 2.6rem); max-width: 560px; margin-bottom: 10px; }
.auth-visual p { color: rgba(255,255,255,.88); max-width: 520px; }
.feature-row { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.feature { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: .86rem; color: rgba(255,255,255,.92); }
.feature span { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.feature .icon { width: 22px; height: 22px; }

/* organisation logo on the login page */
.auth-org { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); text-decoration: none; opacity: .9; transition: opacity .15s; align-self: flex-start; }
.auth-org:hover { opacity: 1; color: var(--ink-2); }
.auth-org img { width: 64px; height: auto; filter: drop-shadow(0 2px 4px rgba(16,42,90,.15)); }
.auth-org strong { display: block; font-size: .86rem; color: var(--ink-2); font-weight: 600; }
.auth-org small { display: block; font-size: .74rem; color: var(--muted-2); }
.auth-visual .hero-airplane { top: 9%; right: 6%; width: min(70%, 640px); }

/* ==========================================================================
   Chat
   ========================================================================== */
.chat { position: relative; display: flex; flex-direction: column; height: calc(100vh - var(--nav-h) - 170px); min-height: 460px; }
.chat-list { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, var(--surface-2), #fff 140px); scroll-behavior: auto; }
.chat-more { text-align: center; margin-bottom: 6px; }
.chat-day { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg .avatar { width: 36px; height: 36px; font-size: .78rem; box-shadow: none; margin-top: 2px; }
.msg-body { flex: 1; min-width: 0; max-width: 820px; background: #fff; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 10px 14px 12px; box-shadow: var(--shadow-sm); }
.msg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 4px; }
.msg-head strong { font-size: .9rem; color: var(--ink); }
.msg-head time { font-size: .76rem; color: var(--muted); }
.msg-head .badge { padding: 2px 8px; font-size: .7rem; }
.msg-del { margin-left: auto; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-del, .msg-del:focus-within { opacity: 1; }
.msg-del .btn { width: 28px; min-height: 28px; color: var(--muted); }
.msg-del .btn:hover { color: var(--danger); }
.msg-text { font-size: .93rem; color: var(--ink-2); line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-text a { text-decoration: underline; }
.msg-mine .msg-body { border-color: var(--primary-100); background: #f7fbff; }
.msg-admin .msg-body { background: linear-gradient(180deg, #fff8e6, #fffbf1); border-color: #ffd98a; box-shadow: 0 4px 14px -8px rgba(245, 159, 0, .45); border-left: 4px solid var(--warning); }
.msg-admin .msg-head strong { color: #8a5300; }
.avatar-admin { background: linear-gradient(135deg, #f59f00, #e8590c) !important; }
.chat-form { display: flex; align-items: flex-end; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fff; }
.chat-form .avatar { width: 38px; height: 38px; font-size: .8rem; box-shadow: none; margin-bottom: 4px; }
.chat-form .textarea { min-height: 46px; max-height: 180px; resize: none; padding: 12px 14px; line-height: 1.4; }
.chat-form .btn { min-height: 46px; }
.chat-new { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); box-shadow: var(--shadow-lg); z-index: 5; }
.m-3 { margin: 16px; }

/* ==========================================================================
   Learning / PDF viewer
   ========================================================================== */
.viewer { display: flex; flex-direction: column; height: calc(100vh - var(--nav-h) - 40px); min-height: 520px; max-height: 1100px; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.viewer-bar .file-name { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; flex: 1 1 200px; }
.viewer-bar .file-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar .file-name .icon { color: var(--primary); }
.viewer-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.viewer-tools .group { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.viewer-tools .group .btn-icon { width: 34px; min-height: 34px; border-radius: 9px; }
.page-input { width: 46px; min-height: 30px; text-align: center; border: 0; font: 600 .88rem var(--font); color: var(--ink); background: transparent; -moz-appearance: textfield; }
.page-input::-webkit-outer-spin-button, .page-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.page-total { font-size: .86rem; color: var(--muted); padding-right: 8px; white-space: nowrap; }
.zoom-label { min-width: 52px; text-align: center; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.viewer-body { flex: 1; display: flex; min-height: 0; background: var(--surface-2); }
.thumbs { width: 132px; flex: none; overflow-y: auto; padding: 12px; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; gap: 12px; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; background: none; font: inherit; color: var(--muted); font-size: .72rem; }
.thumb canvas { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 4px rgba(16,42,90,.18); background: #fff; display: block; }
.thumb.active { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.thumb-ph { width: 100%; aspect-ratio: 1 / 1.414; background: #f1f4f9; border-radius: 4px; }
.pages { flex: 1; overflow: auto; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 18px; scroll-behavior: smooth; position: relative; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 4px 20px -6px rgba(16, 42, 90, .25); border-radius: 6px; overflow: hidden; flex: none; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-page .page-num { position: absolute; right: 10px; bottom: 8px; font-size: .72rem; color: var(--muted-2); }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); gap: 10px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--primary-100); border-top-color: var(--primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer.is-fullscreen { position: fixed; inset: 0; z-index: 400; height: 100vh; border-radius: 0; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ==========================================================================
   Test
   ========================================================================== */
.test-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 22px; }
.test-head .title { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; min-width: 0; }
.test-head h1 { font-size: 1.15rem; margin: 0; }
.timer { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font: 700 1rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); }
.timer .icon { color: var(--primary); width: 18px; height: 18px; }
.timer.warn { background: var(--warning-50); border-color: #ffd8a8; color: #b26b00; }
.timer.warn .icon { color: var(--warning); }
.timer.danger { background: var(--danger-50); border-color: #ffc9c9; color: #c92a2a; animation: pulse 1s ease-in-out infinite; }
.timer.danger .icon { color: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, .12); } }
.test-progress { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.test-progress .count { font: 700 .95rem var(--font-display); color: var(--primary); white-space: nowrap; }
.test-progress .progress { flex: 1; width: 160px; }
.question-card { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; align-items: start; }
.question-card.no-image { grid-template-columns: minmax(0, 1fr); }
.q-image { border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.q-image img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.q-number { font-size: .8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.q-text { font-size: 1.08rem; font-weight: 600; color: var(--ink); line-height: 1.5; margin-bottom: 18px; }
.answers { display: flex; flex-direction: column; gap: 10px; }
.answer { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; font-size: .95rem; color: var(--ink-2); }
.answer:hover { border-color: var(--primary-100); background: #fbfdff; }
.answer input { position: absolute; opacity: 0; pointer-events: none; }
.answer .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c5d1e3; flex: none; display: grid; place-items: center; transition: all .15s; }
.answer .letter { font-weight: 700; color: var(--muted); min-width: 16px; }
.answer.is-selected, .answer:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--ink); box-shadow: 0 0 0 3px rgba(29,111,242,.08); }
.answer.is-selected .radio, .answer:has(input:checked) .radio { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 4px #fff; }
.answer.is-correct { border-color: var(--success); background: var(--success-50); color: var(--ink); }
.answer.is-correct .radio { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 4px #fff; }
.answer.is-wrong { border-color: var(--danger); background: var(--danger-50); color: var(--ink); }
.answer.is-wrong .radio { border-color: var(--danger); background: var(--danger); box-shadow: inset 0 0 0 4px #fff; }
.answer .tag { margin-left: auto; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.answer.is-correct .tag { color: var(--success-600); }
.answer.is-wrong .tag { color: var(--danger); }
.answers.locked .answer { cursor: default; }
.test-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.qgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qbtn { aspect-ratio: 1; min-height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font: 600 .85rem var(--font); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.qbtn:hover { border-color: var(--primary); color: var(--primary); }
.qbtn.answered { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-700); }
.qbtn.current { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-50); }
.qbtn.ok { background: var(--success-50); border-color: #b2f2bb; color: var(--success-600); }
.qbtn.bad { background: var(--danger-50); border-color: #ffc9c9; color: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--muted); margin-top: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); }

.ring { position: relative; width: 180px; height: 180px; margin: 6px auto 14px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: #e7eef8; }
.ring .bar { stroke: var(--success); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }
.ring.fail .bar { stroke: var(--danger); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font: 700 2.2rem/1 var(--font-display); color: var(--ink); }
.result-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.kpi { padding: 14px; border-radius: 14px; border: 1px solid var(--line); text-align: left; }
.kpi .row { gap: 8px; font: 700 1.25rem var(--font-display); }
.kpi small { display: block; color: var(--muted); font-size: .76rem; margin-top: 4px; }
.kpi .icon { width: 22px; height: 22px; padding: 3px; border-radius: 50%; }
.kpi-ok .icon { background: var(--success-50); color: var(--success-600); }
.kpi-bad .icon { background: var(--danger-50); color: var(--danger); }
.kpi-time .icon { color: var(--primary); }
.celebrate { text-align: center; padding: 28px 22px; background: linear-gradient(180deg, #f2f8ff, #fff 60%); }
.celebrate img { width: 82%; max-width: 280px; margin: 8px auto 18px; display: block; transform: rotate(-12deg); filter: drop-shadow(0 16px 16px rgba(20,50,100,.25)); }
.review-item { padding: 20px 0; border-bottom: 1px solid var(--line-2); }
.review-item:last-child { border-bottom: 0; }

/* flashcards (question bank) */
.flash-q { padding: 20px 0; border-bottom: 1px solid var(--line-2); }
.flash-q:last-child { border-bottom: 0; }

/* admin */
.admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--nav-h) + 20px); padding: 12px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.admin-nav a .icon { width: 19px; height: 19px; color: var(--muted); }
.admin-nav a:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 10px 20px -12px rgba(29,111,242,.9); }
.admin-nav a.active .icon { color: #fff; }
.admin-nav .nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 700; padding: 14px 12px 6px; }
.admin-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-title h1 { margin: 0; font-size: 1.6rem; }
.q-preview { font-size: .9rem; color: var(--ink); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.answer-inputs .input-inline { margin-bottom: 8px; }
.answer-inputs .correct-pick { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.answer-inputs .correct-pick:has(input:checked) { border-color: var(--success); background: var(--success-50); color: var(--success-600); }
.answer-inputs .correct-pick input { accent-color: var(--success); }
.letter-pill { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--ink-2); flex: none; }
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 180px 1fr 60px; gap: 12px; align-items: center; font-size: .86rem; }
.bar-row .bar { height: 10px; border-radius: 999px; background: #e7eef8; overflow: hidden; }
.bar-row .bar span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--primary)); }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { width: 100%; height: auto; display: block; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 31, 61, .45); z-index: 500; display: grid; place-items: center; padding: 16px; opacity: 0; visibility: hidden; transition: all .18s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg); transform: scale(.96); transition: transform .18s; }
.modal-backdrop.open .modal { transform: none; }
.modal-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--warning-50); color: var(--warning); margin-bottom: 14px; }
.modal-ico.danger { background: var(--danger-50); color: var(--danger); }
.modal-ico .icon { width: 26px; height: 26px; }
.modal h3 { font-size: 1.15rem; }
.modal .form-actions { justify-content: flex-end; margin-top: 20px; }
.lightbox { position: fixed; inset: 0; z-index: 600; background: rgba(10, 20, 40, .85); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* print layout */
.print-page { max-width: 900px; margin: 0 auto; padding: 32px; background: #fff; }
.print-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1400px) { .hide-md { display: none !important; } .mainnav a { padding: 0 10px; } .mainnav a .icon { display: none; } .topbar .container { gap: 18px; } }
@media (max-width: 1180px) {
	.mainnav a { padding: 0 10px; }
	.mainnav a .icon { display: none; }
	.split { grid-template-columns: minmax(0, 1fr) 300px; }
	.grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.hero-plane { width: 40%; }
}
@media (max-width: 1024px) {
	.mainnav, .topbar .user-chip .who, .topbar .user-chip > .icon { display: none; }
	.hamburger { display: grid; }
	.split, .split-left, .admin { grid-template-columns: minmax(0, 1fr); }
	.admin-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 8px; scrollbar-width: none; }
	.admin-nav::-webkit-scrollbar { display: none; }
	.admin-nav .nav-label { display: none; }
	.admin-nav a { white-space: nowrap; flex: none; }
	.thumbs { display: none; }
	.learning-layout > section { order: -1; }
	.question-card { grid-template-columns: minmax(0, 1fr); }
	.q-image { max-width: 420px; }
	.auth { grid-template-columns: 1fr; }
	.auth-visual { display: none; }
	.auth-panel { background: #0f3a66 url("../img/v2/login-sky-ppl.jpg") center/cover; justify-content: center; }
	.auth-panel > .brand, .auth-panel > .auth-tagline { color: #fff; }
	.auth-panel > .brand small, .auth-panel .auth-tagline { color: rgba(255,255,255,.85); }
	.auth-panel .brand-mark { color: #fff; }
	.auth-form { margin: 32px auto; padding: 28px; border-radius: 22px; background: rgba(255,255,255,.95); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
	.auth-copy { color: #fff; text-align: center; text-shadow: 0 1px 6px rgba(10,30,70,.8); }
	.auth-org { align-self: center; background: rgba(255,255,255,.92); padding: 8px 16px 8px 10px; border-radius: 16px; box-shadow: var(--shadow); opacity: 1; }
}
@media (max-width: 760px) {
	body { font-size: 14.5px; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
	.container { padding: 0 14px; }
	.page { padding: 14px 0 28px; }
	.tabbar { display: flex; }
	.topbar .container { gap: 12px; }
	.brand small { display: none; }
	.grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
	.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.form-row, .form-row-3 { grid-template-columns: minmax(0, 1fr); }
	.card { padding: 16px; border-radius: 18px; }
	.card-flush { padding: 0; }
	.hero-inner { flex-wrap: wrap; padding: 18px; gap: 14px; min-height: 0; }
	.hero::before { background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.92) 55%, rgba(255,255,255,.97) 100%); }
	.hero-plane { width: 70%; top: 2%; right: -6%; opacity: .9; }
	.hero-icon { width: 56px; height: 56px; border-radius: 16px; }
	.hero-icon .icon { width: 28px; height: 28px; }
	.hero h1 { font-size: 1.4rem; }
	.hero-progress { width: 100%; margin: 0; }
	.hero .back-link { margin: 14px 18px 0; }
	.hero-welcome .hero-inner { padding: 20px; min-height: 0; flex-direction: column; }
	.hero-welcome::before { background: linear-gradient(180deg, rgba(14, 67, 160, .88) 0%, rgba(29, 111, 242, .78) 70%, rgba(29, 111, 242, .6) 100%); }
	.next-card { width: 100%; margin: 0; }
	.hero-compact .hero-progress, .hero-compact .hero-plane { display: none; }
	.hero-compact .hero-inner { flex-wrap: nowrap; padding-top: 6px; }
	.hero-welcome .hero-plane { width: 46%; top: 8px; right: -8%; opacity: .45; }
	.stepper { padding: 12px 14px; gap: 8px; }
	.step-label { display: none; }
	.step.active .step-label { display: inline; }
	.viewer { height: calc(100vh - var(--nav-h) - var(--tabbar-h) - 24px); min-height: 460px; }
	.viewer-bar { padding: 8px 10px; }
	.viewer-bar .file-name { flex-basis: 100%; }
	.pages { padding: 10px; gap: 10px; }
	.test-head { padding: 14px 16px; gap: 12px; }
	.test-progress { min-width: 0; flex: 1 1 100%; }
	.q-text { font-size: 1rem; }
	.answer { padding: 12px 14px; }
	.test-nav .btn { flex: 1; }
	.result-kpis { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
	.kpi { padding: 10px; }
	.kpi .row { font-size: 1.05rem; }
	.ring { width: 150px; height: 150px; }
	.bar-row { grid-template-columns: 110px 1fr 46px; }
	.table th, .table td { padding: 10px 8px; }
	.hide-sm { display: none !important; }
	.chat { height: calc(100vh - var(--nav-h) - var(--tabbar-h) - 120px); min-height: 380px; }
	.chat-list { padding: 12px; }
	.chat-form { padding: 10px; gap: 8px; }
	.chat-form .avatar { display: none; }
	.msg .avatar { width: 30px; height: 30px; font-size: .7rem; }
	.msg-del { opacity: 1; }
	.toasts { top: auto; bottom: calc(var(--tabbar-h) + 16px); right: 12px; left: 12px; width: auto; }
	.admin-title h1 { font-size: 1.3rem; }
	.material { padding: 12px; gap: 12px; }
	.material .btn { padding: 0 12px; }
	.auth-form { padding: 22px; }
	.auth-form h1 { font-size: 1.6rem; }
}
@media (min-width: 761px) { .show-sm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
	body { background: #fff; padding: 0; font-size: 12px; }
	.topbar, .tabbar, .footer, .no-print, .toasts, .drawer, .drawer-backdrop { display: none !important; }
	.card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
	.print-page { padding: 0; }
	a { color: inherit; }
}

.q-image img + img { margin-top: 10px; }
