:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #64748b;
  --line: #d9e2ec;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --good: #167c3b;
  --bad: #b42318;
  --warn: #9a5b00;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
select {
  font: inherit;
}

.shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 22px;
}

.hero-copy {
  min-width: 0;
}

.hero-note {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.hero-side {
  display: flex;
  justify-content: flex-end;
}

.cert-reference {
  width: 188px;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.cert-badge {
  width: 132px;
  display: block;
  text-decoration: none;
}

.cert-badge img {
  width: 100%;
  height: auto;
  display: block;
}

.cert-badge:hover,
.cert-badge:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 4px;
}

.cert-context {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
  max-width: 760px;
}

.jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 14px;
}

.jump-links a {
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 11px;
  border: 1px solid #c7d7d5;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.jump-links a:hover,
.jump-links a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
  background: #ffffff;
}

.controls {
  display: grid;
  grid-template-columns: minmax(132px, 150px) minmax(130px, 150px) minmax(190px, 1fr) minmax(118px, 132px) minmax(96px, 112px) minmax(82px, auto) minmax(76px, auto);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.controls > label {
  min-width: 0;
}

.controls select,
.controls button {
  width: 100%;
  min-width: 0;
}

.controls select {
  text-overflow: ellipsis;
}

.ad-slot {
  display: grid;
  justify-items: stretch;
  gap: 6px;
  margin: 14px 0;
}

.ad-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ad-slot a {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  text-decoration: none;
}

.ad-slot a:hover,
.ad-slot a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  border-color: var(--accent);
}

.ad-mobile {
  display: none;
}

.ad-card {
  display: grid;
  align-items: center;
  justify-items: center;
  color: var(--ink);
  text-align: center;
}

.ad-card img {
  display: block;
  max-width: 100%;
  height: auto;
}

.ad-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.ad-card strong {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.ad-card-wide {
  width: 100%;
  min-height: 74px;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  padding: 14px 18px;
  text-align: left;
}

.ad-card-compact {
  width: min(300px, 100%);
  gap: 10px;
  padding: 18px;
}

.ad-card-compact {
  min-height: 132px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

select {
  padding: 0 12px;
}

button {
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

button:disabled,
select:disabled {
  cursor: default;
  opacity: 0.55;
}

button:hover,
button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  border-color: var(--accent);
}

[hidden] {
  display: none !important;
}

.path-panel {
  min-height: 288px;
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.path-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.path-heading h2 {
  margin-bottom: 0;
}

.stage-score {
  min-width: 118px;
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

#stageProgress {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.stage-description {
  max-width: 820px;
  min-height: 44px;
  margin: 14px 0 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.stage-report {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 124, 59, 0.28);
  border-radius: 8px;
  background: #eef9f1;
  color: #14532d;
  font-weight: 800;
}

.stage-report span {
  color: #166534;
}

.stage-report span:last-child {
  margin-left: auto;
  font-size: 20px;
  font-weight: 900;
}

.stage-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
}

.stage-chip {
  min-width: 0;
  min-height: 62px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 8px 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
}

.stage-chip[data-domain="preliminary"] {
  border-color: #c8d7ec;
  background: #f5f8fd;
}

.stage-chip[data-domain="plan"] {
  border-color: #c9ded8;
  background: #f2faf7;
}

.stage-chip[data-domain="design"] {
  border-color: #d8d0ea;
  background: #f8f5fd;
}

.stage-chip[data-domain="deploy"] {
  border-color: #ead4c2;
  background: #fff7ef;
}

.stage-chip .stage-marker {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8eef5;
  color: var(--ink);
  font-weight: 900;
}

.stage-chip strong {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.stage-chip.active {
  border-color: #0f766e;
  color: var(--ink);
  background: #ffffff;
  box-shadow:
    inset 0 0 0 2px #0f766e,
    0 0 0 4px rgba(15, 118, 110, 0.12);
}

.stage-chip.active .stage-marker {
  background: #0f766e;
  color: #ffffff;
}

.stage-chip.done .stage-marker {
  background: var(--good);
  color: #ffffff;
}

.stage-chip.done .stage-marker::before {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}

.path-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}

.exam-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid #c9d8ee;
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: var(--shadow);
}

.exam-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.exam-heading h2 {
  margin-bottom: 0;
}

.exam-timer {
  min-width: 126px;
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.exam-timer strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.exam-info {
  display: grid;
  gap: 10px;
  max-width: 860px;
}

.exam-info p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.exam-info button {
  width: fit-content;
  min-width: 150px;
  margin-top: 6px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

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

.exam-nav-chip {
  min-width: 0;
  min-height: 38px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
}

.exam-nav-chip.answered {
  border-color: rgba(22, 124, 59, 0.38);
  background: #eef9f1;
  color: #14532d;
}

.exam-nav-chip.skipped {
  border-color: rgba(154, 91, 0, 0.28);
  background: #fff8ed;
  color: #7a4300;
}

.exam-nav-chip.marked:where(:not(.answered)) {
  border-color: rgba(154, 91, 0, 0.68);
  background:
    linear-gradient(135deg, rgba(154, 91, 0, 0.18) 0 22%, transparent 22% 100%),
    #fff8ed;
  color: #693900;
}

.exam-nav-chip.answered.marked {
  border-color: rgba(22, 124, 59, 0.38);
  background:
    linear-gradient(135deg, rgba(154, 91, 0, 0.18) 0 22%, transparent 22% 100%),
    #eef9f1;
  color: #14532d;
}

.exam-nav-chip.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quiz-card {
  scroll-margin-top: 12px;
  position: relative;
  border-color: #aacbc6;
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.62) 0%, rgba(255, 255, 255, 0.94) 38%, #ffffff 100%);
  box-shadow: 0 20px 48px rgba(15, 76, 72, 0.13);
}

.quiz-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: var(--accent);
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

#domainTag {
  flex: 1 1 260px;
  min-width: 0;
  text-align: right;
  color: var(--accent-dark);
}

#questionNumber {
  flex: 0 0 auto;
  white-space: nowrap;
}

