:root {
	--ink: #102744;
	--blue: #0c54b1;
	--cyan: #04b5bd;
	--muted: #63758c;
	--line: #d9e3ef;
	--paper: #f5f8fc;
	--amber: #9b6522;
	--green: #24765a;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	color: var(--ink);
	background: var(--paper);
	font:
		14px / 1.8 -apple-system,
		BlinkMacSystemFont,
		"Hiragino Kaku Gothic ProN",
		"Noto Sans JP",
		sans-serif;
}
button,
input,
select,
textarea {
	font: inherit;
}
button,
a,
input,
select,
textarea {
	outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 3px solid var(--cyan);
}
a {
	color: var(--blue);
}
button {
	cursor: pointer;
}
button:disabled {
	cursor: wait;
	opacity: 0.6;
}
header {
	background: #fff;
	border-bottom: 1px solid var(--line);
	padding: 18px max(24px, calc((100vw - 1160px) / 2));
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
}
.brand {
	display: flex;
	align-items: center;
	gap: 13px;
	text-decoration: none;
	line-height: 1.3;
	color: var(--ink);
	font-size: 21px;
	font-weight: 800;
}
.brand img {
	width: 43px;
	height: 43px;
}
.brand em {
	color: var(--blue);
	font-style: normal;
}
.brand small {
	font-size: 10px;
	font-weight: 400;
	display: block;
	margin-top: 8px;
	letter-spacing: 0.8px;
}
header nav {
	display: flex;
	align-items: center;
	gap: 22px;
	font-size: 12px;
	white-space: nowrap;
}
header nav a {
	text-decoration: none;
}
main {
	max-width: 1210px;
	padding: 38px 25px 60px;
	margin: auto;
	min-height: 70vh;
}
footer {
	max-width: 1160px;
	border-top: 1px solid var(--line);
	margin: auto;
	padding: 24px 0;
	display: flex;
	justify-content: space-between;
	gap: 20px;
	font-size: 11px;
	color: var(--muted);
}
h1 {
	font-size: 36px;
	line-height: 1.55;
	letter-spacing: -0.5px;
	margin: 12px 0 20px;
}
h2 {
	font-size: 21px;
	line-height: 1.8;
	margin: 0 0 18px;
}
h3 {
	font-size: 16px;
	margin: 0 0 12px;
}
p {
	margin: 0 0 15px;
}
.muted {
	color: var(--muted);
}
.eyebrow {
	font-size: 10px;
	letter-spacing: 2px;
	color: var(--blue);
	font-weight: 800;
}
.lead {
	font-size: 16px;
	line-height: 2;
}
.card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 17px;
	padding: 26px;
}
.hero {
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	gap: 40px;
	align-items: start;
	margin: 25px 0 38px;
}
.hero .card {
	border-top: 4px solid var(--cyan);
}
.facts {
	display: flex;
	gap: 36px;
	margin: 26px 0;
}
.facts strong {
	font-size: 31px;
	line-height: 1.3;
}
.facts span {
	display: block;
	color: var(--muted);
	font-size: 11px;
	margin-top: 7px;
}
.primary,
.secondary {
	border-radius: 9px;
	padding: 11px 18px;
	min-height: 45px;
	font-weight: 700;
	font-size: 13px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
}
.primary {
	background: var(--blue);
	color: #fff;
	border: 1px solid var(--blue);
	box-shadow: 0 3px 0 #08367e;
}
.primary:hover:not(:disabled) {
	background: #094697;
}
.secondary {
	background: #fff;
	border: 1px solid var(--line);
	color: var(--ink);
}
.text-button {
	background: none;
	border: 0;
	color: var(--muted);
	padding: 7px 0;
	min-height: 36px;
	font-size: 12px;
}
.actions {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 18px;
}
.pill {
	display: inline-block;
	border-radius: 20px;
	padding: 3px 11px;
	background: #eaf3fc;
	color: var(--blue);
	font-size: 11px;
	font-weight: 700;
}
.pill.trial {
	background: #fff3db;
	color: var(--amber);
}
label.field {
	display: grid;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	margin: 15px 0;
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
	width: 100%;
	border: 1px solid #c7d5e5;
	border-radius: 8px;
	padding: 10px 12px;
	min-width: 0;
	background: #fff;
	color: var(--ink);
}
input[readonly] {
	background: #f7f9fc;
}
textarea {
	resize: vertical;
	min-height: 80px;
}
.check {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.9;
}
.check input {
	margin-top: 6px;
	flex: none;
	accent-color: var(--blue);
}
.notice {
	background: #fff3dd;
	color: var(--amber);
	padding: 13px 16px;
	border-radius: 9px;
	margin: 14px 0;
	font-size: 12px;
}
.notice.error {
	background: #fbecec;
	color: #a93730;
}
.notice.success {
	background: #e9f6ee;
	color: var(--green);
}
[hidden] {
	display: none !important;
}
.sr {
	position: absolute;
	clip: rect(0, 0, 0, 0);
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.grid-5 {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 13px;
}
.theme-card {
	border: 1px solid var(--line);
	background: #fff;
	padding: 17px;
	border-radius: 12px;
	font-size: 12px;
}
.theme-card strong {
	display: block;
	color: var(--blue);
	font-size: 21px;
	margin-bottom: 4px;
}
.history {
	margin-top: 32px;
}
.history-row {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	padding: 13px 0;
	border-bottom: 1px solid var(--line);
	font-size: 13px;
}
.page-title {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	margin-bottom: 24px;
}
.page-title h1 {
	font-size: 26px;
	margin: 0;
}
.progress-row {
	display: flex;
	align-items: center;
	gap: 22px;
	margin: 18px 0 23px;
	font-size: 12px;
	color: var(--muted);
}
.progress-track {
	height: 7px;
	background: #dfe8f3;
	border-radius: 8px;
	flex: 1;
	overflow: hidden;
}
.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--blue), var(--cyan));
	transition: width 0.2s;
}
.exam-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 258px;
	gap: 24px;
	align-items: start;
}
.exam-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	font-size: 11px;
	color: var(--muted);
}
.timer {
	display: flex;
	align-items: baseline;
	gap: 5px;
	border-radius: 8px;
	background: #edf4fc;
	color: var(--blue);
	padding: 3px 12px;
	white-space: nowrap;
}
.timer strong {
	font-size: 25px;
	font-variant-numeric: tabular-nums;
}
.timer.urgent {
	background: #fff1d9;
	color: var(--amber);
}
.question-title {
	font-size: 21px;
	margin: 22px 0 16px;
	line-height: 1.9;
	overflow-wrap: anywhere;
}
.scenario {
	background: #f3f8fc;
	border-left: 3px solid var(--cyan);
	padding: 15px 18px;
	border-radius: 0 8px 8px 0;
	white-space: pre-line;
	font-size: 14px;
	line-height: 1.95;
}
.hint {
	font-size: 12px;
	color: var(--blue);
	font-weight: 700;
}
.choices {
	display: grid;
	gap: 10px;
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.choice {
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	min-height: 63px;
	padding: 13px 16px;
	cursor: pointer;
	font-size: 14px;
	position: relative;
}
.choice:hover {
	border-color: #86aed7;
	background: #f7faff;
}
.choice.selected {
	border-color: var(--blue);
	box-shadow: inset 0 0 0 1px var(--blue);
	background: #eff6ff;
}
.choice.locked {
	cursor: default;
}
.choice:focus-within {
	outline: 3px solid var(--cyan);
	outline-offset: 2px;
}
.choice input {
	position: absolute;
	width: 20px;
	height: 20px;
	opacity: 0;
}
.letter {
	width: 30px;
	height: 30px;
	border-radius: 7px;
	background: #edf2f8;
	color: var(--muted);
	display: grid;
	place-items: center;
	font-weight: 800;
	font-size: 12px;
	flex: none;
}
.selected .letter {
	background: var(--blue);
	color: #fff;
}
.choice-text {
	flex: 1;
}
.exam-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 18px 0;
}
.save-status {
	font-size: 11px;
	color: var(--muted);
	margin-top: 14px;
	min-height: 20px;
}
.map {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 7px;
}
.map button {
	border: 1px solid var(--line);
	border-radius: 7px;
	background: #fff;
	color: var(--muted);
	min-height: 33px;
	padding: 0;
	font-size: 11px;
	position: relative;
}
.map button.answered {
	background: #eaf2fb;
	color: var(--blue);
	border-color: #c4d9ee;
}
.map button.current {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}
.map button.expired:not(.answered) {
	background: #fff2dd;
	color: var(--amber);
}
.map-legend {
	font-size: 10px;
	line-height: 2;
	color: var(--muted);
	margin-top: 12px;
}
.result-card {
	background: var(--ink);
	color: #fff;
	padding: 34px;
	border-radius: 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	margin-bottom: 24px;
}
.result-card h1 {
	font-size: 31px;
	margin: 8px 0 13px;
}
.result-card p {
	color: #c8d7e7;
}
.result-number {
	font-size: 63px;
	line-height: 1.4;
	white-space: nowrap;
	font-weight: 800;
}
.result-number span {
	font-size: 20px;
	color: #a5bfdb;
}
.result-theme {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 13px;
	padding: 19px;
}
.result-theme strong {
	font-size: 22px;
	display: block;
	color: var(--blue);
}
.certificate {
	max-width: 860px;
	border: 8px double #9bb8d6;
	background: #fff;
	padding: 52px;
	text-align: center;
	margin: 24px auto;
}
.certificate .cert-name {
	font-size: 29px;
	font-weight: 700;
	margin: 28px 0;
}
.certificate h1 {
	font-size: 29px;
}
.certificate .cert-meta {
	font-size: 12px;
	color: var(--muted);
	line-height: 2.3;
	overflow-wrap: anywhere;
}
.certificate img {
	width: 53px;
}
.tabs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 22px;
}
.tabs button {
	padding: 10px 17px;
	border-radius: 9px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--muted);
	font-size: 12px;
}
.tabs button.active {
	background: var(--blue);
	color: #fff;
	border-color: var(--blue);
}
.admin-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
	gap: 24px;
	align-items: start;
}
.list-tools {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
	align-items: center;
}
.question-list {
	max-height: 750px;
	overflow: auto;
}
.question-list button {
	display: block;
	text-align: left;
	width: 100%;
	padding: 13px 8px;
	border: 0;
	border-bottom: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
	font-size: 12px;
	line-height: 1.8;
}
.question-list button.active {
	background: #eef5fe;
}
.question-list button:hover {
	background: #f5f9ff;
}
.question-list small {
	color: var(--muted);
	display: block;
	font-size: 10px;
}
.editor-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.correct-option {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}
.correct-option input[type="checkbox"],
.correct-option input[type="radio"] {
	accent-color: var(--blue);
	width: 17px;
	height: 17px;
	flex: none;
}
.correct-option input[type="text"] {
	flex: 1;
}
.table-wrap {
	overflow: auto;
}
table {
	border-collapse: collapse;
	width: 100%;
	font-size: 12px;
	white-space: nowrap;
}
th,
td {
	padding: 12px 13px;
	border-bottom: 1px solid var(--line);
	text-align: left;
}
th {
	color: var(--muted);
	font-size: 11px;
}
.code-box {
	background: #edf5fd;
	padding: 20px;
	border-radius: 12px;
	margin-top: 20px;
}
.code-box input {
	font-size: 12px;
}
.code-entry {
	border-top: 1px solid var(--line);
	margin-top: 22px;
	padding-top: 16px;
	font-size: 12px;
}
.code-entry summary {
	cursor: pointer;
	color: var(--muted);
}
.narrow {
	max-width: 540px;
	margin: 35px auto;
}
.loading {
	color: var(--muted);
	padding: 40px;
	text-align: center;
}
@media (max-width: 900px) {
	header {
		padding: 17px 24px;
	}
	.brand {
		font-size: 18px;
	}
	.hero {
		gap: 24px;
	}
	.exam-layout {
		grid-template-columns: minmax(0, 1fr) 218px;
	}
	.admin-layout {
		grid-template-columns: 1fr;
	}
	.grid-5 {
		grid-template-columns: repeat(3, 1fr);
	}
	footer {
		margin: 0 25px;
	}
}
@media (max-width: 650px) {
	header {
		padding: 15px 20px;
		align-items: flex-start;
		gap: 14px;
		flex-wrap: wrap;
	}
	.brand {
		font-size: 19px;
	}
	.brand img {
		width: 36px;
		height: 36px;
	}
	header nav {
		gap: 19px;
		font-size: 11px;
	}
	main {
		padding: 25px 20px 40px;
	}
	.hero {
		grid-template-columns: 1fr;
		margin: 0 0 27px;
	}
	h1 {
		font-size: 30px;
	}
	.facts {
		gap: 27px;
	}
	.facts strong {
		font-size: 28px;
	}
	.card {
		padding: 20px;
	}
	.exam-layout {
		grid-template-columns: 1fr;
	}
	.exam-meta {
		align-items: flex-start;
		flex-wrap: wrap;
	}
	.question-title {
		font-size: 19px;
	}
	.choice {
		padding: 12px;
		align-items: flex-start;
		font-size: 13px;
	}
	.letter {
		width: 27px;
		height: 27px;
	}
	.map button {
		min-height: 44px;
	}
	.grid-5 {
		grid-template-columns: repeat(2, 1fr);
	}
	.result-card {
		padding: 24px;
		flex-wrap: wrap;
	}
	.result-card h1 {
		font-size: 27px;
	}
	.result-number {
		font-size: 53px;
	}
	.certificate {
		padding: 25px 18px;
		border-width: 5px;
	}
	.certificate h1 {
		font-size: 23px;
	}
	.certificate .cert-name {
		font-size: 25px;
	}
	.page-title {
		align-items: flex-start;
	}
	.page-title h1 {
		font-size: 23px;
	}
	.editor-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}
	footer {
		flex-direction: column;
		gap: 12px;
		padding: 20px 0;
		margin: 0 20px;
	}
	.lead {
		font-size: 14px;
	}
	.progress-row {
		gap: 13px;
	}
	.page-title .text-button {
		font-size: 11px;
		white-space: nowrap;
	}
}
@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
@media print {
	header,
	footer,
	.no-print,
	#announcement {
		display: none !important;
	}
	body {
		background: #fff;
	}
	main {
		padding: 0;
		min-height: 0;
	}
	.certificate {
		margin: 15mm 0;
		max-width: none;
		break-inside: avoid;
	}
	.certificate .cert-meta {
		font-size: 11px;
	}
	@page {
		size: A4 portrait;
		margin: 12mm;
	}
}
.map a {
	border: 1px solid var(--line);
	border-radius: 7px;
	background: #fff;
	color: var(--muted);
	min-height: 33px;
	padding: 0;
	font-size: 11px;
	position: relative;
	text-decoration: none;
}
.map a.answered {
	background: #eaf2fb;
	color: var(--blue);
	border-color: #c4d9ee;
}
.map a.current {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}
.map a.expired:not(.answered) {
	background: #fff2dd;
	color: var(--amber);
}
@media (max-width: 650px) {
	.map a {
		min-height: 44px;
	}
}

.question-visual,.question-review {margin-top:24px;padding-top:16px;border-top:1px solid #ddd;}
.question-visual [contenteditable] {white-space:pre-wrap; border:1px solid #ddd;min-height:40px;padding:12px;margin:8px 0 16px;font-size:16px;}
#question-review pre {white-space:pre-wrap;overflow-wrap:anywhere;}
#question-comments article {margin:16px 0;padding:12px;background:#f5f7fa;}

.admin-layout > *, #question-editor, #question-review, .question-visual {min-width:0; max-width:100%;}
.question-visual [contenteditable], #question-editor p, #question-editor small {overflow-wrap:anywhere;}
#question-editor textarea, #question-editor input, #question-editor select {max-width:100%;min-width:0;}
#question-check, #question-history pre {white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;max-width:100%;}
@media(max-width:700px) {.page-title {flex-wrap:wrap;}.page-title > * {max-width:100%;}.correct-option {min-width:0;}.tabs {flex-wrap:wrap;}}
