:root {
	color-scheme: light dark;
	--fg: #1a1a1a;
	--bg: #ffffff;
	--muted: #6b7280;
	--accent: #2563eb;
	--border: #e5e7eb;
	--surface: #f9fafb;
	--ok: #15803d;
	--error: #b91c1c;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--fg);
	background: var(--bg);
	line-height: 1.5;
}

.container {
	max-width: 960px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.site-header {
	padding: 2rem 0 1rem;
}

.site-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

/* Auth controls in the header */
.auth {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.auth-status {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
}

.auth-status[hidden] {
	display: none;
}

.auth-eid {
	font-weight: 600;
	color: var(--fg);
}

.auth-btn {
	appearance: none;
	border: 1px solid var(--accent);
	background: var(--bg);
	color: var(--accent);
	font: inherit;
	font-weight: 600;
	padding: 0.4rem 0.9rem;
	border-radius: 8px;
	cursor: pointer;
}

.auth-btn:hover {
	background: var(--accent);
	color: #fff;
}

.auth-btn--primary {
	background: var(--accent);
	color: #fff;
}

.auth-logout {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
}

.auth-logout:hover {
	color: var(--fg);
	text-decoration: underline;
}

/* Login modal */
.login-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.login-modal[hidden] {
	display: none;
}

.login-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.login-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(420px, 92vw);
	background: var(--bg);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.login-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.9rem 1.25rem;
	border-bottom: 1px solid var(--border);
}

.login-modal__title {
	font-weight: 700;
}

.login-modal__close {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--muted);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.login-modal__close:hover {
	color: var(--fg);
}

.login-form {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	padding: 1.25rem;
}

.login-form__hint {
	margin: 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.login-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-weight: 600;
	font-size: 0.9rem;
}

.login-field input {
	font: inherit;
	font-weight: 400;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--bg);
	color: var(--fg);
}

.login-form__error {
	margin: 0;
	color: var(--error);
	font-size: 0.9rem;
}

.login-form__error[hidden] {
	display: none;
}

.login-form__actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 0.25rem;
}

body.login-modal-open {
	overflow: hidden;
}

h1 {
	color: var(--accent);
	margin-bottom: 0.25rem;
}

.site-header p {
	color: var(--muted);
	margin-top: 0;
}

/* Tabs */
.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	border-bottom: 2px solid var(--border);
	margin-bottom: 1.5rem;
}

.tab {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-weight: 600;
	padding: 0.6rem 0.9rem;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
}

.tab:hover {
	color: var(--fg);
}

.tab[aria-selected="true"] {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

/* Content */
.content {
	padding-bottom: 4rem;
}

.placeholder {
	color: var(--muted);
	padding: 3rem 0;
}

.placeholder.error {
	color: var(--error);
}

/* Front matter (static course intro; not an assignment form) */
.front-matter .assignment-header {
	margin-bottom: 1rem;
}

/* Assignment */
.assignment-header h2 {
	margin-bottom: 0.25rem;
}

.assignment-meta {
	color: var(--muted);
	margin-top: 0;
}

.question-block {
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 1.25rem 1.5rem;
	margin-bottom: 1.25rem;
	background: var(--surface);
}

.section-block {
	background: transparent;
	border: none;
	border-left: 3px solid var(--accent);
	border-radius: 0;
	padding-left: 1rem;
}

.question-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin-bottom: 0.5rem;
}

.question-title {
	font-weight: 700;
}

.question-points {
	color: var(--muted);
	font-size: 0.9rem;
	white-space: nowrap;
}

.badge-bonus {
	display: inline-block;
	margin-left: 0.35rem;
	padding: 0.05rem 0.4rem;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	vertical-align: middle;
}

.prompt {
	margin-bottom: 1rem;
}

.prompt img {
	max-width: 100%;
	height: auto;
}

.prompt pre {
	overflow: auto;
	background: rgba(0, 0, 0, 0.04);
	padding: 0.75rem;
	border-radius: 6px;
}

/* Answers */
.answer textarea,
.answer input[type="number"],
.answer input[type="text"] {
	width: 100%;
	font: inherit;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--bg);
	color: var(--fg);
}

.answer textarea {
	resize: vertical;
}

