:root {
  --primary: #d91e0e;
  --primary-hover: #ba190c;
  --primary-soft: #fff1ef;
  --accent: #047857;
  --accent-soft: #ecfdf5;
  --warning: #a24605;
  --warning-soft: #fff7ed;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ink: #101828;
  --ink-soft: #526079;
  --canvas: #f7f7f7;
  --surface: #ffffff;
  --surface-muted: #f1f4f9;
  --border: #dce2ec;
  --border-strong: #c3ccda;
  --dark: #212629;
  --dark-soft: #2e3438;
  --shadow-sm: 0 8px 24px rgb(23 32 51 / 7%);
  --shadow-lg: 0 24px 64px rgb(23 32 51 / 14%);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --focus: 0 0 0 3px rgb(217 30 14 / 24%);
  --transition: 180ms ease;
  font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
label,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  font-weight: 700;
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgb(220 226 236 / 85%);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(14px);
}

.brand,
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand > span:last-child,
.login-brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand strong,
.login-brand strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand small,
.login-brand small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #f22613, #d91e0e);
  box-shadow: 0 8px 20px rgb(217 30 14 / 24%);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-mark-dark {
  background: var(--dark);
  box-shadow: 0 8px 20px rgb(23 32 51 / 20%);
}

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
}

.secure-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.candidate-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
}

.screen {
  min-height: calc(100dvh - 77px);
  padding: clamp(48px, 8vw, 112px) clamp(20px, 5vw, 72px);
}

.screen-active {
  animation: screen-in 320ms ease both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: clamp(40px, 8vw, 112px);
  align-items: center;
  max-width: 1220px;
  margin: 0 auto;
}

.hero-copy h1,
.step-heading h1,
.completion-card h1,
.legal-page h1 {
  max-width: 18ch;
  margin: 10px 0 20px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-lead {
  max-width: 64ch;
  margin: 0 0 32px;
  color: var(--ink-soft);
  font-size: clamp(18px, 2vw, 21px);
}

.fact-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 32px;
}

.fact-card {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 72%);
}

.fact-card strong {
  font-size: 24px;
  line-height: 1.15;
}

.fact-card span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 13px;
}

