:root {
  --ink: #172033;
  --muted: #67728a;
  --line: #dfe4ee;
  --paper: #ffffff;
  --canvas: #f4f6fa;
  --navy: #18223a;
  --blue: #4361ee;
  --blue-dark: #314ac4;
  --cyan: #22b8cf;
  --green: #168a62;
  --red: #c43d4b;
  --amber: #c77b13;
  --shadow: 0 12px 35px rgba(30, 46, 86, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar { min-height: 68px; padding: 0 4vw; display: flex; align-items: center; gap: 32px; color: #fff; background: var(--navy); box-shadow: 0 6px 24px rgba(16, 25, 48, .2); position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; letter-spacing: -.02em; }
.brand:hover { color: #fff; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand small { margin-top: 4px; color: #9eabc3; font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.brand-logo { width: 42px; height: 42px; flex: 0 0 42px; object-fit: contain; background: #fff; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .16); }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav a { color: #bec7d9; padding: 9px 11px; border-radius: 9px; font-size: 14px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.user-menu { display: flex; align-items: center; gap: 14px; color: #dfe4ef; font-size: 14px; }
.user-menu form { margin: 0; }
.account-link { color: #aeb9cf; white-space: nowrap; }
.account-link:hover { color: #fff; }
.link-button { border: 0; color: #aeb9cf; background: transparent; padding: 0; }
.link-button:hover { color: #fff; }
.topbar-login { margin-left: auto; padding: 10px 17px; color: #fff; background: var(--blue); border-radius: 10px; font-size: 13px; font-weight: 800; }
.topbar-login:hover { color: #fff; background: var(--blue-dark); }

.page { width: min(1440px, 92vw); margin: 0 auto; padding: 42px 0 72px; min-height: calc(100vh - 124px); }
.footer { padding: 18px; color: #8a94a8; text-align: center; font-size: 13px; border-top: 1px solid var(--line); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-header h1, .candidate-hero h1 { margin: 2px 0 5px; font-size: clamp(28px, 3vw, 42px); line-height: 1.15; letter-spacing: -.035em; }
.page-header p, .candidate-hero p { margin: 0; color: var(--muted); max-width: 760px; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.narrow { width: min(780px, 100%); margin: 0 auto; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 750; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.btn-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(67, 97, 238, .22); }
.btn-primary:hover { color: #fff; background: var(--blue-dark); }
.btn-secondary { color: #2d3c5c; background: #eef1f8; border-color: #d8deea; }
.btn-secondary:hover { color: var(--ink); background: #e4e9f3; }
.btn-ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.btn-danger { color: #fff; background: var(--red); }
.btn-danger-soft { color: #a72f3c; background: #fff0f1; border-color: #efc3c7; }
.btn-danger-soft:hover { color: #8d2230; background: #ffe5e8; }
.btn-block { width: 100%; }

.panel, .metric, .test-card, .candidate-test, .answer-card, .auth-card, .success-card, .download-card, .empty-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 24px; }
.panel h2 { margin: 0 0 18px; font-size: 19px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-header h2 { margin: 0; }
.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; margin-bottom: 20px; }
.span-2 { min-width: 0; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric { padding: 20px; position: relative; overflow: hidden; }
.metric::before { content: ""; position: absolute; width: 5px; height: 100%; left: 0; top: 0; background: #cbd3e2; }
.metric-warn::before { background: var(--amber); }
.metric-accent::before { background: var(--blue); }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 30px; letter-spacing: -.03em; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; color: #7a8498; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line); }
td { padding: 14px; vertical-align: middle; border-bottom: 1px solid #edf0f5; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
td small { display: block; color: var(--muted); margin-top: 2px; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.code { color: #405078; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; font-weight: 750; }
.badge { display: inline-flex; align-items: center; width: fit-content; border: 1px solid #dce2ed; border-radius: 999px; padding: 4px 9px; color: #59657a; background: #f4f6fa; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-review { color: #905f0d; background: #fff6df; border-color: #efd69c; }
.badge-graded { color: #126948; background: #e9f8f2; border-color: #bde6d5; }
.result-pass { color: var(--green); font-weight: 800; }
.result-fail { color: var(--red); font-weight: 800; }

.form-control { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #ccd4e1; border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s; }
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(67, 97, 238, .12); }
textarea.form-control { resize: vertical; }
.stack-form p { margin: 0 0 17px; }
.stack-form label { display: block; margin-bottom: 6px; font-weight: 750; font-size: 14px; }
.stack-form .helptext { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.stack-form ul.errorlist { list-style: none; margin: 0 0 5px; padding: 0; color: var(--red); font-size: 13px; }
.stack-form input[type="checkbox"] { width: 18px; height: 18px; margin-right: 8px; vertical-align: middle; accent-color: var(--blue); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.filter-row { display: flex; gap: 10px; margin-bottom: 18px; }

.messages { margin-bottom: 20px; }
.alert { padding: 13px 15px; border-radius: 10px; border: 1px solid #cfd8e7; background: #f6f8fc; }
.alert + .alert { margin-top: 8px; }
.alert-success { color: #116447; background: #eaf8f2; border-color: #bde6d5; }
.alert-error { color: #9a2f3b; background: #fff0f1; border-color: #efc3c7; }
.alert-warning { color: #855a13; background: #fff8e7; border-color: #ecd49e; }

.auth-shell { min-height: 100vh; background: linear-gradient(90deg, rgba(237,246,255,.72), rgba(255,255,255,.36)), url("../images/aes-background.png") center / cover no-repeat fixed; }
.page.auth-page { width: 100%; display: grid; place-items: center; padding: 54px 18px; background: transparent; }
.auth-card { width: min(470px, 100%); padding: 38px; text-align: center; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); box-shadow: 0 24px 65px rgba(15, 66, 125, .22); }
.auth-card .stack-form { text-align: left; }
.auth-card .stack-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #ccd4e1; border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s; }
.auth-card .stack-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(67, 97, 238, .12); }
.auth-logo { width: 112px; height: 112px; margin: -12px auto 4px; display: block; object-fit: contain; }
.auth-card h1 { margin: 7px 0 8px; font-size: 30px; letter-spacing: -.03em; }
.auth-card > p { color: var(--muted); margin-bottom: 24px; }
.error-icon, .success-icon { width: 62px; height: 62px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; font-size: 34px; font-weight: 500; }
.error-icon { color: var(--red); background: #ffebed; }
.success-icon { color: var(--green); background: #e8f8f1; }

.card-grid, .candidate-tests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.test-card, .candidate-test { display: block; padding: 24px; color: var(--ink); transition: .16s ease; }
.test-card:hover { color: var(--ink); border-color: #b8c4da; transform: translateY(-3px); box-shadow: 0 18px 42px rgba(30, 46, 86, .12); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.test-card h2, .candidate-test h2 { margin: 17px 0 8px; font-size: 21px; }
.list-tabs { display: flex; gap: 10px; margin: -8px 0 22px; }
.list-tabs .btn span { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.22); font-size: 11px; }
.test-manage-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.test-card-main { flex: 1; display: block; padding: 24px; color: var(--ink); }
.test-card-main:hover { color: var(--ink); }
.test-usage { display: flex; gap: 16px; margin-top: 16px; padding-top: 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.test-card-actions { display: flex; gap: 8px; padding: 14px 16px; background: #f8faff; border-top: 1px solid var(--line); }
.test-card-actions form { margin: 0; }
.test-card-actions .btn { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.table-actions { display: flex; align-items: center; gap: 7px; min-width: max-content; }
.table-actions form { margin: 0; }
.table-actions .btn { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.safe-note, .security-note { margin-top: 18px; padding: 14px 15px; color: #355775; background: #edf6ff; border: 1px solid #cfe4f7; border-radius: 11px; font-size: 13px; }
.danger-panel, .password-panel { padding: clamp(24px, 4vw, 38px); }
.danger-panel { text-align: center; }
.danger-panel > p { color: var(--muted); }
.warning-icon, .delete-icon { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; font-size: 34px; font-weight: 800; }
.warning-icon { color: var(--amber); background: #fff5dd; }
.delete-icon { color: var(--red); background: #ffebed; }
.center-actions { justify-content: center; margin-top: 22px; }
.security-note { display: flex; flex-direction: column; gap: 4px; margin: 0 0 24px; }
.security-note span { color: var(--muted); }
.danger-confirm-form { margin-top: 22px; }
.danger-confirm { display: flex; align-items: flex-start; gap: 12px; padding: 15px; color: #7c2934; text-align: left; background: #fff0f1; border: 1px solid #efc3c7; border-radius: 11px; cursor: pointer; }
.danger-confirm input { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px; accent-color: var(--red); }
.danger-confirm span { font-size: 13px; }
.test-card p, .candidate-test p { min-height: 48px; margin: 0 0 20px; color: var(--muted); }
.card-meta, .test-facts { display: flex; gap: 14px; flex-wrap: wrap; color: #647087; font-size: 13px; }
.empty-card { display: grid; place-items: center; min-height: 180px; padding: 30px; color: var(--muted); text-align: center; }

.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.download-card { display: flex; flex-direction: column; padding: 18px; color: var(--ink); }
.download-card:hover { color: var(--ink); border-color: #b8c4da; }
.download-card span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.danger-panel { color: #832b36; background: #fff5f6; border-color: #ecc2c7; }
.warning-panel { color: #785113; background: #fff9ea; border-color: #ead39c; }

.summary-list > div, .rule-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-list span, .rule-list span { color: var(--muted); font-size: 13px; }
.rule-list { margin-top: 18px; }
.rule-list > div { flex-direction: column; gap: 2px; }

.success-card { padding: 44px; text-align: center; }
.success-card h1 { margin: 5px 0 8px; font-size: 34px; }
.copy-row { display: flex; gap: 8px; margin: 8px 0 8px; }
.copy-status { min-height: 24px; }
.copy-success { color: var(--green); font-weight: 700; }
.success-card label { display: block; margin-top: 26px; text-align: left; font-weight: 750; font-size: 13px; }
.notice { margin: 22px 0; padding: 13px; color: #765011; background: #fff8e6; border-radius: 10px; }
.candidate-score { margin: 24px auto; display: flex; flex-direction: column; width: min(300px, 100%); padding: 25px; background: #f2f5ff; border-radius: 16px; }
.candidate-score strong { color: var(--blue); font-size: 48px; letter-spacing: -.05em; }
.candidate-score span { color: var(--muted); }
.candidate-score b { margin-top: 7px; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: #f7f8fb; border-radius: 10px; }
.bar-row strong, .bar-row span { display: block; }
.bar-row span { color: var(--muted); font-size: 12px; }
.bar-value { color: var(--blue); font-size: 22px; font-weight: 850; }

.score-ring { width: 130px; min-width: 130px; height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; border: 10px solid #dde4ff; background: #fff; box-shadow: var(--shadow); }
.score-ring strong { color: var(--blue); font-size: 28px; }
.score-ring span { color: var(--muted); font-size: 11px; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; background: var(--navy); border-radius: var(--radius); overflow: hidden; }
.summary-strip > div { padding: 18px 22px; color: #fff; border-right: 1px solid rgba(255,255,255,.12); }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { color: #aeb9ce; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.answer-list { display: flex; flex-direction: column; gap: 16px; }
.answer-card { padding: 24px; }
.answer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.question-number { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; color: #fff; background: var(--navy); border-radius: 8px; font-weight: 800; }
.answer-card h3 { margin: 18px 0; }
.option-review { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.option-review li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f7f8fb; border: 1px solid transparent; border-radius: 9px; }
.option-review li > span { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 7px; background: #e5e9f1; font-size: 12px; font-weight: 800; }
.option-review li.correct { background: #eaf8f2; border-color: #b9e3d1; }
.option-review li.selected { box-shadow: inset 4px 0 var(--blue); }
.option-review em { margin-left: auto; color: var(--muted); font-size: 11px; font-style: normal; }
.awarded { margin-top: 15px; text-align: right; color: var(--muted); }
.text-answer { padding: 16px; background: #f7f8fb; border-radius: 10px; }
.review-note { color: var(--green); }

.candidate-hero { padding: 34px; margin-bottom: 22px; color: #fff; background: radial-gradient(circle at 86% 18%, rgba(34,184,207,.42), transparent 28%), linear-gradient(130deg, #17213a, #25365f); border-radius: 20px; box-shadow: 0 18px 45px rgba(24,34,58,.18); }
.candidate-hero .eyebrow { color: #72d4e0; }
.candidate-hero p { color: #c7d0e1; }
.candidate-test .btn { margin-top: 20px; }
.test-facts { padding-top: 16px; border-top: 1px solid var(--line); }
.test-facts span { display: flex; flex-direction: column; }
.test-facts strong { color: var(--ink); font-size: 18px; }

.test-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.test-toolbar h1 { margin: 3px 0 0; font-size: clamp(24px, 3vw, 36px); }
.timer { min-width: 140px; padding: 12px 18px; color: #fff; background: var(--navy); border-radius: 13px; text-align: center; }
.timer span, .timer strong { display: block; }
.timer span { color: #aeb9cf; font-size: 11px; text-transform: uppercase; }
.timer strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.progress-shell { height: 6px; margin-bottom: 24px; overflow: hidden; background: #dfe4ee; border-radius: 99px; }
#progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .25s; }
.question-stack { display: flex; flex-direction: column; gap: 18px; }
.question-card { padding: clamp(22px, 4vw, 36px); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.question-card h2 { margin: 14px 0 22px; font-size: clamp(19px, 2.2vw, 26px); line-height: 1.35; }
.question-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.answer-options { display: grid; gap: 10px; }
.answer-option { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 11px; padding: 14px; border: 1px solid #d8deea; border-radius: 11px; cursor: pointer; transition: .15s; }
.answer-option:hover { border-color: #aebbd5; background: #fafbff; }
.answer-option:has(input:checked) { border-color: var(--blue); background: #f1f4ff; box-shadow: 0 0 0 2px rgba(67,97,238,.08); }
.answer-option input { width: 18px; height: 18px; accent-color: var(--blue); }
.option-letter { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #e9edf5; color: #46536a; font-size: 12px; font-weight: 850; }
.save-state { margin-top: 12px; color: var(--muted); font-size: 12px; text-align: right; }
.save-state.saved { color: var(--green); }
.save-state.failed { color: var(--red); }
.submit-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.submit-panel p { margin: 3px 0 0; color: var(--muted); }

.error-page { padding: 90px 20px; text-align: center; }
.error-page > strong { color: #dce2ed; font-size: 110px; line-height: 1; letter-spacing: -.08em; }
.error-page h1 { margin: 0; }
.error-page p { color: var(--muted); }

.public-shell { min-height: 100vh; background: linear-gradient(90deg, rgba(240,247,255,.18), rgba(242,248,255,.12)), url("../images/aes-background.png") center / cover no-repeat fixed; }
.public-shell .topbar, .auth-shell .topbar { width: min(1180px, calc(100% - 36px)); min-height: 68px; margin: 18px auto 0; padding: 8px 18px; color: var(--ink); background: rgba(255,255,255,.9); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,.78); border-radius: 20px; box-shadow: 0 14px 38px rgba(20,65,120,.16); position: sticky; top: 12px; }
.public-shell .brand, .public-shell .brand:hover, .auth-shell .brand, .auth-shell .brand:hover { color: #0b3b78; }
.public-shell .brand small, .auth-shell .brand small { color: #5e7694; }
.public-shell .footer, .auth-shell .footer { color: #42627f; background: rgba(255,255,255,.78); border-top-color: rgba(255,255,255,.8); }
.page.public-page { width: 100%; display: flex; flex-direction: column; justify-content: center; padding: 42px 0 62px; background: transparent; }
.public-hero { width: min(1180px, 92vw); min-height: min(510px, 64vh); margin: 0 auto; display: flex; align-items: center; justify-content: flex-end; }
.public-copy { width: min(610px, 58%); padding: clamp(32px, 5vw, 58px); color: var(--ink); text-align: left; background: rgba(255,255,255,.88); backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,.84); border-radius: 26px; box-shadow: 0 24px 60px rgba(14,61,115,.2); }
.public-copy .eyebrow { color: #1769aa; }
.public-copy h1 { max-width: 760px; margin: 8px 0 16px; color: #073b8e; font-size: clamp(42px, 5.4vw, 68px); line-height: 1; letter-spacing: -.05em; }
.public-copy p { max-width: 680px; margin: 0 0 28px; color: #4d6078; font-size: clamp(16px, 1.7vw, 20px); }
.public-login { min-height: 48px; padding-inline: 22px; }
.public-guide { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(93,119,151,.2); }
.public-guide strong { color: #173d68; font-size: 14px; }
.public-guide span { color: var(--muted); font-size: 13px; }
.public-subjects { width: min(1180px, 92vw); margin: 18px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.public-subjects article { padding: 20px 22px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.82); border-radius: 16px; box-shadow: 0 14px 35px rgba(14,61,115,.12); }
.public-subjects span { display: block; color: #a5aec0; font-size: 11px; font-weight: 850; }
.public-subjects strong { display: block; margin-top: 8px; font-size: 18px; }
.public-subjects p { margin: 3px 0 0; color: var(--muted); }
.standard-card > p { margin: 18px 0 0; }

.site-intro { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: #f2f8ff; animation: intro-hide .45s ease .8s forwards; }
.site-intro-icon { width: 82px; height: 82px; display: grid; place-items: center; overflow: hidden; background: #fff; border: 1px solid #dbe9f8; border-radius: 22px; box-shadow: 0 18px 45px rgba(19,77,140,.18); animation: intro-pop .65s cubic-bezier(.22,.85,.32,1); }
.site-intro-icon img { width: 74px; height: 74px; object-fit: contain; }
@keyframes intro-pop { from { opacity: 0; transform: scale(.72); } to { opacity: 1; transform: scale(1); } }
@keyframes intro-hide { to { opacity: 0; visibility: hidden; } }

.question-editor-wrap { width: min(980px, 100%); margin: 0 auto; }
.question-editor { padding: clamp(22px, 4vw, 38px); }
.editor-step { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 15px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.editor-step:first-of-type { padding-top: 0; }
.step-number { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: #1769aa; border-radius: 10px; font-weight: 850; }
.step-content > label, .step-content > strong { display: block; margin: 5px 0 8px; font-weight: 800; }
.step-content textarea { min-height: 116px; }
.option-section-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin: 4px 0 14px; }
.option-section-title strong, .option-section-title span { display: block; }
.option-section-title span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.option-section-title .required-note { margin-top: 2px; color: #1769aa; font-size: 11px; font-weight: 800; white-space: nowrap; }
.option-editor-list { display: grid; gap: 10px; }
.option-editor-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; background: #f7faff; border: 1px solid #dce6f1; border-radius: 13px; transition: .15s ease; }
.option-editor-row:has(input[type="radio"]:checked) { background: #ebf7f1; border-color: #8ed0b6; box-shadow: inset 4px 0 #168a62; }
.option-editor-letter { width: 34px; height: 34px; display: grid; place-items: center; color: #0b4b8c; background: #e4f0fb; border-radius: 10px; font-weight: 900; }
.option-editor-row > div > label { display: block; margin: 0 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.option-editor-row .form-control { min-height: 40px; }
.correct-choice { display: flex; align-items: center; gap: 7px; padding: 8px 10px; color: #55708c; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 800; }
.correct-choice input { width: 19px; height: 19px; margin: 0; accent-color: var(--green); }
.option-editor-row:has(input[type="radio"]:checked) .correct-choice { color: var(--green); }
.editor-details { margin: 22px 0; padding: 14px 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 11px; }
.editor-details summary { cursor: pointer; color: #425877; font-weight: 750; }
.editor-details label { display: block; margin: 15px 0 6px; font-weight: 750; }
.question-editor ul.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--red); font-size: 12px; }

.result-filter-panel { margin-bottom: 20px; }
.result-filters { display: grid; grid-template-columns: 1.4fr repeat(5, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.result-filters label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.filter-actions { display: flex; gap: 8px; grid-column: 1 / -1; justify-content: flex-end; }
.result-table-panel { padding-top: 16px; }
.result-count { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.score-cell { color: var(--blue); font-size: 22px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; padding-top: 22px; }
.export-panel { padding: clamp(24px, 4vw, 38px); }
.export-note { display: flex; flex-direction: column; gap: 5px; margin: 22px 0 8px; padding: 16px; color: #40536e; background: #edf6ff; border: 1px solid #cfe4f7; border-radius: 11px; }
.export-note span { font-size: 13px; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid, .candidate-tests { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .brand { flex: 1; }
}

@media (max-width: 760px) {
  .topbar { padding: 0 18px; gap: 12px; }
  .user-menu > span { display: none; }
  .account-link { font-size: 12px; }
  .page { width: min(94vw, 680px); padding-top: 28px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid, .card-grid, .candidate-tests, .download-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .score-ring { width: 100px; min-width: 100px; height: 100px; }
  .copy-row, .filter-row, .submit-panel { align-items: stretch; flex-direction: column; }
  .test-card-actions { flex-wrap: wrap; }
  .auth-card, .success-card { padding: 26px; }
  .test-toolbar { align-items: flex-start; }
  .timer { min-width: 112px; }
  .table-wrap { margin: 0 -14px; }
  .public-hero, .public-subjects { grid-template-columns: 1fr; }
  .public-hero { min-height: auto; }
  .public-copy { width: 100%; }
  .public-copy h1 { font-size: clamp(38px, 14vw, 58px); }
  .result-filters { grid-template-columns: 1fr 1fr; }
  .result-filters label:first-child, .filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 440px) {
  .metric-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr; }
  .page-header .actions { width: 100%; }
  .page-header .actions .btn { flex: 1; }
  .result-filters { grid-template-columns: 1fr; }
  .result-filters label:first-child, .filter-actions { grid-column: auto; }
  .filter-actions { flex-direction: column; }
  .public-shell .topbar, .auth-shell .topbar { width: calc(100% - 20px); margin-top: 10px; border-radius: 15px; }
  .topbar-login { padding: 9px 11px; font-size: 11px; }
  .brand-logo { width: 38px; height: 38px; flex-basis: 38px; }
  .brand > span:last-child { font-size: 13px; }
  .option-editor-row { grid-template-columns: 34px minmax(0, 1fr); }
  .correct-choice { grid-column: 2; padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .site-intro { display: none; }
}