h2 {
  margin: 0 0 22px;
  font-size: 24px;
  line-height: 1.32;
  letter-spacing: 0;
}

#questionTitle {
  min-height: 56px;
}

.answers {
  display: grid;
  gap: 10px;
  min-height: 250px;
  align-content: start;
}

.answer {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  font-weight: 650;
  line-height: 1.34;
}

.answer .letter {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6f4f1;
  color: var(--accent-dark);
  font-weight: 900;
}

.answer.correct {
  border-color: rgba(22, 124, 59, 0.45);
  background: #eef9f1;
}

.answer.correct .letter {
  background: var(--good);
  color: white;
}

.answer.wrong {
  border-color: rgba(180, 35, 24, 0.45);
  background: #fff1f0;
}

.answer.wrong .letter {
  background: var(--bad);
  color: white;
}

.answer.selected {
  border-color: rgba(15, 118, 110, 0.42);
  background: #f3fbfa;
}

.answer.selected .letter {
  background: var(--accent);
  color: #ffffff;
}

.answer:disabled {
  cursor: default;
  opacity: 1;
}

.mark-review-control {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(154, 91, 0, 0.32);
  border-radius: 8px;
  background: #fff8ed;
  color: #693900;
  font-size: 14px;
  font-weight: 850;
}

.mark-review-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--warn);
}

.explanation {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-left: 4px solid var(--accent);
  background: #f0fdfa;
  color: #164e4a;
  line-height: 1.45;
}

.explanation-answer,
.explanation-category {
  display: grid;
  gap: 3px;
}

