/* Evictek E-Learning Portal — mobile-first styles */
:root {
	--evl-primary: #3b5bdb;
	--evl-primary-ink: #fff;
	--evl-bg: #f4f6fb;
	--evl-surface: #ffffff;
	--evl-surface-2: #f8f9fc;
	--evl-text: #0f172a;
	--evl-muted: #64748b;
	--evl-border: #e4e7ef;
	--evl-success: #16a34a;
	--evl-success-bg: #e8f7ee;
	--evl-warning: #d97706;
	--evl-warning-bg: #fef4e2;
	--evl-danger: #dc2626;
	--evl-danger-bg: #fdecec;
	--evl-radius: 14px;
	--evl-radius-sm: 10px;
	--evl-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
	--evl-tabbar-h: 64px;
	--evl-header-h: 56px;
	--evl-safe-b: env(safe-area-inset-bottom, 0px);
	--evl-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.evl-body { margin: 0; background: var(--evl-bg); color: var(--evl-text); font: 15px/1.5 var(--evl-font); -webkit-font-smoothing: antialiased; }
.evl-app { min-height: 100vh; min-height: 100dvh; font-family: var(--evl-font); color: var(--evl-text); }
.evl-embed .evl-app { min-height: 70vh; background: var(--evl-bg); border-radius: 16px; overflow: hidden; }
.evl-app a { color: var(--evl-primary); text-decoration: none; }
.evl-app img, .evl-app video, .evl-app iframe { max-width: 100%; }
.evl-app button, .evl-app input, .evl-app select, .evl-app textarea { font: inherit; color: inherit; }
.evl-app h1, .evl-app h2, .evl-app h3, .evl-app h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.evl-app p { margin: 0 0 .75em; }
.evl-hidden { display: none !important; }
.evl-app svg { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }

/* Boot */
.evl-boot { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.evl-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(59, 91, 219, .15); border-top-color: var(--evl-primary); animation: evl-spin .8s linear infinite; }
.evl-spinner.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes evl-spin { to { transform: rotate(360deg); } }
.evl-loading { padding: 48px 0; display: flex; justify-content: center; }

/* Shell */
.evl-header { position: sticky; top: 0; z-index: 30; height: var(--evl-header-h); display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--evl-surface); border-bottom: 1px solid var(--evl-border); }
.evl-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--evl-text) !important; }
.evl-brand img { height: 32px; width: auto; border-radius: 6px; }
.evl-brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--evl-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.evl-brand-text { min-width: 0; }
.evl-brand-title { display: block; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evl-brand-sub { display: block; font-size: 12px; color: var(--evl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evl-header-actions { display: flex; align-items: center; gap: 6px; }
.evl-icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--evl-text); cursor: pointer; }
.evl-icon-btn:hover { background: var(--evl-surface-2); }
.evl-dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--evl-danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.evl-avatar { width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--evl-primary) 14%, #fff); color: var(--evl-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.evl-avatar.lg { width: 64px; height: 64px; font-size: 24px; }

.evl-main { padding: 16px 16px calc(var(--evl-tabbar-h) + var(--evl-safe-b) + 24px); max-width: 1040px; margin: 0 auto; }
.evl-no-nav .evl-main { padding-bottom: 32px; }

.evl-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: var(--evl-surface); border-top: 1px solid var(--evl-border); padding-bottom: var(--evl-safe-b); height: calc(var(--evl-tabbar-h) + var(--evl-safe-b)); }
.evl-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--evl-muted) !important; position: relative; }
.evl-tab svg { width: 22px; height: 22px; }
.evl-tab.active { color: var(--evl-primary) !important; }
.evl-tab .evl-dot { top: 6px; right: calc(50% - 22px); }

.evl-sidebar { display: none; }

