/* Protryx: Precision in Assessment. Design tokens and components (see DESIGN_SYSTEM.md). */

/* Fonts are self-hosted (SIL Open Font License; licences in /fonts). */
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* Brand palette */
  --px-navy: #142B50;      /* primary, structure */
  --px-blue: #2459B3;      /* actions, links, focus */
  --px-red: #C82035;       /* signal: deadlines, violations, destructive. Use sparingly. */
  --px-ink: #101B2D;       /* body text */
  --px-surface: #F7F8FA;   /* page background */
  --px-white: #FFFFFF;
  --px-slate: #526079;     /* secondary text (6.0:1 on surface) */
  --px-line: #DCE2EA;      /* borders, dividers */
  --px-control-line: #7F8A9D; /* edges of inputs, answer choices and the progress rail: 3.5:1 on white (WCAG 1.4.11) */
  --px-blue-tint: #EAF0FA;
  --px-red-tint: #FCECEF;
  /* Supporting states (not brand colours; always paired with text or a symbol) */
  --px-green: #1E7148;
  --px-green-tint: #E6F3EC;
  --px-amber: #8F5300;
  --px-amber-tint: #FBF0DD;
  --px-navy-2: #1C3864;
  --px-blue-dark: #1C478F;
  --px-red-dark: #A01A2B;

  /* Older names used by page scripts, mapped to the Protryx palette */
  --blue-900: var(--px-navy);
  --blue-800: var(--px-navy);
  --blue-700: var(--px-blue);
  --blue-600: var(--px-blue);
  --blue-100: #CFDCF2;
  --blue-50: var(--px-blue-tint);
  --red-700: var(--px-red-dark);
  --red-600: var(--px-red);
  --red-500: var(--px-red);
  --red-50: var(--px-red-tint);
  --white: var(--px-white);
  --ink: var(--px-ink);
  --muted: var(--px-slate);
  --line: var(--px-line);
  --surface: var(--px-surface);
  --green-600: var(--px-green);
  --green-50: var(--px-green-tint);
  --amber-600: var(--px-amber);
  --amber-50: var(--px-amber-tint);

  --radius: 8px;
  --radius-lg: 10px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(16, 27, 45, .06);
  --shadow-lg: 0 10px 30px rgba(16, 27, 45, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --focus: 0 0 0 3px rgba(36, 89, 179, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  overflow-wrap: break-word;
}
a { color: var(--px-blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--px-blue-dark); }
.topnav a, .btn, .brand, .tabs a, .side-nav a { text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; color: var(--px-navy); font-family: var(--font-display); font-weight: 750; }
h1 { font-size: 2rem; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; letter-spacing: -.01em; }
h3, .h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono, code, kbd { font-family: var(--font-mono); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 400; background: var(--px-navy); color: #fff; padding: .6rem .9rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
.eyebrow { font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--px-slate); }

/* ---------- top bar ---------- */
.topbar { background: var(--px-white); color: var(--px-navy); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar .container { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--px-navy); font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.brand:hover { color: var(--px-navy); }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 30px; height: 30px; display: block; }
.brand .wordmark b { color: var(--px-red); font-weight: 800; }
.brand .product { font-family: var(--font); font-weight: 600; font-size: .82rem; color: var(--px-slate); border-left: 1px solid var(--line); padding-left: .6rem; margin-left: .1rem; letter-spacing: 0; }
.topnav { display: flex; gap: .2rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topnav a, .topnav button.linklike { color: var(--px-navy); padding: .45rem .7rem; border-radius: var(--radius-sm); font-weight: 550; font-size: .92rem; }
.topnav a:hover, .topnav button.linklike:hover { background: var(--px-blue-tint); color: var(--px-navy); }
.topnav a.btn { color: #fff; }
.userchip { display: flex; align-items: center; gap: .5rem; color: var(--px-navy); font-size: .9rem; padding: 0 .3rem; }
.avatar { width: 32px; height: 32px; border-radius: 6px; background: var(--px-navy); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; font-family: var(--font-mono); }
.role-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--px-slate); font-family: var(--font-mono); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; font-size: .93rem; line-height: 1.1;
  min-height: 40px; padding: .6rem 1.05rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; background: var(--px-navy); color: var(--white); transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--px-navy-2); color: #fff; }
:focus-visible { outline: 2px solid var(--px-blue); outline-offset: 2px; }
.btn.red { background: var(--px-blue); }               /* primary action */
.btn.red:hover { background: var(--px-blue-dark); }
.btn.ghost, .btn.outline, .btn.light { background: var(--white); color: var(--px-navy); border-color: #C5CEDB; }
.btn.ghost:hover, .btn.outline:hover, .btn.light:hover { background: var(--px-blue-tint); border-color: var(--px-blue); color: var(--px-navy); }
.btn.danger-ghost, .btn.outline.danger { background: var(--white); color: var(--px-red); border-color: #EBB7BE; }
.btn.danger-ghost:hover, .btn.outline.danger:hover { background: var(--red-50); color: var(--px-red-dark); }
.btn.danger { background: var(--px-red); color: #fff; }
.btn.sm { min-height: 32px; padding: .38rem .7rem; font-size: .84rem; }
.btn.lg { min-height: 46px; padding: .8rem 1.35rem; font-size: 1rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
button.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--px-blue); padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.topnav button.linklike { text-decoration: none; }

/* ---------- cards & layout ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page { padding: 28px 0 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.65rem; }
.page-head p { margin: .25rem 0 0; }

.stat { padding: 1rem 1.15rem; position: relative; }
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; background: var(--px-blue); border-radius: 0 2px 2px 0; }
.stat.red::before { background: var(--px-red); }
.stat .label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 500; font-family: var(--font-mono); }
.stat .value { font-size: 1.85rem; font-weight: 750; color: var(--px-navy); line-height: 1.1; margin-top: .25rem; font-family: var(--font-display); font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
label, .field-title { display: block; font-weight: 600; font-size: .88rem; color: var(--px-navy); margin-bottom: .35rem; }
.field { margin-bottom: 1rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--white); min-height: 42px;
  border: 1px solid var(--px-control-line); border-radius: var(--radius-sm); padding: .55rem .75rem;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--px-blue); box-shadow: var(--focus); outline: none; }
input[aria-invalid=true] { border-color: var(--px-red); }
/* Show / hide password (eye button added by core.js). */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.8rem; }
.pw-wrap input::-ms-reveal, .pw-wrap input::-ms-clear { display: none; }
.pw-eye { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--px-slate); cursor: pointer; }
.pw-eye:hover { color: var(--px-blue); background: rgba(36, 89, 179, .08); }
.pw-eye:focus-visible { outline: none; box-shadow: var(--focus); }
textarea { min-height: 96px; resize: vertical; }
.code-input { font-family: var(--font-mono); font-size: 1.35rem !important; letter-spacing: .25em; text-align: center; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; color: var(--ink); cursor: pointer; margin: 0; }
.check input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--px-blue); flex: none; }
.form-error { background: var(--red-50); color: var(--px-red-dark); border: 1px solid #EBB7BE; border-left: 3px solid var(--px-red); padding: .65rem .8rem; border-radius: var(--radius-sm); font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem .2rem; margin: 0 0 1.2rem; }
legend { font-weight: 700; color: var(--px-navy); padding: 0 .4rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #F1F4F8; color: var(--px-navy); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; white-space: nowrap; font-family: var(--font-mono); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFBFD; }
td .row { flex-wrap: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 2.2rem 1rem; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .5rem; border-radius: var(--radius-sm);
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; font-family: var(--font-mono);
  background: var(--blue-50); color: var(--px-blue-dark); border: 1px solid #CFDCF2;
}
.badge.red { background: var(--red-50); color: var(--px-red-dark); border-color: #EBB7BE; }
.badge.green { background: var(--green-50); color: var(--px-green); border-color: #BFDCCB; }
.badge.amber { background: var(--amber-50); color: var(--px-amber); border-color: #E8CF9F; }
.badge.gray { background: #EEF1F5; color: #445067; border-color: var(--line); }
.badge.solid-red { background: var(--px-red); color: var(--white); border-color: var(--px-red); }
.badge.solid-blue { background: var(--px-navy); color: var(--white); border-color: var(--px-navy); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs a, .tabs button { padding: .7rem 1rem; color: var(--muted); border: 0; background: none; font: inherit; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--px-navy); }
.tabs .active { color: var(--px-navy); border-bottom-color: var(--px-blue); }

/* ---------- toast & modal ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--px-ink); color: var(--white); padding: .8rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .92rem; border-left: 3px solid #8FB0E6; }
.toast.error { border-left-color: #F08A97; }
.toast.success { border-left-color: #7BC89E; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 27, 45, .55); z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow: auto; padding: 1.5rem; border-top: 3px solid var(--px-navy); }
.modal.warn { border-top-color: var(--px-red); }
.modal h3 { margin-bottom: .6rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.3rem; flex-wrap: wrap; }

/* ---------- X motif: two crossing hairlines, used as a structural accent only ---------- */
.x-motif { position: absolute; pointer-events: none; color: var(--px-line); }
.x-motif svg { display: block; width: 100%; height: 100%; }

/* ---------- landing (Protryx product page) ---------- */
.hero { background: var(--px-navy); color: var(--white); position: relative; overflow: hidden; border-bottom: 3px solid var(--px-red); }
.hero .container { padding-top: 76px; padding-bottom: 84px; position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero h1 { color: var(--white); font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em; margin-bottom: 1.1rem; }
.hero h1 span { display: block; }
.hero h1 span:nth-child(3) { color: #F2A2AC; }
.hero p.lead { font-size: 1.1rem; color: #CBD6EA; max-width: 560px; margin-bottom: 1.8rem; }
.hero .eyebrow { color: #9DB2D6; margin-bottom: 1rem; display: block; }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.08); border-color: #fff; }
.hero .x-motif { color: rgba(255, 255, 255, .07); right: -80px; top: -60px; width: 560px; height: 560px; }
.hero-panel { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-lg); padding: 1.25rem; font-size: .9rem; color: #DCE4F2; }
.hero-panel h2 { color: #fff; font-size: 1rem; margin-bottom: .8rem; }
.hero-panel ol { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.hero-panel li { counter-increment: s; display: grid; grid-template-columns: 2.2rem 1fr; gap: .4rem; padding: .6rem 0; border-top: 1px solid rgba(255,255,255,.1); }
.hero-panel li::before { content: counter(s, decimal-leading-zero); font-family: var(--font-mono); color: #F2A2AC; font-size: .8rem; padding-top: .1rem; }
.hero-panel li strong { color: #fff; display: block; font-weight: 600; }
.door-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: -40px; position: relative; z-index: 2; }
.door { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: .4rem; }
.door h2 { font-size: 1.15rem; margin: 0; }
.door p { color: var(--muted); flex: 1; margin-bottom: .8rem; }
.door .btn { align-self: flex-start; }
.section { padding: 64px 0; }
.section.alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { max-width: 720px; margin-bottom: 2rem; }
.section-title p { color: var(--muted); }
.feature-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.feature { padding: 1.3rem 1.3rem 1.3rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 2.4rem 1fr; gap: .2rem .6rem; }
.feature .icon { font-family: var(--font-mono); font-size: .78rem; color: var(--px-red); padding-top: .2rem; }
.feature h3 { margin: 0 0 .2rem; font-size: 1rem; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; grid-column: 2; }
.workspaces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.workspace { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 1.2rem; }
.workspace .eyebrow { display: block; margin-bottom: .3rem; }
.workspace h3 { margin-bottom: .35rem; }
.workspace p { color: var(--muted); margin: 0; font-size: .92rem; }
footer.site { background: var(--px-ink); color: #B6C1D3; padding: 28px 0; font-size: .88rem; }
/* Pages with the site footer fill at least the whole window, so the footer stays at the bottom on short pages. */
body:has(> footer.site) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body:has(> footer.site) > main { flex: 1 0 auto; width: 100%; }
body:has(> footer.site) > footer.site { flex-shrink: 0; }
footer.site a { color: var(--white); }
footer.site .row { justify-content: space-between; }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 61px); display: grid; place-items: center; padding: 32px 16px; position: relative; overflow: hidden; }
.auth-card { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.auth-card .card { padding: 1.8rem; border-top: 3px solid var(--px-navy); }
.auth-title { font-size: 1.45rem; margin-bottom: .25rem; }
.role-switch { display: grid; grid-template-columns: repeat(3, 1fr); background: #EEF1F5; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; margin: 1rem 0 1.4rem; gap: 3px; }
.role-switch.two { grid-template-columns: repeat(2, 1fr); }
.role-switch button { border: 0; background: none; min-height: 40px; padding: .5rem .3rem; border-radius: 3px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--px-navy); cursor: pointer; }
.role-switch button:hover { background: rgba(255,255,255,.7); }
.role-switch button.active { background: var(--white); color: var(--px-navy); box-shadow: 0 1px 2px rgba(16,27,45,.12), inset 0 -2px 0 var(--px-blue); }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1.5rem; padding: 1rem 1rem 1rem 2.6rem; background: var(--surface); border: 1px dashed #B9C4D4; border-radius: var(--radius-sm); margin: 0 0 1rem; font-size: 1rem; }
.qr-box { display: inline-block; padding: .5rem; background: #fff; border: 1px solid var(--px-line); border-radius: var(--radius-sm); margin: .25rem 0 .75rem; line-height: 0; }
.qr-box svg { display: block; width: 200px; height: 200px; }
.secret-key { background: var(--surface); border: 1px solid var(--line); padding: .1rem .4rem; border-radius: var(--radius-sm); letter-spacing: .08em; word-break: break-all; }
ol.steps { padding-left: 1.3rem; }
ol.steps li { margin-bottom: .6rem; }

/* ---------- legal pages ---------- */
.legal h2 { margin-top: 1.8rem; font-size: 1.15rem; padding-left: .7rem; border-left: 3px solid var(--px-navy); }
.legal li { margin-bottom: .4rem; }
.notice { background: var(--blue-50); border: 1px solid #CFDCF2; border-left: 3px solid var(--px-blue); padding: .9rem 1rem; border-radius: var(--radius-sm); }
.notice.red { background: var(--red-50); border-color: #EBB7BE; border-left-color: var(--px-red); }

/* ---------- exam cards (candidate) ---------- */
.exam-card { display: flex; flex-direction: column; gap: .6rem; border-top: 3px solid var(--px-navy); }
.exam-card.live { border-top-color: var(--px-red); }
.exam-card .meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--muted); font-size: .85rem; }
.exam-card .actions { margin-top: auto; padding-top: .6rem; }

/* ---------- exam builder ---------- */
.q-editor { border: 1px solid var(--line); border-left: 3px solid var(--px-navy); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--white); margin-bottom: 1rem; }
.q-editor .q-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.q-editor .q-num { background: var(--px-navy); color: var(--white); font-weight: 600; border-radius: var(--radius-sm); padding: .15rem .55rem; font-size: .82rem; font-family: var(--font-mono); }
.opt-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.opt-row input[type=text] { flex: 1; }
.opt-row .correct-toggle { display: flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--green-600); margin: 0; white-space: nowrap; }
.opt-row .correct-toggle input { accent-color: var(--green-600); width: 16px; height: 16px; }
.icon-btn { border: 1px solid var(--line); background: var(--white); color: var(--muted); border-radius: var(--radius-sm); width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; flex: none; font-size: 1rem; line-height: 1; }
.icon-btn:hover { color: var(--px-red); border-color: #EBB7BE; background: var(--red-50); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(247, 248, 250, .96); padding: .9rem 0; border-top: 1px solid var(--line); display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; z-index: 5; }

/* ---------- risk & integrity review ---------- */
.risk-meter { height: 8px; background: #E4E9F0; border-radius: 2px; overflow: hidden; }
.risk-meter > span { display: block; height: 100%; background: var(--green-600); }
.risk-meter.medium > span { background: var(--amber-600); }
.risk-meter.high > span { background: var(--red-600); }
.flag { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.flag:last-child { border-bottom: 0; }
.flag .pts { font-weight: 600; color: var(--red-600); min-width: 40px; font-family: var(--font-mono); }
.timeline { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow: auto; font-size: .86rem; }
.timeline li { display: flex; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid #EEF1F5; flex-wrap: wrap; align-items: baseline; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 72px; font-family: var(--font-mono); font-size: .8rem; }
.review-controls { display: flex; gap: .35rem; flex-wrap: wrap; margin-left: auto; }
.review-state { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.answer-review { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .8rem; background: var(--white); }
.answer-review.right { border-left: 3px solid var(--green-600); }
.answer-review.wrong { border-left: 3px solid var(--red-600); }
.answer-review.pending { border-left: 3px solid var(--amber-600); }
.answer-review .opt { padding: .3rem .55rem; border-radius: var(--radius-sm); margin: .2rem 0; }
.answer-review .opt.correct { background: var(--green-50); color: var(--green-600); font-weight: 600; }
.answer-review .opt.chosen-wrong { background: var(--red-50); color: var(--red-700); font-weight: 600; text-decoration: line-through; }
.answer-review pre, .pre { white-space: pre-wrap; word-break: break-word; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem; font: inherit; margin: .4rem 0; }

/* ---------- Protryx Focus: the candidate exam workspace ---------- */
body.exam-mode { user-select: none; -webkit-user-select: none; background: var(--surface); }
body.exam-mode textarea, body.exam-mode input[type=text] { user-select: text; -webkit-user-select: text; }
.exam-bar { background: var(--white); color: var(--px-navy); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.exam-bar .container { display: flex; align-items: center; gap: 1rem; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; max-width: 1600px; }
.exam-bar .title { font-weight: 700; font-size: 1rem; font-family: var(--font-display); }
.exam-bar .focus-label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--px-slate); }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-weight: 600; font-size: 1.2rem; background: var(--px-navy); color: var(--white); border-radius: var(--radius-sm); padding: .35rem .8rem; min-width: 110px; text-align: center; }
/* Low time: a calm, steady change of colour and a word, never flashing. */
.timer.low { background: var(--px-red); color: var(--white); }
.timer.low::before { content: "Ending "; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; vertical-align: 2px; margin-right: .2rem; }
.proctor-pill { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; background: var(--px-green-tint); color: var(--px-green); padding: .3rem .65rem; border-radius: var(--radius-sm); border: 1px solid #BFDCCB; }
.proctor-pill .dot { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.proctor-pill.alert { background: var(--red-50); color: var(--px-red-dark); border-color: #EBB7BE; }
.conn-state { font-size: .8rem; font-weight: 600; color: var(--px-green); display: inline-flex; gap: .35rem; align-items: center; }
.conn-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.conn-state.offline { color: var(--px-red-dark); }
.exam-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 1.2rem; padding: 22px 0 40px; }
.exam-layout > .rail { order: -1; }
.question-card { min-height: 380px; display: flex; flex-direction: column; }
.question-card .q-text { font-size: 1.08rem; font-weight: 500; color: var(--ink); white-space: pre-wrap; margin-bottom: 1.2rem; line-height: 1.6; }
.choice { display: flex; gap: .8rem; align-items: center; border: 1px solid var(--px-control-line); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .55rem; cursor: pointer; background: var(--white); transition: border-color .1s, background .1s; font-weight: 500; min-height: 48px; }
.choice:hover { border-color: var(--px-blue); background: #FAFBFE; }
.choice.selected { border-color: var(--px-blue); background: var(--blue-50); box-shadow: inset 3px 0 0 var(--px-blue); }
.choice input { width: 18px; height: 18px; accent-color: var(--px-blue); flex: none; }
.choice .letter { width: 28px; height: 28px; border-radius: var(--radius-sm); background: #EEF1F5; color: var(--px-navy); display: grid; place-items: center; font-weight: 600; font-size: .82rem; flex: none; font-family: var(--font-mono); }
.choice.selected .letter { background: var(--px-blue); color: var(--white); }
.q-nav { margin-top: auto; padding-top: 1.2rem; display: flex; gap: .6rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
/* Question palette / progress rail. Status is shown by shape and text as well as colour. */
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.palette button { aspect-ratio: 1; min-height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--px-control-line); background: var(--white); font: inherit; font-family: var(--font-mono); font-weight: 600; font-size: .85rem; color: var(--px-slate); cursor: pointer; position: relative; }
.palette button:hover { border-color: var(--px-blue); }
.palette button.answered { background: var(--px-navy); border-color: var(--px-navy); color: var(--white); }
.palette button.answered::before { content: ""; position: absolute; left: 4px; bottom: 4px; width: 5px; height: 5px; background: #fff; border-radius: 1px; }
.palette button.flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 0; height: 0; border-top: 9px solid var(--px-red); border-left: 9px solid transparent; }
.palette button.current { outline: 2px solid var(--px-blue); outline-offset: 2px; }
.legend { display: grid; gap: .35rem; font-size: .8rem; color: var(--muted); margin-top: .9rem; }
.legend span { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -2px; margin-right: .4rem; border: 1px solid #C5CEDB; }
.rail-progress { height: 6px; background: #E4E9F0; border-radius: 2px; overflow: hidden; margin: .5rem 0 .3rem; }
.rail-progress > span { display: block; height: 100%; background: var(--px-navy); }
.save-state { font-size: .8rem; color: var(--muted); }
.exam-watermark { position: fixed; inset: 0; z-index: 200; pointer-events: none; background-repeat: repeat; }
@media print { .exam-watermark { display: none; } }
.lock-screen { position: fixed; inset: 0; z-index: 250; background: rgba(16, 27, 45, .94); color: var(--white); display: grid; place-items: center; padding: 20px; text-align: center; }
.lock-screen .box { max-width: 520px; }
.lock-screen h2 { color: var(--white); font-size: 1.5rem; }
.lock-screen .count { display: inline-block; background: var(--px-red); border-radius: var(--radius-sm); padding: .3rem .9rem; font-weight: 600; margin-bottom: 1rem; font-family: var(--font-mono); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid #EEF1F5; align-items: center; }
.checklist .ok { color: var(--green-600); font-weight: 700; }
.checklist .bad { color: var(--red-600); font-weight: 700; }
.score-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: conic-gradient(var(--px-navy) calc(var(--p) * 1%), #E4E9F0 0); }
.score-ring > div { width: 120px; height: 120px; border-radius: 50%; background: var(--white); display: grid; place-items: center; font-size: 1.6rem; font-weight: 750; color: var(--px-navy); font-family: var(--font-display); }
.rail-toggle { display: none; }

/* ---------- Protryx Command / Control: staff workspace shell ---------- */
.console-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 61px); }
.side-nav { background: var(--px-ink); color: #C9D3E3; padding: 1.1rem .75rem; position: sticky; top: 61px; height: calc(100vh - 61px); overflow-y: auto; }
.side-nav .ws-name { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: #8FA2C2; padding: .2rem .6rem 1rem; display: block; }
.side-nav .ws-name strong { display: block; color: #fff; font-family: var(--font-display); font-size: 1rem; letter-spacing: 0; text-transform: none; margin-top: .15rem; }
.side-nav .group { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: #7186A8; padding: 1rem .6rem .35rem; }
.side-nav a { display: flex; align-items: center; gap: .55rem; color: #D5DDEA; padding: .5rem .6rem; border-radius: var(--radius-sm); font-weight: 500; font-size: .92rem; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 2px 0 0 #F2A2AC; }
.console-main { min-width: 0; padding: 0 0 48px; }
.console-main .container { max-width: 1320px; }
.nav-toggle { display: none; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--font-mono); font-size: .86rem; }

@media (max-width: 1180px) {
  .exam-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .exam-layout > .rail { order: 0; grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 960px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .feature-list, .workspaces { grid-template-columns: 1fr; }
  .hero .container { grid-template-columns: 1fr; gap: 2rem; padding-top: 56px; padding-bottom: 72px; }
  .exam-layout { grid-template-columns: 1fr; }
  .exam-layout > .rail { grid-column: auto; grid-row: auto; order: 0; }
  .console-shell { grid-template-columns: 1fr; }
  .side-nav { position: fixed; top: 61px; left: 0; bottom: 0; height: auto; width: min(280px, 85vw); z-index: 60; transform: translateX(-100%); visibility: hidden; transition: transform .15s, visibility .15s; }
  .side-nav.open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-4, .door-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .topnav .hide-sm, .brand .product { display: none; }
  .topbar .container { flex-wrap: wrap; gap: .2rem .6rem; padding-top: .35rem; padding-bottom: .35rem; min-height: 56px; }
  .topnav { gap: 0; flex-wrap: wrap; justify-content: flex-end; }
  .topnav a, .topnav button.linklike { padding: .4rem .45rem; font-size: .86rem; }
  .userchip { padding: 0 .2rem; }
  h1 { font-size: 1.55rem; }
  .timer { font-size: 1.05rem; min-width: 92px; }
  .recovery-codes { grid-template-columns: 1fr; }
  .door-grid { margin-top: -28px; }
  .exam-bar .container { gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  body.exam-mode * { display: none !important; }
}

/* ---------- Google button, alerts, rooms, chat, labs ---------- */
.divider-text { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .85rem; margin: 1rem 0 .4rem; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.bell { position: relative; }
.bell-count { display: inline-block; min-width: 1.3em; margin-left: .3rem; padding: 0 .35em; border-radius: var(--radius-sm); background: var(--px-red); color: #fff; font-size: .72rem; font-weight: 600; text-align: center; font-family: var(--font-mono); }
.alert-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.alert-item { padding: .7rem .2rem; border-bottom: 1px solid var(--line); display: grid; gap: .2rem; }
.alert-item.unread { background: var(--blue-50); padding-left: .6rem; border-left: 3px solid var(--px-blue); }
.room-code { font-family: var(--font-mono); font-weight: 600; letter-spacing: .18em; color: var(--px-navy); background: var(--blue-50); border: 1px dashed var(--px-blue); border-radius: var(--radius-sm); padding: .35rem .6rem; display: inline-block; }
.room-code.big { font-size: 1.6rem; margin-bottom: .6rem; }
.room-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: 1.2rem; }
@media (max-width: 900px) { .room-grid { grid-template-columns: 1fr; } }
.chat { display: flex; flex-direction: column; gap: .6rem; }
.chat-log { height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; background: var(--surface); display: flex; flex-direction: column; gap: .5rem; }
.chat-msg { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .6rem; max-width: 92%; overflow-wrap: anywhere; }
.chat-msg.mine { align-self: flex-end; border-color: #CFDCF2; background: var(--blue-50); }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; resize: vertical; }
.chat-note { padding: .4rem .6rem; background: var(--amber-50); border-radius: var(--radius-sm); }
.code-editor, pre.code { font-family: var(--font-mono); font-size: .88rem; line-height: 1.5; tab-size: 2; }
textarea.code-editor { width: 100%; min-height: 300px; white-space: pre; overflow: auto; background: var(--px-ink); color: #E6EDF8; border-radius: var(--radius-sm); padding: .7rem; }
.builder textarea.code-editor, .test-row textarea.code-editor { min-height: 70px; }
pre.code { white-space: pre-wrap; margin: .2rem 0 .5rem; }
.run-output { margin-top: .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem; background: var(--white); }
.run-output .test { border-left: 3px solid var(--line); padding: .3rem .6rem; margin-top: .5rem; }
.run-output .test.pass, .test-list .pass { border-color: var(--green-600); color: var(--green-600); }
.run-output .test.fail, .test-list .fail { border-color: var(--red-600); color: var(--red-600); }
.test-list { margin: .3rem 0; padding-left: 1.1rem; font-size: .9rem; }
.test-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: start; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem; margin-bottom: .5rem; }
@media (max-width: 700px) { .test-row { grid-template-columns: 1fr; } }
.card.release { border-left: 3px solid var(--amber-600); }
.card.release.on { border-left-color: var(--green-600); }

/* ---------- TRACE (coding-process report) ---------- */
.trace-card { margin-top: .8rem; padding: .8rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--px-blue); border-radius: var(--radius-sm); background: var(--blue-50); }
.trace-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem 1rem; margin: .7rem 0; }
.trace-reasons { margin: .3rem 0 0; padding-left: 0; list-style: none; }
.trace-reasons li { margin: .25rem 0; }
.trace-reasons .pts { display: inline-block; min-width: 2.4rem; font-weight: 600; color: var(--red-600); font-family: var(--font-mono); }
.trace-doc { max-height: 360px; overflow: auto; background: var(--white); }
.trace-caret { display: inline-block; width: 2px; height: 1.1em; margin: 0 -1px; vertical-align: text-bottom; background: var(--red-600); }

/* Camera monitoring: preview before the exam, then a small floating box during it. */
.cam-setup { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.cam-box { position: relative; width: 220px; border-radius: var(--radius); overflow: hidden; background: var(--px-ink); }
.cam-box video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transform: scaleX(-1); }
.cam-box .cam-status { font-size: .78rem; font-weight: 600; padding: .3rem .6rem; color: #fff; background: #334155; }
.cam-box .cam-status.ok { background: var(--green-600); }
.cam-box .cam-status.warn { background: var(--amber-600); }
.cam-box .cam-status.bad { background: var(--red-600); }
.cam-box.floating { position: fixed; left: 12px; bottom: 12px; width: 150px; z-index: 40; box-shadow: var(--shadow-lg); }
.ok-text { color: var(--green-600); font-weight: 600; }
.snapshots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.snapshots figure { margin: 0; }
.snapshots img { width: 100%; border-radius: var(--radius-sm); display: block; }
.snapshots figcaption { font-size: .75rem; color: var(--muted); margin-top: .2rem; }
@media (max-width: 600px) { .cam-box.floating { width: 96px; left: 8px; bottom: 8px; } }
