.professional-tests-view {
  max-width: 1320px;
  margin: 0 auto;
}

.professional-test-toolbar {
  align-items: center;
}

.professional-test-toolbar .tabbar {
  flex: 1 1 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.professional-test-toolbar .tab {
  flex: 0 0 auto;
  min-height: 40px;
}

.professional-test-toolbar .tab small {
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.test-safety-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 20px;
  padding: 12px 14px;
  border-left: 3px solid var(--teal);
  background: rgba(22, 139, 136, 0.08);
  color: #245c5a;
  line-height: 1.45;
}

.test-safety-note svg {
  flex: 0 0 auto;
  width: 19px;
  margin-top: 1px;
}

.test-catalog-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
}

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

.professional-test-grid > .empty-state {
  grid-column: 1 / -1;
}

.professional-test-card {
  min-width: 0;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  border-radius: var(--radius);
  background: var(--surface);
}

.professional-test-card > header,
.professional-test-card > footer,
.test-category-mark,
.test-best-score {
  display: flex;
  align-items: center;
}

.professional-test-card > header {
  justify-content: space-between;
  gap: 8px;
}

.test-category-mark {
  min-width: 0;
  gap: 6px;
  color: var(--graphite-2);
  font-size: 12px;
  font-weight: 800;
}

.test-category-mark svg {
  width: 16px;
  color: var(--orange-dark);
}

.test-level {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.test-level-basic {
  color: var(--green);
  background: rgba(46, 133, 64, 0.08);
}

.test-level-intermediate {
  color: var(--blue);
  background: rgba(47, 111, 187, 0.08);
}

.test-level-advanced {
  color: var(--red);
  background: rgba(181, 54, 45, 0.08);
}

.professional-test-copy {
  flex: 1 1 auto;
  padding: 16px 0 12px;
}

.professional-test-copy h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.professional-test-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.test-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.test-facts div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.test-facts dt,
.test-facts dd {
  margin: 0;
}

.test-facts dt svg {
  width: 14px;
  color: var(--muted);
}

.test-facts dd {
  white-space: nowrap;
  color: var(--graphite-2);
  font-size: 11px;
  font-weight: 700;
}

.test-best-score {
  gap: 6px;
  min-height: 32px;
  margin-top: 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.test-best-score.is-passed {
  color: var(--green);
}

.test-best-score svg {
  width: 15px;
}

.professional-test-card > footer {
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  margin-top: auto;
}

.professional-test-card > footer > span {
  color: var(--muted);
  font-size: 11px;
}

.professional-test-card > footer .primary-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 10px;
}

.test-history-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.test-knowledge-profile {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-top: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.test-knowledge-summary,
.test-recommendations {
  min-width: 0;
}

.test-knowledge-heading,
.test-knowledge-heading > div,
.test-recommendations-title,
.test-recommendation-row,
.test-knowledge-category > div:first-child {
  display: flex;
  align-items: center;
}

.test-knowledge-heading {
  justify-content: space-between;
  gap: 14px;
}

.test-knowledge-heading > div {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.test-knowledge-heading span,
.test-knowledge-metrics span,
.test-recommendation-row span,
.test-recommendation-row p {
  color: var(--muted);
  font-size: 12px;
}

.test-knowledge-heading h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.test-knowledge-heading > strong {
  color: var(--teal);
  font-size: 30px;
}

.test-knowledge-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
}

.test-knowledge-metrics > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.test-knowledge-metrics strong {
  font-size: 18px;
}

.test-knowledge-categories {
  display: grid;
  gap: 10px;
}

.test-knowledge-category {
  display: grid;
  gap: 5px;
}

.test-knowledge-category > div:first-child {
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.test-knowledge-category > div:first-child span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--graphite-2);
  font-weight: 700;
}

.test-knowledge-category svg {
  width: 15px;
  color: var(--orange-dark);
}

.test-knowledge-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.test-knowledge-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.test-recommendations {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.test-recommendations-title {
  gap: 7px;
  min-height: 32px;
  margin-bottom: 7px;
}

.test-recommendations-title svg {
  width: 18px;
  color: var(--blue);
}

.test-recommendation-row {
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.test-recommendation-row > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.test-recommendation-row p {
  margin: 0;
  line-height: 1.35;
}

.test-recommendation-row .secondary-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 9px;
}

.test-history-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.test-history-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.test-history-score {
  color: var(--red);
  font-size: 20px;
  font-weight: 900;
}

.test-history-score.is-passed {
  color: var(--green);
}

.test-history-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.test-history-row div span {
  color: var(--muted);
  font-size: 12px;
}

.test-runner,
.test-result {
  max-width: 920px;
  margin: 0 auto;
}

.test-runner-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding-bottom: 16px;
}

.test-runner-head > div {
  display: grid;
  gap: 3px;
}

.test-runner-head span {
  color: var(--muted);
  font-size: 12px;
}

.test-runner-head h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.test-runner-head > div:last-child {
  text-align: right;
}

.test-runner-head strong {
  font-size: 22px;
}

.test-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.test-progress-track span {
  display: block;
  height: 100%;
  background: var(--orange);
  transition: width 180ms ease;
}

.test-question-stage {
  min-height: 460px;
  padding: 30px 0 22px;
}

.test-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.test-question-meta strong {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}

.test-question-meta strong.is-warning {
  border-color: rgba(181, 54, 45, 0.4);
  color: var(--red);
  background: rgba(181, 54, 45, 0.07);
}

.test-question-stage h3 {
  max-width: 800px;
  margin: 0 0 24px;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
}

.test-option-list {
  display: grid;
  gap: 9px;
}

.test-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.test-option:hover {
  border-color: var(--line-strong);
}

.test-option.is-selected {
  border-color: var(--orange);
  box-shadow: inset 3px 0 0 var(--orange);
  background: rgba(243, 107, 33, 0.05);
}

.test-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.test-option-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-weight: 900;
}

