﻿:root{--purple:#3b1b7a;--purple-dark:#2d145f;--purple-soft:#f1edfb;--ink:#22242c;--muted:#6d7280;--line:#e5e6eb;--surface:#fff;--background:#f7f7fa;font-family:Inter,"Segoe UI",Arial,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--background);color:var(--ink)}button,input{font:inherit}button{cursor:pointer}.screen{display:none;min-height:100vh}.screen.active{display:block}.welcome-shell{max-width:1040px;margin:auto;padding:54px 24px 30px;text-align:center}.brand-logo{width:min(540px,85vw)}.compact-logo{width:min(320px,72vw);display:block;margin:8px auto 28px}.tagline{margin:4px 0 42px;color:var(--muted);font-size:1.05rem}.welcome-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.entry-card,.auth-card,.assessment-card,.metric,.quick-panel{background:var(--surface);border:1px solid var(--line);border-radius:20px}.entry-card{padding:34px;text-align:left}.entry-card h1,.entry-card h2{margin:12px 0 10px;color:var(--purple)}.entry-card p{color:var(--muted);line-height:1.6}.entry-icon{width:48px;height:48px;border-radius:14px;background:var(--purple-soft);color:var(--purple);display:grid;place-items:center;font-weight:800;font-size:1.4rem}.entry-icon.staff{background:#ebf9f5;color:#18866a}.primary,.secondary{border-radius:12px;padding:13px 18px;border:1px solid transparent;font-weight:700}.primary{background:var(--purple);color:#fff}.secondary{background:#fff;color:var(--purple);border-color:#cfc7e7}.full{width:100%;margin-top:18px}footer{margin-top:34px;color:var(--muted);font-size:.9rem}.auth-shell,.candidate-shell{max-width:620px;margin:auto;padding:36px 22px}.back{background:transparent;border:0;color:var(--purple);font-weight:700;padding:8px 0}.auth-card{padding:30px}.eyebrow{font-size:.78rem;letter-spacing:.12em;font-weight:800;color:var(--purple)}.auth-card h2,.page-heading h2{font-size:2rem;margin:8px 0 10px}.auth-card p,.page-heading p{color:var(--muted);line-height:1.55}label{display:block;font-weight:700;margin:18px 0 7px}input{width:100%;padding:14px 15px;border:1px solid #cfd1d8;border-radius:11px;font-size:16px}.message{margin-top:14px;min-height:20px;color:var(--purple)}.prototype-note{font-size:.85rem;color:var(--muted);margin-top:18px}.assessment-card{padding:22px;display:flex;justify-content:space-between;gap:18px;align-items:center;margin:22px 0}.assessment-card p{margin:6px 0 0;color:var(--muted)}.status{background:var(--purple-soft);color:var(--purple);padding:7px 10px;border-radius:999px;font-size:.85rem;font-weight:700}.app-shell{display:grid;grid-template-columns:250px 1fr;min-height:100vh}.sidebar{background:#fff;border-right:1px solid var(--line);padding:24px 18px;display:flex;flex-direction:column}.sidebar-logo{width:190px;margin:4px 8px 28px}nav{display:grid;gap:4px}.nav-item{border:0;background:transparent;text-align:left;padding:11px 12px;border-radius:9px;color:#4e5260}.active-nav{background:var(--purple-soft);color:var(--purple);font-weight:800}.signout{margin-top:auto}.dashboard-main{padding:38px}.dashboard-header h1{margin:8px 0 6px;font-size:2rem}.dashboard-header p{color:var(--muted)}.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:30px 0}.metric{padding:20px}.metric span{display:block;color:var(--muted);font-size:.9rem}.metric strong{display:block;font-size:2rem;color:var(--purple);margin-top:8px}.quick-panel{padding:24px}.quick-actions{display:flex;gap:10px;flex-wrap:wrap}button:disabled{opacity:.5;cursor:not-allowed}@media(max-width:760px){.welcome-grid{grid-template-columns:1fr}.app-shell{grid-template-columns:1fr}.sidebar{border-right:0;border-bottom:1px solid var(--line)}.sidebar nav{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-main{padding:24px 18px}.metric-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:430px){.metric-grid{grid-template-columns:1fr}.assessment-card{align-items:flex-start;flex-direction:column}}
.brand-logo { margin-bottom: 45px; }
.item-bank-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:24px;
}