.choices {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.choice {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
}

.answer.unsupported {
	color: var(--error);
	font-style: italic;
}

/* Ranking drag-and-drop (Assignment 04 Q3) */
.ranking-answer {
	margin-bottom: 0.75rem;
}

.ranking-hint {
	margin: 0 0 0.75rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.ranking-row {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	gap: 1rem;
}

.ranking-item {
	box-sizing: border-box;
	flex: 0 0 4.5rem;
	width: 4.5rem;
	height: 4.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-weight: 700;
	font-size: 1.35rem;
	letter-spacing: 0.02em;
	border: 2px solid #c5cad3;
	border-radius: 12px;
	background: var(--surface);
	color: var(--fg);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
	cursor: grab;
	user-select: none;
	touch-action: none;
	transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.ranking-item:hover {
	border-color: var(--accent);
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}

.ranking-item:active {
	cursor: grabbing;
	transform: scale(1.03);
}

.ranking-item--dragging {
	opacity: 0.4;
	transform: scale(0.96);
	box-shadow: none;
}

.ranking-item--over {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Inline fill-in-the-blank inputs live inside the prompt */
.prompt input[type="text"] {
	font: inherit;
	padding: 0.15rem 0.4rem;
	border: 1px solid var(--border);
	border-radius: 4px;
	background: var(--bg);
	color: var(--fg);
}

/* Submit */
.form-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
}

.submit-btn {
	appearance: none;
	border: none;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	padding: 0.6rem 1.4rem;
	border-radius: 8px;
	cursor: pointer;
}

.submit-btn:hover {
	filter: brightness(1.05);
}

.submit-status {
	margin: 0;
	color: var(--muted);
}

.submit-status.ok {
	color: var(--ok);
}

.submit-status.error {
	color: var(--error);
}

/* ---------------------------------------------------------------------------
 * Turtle editor: answer trigger, modal, and inline preview.
 * Everything here is scoped under .turtle-* class names so it only styles the
 * modal/editor instances and never leaks onto the rest of the page.
 * ------------------------------------------------------------------------- */

.turtle-answer {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: flex-start;
}

.turtle-open {
	appearance: none;
	border: 1px solid var(--accent);
	background: var(--bg);
	color: var(--accent);
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 1rem;
	border-radius: 8px;
	cursor: pointer;
}

.turtle-open:hover {
	background: var(--accent);
	color: #fff;
}

.turtle-preview {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg);
}

.turtle-preview__img {
	max-width: 320px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #fff;
}

.turtle-preview__code {
	margin: 0;
	overflow: auto;
	max-height: 220px;
	background: rgba(0, 0, 0, 0.04);
	padding: 0.6rem 0.75rem;
	border-radius: 6px;
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 0.85rem;
	white-space: pre;
}

.turtle-preview__note {
	margin: 0;
	color: var(--muted);
	font-size: 0.85rem;
}

/* Modal overlay */
.turtle-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.turtle-modal[hidden] {
	display: none;
}

.turtle-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.turtle-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(960px, 94vw);
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--fg);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.turtle-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.9rem 1.25rem;
	border-bottom: 1px solid var(--border);
}

.turtle-modal__title {
	font-weight: 700;
}

.turtle-modal__close {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--muted);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.turtle-modal__close:hover {
	color: var(--fg);
}

.turtle-modal__body {
	padding: 1.25rem;
	overflow: auto;
}

.turtle-modal__footer {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.85rem 1.25rem;
	border-top: 1px solid var(--border);
}

.turtle-modal__spacer {
	flex: 1;
}

.turtle-btn {
	appearance: none;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--fg);
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 0.9rem;
	border-radius: 8px;
	cursor: pointer;
}

.turtle-btn:hover {
	filter: brightness(0.97);
}

.turtle-btn--run {
	background: var(--ok);
	border-color: var(--ok);
	color: #fff;
}

.turtle-btn--stop {
	background: var(--error);
	border-color: var(--error);
	color: #fff;
}

