:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #5c6570;
  --border: #d8dee4;
  --accent: #1273eb;
  --accent-soft: #e8f1fd;
  --success: #0d8050;
  --success-soft: #e6f5ee;
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.xero-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.xero-header__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
}

.xero-header__logo {
  display: block;
  height: 22px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
}

#app {
  min-height: 100vh;
}

/* Home only: reserve space so fixed “Clear progression” does not cover the last section. */
#app.app--chooser {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

.cert-progress-clear {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  left: auto;
  z-index: 40;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  max-width: min(18rem, calc(100vw - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
}

@media (max-width: 480px) {
  #app.app--chooser {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  }

  .cert-progress-clear {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    max-width: calc(100vw - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  }
}

.cert-progress-clear:hover:not(:disabled) {
  border-color: #b8c4d0;
  background: #fafbfc;
}

.cert-progress-clear:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cert-progress-clear:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 1rem;
}

.home-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.home-section--first {
  margin-top: 1rem;
  padding-top: 0;
  border-top: none;
}

.home-section__title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.home-section__body {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: 52ch;
}

.home-section__empty {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.field input {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.assessment-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.assessment-picker__btn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fafbfc;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}

.assessment-picker__btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.assessment-picker__btn--soon,
.assessment-picker__btn--locked,
.assessment-picker__btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.assessment-picker__btn--soon:hover {
  border-color: var(--border);
  background: #fafbfc;
}

.assessment-picker__btn--locked:hover {
  border-color: var(--border);
  background: #fafbfc;
}

.assessment-picker__badge--locked {
  max-width: min(100%, 16rem);
  text-align: right;
  line-height: 1.35;
  white-space: normal;
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--muted);
}

.assessment-picker__label {
  flex: 1;
  min-width: min(100%, 14rem);
  line-height: 1.35;
}

.assessment-picker__badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.assessment-picker__error {
  color: var(--danger);
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.assessment-picker__loading {
  margin-top: 0.75rem;
  text-align: center;
}

.progress-wrap {
  margin-bottom: 1.25rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.progress-meta-label {
  font-weight: 500;
}

.quiz-question-series {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 0.65rem;
  letter-spacing: 0.02em;
}

.results-run-scope {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.progress-bar {
  height: 6px;
  background: #e4e9ef;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.prompt {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fafbfc;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.choice:hover {
  border-color: #b8c4d0;
  background: #fff;
}

.choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.choice span {
  flex: 1;
  font-size: 0.95rem;
}

.hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.feedback {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.feedback.ok {
  background: var(--success-soft);
  color: #054d2f;
  border: 1px solid #b8e2cc;
}

.feedback.bad {
  background: var(--danger-soft);
  color: #7a271a;
  border: 1px solid #f5c4c0;
}

.score-big {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.25rem 0 0.5rem;
}

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.pill.pass {
  background: var(--success-soft);
  color: var(--success);
}

.pill.fail {
  background: var(--danger-soft);
  color: var(--danger);
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.summary-q-series {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 0.35rem;
  letter-spacing: 0.02em;
}

.summary-item strong {
  display: block;
  margin-bottom: 0.25rem;
}

.results-subhead {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.results-subhead:first-of-type {
  margin-top: 1.25rem;
}

.results-subhead--breakdown {
  margin-top: 1.75rem;
}

.catch-up-section {
  margin-top: 0.25rem;
}

.catch-up-lead {
  margin: 0 0 1rem;
  max-width: 52ch;
}

.catch-up-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.catch-up-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: #fafbfc;
}

.catch-up-prompt {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.catch-up-missing {
  margin: 0;
  font-size: 0.875rem;
}

a.catch-up-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

a.catch-up-link:hover {
  text-decoration: underline;
}

.summary-resource {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.review-summary-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-summary-item {
  list-style: none;
}

.review-summary-series {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 0.4rem;
  letter-spacing: 0.02em;
}

.review-summary-hit {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.review-summary-hit:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.review-summary-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.review-summary-body {
  flex: 1;
  min-width: 0;
}

.review-summary-prompt {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.review-summary-answer {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.video-link-wrap {
  margin: 0 0 1.25rem;
}

.cert-central-link-wrap {
  margin: 0 0 1rem;
}

a.video-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

a.video-link-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

a.video-link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.video-wrap {
  margin: 0 0 1.25rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f1419;
  aspect-ratio: 16 / 9;
  max-height: 360px;
}

.wistia-iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
  border: 0;
}

.video-wrap--wistia-player wistia-player {
  display: block;
  width: 100%;
  max-width: 100%;
}

.quiz-timer-row {
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.quiz-timer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
}

.quiz-timer-label {
  color: var(--muted);
  font-weight: 500;
}

.quiz-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}

.quiz-timer--warn {
  color: var(--danger);
}

.quiz-timer-track {
  height: 4px;
  background: #e4e9ef;
  border-radius: 999px;
  overflow: hidden;
}

.quiz-timer-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s linear;
}

.quiz-timer-row:has(.quiz-timer--warn) .quiz-timer-bar-fill {
  background: var(--danger);
}

.time-expired-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff8e6;
  border: 1px solid #f5d78e;
  color: #5c4a00;
}

code {
  font-size: 0.9em;
  background: #eef1f5;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.results-takeaway-links {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
}

a.takeaway-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

a.takeaway-link:hover {
  text-decoration: underline;
}

.takeaway-link-sep {
  color: var(--muted);
  user-select: none;
}

/* Hidden on screen; only printed (see @media print below). */
.print-next-actions-panel {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.print-next-actions-brand {
  margin: 0 0 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #d8dee4;
}

.print-next-actions-logo {
  display: block;
  height: 22px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
}

.print-next-actions-meta {
  margin: 0 0 0.35rem;
  font-size: 10pt;
  color: #333;
}

.print-next-actions-subhead {
  margin: 1rem 0 0.5rem;
  font-size: 13pt;
}

.print-next-actions-q {
  margin: 0.85rem 0 0.25rem;
  font-size: 11pt;
  font-weight: 700;
}

.print-next-actions-answer,
.print-next-actions-learn-label,
.print-next-actions-learn-title,
.print-next-actions-body,
.print-next-actions-footnote {
  margin: 0 0 0.25rem;
  font-size: 10pt;
}

.print-next-actions-learn-label {
  font-weight: 700;
  margin-top: 0.35rem;
}

.print-next-actions-url-wrap {
  margin: 0 0 0.5rem;
  font-size: 10pt;
  word-break: break-all;
}

a.print-next-actions-url {
  color: #0b57d0;
}

@media print {
  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  .print-next-actions-panel,
  .print-next-actions-panel * {
    visibility: visible;
  }

  .print-next-actions-panel {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
    color: #000;
    background: #fff;
  }

  .print-next-actions-panel h1 {
    font-size: 18pt;
    margin: 0 0 0.5rem;
  }

  .print-next-actions-logo {
    height: 28px;
    max-width: 200px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-next-actions-brand {
    border-bottom-color: #ccc;
  }

  @page {
    margin: 0.5in;
  }
}