.test-option.is-selected .test-option-index {
  border-color: var(--orange);
  color: #fff;
  background: var(--orange);
}

.test-runner-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.test-runner-actions #testExit {
  margin-right: auto;
}

.test-result-score {
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--line);
}

.test-result-score span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.test-result-score strong {
  display: block;
  margin: 4px 0;
  font-size: 54px;
  line-height: 1;
  color: var(--red);
}

.test-result-score.is-passed strong {
  color: var(--green);
}

.test-result-score p {
  margin: 8px 0 0;
  color: var(--muted);
}

.test-result-review {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.test-review-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  background: var(--surface);
}

.test-review-item.is-correct {
  border-left-color: var(--green);
}

.test-review-item header {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: start;
}

.test-review-item header > span {
  font-weight: 900;
  color: var(--muted);
}

.test-review-item header h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.test-review-item header svg {
  color: var(--red);
}

.test-review-item.is-correct header svg {
  color: var(--green);
}

.test-review-item dl {
  display: grid;
  gap: 7px;
  margin: 13px 0 0 36px;
}

.test-review-item dl div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px;
}

.test-review-item dt {
  color: var(--muted);
  font-size: 12px;
}

.test-review-item dd {
  margin: 0;
  font-weight: 700;
}

.test-review-item > p {
  margin: 12px 0 0 36px;
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.5;
}

.professional-test-admin-grid {
  margin-top: 16px;
}

.test-category-admin-list,
.admin-professional-test-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.test-category-admin-row,
.admin-professional-test-row {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.test-category-admin-actions,
.admin-professional-test-row,
.admin-professional-test-row > div,
.professional-test-question-toolbar,
.professional-test-question-editor > header {
  display: flex;
  align-items: center;
}

.test-category-admin-actions,
.admin-professional-test-row,
.professional-test-question-toolbar,
.professional-test-question-editor > header {
  justify-content: space-between;
  gap: 8px;
}

.admin-professional-test-row > div:first-child {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
}

.admin-professional-test-row small {
  color: var(--muted);
}

.professional-test-editor {
  margin-top: 16px;
}

.professional-test-question-toolbar {
  margin: 20px 0 10px;
}

.professional-test-question-builder {
  display: grid;
  gap: 12px;
}

.professional-test-question-editor {
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.professional-test-option-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 9px 0;
}

.test-admin-option {
  display: grid;
  grid-template-columns: 18px 24px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
}

.test-admin-option > span {
  font-weight: 900;
  text-align: center;
}

.test-admin-option input[type="text"] {
  min-width: 0;
  width: 100%;
}

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

  .test-knowledge-profile {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-recommendations {
    padding: 16px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .professional-test-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .professional-test-toolbar {
    align-items: stretch;
  }

  .professional-test-toolbar .search-field {
    width: 100%;
  }

  .test-question-stage {
    min-height: 430px;
    padding-top: 22px;
  }

  .test-question-stage h3 {
    font-size: 20px;
  }

  .test-runner-head {
    align-items: flex-start;
  }

  .test-runner-head h3 {
    font-size: 18px;
  }

  .test-runner-actions {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr);
  }

  .test-runner-actions .primary-button,
  .test-runner-actions .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .test-history-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .test-history-row > .status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .test-knowledge-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .test-recommendation-row {
    align-items: flex-start;
  }

  .test-recommendation-row .secondary-button span {
    display: none;
  }

  .test-review-item dl,
  .test-review-item > p {
    margin-left: 0;
  }

  .test-review-item dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .professional-test-option-editor {
    grid-template-columns: 1fr;
  }
}
