/* Lesson tools (calculator, graph, quadratic solver) for the Kids / IG lessons. Taken from the Grade 10 lesson tools. */
.mmx-pro,
.mmx-win,
.mmx-topbar {
	--i-calc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2.5' width='16' height='19' rx='3'/%3E%3Cpath d='M8 7h8M8 12h.01M12 12h.01M16 12h.01M8 16h.01M12 16h.01M16 16h.01'/%3E%3C/svg%3E");
	--i-sigma: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 5V4H6l6 8-6 8h12v-1'/%3E%3C/svg%3E");
	--i-kbd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='3'/%3E%3Cpath d='M6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M9 15.5h6'/%3E%3C/svg%3E");
	--i-target: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='black'/%3E%3C/svg%3E");
	--i-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3H20v15H6.5A2.5 2.5 0 0 0 4 20.5z'/%3E%3Cpath d='M4 20.5A2.5 2.5 0 0 0 6.5 23H20v-5'/%3E%3C/svg%3E");
	--i-bulb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21.5h4'/%3E%3Cpath d='M12 2.5a6.5 6.5 0 0 0-4 11.6c.7.6 1 1.3 1 2.1V16h6v-.8c0-.8.3-1.5 1-2.1a6.5 6.5 0 0 0-4-11.6z'/%3E%3C/svg%3E");
	--i-key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='4.5'/%3E%3Cpath d='M10.7 12.3 21 2M17 6l3 3M14.5 8.5l2 2'/%3E%3C/svg%3E");
	--i-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17v5'/%3E%3Cpath d='M9 3h6l-1 6 3.5 3.5V15h-11v-2.5L10 9z'/%3E%3C/svg%3E");
	--i-pencil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z'/%3E%3Cpath d='M14.5 5.5l3 3'/%3E%3C/svg%3E");
	--i-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.2a6.5 6.5 0 0 1 3.5 5.8'/%3E%3C/svg%3E");
	--i-dumbbell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7v10M17 7v10M4 9.5v5M20 9.5v5M7 12h10'/%3E%3C/svg%3E");
	--i-trophy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4h10v5a5 5 0 0 1-10 0z'/%3E%3Cpath d='M7 6H4a3 3 0 0 0 3 4M17 6h3a3 3 0 0 1-3 4M12 14v4M8 21h8M9.5 18h5'/%3E%3C/svg%3E");
	--i-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
	--i-flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 22V3M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E");
	--i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2l2.2 6.3L20.5 10l-6.3 2.2L12 18.5l-2.2-6.3L3.5 10l6.3-1.7z'/%3E%3Cpath d='M19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z'/%3E%3C/svg%3E");
	--i-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M9 6h12M9 12h12M9 18h12'/%3E%3Ccircle cx='4' cy='6' r='1.2' fill='black'/%3E%3Ccircle cx='4' cy='12' r='1.2' fill='black'/%3E%3Ccircle cx='4' cy='18' r='1.2' fill='black'/%3E%3C/svg%3E");
}