.hero-panel {
  position: relative;
  padding: 30px;
  overflow: hidden;
  border: 1px solid #f0d4d0;
  border-top: 4px solid #f22613;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}

.hero-panel::after {
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgb(242 38 19 / 5%);
  content: "";
  filter: blur(2px);
}

.hero-panel-top,
.section-title-row,
.panel-heading,
.modal-heading,
.test-topbar,
.progress-label,
.split-actions,
.device-check-row,
.spoken-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.kicker {
  font-size: 14px;
  font-weight: 750;
}

.status-pill,
.count-pill {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-neutral {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-active,
.status-submitted,
.status-shortlist {
  background: var(--accent-soft);
  color: #065f46;
}

.status-in_progress,
.status-reviewing,
.status-follow_up {
  background: var(--warning-soft);
  color: #92400e;
}

.status-expired,
.status-revoked,
.status-not_selected,
.status-deleted {
  background: var(--surface-muted);
  color: #526079;
}

.status-redeemed,
.status-new {
  background: var(--primary-soft);
  color: #ab251b;
}

.check-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.check-list li:last-child {
  border-bottom: 0;
}

.check-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: rgb(242 38 19 / 18%);
  color: #f5b5ae;
  font-size: 13px;
  font-weight: 800;
}

.check-list div {
  display: flex;
  flex-direction: column;
}

.check-list strong {
  font-size: 15px;
}

.check-list div span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 14px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
  touch-action: manipulation;
}

.button:not(:disabled):active {
  opacity: 0.82;
}

.button:disabled {
  opacity: 0.46;
}

.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 18px rgb(217 30 14 / 18%);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: #fff;
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  border-color: #aeb9c9;
  background: var(--surface-muted);
  color: var(--ink);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.button-danger {
  border-color: #fecaca;
  background: #fff;
  color: var(--danger);
}

.button-large {
  min-height: 52px;
  padding-inline: 23px;
  font-size: 16px;
}

.button-full {
  width: 100%;
}

.narrow-layout {
  width: min(100%, 880px);
  margin: 0 auto;
}

.step-heading {
  margin-bottom: 30px;
}

.step-heading h1 {
  max-width: 20ch;
  font-size: clamp(34px, 5vw, 52px);
}

.step-heading > p:last-child {
  max-width: 68ch;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.notice-card,
.form-card,
.device-card,
.panel,
.completion-card,
.login-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.notice-card {
  padding: clamp(22px, 4vw, 32px);
  margin-bottom: 20px;
  border-left: 5px solid var(--primary);
}

.notice-heading {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notice-heading h2 {
  margin: 0;
  font-size: 20px;
}

.notice-heading p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.notice-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.notice-card ul {
  display: grid;
  gap: 10px;
  padding-left: 24px;
  margin: 22px 0;
  color: #39465c;
}

.text-link {
  font-weight: 750;
}

.form-card,
.form-panel {
  padding: clamp(22px, 4vw, 34px);
}

.field-grid {
  display: grid;
  gap: 18px;
}

.field-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > span:first-child,
.field > label,
.field > label:first-child {
  font-size: 14px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea,
.compact-field select,
.choice-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background-color var(--transition);
}

.field input,
.field select,
.compact-field select {
  padding: 10px 12px;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #a8b3c3;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.compact-field select:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.field input[readonly],
.field textarea[readonly] {
  background: var(--surface-muted);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffafa;
}

.field-help,
.field small,
.micro-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.code-input,
.generated-code strong,
.timer-card strong,
.typing-metrics strong,
.spoken-timer strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.code-input {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.consent-list,
.choice-field {
  padding: 0;
  margin: 28px 0;
  border: 0;
}

.consent-list legend,
.choice-field legend {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
}

.check-control {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 44px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: #344158;
}

.check-control:last-child {
  border-bottom: 0;
}

.check-control input,
.choice-grid input,
.option-control input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.form-error {
  padding: 12px 14px;
  margin: 16px 0;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: #991b1b;
  font-size: 14px;
  font-weight: 650;
}

.form-actions {
  margin-top: 22px;
}

.device-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  overflow: hidden;
}

.camera-stage {
  position: relative;
  min-height: 440px;
  background: #111827;
}

.camera-stage video,
.floating-camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: #d2d8e4;
}

.camera-placeholder span:last-child {
  color: #8f9bb0;
  font-size: 13px;
}

.camera-shape {
  position: relative;
  display: block;
  width: 68px;
  height: 48px;
  margin-bottom: 10px;
  border: 2px solid #657087;
  border-radius: 12px;
}

.camera-shape::after {
  position: absolute;
  right: -18px;
  top: 12px;
  width: 17px;
  height: 24px;
  border-radius: 0 8px 8px 0;
  background: #657087;
  content: "";
}

.device-content {
  padding: clamp(24px, 4vw, 40px);
}

.device-content h2 {
  margin: 0 0 22px;
  font-size: 24px;
}

.device-check-row {
  min-height: 52px;
  border-bottom: 1px solid var(--border);
}

.status-text {
  font-size: 13px;
}

.status-waiting {
  color: var(--ink-soft);
}

.status-ready {
  color: var(--accent);
}

.status-failed {
  color: var(--danger);
}

.muted-copy {
  margin: 24px 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.test-screen {
  padding-top: 30px;
}

.test-topbar {
  max-width: 1280px;
  margin: 0 auto 26px;
}

.test-topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.025em;
}

.test-status-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recording-chip {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: var(--danger-soft);
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
}

.recording-chip span,
.floating-camera-label span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 4px rgb(220 38 38 / 13%);
}

.timer-card {
  display: flex;
  min-width: 142px;
  flex-direction: column;
  align-items: flex-end;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.timer-card span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.timer-card strong {
  font-size: 19px;
}

.timer-card.is-warning {
  border-color: #fed7aa;
  background: var(--warning-soft);
  color: #92400e;
}

.test-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  max-width: 1280px;
  align-items: start;
  margin: 0 auto;
}

.test-sidebar {
  position: sticky;
  top: 20px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.progress-label {
  margin-bottom: 10px;
  font-size: 13px;
}

.progress-label span {
  color: var(--ink-soft);
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ebf3;
}

.progress-track span {
  display: block;
  width: 14%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 240ms ease;
}

.section-list {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 22px 0;
  list-style: none;
}

.section-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--ink-soft);
}

.section-list li.is-current {
  background: var(--primary-soft);
  color: #ab251b;
}

.section-list li.is-complete {
  color: var(--accent);
}

.section-list .step-index {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.section-list li.is-current .step-index {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.section-list strong {
  display: block;
  font-size: 13px;
}

.section-list small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.8;
}

.autosave-card {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.save-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.save-dot.is-saving {
  background: var(--warning);
}

.save-dot.is-error {
  background: var(--danger);
}

.autosave-card strong,
.autosave-card span {
  display: block;
}

.autosave-card strong {
  font-size: 12px;
}

.autosave-card div span {
  color: var(--ink-soft);
  font-size: 10px;
}

.test-workspace {
  min-width: 0;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.test-section {
  animation: section-in 220ms ease both;
}

@keyframes section-in {
  from { opacity: 0; transform: translateX(5px); }
  to { opacity: 1; transform: translateX(0); }
}

.section-heading {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.section-number {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: #ab251b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(23px, 3vw, 30px);
  letter-spacing: -0.025em;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
}

.typing-target,
.scenario-card,
.source-record,
.spoken-prompt,
.submission-notice,
.principle-banner {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.typing-target {
  padding: 20px;
  margin-bottom: 18px;
  color: #28364d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.7;
  user-select: none;
}

.typing-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.typing-metrics > div {
  display: flex;
  flex-direction: column;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.typing-metrics span,
.spoken-timer span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.typing-metrics strong {
  margin-top: 3px;
  font-size: 20px;
}

.inline-message {
  padding: 10px 12px;
  margin: 12px 0;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  color: #ab251b;
  font-size: 13px;
}

.scenario-card {
  padding: 20px;
  margin: 0 0 18px;
}

.scenario-card.compact {
  margin-top: 28px;
}

.scenario-card p,
.source-record p {
  margin: 7px 0 0;
}

.scenario-label {
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.source-line {
  display: block;
  padding: 12px 14px;
  border-radius: 9px;
  background: #e9edf5;
  color: #243047;
  overflow-wrap: anywhere;
}

.test-section .field + .field,
.test-section .field-grid + .field,
.test-section .question-stack + .field {
  margin-top: 24px;
}

.source-record {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 8px 20px;
  margin-bottom: 24px;
}

.source-record div {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.source-record div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.source-record div:nth-child(odd) {
  padding-right: 18px;
}

.source-record span,
.source-record strong {
  display: block;
}

.source-record span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.source-record strong {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.subsection-heading {
  margin: 34px 0 15px;
}

.subsection-heading h3 {
  margin: 0;
  font-size: 19px;
}

.subsection-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.priority-list,
.question-stack {
  display: grid;
  gap: 12px;
}

.priority-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.priority-item select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.priority-item p {
  margin: 0;
  font-size: 14px;
}

.question-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.question-card fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}

.question-card legend {
  margin-bottom: 13px;
  font-weight: 750;
}

.option-control {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 9px;
  color: #344158;
}

.option-control:hover {
  background: var(--surface-muted);
}

.field-prompt {
  color: #344158;
  font-size: 14px;
  font-weight: 500 !important;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-grid.seven {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.choice-grid label {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
}

.choice-grid label:has(input:checked) {
  border-color: #efa59d;
  background: var(--primary-soft);
  color: #ab251b;
}

.spoken-prompt {
  padding: clamp(22px, 4vw, 34px);
}

.spoken-prompt blockquote {
  margin: 12px 0 0;
  font-size: clamp(19px, 2.5vw, 25px);
  font-weight: 650;
  line-height: 1.4;
}

.spoken-controls {
  margin: 24px 0;
}

.spoken-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.spoken-timer strong {
  font-size: 28px;
}

.final-check {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.submission-notice {
  padding: 18px;
  margin-top: 20px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}

.submission-notice p {
  margin: 4px 0 0;
  color: #255849;
  font-size: 13px;
}

.test-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding-top: 24px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.test-navigation .button:last-child {
  justify-self: end;
}

.test-navigation > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.floating-camera {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: 210px;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 16px;
  background: var(--dark);
  box-shadow: var(--shadow-lg);
}

.floating-camera video {
  display: block;
  height: 132px;
}

.floating-camera-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--dark);
  color: #eef2f7;
  font-size: 10px;
  font-weight: 750;
}

.completion-card {
  width: min(100%, 720px);
  padding: clamp(32px, 7vw, 68px);
  margin: 0 auto;
  text-align: center;
}

.completion-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 34px;
  font-weight: 900;
}

.completion-card h1 {
  max-width: 17ch;
  margin-inline: auto;
  font-size: clamp(34px, 6vw, 52px);
}

.completion-card > p:not(.eyebrow, .micro-copy) {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--ink-soft);
}

.completion-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 30px 0 22px;
  text-align: left;
}

.completion-details div {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.completion-details span,
.completion-details strong {
  display: block;
}

.completion-details span {
  color: var(--ink-soft);
  font-size: 11px;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 3000;
  max-width: min(400px, calc(100vw - 44px));
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--dark);
  box-shadow: var(--shadow-lg);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}

.legal-page {
  width: min(100% - 40px, 780px);
  padding: 70px 0 100px;
  margin: 0 auto;
}

.legal-page h1 {
  max-width: 17ch;
  font-size: clamp(38px, 6vw, 58px);
}

.legal-lead {
  margin-bottom: 42px;
  color: var(--ink-soft);
  font-size: 19px;
}

.legal-page section {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.legal-page h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

.legal-page section p {
  margin: 0;
  color: #3e4b60;
}

.legal-page .button {
  margin-top: 30px;
}

/* Admin */
.admin-body {
  background: #f7f7f7;
}

.admin-login-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 20% 15%, rgb(217 30 14 / 14%), transparent 34%),
    radial-gradient(circle at 85% 85%, rgb(4 120 87 / 10%), transparent 30%),
    #f7f7f7;
}

.admin-login-shell .login-brand {
  position: absolute;
  top: 28px;
  left: 32px;
}

.login-card {
  width: min(100%, 460px);
  padding: clamp(28px, 5vw, 46px);
}

.login-card h1 {
  margin: 9px 0 12px;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.login-card > p:not(.eyebrow) {
  margin: 0 0 28px;
  color: var(--ink-soft);
}

.login-card .field {
  margin-bottom: 18px;
}

.admin-app {
  min-height: 100dvh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  display: flex;
  width: 240px;
  flex-direction: column;
  padding: 26px 18px 20px;
  background: var(--dark);
  color: #fff;
}

.brand-on-dark {
  padding: 0 10px;
  color: #fff;
}

.brand-on-dark small {
  color: #9eabc0;
}

.admin-nav {
  display: grid;
  gap: 5px;
  margin-top: 44px;
}

.nav-item {
  min-height: 44px;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #aeb8ca;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgb(255 255 255 / 9%);
  color: #fff;
}

.sidebar-foot {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.sidebar-foot a,
.sidebar-foot button {
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #aeb8ca;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}

.sidebar-foot a:hover,
.sidebar-foot button:hover {
  background: rgb(255 255 255 / 8%);
  color: #fff;
}

.admin-main {
  min-height: 100dvh;
  margin-left: 240px;
  padding: 36px clamp(24px, 4vw, 58px) 80px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto 42px;
}

.admin-topbar h1 {
  margin: 4px 0 0;
  font-size: 34px;
  letter-spacing: -0.035em;
}

.admin-section {
  max-width: 1280px;
  margin: 0 auto 46px;
  scroll-margin-top: 20px;
}

.section-title-row {
  margin-bottom: 17px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.section-title-row p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: flex;
  min-height: 145px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card > span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  margin-top: auto;
  font-size: 36px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.principle-banner {
  padding: 18px 22px;
  margin-top: 14px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
}

.principle-banner p {
  margin: 3px 0 0;
  color: #475569;
  font-size: 13px;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(300px, 0.36fr) minmax(0, 0.64fr);
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.form-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.form-panel .field + .field {
  margin-top: 16px;
}

.form-panel .button {
  margin-top: 22px;
}

.panel-heading {
  min-height: 75px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.form-panel .panel-heading {
  min-height: 0;
  padding: 0 0 20px;
  margin-bottom: 20px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 17px;
}

.panel-heading p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.count-pill {
  min-width: 28px;
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.empty-state {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 28px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-state span {
  margin-top: 4px;
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #fafbfc;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfcfe;
}

.candidate-cell strong,
.candidate-cell span {
  display: block;
}

.candidate-cell strong {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.candidate-cell span {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 11px;
}

.table-code {
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.table-action {
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.table-action:hover {
  border-color: #a8b3c3;
  background: var(--surface-muted);
}

.score-value {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.score-value small {
  color: var(--ink-soft);
  font-weight: 600;
}

.compact-field select {
  min-width: 170px;
}

.modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgb(15 23 42 / 66%);
  backdrop-filter: blur(4px);
}

.modal[open] {
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-shell {
  width: min(100%, 760px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.result-shell {
  width: min(100%, 1040px);
}

.modal-heading {
  padding: 24px 26px;
  border-bottom: 1px solid var(--border);
}

.modal-heading h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.modal-heading p:last-child {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.sticky-modal-heading {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 24px;
  line-height: 1;
}

.icon-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.compact-modal > .field,
.compact-modal > .generated-code,
.compact-modal > .modal-actions {
  margin-inline: 26px;
}

.compact-modal > .field + .field {
  margin-top: 18px;
}

.generated-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  margin-top: 24px;
  margin-bottom: 22px;
  border: 1px solid #f5b5ae;
  border-radius: 14px;
  background: var(--primary-soft);
}

.generated-code span {
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.generated-code strong {
  color: #9e2218;
  font-size: clamp(19px, 4vw, 27px);
  letter-spacing: 0.06em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 22px 0 26px;
}

.result-detail {
  padding: 26px;
}

.review-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.review-summary-card {
  display: flex;
  min-height: 106px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fafbfc;
}

.review-summary-card span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.review-summary-card strong {
  margin-top: auto;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.review-summary-card small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.result-column {
  display: grid;
  gap: 16px;
}

.result-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.result-block h3 {
  padding: 15px 18px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  font-size: 15px;
}

.result-block-body {
  padding: 18px;
}

.answer-item + .answer-item {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.answer-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.answer-item p,
.answer-item pre {
  margin: 0;
  color: #2f3c52;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.breakdown-list {
  display: grid;
  gap: 10px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
}

.breakdown-row span {
  color: var(--ink-soft);
}

.recording-list {
  display: grid;
  gap: 12px;
}

.recording-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fafbfc;
}

.recording-item video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #111827;
}

.recording-item p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.review-form .field + .field,
.review-form .rating-grid + .field {
  margin-top: 16px;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.danger-zone {
  padding-top: 16px;
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-split {
    grid-template-columns: 1fr;
  }

  .test-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .floating-camera {
    width: 170px;
  }

  .floating-camera video {
    height: 106px;
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .device-card,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 19ch;
  }

  .camera-stage {
    min-height: 360px;
  }

  .test-layout {
    grid-template-columns: 1fr;
  }

  .test-sidebar {
    position: static;
  }

  .section-list {
    grid-template-columns: repeat(7, minmax(36px, 1fr));
    gap: 3px;
    margin-bottom: 12px;
  }

  .section-list li {
    display: flex;
    min-height: 38px;
    justify-content: center;
    padding: 3px;
  }

  .section-list li div:last-child {
    display: none;
  }

  .autosave-card {
    padding-top: 10px;
  }

  .admin-sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
  }

  .admin-nav {
    display: flex;
    margin: 0 0 0 auto;
  }

  .nav-item {
    min-height: 44px;
  }

  .sidebar-foot {
    display: none;
  }

  .admin-main {
    margin-left: 0;
    padding-top: 28px;
  }

  .brand-on-dark small {
    display: none;
  }
}

@media (max-width: 700px) {
  .site-header {
    min-height: 68px;
    padding: 12px 18px;
  }

  .header-meta {
    font-size: 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .screen {
    min-height: calc(100dvh - 68px);
    padding: 42px 18px 80px;
  }

  .fact-row,
  .field-grid.two-columns,
  .source-record,
  .completion-details,
  .choice-grid,
  .choice-grid.seven,
  .typing-metrics,
  .rating-grid,
  .review-summary-grid {
    grid-template-columns: 1fr;
  }

  .fact-card {
    min-height: 74px;
  }

  .hero-panel {
    padding: 24px;
  }

  .source-record div,
  .source-record div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .source-record div:last-child {
    border-bottom: 0;
  }

  .choice-grid.seven {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .test-status-cluster {
    width: 100%;
    justify-content: space-between;
  }

  .test-workspace {
    padding: 22px 16px;
  }

  .section-heading {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .section-number {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .test-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .test-navigation > span {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  .test-navigation .button {
    grid-row: 2;
  }

  .floating-camera {
    right: 10px;
    bottom: 10px;
    width: 132px;
    border-width: 2px;
    border-radius: 12px;
  }

  .floating-camera video {
    height: 82px;
  }

  .floating-camera-label {
    padding: 6px 7px;
    font-size: 8px;
  }

  .admin-sidebar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
  }

  .admin-sidebar .brand {
    flex: 0 0 auto;
  }

  .admin-nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
  }

  .admin-nav .nav-item {
    min-width: 0;
    padding-inline: 6px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
  }

  .admin-main {
    padding-inline: 16px;
  }

  .admin-topbar,
  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-height: 126px;
    padding: 17px;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }

  .data-table tbody tr:last-child {
    border-bottom: 0;
  }

  .data-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    border: 0;
    text-align: right;
  }

  .data-table td::before {
    color: var(--ink-soft);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
  }

  .data-table td:first-child {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 11px;
    text-align: left;
  }

  .data-table td:first-child::before {
    display: none;
  }

  .modal[open] {
    padding: 0;
  }

  .modal-shell {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .result-detail,
  .modal-heading {
    padding: 20px 16px;
  }

  .compact-modal > .field,
  .compact-modal > .generated-code,
  .compact-modal > .modal-actions {
    margin-inline: 16px;
  }

  .generated-code {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-actions,
  .review-actions {
    flex-direction: column;
  }

  .modal-actions .button,
  .review-actions .button {
    width: 100%;
  }

  .admin-login-shell .login-brand {
    position: static;
    align-self: start;
    justify-self: start;
    margin-bottom: 20px;
  }

  .admin-login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
}

@media (max-width: 440px) {
  .header-meta {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .test-status-cluster,
  .spoken-controls,
  .split-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .timer-card,
  .spoken-timer {
    align-items: flex-start;
  }

  .split-actions .button,
  .spoken-controls .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Xino Digital · Persian, right-to-left brand layer */
html[dir="rtl"] { font-size: 16px; }
body { line-height: 1.85; }
h1, h2, h3, .eyebrow, .brand strong, .brand small, .data-table th,
.status-pill, .count-pill, .scenario-label, .source-record span,
.brand-caption, .test-card h3, .login-card h1 { letter-spacing: 0; text-transform: none; }
.hero-copy h1 { font-size: clamp(38px, 4.2vw, 60px); line-height: 1.4; max-width: 13ch; }
.step-heading h1, .completion-card h1 { line-height: 1.5; }
.brand-logo { display: block; flex: 0 0 auto; width: 96px; height: auto; object-fit: contain; }
.brand-caption { padding-inline-start: 15px; border-inline-start: 1px solid var(--border); }
.brand strong, .login-brand strong { font-size: 15px; }
.brand small, .login-brand small { font-size: 12px; line-height: 1.7; font-weight: 500; }
.brand-on-dark { padding: 0 4px; gap: 10px; }
.brand-on-dark .brand-logo { width: 80px; }
.brand-on-dark strong { font-size: 13px; }
.intro-footnote { margin: 18px 0 0; color: var(--ink-soft); font-size: 13px; }
.hero-panel::after { right: auto; left: -80px; }
.hero-panel-footer { position: relative; z-index: 1; margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--primary-soft); color: #9e2218; font-size: 13px; }
.check-number { color: #b42a1e; background: var(--primary-soft); }
.fact-card { min-height: 100px; }
.hero-copy .fact-card span { font-size: 14px; }
.field { cursor: default; }
.field label, .field > span:first-child { line-height: 1.8; font-size: 14px; }
.field-help, .field small, .micro-copy { font-size: 12px; line-height: 1.9; }
.field input, .field textarea, .field select { line-height: 1.8; }
.field input[dir="ltr"], .field textarea[dir="ltr"], .english-copy, .typing-target { text-align: left; font-family: "Segoe UI", Arial, sans-serif; }
.mono, bdi, .code-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.code-input { text-align: left; }
.button { line-height: 1.7; }
.text-link { text-underline-offset: 5px; }
.status-pill, .count-pill { font-size: 11px; line-height: 1.7; }
.notice-card { border-left: 1px solid var(--border); border-right: 5px solid var(--primary); }
.notice-card ul { padding-inline-start: 22px; padding-inline-end: 0; }
.notice-icon { font-size: 12px; letter-spacing: 0; flex-shrink: 0; }
.inline-message { border-left: 0; border-right: 3px solid var(--primary); }
.submission-notice { border-left: 1px solid var(--border); border-right: 4px solid var(--accent); }
.brand-on-dark, .brand-on-dark:hover { color: #fff; }
.admin-sidebar { inset: 0 0 0 auto; width: 250px; background: #212629; border-inline-end: 1px solid #343a3e; }
.admin-main { margin-left: 0; margin-right: 250px; }
.nav-item, .sidebar-foot a, .sidebar-foot button { text-align: right; }
.nav-item { color: #c5cbcf; }
.nav-item.is-active { color: #b51d10; background: #fff; }
.admin-topbar h1 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.6; }
.page-description { color: var(--ink-soft); margin: 5px 0 0; font-size: 14px; }
.metric-card { border-top: 3px solid #f22613; }
.metric-card > span { font-size: 14px; }
.metric-card small { font-size: 12px; }
.metric-card strong { line-height: 1.4; margin-top: 12px; }
.workflow-banner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 18px 22px; margin-top: 16px; background: #fff; border: 1px solid var(--border); border-radius: 12px; color: var(--ink-soft); font-size: 13px; }
.workflow-step { display: inline-flex; align-items: center; gap: 9px; }
.workflow-step b { display: grid; place-items: center; width: 28px; height: 28px; background: var(--primary-soft); color: var(--primary); border-radius: 8px; }
.test-library { display: grid; gap: 14px; }
.test-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: #fff; border-inline-start: 4px solid #f22613; box-shadow: var(--shadow-sm); }
.test-card-content { min-width: 0; }
.test-card h3 { margin: 8px 0 4px; font-size: 22px; }
.test-card p { max-width: 68ch; margin: 5px 0; color: var(--ink-soft); font-size: 14px; }
.test-card-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; color: var(--ink-soft); font-size: 12px; }
.test-card-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-start; flex-shrink: 0; }
.test-card-actions .button { white-space: nowrap; }
.test-preview-section { margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.test-preview-section h3 { margin: 0 0 8px; font-size: 17px; }
.test-preview-section ul { margin: 0; padding-inline-start: 20px; }
.test-preview-section li { padding: 3px 0; font-size: 14px; }
.test-preview-sample { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 18px; }
.test-preview-sample .english-copy { padding: 16px; background: var(--surface-muted); border-radius: 12px; }
.test-preview-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.form-footnote { margin-top: 15px; }
.admin-split { grid-template-columns: minmax(290px, .34fr) minmax(0, .66fr); }
.table-wrap { scrollbar-width: thin; }
.data-table th, .data-table td { text-align: right; padding: 14px 12px; }
.data-table th { background: #212629; color: #fff; font-size: 11px; }
.candidate-cell .candidate-email { direction: ltr; text-align: right; unicode-bidi: plaintext; }
.candidate-cell .candidate-test { color: #9d3027; margin-top: 5px; font-size: 12px; }
.data-table small { display: block; color: var(--ink-soft); font-size: 11px; }
.table-code { font-size: 12px; white-space: nowrap; }
.demo-badge { display: inline-flex; padding: 2px 8px; border: 1px solid #fed7aa; border-radius: 6px; background: #fff7ed; color: #92400e; font-size: 10px; margin-inline-start: 6px; }
.invitation-status { margin: 0 26px 20px; font-size: 13px; color: var(--ink-soft); }
.invitation-actions { flex-wrap: wrap; justify-content: flex-start; }
.case-strip { display: flex; justify-content: space-between; gap: 16px; padding: 13px 18px; background: var(--primary-soft); border: 1px solid #f0c6c1; border-radius: 12px; margin: 0 0 18px; font-size: 13px; }
.case-strip bdi { color: #9d3027; }
.case-label { color: var(--ink-soft); font-size: 12px; margin: 6px 0 0; }
.result-case-summary { margin: 0 0 20px; }
.review-summary-card strong { font-size: 22px; }
.answer-item span { font-size: 12px; letter-spacing: 0; }
.answer-item pre { direction: auto; text-align: start; unicode-bidi: plaintext; font-size: 14px; line-height: 1.9; }
.source-record div:nth-child(odd) { padding-right: 0; padding-left: 18px; }
.source-record strong { direction: ltr; text-align: left; unicode-bidi: plaintext; font-family: "Segoe UI", sans-serif; }
.source-record span { font-size: 12px; }
.source-line { font-family: ui-monospace, Consolas, monospace; }
.priority-item { grid-template-columns: 84px minmax(0, 1fr); }
.timer-card strong, .typing-metrics strong, .spoken-timer strong { line-height: 1.5; }
.floating-camera { position: static; width: 100%; margin-top: 20px; border: 1px solid var(--border); box-shadow: none; border-radius: 10px; }
.floating-camera video { height: auto; aspect-ratio: 16 / 10; }
.floating-camera-label { font-size: 10px; line-height: 1.8; letter-spacing: 0; }
.test-layout { grid-template-columns: 240px minmax(0, 1fr); }
.local-version { padding: 10px 12px; color: #aeb8ca; font-size: 11px; }
.admin-login-shell .login-brand { left: auto; right: 32px; }
.login-card h1 { font-size: 30px; line-height: 1.6; }
.legal-page h1 { line-height: 1.5; font-size: clamp(32px, 4vw, 48px); }
.legal-page section p { line-height: 2.1; }
.toast { right: auto; left: 22px; text-align: right; }
.dialog-note { padding: 12px 14px; margin: 15px 0; background: var(--primary-soft); border: 1px solid #f0d4d0; border-radius: 10px; font-size: 13px; color: #9d3027; }
@media (max-width: 1200px) {
  .admin-split { grid-template-columns: 1fr; }
  .test-card { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 860px) {
  .admin-sidebar { position: static; width: 100%; flex-direction: column; align-items: stretch; padding: 14px 18px; gap: 16px; }
  .brand-on-dark .brand-logo { width: 86px; }
  .brand-on-dark small { display: block; }
  .admin-main { margin-right: 0; }
  .admin-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0; width: 100%; }
  .admin-nav .nav-item { min-width: 0; white-space: normal; font-size: 12px; padding: 8px 4px; text-align: center; }
  .test-layout { grid-template-columns: 1fr; }
  .floating-camera { max-width: 180px; margin: 14px auto 0; }
  .test-sidebar { position: static; }
}
@media (max-width: 700px) {
  .brand-logo { width: 78px; }
  .brand strong { font-size: 13px; }
  .brand small { font-size: 11px; }
  .hero-grid { gap: 30px; }
  .hero-copy h1 { max-width: 13ch; font-size: 38px; }
  .hero-lead { line-height: 1.95; font-size: 17px; }
  .fact-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fact-card { padding: 12px 8px; min-height: 85px; }
  .fact-card strong { font-size: 18px; line-height: 1.6; }
  .hero-copy .fact-card span { font-size: 11px; }
  .hero-panel { padding: 22px 18px; }
  .step-heading h1 { font-size: 31px; }
  .test-card { padding: 22px 18px; }
  .test-card h3 { font-size: 19px; }
  .test-card-actions { width: 100%; }
  .test-card-actions .button { flex: 1 1 140px; }
  .data-table td { text-align: left; padding: 7px 0; }
  .data-table td:first-child { text-align: right; align-items: stretch; }
  .data-table td::before { text-align: right; font-size: 11px; }
  .candidate-cell .candidate-email { text-align: right; }
  .source-record div:nth-child(odd) { padding-left: 0; }
  .generated-code strong { font-size: 23px; }
  .case-strip { flex-wrap: wrap; }
  .review-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-summary-card { padding: 12px; }
  .review-summary-card strong { font-size: 18px; }
  .choice-grid.seven { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recording-chip { align-self: flex-start; }
  .test-sidebar .autosave-card { padding-top: 12px; }
  .floating-camera { max-width: 160px; }
  .floating-camera video { height: auto; }
  .invitation-status { margin-inline: 16px; }
  .notice-heading h2 { font-size: 18px; }
  .legal-page { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-track span { transition: none; }
}