@media (min-width: 960px) {
	.evl-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
	.evl-sidebar { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; padding: 16px 12px; background: var(--evl-surface); border-right: 1px solid var(--evl-border); overflow-y: auto; }
	.evl-sidebar .evl-brand { flex: none; padding: 4px 8px 18px; }
	.evl-side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--evl-text) !important; font-weight: 500; position: relative; }
	.evl-side-link svg { width: 20px; height: 20px; color: var(--evl-muted); }
	.evl-side-link:hover { background: var(--evl-surface-2); }
	.evl-side-link.active { background: color-mix(in srgb, var(--evl-primary) 10%, #fff); color: var(--evl-primary) !important; }
	.evl-side-link.active svg { color: var(--evl-primary); }
	.evl-side-link .evl-dot { position: static; margin-left: auto; }
	.evl-side-sep { height: 1px; background: var(--evl-border); margin: 10px 8px; }
	.evl-tabbar { display: none; }
	.evl-header .evl-brand { visibility: hidden; }
	.evl-main { padding: 24px 32px 48px; }
}

/* Page head */
.evl-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.evl-page-head h1 { font-size: 22px; font-weight: 750; }
.evl-page-head p { color: var(--evl-muted); margin: 4px 0 0; font-size: 14px; }
.evl-back { display: inline-flex; align-items: center; gap: 4px; color: var(--evl-muted) !important; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.evl-back svg { width: 18px; height: 18px; }
.evl-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--evl-muted); margin: 24px 0 10px; display: flex; justify-content: space-between; align-items: center; }
.evl-section-title a { text-transform: none; letter-spacing: 0; font-size: 14px; }

/* Cards */
.evl-card { background: var(--evl-surface); border: 1px solid var(--evl-border); border-radius: var(--evl-radius); padding: 16px; box-shadow: var(--evl-shadow); }
.evl-card + .evl-card { margin-top: 12px; }
.evl-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.evl-card-muted { background: var(--evl-surface-2); box-shadow: none; }
.evl-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .evl-grid.cols-2 { grid-template-columns: 1fr 1fr; } .evl-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .evl-grid.cols-3-lg { grid-template-columns: repeat(3, 1fr); } }