.turtle-btn--save {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

/* Editor + canvas layout inside the modal */
.turtle-editor__panes {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.turtle-editor__editor,
.turtle-editor__canvas {
	flex: 1 1 360px;
	min-width: 300px;
}

.turtle-editor__label {
	margin: 0 0 0.35rem;
	font-weight: 600;
	color: var(--muted);
}

.turtle-editor .CodeMirror {
	height: 400px;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.9rem;
}

/* PythonSandbox.setupMirror() clones the source textarea with Bootstrap's
   ".hidden" class; we don't load Bootstrap, so hide that mirror clone here
   (scoped to the editor so it affects nothing else). */
.turtle-editor .hidden {
	display: none;
}

.turtle-canvas {
	width: 400px;
	max-width: 100%;
	height: 400px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
}

.turtle-output {
	margin: 0.5rem 0 0;
	max-height: 120px;
	overflow: auto;
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 0.8rem;
	color: var(--fg);
	white-space: pre-wrap;
}

.turtle-output:empty {
	display: none;
}

.turtle-output--error {
	color: var(--error);
}

body.turtle-modal-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------------------
 * LiDAR simulator modals (Assignment 03 Q6-Q8). Same overlay pattern as turtle;
 * host layout lives in /assignment3_lidar/css/lidar.css.
 * ------------------------------------------------------------------------- */

.lidar-open,
.pf-open,
.tm-open,
.response-open {
	appearance: none;
	border: 1px solid var(--accent);
	background: var(--bg);
	color: var(--accent);
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 1rem;
	border-radius: 8px;
	cursor: pointer;
}

.lidar-open:hover,
.pf-open:hover,
.tm-open:hover,
.response-open:hover {
	background: var(--accent);
	color: #fff;
}

.lidar-answer,
.pf-answer,
.tm-answer,
.response-modal-answer {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: flex-start;
}

.lidar-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lidar-modal[hidden] {
	display: none;
}

.lidar-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.lidar-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100vw;
	height: 100vh;
	max-width: 100vw;
	max-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--fg);
	border: none;
	border-radius: 0;
	box-shadow: none;
	overflow: hidden;
}

.lidar-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.9rem 1.25rem;
	border-bottom: 1px solid var(--border);
}

.lidar-modal__title {
	font-weight: 700;
}

.lidar-modal__close {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--muted);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.lidar-modal__close:hover {
	color: var(--fg);
}

.lidar-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 1.25rem;
	overflow: auto;
	display: flex;
	flex-direction: column;
}

.lidar-modal__footer {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.85rem 1.25rem;
	border-top: 1px solid var(--border);
}

.lidar-modal__spacer {
	flex: 1;
}

.lidar-btn {
	appearance: none;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--fg);
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 0.9rem;
	border-radius: 8px;
	cursor: pointer;
}

.lidar-btn:hover {
	filter: brightness(0.97);
}

.lidar-btn--save {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

body.lidar-modal-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------------------
 * GridWorld widget (Assignment 02 Q3-Q6 + standalone editor).
 * Colors follow the assignment convention: yellow start, red-star goal, gray
 * walls; soft blue "visited" shading and a red-blob-style thin gridline look.
 * ------------------------------------------------------------------------- */

.gridworld {
	--gw-cell: 34px;
	--gw-line: #cbd5e1;
	--gw-wall: #6b7280;
	--gw-start: #fde047;
	--gw-goal-bg: #fee2e2;
	--gw-goal: #dc2626;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.6rem;
	margin: 0.75rem 0 1rem;
}

.gw-grid {
	display: grid;
	grid-template-columns: repeat(10, var(--gw-cell));
	grid-template-rows: repeat(10, var(--gw-cell));
	width: max-content;
	align-self: center;
	border: 2px solid var(--gw-line);
	background: var(--gw-line);
	gap: 1px;
	touch-action: none;
	user-select: none;
}

.gw-grid:focus {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

.gw-cell {
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: calc(var(--gw-cell) * 0.62);
	line-height: 1;
}

.gw-cell.gw-path {
	color: #000000;
	font-weight: 700;
}

/* Navigation trail: arrow only, no background fill. */
.gw-cell.gw-trail {
	color: #000000;
	font-weight: 700;
}

.gw-cell.gw-wall {
	background: var(--gw-wall);
}

.gw-cell.gw-start {
	background: var(--gw-start);
}

.gw-cell.gw-goal {
	background: var(--gw-goal-bg);
	color: var(--gw-goal);
}

/* Editable grids invite interaction. */
.gridworld[data-mode="build"] .gw-cell:hover,
.gridworld[data-mode="build_play"] .gw-cell:hover {
	box-shadow: inset 0 0 0 2px var(--accent);
	cursor: pointer;
}

.gw-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.gw-btn {
	appearance: none;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--fg);
	font: inherit;
	font-weight: 600;
	padding: 0.4rem 0.9rem;
	border-radius: 8px;
	cursor: pointer;
}

.gw-btn:hover {
	filter: brightness(0.97);
}

.gw-status {
	margin: 0;
	color: var(--muted);
	font-size: 0.9rem;
	min-height: 1.2em;
}

.gw-status--ok {
	color: var(--ok);
	font-weight: 600;
}

/* ------------------------------------------------------------------------- */
/* Assignment 05 — Response entry modal (Q4–Q6). Shell mirrors .lidar-modal. */
/* ------------------------------------------------------------------------- */

.response-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.response-modal[hidden] {
	display: none;
}

.response-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.response-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100vw;
	height: 100vh;
	max-width: 100vw;
	max-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--fg);
	border: none;
	border-radius: 0;
	box-shadow: none;
	overflow: hidden;
}

