.assessment-shell {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body[data-analytics-page-name="assessment"],
body[data-analytics-page-name="assessment"] main,
body[data-analytics-page-name="assessment"] .assessment-shell,
body[data-analytics-page-name="assessment"] .assessment-app {
  max-width: 100vw;
  overflow-x: clip;
}

.assessment-intro,
.gate-card,
.selector-card,
.assessment-app,
.result-card {
  padding: 24px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

body.light-mode .assessment-intro,
body.light-mode .gate-card,
body.light-mode .selector-card,
body.light-mode .assessment-app,
body.light-mode .result-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 255, 0.92));
  border-color: rgba(11, 31, 51, 0.09);
}

.intro-subtitle {
  margin-bottom: 0.35rem;
  color: var(--text);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.intro-text {
  max-width: 900px;
}

.selected-assessment {
  margin-top: 0;
  color: var(--accent-alt);
  font-weight: 700;
}

.unlock-link {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-mode .unlock-link {
  border-top-color: rgba(11, 31, 51, 0.08);
}

.estimated-time {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.consent-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.checkbox-label {
  flex: 1;
}

.consent-row .estimated-time {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.download-report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.45rem;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(79, 255, 176, 0.4);
  background: linear-gradient(135deg, rgba(23, 197, 230, 0.16), rgba(79, 255, 176, 0.18));
  color: var(--text);
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.download-report-btn:hover,
.download-report-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(79, 255, 176, 0.7);
  background: linear-gradient(135deg, rgba(23, 197, 230, 0.24), rgba(79, 255, 176, 0.28));
}

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

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

.progress-track,
.tiny-bar,
.chart-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill,
.tiny-bar-fill,
.chart-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--warning), var(--accent));
}

body.light-mode .progress-track,
body.light-mode .tiny-bar,
body.light-mode .chart-bar {
  background: rgba(11, 31, 51, 0.05);
  border-color: rgba(11, 31, 51, 0.08);
}

.question-card,
.assessment-option,
.category-score,
.stat {
  padding: 5px;
  min-width: 0;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

body.light-mode .question-card,
body.light-mode .assessment-option,
body.light-mode .category-score,
body.light-mode .stat {
  background: rgba(11, 31, 51, 0.03);
  border-color: rgba(11, 31, 51, 0.08);
}

.question-card {
  margin-bottom: 0.35rem;
}

.question-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 5px;
}

.question-heading h3 {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.2;
}

.question-help {
  position: relative;
  flex-shrink: 0;
}

.question-help-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(23, 197, 230, 0.32);
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: help;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.question-help-btn:hover,
.question-help-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(79, 255, 176, 0.6);
  background: rgba(79, 255, 176, 0.08);
}

.question-tooltip {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(280px, 70vw);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 12, 21, 0.97);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.45;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 10;
}

.question-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: rgba(5, 12, 21, 0.97);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(45deg);
}

.question-help:hover .question-tooltip,
.question-help:focus-within .question-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  min-width: 0;
}

.answer-btn {
  min-height: 34px;
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.answer-btn:hover,
.answer-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(79, 255, 176, 0.45);
}

.answer-btn.selected {
  border-color: rgba(23, 197, 230, 0.55);
  background: rgba(23, 197, 230, 0.14);
  box-shadow: 0 0 0 1px rgba(23, 197, 230, 0.18);
}

body.light-mode .answer-btn {
  background: rgba(11, 31, 51, 0.03);
  border-color: rgba(11, 31, 51, 0.08);
}

body.light-mode .answer-btn.selected {
  background: rgba(23, 197, 230, 0.1);
}

.assessment-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.result-stats {
  margin-top: 1rem;
}

.stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.6rem;
}

.recommendations {
  margin-top: 1rem;
}

.recommendations ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.assessment-options {
  margin-top: 1rem;
}

.assessment-option {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.9rem;
  align-items: start;
}

.assessment-option h3,
.assessment-option p {
  margin: 0;
}

.assessment-option p {
  color: var(--muted);
}

.assessment-option.selected {
  border-color: rgba(23, 197, 230, 0.42);
  box-shadow: 0 14px 32px rgba(23, 197, 230, 0.14);
}

.assessment-option.disabled {
  opacity: 0.65;
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #041018;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
}

.chart-wrap {
  margin-top: 1rem;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 3fr auto;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.5rem;
  min-width: 0;
}

@media (max-width: 760px) {
  body[data-analytics-page-name="assessment"] {
    overflow-x: hidden;
  }

  .assessment-intro,
  .gate-card,
  .selector-card,
  .assessment-app,
  .result-card {
    padding: 14px 8px;
  }

  .assessment-shell {
    gap: 14px;
  }

  #leadGateForm input,
  #leadGateForm select,
  #leadGateForm textarea {
    font-size: 16px;
  }

  .question-card {
    padding: 4px;
    margin-bottom: 0.25rem;
  }

  .question-heading {
    gap: 4px;
    margin-bottom: 4px;
  }

  .question-heading h3 {
    font-size: 0.79rem;
    line-height: 1.14;
  }

  .answer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
  }

  .answer-btn {
    min-height: 30px;
    padding: 0.38rem 0.2rem;
    font-size: 0.7rem;
    letter-spacing: -0.01em;
  }

  .consent-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .consent-row .estimated-time {
    width: 100%;
    margin-left: 0;
    padding-left: calc(18px + 0.7rem);
    text-align: left;
  }

  .chart-row {
    grid-template-columns: minmax(70px, 0.95fr) minmax(0, 2.2fr) auto;
    gap: 0.35rem;
    font-size: 0.72rem;
  }

  .result-stats,
  .category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .question-heading h3 {
    font-size: 0.75rem;
  }

  .answer-btn {
    font-size: 0.66rem;
  }

  .question-tooltip {
    right: auto;
    left: -8px;
    width: min(260px, calc(100vw - 4rem));
  }

  .question-tooltip::before {
    right: auto;
    left: 14px;
  }

  .assessment-shell,
  .assessment-app,
  .result-card,
  .selector-card,
  .gate-card,
  .assessment-intro {
    max-width: 100%;
  }
}

@media (max-width: 760px) and (hover: none) and (pointer: coarse) {
  .question-tooltip {
    top: auto;
    bottom: calc(100% + 0.45rem);
    right: calc(100% - 18px);
    left: auto;
    width: min(260px, calc(100vw - 3rem));
    transform: translateY(4px);
  }

  .question-tooltip::before {
    top: auto;
    bottom: -6px;
    right: 14px;
    left: auto;
    border-left: none;
    border-top: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .question-help:hover .question-tooltip,
  .question-help:focus-within .question-tooltip {
    transform: translateY(0);
  }
}
