/* TM Learning — Quiz-taking page.
   Header/logo/nav-button/panel-margin rules are inherited from
   tml-dashboard.css (same source of truth as the Lessons dashboard);
   this file only adds the quiz-specific elements. */

.tml-header {
	position: relative;
}

.tml-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.tml-quiz-timer {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 6px;
	border: 2px solid #d63638;
	color: #d63638;
	font-weight: bold;
	font-size: 15px;
	white-space: nowrap;
	background: #fff;
}

.tml-quiz-submit-btn {
	color: #b8860b;
	border-color: #b8860b;
	font-weight: bold;
}

.tml-quiz-submit-btn:hover {
	background: #fdf6e3;
}

.tml-quiz-finish-btn {
	color: #d63638;
	border-color: #d63638;
	font-weight: bold;
}

.tml-quiz-finish-btn:hover {
	background: #fdeaea;
}

.tml-quiz-main {
	gap: 12px;
}

/* Panel 1 — Quizzes palette (narrower than the Lessons sidebar) */
.tml-quiz-palette-panel {
	width: 200px;
	min-width: 200px;
}

.tml-quiz-palette {
	flex: 1 1 auto;
	overflow-y: auto;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: 34px;
	align-content: start;
	gap: 8px;
	padding: 10px;
}

.tml-palette-btn {
	height: 34px;
	background: #ececec;
	border: 1px solid var(--tml-border);
	border-radius: 4px;
	font-weight: bold;
	font-size: 14px;
	cursor: pointer;
}

.tml-palette-btn:hover {
	background: #e0e0e0;
}

.tml-palette-btn.tml-active {
	background: var(--tml-header-bg);
	color: #fff;
	border-color: var(--tml-header-bg);
}

/* Center panel — < / > sit at the outer edges of the title bar */
.tml-quiz-title-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
}

.tml-quiz-title-bar .tml-content-title {
	flex: 1 1 auto;
}

.tml-quiz-prev,
.tml-quiz-next {
	flex: 0 0 auto;
	font-size: 22px;
	font-weight: bold;
	color: var(--tml-text);
	text-decoration: none;
}

.tml-quiz-prev:hover,
.tml-quiz-next:hover {
	color: var(--tml-header-bg);
}

.tml-quiz-center .tml-content-inner {
	position: relative;
}

.tml-quiz-mark-badge {
	position: absolute;
	top: 8px;
	right: 14px;
	margin: 0;
	padding: 2px 10px;
	border: 1px solid var(--tml-border);
	border-radius: 4px;
	background: #fff;
	color: #666;
	font-size: 13px;
	font-weight: bold;
	z-index: 1;
}

.tml-quiz-question-text {
	font-size: 18px;
	font-weight: bold;
	margin: 0 0 18px 0;
}

.tml-quiz-statements {
	margin: 0 0 18px 0;
	padding-left: 22px;
	font-size: 15px;
	line-height: 1.6;
}

.tml-quiz-statements li {
	margin-bottom: 6px;
}

.tml-quiz-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tml-quiz-option {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	cursor: pointer;
}

/* Panel 3 — Notepad + Calculator (equal height split) */
.tml-quiz-side-panel {
	width: 230px;
	min-width: 230px;
	padding: 10px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tml-notepad-box {
	flex: 1 1 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.tml-notepad-box h3 {
	margin: 0 0 6px 0;
	font-size: 13px;
	font-weight: bold;
	color: #666;
}

.tml-notepad {
	width: 100%;
	flex: 1 1 auto;
	min-height: 100px;
	resize: none;
	border: 1px solid var(--tml-border);
	border-radius: 4px;
	padding: 8px;
	font-family: inherit;
	font-size: 14px;
	box-sizing: border-box;
}

.tml-calculator {
	flex: 1 1 0;
	min-height: 0;
	border: 1px solid var(--tml-border);
	border-radius: 4px;
	padding: 10px;
	display: flex;
	flex-direction: column;
}

.tml-calc-display {
	width: 100%;
	box-sizing: border-box;
	text-align: right;
	font-size: 18px;
	padding: 6px 8px;
	margin-bottom: 8px;
	border: 1px solid var(--tml-border);
	border-radius: 4px;
	flex: 0 0 auto;
}

.tml-calc-keys {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: repeat(6, 1fr);
	gap: 6px;
}

.tml-calc-key {
	background: #ececec;
	border: 1px solid var(--tml-border);
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
}

.tml-calc-key:hover {
	background: #e0e0e0;
}

.tml-calc-key-blank {
	background: transparent;
	border: none;
	cursor: default;
	pointer-events: none;
}

.tml-calc-clear {
	color: #b32d2e;
}

.tml-calc-zero {
	grid-column: span 2;
}

@media (max-width: 900px) {
	.tml-quiz-palette-panel,
	.tml-quiz-side-panel {
		display: none;
	}
}