.response-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.9rem 1.25rem;
	border-bottom: 1px solid var(--border);
}

.response-modal__title {
	font-weight: 700;
}

.response-modal__close {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--muted);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.response-modal__close:hover {
	color: var(--fg);
}

.response-modal__params {
	padding: 0.75rem 1.25rem;
	border-bottom: 1px solid var(--border);
	font-weight: 600;
	color: var(--fg);
	background: var(--surface);
	flex: 0 0 auto;
}

.response-modal__params[hidden] {
	display: none;
}

.response-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	display: grid;
	gap: 1.25rem;
	padding: 1.25rem;
	overflow: auto;
}

.response-modal__body--decoding {
	grid-template-columns: 1fr 1fr;
}

.response-modal__body--benchmark {
	grid-template-columns: repeat(3, 1fr);
	align-items: stretch;
}

.response-modal__body--review {
	grid-template-columns: 1fr;
	grid-template-rows: auto 1fr auto;
}

.response-modal__col {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	min-width: 0;
	min-height: 0;
}

.response-modal__col--explain {
	min-height: 100%;
}

.response-modal__benchmark-col {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	min-width: 0;
	min-height: 0;
	height: 100%;
	padding: 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
}

.response-modal__benchmark-heading {
	font-weight: 700;
	flex: 0 0 auto;
}

.response-modal__textarea--benchmark {
	flex: 1 1 auto;
	min-height: 280px;
	height: 100%;
	resize: vertical;
	overflow: auto;
}

.response-modal__label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-weight: 600;
	font-size: 0.95rem;
	min-height: 0;
}

.response-modal__col--explain .response-modal__label,
.response-modal__review-explain .response-modal__label {
	flex: 1;
}

.response-modal__textarea {
	width: 100%;
	resize: vertical;
	font: inherit;
	font-weight: 400;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg);
	color: var(--fg);
	box-sizing: border-box;
}

.response-modal__textarea--explain {
	flex: 1;
	min-height: 280px;
	resize: vertical;
}

.response-modal__textarea--readonly {
	resize: none;
	overflow: auto;
	background: var(--surface);
	color: var(--fg);
	cursor: default;
}

.response-modal__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	border-bottom: 2px solid var(--border);
	flex: 0 0 auto;
}

.response-modal__tab {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-weight: 600;
	padding: 0.6rem 0.9rem;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
}

.response-modal__tab:hover {
	color: var(--fg);
}

.response-modal__tab[aria-selected="true"] {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

.response-modal__review-pane {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	min-height: 0;
	overflow: auto;
	align-items: stretch;
}

.response-modal__review-explain {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-top: 1px solid var(--border);
	padding-top: 1rem;
	flex: 0 0 auto;
}

.response-modal__body--review .response-modal__textarea--explain {
	min-height: 160px;
}

.response-modal__footer {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.85rem 1.25rem;
	border-top: 1px solid var(--border);
	flex: 0 0 auto;
}

.response-modal__spacer {
	flex: 1;
}

.response-modal__btn {
	appearance: none;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--fg);
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 0.9rem;
	border-radius: 8px;
	cursor: pointer;
}

.response-modal__btn:hover {
	filter: brightness(0.97);
}

.response-modal__btn--save {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

body.response-modal-open {
	overflow: hidden;
}

@media (max-width: 900px) {
	.response-modal__body--decoding,
	.response-modal__body--benchmark,
	.response-modal__review-pane {
		grid-template-columns: 1fr;
	}

	.response-modal__textarea--explain,
	.response-modal__textarea--benchmark {
		min-height: 160px;
	}
}
