:root {
  --primary: #1e3a8a;
  --secondary: #2563eb;
  --accent: #38bdf8;
  --success: #22c55e;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eff6ff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbeafe;
  --border-strong: #93c5fd;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --ok-bg: #dcfce7;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 8px 26px rgba(15, 23, 42, 0.07);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.9), rgba(248, 250, 252, 0.95) 34%),
    var(--background);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.75);
  outline-offset: 3px;
}

.questionnaire-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.home-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 44px;
}

.hero-section {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 350px;
  height: clamp(350px, 42vw, 500px);
  place-items: center;
  overflow: hidden;
  padding: clamp(28px, 5vw, 56px) 16px;
  text-align: center;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 58, 138, 0.92)),
    var(--primary);
}

.hero-banner-bg,
.hero-banner-overlay {
  position: absolute;
  inset: 0;
}

.hero-banner-bg {
  z-index: -3;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 900ms ease;
}

.hero-banner-bg-active {
  opacity: 1;
}

.hero-banner-bg-next {
  z-index: -2;
}

.hero-banner-bg-next.is-visible {
  opacity: 1;
}

.hero-banner-overlay {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(5, 10, 20, 0.26), rgba(5, 10, 20, 0.5)),
    rgba(0, 0, 0, 0.35);
}

.hero-content {
  display: flex;
  width: min(760px, 100%);
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vw, 16px);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.brand-logo {
  display: block;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid rgba(219, 234, 254, 0.9);
  box-shadow: var(--shadow-soft);
}

.hero-logo {
  width: clamp(94px, 12vw, 132px);
  height: clamp(94px, 12vw, 132px);
  border-radius: 24px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.brand-logo-small {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  padding: 4px;
}

.eyebrow {
  margin: 8px 0 0;
  color: var(--secondary);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-section h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-weight: 900;
  line-height: 0.96;
}

.logo {
  margin: 0;
  color: var(--primary);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 1;
}

.hero-subtitle {
  width: min(680px, 100%);
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 800;
}

.hero-copy {
  width: min(720px, 100%);
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.24rem);
}

.home-content {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 0;
  text-align: center;
}

.module-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 0;
}

.module-card,
.card,
.question-card,
.result-card,
.stat-card,
.dashboard-section,
.feedback-card {
  background: var(--surface);
  border: 1px solid rgba(219, 234, 254, 0.9);
  box-shadow: var(--shadow-soft);
}

.module-card {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px;
  border-radius: var(--radius);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.feedback-card {
  display: grid;
  width: 100%;
  gap: 18px;
  margin: 22px auto 0;
  border-radius: var(--radius);
  padding: 28px;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.feedback-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.module-icon,
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 900;
  font-size: 0.9rem;
}

.module-card h2 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.module-card p,
.privacy-note,
.lead,
.question-help {
  color: var(--muted);
}

.module-card p {
  margin: 0;
}

.privacy-note {
  width: min(760px, 100%);
  margin: 18px auto 0;
  font-size: 0.95rem;
}

.links {
  color: var(--muted);
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 32px;
  color: var(--muted);
}

.site-footer-inner {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(30, 58, 138, 0.14);
  padding-top: 18px;
}

.site-footer-legal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
}

.site-footer small {
  display: block;
  font-size: 0.82rem;
  line-height: 1.55;
}

.site-footer-copyright {
  color: var(--text);
  font-weight: 700;
}

.site-footer-attribution {
  max-width: 860px;
}

.site-footer-legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.site-footer-legal-nav a {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.button,
.big {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.button:hover,
.big:hover {
  transform: translateY(-1px);
}

.button-primary,
.big {
  background: var(--secondary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.button-primary:hover,
.big:hover {
  background: var(--primary);
}

.button-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border-strong);
}

.button:disabled,
.big:disabled,
button.option:disabled,
textarea:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.container {
  width: min(960px, calc(100% - 32px));
  margin: 32px auto;
}

.card {
  padding: 30px;
  border-radius: var(--radius);
}

label {
  display: block;
  margin: 12px 0;
  color: var(--text);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  background: #ffffff;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-size: 1.16rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
}

.module-pill,
.completion-badge {
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.9rem;
}

.question-panel {
  width: min(900px, 100%);
  margin: 0 auto;
}

.progress-text {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  margin-bottom: 18px;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  transition: width 260ms ease;
}

.question-card {
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow);
}

.question-title {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.2;
}

.question-help {
  margin: 10px 0 24px;
  font-size: 1rem;
}

.option-grid {
  display: grid;
  gap: 12px;
}

.option-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.option-card:hover {
  border-color: var(--secondary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.option-card.selected {
  border-color: var(--secondary);
  background: var(--secondary);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
}

.option-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 900;
  font-size: 0.85rem;
}

.option-card.selected .option-index {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.open-answer {
  min-height: 170px;
}

.question-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}

.question-actions .button {
  min-width: 140px;
}

.generation-card {
  display: grid;
  gap: 16px;
}

.generation-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #dbeafe;
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.generation-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.generation-status.error {
  color: var(--danger);
}

.generation-percent {
  color: var(--primary);
}

.generation-progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.generation-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), var(--accent), var(--success));
  transition: width 420ms ease;
}