.item-bank-header h1{
  margin:8px 0 6px;
  font-size:2rem;
}

.item-bank-header p{
  margin:0;
  color:var(--muted);
}

.item-toolbar{
  display:grid;
  grid-template-columns:minmax(240px,1.5fr) repeat(3,minmax(150px,1fr));
  gap:12px;
  margin-bottom:20px;
}

.item-toolbar input,
.item-toolbar select{
  width:100%;
  padding:12px 14px;
  border:1px solid #cfd1d8;
  border-radius:10px;
  background:white;
}

.item-table-wrap{
  background:white;
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
}

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

.item-table th{
  text-align:left;
  padding:14px 16px;
  background:#f7f5fb;
  color:var(--purple);
  font-size:.84rem;
}

.item-table td{
  padding:16px;
  border-top:1px solid var(--line);
}

.empty-row td{
  text-align:center;
  padding:48px 20px;
  color:var(--muted);
}

.empty-row strong{
  display:block;
  color:var(--ink);
  margin-bottom:8px;
}

@media(max-width:900px){
  .item-toolbar{grid-template-columns:1fr 1fr}
}

@media(max-width:620px){
  .item-bank-header{flex-direction:column}
  .item-toolbar{grid-template-columns:1fr}
  .item-table-wrap{overflow-x:auto}
  .item-table{min-width:760px}
}
.editor-grid{
  display:grid;
  gap:20px;
}

.editor-panel{
  background:white;
  border:1px solid var(--line);
  border-radius:18px;
  padding:24px;
}

.editor-panel h2{
  margin:0 0 20px;
  color:var(--purple);
  font-size:1.15rem;
}

.form-grid{
  display:grid;
  gap:16px;
}

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

.editor-panel select,
.editor-panel textarea{
  width:100%;
  padding:13px 14px;
  border:1px solid #cfd1d8;
  border-radius:10px;
  background:white;
  font:inherit;
}

.editor-panel textarea{
  resize:vertical;
  line-height:1.5;
}

.editor-panel input:focus,
.editor-panel select:focus,
.editor-panel textarea:focus{
  outline:3px solid rgba(59,27,122,.12);
  border-color:var(--purple);
}

.editor-toolbar-note{
  margin-top:14px;
  padding:12px 14px;
  background:#f7f5fb;
  border-radius:10px;
  color:var(--muted);
  font-size:.88rem;
}

.option-row{
  display:grid;
  grid-template-columns:40px 1fr;
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}

.option-label{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:var(--purple-soft);
  color:var(--purple);
  font-weight:800;
}

.small-action{
  margin-top:5px;
}

.response-meta{
  margin-top:22px;
}

.checkbox-grid{
  display:flex;
  gap:28px;
  flex-wrap:wrap;
  margin:22px 0;
}

.checkbox-grid label{
  margin:0;
  display:flex;
  align-items:center;
  gap:8px;
}

.checkbox-grid input{
  width:auto;
}

.editor-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  padding:4px 0 30px;
}

@media(max-width:700px){
  .two-col{
    grid-template-columns:1fr;
  }

  .editor-actions{
    justify-content:stretch;
  }

  .editor-actions button{
    flex:1;
  }
}
.preview-shell{
  max-width:960px;
  margin:0 auto;
  padding:30px 28px 50px;
}

.preview-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:24px;
  padding-bottom:22px;
  border-bottom:1px solid var(--line);
}

.preview-logo{
  width:220px;
  height:auto;
}

.preview-mode{
  display:flex;
  align-items:center;
  gap:16px;
}

.preview-mode span{
  color:var(--purple);
  font-size:.85rem;
  font-weight:800;
}