.explanation-answer span {
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.explanation-answer strong,
.explanation-category strong {
  color: #123f3c;
  font-size: 15px;
  line-height: 1.35;
}

.explanation-category {
  display: block;
  padding: 0;
  color: #4f7f79;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.explanation-category strong {
  color: #3f6f69;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.explanation-source {
  margin-top: -8px;
  font-size: 11px;
  line-height: 1.3;
}

.explanation-source a {
  color: #0f766e;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.explanation-why {
  margin: 0;
  color: #1f5f5a;
}

.explanation-memory,
.explanation-distractors {
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.explanation-memory > strong,
.explanation-distractors > strong {
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.explanation-memory p,
.explanation-distractors p {
  margin: 4px 0 0;
}

.explanation-distractors ul {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.explanation-distractors li > span {
  color: #174e4a;
  font-weight: 750;
}

.explanation-distractors li > p {
  color: #3f6f69;
  font-size: 13px;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  min-height: 50px;
  align-items: center;
}

.actions button {
  min-width: 136px;
}

.actions.exam-result-actions {
  justify-content: flex-end;
}

.actions.exam-result-actions #prevButton {
  display: none !important;
}

.next-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.stage-summary-panel {
  min-height: 262px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 26px;
  padding: 26px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background: #f0fdfa;
}

.score-ring {
  --score: 0;
  --score-color: var(--good);
  width: 154px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--score-color) calc(var(--score) * 1%), #fee2e2 0);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
}

.score-ring.fail {
  --score-color: var(--bad);
}

.score-ring.fail span {
  color: #7f1d1d;
}

.score-ring span {
  color: #14532d;
  font-size: 30px;
  font-weight: 900;
}

.stage-summary-copy {
  display: grid;
  gap: 8px;
}

.stage-summary-kicker {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.exam-result.fail {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff7f7;
}

.exam-result.fail .stage-summary-kicker {
  color: var(--bad);
}

.exam-result.pass {
  border-color: rgba(22, 124, 59, 0.28);
}

.stage-summary-copy strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.15;
}

.stage-summary-copy span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.exam-time-summary,
.exam-domain-summary {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.exam-time-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.exam-time-summary span {
  padding: 8px 10px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 13px;
}

.exam-domain-summary {
  padding: 0;
  list-style: none;
}

.exam-domain-summary li {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(15, 118, 110, 0.18);
}

.exam-domain-summary strong,
.exam-domain-summary em {
  color: var(--ink);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.failed-review {
  display: grid;
  gap: 12px;
}

.failed-review-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: #fffdfb;
}

.failed-review-item h3,
.failed-review-item p {
  margin: 0;
}

.failed-review-item h3 {
  font-size: 16px;
  line-height: 1.35;
}

.failed-review-item p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.failed-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.failed-review-header span,
.failed-review-header strong {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.failed-review-header span {
  color: var(--muted);
}

.failed-review-header strong {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.1);
  color: var(--bad);
}

.failed-review-answer {
  padding: 10px 12px;
  border-radius: 8px;
}

.failed-review-answer.chosen {
  border: 1px solid rgba(180, 35, 24, 0.18);
  background: #fff7f7;
}

.failed-review-answer.correct {
  border: 1px solid rgba(22, 124, 59, 0.2);
  background: #f2fbf5;
}

.failed-review-rationale {
  padding-top: 2px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.summary > div {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-value {
  font-size: 24px;
  font-weight: 900;
}

.summary-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.resource-panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.resource-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.resource-copy {
  max-width: 860px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.text-button {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.text-button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.text-button-primary:hover,
.text-button-primary:focus-visible {
  border-color: var(--accent-dark);
}

.text-button:hover,
.text-button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  border-color: var(--accent);
}

.guide-viewer {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.guide-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f8;
}

.guide-tab {
  min-height: 40px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.guide-tab[aria-selected="true"] {
  border-color: var(--line);
  background: var(--panel);
  color: var(--accent-dark);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.guide-tab-panel {
  min-height: 188px;
  padding: 4px 2px 2px;
}

.guide-tab-panel:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
}

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

.guide-panel-span {
  grid-column: 1 / -1;
}

.guide-viewer h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.guide-viewer ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.site-footer a,
.back-link {
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
}

.legal-page {
  max-width: 900px;
}

.back-link {
  display: inline-block;
  margin: 8px 0 0;
}

.legal-page .resource-panel > h1 {
  margin-bottom: 22px;
}

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

.legal-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.legal-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.legal-grid h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.legal-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
  }

}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1040px);
    padding-top: 14px;
  }

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

  .hero-side {
    align-items: start;
    justify-content: flex-start;
  }

  .cert-reference {
    width: min(188px, 100%);
    justify-items: start;
  }

  .cert-context {
    text-align: left;
  }

  .jump-links {
    margin-top: -2px;
  }

  .jump-links a {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .ad-leaderboard {
    display: none;
  }

  .ad-mobile {
    display: grid;
    justify-items: stretch;
  }

  .ad-card-compact {
    width: 100%;
    min-height: 96px;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    row-gap: 4px;
    justify-items: start;
    padding: 16px 18px;
    text-align: left;
  }

  .ad-card-compact img {
    grid-row: 1 / span 2;
    align-self: center;
  }

  .card {
    padding: 18px;
  }

  .path-panel {
    min-height: 630px;
    padding: 18px;
  }

  .path-heading {
    display: grid;
  }

  .stage-score {
    justify-items: start;
  }

  .stage-description {
    min-height: 88px;
  }

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

  h2 {
    font-size: 20px;
  }

  #questionTitle {
    min-height: 70px;
  }

  .answers {
    min-height: 300px;
  }

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

  .stage-summary-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 394px;
    text-align: center;
  }

  .score-ring {
    width: 132px;
  }

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

  .resource-heading,
  .legal-grid {
    grid-template-columns: 1fr;
  }

  .resource-heading {
    display: grid;
  }

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

  .resource-actions .text-button {
    min-width: 0;
    flex: 1 1 144px;
  }

  .resource-panel {
    padding: 18px;
  }

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

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

  .site-footer {
    display: grid;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

}