.generation-error {
  margin-bottom: 0;
}

.generation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.message {
  margin: 16px 0;
  padding: 13px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.hidden {
  display: none;
}

.status-box {
  background: var(--ok-bg);
  color: #166534;
  border: 1px solid #bbf7d0;
}

.error,
.error-box {
  color: var(--danger);
}

.error-box {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  padding: 13px 14px;
  border-radius: 12px;
}

.loading-card {
  color: var(--muted);
  font-weight: 800;
}

.fade-in {
  animation: fadeIn 220ms ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.result-hero,
.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.result-title h1,
.dashboard-hero h1 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.08;
}

.result-title p,
.dashboard-hero p {
  margin: 6px 0 0;
  color: var(--muted);
}

.dashboard-tools {
  margin-top: 14px;
}

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

.result-card {
  border-radius: var(--radius);
  padding: 24px;
}

.result-card-wide {
  grid-column: 1 / -1;
}

.result-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 1.25rem;
}

.stable-report,
.visual-report {
  display: grid;
  gap: 20px;
}

.report-hero {
  margin-bottom: 0;
  border-bottom: 1px solid rgba(30, 58, 138, 0.14);
  padding-bottom: 20px;
}

.report-summary,
.report-section,
.ai-report-text,
.next-step-card,
.final-message-card {
  border: 1px solid rgba(203, 213, 225, 0.88);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.report-summary {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.45fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
  padding: clamp(24px, 5vw, 42px);
  background:
    linear-gradient(135deg, rgba(30, 58, 138, 0.98), rgba(37, 99, 235, 0.92)),
    var(--primary);
  color: #ffffff;
}

.report-summary .module-pill {
  display: inline-flex;
  width: fit-content;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.report-summary h2 {
  margin: 14px 0 0;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1.1;
}

.report-summary p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1.02rem, 2vw, 1.18rem);
}

.report-section {
  padding: clamp(22px, 4vw, 34px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 20px;
}

.section-heading h2,
.next-step-card h2,
.final-message-card h2 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.45rem, 3vw, 2.05rem);
}

.section-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(280px, 1.25fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
}

.chart-card {
  display: grid;
  min-height: 300px;
  place-items: center;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  padding: clamp(18px, 3vw, 28px);
}

.css-doughnut {
  position: relative;
  display: grid;
  width: min(260px, 72vw);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: var(--chart-gradient);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.css-doughnut::before {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0.8);
  content: "";
}

.css-doughnut span {
  position: relative;
  z-index: 1;
  color: var(--primary);
  font-weight: 900;
}

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

.interest-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.88);
  background: #ffffff;
  padding: 14px;
}

.interest-chip span {
  display: block;
  flex: 0 0 auto;
  width: 14px;
  height: 44px;
  border-radius: 999px;
  background: var(--chip-color);
}