.preview-progress{
  display:flex;
  justify-content:space-between;
  gap:20px;
  padding:22px 2px 14px;
  color:var(--muted);
  font-size:.9rem;
}

.preview-card{
  background:white;
  border:1px solid var(--line);
  border-radius:20px;
  padding:36px;
}

.preview-section-label{
  color:var(--purple);
  font-size:.76rem;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
  margin-bottom:12px;
}

.preview-stimulus{
  padding:20px;
  background:#f7f5fb;
  border-radius:12px;
  line-height:1.7;
  margin-bottom:30px;
}

.preview-question h2{
  margin:0 0 26px;
  font-size:1.35rem;
  line-height:1.5;
  color:var(--ink);
}

.preview-options{
  display:grid;
  gap:12px;
}

.preview-option{
  display:grid;
  grid-template-columns:auto 42px 1fr;
  align-items:center;
  gap:12px;
  margin:0;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  cursor:pointer;
  transition:.15s ease;
}

.preview-option:hover{
  border-color:#b9acd9;
  background:#faf9fd;
}

.preview-option input{
  width:auto;
  margin:0;
}

.preview-option-letter{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:var(--purple-soft);
  color:var(--purple);
  font-weight:800;
}

.preview-option:has(input:checked){
  border-color:var(--purple);
  background:#f7f5fb;
}

.preview-footer{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding-top:22px;
  color:var(--muted);
  font-size:.86rem;
}

@media(max-width:620px){
  .preview-shell{
    padding:20px 16px 40px;
  }

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

  .preview-mode{
    width:100%;
    justify-content:space-between;
  }

  .preview-card{
    padding:24px 18px;
  }

  .preview-progress{
    font-size:.8rem;
  }
}

/* OPT response layout */
.confidence-preview-option {
  display: block;
  padding: 20px 22px;
}

.confidence-option-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin-bottom: 18px;
}

.confidence-option-heading .preview-option-letter {
  flex: 0 0 auto;
}

.confidence-option-heading > span:last-child {
  flex: 1;
  line-height: 1.5;
}

.confidence-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.confidence-slider {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.confidence-number {
  width: 70px;
  box-sizing: border-box;
  text-align: center;
}

.confidence-percent {
  width: 20px;
  text-align: left;
}


/* OPT slider endpoint styling */
.confidence-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  background: transparent;
  cursor: pointer;
}

/* Chrome / Edge / Safari track */
.confidence-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #ddd;
}

/* Chrome / Edge / Safari thumb */
.confidence-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4b2a63;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  margin-top: -6px;
}

/* Firefox track */
.confidence-slider::-moz-range-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #ddd;
}

/* Firefox thumb */
.confidence-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4b2a63;
  border: 2px solid #ffffff;
  box-sizing: border-box;
}


/* Likert / Rating Scale Candidate Preview */
.likert-preview-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 24px;
}

.likert-preview-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 145px;
  padding: 18px 12px;
  border: 1px solid #dedbe2;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  transition: border-color 0.15s ease,
              box-shadow 0.15s ease,
              background 0.15s ease;
}

.likert-preview-option:hover {
  border-color: #7b638c;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
}

.likert-preview-option input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  accent-color: #4b2a63;
}

.likert-preview-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2eef4;
  color: #4b2a63;
  font-weight: 700;
  font-size: 15px;
}

.likert-preview-label {
  display: block;
  line-height: 1.35;
  font-size: 14px;
  color: #333036;
}

.likert-preview-option:has(input[type="radio"]:checked) {
  border-color: #4b2a63;
  background: #f8f5f9;
  box-shadow: 0 0 0 2px rgba(75, 42, 99, 0.10);
}

.likert-preview-option:has(input[type="radio"]:checked)
.likert-preview-number {
  background: #4b2a63;
  color: #ffffff;
}

/* Stack the scale on smaller screens */
@media (max-width: 700px) {
  .likert-preview-options {
    grid-template-columns: 1fr;
  }

  .likert-preview-option {
    min-height: auto;
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    text-align: left;
  }
}


