:root {
  --ink: #1c2733;
  --ink-soft: #52606d;
  --paper: #f5f7f6;
  --surface: #ffffff;
  --line: #d3dbd8;
  --teal: #0e6b63;
  --teal-soft: #e3f1ef;
  --amber: #a35a07;
  --amber-soft: #fbf0df;
  --red: #b3261e;
  --red-soft: #fbe7e5;
  --green: #2f7d3c;
  --green-soft: #e6f3e8;
  --radius: 6px;
  --font: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e4ebe9; --ink-soft: #a2b0ad; --paper: #131a1f; --surface: #1b242b; --line: #33414a;
    --teal: #4fb8ad; --teal-soft: #173431; --amber: #e2a04f; --amber-soft: #3a2a14;
    --red: #f08a82; --red-soft: #3d1c1a; --green: #79c487; --green-soft: #1a3320;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.55; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .4rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .4rem; }
p { max-width: 68ch; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.5rem;
  border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.topbar nav { display: flex; gap: 1.25rem; }
.topbar nav a { text-decoration: none; }

.page { max-width: 1040px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.narrow { max-width: 560px; margin: 0 auto; padding: 3rem 1.5rem; }

.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border-left: 4px solid; }
.flash-success { background: var(--green-soft); border-color: var(--green); }
.flash-error { background: var(--red-soft); border-color: var(--red); }
.flash-info { background: var(--amber-soft); border-color: var(--amber); }

/* forms */
label { display: block; font-weight: 700; margin: 1rem 0 .3rem; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .88rem; }
input[type=text], input[type=email], input[type=password], textarea, input[type=file] {
  width: 100%; padding: .6rem .7rem; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
textarea { min-height: 8rem; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
.or { margin: .6rem 0 0; color: var(--ink-soft); font-size: .88rem; }

.btn { display: inline-block; font: inherit; font-weight: 700; padding: .6rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--teal); background: var(--teal); color: var(--surface); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--teal); }
.btn-danger { background: var(--red); border-color: var(--red); }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; align-items: center; }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--ink-soft); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }

.tag { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 700;
  background: var(--paper); border: 1px solid var(--line); white-space: nowrap; }
.tag-good { background: var(--green-soft); border-color: transparent; color: var(--green); }
.tag-bad { background: var(--red-soft); border-color: transparent; color: var(--red); }
.tag-wait { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.tag-live { background: var(--teal-soft); border-color: transparent; color: var(--teal); }
.skills { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }

/* the screening meter: score bar with the threshold marked */
.meter { margin: 1.5rem 0 2rem; max-width: 640px; }
.meter-score { font-size: 3.2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.meter-track { position: relative; height: 14px; background: var(--line); border-radius: 7px; margin-top: 1rem; }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: var(--amber); }
.meter.pass .meter-fill { background: var(--teal); }
.meter-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); }
.meter-mark span { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); font-size: .8rem;
  white-space: nowrap; color: var(--ink-soft); }
.meter-caption { margin-top: 2rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1rem 0; }
.linkbox { display: flex; gap: .5rem; }
.linkbox input { font-family: var(--mono); font-size: .85rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; }
details { margin: .5rem 0; }
summary { cursor: pointer; font-weight: 700; }
pre, code { font-family: var(--mono); font-size: .86rem; }
pre { background: var(--paper); border: 1px solid var(--line); padding: .75rem; border-radius: var(--radius);
  white-space: pre-wrap; overflow-x: auto; }
.correct { color: var(--green); font-weight: 700; }

/* candidate test */
.test-body { user-select: none; -webkit-user-select: none; }
.test-body textarea, .test-body input { user-select: text; -webkit-user-select: text; }
.testbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.timer { font-family: var(--mono); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--red); }
.test { max-width: 820px; margin: 0 auto; padding: 1.5rem 1.5rem 5rem; }
.section-head { margin: 2.5rem 0 .25rem; padding-bottom: .4rem; border-bottom: 2px solid var(--ink); display: flex;
  justify-content: space-between; align-items: baseline; }
.section-head h2 { margin: 0; }
.question { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.q-num { color: var(--ink-soft); font-weight: 700; margin-right: .35rem; }
.q-marks { float: right; color: var(--ink-soft); font-size: .85rem; }
.option { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: .35rem 0; padding: .5rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.option:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.option input { margin-top: .3rem; }
textarea.code { font-family: var(--mono); font-size: .9rem; min-height: 16rem; tab-size: 4; line-height: 1.5; }
.save-state { font-size: .85rem; color: var(--ink-soft); }

.gate { position: fixed; inset: 0; z-index: 50; background: var(--paper); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.gate[hidden] { display: none; }
.gate-inner { max-width: 520px; }
.warning-banner { background: var(--red-soft); color: var(--red); padding: .6rem 1.5rem; font-weight: 700; }
.rules li { margin: .4rem 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* recruiter marking */
.marking { display: grid; grid-template-columns: 9rem 1fr; gap: 0 1rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--line); }
.marking label { margin-top: 0; }
.marking input[type=number] { width: 100%; padding: .55rem .6rem; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.marking textarea { min-height: 3rem; }
@media (max-width: 640px) { .marking { grid-template-columns: 1fr; } }
.review-panel { border: 2px solid var(--teal); margin-top: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* review */
.result-head { display: flex; gap: 3rem; align-items: flex-end; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.reasons { margin: .4rem 0; padding-left: 1.2rem; }
.panel.flagged { border-color: var(--amber); box-shadow: inset 4px 0 0 var(--amber); }
.auto-grade { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: baseline; }
.auto-grade > div { flex-basis: 100%; }
.marking { display: grid; grid-template-columns: 9rem 1fr; gap: 0 1rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.marking label { margin-top: .4rem; }
.marking textarea { min-height: 2.8rem; }
input[type=number] { width: 100%; padding: .6rem .7rem; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.review-panel { border: 2px solid var(--ink); }
.choices { border: 0; padding: 0; margin: .5rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 640px) { .marking { grid-template-columns: 1fr; } }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }

/* screening review band on the score meter */
.meter-band { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--amber-soft) 0 6px, transparent 6px 12px);
  border-left: 1px dashed var(--amber); border-right: 1px dashed var(--amber); }
.meter-fill { z-index: 1; }
.meter-band { z-index: 0; }
.meter-mark { z-index: 2; }
.meter-mark-soft { background: var(--amber); }
.meter-mark-soft span { top: -22px; }
.meter.in-review .meter-fill { background: var(--amber); }
.meter-track:has(.meter-band) { margin-top: 2rem; }

.topbar nav { align-items: center; }
.who { font-size: .9rem; padding-left: 1rem; border-left: 1px solid var(--line); }
.filters { display: flex; gap: .5rem; align-items: center; margin: .5rem 0 1rem; flex-wrap: wrap; }
.filters select { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); }
select { font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); width: 100%; }
