:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --brand: #0b4f6c;
  --brand-2: #2c7da0;
  --ok: #1f9d55;
  --warn: #c2410c;
  --line: #d6dee8;
  --exam-panel-height: 620px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: #ffffff;
}

body.exam-page {
  background: #0165ca;
  --exam-panel-height: clamp(520px, calc(100vh - 64px), 760px);
  overflow-x: hidden;
}

body.exam-page .page {
  width: 100%;
  max-width: none;
  padding: 14px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

.topbar {
  background: #0165ca;
  color: #fff;
  padding: 10px 24px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 0;
}

.topbar-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 76px;
  overflow: hidden;
}

.topbar-logo {
  display: block;
  max-height: 64px;
  max-width: 860px;
  object-fit: contain;
  transform: scale(1.75);
  transform-origin: left center;
}

.brand-wrap {
  justify-self: center;
  text-align: center;
}

.brand-main {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-sub {
  font-size: 0.8rem;
  opacity: 0.9;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.top-actions a {
  color: #fff;
  font-size: 0.9rem;
}

.staff-user-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 0 20px;
  text-align: right;
  padding: 0;
  font-weight: 300;
  font-size: 0.6875rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.staff-user-tools strong {
  font-weight: 700;
}

.staff-user-tools a,
.staff-user-tools button {
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-transform: inherit;
  letter-spacing: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.staff-user-tools a:hover,
.staff-user-tools a:focus,
.staff-user-tools button:hover,
.staff-user-tools button:focus {
  color: #c4dce8;
  text-decoration: none;
  border-bottom: 0;
}

.staff-user-tools .sep {
  color: #c4dce8;
  margin: 0 2px;
}

.staff-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.staff-theme-toggle svg {
  vertical-align: middle;
  height: 1rem;
  width: 1rem;
  display: none;
  fill: #fff;
}

html[data-theme="light"] .staff-theme-toggle .theme-icon-when-light {
  display: block;
}

html[data-theme="dark"] .staff-theme-toggle .theme-icon-when-dark {
  display: block;
}

html[data-theme="auto"] .staff-theme-toggle .theme-icon-when-auto {
  display: block;
}

.staff-user-tools .staff-theme-toggle:hover,
.staff-user-tools .staff-theme-toggle:focus,
.staff-user-tools .staff-logout-form button:hover,
.staff-user-tools .staff-logout-form button:focus {
  margin-bottom: 1px;
}

.staff-logout-form {
  display: inline;
  margin: 0;
}

.page {
  padding: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.breadcrumbs {
  margin: -18px calc(50% - 50vw) 12px;
  padding: 10px 40px;
  border: 0;
  border-radius: 0;
  background: #264b5d;
  color: #c4dce8;
  font-size: 0.875rem;
  line-height: 1.2;
  text-align: left;
}

.breadcrumbs a {
  color: #fff;
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus {
  color: #c4dce8;
  text-decoration: none;
}

.breadcrumbs .sep {
  display: inline-block;
  margin: 0 7px;
  color: #c4dce8;
  opacity: 1;
}

body.staff-theme-dark {
  background: #0b1220;
  color: #e2e8f0;
}

body.staff-theme-dark .card {
  background: #101a2e;
  border-color: #334155;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.4);
}

body.staff-theme-dark .table th,
body.staff-theme-dark .table td {
  border-bottom-color: #334155;
  color: #e2e8f0;
}

body.staff-theme-dark input[type="text"],
body.staff-theme-dark input[type="number"],
body.staff-theme-dark input[type="datetime-local"],
body.staff-theme-dark select,
body.staff-theme-dark textarea {
  background: #0b1220;
  color: #e2e8f0;
  border-color: #475569;
}

body.staff-theme-dark .muted {
  color: #94a3b8;
}

body.staff-theme-dark .breadcrumbs {
  background: #1f2937;
  color: #cbd5e1;
}

body.staff-theme-dark .breadcrumbs a,
body.staff-theme-dark .breadcrumbs .sep {
  color: #e2e8f0;
}

@media (max-width: 640px) {
  .breadcrumbs {
    margin-left: -18px;
    margin-right: -18px;
    padding: 10px 16px;
  }
}

.messages {
  margin-bottom: 10px;
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #e2e8f0;
}

.message.error {
  background: #fee2e2;
}

.message.success {
  background: #dcfce7;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.card + .card {
  margin-top: 14px;
}

.card-narrow {
  max-width: 560px;
  margin: 30px auto;
}

.result-card {
  text-align: center;
}

.result-card hr {
  margin: 14px auto;
  max-width: 320px;
}

.candidate-ready-topbar {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: -18px;
  background: #0165ca;
  padding: 10px 24px;
  margin-bottom: 14px;
  border-bottom: 0;
}

.candidate-ready-topbar-inner {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 76px;
}

.candidate-ready-topbar img {
  display: block;
  max-height: 64px;
  max-width: 860px;
  object-fit: contain;
  transform: scale(1.75);
  transform-origin: left center;
}

.candidate-ready-topbar .muted {
  color: #dbeafe;
}

.candidate-step-topbar-inner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 76px;
}

.candidate-step-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.candidate-step-progress-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.candidate-step-progress {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(26px, 1fr) minmax(0, 1fr) minmax(26px, 1fr) minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  column-gap: 10px;
}

.candidate-step-node {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.candidate-step-dot {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #bfdbfe;
  background: rgba(147, 197, 253, 0.35);
  box-sizing: border-box;
}

.candidate-step-label {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 1px;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}

.candidate-step-label span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 700;
}

.candidate-step-connector {
  width: calc(100% + 10px);
  margin-left: -5px;
  height: 6px;
  border-radius: 999px;
  background: rgba(191, 219, 254, 0.4);
}

.candidate-step-node.is-active .candidate-step-dot {
  background: #fff;
  border-color: #fff;
}

.candidate-step-node.is-done .candidate-step-dot {
  background: #fff;
  border-color: #fff;
}

.candidate-step-node.is-done .candidate-step-dot::before {
  content: "\2714";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -53%);
  font-size: 0.82rem;
  line-height: 1;
  color: rgba(1, 101, 202, 0.78);
}

.candidate-step-node.is-done .candidate-step-label span {
  color: #e5f3ff;
}

.candidate-step-connector.is-done {
  background: #fff;
}

.candidate-step-node.is-active .candidate-step-label span {
  color: #fff;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.15);
}

.candidate-step-subtitle {
  color: #dbeafe;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}

.candidate-step-right-spacer {
  min-height: 1px;
}

body.candidate-ready-page {
  overflow-x: hidden;
}

body.candidate-ready-page .page {
  overflow-x: visible;
}

body.candidate-ready-page .candidate-ready-topbar,
body.candidate-ready-page .candidate-ready-topbar-inner {
  overflow-x: hidden;
}

body.candidate-ready-page .candidate-ready-topbar {
  width: auto;
  max-width: none;
  margin-left: -18px;
  margin-right: -18px;
  overflow-x: clip;
  overflow-y: hidden;
  box-sizing: border-box;
}

@media (min-width: 993px) {
  body.candidate-ready-page .candidate-ready-topbar {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
}

body.candidate-ready-page .candidate-ready-topbar-inner {
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

body.candidate-ready-page .candidate-ready-topbar img {
  max-width: 100%;
}

.candidate-ready-card {
  max-width: 1040px;
  margin: 0 auto 30px;
}

.candidate-ready-card h1 {
  text-align: center;
  text-transform: uppercase;
  color: #0165ca;
}

.candidate-step-card {
  max-width: 1040px;
  margin: 0 auto 30px;
}

.candidate-step-card h1 {
  text-align: center;
  text-transform: uppercase;
  color: #0165ca;
}

.candidate-step-text {
  margin-top: 10px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  line-height: 1.4;
}

.candidate-step-actions,
.candidate-ready-step3-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.candidate-step-privacy-form {
  margin-top: 12px;
}

.candidate-step-actions .btn-primary,
.candidate-step-privacy-form .btn-primary {
  background: #0165ca;
  color: #fff;
}

.candidate-step-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.candidate-ready-waiting-alert {
  margin: 14px auto 0;
  width: fit-content;
  max-width: min(760px, 100%);
  padding: 7px 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  line-height: 1.25;
  font-weight: 700;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #0b1f44;
}

.candidate-ready-waiting-alert::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(1, 101, 202, 0.28);
  border-top-color: #0165ca;
  border-right-color: #0165ca;
  box-sizing: border-box;
  animation: candidate-wait-spin 0.9s linear infinite;
}

@keyframes candidate-wait-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.candidate-ready-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.candidate-ready-col h2 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
}

.candidate-ready-fields p,
.candidate-ready-metrics p {
  margin: 6px 0;
}

.candidate-ready-divider {
  margin: 10px 0;
  border-top: 1px solid #cbd5e1;
}

.candidate-ready-instructions {
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  min-height: 92px;
}

.candidate-ready-instruction-text {
  margin: 0;
  line-height: 1.35;
  color: #0f172a;
}

.candidate-ready-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.candidate-ready-actions p {
  margin: 0 0 8px 0;
}

.candidate-ready-status {
  grid-column: 1 / -1;
  text-align: center;
}

.candidate-ready-actions .stack-form {
  grid-column: 1 / -1;
  width: 100%;
  align-items: center;
}

.candidate-ready-start-btn {
  background: #0165ca;
  color: #fff;
  width: calc(50% - 8px);
  text-transform: uppercase;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
  display: inline-block;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-secondary {
  background: #dbe7ef;
  color: #0f172a;
}

.btn-danger {
  background: #b91c1c;
  color: #fff;
}

.btn-summary {
  background: #0165ca;
  color: #fff;
}

.btn-primary.candidate-ready-start-btn {
  background: #0165ca;
  color: #fff;
}

.btn-primary.candidate-login-btn {
  background: #0165ca;
  color: #fff;
  text-transform: uppercase;
}

.candidate-login-title {
  text-align: center;
  color: #0165ca;
}

.candidate-login-note {
  max-width: 560px;
  margin: 8px auto 0;
  text-align: center;
}

.field-error {
  color: #b91c1c;
  font-size: 0.9rem;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.app-modal-backdrop[aria-hidden="true"] {
  display: none !important;
}

.app-modal-backdrop[hidden] {
  display: none !important;
}

.app-modal {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
  padding: 16px;
}

.app-modal h3 {
  margin: 0 0 8px 0;
}

.app-modal-message {
  margin: 0;
  line-height: 1.4;
}

.app-modal-input-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-modal-input-wrap[hidden] {
  display: none !important;
}

.app-modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.exam-shell {
  display: grid;
  grid-template-columns: clamp(260px, 25vw, 320px) minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 14px;
  align-items: start;
}

body.exam-page .exam-shell {
  row-gap: 4px;
}

.exam-side {
  position: sticky;
  top: 14px;
  align-self: start;
  height: calc(var(--exam-panel-height) - 38px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-side .card + .card {
  margin-top: 0;
}

.timer {
  font-size: 2rem;
  font-weight: 700;
}

.time-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 0 0 130px;
  order: 2;
}

.time-card h3 {
  margin: 0;
  font-size: 1rem;
}

.summary-shell {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  max-width: 1360px;
  margin: 0 auto;
}

body.summary-page .page {
  max-width: 1400px;
  padding-left: 12px;
  padding-right: 12px;
}

body.summary-page .summary-shell {
  grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  max-width: none;
  margin: 0;
}

.summary-shell .summary-left-col {
  position: static;
  top: auto;
  height: auto;
  gap: 14px;
}

.summary-overview-card {
  height: auto;
}

.summary-questions-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(var(--exam-panel-height) + 30px);
}

.summary-questions-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-question-item {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.summary-question-title {
  margin: 0 0 8px 0;
  font-weight: 600;
  line-height: 1.3;
}

.summary-question-image-wrap {
  margin: 8px 0;
}

.summary-question-image-wrap img {
  max-width: 100%;
  max-height: 180px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.summary-choice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-choice-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #dce4ec;
  border-radius: 6px;
  background: #fff;
}

.summary-choice-item.selected {
  background: #fff;
  border-color: #dce4ec;
  color: #0f172a;
  font-weight: 600;
}

.summary-choice-marker {
  display: inline-flex;
  width: 14px;
  justify-content: center;
  flex: 0 0 14px;
}

.summary-no-answer {
  margin: 6px 0 0 0;
}

.time-card .btn {
  margin-top: 2px;
  min-width: 170px;
}

.time-card .btn-summary {
  min-width: 270px;
}

.timer.danger {
  color: #b91c1c;
}

.logo-card {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 130px;
  min-height: 130px;
  max-height: 130px;
  overflow: hidden;
}

.logo-card img {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
}

.logo-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 150px;
  min-height: 150px;
  max-height: 150px;
  overflow: hidden;
  order: 3;
}

.logo-inline img {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.logo-inline .muted {
  color: #dbeafe;
}

.summary-side-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: hidden;
  order: 1;
}

.summary-side-card p {
  margin: 4px 0;
}

.candidate-gender-icon-wrap {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.candidate-gender-icon-wrap img {
  width: auto;
  height: auto;
  max-width: 76px;
  max-height: 76px;
  object-fit: contain;
  transform: translateY(-4px) scale(1.25);
  transform-origin: center center;
}

.device-card {
  order: 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-card p {
  margin: 0;
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
}

.status-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  height: 30px;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
}

.status-pill.ok {
  background: #bbf7d0;
  border-color: #22c55e;
  color: #14532d;
  font-weight: 700;
}

.summary-overview-card .status-pill.ok {
  background: #0165ca;
  border-color: #0157ad;
  color: #fff;
}

.status-pill.pending {
  background: #f8fafc;
}

.exam-main-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
}

.question-counter {
  color: #64748b;
  font-size: 1.35rem;
  margin: 0;
  transform: translateY(-3px);
}

.exam-main {
  height: calc(var(--exam-panel-height) - 38px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.exam-main-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.exam-form-fixed {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.question-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-image-wrap {
  margin: 12px 0;
}

.question-image-wrap img {
  max-width: 100%;
  max-height: 260px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.question-image-wrap img.question-image-zoomable {
  cursor: zoom-in;
}

.question-image-wrap img.question-image-zoomable:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

body.image-lightbox-open {
  overflow: hidden;
}

.question-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.82);
}

.question-image-lightbox[aria-hidden="true"],
.question-image-lightbox[hidden] {
  display: none !important;
}

.question-image-lightbox img {
  width: auto;
  height: auto;
  max-width: min(95vw, 1400px);
  max-height: 90vh;
  object-fit: contain;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.5);
  cursor: zoom-out;
}

.question-image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.question-image-lightbox-close:hover {
  background: rgba(15, 23, 42, 0.95);
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-option {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 2px 0;
  display: flex;
  gap: 6px;
  align-items: center;
}

.choice-option input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.8px solid #6b7280;
  border-radius: 50%;
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

.choice-option input[type="radio"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 120ms ease-in-out;
  background: #0b4f6c;
}

.choice-option input[type="radio"]:checked::before {
  transform: scale(1);
}

.choice-option input[type="radio"]:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.choice-option span {
  display: block;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.15;
}

.nav-actions {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.nav-actions .btn {
  min-width: 190px;
}

.exam-bottom-summary {
  grid-column: 1 / -1;
  padding: 16px;
  min-width: 0;
}

.bottom-summary-bar {
  padding: 0;
}

.bottom-summary-row {
  --blocks-label-h: 35px;
  --blocks-item-h: 35px;
  --blocks-gap-h: 2px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.summary-nav-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: calc(var(--blocks-label-h) + var(--blocks-item-h) + var(--blocks-gap-h));
  white-space: normal;
  padding: 12px 12px;
  background: #0165ca;
  color: #fff;
  text-align: center;
}

.summary-nav-btn .nav-arrow {
  color: #fff;
  display: inline-block;
  font-weight: 900;
  font-size: 1.4rem;
  line-height: 0.95;
  margin-top: -4px;
  margin-bottom: 5px;
  -webkit-text-stroke: 0.3px #fff;
  text-shadow: 0 0 1px #fff;
  transform: translateY(-2px) scale(2.2);
  transform-origin: center;
}

.summary-nav-btn .nav-label {
  color: #fff;
  font-size: 0.78rem;
  line-height: 1;
}

.question-blocks-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--blocks-gap-h);
  overflow: hidden;
  padding: 0;
  min-width: 0;
}

.question-groups-wrap {
  display: grid;
  grid-template-columns: repeat(var(--block-count, 1), minmax(0, 1fr));
  gap: 8px;
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

.question-panels-wrap {
  min-width: 0;
  width: 100%;
}

.question-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 auto;
}

.question-block-label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
  height: var(--blocks-label-h);
  padding: 0 10px;
  cursor: pointer;
  width: 100%;
}

.question-block-label.ok {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.question-block-label.ok::before {
  content: "\2691";
  display: inline-block;
  margin-right: 10px;
  font-size: 0.8em;
  line-height: 1;
  transform: translateY(-1px);
  text-shadow: 6px 3px 0 currentColor;
}

.question-block-label.active {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e3a8a;
}

.question-block-label.ok.active {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e3a8a;
}

.question-block-grid {
  display: grid;
  grid-template-columns: repeat(var(--visible-questions, 10), minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}

.question-block-panel {
  display: none;
}

.question-block-panel.is-active {
  display: grid;
}

.question-block-panel.is-hidden {
  display: none;
}

.question-block-grid .status-pill {
  height: var(--blocks-item-h);
  width: 100%;
  min-width: 0;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.question-block-grid .status-pill.ok {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  font-weight: 600;
}

.question-block-grid .status-pill.ok::before {
  content: "\2691";
  display: inline-block;
  margin-right: 3px;
  font-size: 0.72em;
  line-height: 1;
}

.question-block-grid .status-pill.is-current {
  border: 2px solid #1d4ed8;
  box-shadow: 0 0 0 1px #bfdbfe;
}

.question-block-grid .status-pill:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 1px;
}

.question-block-grid .status-pill.placeholder {
  cursor: default;
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: transparent;
  pointer-events: none;
}

.summary-actions {
  margin-top: 16px;
  max-width: 280px;
}

.summary-actions-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.summary-actions-row .btn {
  min-width: 0;
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 10px;
  text-align: center;
}

.summary-submit-form {
  margin: 0;
  width: 100%;
}

.summary-end-btn {
  background: #b91c1c;
  color: #fff;
}

.summary-back-btn {
  background: #0165ca;
  color: #fff;
}

.result-card .result-access-btn,
.result-card .result-access-btn:visited,
.result-card .result-access-btn:hover,
.result-card .result-access-btn:focus {
  background: #0165ca !important;
  color: #fff !important;
}

.progress-track {
  margin-top: 4px;
  width: 100%;
  max-width: 180px;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #0b4f6c;
}

.live-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.8rem;
  font-weight: 700;
}

.live-state-in_progress {
  background: #dbeafe;
  color: #1e3a8a;
}

.live-state-submitted {
  background: #dcfce7;
  color: #166534;
}

.live-state-time_expired {
  background: #fee2e2;
  color: #991b1b;
}

.live-state-cancelled {
  background: #f3f4f6;
  color: #374151;
}

.live-state-created {
  background: #ede9fe;
  color: #5b21b6;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.staff-codes-layout {
  display: grid;
  grid-template-columns: minmax(420px, 45%) minmax(0, 55%);
  gap: 14px;
  align-items: start;
  width: 100%;
}

body.staff-wide-page .page {
  max-width: none;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

body.staff-wide-page .card {
  min-width: 0;
}

body.staff-wide-page .grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

body.staff-wide-page .grid-2 > .card {
  height: 100%;
}

body.staff-wide-page .staff-dashboard-unified {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

body.staff-wide-page .staff-dashboard-pane {
  min-width: 0;
}

body.staff-wide-page .staff-dashboard-pane + .staff-dashboard-pane {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

body.staff-wide-page .staff-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.staff-wide-page .staff-table-wrap .table {
  min-width: 1080px;
}

body.staff-wide-page .staff-table-wrap #live-table {
  min-width: 1320px;
}

body.staff-codes-page .staff-codes-layout > .card {
  min-width: 0;
}

body.staff-codes-page .page {
  max-width: none;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

.staff-codes-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.staff-codes-modal-backdrop.hidden,
.staff-codes-modal-backdrop[hidden] {
  display: none !important;
}

.staff-codes-modal {
  width: min(1100px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  margin: 0;
}

.staff-codes-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.staff-codes-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 12px;
}

.staff-codes-form-field {
  min-width: 0;
}

.staff-codes-form-field label {
  display: block;
  margin-bottom: 4px;
}

.staff-codes-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.staff-codes-page .staff-codes-table-wrap .table {
  min-width: 980px;
}

@media (max-width: 1200px) {
  .staff-codes-layout {
    grid-template-columns: 1fr;
  }
}

.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row-spread {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-form textarea {
  min-width: 220px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  vertical-align: top;
  font-size: 0.95rem;
}

.code-actions {
  white-space: nowrap;
}

.code-actions .btn {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.code-actions .btn + .btn {
  margin-left: 6px;
}

.live-actions-cell {
  white-space: nowrap;
}

.live-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.live-action-link {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: #b91c1c;
  font: inherit;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline;
  vertical-align: baseline;
}

.live-action-link:hover,
.live-action-link:focus {
  color: #991b1b;
  text-decoration: none;
}

.list-clean {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-clean li {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.staff-session-card + .staff-session-card {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #d6dee8;
}

.staff-session-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.staff-session-head h3 {
  margin: 0;
}

.staff-session-head p {
  margin: 4px 0 0 0;
}

.staff-session-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

@media (max-width: 1200px) {
  body.exam-page .exam-shell {
    grid-template-columns: 280px minmax(0, 1fr);
    column-gap: 10px;
  }

  body.exam-page .exam-side {
    gap: 10px;
  }

  body.exam-page .time-card .btn-summary {
    min-width: 0;
    width: 100%;
  }

  body.exam-page .summary-nav-btn .nav-label {
    font-size: 0.72rem;
  }

  body.exam-page .summary-nav-btn {
    min-width: 0;
    min-height: calc(var(--blocks-label-h) + var(--blocks-item-h) + var(--blocks-gap-h));
  }
}

@media (max-width: 992px) {
  body.summary-page .summary-shell,
  .summary-shell {
    grid-template-columns: 1fr;
    max-width: 980px;
  }

  body.summary-page .summary-shell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    row-gap: 12px;
  }

  body.summary-page .summary-left-col,
  body.summary-page .summary-questions-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .summary-questions-card {
    height: auto;
  }

  .summary-questions-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .exam-shell {
    grid-template-columns: 1fr;
  }
  .exam-side {
    position: static;
    height: auto;
    gap: 14px;
  }
  .time-card {
    flex: 0 0 auto;
  }
  .logo-card {
    min-height: 130px;
    max-height: 130px;
  }
  .logo-inline {
    min-height: 150px;
    max-height: 150px;
  }
  .summary-side-card {
    min-height: 0;
    max-height: none;
    overflow: visible;
  }
  .exam-main {
    height: auto;
  }
  .exam-main-column {
    gap: 10px;
  }
  .bottom-summary-row {
    grid-template-columns: 1fr;
  }
  .question-blocks-wrap {
    order: 1;
  }
  .summary-nav-btn {
    order: 2;
    width: 100%;
  }
  .question-scroll {
    overflow: visible;
    padding-right: 0;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .candidate-ready-grid {
    grid-template-columns: 1fr;
  }

  .candidate-step-topbar-inner {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: center;
  }

  .candidate-step-logo-wrap {
    justify-content: center;
  }

  .candidate-step-right-spacer {
    display: none;
  }

  .candidate-step-progress {
    width: 100%;
    column-gap: 6px;
    grid-template-columns: minmax(0, 1fr) minmax(16px, 1fr) minmax(0, 1fr) minmax(16px, 1fr) minmax(0, 1fr);
  }

  .candidate-step-dot {
    width: 24px;
    height: 24px;
  }

  .candidate-step-connector {
    height: 5px;
    width: calc(100% + 6px);
    margin-left: -3px;
  }

  .candidate-step-label span {
    font-size: 0.66rem;
  }
  .candidate-ready-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .candidate-ready-actions p,
  .candidate-ready-actions .stack-form {
    grid-column: 1;
  }
  .candidate-ready-actions .stack-form {
    align-items: stretch;
  }
  .candidate-ready-start-btn {
    width: 100%;
  }

  body.exam-page .page {
    padding: 12px;
  }

  body.exam-page .exam-shell {
    row-gap: 4px;
  }

  body.exam-page .exam-side {
    gap: 10px;
  }

  body.exam-page .time-card .btn-summary {
    min-width: 0;
    width: 100%;
  }

  body.exam-page .logo-inline {
    min-height: 120px;
    max-height: 120px;
  }

  body.exam-page .logo-inline img {
    max-height: 120px;
  }

  body.exam-page .bottom-summary-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "blocks blocks"
      "prev next";
    gap: 8px;
  }

  body.exam-page .question-blocks-wrap {
    grid-area: blocks;
  }

  body.exam-page .summary-nav-prev {
    grid-area: prev;
  }

  body.exam-page .summary-nav-next {
    grid-area: next;
  }

  body.exam-page .summary-nav-btn {
    min-height: calc(var(--blocks-label-h) + var(--blocks-item-h) + var(--blocks-gap-h));
    padding: 10px 8px;
  }

  body.exam-page .summary-nav-btn .nav-label {
    font-size: 0.72rem;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .staff-codes-layout {
    grid-template-columns: 1fr;
  }

  .staff-codes-form-grid {
    grid-template-columns: 1fr;
  }

  body.staff-codes-page .page {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.staff-codes-page .staff-codes-table-wrap .table {
    min-width: 860px;
  }

  body.staff-wide-page .page {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.staff-wide-page .grid-2 {
    grid-template-columns: 1fr;
  }

  body.staff-wide-page .staff-table-wrap .table {
    min-width: 900px;
  }

  body.staff-wide-page .staff-table-wrap #live-table {
    min-width: 1180px;
  }

  body.staff-wide-page .staff-dashboard-unified {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.staff-wide-page .staff-dashboard-pane + .staff-dashboard-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 12px;
  }
}

@media (max-width: 768px) {
  body.summary-page .page {
    padding: 8px;
  }

  body.summary-page .card {
    padding: 12px;
  }

  body.summary-page .summary-questions-card {
    height: auto;
    max-height: none;
  }

  body.summary-page .summary-questions-scroll {
    overflow: visible;
    max-height: none;
  }

  .candidate-ready-topbar {
    padding: 8px 12px;
    margin-top: -8px;
    margin-bottom: 10px;
  }

  .candidate-ready-topbar-inner {
    min-height: 56px;
  }

  .candidate-ready-topbar img {
    max-height: 52px;
    transform: scale(1.2);
  }

  body.summary-page .summary-actions-row {
    grid-template-columns: 1fr;
  }

  body.exam-page .page {
    padding: 8px;
  }

  body.exam-page .card {
    padding: 12px;
  }

  body.exam-page .timer {
    font-size: 1.6rem;
  }

  body.exam-page .time-card h3 {
    font-size: 0.9rem;
  }

  body.exam-page .question-counter {
    font-size: 1.05rem;
  }

  body.exam-page .question-text {
    font-size: 1rem;
    line-height: 1.35;
  }

  body.exam-page .choice-option {
    padding: 2px 0;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .candidate-ready-topbar-inner {
    min-height: 50px;
  }

  .candidate-ready-topbar img {
    max-height: 46px;
    transform: scale(1.05);
  }

  body.exam-page .bottom-summary-row {
    --blocks-label-h: 31px;
    --blocks-item-h: 31px;
    --blocks-gap-h: 1px;
  }

  body.exam-page .question-counter {
    font-size: 0.95rem;
  }

  body.exam-page .summary-nav-btn {
    min-height: calc(var(--blocks-label-h) + var(--blocks-item-h) + var(--blocks-gap-h));
  }

  body.exam-page .summary-nav-btn .nav-arrow {
    font-size: 1.18rem;
    margin-top: -3px;
    margin-bottom: 4px;
    transform: translateY(-1px) scale(1.95);
  }

  body.exam-page .summary-nav-btn .nav-label {
    font-size: 0.68rem;
  }

  body.exam-page .question-block-label {
    font-size: 0.66rem;
    padding: 0 4px;
  }

  body.exam-page .question-block-grid {
    gap: 3px;
  }

  body.exam-page .question-block-grid .status-pill {
    width: 100%;
    min-width: 0;
    font-size: 0.74rem;
  }
}

/* Fine tuning responsive dedicato alla sola pagina prova (tablet/smartphone) */
@media (max-width: 992px) {
  body.exam-page .exam-shell {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 4px;
  }

  body.exam-page .exam-side {
    position: static;
    top: auto;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "device device"
      "info info"
      "timer logo";
    gap: 8px;
    align-items: stretch;
  }

  body.exam-page .device-card {
    grid-area: device;
  }

  body.exam-page .summary-side-card {
    grid-area: info;
    overflow: visible;
    max-height: none;
  }

  body.exam-page .summary-side-card p {
    overflow-wrap: anywhere;
  }

  body.exam-page .time-card {
    grid-area: timer;
    flex: 1 1 auto;
    min-height: 0;
    gap: 8px;
  }

  body.exam-page .logo-inline {
    grid-area: logo;
    flex: 1 1 auto;
    min-height: 92px;
    max-height: 92px;
  }

  body.exam-page .logo-inline img {
    max-height: 92px;
  }

  body.exam-page .exam-main {
    height: auto;
    min-height: clamp(360px, 45vh, 520px);
  }

  body.exam-page .question-text {
    overflow-wrap: anywhere;
  }

  body.exam-page .question-blocks-wrap {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  body.exam-page .bottom-summary-row {
    --blocks-label-h: 35px;
    --blocks-item-h: 35px;
    --blocks-gap-h: 2px;
  }

  body.exam-page .exam-side {
    grid-template-columns: 1fr;
    grid-template-areas:
      "device"
      "info"
      "timer"
      "logo";
  }

  body.exam-page .exam-main-head {
    flex-wrap: wrap;
  }

  body.exam-page .question-image-wrap img {
    max-height: 220px;
  }

  body.exam-page .bottom-summary-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "blocks"
      "prev"
      "next";
  }

  body.exam-page .summary-nav-btn {
    width: 100%;
    min-height: calc(var(--blocks-label-h) + var(--blocks-item-h) + var(--blocks-gap-h));
  }
}

@media (max-width: 420px) {
  body.exam-page .bottom-summary-row {
    --blocks-label-h: 31px;
    --blocks-item-h: 31px;
    --blocks-gap-h: 1px;
  }

  body.exam-page .page {
    padding: 6px;
  }

  body.exam-page .card {
    padding: 10px;
    border-radius: 10px;
  }

  body.exam-page .timer {
    font-size: 1.45rem;
  }

  body.exam-page .question-text {
    font-size: 0.95rem;
  }

  body.exam-page .question-image-wrap img {
    max-height: 180px;
  }
}
