/* Elevate Incentives — frontend portal styles */
.ei-portal {
	--ei-bg: #ffffff;
	--ei-fg: #0f172a;
	--ei-muted: #64748b;
	--ei-line: #e5e7eb;
	--ei-brand: #2563eb;
	--ei-brand-dark: #1d4ed8;
	--ei-good: #16a34a;
	--ei-bad: #dc2626;
	--ei-soft: #f8fafc;
	/* Width is left to the theme's own page/column container, so the portal
	   fills whatever it's dropped into (Impreza row, WPBakery column, etc.). */
	width: 100%;
	color: var(--ei-fg);
	/* Inherit the theme's font by default (Impreza etc.); set --ei-font to override. */
	font-family: var(--ei-font, inherit);
}
.ei-portal * { box-sizing: border-box; }

.ei-portal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 0 20px;
	border-bottom: 1px solid var(--ei-line);
	margin-bottom: 24px;
}
.ei-portal-head h2 { margin: 0 0 4px; font-size: 24px; }
.ei-muted { color: var(--ei-muted); }
.ei-logout {
	font-size: 14px;
	color: var(--ei-muted);
	text-decoration: none;
	border: 1px solid var(--ei-line);
	padding: 8px 14px;
	border-radius: 8px;
	white-space: nowrap;
}
.ei-logout:hover { border-color: var(--ei-brand); color: var(--ei-brand); }