/* Slider Scale Candidate Preview */
.scale-preview-wrapper {
  width: 100%;
  max-width: 760px;
  margin: 30px auto 10px;
  padding: 28px 30px;
  box-sizing: border-box;
  background: #faf9fb;
  border: 1px solid #e4e0e7;
  border-radius: 14px;
}

.scale-value-display {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 44px;
  margin: 0 auto 26px;
  border-radius: 10px;
  background: #4b2a63;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

/* Slider itself */
.scale-preview-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

/* Chrome / Edge / Safari track */
.scale-preview-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #d8d2dc;
}

/* Chrome / Edge / Safari thumb */
.scale-preview-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -6.5px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #4b2a63;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.20);
}

/* Firefox track */
.scale-preview-slider::-moz-range-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #d8d2dc;
}

/* Firefox thumb */
.scale-preview-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #4b2a63;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.20);
}

/* Endpoint labels */
.scale-preview-labels {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  width: 100%;
  margin-top: 16px;
}

.scale-end-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 45%;
  line-height: 1.35;
}

.scale-end-label-right {
  align-items: flex-end;
  text-align: right;
}

.scale-end-label strong {
  color: #4b2a63;
  font-size: 14px;
  margin-bottom: 3px;
}

.scale-end-label span {
  color: #5f5a62;
  font-size: 13px;
}

/* Keyboard focus */
.scale-preview-slider:focus-visible {
  outline: 3px solid rgba(75, 42, 99, 0.22);
  outline-offset: 5px;
}

@media (max-width: 600px) {
  .scale-preview-wrapper {
    padding: 24px 20px;
  }
}


/* Ranking Candidate Preview */
.ranking-preview-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 24px;
}

.ranking-preview-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #e1dde4;
  border-radius: 12px;
  background: #ffffff;
  box-sizing: border-box;
}

.ranking-position {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #4b2a63;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
}

.ranking-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ranking-option-text {
  line-height: 1.4;
  color: #333036;
}

.ranking-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ranking-controls button {
  min-width: 92px;
  padding: 8px 10px;
  font-size: 13px;
}

.ranking-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .ranking-preview-item {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .ranking-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 60px;
  }
}


/* Best / Worst Response Candidate Preview */
.best-worst-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 24px;
}

.best-worst-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.best-worst-instruction {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f5f2f7;
  color: #4b2a63;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.best-worst-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid #e1dde4;
  border-radius: 12px;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.15s ease,
              box-shadow 0.15s ease;
}

.best-worst-option:hover {
  border-color: #b8aabd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.best-worst-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.best-worst-option-text {
  color: #333036;
  line-height: 1.45;
}

.best-worst-choices {
  display: grid;
  grid-template-columns: 90px 90px;
  gap: 8px;
}

.best-worst-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #ddd7e0;
  border-radius: 9px;
  background: #faf9fb;
  cursor: pointer;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #514b54;
  transition: border-color 0.15s ease,
              background 0.15s ease,
              color 0.15s ease;
}

.best-worst-choice:hover {
  border-color: #7b638c;
}

.best-worst-choice input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: pointer;
  accent-color: #4b2a63;
}

.best-worst-choice:has(input[type="radio"]:checked) {
  border-color: #4b2a63;
  background: #f2edf5;
  color: #4b2a63;
  box-shadow: 0 0 0 1px rgba(75, 42, 99, 0.08);
}

@media (max-width: 700px) {
  .best-worst-option {
    grid-template-columns: 1fr;
  }

  .best-worst-choices {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
}


/* Image-option MCQ Candidate Preview */
.image-mcq-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  margin-top: 24px;
}

.image-mcq-preview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e1dde4;
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.image-mcq-preview-card:hover {
  border-color: #8a7498;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.image-mcq-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.image-mcq-preview-top input[type="radio"] {
  width: 19px;
  height: 19px;
  margin: 0;
  cursor: pointer;
  accent-color: #4b2a63;
}

.image-mcq-preview-image-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #eeeaf0;
  border-radius: 10px;
  background: #faf9fb;
}

