/*
 * Self-contained palette so the tool looks the same inside any theme
 * (same approach as the other EducationalEngine generators).
 */
.ee-mcq-app {
	--ee-mcq-bg: #ffffff;
	--ee-mcq-surface: #f1f5f9;
	--ee-mcq-text: #1e293b;
	--ee-mcq-muted: #52606d;
	--ee-mcq-border: #cbd5e1;
	--ee-mcq-accent: #1d4ed8;
	--ee-mcq-accent-hover: #1e40af;
	--ee-mcq-correct: #15803d;
	--ee-mcq-correct-bg: #f0fdf4;
	--ee-mcq-danger: #b91c1c;
	--ee-mcq-danger-bg: #fef2f2;

	max-width: 900px;
	margin: 0 auto 48px;
	padding: 24px;
	background: var(--ee-mcq-bg);
	border: 1px solid var(--ee-mcq-border);
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
	color: var(--ee-mcq-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.5;
}
.ee-mcq-app * { box-sizing: border-box; }
.ee-mcq-app button, .ee-mcq-app input, .ee-mcq-app select, .ee-mcq-app textarea {
	font-family: inherit; box-shadow: none; text-shadow: none; background-image: none;
}

.ee-mcq-quota-bar {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center;
	background: var(--ee-mcq-surface); border: 1px solid var(--ee-mcq-border); border-radius: 6px;
	padding: 10px 16px; margin-bottom: 16px; font-size: 0.9em;
}
.ee-mcq-quota-label { font-weight: 700; }
.ee-mcq-quota-count { color: var(--ee-mcq-muted); }
.ee-mcq-quota-count a { color: var(--ee-mcq-accent); }

.ee-mcq-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--ee-mcq-border); }
.ee-mcq-tab {
	background: transparent !important; border: 0; border-bottom: 3px solid transparent; color: var(--ee-mcq-muted) !important;
	padding: 8px 12px; font-weight: 600; cursor: pointer; margin-bottom: -1px;
}
.ee-mcq-tab.is-active { color: var(--ee-mcq-accent) !important; border-bottom-color: var(--ee-mcq-accent); }
.ee-mcq-panel { display: none; }
.ee-mcq-panel.is-active { display: block; }

.ee-mcq-field { margin-bottom: 14px; flex: 1 1 0; min-width: 0; }
.ee-mcq-field label, .ee-mcq-sizes legend { display: block; font-weight: 600; font-size: 0.9em; margin-bottom: 4px; color: var(--ee-mcq-text); }
.ee-mcq-field input, .ee-mcq-field select, .ee-mcq-field textarea {
	width: 100%; padding: 8px 10px; height: auto; min-height: 40px; border: 1px solid var(--ee-mcq-border); border-radius: 6px;
	background: #fff !important; color: var(--ee-mcq-text) !important; font-size: 0.95em;
}
.ee-mcq-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ee-mcq-row .ee-mcq-field { min-width: 180px; }
.ee-mcq-hint { font-size: 0.82em; color: var(--ee-mcq-muted); margin: 4px 0 0; }

