/* ===== Exam Result Search — front ===== */
.ers {
	--ers-accent: #3f6ee8;
	--ers-text: #0f172a;
	--ers-muted: #64748b;
	--ers-line: #dbe3f0;
	max-width: 780px;
	margin: 2rem auto;
	padding: 36px 24px 28px;
	color: var(--ers-text);
	border-radius: 28px;
	background:
		radial-gradient(700px 260px at 15% -10%, #d6e4fb 0, transparent 70%),
		radial-gradient(600px 260px at 100% 0, #e4e9fb 0, transparent 70%),
		#f4f7fc;
	box-sizing: border-box;
	line-height: 1.5;
}
.ers *, .ers *::before, .ers *::after { box-sizing: border-box; }

/* header */
.ers-head { text-align: center; margin: 0 auto 22px; max-width: 620px; }
.ers-inst { font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ers-accent); font-weight: 700; }
.ers-inst:empty, .ers-sub:empty { display: none; }
.ers .ers-title { margin: 4px 0 0; font-size: 1.5rem; line-height: 1.3; font-weight: 700; color: var(--ers-text); }
.ers-sub { margin: 8px 0 0; color: var(--ers-muted); font-size: .9rem; }

/* big glass input box */
.ers-box {
	padding: 18px 18px 14px;
	border-radius: 24px;
	background: rgba(255, 255, 255, .72);
	border: 1px solid rgba(255, 255, 255, .95);
	box-shadow: 0 0 0 1px var(--ers-line), 0 18px 46px -22px rgba(37, 70, 160, .38);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: box-shadow .18s;
}
.ers-box:focus-within { box-shadow: 0 0 0 2px var(--ers-accent), 0 18px 46px -22px rgba(37, 70, 160, .45); }
.ers .ers-input {
	display: block; width: 100%; height: 54px; padding: 0 6px; margin: 0 0 14px;
	font: inherit; font-size: 1.1rem; letter-spacing: .02em; color: var(--ers-text);
	background: transparent; border: 0; outline: 0; box-shadow: none; border-radius: 0;
}
.ers .ers-input::placeholder { color: #8a96ab; letter-spacing: 0; }
.ers-box-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ers-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ers-chip {
	display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 32px; padding: 0 12px;
	font-size: .8rem; font-weight: 500; color: #1f2937; background: rgba(255, 255, 255, .85);
	border: 1px solid var(--ers-line); border-radius: 999px;
}
.ers-chip svg { flex: none; }
.ers-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.ers-chip-id {
	color: var(--ers-accent);
	background: color-mix(in srgb, var(--ers-accent) 11%, #fff);
	border-color: color-mix(in srgb, var(--ers-accent) 32%, #fff);
}
.ers .ers-send {
	flex: none; width: 42px; height: 42px; padding: 0; display: grid; place-items: center;
	color: #fff; background: var(--ers-accent); border: 0; border-radius: 50%; cursor: pointer;
	box-shadow: 0 6px 16px -6px var(--ers-accent);
	transition: transform .12s, filter .15s, opacity .15s;
}
.ers .ers-send:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ers .ers-send:active { transform: scale(.94); }
.ers .ers-send:disabled { opacity: .7; cursor: wait; }
.ers-loading .ers-send svg { display: none; }
.ers-loading .ers-send::after { content: ""; width: 18px; height: 18px; border: 2.5px solid #fff; border-right-color: transparent; border-radius: 50%; animation: ers-spin .7s linear infinite; }
@keyframes ers-spin { to { transform: rotate(360deg); } }

/* recent exam pills */
.ers-recent { margin: 26px 0 10px; text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ers-muted); }
.ers-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ers .ers-pill {
	display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 40px; padding: 0 16px; margin: 0;
	font: inherit; font-size: .86rem; font-weight: 500; color: #1f2937; cursor: pointer;
	background: rgba(255, 255, 255, .6); border: 1px solid #c9d3e6; border-radius: 999px;
	transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s;
}
.ers .ers-pill svg { flex: none; opacity: .75; }
.ers .ers-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.ers .ers-pill:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(37, 70, 160, .5); }
.ers .ers-pill.is-active {
	color: var(--ers-accent); font-weight: 600;
	background: color-mix(in srgb, var(--ers-accent) 11%, #fff);
	border-color: var(--ers-accent);
}
.ers .ers-pill.is-active svg { opacity: 1; }

/* result */
.ers-out:empty { display: none; }
.ers-out { margin-top: 24px; }
.ers-result {
	display: flex; gap: 16px; padding: 20px; border-radius: 18px;
	background: var(--c-bg); border: 1px solid var(--c-line);
	animation: ers-in .25s ease-out;
	--c: #475569; --c-bg: #f8fafc; --c-line: #e2e8f0;
	-webkit-print-color-adjust: exact; print-color-adjust: exact;
}
@keyframes ers-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ers-pass { --c: #15803d; --c-bg: #f0fdf4; --c-line: #bbf7d0; }
.ers-fail { --c: #b91c1c; --c-bg: #fef2f2; --c-line: #fecaca; }
.ers-info { --c: #1d4ed8; --c-bg: #eff6ff; --c-line: #bfdbfe; }
.ers-none { --c: #b45309; --c-bg: #fffbeb; --c-line: #fde68a; }
.ers-badge { flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: var(--c); border-radius: 50%; }
.ers-body { min-width: 0; flex: 1; }
.ers-status { font-size: 1.35rem; font-weight: 700; line-height: 1.3; color: var(--c); }
.ers-remark { margin-top: 4px; color: var(--ers-text); font-size: .95rem; }
.ers-q { margin-top: 6px; font-size: .8rem; color: var(--ers-muted); }
.ers-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin: 14px 0 0; }
.ers-dl-i dt { margin: 0; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ers-muted); }
.ers-dl-i dd { margin: 2px 0 0; font-size: 1.02rem; font-weight: 600; color: var(--ers-text); word-break: break-word; }
.ers-meta { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--c-line); font-size: .8rem; color: var(--ers-muted); }
.ers-note { margin-top: 12px; font-size: .82rem; color: var(--ers-muted); font-style: italic; }

/* cross-check + actions */
.ers-cross { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: .84rem; }
.ers-cross-t { font-weight: 700; margin-bottom: 4px; }
.ers-cross p { margin: 0; white-space: pre-line; }
.ers-cross a { display: inline-block; margin-top: 8px; font-weight: 600; color: #92400e; text-decoration: underline; }
.ers-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.ers .ers-ghost {
	display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; font: inherit; font-size: .85rem; font-weight: 600;
	color: var(--ers-accent); background: #fff; border: 1px solid color-mix(in srgb, var(--ers-accent) 35%, #fff); border-radius: 999px; cursor: pointer;
	transition: background .15s;
}
.ers .ers-ghost:hover { background: color-mix(in srgb, var(--ers-accent) 9%, #fff); }
.ers-empty { text-align: center; color: var(--ers-muted); margin: 0; }

@media (max-width: 520px) {
	.ers { padding: 24px 14px 20px; border-radius: 22px; margin: 1rem 0; }
	.ers .ers-title { font-size: 1.25rem; }
	.ers-chip-exam { display: none; }
	.ers-result { padding: 16px; gap: 12px; }
}

/* tag + removed notice */
.ers .ers-tag { flex: none; font-style: normal; font-size: .66rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: #fee2e2; color: #991b1b; }
.ers-removed { --c: #475569; --c-bg: #f1f5f9; --c-line: #cbd5e1; }
.ers-pre { white-space: pre-line; }
.ers-link { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .85rem; color: var(--ers-accent); text-decoration: underline; }

/* "Search Result" archive */
.ers-archive-wrap { display: flex; justify-content: center; margin-top: 16px; }
.ers .ers-archive-btn {
	display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px; margin: 0;
	font: inherit; font-size: .88rem; font-weight: 600; color: var(--ers-accent); cursor: pointer;
	background: #fff; border: 1.5px solid color-mix(in srgb, var(--ers-accent) 45%, #fff); border-radius: 999px;
	transition: background .15s, box-shadow .15s, transform .12s;
}
.ers .ers-archive-btn:hover { background: color-mix(in srgb, var(--ers-accent) 8%, #fff); transform: translateY(-1px); }
.ers .ers-archive-btn.is-open { background: var(--ers-accent); color: #fff; border-color: var(--ers-accent); }
.ers-archive { margin-top: 14px; padding: 14px; border-radius: 20px; background: rgba(255, 255, 255, .78); box-shadow: 0 0 0 1px var(--ers-line), 0 14px 36px -22px rgba(37, 70, 160, .4); animation: ers-in .2s ease-out; }
.ers-archive[hidden] { display: none; }
.ers-archive-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; margin-bottom: 10px; color: var(--ers-muted); background: #f4f7fc; border: 1px solid var(--ers-line); border-radius: 999px; }
.ers-archive-search:focus-within { border-color: var(--ers-accent); background: #fff; }
.ers .ers-archive-q { flex: 1; min-width: 0; height: 100%; padding: 0; margin: 0; font: inherit; font-size: .95rem; color: var(--ers-text); background: transparent; border: 0; outline: 0; box-shadow: none; }
.ers-archive-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.ers-archive-list.is-busy { opacity: .55; }
.ers .ers-ar-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; margin: 0; text-align: left; font: inherit; color: var(--ers-text); background: transparent; border: 0; border-radius: 12px; cursor: pointer; transition: background .12s; }
.ers .ers-ar-item:hover { background: color-mix(in srgb, var(--ers-accent) 9%, #fff); }
.ers-ar-main { display: flex; flex-direction: column; min-width: 0; }
.ers-ar-t { font-size: .92rem; font-weight: 600; line-height: 1.35; }
.ers-ar-s { font-size: .76rem; color: var(--ers-muted); }
.ers-ar-empty { margin: 14px 0; text-align: center; color: var(--ers-muted); font-size: .9rem; }
.ers-archive-foot { display: flex; justify-content: center; margin-top: 8px; }
.ers-archive-foot [hidden] { display: none; }

/* ===== print slip (built by JS) ===== */
.ers-slip { display: none; }
@media print {
	body.ers-printing > *:not(#ers-print-root) { display: none !important; }
	body.ers-printing #ers-print-root { display: block !important; max-width: 720px; margin: 0 auto; padding: 24px; color: #0f172a; font-family: inherit;
		--ers-accent: #3f6ee8; --ers-text: #0f172a; --ers-muted: #475569; }
	.ers-slip-head { text-align: center; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid #0f172a; }
	.ers-slip-head h2 { margin: 4px 0; font-size: 20px; }
	.ers-slip-head p { margin: 4px 0 0; font-size: 13px; color: #475569; }
	.ers-slip .ers-inst { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
	.ers-slip .ers-result { animation: none; break-inside: avoid; }
	.ers-slip .ers-cross { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.ers-slip-foot { margin-top: 18px; font-size: 11px; color: #64748b; text-align: right; }
}