.image-mcq-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 10px;
  box-sizing: border-box;
}

.image-mcq-preview-placeholder {
  padding: 20px;
  color: #8b858d;
  font-size: 13px;
  text-align: center;
}

.image-mcq-preview-text {
  min-height: 22px;
  color: #333036;
  line-height: 1.45;
  text-align: center;
}

.image-mcq-preview-card:has(input[type="radio"]:checked) {
  border-color: #4b2a63;
  background: #f8f5f9;
  box-shadow: 0 0 0 2px rgba(75, 42, 99, 0.10);
}

.image-mcq-preview-card:has(input[type="radio"]:checked)
.preview-option-letter {
  background: #4b2a63;
  color: #ffffff;
}

@media (max-width: 700px) {
  .image-mcq-preview-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================
   MATRIX / ABSTRACT REASONING
   Candidate Preview
   ========================= */

.matrix-candidate-stimulus {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0 32px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid #e8e5ec;
  border-radius: 14px;
}

.matrix-candidate-stimulus-image {
  display: block;
  max-width: 620px;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.matrix-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.matrix-answer-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: #ffffff;
  border: 2px solid #e7e2eb;
  border-radius: 14px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.matrix-answer-card:hover {
  border-color: #8c6aa8;
  box-shadow: 0 6px 18px rgba(59, 35, 74, 0.08);
}

.matrix-answer-card:has(input[type="radio"]:checked) {
  border-color: #5b2d73;
  box-shadow: 0 0 0 3px rgba(91, 45, 115, 0.10);
}

.matrix-answer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.matrix-answer-top input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #5b2d73;
  cursor: pointer;
}

.matrix-answer-image-area {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 14px;
  background: #faf9fb;
  border: 1px solid #eeeaf1;
  border-radius: 10px;
  overflow: hidden;
}

.matrix-answer-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.matrix-answer-placeholder {
  color: #7d7482;
  font-size: 0.9rem;
  text-align: center;
}

.matrix-answer-text {
  text-align: center;
  font-size: 0.95rem;
  color: #3f3942;
  line-height: 1.4;
}

@media (max-width: 700px) {
  .matrix-candidate-stimulus {
    padding: 18px;
    margin-bottom: 24px;
  }

  .matrix-answer-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================
   PASSAGE + ITEM SET
   Candidate Preview
   ========================= */

.passage-preview-question-set {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 26px;
}

.passage-preview-question {
  padding: 22px;
  background: #ffffff;
  border: 1px solid #e8e5ec;
  border-radius: 14px;
}

.passage-preview-question-text {
  margin: 8px 0 18px;
  font-size: 1.15rem;
  line-height: 1.5;
  color: #312c34;
}

.passage-preview-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.passage-preview-option {
  display: grid;
  grid-template-columns: 22px 36px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #faf9fb;
  border: 2px solid #ebe7ee;
  border-radius: 12px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.passage-preview-option:hover {
  border-color: #8c6aa8;
}

.passage-preview-option:has(input[type="radio"]:checked) {
  border-color: #5b2d73;
  background: #f7f2fa;
  box-shadow: 0 0 0 3px rgba(91, 45, 115, 0.08);
}

.passage-preview-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #5b2d73;
  cursor: pointer;
}

.passage-preview-option-text {
  line-height: 1.45;
  color: #3f3942;
}

/* Make the shared passage easier to read */
#previewStimulusBlock {
  padding: 24px;
  background: #faf9fb;
  border: 1px solid #e7e2eb;
  border-radius: 14px;
}

#previewStimulus {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #39333c;
}

@media (max-width: 700px) {
  .passage-preview-question {
    padding: 18px;
  }

  .passage-preview-option {
    grid-template-columns: 20px 32px 1fr;
    padding: 12px;
  }
}


/* =========================================================
   TABLE / CHART + ITEM SET — CANDIDATE PREVIEW
   ========================================================= */

.table-chart-preview-instructions {
  font-size: 1rem;
  line-height: 1.65;
  color: #2f2f35;
  margin-bottom: 24px;
}

/* Shared data table */