.interest-chip strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.interest-chip small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.insight-grid,
.pathway-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.insight-card,
.environment-card,
.pathway-card,
.notice-card {
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.88);
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.insight-card,
.environment-card {
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.insight-card:hover,
.environment-card:hover,
.pathway-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.insight-card h3,
.environment-card h3,
.pathway-card h3 {
  margin: 14px 0 8px;
  color: var(--primary);
  font-size: 1.1rem;
}

.insight-card p,
.environment-card p,
.pathway-card p,
.notice-card p,
.next-step-card p,
.final-message-card p {
  margin: 0;
  color: var(--muted);
}

.pathway-card {
  border-top: 5px solid var(--secondary);
}

.strength-card {
  border-top: 5px solid var(--success);
}

.insight-tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.pathway-tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.pathway-school-note {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 14px;
}

.pathway-school-note p {
  color: #166534;
  font-weight: 700;
}

.pathway-school-note .button {
  width: fit-content;
  border-color: #86efac;
  color: #166534;
}

.pathway-card p + p {
  margin-top: 10px;
}

.pathway-card strong {
  color: var(--text);
}

.notice-card {
  margin-top: 16px;
  background: #fff7ed;
  border-color: #fed7aa;
}

.neutral-notice {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.notice-card p {
  color: #9a3412;
  font-weight: 700;
}

.neutral-notice p {
  color: var(--muted);
}

.insight-card-wide {
  grid-column: 1 / -1;
}

.report-two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.next-step-card,
.final-message-card {
  padding: clamp(22px, 4vw, 30px);
}

.next-step-card {
  border-top: 5px solid var(--success);
}

.final-message-card {
  border-top: 5px solid var(--accent);
}

.next-step-card p:not(.eyebrow),
.final-message-card p:not(.eyebrow) {
  margin-top: 12px;
  font-size: 1.02rem;
}

.report-text {
  white-space: pre-wrap;
  margin: 0;
  color: var(--text);
}

.ai-report-text {
  display: grid;
  gap: 14px;
  padding: clamp(20px, 3vw, 28px);
  color: var(--text);
}

.ai-report-text h3 {
  margin: 8px 0 0;
  color: var(--primary);
  font-size: 1.15rem;
}

.ai-report-text h3:first-child {
  margin-top: 0;
}

.ai-report-text p {
  margin: 0;
}

.ai-report-text ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2rem;
}

.chart-empty,
.result-empty-state p:not(.error-box) {
  color: var(--muted);
  font-weight: 700;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.score-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.score-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.score-value {
  color: var(--primary);
  font-weight: 900;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
}

td,
th {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px;
  text-align: left;
}

th {
  color: var(--primary);
  background: var(--surface-soft);
}

tr:last-child td {
  border-bottom: 0;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.stat-card,
.dashboard-section {
  border-radius: var(--radius);
  padding: 20px;
}

.stat-card span {
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--primary);
  font-size: 2rem;
}

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

.dashboard-section-wide {
  grid-column: 1 / -1;
}

.admin-test-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.admin-test-form fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.admin-test-form legend {
  color: var(--primary);
  font-weight: 900;
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-weight: 800;
}

.checkbox-row small {
  color: var(--muted);
  font-weight: 700;
}

.admin-test-form .result-actions {
  grid-column: 1 / -1;
}

.admin-ai-output {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 16px;
  color: var(--text);
  font: inherit;
}

.result-feedback-card {
  margin-top: 0;
}

.dashboard-feedback {
  display: grid;
  gap: 18px;
  margin: 26px 0;
}

.dashboard-heading h2 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.45rem, 3vw, 2.05rem);
}

.dashboard-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.feedback-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 2px;
}

.feedback-heading h2 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.18;
}

.feedback-heading p {
  margin: 0;
  color: var(--muted);
}

.feedback-module-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.feedback-form {
  display: grid;
  gap: 16px;
}

.feedback-form .message {
  margin: 0;
}

.feedback-field {
  display: grid;
  gap: 10px;
}

.feedback-label,
.feedback-fieldset legend {
  color: var(--text);
  font-weight: 600;
}

.feedback-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-star {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 1.34rem;
  line-height: 1;
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.feedback-star:hover,
.feedback-star.is-active {
  border-color: #facc15;
  background: #fffbeb;
  color: #facc15;
  box-shadow: 0 8px 18px rgba(250, 204, 21, 0.18);
  transform: translateY(-1px) scale(1.02);
}

.feedback-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.feedback-choice,
.feedback-comment-label,
.feedback-problem-check,
.feedback-reason {
  margin: 0;
}

.feedback-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}

.feedback-choice input,
.feedback-problem-check input {
  width: auto;
  margin: 0;
}

.feedback-problem-details {
  display: grid;
  gap: 14px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: var(--surface-soft);
  padding: 18px;
}

.feedback-problem-details.hidden {
  display: none;
}

.feedback-problem-details h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 600;
}

.feedback-problem-list {
  display: grid;
  gap: 10px;
}