.ei-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 16px;
	margin-bottom: 28px;
}
.ei-portal-ident { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ei-ws-logo { max-height: 56px; max-width: 180px; width: auto; height: auto; object-fit: contain; flex-shrink: 0; }
.ei-stat {
	background: var(--ei-soft);
	border: 1px solid var(--ei-line);
	border-radius: 12px;
	padding: 20px;
	text-align: center;
}
.ei-stat-num { display: block; font-size: 30px; font-weight: 800; line-height: 1; }
.ei-stat-label { display: block; margin-top: 8px; font-size: 13px; color: var(--ei-muted); }

.ei-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--ei-line); margin-bottom: 24px; }
.ei-tab {
	background: none; border: none; cursor: pointer;
	padding: 12px 18px; font-size: 15px; font-weight: 600; color: var(--ei-muted);
	border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ei-tab.is-active { color: var(--ei-brand); border-bottom-color: var(--ei-brand); }

.ei-panel { display: none; }
.ei-panel.is-active { display: block; }

.ei-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.ei-video-card, .ei-reward-card {
	border: 1px solid var(--ei-line);
	border-radius: 12px;
	overflow: hidden;
	background: var(--ei-bg);
	transition: box-shadow .15s ease;
}
.ei-video-card:hover, .ei-reward-card:hover { box-shadow: 0 6px 22px rgba(15,23,42,.08); }
.ei-video-card.is-complete { border-color: var(--ei-good); }

.ei-video-wrap { position: relative; background: #000; aspect-ratio: 16/9; }
.ei-video-embed, .ei-video-embed .ei-yt-target, .ei-html5-video, .ei-vimeo-frame,
.ei-video-embed iframe { width: 100%; height: 100%; display: block; }
.ei-video-wrap iframe, .ei-video-wrap video, .ei-video-wrap .ei-yt-target {
	position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.ei-video-body { padding: 16px; }
.ei-video-body h3, .ei-reward-body h3 { margin: 0 0 6px; font-size: 17px; }
.ei-video-meta, .ei-reward-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

/* Pills / badges — one consistent system:
   base = brand blue (points, highlights); ok = green; warn = amber; bad = red; muted = grey. */
.ei-pill {
	display: inline-block; background: #eff6ff; color: var(--ei-brand-dark);
	font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
	line-height: 1.5; white-space: nowrap; vertical-align: middle;
}
.ei-pill-ok, .ei-pill.ei-status-active, .ei-pill.ei-status-fulfilled { background: #dcfce7; color: #166534; }
.ei-pill-warn, .ei-pill.ei-status-pending { background: #fef3c7; color: #92400e; }
.ei-pill-bad, .ei-pill.ei-status-cancelled { background: #fee2e2; color: #991b1b; }
.ei-pill-muted, .ei-pill.ei-status-inactive, .ei-pill.ei-status-draft { background: #f1f5f9; color: var(--ei-muted); }
.ei-status { font-size: 13px; color: var(--ei-muted); }

.ei-reward-img { height: 150px; background-size: cover; background-position: center; background-color: var(--ei-soft); }
.ei-reward-body { padding: 16px; }
.ei-progress { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin: 12px 0 4px; }
.ei-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--ei-brand), #38bdf8); transition: width .4s ease; }

.ei-btn, .ei-claim {
	display: inline-block; width: 100%; margin-top: 14px; cursor: pointer;
	background: var(--ei-brand); color: #fff; border: none; border-radius: 8px;
	padding: 11px 16px; font-size: 15px; font-weight: 700;
}
.ei-btn:hover, .ei-claim:hover { background: var(--ei-brand-dark); }
.ei-claim:disabled { background: #cbd5e1; cursor: not-allowed; }

.ei-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ei-table th, .ei-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--ei-line); }
.ei-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--ei-muted); }
.ei-right { text-align: right; }
.ei-pos { color: var(--ei-good); font-weight: 700; }
.ei-neg { color: var(--ei-bad); font-weight: 700; }

.ei-leaderboard { list-style: none; margin: 0; padding: 0; }
.ei-leaderboard li { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--ei-line); }
.ei-rank { width: 28px; height: 28px; border-radius: 50%; background: var(--ei-soft); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.ei-leaderboard li:nth-child(1) .ei-rank { background: #fde68a; }
.ei-leaderboard li:nth-child(2) .ei-rank { background: #e5e7eb; }
.ei-leaderboard li:nth-child(3) .ei-rank { background: #fed7aa; }
.ei-lb-name { flex: 1; font-weight: 600; }
.ei-lb-pts { color: var(--ei-brand-dark); font-weight: 700; }

.ei-status-pending { background: #fef3c7; color: #92400e; }
.ei-status-fulfilled { background: #dcfce7; color: #166534; }
.ei-status-cancelled { background: #fee2e2; color: #991b1b; }
.ei-status-active { background: #dcfce7; color: #166534; }
.ei-status-inactive, .ei-status-draft { background: #f1f5f9; color: var(--ei-muted); }

/* Account settings */
.ei-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.ei-settings-grid .ei-manage-form { max-width: none; margin-top: 0; }
.ei-logo-preview { background: #fff; border: 1px dashed var(--ei-line); border-radius: 10px; padding: 12px; text-align: center; }
.ei-logo-preview img { max-height: 64px; max-width: 100%; }

.ei-card { border: 1px solid var(--ei-line); border-radius: 12px; padding: 28px; max-width: 420px; margin: 40px auto; }
.ei-login-prompt .ei-card h2 { margin-top: 0; }

/* Toasts */
#ei-toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; }
.ei-toast {
	background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px;
	font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2);
	opacity: 0; transform: translateY(10px); transition: all .3s ease; max-width: 320px;
}
.ei-toast.is-in { opacity: 1; transform: translateY(0); }
.ei-toast-success { background: #16a34a; }
.ei-toast-error { background: #dc2626; }

/* Element titles */
.ei-el-title { font-size: 20px; margin: 0 0 16px; }

/* Notices */
.ei-notice { position: relative; padding: 12px 40px 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; transition: opacity .3s ease, transform .3s ease; }
.ei-notice.is-hiding { opacity: 0; transform: translateY(-6px); }
.ei-notice-x {
	position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
	background: none; border: none; cursor: pointer; color: inherit; opacity: .6;
	font-size: 20px; line-height: 1; padding: 4px 6px;
}
.ei-notice-x:hover { opacity: 1; }
.ei-notice-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.ei-notice-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* Admin preview badge */
.ei-badge-preview {
	display: inline-block; vertical-align: middle; margin-left: 8px;
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
	background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 999px;
}

/* Nav links */
.ei-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.ei-links .ei-link {
	text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ei-brand-dark);
	border: 1px solid var(--ei-line); padding: 8px 14px; border-radius: 8px;
}
.ei-links .ei-link:hover { border-color: var(--ei-brand); background: var(--ei-soft); }
.ei-reg-links { margin-top: 14px; }

/* Native auth forms */
.ei-auth-form { margin-top: 4px; }
.ei-auth-form .ei-inline-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.ei-auth-form .ei-inline-check input { width: auto; }
.ei-login-prompt .ei-btn { width: 100%; }

/* Forms */
.ei-form { display: flex; flex-direction: column; gap: 14px; }
.ei-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ei-fg); }
.ei-form input {
	width: 100%; padding: 10px 12px; border: 1px solid var(--ei-line); border-radius: 8px;
	font-size: 15px; font-weight: 400;
}
.ei-form input:focus { outline: none; border-color: var(--ei-brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.ei-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ei-hint { font-size: 12px; font-weight: 400; color: var(--ei-muted); }
.ei-form .ei-btn { margin-top: 4px; }
.ei-code { background: var(--ei-soft); border: 1px solid var(--ei-line); padding: 2px 8px; border-radius: 6px; font-weight: 700; letter-spacing: .05em; }

/* Bulk bar + pending */
.ei-bulkbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ei-bulkbar label { font-size: 14px; color: var(--ei-muted); }
.ei-btn { text-decoration: none; }
.ei-btn-sm { width: auto; margin: 0; padding: 8px 14px; font-size: 13px; }
.ei-btn-ghost { background: #fff; color: var(--ei-muted); border: 1px solid var(--ei-line); }
.ei-btn-ghost:hover { background: #f8fafc; color: var(--ei-brand); border-color: var(--ei-brand); }
.ei-btn-ghost.ei-danger { color: var(--ei-bad); }
.ei-btn-ghost.ei-danger:hover { background: #fef2f2; border-color: var(--ei-bad); color: var(--ei-bad); }
.ei-count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: #e2e8f0; color: #64748b; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.ei-count.has-items { background: #fee2e2; color: #991b1b; }
.ei-row-actions a { text-decoration: none; }

/* Quizzes */
.ei-quiz { margin-top: 14px; border-top: 1px solid var(--ei-line); padding-top: 12px; }
.ei-quiz-result { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ei-quiz-toggle { display: inline-block; }
.ei-quiz-lock { font-size: 12px; margin: 8px 0 0; }
.ei-quiz[data-ei-quiz-state="ready"] .ei-quiz-lock { display: none; }
.ei-quiz[data-ei-quiz-state="locked"] .ei-quiz-toggle { opacity: .5; cursor: not-allowed; }
.ei-quiz-form { display: none; margin-top: 12px; }
.ei-quiz.is-open .ei-quiz-form { display: block; }
.ei-quiz-q { border: 1px solid var(--ei-line); border-radius: 8px; padding: 12px 14px; margin: 0 0 10px; }
.ei-quiz-q legend { font-weight: 700; font-size: 14px; padding: 0 4px; }
.ei-quiz-opt { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.ei-quiz-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.ei-quiz-feedback { margin-top: 10px; font-size: 13px; font-weight: 600; }
.ei-quiz-retry { color: #92400e; }
.ei-quiz-error { color: var(--ei-bad); }

/* Training detail page — two-column: video + course info | facts + questions */
.ei-training-back { margin: 0 0 16px; }
.ei-training-back a { text-decoration: none; font-weight: 600; color: var(--ei-brand-dark); }

.ei-video-card.ei-training-detail {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 28px;
	align-items: start;
	/* Undo the grid-card chrome: the detail page is a layout, not a card. */
	border: none;
	background: transparent;
	overflow: visible;
	padding: 0;
}
.ei-video-card.ei-training-detail:hover { box-shadow: none; }
.ei-video-card.ei-training-detail.is-complete { border: none; }

.ei-training-main { min-width: 0; }
.ei-training-head { margin: 0 0 16px; }
.ei-training-head h2 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; }
.ei-training-lede { font-size: 17px; color: var(--ei-muted); margin: 0; }

.ei-training-detail .ei-video-wrap {
	position: relative; background: #000; aspect-ratio: 16/9;
	border-radius: 14px; overflow: hidden;
	box-shadow: 0 12px 34px rgba(15, 23, 42, .14);
}

.ei-training-content { margin: 26px 2px 0; line-height: 1.7; }
.ei-training-content-title {
	font-size: 14px; text-transform: uppercase; letter-spacing: .06em;
	color: var(--ei-muted); margin: 0 0 10px; padding-bottom: 8px;
	border-bottom: 2px solid var(--ei-line);
}
.ei-training-content h2, .ei-training-content h3 { margin: 20px 0 8px; }
.ei-training-content ul, .ei-training-content ol { padding-left: 22px; }
.ei-training-content img { max-width: 100%; height: auto; border-radius: 10px; }
.ei-training-content a { color: var(--ei-brand-dark); }

/* Sidebar */
.ei-training-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
.ei-side-card { background: #fff; border: 1px solid var(--ei-line); border-radius: 14px; padding: 18px 20px; box-shadow: 0 4px 16px rgba(15, 23, 42, .05); }
.ei-facts-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--ei-line); font-size: 14px; font-weight: 600; }
.ei-facts-row:last-child { border-bottom: none; }
.ei-facts-row > span:first-child { color: var(--ei-muted); font-weight: 400; }

.ei-training-quiz h3 { margin: 0 0 4px; font-size: 16px; }
.ei-training-quiz .ei-quiz { border-top: none; padding-top: 0; margin-top: 0; }
.ei-training-quiz .ei-quiz-toggle { display: none; }
/* Questions reveal automatically once the video is completed. */
.ei-training-quiz .ei-quiz[data-ei-quiz-state="ready"] .ei-quiz-form { display: block; }
.ei-training-quiz .ei-quiz-q { background: var(--ei-soft); border: 1px solid var(--ei-line); }
.ei-training-quiz .ei-quiz-meta { flex-direction: column; align-items: stretch; gap: 8px; }
.ei-training-quiz .ei-quiz-submit { width: 100%; }

/* Course preview cards — videos play on the detail page only */
.ei-course-card {
	display: block; text-decoration: none; color: inherit;
	border: 1px solid var(--ei-line); border-radius: 12px; overflow: hidden;
	background: var(--ei-bg); transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.ei-course-card:hover { box-shadow: 0 8px 26px rgba(15,23,42,.10); transform: translateY(-2px); border-color: #cbd5e1; }
.ei-course-card.is-complete { border-color: var(--ei-good); }
.ei-course-thumb { position: relative; aspect-ratio: 16/9; background: #0f172a; overflow: hidden; }
.ei-course-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ei-course-ph { display: grid; place-items: center; height: 100%; color: #475569; font-size: 34px; }
.ei-course-play {
	position: absolute; inset: 0; margin: auto; width: 54px; height: 54px;
	display: grid; place-items: center; border-radius: 50%;
	background: rgba(255,255,255,.92); color: #0f172a; font-size: 20px; padding-left: 4px;
	box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: transform .15s ease;
}
.ei-course-card:hover .ei-course-play { transform: scale(1.08); }
.ei-course-done {
	position: absolute; top: 10px; right: 10px; background: var(--ei-good); color: #fff;
	font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.ei-course-body { padding: 16px; }
.ei-course-body h3 { margin: 0 0 6px; font-size: 17px; }
.ei-squiz-tile .ei-course-body { padding: 20px; }

/* Share */
.ei-share-btn { width: 100%; margin-top: 12px; }

/* Message threads */
.ei-msg-card h3 { display: flex; align-items: center; gap: 8px; }
.ei-msg-thread { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; max-height: 320px; overflow-y: auto; }
.ei-msg-thread-lg { max-height: 460px; }
.ei-msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.ei-msg-mine { background: #eff6ff; border: 1px solid #dbeafe; }
.ei-msg-theirs { background: var(--ei-soft); border: 1px solid var(--ei-line); }
.ei-msg-body { white-space: pre-wrap; word-break: break-word; }
.ei-msg-meta { display: block; margin-top: 6px; font-size: 11px; color: var(--ei-muted); }
.ei-msg-form textarea { width: 100%; margin-bottom: 8px; }
.ei-msg-form .ei-btn { width: 100%; margin: 0; }

.ei-training-link { text-decoration: none; color: inherit; }
.ei-training-link:hover { color: var(--ei-brand); }
.ei-training-more { margin: 10px 0 0; font-size: 14px; }
.ei-training-more a { text-decoration: none; font-weight: 600; color: var(--ei-brand-dark); }

@media (max-width: 920px) {
	.ei-video-card.ei-training-detail { grid-template-columns: 1fr; }
	.ei-training-side { position: static; }
}

/* Standalone questionnaires */
.ei-squiz-list { display: flex; flex-direction: column; gap: 18px; }
.ei-squiz-card { border: 1px solid var(--ei-line); border-radius: 12px; padding: 18px 20px; background: #fff; }
.ei-squiz-card h3 { margin: 0 0 6px; }
.ei-quiz-form.is-visible { display: block; margin-top: 10px; }

/* Locked player overlay */
.ei-lock-layer {
	position: absolute; inset: 0; z-index: 3; cursor: pointer;
	display: flex; align-items: flex-end; justify-content: flex-start;
	background: transparent;
}
.ei-lock-btn {
	margin: 0 0 10px 10px; width: 42px; height: 42px; border: none; border-radius: 50%;
	background: rgba(15,23,42,.75); color: #fff; font-size: 15px; cursor: pointer; line-height: 1;
}
.ei-lock-btn:hover { background: rgba(15,23,42,.95); }
.ei-lock-hint {
	margin: 0 0 20px 10px; font-size: 11px; color: #fff; background: rgba(15,23,42,.6);
	padding: 3px 9px; border-radius: 999px; pointer-events: none;
}
.ei-lock-progress {
	position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.25);
}
.ei-lock-progress span { display: block; height: 100%; width: 0; background: var(--ei-brand, #2563eb); transition: width .3s linear; }

/* Timed question modal (over the player) */
.ei-q-modal {
	position: absolute; inset: 0; z-index: 5; background: rgba(15,23,42,.88);
	display: flex; align-items: center; justify-content: center; padding: 14px;
}
.ei-q-box { background: #fff; border-radius: 12px; padding: 16px 18px; max-width: 480px; width: 100%; max-height: 100%; overflow: auto; }
.ei-q-box .ei-quiz-q { margin-bottom: 12px; }
.ei-q-continue { width: 100%; }

/* Quiz builder: preview + questions columns */
.ei-qb-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 20px; }
.ei-qb-cols .ei-manage-form { max-width: none; margin-top: 0; }
.ei-qb-preview-col { position: sticky; top: 24px; }
.ei-qb-preview-col h4 { margin: 0 0 12px; font-size: 17px; }
.ei-qb-preview { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 28px rgba(15, 23, 42, .14); }
.ei-qb-frame, .ei-qb-preview iframe, .ei-qb-preview video { width: 100%; height: 100%; display: block; border: 0; }
.ei-qb-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.ei-qb-preview-head h4 { margin: 0; font-size: 17px; }

/* "Video on top" layout: preview spans the full width, questions run below —
   a demo-style view of the quiz with the video still fully controllable. */
.ei-qb-cols.ei-qb-stacked { grid-template-columns: 1fr; }
.ei-qb-cols.ei-qb-stacked .ei-qb-preview-col { position: static; }
.ei-qb-cols.ei-qb-stacked .ei-qb-preview { max-width: 860px; margin: 0 auto; }
.ei-qb-cols.ei-qb-stacked .ei-qb-timebar { max-width: 860px; margin-left: auto; margin-right: auto; }
.ei-qb-timebar { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ei-qb-clock {
	font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px;
	background: #fff; border: 1px solid var(--ei-line); border-radius: 8px;
	padding: 5px 10px; min-width: 54px; text-align: center; flex-shrink: 0;
}
@media (max-width: 860px) { .ei-qb-cols { grid-template-columns: 1fr; } .ei-qb-preview-col { position: static; } }

/* View controls: grid / theater toggle */
.ei-view-bar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-bottom: 14px; }
.ei-view-btn {
	background: #fff; border: 1px solid var(--ei-line); border-radius: 8px; cursor: pointer;
	padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--ei-muted);
}
.ei-view-btn.is-active { border-color: var(--ei-brand); color: var(--ei-brand); background: var(--ei-soft); }

/* Theater view: single large column */
.ei-grid.ei-view-theater { grid-template-columns: 1fr; max-width: 820px; margin-left: auto; margin-right: auto; }

/* Per-video expand: card spans the full grid width */
.ei-video-card { position: relative; }
.ei-video-expand {
	position: absolute; top: 8px; right: 8px; z-index: 2;
	background: rgba(15,23,42,.7); color: #fff; border: none; border-radius: 6px;
	width: 32px; height: 32px; font-size: 15px; cursor: pointer; line-height: 1;
}
.ei-video-expand:hover { background: rgba(15,23,42,.9); }
.ei-video-card.is-expanded { grid-column: 1 / -1; }
.ei-video-card.is-expanded .ei-video-wrap { max-width: 900px; margin: 0 auto; width: 100%; }

/* (Role-aware nav styles live in ei-nav.css, loaded site-wide.) */

/* Plan cards */
.ei-plan-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ei-plan-card { border: 1px solid var(--ei-line); border-radius: 12px; padding: 20px; text-align: center; background: #fff; }
.ei-plan-card.is-current { border-color: var(--ei-brand); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.ei-plan-card h3 { margin: 0 0 6px; font-size: 18px; }
.ei-plan-price { font-size: 22px; font-weight: 800; color: var(--ei-brand-dark); margin-bottom: 12px; }
.ei-plan-caps { list-style: none; margin: 0 0 14px; padding: 0; font-size: 13px; color: var(--ei-muted); }
.ei-plan-caps li { padding: 3px 0; border-bottom: 1px dashed var(--ei-line); }
.ei-plan-card .ei-btn { width: 100%; }

/* Leaderboards two-column */
.ei-lb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 640px) { .ei-lb-cols { grid-template-columns: 1fr; } }

/* Workspace-admin manage panel */
.ei-manage-h { font-size: 18px; margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--ei-line); }

/* Content sub-tabs: one section (videos / incentives / questionnaires) at a time */
.ei-subtabs { display: flex; gap: 8px; margin: 18px 0 22px; flex-wrap: wrap; }
.ei-subtab {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 9px 16px; border-radius: 999px; border: 1px solid var(--ei-line);
	background: #fff; font-size: 14px; font-weight: 600; color: var(--ei-muted); cursor: pointer;
	transition: border-color .15s ease, color .15s ease;
}
.ei-subtab:hover { border-color: var(--ei-brand); color: var(--ei-brand); }
.ei-subtab.is-active { background: var(--ei-brand); border-color: var(--ei-brand); color: #fff; }
.ei-subtab-count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
	background: rgba(37, 99, 235, .1); color: var(--ei-brand-dark); font-size: 12px; font-weight: 700;
}
.ei-subtab.is-active .ei-subtab-count { background: rgba(255, 255, 255, .22); color: #fff; }
.ei-subpanel { display: none; }
.ei-subpanel.is-active { display: block; }

/* Section header: title left, "+ Add" button right */
.ei-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.ei-panel-head .ei-manage-h { margin: 0; padding: 0; border: none; }

/* Add/edit forms stay hidden until requested */
.ei-manage-form.ei-collapsed { display: none; }

/* Focused create/edit views (companies, users): form + overview side card */
.ei-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ei-editor-grid .ei-editor-form { max-width: none; margin-top: 0; }
.ei-editor-info { background: #fff; border: 1px solid var(--ei-line); border-radius: 12px; padding: 18px 20px; box-shadow: 0 4px 16px rgba(15, 23, 42, .05); }
.ei-editor-info h4 { margin: 0 0 6px; font-size: 15px; }
@media (max-width: 860px) { .ei-editor-grid { grid-template-columns: 1fr; } }
.ei-manage-form { max-width: 640px; margin-top: 16px; padding: 18px; border: 1px solid var(--ei-line); border-radius: 12px; background: var(--ei-soft); }
.ei-manage-form h4 { margin: 0 0 4px; font-size: 16px; }
.ei-manage-form select { width: 100%; padding: 10px 12px; border: 1px solid var(--ei-line); border-radius: 8px; font-size: 15px; background: #fff; }

/* Quiz builder — compact question cards */
.ei-qb-questions { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.ei-qb-q { background: #fff; border: 1px solid var(--ei-line); border-radius: 10px; padding: 10px 12px; }
.ei-qb-qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ei-qb-num {
	flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
	background: var(--ei-brand); color: #fff; font-size: 12px; font-weight: 700;
	display: inline-flex; align-items: center; justify-content: center;
}
.ei-qb-qhead .ei-qb-qtext { flex: 1; min-width: 160px; margin: 0; font-weight: 600; }
.ei-qb-timebox { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ei-qb-timebox .ei-qb-time { width: 74px; margin: 0; text-align: center; padding: 8px 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ei-qb-stamp { border: 1px solid var(--ei-line); background: #fff; border-radius: 8px; cursor: pointer; padding: 7px 9px; font-size: 13px; line-height: 1; }
.ei-qb-stamp:hover { border-color: var(--ei-brand); }
.ei-qb-q input[type=text] { padding: 8px 10px; font-size: 14px; }
.ei-qb-dtext { width: 100%; margin: 0 0 8px; font-size: 13px; color: var(--ei-muted); }
.ei-q-detail { margin: 2px 0 8px; font-size: 13px; color: var(--ei-muted); }

/* Accordion questions: collapsed cards show just the numbered header row */
.ei-qb-chevron {
	flex-shrink: 0; border: none; background: none; cursor: pointer;
	color: var(--ei-muted); font-size: 15px; line-height: 1; padding: 4px 6px;
	transition: transform .15s ease;
}
.ei-qb-q.is-open .ei-qb-chevron { transform: rotate(180deg); }
.ei-qb-q:not(.is-open) .ei-qb-dtext,
.ei-qb-q:not(.is-open) .ei-qb-opts,
.ei-qb-q:not(.is-open) .ei-qb-qactions { display: none; }
.ei-qb-q:not(.is-open) .ei-qb-qhead { margin-bottom: 0; }

/* File storage */
.ei-file-upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ei-file-upload-row input[type=file] { flex: 1; min-width: 180px; font-size: 13px; }
.ei-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.ei-file-grid-lg { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.ei-file-grid-lg .ei-file img { height: 110px; }
.ei-file-name { display: block; font-size: 12px; margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ei-panel-head .ei-file-upload { margin: 0; }
.ei-dropzone {
	border: 2px dashed var(--ei-line); border-radius: 14px; background: var(--ei-soft);
	padding: 22px 20px; text-align: center; transition: border-color .15s ease, background .15s ease;
	margin: 12px 0 14px;
}
.ei-dropzone.is-drag { border-color: var(--ei-brand); background: #eff6ff; }
.ei-dropzone.is-uploading { opacity: .85; pointer-events: none; }
.ei-upload-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ei-upload-track { flex: 1; height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.ei-upload-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ei-brand), #38bdf8); transition: width .2s ease; border-radius: 999px; }
.ei-upload-pct { font-size: 12px; font-weight: 700; color: var(--ei-muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.ei-dropzone-msg { margin: 0 0 10px; color: var(--ei-muted); }
.ei-dropzone .ei-file-upload-row { justify-content: center; margin-bottom: 0; }
.ei-dropzone input[type=file] { flex: 0 1 auto; }
.ei-file-doc {
	display: flex; align-items: center; justify-content: center;
	height: 110px; background: #fef2f2; color: #991b1b; font-weight: 800; font-size: 18px;
	border-radius: 8px; border: 1px solid var(--ei-line); letter-spacing: .05em;
}
.ei-file { margin: 0; }
.ei-file img { width: 100%; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--ei-line); display: block; }
.ei-file figcaption { margin-top: 4px; }
.ei-file figcaption input { width: 100%; font-size: 11px; padding: 4px 6px; border: 1px solid var(--ei-line); border-radius: 6px; color: var(--ei-muted); }
.ei-file figcaption a { font-size: 12px; }
.ei-row-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; border: 1px solid var(--ei-line); }
.ei-qb-opts { display: flex; flex-direction: column; gap: 5px; }
.ei-qb-opt { display: flex; align-items: center; gap: 8px; }
.ei-qb-opt input[type=radio] { flex-shrink: 0; }
.ei-qb-opt .ei-qb-otext { flex: 1; margin: 0; }
.ei-qb-x { background: none; border: none; color: var(--ei-bad); font-size: 18px; cursor: pointer; line-height: 1; padding: 0 6px; }
.ei-qb-qactions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.ei-qb-qactions .ei-danger { margin-left: auto; }
.ei-pill-muted { background: #e2e8f0; color: #475569; }

@media (max-width: 640px) {
	.ei-stats { grid-template-columns: repeat(2, 1fr); }
	.ei-portal-head { flex-direction: column; align-items: flex-start; }
	.ei-field-row { grid-template-columns: 1fr; }
}