.table-chart-preview-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0 30px;
  border: 1px solid #e2dfea;
  border-radius: 12px;
  background: #ffffff;
}

.table-chart-candidate-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.table-chart-candidate-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3f275d;
  background: #f4f1f7;
  border-bottom: 1px solid #ddd7e5;
}

.table-chart-candidate-table td {
  padding: 14px 16px;
  color: #343238;
  background: #ffffff;
  border-bottom: 1px solid #ece9f0;
}

.table-chart-candidate-table th:not(:last-child),
.table-chart-candidate-table td:not(:last-child) {
  border-right: 1px solid #ece9f0;
}

.table-chart-candidate-table tbody tr:last-child td {
  border-bottom: none;
}

/* Chart / image stimulus */

.table-chart-preview-image-wrapper {
  width: 100%;
  margin: 24px 0 32px;
  padding: 22px;
  box-sizing: border-box;
  border: 1px solid #e2dfea;
  border-radius: 12px;
  background: #faf9fb;
  display: flex;
  justify-content: center;
  align-items: center;
}

.table-chart-preview-image {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Question set */

.table-chart-preview-question-set {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 28px;
}

.table-chart-preview-question {
  padding: 26px;
  border: 1px solid #e3dfe8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(40, 28, 52, 0.04);
}

.table-chart-preview-question .preview-section-label {
  margin-bottom: 9px;
  color: #684889;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table-chart-preview-question-text {
  margin: 0 0 20px;
  color: #29262d;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.5;
}

/* Response options */

.table-chart-preview-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table-chart-preview-option {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 15px;
  border: 1px solid #ded9e4;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.table-chart-preview-option:hover {
  border-color: #9275aa;
  background: #faf8fc;
}

.table-chart-preview-option:has(input[type="radio"]:checked) {
  border-color: #684889;
  background: #f5f0f8;
  box-shadow: 0 0 0 1px #684889;
}

.table-chart-preview-option input[type="radio"] {
  flex: 0 0 auto;
  accent-color: #684889;
}

.table-chart-preview-option .preview-option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f1edf4;
  color: #553773;
  font-size: 0.85rem;
  font-weight: 700;
}

.table-chart-preview-option:has(input[type="radio"]:checked)
  .preview-option-letter {
  background: #684889;
  color: #ffffff;
}

.table-chart-preview-option-text {
  flex: 1;
  color: #343238;
  line-height: 1.45;
}

/* Responsive candidate layout */

@media (max-width: 700px) {
  .table-chart-preview-question {
    padding: 20px;
  }

  .table-chart-preview-image-wrapper {
    padding: 14px;
  }

  .table-chart-candidate-table th,
  .table-chart-candidate-table td {
    padding: 12px;
  }

  .table-chart-preview-option {
    padding: 12px;
  }
}


/* =========================================================
   SHORT RESPONSE — CANDIDATE PREVIEW
   ========================================================= */

.short-response-preview-panel {
  width: 100%;
  box-sizing: border-box;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #e3dfe8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(40, 28, 52, 0.04);
}

.short-response-preview-label {
  display: block;
  margin-bottom: 10px;
  color: #29262d;
  font-size: 0.95rem;
  font-weight: 700;
}

.short-response-preview-textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  box-sizing: border-box;
  padding: 16px;
  resize: vertical;
  border: 1px solid #d9d4df;
  border-radius: 10px;
  background: #ffffff;
  color: #29262d;
  font: inherit;
  font-size: 1rem;
  line-height: 1.55;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.short-response-preview-textarea::placeholder {
  color: #8b8790;
}

.short-response-preview-textarea:hover {
  border-color: #a996b8;
}

.short-response-preview-textarea:focus {
  border-color: #684889;
  box-shadow: 0 0 0 3px rgba(104, 72, 137, 0.12);
}

.short-response-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  color: #716d76;
  font-size: 0.84rem;
}

.short-response-preview-requirement {
  line-height: 1.4;
}