.feedback-problem-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.38fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  padding: 14px 16px;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.feedback-problem-item.is-selected {
  border-color: var(--secondary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.feedback-problem-item:hover {
  border-color: var(--secondary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.feedback-problem-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
}

.feedback-problem-check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-reason {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.feedback-reason select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.feedback-comment-label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.feedback-comment-label textarea {
  min-height: 118px;
}

.feedback-privacy,
.feedback-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
}

.feedback-actions {
  display: flex;
  justify-content: flex-start;
}

.feedback-actions .button {
  min-width: 170px;
}

.feedback-card.is-submitted {
  border-color: var(--border-strong);
}

.feedback-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-feedback .dashboard-stats {
  margin: 0;
}

.feedback-bars {
  display: grid;
  gap: 12px;
}

.feedback-bar-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
}

.feedback-bar-row > span:first-child {
  color: var(--text);
  font-weight: 500;
}

.feedback-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.feedback-bar-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
}

.feedback-bar-row strong {
  color: var(--primary);
  text-align: right;
}

.feedback-module-breakdown {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feedback-module-breakdown li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.feedback-module-breakdown span {
  color: var(--text);
  font-weight: 500;
}

.feedback-module-breakdown strong,
.rating-stars-inline {
  color: var(--primary);
  font-weight: 800;
}

.feedback-detail-section {
  display: grid;
  gap: 18px;
}

.feedback-detail-analytics {
  margin: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feedback-detail-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 18px;
}

.feedback-detail-filters label {
  margin: 0;
  color: var(--text);
  font-weight: 700;
}

.feedback-detail-filters select,
.feedback-detail-filters input[type="date"] {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
}

.feedback-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-result-summary p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.feedback-details-table {
  min-width: 980px;
}

.feedback-details-table td {
  vertical-align: top;
}

.feedback-comment-cell {
  max-width: 260px;
}

.feedback-detail-toggle {
  min-height: 40px;
  padding: 10px 12px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.feedback-detail-expansion td {
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 0;
}

.feedback-detail-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.feedback-detail-grid,
.feedback-problem-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feedback-detail-meta,
.feedback-detail-comment,
.feedback-detail-problems,
.feedback-problem-detail-card {
  border-radius: 14px;
  border: 1px solid rgba(203, 213, 225, 0.88);
  background: #ffffff;
  padding: 14px;
}

.feedback-detail-meta span,
.feedback-problem-detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.feedback-detail-meta strong,
.feedback-problem-detail-grid strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.94rem;
}

.feedback-detail-meta-wide,
.feedback-problem-detail-question {
  grid-column: 1 / -1;
}

.feedback-detail-comment h3,
.feedback-detail-problems h3 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 1.05rem;
}

.feedback-detail-comment p,
.feedback-detail-problems p,
.feedback-problem-detail-question p {
  margin: 0;
  color: var(--muted);
}

.feedback-problem-detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feedback-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.feedback-pagination > span:not(.button) {
  color: var(--muted);
  font-weight: 800;
}

.button.is-disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.table-comment {
  max-width: 360px;
  color: var(--muted);
}

@media (max-width: 780px) {
  .questionnaire-shell,
  .result-shell,
  .container {
    width: min(100% - 24px, 960px);
    padding-top: 18px;
  }

  .home-content {
    width: min(100% - 24px, 960px);
    padding-top: 24px;
  }

  .site-footer {
    width: min(100% - 24px, 960px);
    padding-bottom: 24px;
  }

  .site-footer-legal-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-section {
    min-height: 250px;
    height: clamp(250px, 74vw, 350px);
    padding: 24px 12px;
  }

  .hero-logo {
    width: clamp(82px, 26vw, 110px);
    height: clamp(82px, 26vw, 110px);
    border-radius: 20px;
  }

  .hero-section h1 {
    font-size: clamp(2.35rem, 13vw, 3.5rem);
  }

  .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.18rem);
  }

  .module-grid,
  .result-grid,
  .chart-layout,
  .chart-legend,
  .interest-list,
  .insight-grid,
  .pathway-grid,
  .report-two-columns,
  .report-summary,
  .dashboard-grid,
  .dashboard-stats,
  .admin-test-form,
  .feedback-detail-filters,
  .feedback-detail-grid,
  .feedback-problem-detail-grid {
    grid-template-columns: 1fr;
  }

  .app-header,
  .result-hero,
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .question-actions {
    flex-direction: column;
  }

  .question-actions .button,
  .button,
  .big {
    width: 100%;
  }

  .module-card {
    min-height: auto;
  }

  .feedback-problem-item,
  .feedback-bar-row {
    grid-template-columns: 1fr;
  }

  .feedback-problem-check span {
    white-space: normal;
  }

  .feedback-actions .button {
    width: 100%;
  }

  .feedback-pagination {
    align-items: stretch;
    flex-direction: column;
  }
}