.mmx-ic {
	display: inline-block;
	flex: none;
	width: 20px;
	height: 20px;
	background: currentColor;
	-webkit-mask: var(--icon) center / contain no-repeat;
	mask: var(--icon) center / contain no-repeat;
}
.mmx-ic--list { --icon: var(--i-list); }
.mmx-ic--calc { --icon: var(--i-calc); }
.mmx-ic--sigma { --icon: var(--i-sigma); }
.mmx-ic--kbd { --icon: var(--i-kbd); }
.mmx-ic--trophy { --icon: var(--i-trophy); }
.mmx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 42px;
	padding: 8px 18px;
	border: 0;
	border-radius: 12px;
	background: var(--x-accent);
	color: #fff;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 3px 0 var(--x-accent-dark);
	transition: transform .12s, background-color .15s;
}
.mmx-btn:hover { background: var(--x-accent-dark); transform: translateY(-1px); }
.mmx-btn:focus-visible, .mmx-iconbtn:focus-visible { outline: 3px solid var(--x-tint-2); outline-offset: 2px; }
.mmx-btn--ghost { background: #fff; color: var(--x-accent-dark); box-shadow: inset 0 0 0 2px var(--x-tint-2); }
.mmx-btn--ghost:hover { background: var(--x-tint); }
.mmx-btn--soft { background: #16a34a; box-shadow: 0 3px 0 #166534; }
.mmx-btn--soft:hover { background: #15803d; }
.mmx-btn--done { width: 100%; background: #db2777; box-shadow: 0 3px 0 #9d174d; }
.mmx-btn--done:hover { background: #be185d; }
.mmx-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 44px;
	border: 2px solid var(--x-tint-2);
	border-radius: 12px;
	background: var(--x-tint);
	color: var(--x-accent-dark);
	cursor: pointer;
}
.mmx-iconbtn:hover { background: var(--x-tint-2); }
:root:root .mmx-tb__btn[data-act="calc"] .mmx-ic { color: var(--x-orange); }
:root:root .mmx-tb__btn[data-act="editor"] .mmx-ic { color: var(--x-violet); }
.mmx-win {
	position: fixed;
	z-index: 100000;
	top: 90px;
	right: 24px;
	width: min(380px, calc(100vw - 24px));
	max-height: calc(100vh - 110px);
	display: flex;
	flex-direction: column;
	border-radius: 20px;
	background: #fff;
	color: #13183a;
	font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	box-shadow: 0 24px 60px rgba(19, 24, 58, .28), 0 0 0 1px rgba(19, 24, 58, .06);
	overflow: hidden;
}
.mmx-win[hidden] { display: none; }
.mmx-win *, .mmx-win *::before, .mmx-win *::after { box-sizing: border-box; }
.mmx-win__bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 10px 10px 16px;
	background: linear-gradient(120deg, var(--x-accent-dark), var(--x-accent-2));
	color: #fff;
	cursor: grab;
	touch-action: none;
	user-select: none;
}
.mmx-win__bar:active { cursor: grabbing; }
.mmx-win__title { flex: 1 1 auto; font-weight: 900; font-size: 1.02em; }
.mmx-win__btn {
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 10px;
	background: rgba(255, 255, 255, .16);
	color: #fff;
	font: inherit;
	font-size: 1.25em;
	font-weight: 900;
	line-height: 1;
	cursor: pointer;
}
.mmx-win__btn:hover { background: rgba(255, 255, 255, .3); }
.mmx-win__body { padding: 14px; overflow: auto; }
.mmx-win.is-min .mmx-win__body { display: none; }
.mmx-win--calc { width: min(340px, calc(100vw - 24px)); }
.mmx-win--calc .mmx-win__bar { background: linear-gradient(120deg, #c2410c, #ea580c); }
.mmx-win--editor { top: auto; bottom: 24px; right: 24px; width: min(520px, calc(100vw - 24px)); }
.mmx-win--editor .mmx-win__bar { background: linear-gradient(120deg, var(--x-accent-2), var(--x-accent)); }
.mmx-win--panel { right: auto; left: 24px; width: min(400px, calc(100vw - 24px)); }
.mmx-win--done { top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 24px)); }
.mmx-win--done .mmx-win__bar { background: linear-gradient(120deg, #be185d, #db2777); }
.mmx-calc__screen { margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: #1e1b4b; color: #fff; }
.mmx-calc__mode { display: flex; gap: 4px; margin-bottom: 4px; }
.mmx-calc__deg { padding: 2px 8px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .12); color: var(--x-tint-2); font: inherit; font-size: .75em; font-weight: 800; cursor: pointer; }
.mmx-calc__deg.is-on { background: #facc15; color: #3b2a00; }
.mmx-calc__in { width: 100%; padding: 4px 0; border: 0; background: transparent; color: var(--x-tint-2); font: inherit; font-size: 1.1em; outline: none; }
.mmx-calc__out { text-align: right; font-size: 1.7em; font-weight: 900; font-variant-numeric: tabular-nums; overflow-x: auto; white-space: nowrap; }
.mmx-calc__out.is-err { color: #fca5a5; }
.mmx-calc__keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mmx-calc__key {
	min-height: 46px;
	border: 0;
	border-radius: 12px;
	background: #eef0f8;
	color: #1e1b4b;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 2px 0 #d5d9ea;
}
.mmx-calc__key:active { transform: translateY(1px); box-shadow: none; }
.mmx-calc__key.is-num { background: #fff; box-shadow: inset 0 0 0 1px #e3e6f3, 0 2px 0 #d5d9ea; font-size: 1.1em; }
.mmx-calc__key.is-del { background: #fee2e2; color: #991b1b; }
.mmx-calc__key.is-eq { background: #ea580c; color: #fff; box-shadow: 0 2px 0 #9a3412; font-size: 1.2em; }
@media (max-width: 520px) {
	:root:root .mm-lesson.mmx-pro .mmx-answer { margin-left: 0; }
	:root:root .mm-lesson.mmx-pro .mmx-toolbar { flex-wrap: nowrap; gap: 6px; padding: 6px; }
	:root:root .mmx-tb__label { display: none; }
	:root:root .mmx-tb__btn { padding: 6px 10px; }
	:root:root .mmx-tb__btn[data-act="panel"] { flex: 1 1 auto; min-width: 0; }
	:root:root .mmx-tb__btn[data-act="panel"] .mmx-tb__label { display: inline; }
	.mmx-win { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; max-height: 70vh; }
	.mmx-win--done { top: 50%; bottom: auto; left: 50%; right: auto; width: calc(100vw - 24px); }
	.mmx-win--panel { right: 12px; left: 12px; }
	.mmx-calc__key { min-height: 42px; }
}
.mmx-ic--graph { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 3v17h17'/%3E%3Cpath d='M7 16c3-9 6-9 8-4s3 2 5-6'/%3E%3C/svg%3E"); }
:root:root .mmx-tb__btn[data-act="graph"] .mmx-ic { color: #2563eb; }
.mmx-win--graph { top: 70px; right: auto; left: 50%; transform: translateX(-50%); width: min(960px, calc(100vw - 24px)); }
.mmx-win--graph .mmx-win__bar { background: linear-gradient(120deg, #1d4ed8, #0891b2); }
.mmx-graph { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 12px; }
.mmx-graph__side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mmx-graph__list { display: flex; flex-direction: column; gap: 8px; }
.mmx-graph__row {
	display: grid;
	grid-template-columns: 24px minmax(0, 1fr) 28px;
	align-items: center;
	gap: 6px;
	padding: 6px 6px 6px 8px;
	border: 2px solid #e5e8f2;
	border-left: 6px solid var(--c);
	border-radius: 12px;
	background: #fff;
}
.mmx-graph__row.is-err { border-color: #fecaca; border-left-color: var(--c); }
.mmx-graph__dot { width: 22px; height: 22px; padding: 0; border: 3px solid var(--c); border-radius: 50%; background: var(--c); cursor: pointer; }
.mmx-graph__row.is-hidden .mmx-graph__dot { background: #fff; }
.mmx-graph__row.is-hidden .mmx-graph__in { opacity: .45; }
.mmx-graph__in { min-width: 0; }
.mmx-graph__mf, .mmx-graph__txt { display: block; width: 100%; min-height: 36px; border: 0; outline: none; background: transparent; font-size: 1.05em; }
.mmx-graph__txt { font: inherit; color: inherit; }
.mmx-graph__del { width: 28px; height: 28px; border: 0; border-radius: 8px; background: #f1f5f9; color: #475569; font: inherit; font-weight: 900; cursor: pointer; }
.mmx-graph__del:hover { background: #fee2e2; color: #b91c1c; }
.mmx-graph__err { grid-column: 1 / -1; margin: 0; color: #b91c1c; font-size: .85em; font-weight: 700; }
.mmx-graph__err:empty { display: none; }
.mmx-graph__hint { margin: 0; color: #64748b; font-size: .85em; line-height: 1.45; }
.mmx-graph__hint code { padding: 1px 5px; border-radius: 6px; background: #f1f5f9; color: #1e293b; }
.mmx-graph__stage { position: relative; min-width: 0; height: min(460px, 62vh); min-height: 260px; border: 2px solid #e5e8f2; border-radius: 14px; overflow: hidden; }
.mmx-graph__cv { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.mmx-graph__zoom { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; }
.mmx-graph__zoom button {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 10px;
	background: rgba(255, 255, 255, .95);
	box-shadow: 0 2px 8px rgba(19, 24, 58, .18);
	color: #1e293b;
	font: inherit;
	font-size: 1.25em;
	font-weight: 900;
	line-height: 1;
	cursor: pointer;
}
.mmx-graph__tip {
	position: absolute;
	padding: 4px 8px;
	border: 2px solid;
	border-radius: 8px;
	background: #fff;
	color: #13183a;
	font-size: .85em;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	pointer-events: none;
}
@media (max-width: 760px) {
	.mmx-graph { grid-template-columns: minmax(0, 1fr); }
	.mmx-graph__stage { height: 300px; }
}
@media (max-width: 520px) {
	.mmx-win--graph { top: auto; left: 12px; right: 12px; transform: none; width: auto; }
	.mmx-graph__stage { height: 240px; min-height: 220px; }
	.mmx-graph__hint { display: none; }
}
.mmx-pro,
.mmx-win,
.mmx-topbar {
	--i-calc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2.5' width='16' height='19' rx='3'/%3E%3Cpath d='M8 7h8M8 12h.01M12 12h.01M16 12h.01M8 16h.01M12 16h.01M16 16h.01'/%3E%3C/svg%3E");
	--i-sigma: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 5V4H6l6 8-6 8h12v-1'/%3E%3C/svg%3E");
	--i-kbd: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='3'/%3E%3Cpath d='M6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M9 15.5h6'/%3E%3C/svg%3E");
	--i-target: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='black'/%3E%3C/svg%3E");
	--i-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M4 5.5A2.5 2.5 0 0 1 6.5 3H20v15H6.5A2.5 2.5 0 0 0 4 20.5z'/%3E%3Cpath d='M4 20.5A2.5 2.5 0 0 0 6.5 23H20v-5'/%3E%3C/svg%3E");
	--i-bulb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21.5h4'/%3E%3Cpath d='M12 2.5a6.5 6.5 0 0 0-4 11.6c.7.6 1 1.3 1 2.1V16h6v-.8c0-.8.3-1.5 1-2.1a6.5 6.5 0 0 0-4-11.6z'/%3E%3C/svg%3E");
	--i-key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='4.5'/%3E%3Cpath d='M10.7 12.3 21 2M17 6l3 3M14.5 8.5l2 2'/%3E%3C/svg%3E");
	--i-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 17v5'/%3E%3Cpath d='M9 3h6l-1 6 3.5 3.5V15h-11v-2.5L10 9z'/%3E%3C/svg%3E");
	--i-pencil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z'/%3E%3Cpath d='M14.5 5.5l3 3'/%3E%3C/svg%3E");
	--i-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.6a3.5 3.5 0 0 1 0 6.8M18 14.2a6.5 6.5 0 0 1 3.5 5.8'/%3E%3C/svg%3E");
	--i-dumbbell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7v10M17 7v10M4 9.5v5M20 9.5v5M7 12h10'/%3E%3C/svg%3E");
	--i-trophy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4h10v5a5 5 0 0 1-10 0z'/%3E%3Cpath d='M7 6H4a3 3 0 0 0 3 4M17 6h3a3 3 0 0 1-3 4M12 14v4M8 21h8M9.5 18h5'/%3E%3C/svg%3E");
	--i-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
	--i-flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 22V3M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E");
	--i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2l2.2 6.3L20.5 10l-6.3 2.2L12 18.5l-2.2-6.3L3.5 10l6.3-1.7z'/%3E%3Cpath d='M19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z'/%3E%3C/svg%3E");
	--i-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M9 6h12M9 12h12M9 18h12'/%3E%3Ccircle cx='4' cy='6' r='1.2' fill='black'/%3E%3Ccircle cx='4' cy='12' r='1.2' fill='black'/%3E%3Ccircle cx='4' cy='18' r='1.2' fill='black'/%3E%3C/svg%3E");
}
/* colours for the tool windows (the Grade 10 violet theme) */
.mmx-win {
	--x-accent: #4f46e5; --x-accent-dark: #3730a3; --x-accent-2: #6d28d9; --x-tint: #eef2ff; --x-tint-2: #e0e7ff;
}
.mmx-win--calc { width: min(380px, calc(100vw - 24px)); }
.mmx-calc__tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.mmx-calc__tabs button { flex: 1; border: 0; border-radius: 10px; padding: 8px 6px; font: 800 13px/1.2 Nunito, system-ui, sans-serif; background: var(--x-tint); color: var(--x-accent-dark); cursor: pointer; }
.mmx-calc__tabs button.is-on { background: var(--x-accent); color: #fff; }
.mmx-calc__pane[hidden] { display: none; }
.mmx-calc__slot { margin: 8px 0; }
.mmx-calc__mf, math-field.mmx-calc__mf { display: block; width: 100%; min-height: 54px; font-size: 24px; padding: 6px 10px; border: 2px solid var(--x-tint-2); border-radius: 12px; background: #fff; color: #111; }
.mmx-calc__mf:focus-within { border-color: var(--x-accent); outline: none; }
.mmx-calc__out { font: 800 24px/1.3 Nunito, system-ui, sans-serif; text-align: right; min-height: 34px; color: #fff; word-break: break-all; }
.mmx-calc__out.is-err { color: #fca5a5; }
.mmx-quad__out .is-err { color: #dc2626; }
.mmx-calc__row { display: flex; gap: 8px; margin-top: 8px; }
.mmx-calc__hint { font: 600 13px/1.4 Nunito, system-ui, sans-serif; color: #475569; margin: 8px 0 0; }
.mmx-quad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.mmx-quad label { display: flex; align-items: center; gap: 6px; font: 800 18px/1 Nunito, system-ui, sans-serif; color: var(--x-accent-dark); font-style: italic; }
.mmx-quad input { width: 100%; min-width: 0; font: 700 18px/1 Nunito, system-ui, sans-serif; padding: 9px 8px; border: 2px solid var(--x-tint-2); border-radius: 10px; color: #111; background: #fff; }
.mmx-quad input:focus { outline: none; border-color: var(--x-accent); }
.mmx-quad__out { margin-top: 10px; }
.mmx-quad__out p { margin: 6px 0; font: 700 17px/1.4 Nunito, system-ui, sans-serif; color: #111; }

/* buttons in the lesson's sticky bar */
.mm-tools-btns { display: flex; gap: 6px; flex: none; }
.mm-tool-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 6px 12px; font: 800 13px/1 Nunito, system-ui, sans-serif; background: #fff; color: #3730a3; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); cursor: pointer; }
.mm-tool-btn:hover { transform: translateY(-1px); }
.mm-tools-btns.is-float { position: fixed; top: 10px; right: 10px; z-index: 9000; }
@media (max-width: 560px) { .mm-tool-btn .lbl { display: none; } .mm-tool-btn { padding: 8px 10px; font-size: 16px; } }

/* questions panel and results (the same ones the Grade 10 lessons had) */
.mmx-qp__stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.mmx-qp__stats div { padding: 10px; border-radius: 14px; background: var(--x-tint); text-align: center; }
.mmx-qp__stats div + div { background: #fff7ed; }
.mmx-qp__stats b { display: block; font-size: 1.6em; line-height: 1.1; color: var(--x-accent-dark); }
.mmx-qp__stats div + div b { color: #c2410c; }
.mmx-qp__stats span { font-size: .85em; font-weight: 700; color: #55607a; }
.mmx-qp__legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; font-size: .8em; font-weight: 700; color: #55607a; }
.mmx-qp__legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 5px; border-radius: 4px; vertical-align: -1px; }
.mmx-qp__legend [data-status="right"]::before { background: #16a34a; }
.mmx-qp__legend [data-status="retry"]::before { background: #f59e0b; }
.mmx-qp__legend [data-status="shown"]::before { background: #94a3b8; }
.mmx-qp__legend [data-status="none"]::before { border: 2px dashed #94a3b8; }
.mmx-qp__group { margin-bottom: 10px; }
.mmx-qp__gt { margin: 0 0 6px; font-size: .82em; font-weight: 900; color: var(--x-accent-dark); text-transform: none; }
.mmx-qp__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.mmx-qp__btn {
	height: 40px;
	border: 2px dashed #b6bdd3;
	border-radius: 10px;
	background: #fff;
	color: #13183a;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}
.mmx-qp__btn:hover { border-color: var(--x-accent); }
.mmx-qp__btn[data-status="right"] { border: 2px solid #15803d; background: #16a34a; color: #fff; }
.mmx-qp__btn[data-status="retry"] { border: 2px solid #d97706; background: #fef3c7; color: #92400e; }
.mmx-qp__btn[data-status="shown"] { border: 2px solid #94a3b8; background: #e2e8f0; color: #334155; }
.mmx-qp__foot { position: sticky; bottom: -14px; margin: 8px -14px -14px; padding: 12px 14px; background: #fff; border-top: 1px solid #e6e8f2; }

/* Results */
.mmx-done { text-align: center; }
.mmx-done__ring {
	--p: 0;
	width: 132px;
	height: 132px;
	margin: 4px auto 12px;
	display: grid;
	place-content: center;
	border-radius: 50%;
	background: radial-gradient(closest-side, #fff 76%, transparent 77%), conic-gradient(#16a34a calc(var(--p) * 1%), #e5e7eb 0);
}
.mmx-done__ring b { font-size: 1.9em; line-height: 1; color: #15803d; }
.mmx-done__ring span { font-size: .8em; font-weight: 800; color: #55607a; }
.mmx-done__list { margin: 0 0 12px; padding: 0; list-style: none; text-align: left; }
.mmx-done__list li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid #f1f2f8; font-weight: 700; }
.mmx-done__list b { min-width: 34px; padding: 2px 8px; border-radius: 8px; text-align: center; background: var(--x-tint); }
.mmx-done__list [data-status="right"] b { background: #dcfce7; color: #15803d; }
.mmx-done__list [data-status="retry"] b { background: #fef3c7; color: #92400e; }
.mmx-done__list [data-status="shown"] b { background: #e2e8f0; color: #334155; }
.mmx-done__list [data-status="none"] b { background: #fff; border: 2px dashed #b6bdd3; }
.mmx-done__msg { font-weight: 800; }
.mmx-done__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mmx-qp__stats div:first-child { background: #dcfce7; }
.mmx-qp__stats div:first-child b { color: #15803d; }
.mmx-qp__stats div:nth-child(2) { background: #fee2e2; }
.mmx-qp__stats div:nth-child(2) b { color: #b91c1c; }
.mmx-qp__stats div:nth-child(3) { background: #fff7ed; }
.mmx-qp__stats div:nth-child(3) b { color: #c2410c; }
.mmx-qp__btn[data-status="wrong"] { border: 2px solid #dc2626; background: #fee2e2; color: #991b1b; }
.mmx-qp__legend [data-status="wrong"]::before { background: #ef4444; }
.mmx-done__list [data-status="wrong"] b { background: #fee2e2; color: #991b1b; }
.mk-q.mmx-flash { animation: mmx-flash 1.4s ease-out; border-radius: 18px; }
@keyframes mmx-flash { 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .75); } 100% { box-shadow: 0 0 0 22px rgba(79, 70, 229, 0); } }
.mm-tool-btn .cnt { margin-left: 2px; padding: 2px 7px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: .9em; }
.mmx-calc__fns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.mmx-calc__key.is-fn { background: #eef2ff; color: #3730a3; box-shadow: inset 0 0 0 1px #c7d2fe, 0 2px 0 #c7d2fe; font-size: .95em; }
@media (max-width: 560px) {
	.mm-tools-btns { gap: 4px; }
	.mm-tool-btn { padding: 7px 8px; }
	.mm-tool-btn .cnt { display: none; }
}