.short-response-preview-counter {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 7px;
  background: #f3f0f5;
  color: #604579;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Candidate has not yet met the configured minimum */

.short-response-preview-counter[data-minimum-met="false"] {
  background: #f7f3f8;
  color: #76568f;
}

/* Candidate has met the configured minimum */

.short-response-preview-counter[data-minimum-met="true"] {
  background: #f0edf3;
  color: #4f3568;
}

@media (max-width: 700px) {

  .short-response-preview-panel {
    padding: 18px;
  }

  .short-response-preview-textarea {
    min-height: 160px;
    padding: 14px;
  }

  .short-response-preview-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}


/* =========================================================
   NUMERIC ENTRY — CANDIDATE PREVIEW
   ========================================================= */

.numeric-entry-preview-panel {
  width: 100%;
  box-sizing: border-box;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #e3dfe8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(40, 28, 52, 0.04);
}

.numeric-entry-preview-label {
  display: block;
  margin-bottom: 10px;
  color: #29262d;
  font-size: 0.95rem;
  font-weight: 700;
}

.numeric-entry-preview-input-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 420px;
}

.numeric-entry-preview-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid #d9d4df;
  border-radius: 10px;
  background: #ffffff;
  color: #29262d;
  font: inherit;
  font-size: 1.05rem;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.numeric-entry-preview-input:hover {
  border-color: #a996b8;
}

.numeric-entry-preview-input:focus {
  border-color: #684889;
  box-shadow: 0 0 0 3px rgba(104, 72, 137, 0.12);
}

/* When a unit/suffix follows the input */

.numeric-entry-preview-input-row:
  has(.numeric-entry-preview-unit)
  .numeric-entry-preview-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.numeric-entry-preview-unit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 54px;
  box-sizing: border-box;
  padding: 0 14px;
  border: 1px solid #d9d4df;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: #f3f0f5;
  color: #604579;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.numeric-entry-preview-input-row:
  has(.numeric-entry-preview-input:focus)
  .numeric-entry-preview-unit {
  border-color: #684889;
}

.numeric-entry-preview-guidance {
  margin-top: 10px;
  color: #716d76;
  font-size: 0.84rem;
  line-height: 1.45;
}

@media (max-width: 700px) {

  .numeric-entry-preview-panel {
    padding: 18px;
  }

  .numeric-entry-preview-input-row {
    max-width: 100%;
  }

  .numeric-entry-preview-input {
    padding: 13px 14px;
  }
}


/* =========================================================
   RICH CONTENT TOOLBAR
   ========================================================= */

.rich-content-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 8px;
  padding: 8px;
  border: 1px solid #ded9e4;
  border-radius: 10px;
  background: #f8f6fa;
}

.rich-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #3f275d;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.rich-tool-button:hover {
  border-color: #cfc4d8;
  background: #ffffff;
}

.rich-tool-button:focus-visible {
  outline: none;
  border-color: #684889;
  box-shadow: 0 0 0 3px rgba(104, 72, 137, 0.12);
}

.rich-toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: #d9d2df;
}

@media (max-width: 700px) {
  .rich-content-toolbar {
    align-items: stretch;
  }

  .rich-toolbar-divider {
    display: none;
  }
}


/* =========================================================
   RICH CONTENT — SYMBOL PALETTE DISPLAY FIX
   ========================================================= */

.rich-symbol-palette {
  display: grid;
  grid-template-columns: repeat(7, 42px);
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 12px;
  margin: 8px 0 14px;
  background: #ffffff;
  border: 1px solid #d8d5dc;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(30, 22, 40, 0.10);
}

.rich-symbol-button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;

  font-family:
    "Cambria Math",
    "STIX Two Math",
    "Segoe UI Symbol",
    "Arial Unicode MS",
    serif;

  font-size: 21px;
  font-weight: 400;
  line-height: 1;

  background: #ffffff;
  border: 1px solid #d8d5dc;
  border-radius: 7px;
  cursor: pointer;
  padding: 0;
}

.rich-symbol-button:hover {
  background: #f5f2f8;
  border-color: #6b3f82;
}