/* Hero */
.evl-hero { background: linear-gradient(135deg, var(--evl-primary), color-mix(in srgb, var(--evl-primary) 60%, #0f172a)); color: #fff; border-radius: 18px; padding: 22px 18px; margin-bottom: 16px; }
.evl-hero h1 { font-size: 22px; font-weight: 750; color: #fff; }
.evl-hero p { opacity: .9; margin: 6px 0 0; }
.evl-hero-stats { display: flex; gap: 18px; margin-top: 16px; }
.evl-hero-stats div { font-size: 12px; opacity: .9; }
.evl-hero-stats strong { display: block; font-size: 20px; opacity: 1; }

/* Stats */
.evl-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .evl-stats { grid-template-columns: repeat(4, 1fr); } }
.evl-stat { background: var(--evl-surface); border: 1px solid var(--evl-border); border-radius: var(--evl-radius); padding: 14px; display: block; color: var(--evl-text) !important; }
.evl-stat .v { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.evl-stat .l { font-size: 12.5px; color: var(--evl-muted); font-weight: 600; }
.evl-stat.alert .v { color: var(--evl-danger); }

/* Course cards */
.evl-course-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; color: var(--evl-text) !important; }
.evl-course-thumb { aspect-ratio: 16 / 7; background: linear-gradient(135deg, color-mix(in srgb, var(--evl-primary) 85%, #fff), color-mix(in srgb, var(--evl-primary) 55%, #0f172a)); background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 12px; color: #fff; font-weight: 700; font-size: 13px; }
.evl-course-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.evl-course-body h3 { font-size: 16px; margin: 0; }
.evl-course-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--evl-muted); }
.evl-course-meta span { display: inline-flex; align-items: center; gap: 4px; }
.evl-course-meta svg { width: 15px; height: 15px; }
.evl-price { font-weight: 750; font-size: 16px; color: var(--evl-text); }

/* List rows */
.evl-list { background: var(--evl-surface); border: 1px solid var(--evl-border); border-radius: var(--evl-radius); overflow: hidden; }
.evl-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--evl-border); color: var(--evl-text) !important; min-height: 56px; }
.evl-row:last-child { border-bottom: 0; }
a.evl-row:active, button.evl-row:active { background: var(--evl-surface-2); }
button.evl-row { width: 100%; border: 0; border-bottom: 1px solid var(--evl-border); background: transparent; text-align: left; cursor: pointer; }
.evl-row-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--evl-surface-2); color: var(--evl-muted); }
.evl-row-icon svg { width: 20px; height: 20px; }
.evl-row-icon.done { background: var(--evl-success-bg); color: var(--evl-success); }
.evl-row-icon.primary { background: color-mix(in srgb, var(--evl-primary) 12%, #fff); color: var(--evl-primary); }
.evl-row-icon.danger { background: var(--evl-danger-bg); color: var(--evl-danger); }
.evl-row-icon.warning { background: var(--evl-warning-bg); color: var(--evl-warning); }
.evl-row-main { flex: 1; min-width: 0; }
.evl-row-title { display: block; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.evl-row-sub { display: block; font-size: 13px; color: var(--evl-muted); margin-top: 1px; }
.evl-row-end { flex: none; display: flex; align-items: center; gap: 6px; color: var(--evl-muted); font-size: 13px; }
.evl-row-end svg { width: 18px; height: 18px; }

/* Badges */
.evl-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--evl-surface-2); color: var(--evl-muted); border: 1px solid var(--evl-border); white-space: nowrap; }
.evl-badge.success { background: var(--evl-success-bg); color: var(--evl-success); border-color: transparent; }
.evl-badge.warning { background: var(--evl-warning-bg); color: var(--evl-warning); border-color: transparent; }
.evl-badge.danger { background: var(--evl-danger-bg); color: var(--evl-danger); border-color: transparent; }
.evl-badge.primary { background: color-mix(in srgb, var(--evl-primary) 12%, #fff); color: var(--evl-primary); border-color: transparent; }

/* Progress */
.evl-progress { height: 8px; border-radius: 99px; background: #e9ecf4; overflow: hidden; }
.evl-progress > span { display: block; height: 100%; border-radius: 99px; background: var(--evl-primary); transition: width .4s; }
.evl-progress.success > span { background: var(--evl-success); }
.evl-progress-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--evl-muted); margin-bottom: 6px; font-weight: 600; }

/* Buttons */
.evl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--evl-primary); color: var(--evl-primary-ink) !important; font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; -webkit-tap-highlight-color: transparent; }
.evl-btn:active { transform: scale(.98); }
.evl-btn:hover { filter: brightness(1.05); }
.evl-btn svg { width: 18px; height: 18px; }
.evl-btn[disabled] { opacity: .55; cursor: not-allowed; }
.evl-btn.ghost { background: var(--evl-surface); color: var(--evl-text) !important; border-color: var(--evl-border); }
.evl-btn.soft { background: color-mix(in srgb, var(--evl-primary) 11%, #fff); color: var(--evl-primary) !important; }
.evl-btn.danger { background: var(--evl-danger); }
.evl-btn.danger-soft { background: var(--evl-danger-bg); color: var(--evl-danger) !important; }
.evl-btn.success { background: var(--evl-success); }
.evl-btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.evl-btn.block { width: 100%; }
.evl-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.evl-btn-row > .evl-btn { flex: 1; }
.evl-link-btn { background: none; border: 0; color: var(--evl-primary); font-weight: 600; cursor: pointer; padding: 6px 0; }

/* Forms */
.evl-field { display: block; margin-bottom: 14px; }
.evl-field > span { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 6px; }
.evl-field small { display: block; color: var(--evl-muted); font-size: 12.5px; margin-top: 5px; }
.evl-input, .evl-select, .evl-textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--evl-border); border-radius: 12px; background: var(--evl-surface); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
.evl-textarea { min-height: 110px; resize: vertical; }
.evl-input:focus, .evl-select:focus, .evl-textarea:focus, .evl-editor:focus { border-color: var(--evl-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--evl-primary) 18%, transparent); }
.evl-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; cursor: pointer; font-size: 14.5px; }
.evl-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--evl-primary); flex: none; }
.evl-check small { display: block; color: var(--evl-muted); font-size: 12.5px; }
.evl-form-grid { display: grid; gap: 0 12px; }
@media (min-width: 640px) { .evl-form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .evl-form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.evl-form-actions { position: sticky; bottom: calc(var(--evl-tabbar-h) + var(--evl-safe-b)); background: linear-gradient(transparent, var(--evl-bg) 30%); padding: 16px 0 8px; display: flex; gap: 10px; z-index: 5; }
@media (min-width: 960px) { .evl-form-actions { bottom: 0; } }
.evl-form-actions .evl-btn { flex: 1; }
@media (min-width: 640px) { .evl-form-actions .evl-btn { flex: 0 0 auto; min-width: 160px; } }
.evl-error { background: var(--evl-danger-bg); color: var(--evl-danger); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.evl-note { background: var(--evl-surface-2); border: 1px dashed var(--evl-border); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: var(--evl-muted); }
.evl-note.warning { background: var(--evl-warning-bg); border-color: transparent; color: #92400e; }
.evl-note.success { background: var(--evl-success-bg); border-color: transparent; color: #166534; }
.evl-copy { display: flex; gap: 8px; }
.evl-copy .evl-input { font-size: 13px; font-family: ui-monospace, monospace; }

/* Rich text editor */
.evl-editor-wrap { border: 1px solid var(--evl-border); border-radius: 12px; background: var(--evl-surface); overflow: hidden; }
.evl-editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--evl-border); background: var(--evl-surface-2); position: sticky; top: var(--evl-header-h); z-index: 2; }
.evl-editor-bar button { min-width: 38px; height: 36px; border: 0; background: transparent; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--evl-text); }
.evl-editor-bar button:hover { background: #fff; }
.evl-editor { min-height: 220px; padding: 14px; outline: none; font-size: 16px; line-height: 1.6; }
.evl-editor:empty::before { content: attr(data-placeholder); color: var(--evl-muted); }

/* Segmented tabs */
.evl-tabs { display: flex; gap: 4px; background: #e9ecf4; padding: 4px; border-radius: 12px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.evl-tabs::-webkit-scrollbar { display: none; }
.evl-tabs button { flex: 1; min-width: max-content; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; font-weight: 650; font-size: 14px; color: var(--evl-muted); cursor: pointer; }
.evl-tabs button.active { background: var(--evl-surface); color: var(--evl-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* Empty */
.evl-empty { text-align: center; padding: 36px 16px; color: var(--evl-muted); }
.evl-empty svg { width: 44px; height: 44px; margin-bottom: 8px; opacity: .6; }
.evl-empty h3 { color: var(--evl-text); font-size: 16px; margin-bottom: 4px; }

/* Toast */
.evl-toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--evl-tabbar-h) + var(--evl-safe-b) + 14px); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.evl-toast { background: #111827; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: evl-up .2s ease-out; pointer-events: auto; }
.evl-toast.error { background: var(--evl-danger); }
.evl-toast.success { background: var(--evl-success); }
@keyframes evl-up { from { opacity: 0; transform: translateY(10px); } }

/* Modal / bottom sheet */
.evl-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-end; justify-content: center; animation: evl-fade .15s; }
@keyframes evl-fade { from { opacity: 0; } }
.evl-sheet { background: var(--evl-surface); width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 18px calc(18px + var(--evl-safe-b)); animation: evl-sheet .22s ease-out; }
@keyframes evl-sheet { from { transform: translateY(40px); opacity: .5; } }
.evl-sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--evl-border); margin: 4px auto 14px; }
.evl-sheet h2 { font-size: 18px; margin-bottom: 8px; }
.evl-sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.evl-sheet-actions .evl-btn { flex: 1; }
@media (min-width: 640px) {
	.evl-overlay { align-items: center; padding: 24px; }
	.evl-sheet { max-width: 520px; border-radius: 20px; padding: 22px; }
	.evl-sheet-grip { display: none; }
}

/* Auth */
.evl-auth { max-width: 420px; margin: 0 auto; }
.evl-auth-head { text-align: center; padding: 24px 0 18px; }
.evl-auth-head .evl-brand-mark, .evl-auth-head img { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; font-size: 24px; object-fit: contain; }
.evl-auth-head h1 { font-size: 22px; }
.evl-auth-head p { color: var(--evl-muted); margin-top: 4px; }

/* Lesson viewer */
.evl-study-bar { position: sticky; top: var(--evl-header-h); z-index: 20; margin: -16px -16px 14px; padding: 10px 16px; background: color-mix(in srgb, var(--evl-surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--evl-border); display: flex; align-items: center; gap: 12px; }
@media (min-width: 960px) { .evl-study-bar { margin: -24px -32px 18px; padding: 10px 32px; } }
.evl-timer-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; background: var(--evl-success-bg); color: var(--evl-success); }
.evl-timer-pill.paused { background: var(--evl-warning-bg); color: var(--evl-warning); }
.evl-timer-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: evl-pulse 1.4s infinite; }
.evl-timer-pill.paused i { animation: none; }
@keyframes evl-pulse { 50% { opacity: .3; } }
.evl-study-bar .evl-grow { flex: 1; min-width: 0; font-size: 12.5px; color: var(--evl-muted); }
.evl-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--evl-radius); overflow: hidden; margin-bottom: 16px; }
.evl-video iframe, .evl-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.evl-notes { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.evl-notes h1, .evl-notes h2, .evl-notes h3 { margin: 1.1em 0 .5em; }
.evl-notes img { height: auto; border-radius: 10px; }
.evl-notes ul, .evl-notes ol { padding-left: 1.3em; }
.evl-notes table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.evl-notes td, .evl-notes th { border: 1px solid var(--evl-border); padding: 6px 8px; }
.evl-lesson-nav { display: flex; gap: 10px; margin-top: 18px; }
.evl-lesson-nav .evl-btn { flex: 1; }
.evl-cam-mini { position: fixed; right: 12px; bottom: calc(var(--evl-tabbar-h) + var(--evl-safe-b) + 12px); width: 84px; height: 84px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); z-index: 50; background: #111; }
.evl-cam-mini video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.evl-cam-mini.off { border-color: var(--evl-danger); }
@media (min-width: 960px) { .evl-cam-mini { bottom: 16px; width: 110px; height: 110px; } }
.evl-exam-mode .evl-cam-mini { bottom: calc(80px + var(--evl-safe-b)); width: 72px; height: 72px; }

/* Chat */
.evl-chat { display: flex; flex-direction: column; gap: 12px; padding-bottom: 90px; }
.evl-bubble { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.evl-bubble.me { align-self: flex-end; background: var(--evl-primary); color: #fff; border-bottom-right-radius: 5px; }
.evl-bubble.ai { align-self: flex-start; background: var(--evl-surface); border: 1px solid var(--evl-border); border-bottom-left-radius: 5px; }
.evl-bubble.ai p:last-child { margin-bottom: 0; }
.evl-bubble.ai ul, .evl-bubble.ai ol { padding-left: 1.2em; margin: .4em 0; }
.evl-bubble .evl-src { display: block; margin-top: 8px; font-size: 11.5px; color: var(--evl-muted); font-weight: 600; }
.evl-chat-input { position: fixed; left: 0; right: 0; bottom: calc(var(--evl-tabbar-h) + var(--evl-safe-b)); z-index: 35; background: var(--evl-surface); border-top: 1px solid var(--evl-border); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; }
.evl-chat-input textarea { flex: 1; min-height: 46px; max-height: 140px; resize: none; }
.evl-chat-input .evl-btn { width: 46px; padding: 0; flex: none; }
@media (min-width: 960px) { .evl-chat-input { left: 248px; bottom: 0; padding: 12px 32px; } .evl-chat { padding-bottom: 40px; } }
.evl-typing { display: inline-flex; gap: 4px; }
.evl-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--evl-muted); animation: evl-pulse 1s infinite; }
.evl-typing i:nth-child(2) { animation-delay: .2s; } .evl-typing i:nth-child(3) { animation-delay: .4s; }

/* Exam */
.evl-exam-mode .evl-header, .evl-exam-mode .evl-tabbar, .evl-exam-mode .evl-sidebar { display: none !important; }
.evl-exam-mode .evl-shell { display: block; }
.evl-exam-mode .evl-main { padding: 0 0 calc(90px + var(--evl-safe-b)); max-width: 760px; }
.evl-exam-mode, .evl-exam-mode * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.evl-exam-mode textarea, .evl-exam-mode input { -webkit-user-select: text; user-select: text; }
.evl-exam-top { position: sticky; top: 0; z-index: 30; background: var(--evl-surface); border-bottom: 1px solid var(--evl-border); padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.evl-exam-top .t { flex: 1; min-width: 0; }
.evl-exam-top .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evl-exam-top .t small { color: var(--evl-muted); font-size: 12px; }
.evl-countdown { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 18px; padding: 6px 12px; border-radius: 10px; background: var(--evl-surface-2); }
.evl-countdown.low { background: var(--evl-danger-bg); color: var(--evl-danger); animation: evl-pulse 1s infinite; }
.evl-exam-body { padding: 16px; }
.evl-q-card { background: var(--evl-surface); border: 1px solid var(--evl-border); border-radius: var(--evl-radius); padding: 18px 16px; }
.evl-q-num { font-size: 12.5px; font-weight: 700; color: var(--evl-primary); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; display: flex; justify-content: space-between; }
.evl-q-text { font-size: 17px; font-weight: 600; line-height: 1.5; margin-bottom: 16px; overflow-wrap: anywhere; }
.evl-option { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--evl-border); border-radius: 12px; margin-bottom: 10px; cursor: pointer; font-size: 15.5px; transition: border-color .12s, background .12s; }
.evl-option input { display: none; }
.evl-option .k { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--evl-border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; color: var(--evl-muted); }
.evl-option.sel { border-color: var(--evl-primary); background: color-mix(in srgb, var(--evl-primary) 7%, #fff); }
.evl-option.sel .k { background: var(--evl-primary); border-color: var(--evl-primary); color: #fff; }
.evl-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px; }
.evl-palette button { height: 42px; border-radius: 10px; border: 1.5px solid var(--evl-border); background: var(--evl-surface); font-weight: 700; cursor: pointer; }
.evl-palette button.ans { background: color-mix(in srgb, var(--evl-primary) 12%, #fff); border-color: transparent; color: var(--evl-primary); }
.evl-palette button.cur { border-color: var(--evl-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--evl-primary) 30%, transparent); }
.evl-exam-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--evl-surface); border-top: 1px solid var(--evl-border); padding: 10px 12px calc(10px + var(--evl-safe-b)); display: flex; gap: 8px; }
.evl-exam-foot .evl-btn { flex: 1; padding: 0 10px; }
.evl-warn-overlay { position: fixed; inset: 0; z-index: 950; background: rgba(127, 29, 29, .92); color: #fff; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.evl-warn-overlay .box { max-width: 380px; }
.evl-warn-overlay svg { width: 56px; height: 56px; margin-bottom: 10px; }
.evl-warn-overlay h2 { color: #fff; font-size: 22px; margin-bottom: 8px; }
.evl-warn-overlay .evl-btn { background: #fff; color: #7f1d1d !important; margin-top: 18px; width: 100%; }
.evl-cam-check { width: 160px; height: 160px; border-radius: 50%; overflow: hidden; margin: 8px auto 12px; background: #111; border: 4px solid var(--evl-border); }
.evl-cam-check video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.evl-cam-check.ok { border-color: var(--evl-success); }
.evl-rules { padding-left: 1.1em; margin: 8px 0 0; }
.evl-rules li { margin-bottom: 6px; }

/* Result */
.evl-score-ring { width: 132px; height: 132px; border-radius: 50%; margin: 6px auto 12px; display: flex; align-items: center; justify-content: center; flex-direction: column; background: conic-gradient(var(--c, var(--evl-primary)) calc(var(--p) * 1%), #e9ecf4 0); position: relative; }
.evl-score-ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--evl-surface); }
.evl-score-ring b, .evl-score-ring small { position: relative; }
.evl-score-ring b { font-size: 28px; }
.evl-score-ring small { color: var(--evl-muted); font-size: 12px; font-weight: 600; }
.evl-review-q { border-left: 4px solid var(--evl-border); padding: 10px 12px; margin-bottom: 10px; background: var(--evl-surface); border-radius: 0 10px 10px 0; }
.evl-review-q.ok { border-left-color: var(--evl-success); }
.evl-review-q.bad { border-left-color: var(--evl-danger); }
.evl-review-q.pend { border-left-color: var(--evl-warning); }

/* Checklist */
.evl-checklist { list-style: none; margin: 0; padding: 0; }
.evl-checklist li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--evl-border); align-items: flex-start; }
.evl-checklist li:last-child { border-bottom: 0; }
.evl-checklist .ic { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--evl-surface-2); color: var(--evl-muted); }
.evl-checklist .ic svg { width: 15px; height: 15px; }
.evl-checklist .ok .ic { background: var(--evl-success-bg); color: var(--evl-success); }
.evl-checklist .soft .ic { background: var(--evl-warning-bg); color: var(--evl-warning); }
.evl-checklist b { display: block; font-size: 14.5px; }
.evl-checklist small { color: var(--evl-muted); font-size: 13px; }

/* Timeline / snapshots */
.evl-snaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.evl-snap { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: #111; cursor: pointer; border: 2px solid transparent; }
.evl-snap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evl-snap span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); padding: 8px 5px 3px; }
.evl-snap.warn { border-color: var(--evl-warning); }
.evl-events { list-style: none; margin: 0; padding: 0; }
.evl-events li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--evl-border); font-size: 14px; }
.evl-events li:last-child { border-bottom: 0; }
.evl-events .sev { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--evl-muted); }
.evl-events .sev.warning { background: var(--evl-warning); }
.evl-events .sev.danger { background: var(--evl-danger); }
.evl-events time { color: var(--evl-muted); font-size: 12.5px; white-space: nowrap; margin-left: auto; }
.evl-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; padding: 16px; }
.evl-lightbox img { max-width: 100%; max-height: 80vh; border-radius: 10px; }