.ee-mcq-sizes { border: 0; padding: 0; margin: 4px 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.ee-mcq-sizes legend { width: 100%; }
.ee-mcq-styles { border: 0; padding: 0; margin: 4px 0 12px; display: grid; gap: 6px; }
.ee-mcq-styles legend { display: block; font-weight: 600; font-size: 0.9em; margin-bottom: 4px; color: var(--ee-mcq-text); }
.ee-mcq-style { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--ee-mcq-border, #cbd5e1); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 0.92em; }
.ee-mcq-style input { width: auto; min-height: 0; margin: 3px 0 0; }
.ee-mcq-style:has(input:checked) { border-color: var(--ee-mcq-accent); background: #eff6ff; }
.ee-mcq-tag-scenario { background: #e0f2fe; color: #075985; }
.ee-mcq-size {
	display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ee-mcq-border); border-radius: 8px;
	padding: 8px 12px; cursor: pointer; background: #fff;
}
.ee-mcq-size input { width: auto; min-height: 0; margin: 0; }
.ee-mcq-size:has(input:checked) { border-color: var(--ee-mcq-accent); background: #eff6ff; }
.ee-mcq-size-cost { font-size: 0.8em; color: var(--ee-mcq-accent); font-weight: 700; }

.ee-mcq-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 6px; cursor: pointer;
	border: 1px solid var(--ee-mcq-border); background: #fff !important; color: var(--ee-mcq-text) !important;
	font-weight: 600; font-size: 0.9em; text-decoration: none !important; line-height: 1.2;
}
.ee-mcq-btn:hover { border-color: var(--ee-mcq-accent); color: var(--ee-mcq-accent) !important; }
.ee-mcq-btn-primary { background: var(--ee-mcq-accent) !important; border-color: var(--ee-mcq-accent); color: #fff !important; padding: 10px 18px; font-size: 1em; }
.ee-mcq-btn-primary:hover { background: var(--ee-mcq-accent-hover) !important; color: #fff !important; }
.ee-mcq-btn[disabled] { opacity: 0.6; cursor: wait; }
.ee-mcq-btn-small { padding: 5px 10px; font-size: 0.82em; }
.ee-mcq-cost-badge { background: rgba(255, 255, 255, 0.2); border-radius: 999px; padding: 2px 8px; font-size: 0.8em; }

.ee-mcq-status { margin: 14px 0 0; font-weight: 600; color: var(--ee-mcq-accent); }
.ee-mcq-status.is-error, .ee-mcq-error { color: var(--ee-mcq-danger); }
.ee-mcq-result { margin-top: 18px; }

.ee-mcq-list { list-style: none; padding: 0; margin: 0 0 16px; }
.ee-mcq-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--ee-mcq-border); }
.ee-mcq-view-btn { background: none !important; border: 0; padding: 0; color: var(--ee-mcq-accent) !important; font-weight: 600; cursor: pointer; text-align: left; }
.ee-mcq-list-meta { color: var(--ee-mcq-muted); font-size: 0.85em; }

.ee-mcq-set-header h3 { margin: 0 0 4px; }
.ee-mcq-set-meta { color: var(--ee-mcq-muted); font-size: 0.9em; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ee-mcq-upsell-source-note { font-size: 0.85em; font-style: italic; color: var(--ee-mcq-muted); margin: 0 0 6px; }
.ee-mcq-permalink { font-size: 0.85em; margin: 0 0 10px; }

.ee-mcq-incomplete { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.ee-mcq-incomplete p { margin: 0 0 8px; }

.ee-mcq-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 18px; padding: 10px 0; border-top: 1px solid var(--ee-mcq-border); border-bottom: 1px solid var(--ee-mcq-border); }
.ee-mcq-toolbar-label { font-size: 0.82em; color: var(--ee-mcq-muted); margin-left: 8px; }

.ee-mcq-questions { padding-left: 1.4em; margin: 0; }
.ee-mcq-question { margin-bottom: 22px; }
.ee-mcq-stem { font-weight: 600; margin-bottom: 8px; }
.ee-mcq-options { list-style: none; padding: 0; margin: 0 0 8px; }
.ee-mcq-option { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; padding: 6px 8px; border-radius: 6px; margin-bottom: 2px; }
.ee-mcq-letter { font-weight: 700; color: var(--ee-mcq-muted); }
.ee-mcq-feedback { grid-column: 2; font-size: 0.85em; color: var(--ee-mcq-muted); }
.ee-mcq-option.is-correct { background: var(--ee-mcq-correct-bg); }
.ee-mcq-option.is-correct .ee-mcq-letter, .ee-mcq-option.is-correct .ee-mcq-option-text { color: var(--ee-mcq-correct); font-weight: 700; }
.ee-mcq-answer { font-size: 0.9em; background: var(--ee-mcq-surface); border-left: 3px solid var(--ee-mcq-correct); border-radius: 4px; padding: 8px 12px; }
.ee-mcq-tags { display: inline-flex; gap: 4px; margin-left: 6px; }
.ee-mcq-tag { display: inline-block; font-size: 0.75em; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: #e2e8f0; color: #334155; }
.ee-mcq-tag-bloom { background: #ede9fe; color: #5b21b6; }
.ee-mcq-tag-easy { background: #dcfce7; color: #166534; }
.ee-mcq-tag-moderate { background: #fef3c7; color: #92400e; }
.ee-mcq-tag-hard { background: #fee2e2; color: #991b1b; }

/* Hide answers (for projecting to a class). */
.ee-mcq-set.is-answers-hidden .ee-mcq-answer-only { display: none; }
.ee-mcq-set.is-answers-hidden .ee-mcq-option.is-correct { background: transparent; }
.ee-mcq-set.is-answers-hidden .ee-mcq-option.is-correct .ee-mcq-letter,
.ee-mcq-set.is-answers-hidden .ee-mcq-option.is-correct .ee-mcq-option-text { color: inherit; font-weight: inherit; }
.ee-mcq-set.is-answers-hidden .ee-mcq-letter { color: var(--ee-mcq-muted); font-weight: 700; }

.ee-mcq-disclaimer { font-size: 0.8em; color: var(--ee-mcq-muted); margin-top: 16px; }

@media (max-width: 600px) {
	.ee-mcq-app { padding: 16px; }
	.ee-mcq-toolbar-label { width: 100%; margin: 4px 0 0; }
}

/* PDF upload. */
.ee-mcq-label { display: block; font-weight: 600; font-size: 0.9em; margin-bottom: 4px; }
.ee-mcq-pdf-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ee-mcq-pdf-picker[hidden], .ee-mcq-pdf-chip[hidden], .ee-mcq-pdf-preview[hidden] { display: none; }
.ee-mcq-pdf-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.ee-mcq-pdf-input:focus-visible + .ee-mcq-pdf-btn { outline: 2px solid var(--ee-mcq-accent); outline-offset: 2px; }
.ee-mcq-pdf-btn.is-busy { opacity: 0.6; pointer-events: none; }
.ee-mcq-pdf-status { font-size: 0.85em; color: var(--ee-mcq-accent); margin-top: 6px; }
.ee-mcq-pdf-status:empty { display: none; }
.ee-mcq-pdf-status.is-error { color: var(--ee-mcq-danger); font-weight: 600; }
.ee-mcq-pdf-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; border: 1px solid var(--ee-mcq-border); background: var(--ee-mcq-surface); border-radius: 8px; padding: 8px 12px; }
.ee-mcq-pdf-name { font-weight: 700; word-break: break-all; }
.ee-mcq-pdf-name::before { content: "PDF"; font-size: 0.7em; font-weight: 800; color: #fff; background: var(--ee-mcq-danger); border-radius: 3px; padding: 1px 5px; margin-right: 8px; vertical-align: middle; }
.ee-mcq-pdf-meta { color: var(--ee-mcq-muted); font-size: 0.85em; }
.ee-mcq-link { background: none !important; border: 0; padding: 0; color: var(--ee-mcq-accent) !important; font-weight: 600; font-size: 0.85em; cursor: pointer; text-decoration: underline; }
.ee-mcq-pdf-preview { margin-top: 8px; max-height: 260px; overflow: auto; white-space: pre-wrap; font-size: 0.85em; border: 1px solid var(--ee-mcq-border); border-radius: 6px; padding: 10px 12px; background: #fff; }
