:root {
  --ink: #172035;
  --muted: #687086;
  --paper: #fffdfa;
  --canvas: #f2efe9;
  --line: #ded9d0;
  --brand: #163c57;
  --accent: #d95f39;
  --soft: #edf2f4;
  --success: #23765b;
  --danger: #a93832;
  --warning: #946214;
  --shadow: 0 12px 35px rgba(27, 35, 50, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: #126ba0; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.05; letter-spacing: 0; }
h2 { margin: 0; font-size: 1.35rem; letter-spacing: 0; }
.eyebrow, .section-kicker { margin: 0 0 8px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; padding: 9px 15px; font-weight: 750; text-decoration: none; }
.button-primary { border-color: var(--brand); background: var(--brand); color: white; }
.button-secondary { background: white; color: var(--brand); }
.button-danger { border-color: var(--danger); background: var(--danger); color: white; }
.button-small { min-height: 36px; padding: 6px 11px; }
.button-block { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.hidden { display: none !important; }
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 7px; font-weight: 750; }
.field input, .field textarea, .field select, form p input { width: 100%; border: 1px solid #c9c4ba; border-radius: 6px; background: white; padding: 12px 13px; color: var(--ink); }
.field textarea { min-height: 160px; resize: vertical; }
.field textarea.tall { min-height: 260px; }
.field input:focus, .field textarea:focus, .field select:focus, input:focus, select:focus { outline: 3px solid rgba(22, 60, 87, .14); border-color: var(--brand); }
.field-error, .errorlist { margin: 6px 0; color: var(--danger); font-size: .86rem; }
.hint { display: block; margin: -3px 0 9px; color: var(--muted); font-size: .84rem; }
.notice { border-left: 4px solid var(--warning); padding: 12px 14px; background: #fff7df; }
.message { max-width: 1160px; margin: 10px auto; border: 1px solid #bad9cb; border-radius: 6px; padding: 10px 14px; background: #edf8f3; }
.message.error { border-color: #e3b6b1; background: #fff0ee; }

.entry-shell { width: min(1080px, calc(100% - 32px)); min-height: 100vh; margin: auto; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 70px; padding: 56px 0; }
.entry-intro > p:not(.eyebrow) { max-width: 620px; color: var(--muted); font-size: 1.08rem; }
.plain-list { padding: 0; list-style: none; }
.plain-list li { margin: 9px 0; padding-left: 26px; position: relative; }
.plain-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.entry-form-panel, .login-panel, .narrow-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); padding: 30px; }
.entry-form-panel h2 { margin-bottom: 24px; }
.privacy-note { margin: 15px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.message-shell { width: min(650px, calc(100% - 32px)); margin: 14vh auto; border-top: 5px solid var(--accent); background: var(--paper); padding: 38px; box-shadow: var(--shadow); }
.success-message { border-color: var(--success); }

.test-header { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.test-header-inner { width: min(1200px, calc(100% - 32px)); min-height: 70px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.test-header .eyebrow { margin: 0; }
.timer-block { min-width: 112px; text-align: right; }
.timer-block span { display: block; color: var(--muted); font-size: .72rem; }
.timer-block strong { font-variant-numeric: tabular-nums; font-size: 1.25rem; }
.timer-block strong.warning { color: var(--danger); }
.progress-track { height: 4px; background: #dedede; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .25s; }
.test-shell { width: min(1200px, calc(100% - 32px)); margin: 34px auto 70px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.step-nav { position: sticky; top: 105px; display: grid; gap: 6px; }
.candidate-name { margin: 0 0 12px; font-weight: 800; }
.step-link { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 6px; padding: 9px; background: transparent; color: var(--muted); text-align: left; }
.step-link span { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border: 1px solid #c6c7cb; border-radius: 50%; font-size: .76rem; font-weight: 800; }
.step-link.active { background: white; color: var(--ink); box-shadow: 0 3px 12px rgba(27,35,50,.06); }
.step-link.complete span { border-color: var(--success); background: var(--success); color: white; }
.save-status { margin-top: 12px; color: var(--success); font-size: .76rem; }
.save-status.saving { color: var(--warning); }
.save-status.error { color: var(--danger); }
.test-content { min-width: 0; }
.test-step { display: none; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); padding: 32px; }
.test-step.active { display: block; }
.step-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.step-heading span { color: var(--accent); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.step-heading h1 { margin-top: 5px; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.step-heading small { flex: 0 0 auto; border-radius: 5px; background: var(--soft); padding: 7px 10px; color: var(--brand); font-weight: 700; }
.scenario { margin-bottom: 24px; border-left: 4px solid var(--accent); background: #f7f3ed; padding: 18px 20px; }
.scenario p:first-child { margin-top: 0; }
.scenario p:last-child { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0; list-style: none; }
.facts li { border-radius: 5px; background: var(--soft); padding: 10px 12px; font-size: .88rem; }
.facts strong { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.classification-list { display: grid; gap: 10px; }
.classification-row { display: grid; grid-template-columns: 1fr 220px; align-items: center; gap: 20px; border: 1px solid var(--line); padding: 14px; }
.classification-row p { margin: 0; }
.classification-row select { width: 100%; border: 1px solid #c9c4ba; border-radius: 6px; padding: 10px; background: white; }
.two-columns, .validation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.data-panel { border: 1px solid var(--line); padding: 16px; }
.data-panel h2 { font-size: 1rem; }
.data-panel table { width: 100%; margin-top: 10px; border-collapse: collapse; }
.data-panel th, .data-panel td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
.data-panel th { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.validation-grid + .field { margin-top: 24px; }
.test-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.review-content { display: grid; gap: 12px; }
.review-item { border-bottom: 1px solid var(--line); padding: 0 0 12px; }
.review-item h3 { margin: 0 0 5px; font-size: .88rem; }
.review-item p { max-height: 130px; overflow: auto; margin: 0; white-space: pre-wrap; color: var(--muted); font-size: .9rem; }
.confirmation-check { display: flex; align-items: start; gap: 9px; margin-top: 22px; font-weight: 750; }
.confirmation-check input { width: 18px; height: 18px; }

.panel-body { background: #f5f7fa; }
.panel-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 max(24px, calc((100% - 1160px) / 2)); background: #fff; border-bottom: 1px solid #e1e5eb; }
.panel-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.panel-brand span, .panel-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--brand); color: white; font-weight: 800; }
.panel-header nav { display: flex; align-items: center; gap: 18px; }
.panel-header nav a:not(.button), .link-button { border: 0; background: transparent; color: var(--muted); text-decoration: none; }
.panel-header form { margin: 0; }
.panel-shell { width: min(1160px, calc(100% - 32px)); margin: 34px auto 70px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 26px; }
.page-heading h1 { font-family: inherit; font-size: 2rem; font-weight: 800; }
.page-heading p:not(.section-kicker) { margin: 5px 0 0; color: var(--muted); }
.heading-actions, .form-actions { display: flex; gap: 9px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-grid > div { border: 1px solid #e0e4ea; border-radius: 7px; background: white; padding: 18px; }
.metric-grid span { display: block; color: var(--muted); font-size: .8rem; }
.metric-grid strong { display: block; margin-top: 4px; font-size: 1.75rem; }
.table-panel, .detail-main, .review-panel { border: 1px solid #e0e4ea; border-radius: 7px; background: white; }
.table-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 220px; gap: 10px; padding: 14px; border-bottom: 1px solid #e0e4ea; }
.table-toolbar input, .table-toolbar select { border: 1px solid #cfd5df; border-radius: 6px; padding: 10px; background: white; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 13px 15px; border-bottom: 1px solid #e8ebef; text-align: left; white-space: nowrap; }
.admin-table th { color: var(--muted); font-size: .74rem; text-transform: uppercase; }
.admin-table td:first-child { white-space: normal; }
.admin-table td small { display: block; color: var(--muted); }
.status { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: .74rem; font-weight: 750; }
.status-not_accessed { background: #edf0f4; color: #545d6d; }
.status-started { background: #fff0c8; color: #785612; }
.status-completed { background: #dbf1e7; color: #176247; }
.status-expired { background: #f5dfdc; color: #8d302b; }
.empty-state { padding: 35px !important; color: var(--muted); text-align: center !important; }
.narrow-panel { width: min(620px, 100%); }
.narrow-panel h1 { margin-bottom: 8px; font-family: inherit; font-size: 1.8rem; }
.narrow-panel > p { color: var(--muted); }
.narrow-panel form p label { display: block; margin-bottom: 6px; font-weight: 700; }
.narrow-panel .helptext, .narrow-panel form ul { color: var(--muted); font-size: .8rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 18px; }
.detail-main { padding: 22px; }
.review-panel { position: sticky; top: 20px; padding: 22px; }
.metadata-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metadata-strip span { display: block; color: var(--muted); font-size: .72rem; }
.metadata-strip strong { font-size: .86rem; }
.link-box { margin: 15px 0 25px; border: 1px solid #bfd3e0; background: #f2f8fb; padding: 14px; }
.link-box label { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 750; }
.link-box > div { display: flex; gap: 8px; }
.link-box input { min-width: 0; flex: 1; border: 1px solid #bdc9d2; border-radius: 6px; padding: 9px; background: white; }
.content-title { margin: 24px 0 12px; }
.answer-block { border-top: 1px solid #e5e8ec; padding: 16px 0; }
.answer-block h3 { margin: 0 0 7px; font-size: .88rem; }
.answer-block div { color: #3d4554; white-space: normal; }
.back-link { display: inline-block; margin-bottom: 7px; color: var(--muted); text-decoration: none; }
.login-body { background: #e9edf1; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 25px; }
.login-panel { width: min(430px, 100%); }
.login-panel h1 { margin: 12px 0 8px; font-family: inherit; font-size: 1.75rem; }
.login-panel > p:not(.section-kicker) { margin-bottom: 25px; color: var(--muted); }

@media (max-width: 850px) {
  .entry-shell { grid-template-columns: 1fr; gap: 30px; padding: 35px 0; }
  .test-shell { grid-template-columns: 1fr; }
  .step-nav { position: static; display: flex; overflow-x: auto; padding-bottom: 5px; }
  .step-nav .candidate-name, .save-status { display: none; }
  .step-link { width: auto; flex: 0 0 auto; }
  .step-link { font-size: 0; }
  .step-link span { font-size: .76rem; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .review-panel { position: static; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .entry-form-panel, .test-step, .detail-main, .review-panel { padding: 20px; }
  .test-header-inner { min-height: 62px; }
  .classification-row, .two-columns, .validation-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .step-heading { display: block; }
  .step-heading small { display: inline-block; margin-top: 10px; }
  .test-actions { position: sticky; bottom: 0; background: var(--canvas); padding: 10px 0; }
  .panel-header { padding: 10px 16px; }
  .panel-header nav > a:not(.button) { display: none; }
  .panel-brand strong { display: none; }
  .page-heading { align-items: start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .table-toolbar, .metadata-strip { grid-template-columns: 1fr; }
  .link-box > div { display: grid; }
}