/* Question builder */
.evl-qb { border: 1px solid var(--evl-border); border-radius: var(--evl-radius); background: var(--evl-surface); padding: 14px; margin-bottom: 12px; }
.evl-qb-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.evl-qb-head b { flex: 1; }
.evl-qb-opt { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.evl-qb-opt input[type=radio] { width: 22px; height: 22px; accent-color: var(--evl-success); flex: none; }
.evl-qb-opt .evl-input { min-height: 42px; }

/* Tables (desktop) */
.evl-table-wrap { overflow-x: auto; background: var(--evl-surface); border: 1px solid var(--evl-border); border-radius: var(--evl-radius); }
.evl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.evl-table th, .evl-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--evl-border); white-space: nowrap; }
.evl-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--evl-muted); background: var(--evl-surface-2); }
.evl-table tr:last-child td { border-bottom: 0; }

.evl-kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.evl-kv dt { color: var(--evl-muted); }
.evl-kv dd { margin: 0; font-weight: 600; }

.evl-mt { margin-top: 16px; } .evl-mt-sm { margin-top: 8px; } .evl-mb { margin-bottom: 16px; }
.evl-muted { color: var(--evl-muted); } .evl-small { font-size: 13px; }
.evl-flex { display: flex; gap: 10px; align-items: center; } .evl-between { justify-content: space-between; } .evl-wrap { flex-wrap: wrap; }
.evl-center { text-align: center; }
.evl-upload-progress { height: 6px; background: #e9ecf4; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.evl-upload-progress span { display: block; height: 100%; width: 0; background: var(--evl-primary); transition: width .2s; }

/* ---------- Content protection ---------- */
.evl-pv { position: relative; }
.evl-video.evl-pv video { object-fit: contain; background: #000; }
.evl-wm { position: absolute; z-index: 3; pointer-events: none; color: rgba(255, 255, 255, .42); font: 600 12px/1.2 var(--evl-font); text-shadow: 0 0 3px rgba(0, 0, 0, .6); white-space: nowrap; transition: left 1.2s ease, top 1.2s ease; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.evl-fs-btn { position: absolute; top: 8px; right: 8px; z-index: 4; width: 38px; height: 38px; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .5); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.evl-video.evl-pv:fullscreen, .evl-video.evl-pv:-webkit-full-screen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; margin: 0; }
.evl-video.evl-pv:fullscreen .evl-wm { font-size: 16px; }
.evl-pseudo-fs { position: fixed !important; inset: 0; z-index: 2000; aspect-ratio: auto !important; border-radius: 0 !important; margin: 0 !important; }
body.evl-lock-scroll { overflow: hidden; }
.evl-doc { background-color: var(--evl-surface); border: 1px solid var(--evl-border); border-radius: var(--evl-radius); overflow: hidden; }
.evl-doc-page { position: relative; border-bottom: 1px solid var(--evl-border); -webkit-touch-callout: none; }
.evl-doc-page:last-child { border-bottom: 0; }
.evl-doc-page canvas { display: block; width: 100%; height: auto; }
.evl-doc-page::after { content: ""; position: absolute; inset: 0; background-image: var(--evl-wm, none); background-repeat: repeat; }
.evl-doc-ph { height: 360px; display: flex; align-items: center; justify-content: center; color: var(--evl-muted); font-size: 13px; }
.evl-wm-tile { background-repeat: repeat; }
.evl-no-copy .evl-protected, .evl-no-copy .evl-protected * { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; }
.evl-no-copy .evl-protected img { pointer-events: none; }
.evl-blur { filter: blur(22px); transition: filter .1s; }
@media print {
	body.evl-no-copy .evl-app, body.evl-no-copy .evl-overlay { display: none !important; }
	body.evl-no-copy::after { content: "Printing course materials is not allowed."; display: block; padding: 40px; font: 16px sans-serif; }
}

/* ---------- Certificate designer ---------- */
.evl-cd-wrap { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.evl-cd-wrap > * { min-width: 0; }
@media (min-width: 1100px) { .evl-cd-wrap { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .evl-cd-panel { position: sticky; top: calc(var(--evl-header-h) + 12px); max-height: calc(100vh - 140px); overflow-y: auto; } }
.evl-cd-stage { background: #dfe3ea; border-radius: var(--evl-radius); padding: 12px; }
.evl-cd-fit { position: relative; overflow: hidden; margin: 0 auto; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); touch-action: none; background: #fff; }
.evl-cd-fit .evl-cert { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.evl-cd-fit .cel { cursor: move; outline: 1px dashed transparent; outline-offset: 1mm; }
.evl-cd-fit .cel:hover { outline-color: rgba(59, 91, 219, .5); }
.evl-cd-fit .cel.cel-sel { outline: .6mm dashed #3b5bdb; background: rgba(59, 91, 219, .06); }
.evl-chip { border: 1px solid var(--evl-border); background: var(--evl-surface-2); border-radius: 8px; padding: 3px 7px; margin: 3px 2px 0 0; font: 12px ui-monospace, monospace; cursor: pointer; color: var(--evl-text); }
.evl-cd-nudge { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evl-cd-nudge .evl-btn { min-width: 44px; }

/* ---------- Bio-data ---------- */
.evl-passport { width: 120px; height: 154px; border-radius: 10px; border: 2px dashed var(--evl-border); background: var(--evl-surface-2) center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--evl-muted); font-size: 12px; text-align: center; flex: none; overflow: hidden; }
.evl-passport img { width: 100%; height: 100%; object-fit: cover; }
.evl-lock-row { opacity: .7; }
.evl-day-head { font-size: 12px; font-weight: 700; color: var(--evl-muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px 6px; background: var(--evl-surface-2); border-bottom: 1px solid var(--evl-border); }
.evl-cd-stage { position: relative; }
.evl-cd-guide { display: none; position: absolute; width: 0; border-left: 1px dashed #e11d48; z-index: 5; pointer-events: none; }
.evl-cd-fit .cel-rs { position: absolute; right: calc(-11px / var(--k, 1)); bottom: calc(-11px / var(--k, 1)); width: calc(22px / var(--k, 1)); height: calc(22px / var(--k, 1)); border-radius: 50%; background: #3b5bdb; border: calc(3px / var(--k, 1)) solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); cursor: nwse-resize; z-index: 3; }
.evl-cd-fit .cel.al-center .cel-rs { right: calc(-11px / var(--k, 1)); }
.evl-cd-own { margin-bottom: 16px; border: 2px dashed color-mix(in srgb, var(--evl-primary) 35%, var(--evl-border)); }
.evl-cd-own-thumb { width: 120px; max-height: 90px; object-fit: contain; border: 1px solid var(--evl-border); border-radius: 8px; background: #fff; }
.evl-cd-own-status { margin-top: 6px; color: var(--evl-primary); font-weight: 600; }