.rich-symbol-button:focus {
  outline: 2px solid #6b3f82;
  outline-offset: 1px;
}

@media (max-width: 600px) {
  .rich-symbol-palette {
    grid-template-columns: repeat(5, 42px);
  }
}


/* =========================================================
   RICH CONTENT — FRACTION STYLING
   ========================================================= */

.rich-math-fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1.1;
  margin: 0 0.15em;
}

.rich-math-numerator {
  display: block;
  padding: 0 0.2em 0.08em;
  border-bottom: 1.5px solid currentColor;
  text-align: center;
}

.rich-math-denominator {
  display: block;
  padding: 0.08em 0.2em 0;
  text-align: center;
}


/* =========================================================
   RICH CONTENT — POWER STYLING
   ========================================================= */

.rich-math-power {
  display: inline;
  white-space: nowrap;
}

.rich-math-power-exponent {
  font-size: 0.75em;
  line-height: 0;
  vertical-align: super;
  margin-left: 0.02em;
}


/* =========================================================
   RICH CONTENT — SQUARE ROOT STYLING
   ========================================================= */

.rich-math-square-root {
  display: inline-flex;
  align-items: flex-start;
  vertical-align: middle;
  white-space: nowrap;
  margin: 0 0.08em;
}

.rich-math-radical {
  font-family:
    "Cambria Math",
    "STIX Two Math",
    "Segoe UI Symbol",
    serif;

  font-size: 1.25em;
  line-height: 1;
  margin-right: -0.03em;
}

.rich-math-radicand {
  display: inline-block;
  border-top: 1.5px solid currentColor;
  padding: 0.05em 0.12em 0 0.08em;
  line-height: 1.05;
}


/* =========================================================
   RICH CONTENT — SQUARE ROOT VISUAL REFINEMENT
   ========================================================= */

.rich-math-square-root {
  display: inline-flex;
  align-items: flex-start;
  vertical-align: -0.08em;
  white-space: nowrap;
  margin: 0 0.08em;
}

.rich-math-radical {
  font-family:
    "Cambria Math",
    "STIX Two Math",
    "Segoe UI Symbol",
    serif;

  font-size: 1.55em;
  font-weight: 400;
  line-height: 0.82;
  margin-right: -0.10em;
  transform: translateY(0.02em);
}

.rich-math-radicand {
  display: inline-block;
  border-top: 1.5px solid currentColor;
  padding: 0.04em 0.12em 0 0.10em;
  line-height: 1.05;
}


/* =========================================================
   ITEM EDITOR — LIVE QUESTION PREVIEW
   ========================================================= */

.editor-live-preview {
  margin-top: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #faf9fb;
  border: 1px solid #e2dfe6;
  border-radius: 8px;
}

.editor-live-preview-label {
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b6470;
}

.editor-live-preview-content {
  min-height: 28px;
  font-size: 1rem;
  line-height: 1.6;
  color: #25212a;
}

.editor-live-preview-content mjx-container {
  margin: 0 0.08em !important;
}


/* =========================================================
   WELCOME SCREEN — ACCESS LAYOUT POLISH
   ========================================================= */

.staff-access-link {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid #e6e1e9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #6b6470;
}

.staff-login-link {
  appearance: none;
  border: none;
  background: transparent;
  padding: 2px 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: #5b2a86;
  cursor: pointer;
  text-decoration: none;
}

.staff-login-link:hover,
.staff-login-link:focus {
  text-decoration: underline;
  outline: none;
}

.staff-access-link + footer {
  margin-top: 26px;
}


/* =========================================================
   RESPONSE OPTIONS — INTEGRATED LIVE PREVIEW
   ========================================================= */

.response-option-live-preview {
  margin: -2px 0 10px 34px;
  padding: 7px 12px 8px;
  border-left: 2px solid #e2dfe6;
  background: transparent;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #403a45;
}

.response-option-live-preview mjx-container {
  margin: 0 0.06em !important;
}

.option-row:has(.response-option-live-preview:not(:empty)) {
  margin-bottom: 4px;
}


