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

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

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

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

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

.ee-mm-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 6px; cursor: pointer;
	border: 1px solid var(--ee-mm-border); background: #fff !important; color: var(--ee-mm-text) !important;
	font-weight: 600; font-size: 0.9em; text-decoration: none !important; line-height: 1.2;
}
.ee-mm-btn:hover { border-color: var(--ee-mm-accent); color: var(--ee-mm-accent) !important; }
.ee-mm-btn:focus-visible, .ee-mm-zoom-btn:focus-visible, .ee-mm-viewport:focus-visible { outline: 2px solid var(--ee-mm-accent); outline-offset: 2px; }
.ee-mm-btn-primary { background: var(--ee-mm-accent) !important; border-color: var(--ee-mm-accent); color: #fff !important; padding: 10px 18px; font-size: 1em; }
.ee-mm-btn-primary:hover { background: var(--ee-mm-accent-hover) !important; color: #fff !important; }
.ee-mm-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.ee-mm-btn-small { padding: 5px 10px; font-size: 0.82em; }
.ee-mm-btn-danger:hover { border-color: var(--ee-mm-danger); color: var(--ee-mm-danger) !important; }
.ee-mm-cost-badge { background: rgba(255, 255, 255, 0.2); border-radius: 999px; padding: 2px 8px; font-size: 0.8em; }
.ee-mm-btn:not(.ee-mm-btn-primary) .ee-mm-cost-badge { background: var(--ee-mm-surface); }
.ee-mm-link { background: none !important; border: 0; padding: 0; color: var(--ee-mm-accent) !important; font-weight: 600; font-size: 0.85em; cursor: pointer; text-decoration: underline; }

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

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

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

/* Map view. */
.ee-mm-item-header h3 { margin: 0 0 4px; }
.ee-mm-item-meta { color: var(--ee-mm-muted); font-size: 0.9em; margin: 0 0 6px; }
.ee-mm-upsell-source-note { font-size: 0.85em; font-style: italic; color: var(--ee-mm-muted); margin: 0 0 6px; }
.ee-mm-permalink { font-size: 0.85em; margin: 0 0 10px; }

.ee-mm-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 0; }
.ee-mm-export-bar { margin: 8px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ee-mm-border); }
.ee-mm-toolbar-label { font-size: 0.82em; color: var(--ee-mm-muted); }
.ee-mm-export-note { font-size: 0.78em; color: var(--ee-mm-muted); }
.ee-mm-view-switch { display: inline-flex; }
.ee-mm-view-switch .ee-mm-btn:first-child { border-radius: 6px 0 0 6px; }
.ee-mm-view-switch .ee-mm-btn:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.ee-mm-mode.is-active { background: var(--ee-mm-accent) !important; border-color: var(--ee-mm-accent); color: #fff !important; }
.ee-mm-student-hint { font-size: 0.85em; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 6px; padding: 8px 12px; margin: 0 0 10px; }

.ee-mm-viewport-wrap { position: relative; border: 1px solid var(--ee-mm-border); border-radius: 8px; background: #fff; }
.ee-mm-viewport { overflow: auto; max-height: 78vh; min-height: 220px; padding: 2px; -webkit-overflow-scrolling: touch; }
.ee-mm-viewport svg { display: block; margin: 0 auto; max-width: none; height: auto; }
.ee-mm-zoom { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; gap: 0; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15); border-radius: 6px; }
.ee-mm-zoom-btn {
	min-width: 34px; height: 32px; padding: 0 8px; border: 1px solid var(--ee-mm-border); background: #fff !important;
	color: var(--ee-mm-text) !important; font-weight: 700; cursor: pointer; font-size: 0.9em; line-height: 1;
}
.ee-mm-zoom-btn:first-child { border-radius: 6px 0 0 6px; }
.ee-mm-zoom-btn:last-child { border-radius: 0 6px 6px 0; }
.ee-mm-zoom-btn + .ee-mm-zoom-btn { margin-left: -1px; }
.ee-mm-toggle { cursor: pointer; }
.ee-mm-toggle:focus { outline: none; }
.ee-mm-toggle:focus-visible circle { stroke-width: 3; }
.ee-mm-item.is-editing .ee-mm-node { cursor: pointer; }
.ee-mm-item.is-editing .ee-mm-node:hover rect:first-child { filter: brightness(0.96); }
.ee-mm-node:focus { outline: none; }
.ee-mm-node:focus-visible rect:first-child { stroke: #f59e0b; stroke-width: 3; }

/* Editor. */
.ee-mm-editor { margin: 12px 0 0; border: 2px solid #f59e0b; border-radius: 8px; padding: 12px 14px; background: #fffdf5; }
.ee-mm-editor-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.ee-mm-editor-where { font-size: 0.85em; color: var(--ee-mm-muted); }
.ee-mm-editor-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.ee-mm-regen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; padding-top: 10px; border-top: 1px dashed var(--ee-mm-border); }
.ee-mm-regen .ee-mm-hint { margin: 0; }
.ee-mm-editor-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ee-mm-editor-status { font-size: 0.85em; color: var(--ee-mm-muted); }
.ee-mm-editor-status.is-error { color: var(--ee-mm-danger); font-weight: 600; }

.ee-mm-section { margin: 20px 0 0; }
.ee-mm-section h4 { margin: 0 0 8px; }
.ee-mm-outline p { margin: 0 0 4px; }
.ee-mm-outline ul { margin: 0 0 0 4px; padding-left: 18px; }
.ee-mm-outline li { margin: 3px 0; }
.ee-mm-note { color: #334155; }
.ee-mm-upsells { margin-top: 22px; }
.ee-mm-disclaimer { font-size: 0.8em; color: var(--ee-mm-muted); margin-top: 16px; }

/* Student fill-in view hides the educator-only parts (outline = answers). */
.ee-mm-item.is-student-view .ee-mm-edu-only { display: none; }

@media (max-width: 600px) {
	.ee-mm-app { padding: 16px; }
	.ee-mm-row .ee-mm-field { min-width: 100%; }
	.ee-mm-viewport { max-height: 70vh; }
	.ee-mm-export-note { width: 100%; }
}
