:root {
  --ink: #07111f;
  --navy: #0b2d5a;
  --teal: #0f7789;
  --line: #b8c8d6;
  --soft: #edf5f9;
  --good: #177b4d;
  --bad: #b23b31;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #dfeaf0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.pk-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.pk-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #0b2d5a 0%, #113b77 100%);
  color: #fff;
}

.pk-side img {
  width: 170px;
  max-width: 100%;
  margin: 0 auto;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.metric-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.metric-card span,
.metric-card small {
  color: #d8eef4;
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

.pk-main {
  min-width: 0;
  padding: 16px;
}

.pk-hero,
.pk-controls,
.pk-status,
.question-card,
.pk-actions,
.exam-start,
.exam-nav {
  border: 1px solid #8fa9ba;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(13, 37, 58, 0.12);
}

.pk-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0b2d5a 0%, #12446f 72%, #0f7789 100%);
  color: #fff;
}

.pk-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3.2vw, 42px);
}

.pk-hero p,
.exam-start p {
  margin: 0;
  color: #d8eef4;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  background: var(--teal);
  color: #fff;
  font: 900 13px Arial, Helvetica, sans-serif;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mode-switch {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.mode-switch button {
  min-width: 86px;
  background: transparent;
}

.mode-switch button.active {
  background: #fff;
  color: var(--navy);
}

.pk-controls {
  display: grid;
  grid-template-columns: minmax(190px, 320px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #344f62;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  min-width: 0;
  border: 1px solid #aebfcb;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  font: 800 13px Arial, Helvetica, sans-serif;
}

.exam-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 16px;
}

.exam-start[hidden],
.exam-nav[hidden],
.pk-controls[hidden],
.pk-actions [hidden] {
  display: none;
}

.exam-start h2,
.exam-nav h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.exam-start p {
  max-width: 760px;
  color: #435b6b;
}

.pk-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--line);
}

.pk-status div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #fff;
}

.pk-status span {
  color: #536b7a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pk-status strong {
  color: var(--navy);
  font-size: 20px;
}

.question-card {
  min-height: 390px;
  padding: 18px;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.question-meta span {
  border: 1px solid #b8c8d6;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--soft);
  color: #344f62;
  font-size: 11px;
  font-weight: 900;
}

.question-card h2 {
  margin: 0 0 18px;
  color: #07111f;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.3;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid #b8c8d6;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfd;
  color: var(--ink);
  text-align: left;
}

.choice .letter {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #113b77;
  color: #fff;
}

.choice.selected {
  border-color: var(--teal);
  background: #e8f6f8;
  box-shadow: inset 4px 0 0 var(--teal);
}

.choice.correct {
  border-color: #3ba16f;
  background: #e7f6ef;
}

.choice.wrong {
  border-color: #cf6a61;
  background: #fff1f0;
}

.answer-panel {
  margin-top: 14px;
  padding: 13px;
  border-radius: 8px;
  background: #e7f5f7;
  color: #0b5260;
  font-weight: 900;
}

.answer-panel:empty {
  display: none;
}

.answer-panel.pass {
  background: #e1f5e9;
  color: #07502f;
}

.answer-panel.fail {
  background: #ffe8e6;
  color: #7d1c15;
}

.exam-nav {
  margin-top: 12px;
  padding: 12px;
}

.exam-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 7px;
}

.question-jump {
  min-height: 38px;
  padding: 8px;
  border: 1px solid #b8c8d6;
  background: #f8fbfd;
  color: var(--navy);
}

.question-jump.active {
  border-color: #0b2d5a;
  background: #0b2d5a;
  color: #fff;
}

.question-jump.answered {
  border-color: #0f7789;
  background: #dff3f6;
  color: #063d49;
}

.question-jump.correct {
  border-color: var(--good);
  background: #dff5e9;
  color: #07502f;
}

.question-jump.wrong {
  border-color: var(--bad);
  background: #ffe8e6;
  color: #7d1c15;
}

.timer-warn {
  color: #ffd266;
}

.pk-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
}

@media (max-width: 900px) {
  .pk-shell {
    display: block;
  }

  .pk-side {
    position: static;
    height: auto;
  }

  .pk-controls,
  .pk-status {
    grid-template-columns: 1fr;
  }

  .pk-hero,
  .pk-actions,
  .exam-start,
  .exam-nav-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-switch button {
    flex: 1;
  }

  .question-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
