:root {
  --bg: #0b0f1b;
  --surface: #131a2a;
  --surface-2: #182235;
  --surface-3: #202c42;
  --border: #2d3a57;
  --border-strong: #465778;
  --text: #f3efe5;
  --muted: #a8afbd;
  --gold: #dda916;
  --gold-soft: #f2cf62;
  --teal: #2b9b88;
  --teal-soft: #78d0c0;
  --coral: #d66a57;
  --green: #42b883;
  --ink: #101522;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 30px 54px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  border-bottom: 1px solid var(--border);
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--gold-soft);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.top-actions,
.action-row,
.home-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
}

.btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--surface-3);
}

.btn.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.btn.primary:hover:not(:disabled) {
  background: var(--gold-soft);
}

.btn.next {
  border-color: var(--teal);
  background: var(--teal);
  color: #071713;
}

.btn.next:disabled {
  border-color: var(--border);
  background: var(--surface-2);
  color: #737c8e;
}

.home-screen {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 52px 0 30px;
}

.home-screen h1,
.complete-screen h1 {
  margin: 7px 0 12px;
  font-size: 3.15rem;
  line-height: 1;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
}

.test-meta {
  display: flex;
  gap: 10px;
  margin: 24px 0 30px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
}

.skill-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.skill-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.skill-number {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: Consolas, monospace;
  font-weight: 800;
}

.skill-item strong {
  display: block;
  font-size: 1.08rem;
}

.skill-item span:last-child {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem;
}

.progress-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin: 28px 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 180ms ease;
}

.question-screen {
  padding-top: 26px;
}

.question-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.question-heading h1 {
  margin: 3px 0 0;
  font-size: 2.15rem;
  line-height: 1.05;
}

.counter {
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.question-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(430px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-panel,
.answer-panel {
  padding: 24px;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  line-height: 1.15;
}

.panel-intro,
.small-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.88rem;
}

.chart-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  min-width: 520px;
  height: auto;
}

.data-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.data-value {
  min-width: 48px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  text-align: center;
  font-family: Consolas, monospace;
  font-weight: 700;
}

.question-list {
  display: grid;
  gap: 13px;
}

.answer-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(130px, 190px);
  gap: 12px;
  align-items: center;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}

.answer-row:last-child {
  border-bottom: 0;
}

.part-label {
  color: var(--gold);
  font-family: Consolas, monospace;
  font-weight: 800;
}

.answer-row label,
.field label {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: 0;
  background: #0f1523;
  color: var(--text);
  padding: 9px 12px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(221, 169, 22, 0.18);
}

input:disabled,
select:disabled {
  opacity: 0.8;
}

.unit {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem;
  white-space: nowrap;
}

.frequency-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.86rem;
}

.frequency-table th,
.frequency-table td {
  padding: 10px 8px;
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.frequency-table th {
  background: var(--surface-3);
  color: var(--gold-soft);
}

.frequency-table input {
  min-width: 62px;
  min-height: 42px;
  padding: 7px;
  text-align: center;
}

.tally-control {
  display: grid;
  grid-template-columns: 34px minmax(62px, 1fr) 34px;
  gap: 5px;
  align-items: center;
}

.tally-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 900;
}

.tally-output {
  min-height: 34px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #0f1523;
  color: var(--teal-soft);
  font-family: Consolas, monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

.band-guide {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 16px 0;
}

.band-guide div {
  padding: 10px 7px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--teal);
  background: var(--surface-2);
  text-align: center;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.75rem;
}

.band-guide strong {
  display: block;
  color: var(--gold-soft);
}

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

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 6px;
}

.feedback {
  min-height: 58px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0f1523;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
}

.feedback.good {
  border-color: var(--green);
  background: rgba(66, 184, 131, 0.1);
  color: #a9e9cb;
}

.feedback.bad {
  border-color: var(--coral);
  background: rgba(214, 106, 87, 0.1);
  color: #f1b4a9;
}

.action-row {
  justify-content: flex-end;
  margin-top: 16px;
}

.complete-screen {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 90px 0;
  text-align: center;
}

.complete-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  color: var(--teal-soft);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 2rem;
  font-weight: 900;
}

.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;
}

@media (max-width: 980px) {
  .question-layout {
    grid-template-columns: 1fr;
  }

  .skill-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .app-shell {
    padding: 14px 14px 38px;
  }

  .topbar,
  .question-heading {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    padding-bottom: 14px;
  }

  .home-screen {
    padding-top: 34px;
  }

  .home-screen h1,
  .complete-screen h1 {
    font-size: 2.35rem;
  }

  .question-heading {
    grid-template-columns: 1fr;
  }

  .data-panel,
  .answer-panel {
    padding: 17px;
  }

  .answer-row {
    grid-template-columns: 28px 1fr;
  }

  .answer-row .input-with-unit,
  .answer-row > input,
  .answer-row > select {
    grid-column: 2;
  }

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

  .field.full {
    grid-column: auto;
  }

  .band-guide {
    grid-template-columns: 1fr;
  }

  .frequency-table {
    font-size: 0.78rem;
  }

  .frequency-table th,
  .frequency-table td {
    padding: 7px 4px;
  }

  .action-row,
  .home-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
