:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f9fbf9;
  --ink: #17201c;
  --muted: #65716b;
  --line: #dce4de;
  --brand: #126b62;
  --brand-strong: #0a4d47;
  --accent: #315f9f;
  --amber: #a15c12;
  --danger: #b42318;
  --ok: #027a48;
  --shadow: 0 18px 50px rgba(19, 35, 31, .10);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button, .export-card {
  min-height: 40px;
  border: 1px solid transparent;
  background: var(--brand);
  color: white;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}
button:hover, .export-card:hover { background: var(--brand-strong); }
button.secondary { background: #2f3f4a; }
button.ghost {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}
button.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  text-align: left;
}
button.small-button { min-height: 32px; padding: 5px 10px; }
button.wide { width: 100%; }
button:disabled { opacity: .55; cursor: not-allowed; }
input, textarea, select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
label { display: grid; gap: 6px; font-weight: 800; color: #31413b; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; }
h2 { margin-bottom: 4px; font-size: 18px; }
code { white-space: pre-wrap; word-break: break-word; color: #31413b; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.status { min-height: 22px; color: var(--muted); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, 520px);
  background: #edf2ee;
}
.login-visual {
  display: grid;
  align-items: end;
  padding: min(8vw, 72px);
  background:
    linear-gradient(120deg, rgba(18,107,98,.92), rgba(49,95,159,.78)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.18)' stroke-width='2'%3E%3Cpath d='M80 120h640M80 240h640M80 360h640M80 480h640M80 600h640M160 80v640M320 80v640M480 80v640M640 80v640'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: white;
}
.signal-card {
  max-width: 520px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 8px;
  background: rgba(0,0,0,.20);
}
.signal-card strong { display: block; margin: 10px 0; font-size: 34px; line-height: 1.08; }
.signal-card p { margin-bottom: 0; color: rgba(255,255,255,.86); }
.login-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: min(8vw, 72px);
  background: white;
}
.product-mark, .brand-block, .candidate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-mark span, .brand-block span, .candidate-brand span { display: block; color: var(--muted); font-size: 12px; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 16px;
  background: #12201c;
  color: white;
}
.brand-block strong { display: block; font-size: 16px; }
.brand-block span { color: #a9b7b1; }
.nav { display: grid; gap: 6px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  color: #d7e0dc;
  border-color: transparent;
  text-align: left;
}
.nav button.active, .nav button:hover { background: #1f342f; color: white; }
.nav-ico {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,.10);
  font-size: 11px;
  font-weight: 900;
}
.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  color: #d7e0dc;
}
.sidebar-note span { color: #a9b7b1; font-size: 12px; }
.main {
  min-width: 0;
  padding: 22px;
  display: grid;
  gap: 18px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.row-actions, .filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}
.grid { display: grid; gap: 14px; }
.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)); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.metric strong { display: block; font-size: 32px; line-height: 1; }
.metric span { color: var(--muted); font-weight: 800; }
.search-input { width: min(320px, 100%); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1ee;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
th {
  background: #f7faf8;
  font-size: 12px;
  color: #50645b;
  text-transform: uppercase;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
  background: #edf4ff;
  color: var(--accent);
}
.pill.high { background: #fef3f2; color: var(--danger); }
.pill.medium { background: #fff7e8; color: var(--amber); }
.pill.ok { background: #ecfdf3; color: var(--ok); }
.empty-state {
  display: grid;
  gap: 4px;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}
.empty-state strong { color: var(--ink); }
.result-box {
  min-height: 82px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  overflow: auto;
}
.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.export-card {
  display: grid;
  gap: 6px;
  min-height: 110px;
  align-content: center;
  background: white;
  color: var(--ink);
  border-color: var(--line);
}
.export-card:hover { background: #f7faf8; color: var(--ink); }
.export-card span { color: var(--muted); font-weight: 500; }

.candidate-body { background: #f0f5f2; }
.exam-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}
.exam-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  padding: 12px clamp(16px, 4vw, 40px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.timer-box {
  min-width: 132px;
  display: grid;
  justify-items: end;
  gap: 0;
}
.timer-box span { color: var(--muted); font-size: 12px; font-weight: 800; }
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  color: var(--brand);
}
.exam-main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
}
.candidate-welcome {
  min-height: calc(100vh - 122px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .65fr);
  align-items: center;
  gap: clamp(18px, 5vw, 56px);
}
.welcome-copy {
  display: grid;
  gap: 18px;
}
.welcome-copy h1 {
  max-width: 780px;
  font-size: clamp(38px, 7vw, 76px);
  letter-spacing: 0;
}
.welcome-copy p {
  max-width: 720px;
  color: #405049;
  font-size: 18px;
}
.prep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  grid-column: 1;
}
.prep-grid article {
  min-height: 96px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}
.prep-grid strong { font-size: 20px; }
.prep-grid span { color: var(--muted); }
.start-panel {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}
.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: #405049;
}
.notice {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf8;
  color: var(--muted);
}
.consent-line {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
}
.consent-line input { width: auto; min-height: auto; margin-top: 4px; }
.exam-workspace { display: grid; gap: 16px; }
.exam-progress, .submit-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.progress-meter {
  min-width: 130px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--ok);
  font-weight: 900;
}
.question-list { display: grid; gap: 12px; }
.question {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.question-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.question-title span {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #edf4ff;
  color: var(--accent);
  font-weight: 900;
}
.choices { display: grid; gap: 8px; margin-top: 12px; }
.choice {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  cursor: pointer;
}
.choice:hover { border-color: var(--brand); background: #f3faf7; }
.choice input { width: auto; min-height: auto; }
.done-panel {
  width: min(620px, 100%);
  margin: 10vh auto 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  text-align: center;
}

@media (max-width: 980px) {
  .login-page, .app, .candidate-welcome { grid-template-columns: 1fr; }
  .login-visual { min-height: 320px; }
  .sidebar { position: static; height: auto; }
  .metrics, .grid.cols-2, .grid.cols-3, .grid.cols-4, .export-grid, .prep-grid { grid-template-columns: 1fr; }
  .section-head, .topbar, .exam-progress, .submit-bar { align-items: stretch; flex-direction: column; }
  .search-input { width: 100%; }
  th, td { white-space: normal; }
}

@media (max-width: 560px) {
  .main, .exam-main { padding: 14px; }
  .exam-header { align-items: flex-start; }
  .timer-box { min-width: 104px; }
  .timer { font-size: 22px; }
  .welcome-copy h1 { font-size: 38px; }
  .signal-card strong { font-size: 28px; }
}
