/* ==========================================================
   20 to 32 Smile Check
   This file controls the colors, layout, spacing, and animations.
   ========================================================== */

/* These are reusable color and shadow values for the whole site. */
:root {
  --bg: #f4f7fa;
  --ink: #102033;
  --muted: #617083;
  --subtle: #7b8a9b;
  --card: #ffffff;
  --mint: #2bb9a6;
  --mint-dark: #087f74;
  --blue: #1f5fbf;
  --blue-dark: #174b98;
  --purple: #5667d8;
  --pink: #c84b7d;
  --yellow: #eab83a;
  --orange: #b85f12;
  --danger: #c83256;
  --success: #0e7f63;
  --line: #d9e2ec;
  --line-strong: #c7d3df;
  --surface: #eef4f8;
  --surface-strong: #e5eef5;
  --focus: #8bb9ff;
  --shadow: 0 14px 34px rgba(16, 32, 51, 0.08);
  --shadow-soft: 0 8px 20px rgba(16, 32, 51, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --space-section: clamp(52px, 7vw, 84px);
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Baloo 2", "Inter", system-ui, sans-serif;
  /* Exact blue + teal sampled from the logo (images/logo-20to32.png). */
  --brand-blue: #0070fd;
  --brand-teal: #00d1cb;
  --brand-gradient: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
  --gold: #e8a700;
}

/* Reset browser defaults so layouts behave predictably. */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, #f8fbfd 0%, var(--bg) 36%, #eef4f8 100%),
    radial-gradient(circle at top left, rgba(31, 95, 191, 0.08), transparent 28rem),
    radial-gradient(circle at top right, rgba(43, 185, 166, 0.11), transparent 24rem),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--blue-dark);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(16, 32, 51, 0.08);
  box-shadow: 0 6px 18px rgba(16, 32, 51, 0.04);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

/* Real logo (shown only once images/logo-20to32.png loads). */
.brand-logo {
  display: block;
  height: 42px;
  width: auto;
}

.brand.has-logo .brand-icon,
.brand.has-logo .brand-text {
  display: none;
}

.brand-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(8, 127, 116, 0.16);
  border-radius: 11px;
  background: linear-gradient(145deg, #e8f7f5, #ffffff);
  box-shadow: 0 8px 18px rgba(8, 127, 116, 0.1);
}

.brand-icon svg {
  width: 23px;
  height: 23px;
  fill: var(--mint-dark);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.nav-links a {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: #e8f1fb;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(31, 95, 191, 0.1);
}

/* Shared page sections */
.section-screen,
.about {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--space-section) 0;
}

.section-screen {
  display: none;
}

.active-screen {
  display: block;
  animation: riseIn 0.45s ease both;
}

.section-heading {
  max-width: 720px;
  margin: 0 auto 30px;
  text-align: center;
}

.section-heading h2,
.about h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.section-heading p,
.about-card > p {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.08rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(43, 185, 166, 0.13);
  color: var(--mint-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Landing page */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(28px, 5vw, 54px);
  align-items: center;
  min-height: calc(100vh - 84px);
}

.hero h1 {
  max-width: 720px;
  font-family: var(--font-display);
  font-size: clamp(2.65rem, 6.4vw, 4.8rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.subtitle {
  margin-top: 20px;
  color: var(--blue-dark);
  font-size: clamp(1.15rem, 2.3vw, 1.55rem);
  font-weight: 700;
}

.hero-text {
  max-width: 640px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions,
.center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 28px;
}

.center-actions {
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 17px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue), var(--mint-dark));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 112, 253, 0.24);
}

.btn-soft {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.btn-soft:hover {
  border-color: var(--line-strong);
  background: #f8fbfd;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(23, 50, 77, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 252, 0.92)),
    radial-gradient(circle at 20% 15%, rgba(43, 185, 166, 0.14), transparent 13rem);
  box-shadow: var(--shadow);
}

/* Mascot in the hero (shown only once images/mascot.png loads). */
.hero-mascot {
  display: block;
  width: min(320px, 78%);
  height: auto;
  margin: 8px auto 4px;
  filter: drop-shadow(0 18px 28px rgba(16, 32, 51, 0.18));
}

.hero-card.show-mascot .clinical-illustration {
  display: none;
}

.clinical-illustration {
  display: grid;
  min-height: 330px;
  place-items: center;
  border: 1px solid rgba(16, 32, 51, 0.06);
  border-radius: 18px;
  background: linear-gradient(160deg, #edf8f7, #f7fbff 62%, #ffffff);
}

.clinical-illustration svg {
  width: min(100%, 420px);
  height: auto;
}

.screen-shape {
  fill: #ffffff;
  stroke: #d8e7ef;
  stroke-width: 2;
}

.line-shape {
  fill: #d9e7f2;
}

.primary-line {
  fill: #2563eb;
  opacity: 0.86;
}

.chart-ring {
  fill: none;
  stroke: #d9e7f2;
  stroke-width: 13;
}

.chart-arc {
  fill: none;
  stroke: #38bfa7;
  stroke-linecap: round;
  stroke-width: 13;
}

.tooth-shape {
  fill: #ffffff;
  stroke: #2563eb;
  stroke-width: 5;
}

.care-line {
  fill: none;
  stroke: #38bfa7;
  stroke-linecap: round;
  stroke-width: 8;
}

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

.mini-stat-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.mini-stat-grid strong,
.mini-stat-grid span {
  display: block;
}

.mini-stat-grid strong {
  font-size: 1.55rem;
}

.mini-stat-grid span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

/* Smile Check Quiz */
.quiz-card,
.result-card,
.recommendation-card,
.visual-dashboard,
.report-card,
.admin-panel,
.analytics-card,
.metric-card,
.impact-card,
.impact-section-card,
.module-panel,
.clinical-card,
.prevention-card,
.age-guidance-card,
.access-result-card,
.team-detail,
.resource-card,
.explorer-panel,
.age-control-card,
.development-card,
.dental-chart-card,
.fact-card,
.achievement-card,
.myth-card,
.dashboard-panel,
.history-card,
.about-card,
.certificate-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.quiz-card {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.96));
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  margin: 12px 0 30px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-fill {
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
  transition: width 0.35s ease;
}

.quiz-card h3 {
  margin-bottom: 22px;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.2;
}

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

.answer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-weight: 650;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.answer-option:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 12px 24px rgba(18, 36, 58, 0.07);
}

.answer-option.selected {
  border-color: var(--blue);
  background: #edf5ff;
  box-shadow: inset 0 0 0 1px rgba(31, 95, 191, 0.08);
}

.answer-marker {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--blue);
  font-weight: 800;
}

.form-status {
  min-height: 1.4em;
  margin-top: 14px;
  color: var(--danger);
  font-weight: 750;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

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

.result-card {
  min-height: 236px;
  padding: 26px;
}

.score-card {
  display: grid;
  align-content: center;
  background: linear-gradient(150deg, #ffffff, #edf7f7);
}

.result-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.big-score {
  margin: 8px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5.8rem);
  font-weight: 800;
  line-height: 1;
}

.risk-pill {
  display: inline-flex;
  width: fit-content;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(6, 185, 138, 0.12);
  color: var(--success);
  font-weight: 750;
}

.risk-pill.moderate {
  background: rgba(255, 138, 76, 0.16);
  color: var(--orange);
}

.risk-pill.high {
  background: rgba(239, 71, 111, 0.13);
  color: var(--danger);
}

.badge-card {
  display: grid;
  place-items: center;
  text-align: center;
}

.badge-icon,
.certificate-badge {
  display: grid;
  width: 98px;
  height: 98px;
  margin: 12px auto;
  place-items: center;
  border: 1px solid #dbe5ef;
  border-radius: 22px;
  background: linear-gradient(145deg, #eef6ff, #ffffff);
  font-size: 2.8rem;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
}

.badge-card h3 {
  font-size: 1.8rem;
}

.badge-card p {
  color: var(--muted);
}

.visual-dashboard,
.report-card,
.recommendation-card {
  margin-top: 18px;
  padding: 26px;
}

.dashboard-summary,
.report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-summary h3,
.report-heading h3,
.achievement-card h3 {
  margin-top: 4px;
  font-size: 1.35rem;
}

.dashboard-summary p,
.report-note {
  color: var(--muted);
  font-weight: 650;
}

.donut-chart {
  display: grid;
  flex: 0 0 auto;
  width: 126px;
  height: 126px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 58%, transparent 60%),
    conic-gradient(var(--blue) calc(var(--score) * 1%), var(--surface-strong) 0);
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(23, 50, 77, 0.06);
}

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

.habit-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.habit-card span,
.category-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.habit-card strong {
  display: block;
  margin: 4px 0;
  font-size: 1.35rem;
}

.habit-card p {
  color: var(--muted);
  font-weight: 600;
}

.habit-card.strong {
  border-color: rgba(8, 127, 116, 0.18);
  background: rgba(43, 185, 166, 0.09);
}

.habit-card.weak {
  border-color: rgba(200, 50, 86, 0.16);
  background: rgba(200, 50, 86, 0.07);
}

.category-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.education-score-list {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.category-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.category-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.category-topline strong {
  font-size: 1.15rem;
}

.bar-track {
  overflow: hidden;
  height: 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.bar-fill {
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
}

.category-card p {
  color: var(--muted);
  font-weight: 600;
}

.recommendation-card h3 {
  margin-bottom: 12px;
  font-size: 1.45rem;
}

.recommendation-card ul {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.recommendation-card li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-weight: 600;
}

.clinical-card,
.prevention-card {
  margin-top: 18px;
  padding: 26px;
}

.clinical-grid,
.prevention-grid,
.age-guidance-grid,
.team-grid,
.resource-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

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

.clinical-finding-card,
.age-guidance-grid div,
.access-question-card,
.team-card,
.resource-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.clinical-finding-card strong,
.age-guidance-grid strong,
.access-question-card strong,
.team-card strong,
.resource-card strong {
  display: block;
  margin-bottom: 6px;
}

.clinical-finding-card p,
.age-guidance-grid p,
.access-question-card p,
.team-card p,
.resource-card p {
  color: var(--muted);
  font-weight: 600;
}

.evidence-recommendation,
.prevention-evidence-item {
  display: grid;
  gap: 10px;
}

.science-toggle {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 95, 191, 0.12);
  background: #eef5ff;
  color: var(--blue);
  cursor: pointer;
  font-weight: 750;
}

.science-toggle:hover {
  border-color: rgba(31, 95, 191, 0.26);
  background: #e5f0ff;
}

.science-popup {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.evidence-recommendation.open .science-popup,
.prevention-evidence-item.open .science-popup,
.resource-card.open .science-popup {
  display: grid;
}

.science-popup div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.science-popup span {
  display: block;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.science-popup p {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 650;
}

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

.prevention-grid h4 {
  margin-bottom: 12px;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-weight: 650;
}

.prevention-grid ul {
  display: grid;
  gap: 10px;
  padding-left: 0;
  color: var(--muted);
  font-weight: 650;
  list-style: none;
}

.prevention-evidence-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.prevention-evidence-item strong {
  color: var(--ink);
}

.achievement-card {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 26px;
}

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

.achievement-item {
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  text-align: center;
}

.achievement-item.unlocked {
  border-color: rgba(8, 127, 116, 0.18);
  background: linear-gradient(145deg, rgba(43, 185, 166, 0.13), rgba(255, 255, 255, 0.96));
}

.achievement-item span {
  display: block;
  margin-bottom: 6px;
  font-size: 2rem;
}

.achievement-item strong {
  display: block;
  font-size: 0.95rem;
}

.achievement-item p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.save-status {
  min-height: 1.5em;
  margin-top: 16px;
  padding: 0 8px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.save-status.success {
  color: var(--success);
}

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

/* Dashboard / History */
.dashboard-panel {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.96));
}

.dashboard-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-topline p {
  color: var(--muted);
  font-weight: 650;
}

.history-list {
  display: grid;
  gap: 12px;
}

/* Summary header: best / average / count + scores-over-time sparkline. */
.history-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 112, 253, 0.07), rgba(0, 209, 203, 0.07));
  margin-bottom: 4px;
}

.hs-stats {
  display: flex;
  gap: clamp(18px, 4vw, 32px);
}

.hs-stat span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.hs-stat strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.1;
}

.hs-stat strong i {
  font-style: normal;
  font-size: 0.5em;
  font-weight: 700;
  color: var(--muted);
}

.hs-spark-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.history-spark {
  width: 240px;
  max-width: 100%;
  height: 50px;
}

.history-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

/* Score ring (conic-gradient dial, colored by tier). */
.history-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--tier, var(--brand-blue)) calc(var(--pct, 0) * 1%), var(--surface-strong) 0);
}

.history-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.history-ring span {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
}

.history-card h3 {
  font-size: 1.12rem;
}

.history-meta {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

/* Score tiers drive the ring color + card accent. */
.history-card.tier-low { --tier: #e5547d; }
.history-card.tier-fair { --tier: var(--yellow); }
.history-card.tier-great { --tier: var(--brand-blue); }
.history-card.tier-excellent { --tier: var(--brand-teal); }
.history-card.tier-perfect { --tier: var(--gold); }

.history-card.tier-perfect {
  border: 1.5px solid var(--gold);
  background: linear-gradient(180deg, #fffdf2, #ffffff);
  box-shadow: 0 10px 26px rgba(232, 167, 0, 0.16);
}

.perfect-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6c343, #e8a700);
  color: #3a2c00;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.history-trend {
  min-width: 72px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(14, 159, 110, 0.14);
  color: var(--success);
  text-align: center;
  font-weight: 800;
}

.history-trend.down {
  background: rgba(239, 71, 111, 0.12);
  color: var(--danger);
}

.history-trend.flat {
  background: #eef4fb;
  color: var(--muted);
}

.empty-history {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #ffffff, #f8fbfd);
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

/* Tooth Development Explorer */
.explorer-panel {
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 253, 0.96));
}

.age-control-card {
  padding: 22px;
  background: #ffffff;
  box-shadow: none;
}

.age-control-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
}

.age-control-card strong {
  color: var(--ink);
  font-size: 1.4rem;
}

.age-control-card input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.age-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.explorer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.development-card {
  padding: 20px;
  background: #ffffff;
  box-shadow: none;
}

.development-card strong {
  display: block;
  margin: 8px 0;
  color: var(--blue);
  font-size: 2rem;
}

.development-card p {
  color: var(--muted);
  font-weight: 600;
}

.mini-tooth-diagram {
  display: grid;
  grid-template-columns: repeat(4, minmax(28px, 1fr));
  gap: 8px;
  min-height: 72px;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.mini-tooth {
  display: grid;
  place-items: center;
}

.mini-tooth svg {
  width: 34px;
  height: 42px;
}

.mini-empty {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.dental-chart-card,
.fact-card {
  margin-top: 16px;
  padding: 22px;
  background: #ffffff;
  box-shadow: none;
}

.age-guidance-card {
  margin-top: 16px;
  padding: 22px;
  background: #ffffff;
  box-shadow: none;
}

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

.tooth-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.tooth-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--line);
}

.legend-dot.present {
  background: var(--blue);
}

.legend-dot.erupting {
  background: var(--orange);
}

.legend-dot.lost {
  background: var(--danger);
}

.legend-dot.later {
  background: #b8c5d2;
}

.dental-chart {
  display: grid;
  grid-template-columns: repeat(16, minmax(28px, 1fr));
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbfd, #ffffff);
}

.arch-divider {
  grid-column: 1 / -1;
  margin: 6px 0 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.tooth-button {
  display: grid;
  gap: 3px;
  min-height: 76px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tooth-button svg {
  width: 34px;
  height: 42px;
}

.tooth-button span {
  color: inherit;
}

.tooth-crown {
  fill: #f2f6fa;
  stroke: #9dafc1;
  stroke-width: 2.4;
}

.tooth-label {
  fill: #5e6f82;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.tooth-button:hover,
.tooth-button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 12px 24px rgba(18, 36, 58, 0.12);
}

.tooth-button.present {
  background: #eef6ff;
  color: var(--blue);
}

.tooth-button.present .tooth-crown,
.mini-tooth.present .tooth-crown {
  fill: #eef6ff;
  stroke: var(--blue);
}

.tooth-button.present .tooth-label,
.mini-tooth.present .tooth-label {
  fill: var(--blue);
}

.tooth-button.erupting {
  background: rgba(217, 119, 6, 0.13);
  color: var(--orange);
}

.tooth-button.erupting .tooth-crown,
.mini-tooth.erupting .tooth-crown {
  fill: #fff7ed;
  stroke: var(--orange);
  stroke-dasharray: 5 3;
}

.tooth-button.erupting .tooth-label,
.mini-tooth.erupting .tooth-label {
  fill: var(--orange);
}

.mini-tooth.lost .tooth-crown {
  fill: #fff1f2;
  stroke: var(--danger);
}

.mini-tooth.lost .tooth-label {
  fill: var(--danger);
}

.tooth-button.later {
  background: #f2f6fa;
  color: #8a9aac;
}

.tooth-info {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
}

.tooth-info strong,
.tooth-info span {
  display: block;
}

.tooth-info strong {
  color: var(--ink);
}

.tooth-info span {
  margin: 3px 0 6px;
  color: var(--blue);
  font-weight: 800;
}

.fact-card h3 {
  margin: 6px 0;
}

.fact-card p {
  color: var(--muted);
  font-weight: 600;
}

/* Admin analytics dashboard */
.admin-panel {
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 252, 0.95)),
    radial-gradient(circle at top right, rgba(31, 95, 191, 0.09), transparent 20rem);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: none;
}

.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--brand-gradient);
}

.metric-card span,
.chart-heading p {
  color: var(--muted);
  font-weight: 650;
}

.metric-card span {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1;
  color: var(--ink);
}

.metric-card strong i {
  font-style: normal;
  font-size: 0.5em;
  font-weight: 700;
  color: var(--muted);
}

.metric-card p {
  color: var(--muted);
  font-weight: 600;
}

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

.analytics-card {
  padding: 22px;
  background: #ffffff;
  box-shadow: none;
}

.analytics-card.wide,
.impact-card {
  grid-column: 1 / -1;
}

.chart-heading {
  margin-bottom: 16px;
}

.chart-heading h3,
.impact-card h3 {
  font-size: 1.35rem;
}

.bar-chart,
.issue-chart {
  display: grid;
  gap: 14px;
}

.chart-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.chart-track {
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.chart-fill {
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-teal));
}

/* Risk distribution donut + legend. */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.risk-donut {
  position: relative;
  width: 150px;
  height: 150px;
  flex: none;
  border-radius: 50%;
}

.risk-donut-center {
  position: absolute;
  inset: 26px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: #ffffff;
}

.risk-donut-center strong {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
}

.risk-donut-center span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.donut-legend {
  flex: 1;
  min-width: 170px;
  list-style: none;
  display: grid;
  gap: 12px;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--muted);
}

.donut-legend li i {
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 4px;
}

.donut-legend li span {
  flex: 1;
}

.donut-legend li strong {
  color: var(--ink);
}

/* Score distribution column chart. */
.column-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 190px;
  padding-top: 22px;
}

.col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.col-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}

.col-bar {
  position: relative;
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 4px 4px;
  background: var(--brand-gradient);
}

.col-count {
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  text-align: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--ink);
}

.col-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.impact-card {
  margin-top: 18px;
  padding: 24px;
  background: linear-gradient(145deg, #ffffff, #edf5ff);
  box-shadow: none;
}

.impact-card p {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 600;
}

/* Dedicated Project Impact page */
.impact-page {
  max-width: 1180px;
}

.impact-hero,
.impact-section-card {
  padding: clamp(24px, 5vw, 42px);
}

.impact-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 251, 0.95)),
    radial-gradient(circle at top right, rgba(43, 185, 166, 0.12), transparent 24rem);
  box-shadow: var(--shadow);
}

.impact-hero h2 {
  max-width: 920px;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.impact-hero p:not(.eyebrow) {
  max-width: 760px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 600;
}

.impact-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.impact-section-card {
  margin-top: 16px;
  background: #ffffff;
}

.impact-section-card h3 {
  margin: 6px 0 10px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.impact-section-card p {
  color: var(--muted);
  font-weight: 600;
}

.feature-showcase,
.education-grid,
.expansion-timeline,
.impact-metrics-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.feature-showcase {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.impact-metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-showcase div,
.education-grid div,
.expansion-timeline div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.feature-showcase strong,
.education-grid strong,
.expansion-timeline strong {
  display: block;
  margin-bottom: 6px;
}

.feature-showcase p,
.education-grid p,
.expansion-timeline p {
  font-size: 0.95rem;
}

.mission-statement {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.expansion-timeline {
  position: relative;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Access, team, and caregiver modules */
.module-panel {
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.96));
}

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

.access-question-card div {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.access-question-card .selected {
  background: #edf5ff;
  border-color: var(--blue);
  color: var(--blue);
}

.access-result-card,
.team-detail {
  margin-top: 16px;
  padding: 22px;
  background: #ffffff;
}

.access-result-card ul {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 600;
}

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

.team-card {
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 12px 24px rgba(18, 36, 58, 0.08);
}

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

.resource-card {
  box-shadow: none;
}

/* Myth quiz */
.myth-list {
  display: grid;
  gap: 16px;
  max-width: 860px;
  margin: 0 auto;
}

.myth-card {
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.myth-card h3 {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

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

.myth-feedback {
  min-height: 1.5em;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.myth-feedback.correct {
  color: var(--success);
}

.myth-feedback.incorrect {
  color: var(--danger);
}

/* Certificate */
.certificate-stage {
  max-width: 680px;
  margin: 0 auto;
}

.certificate-card {
  position: relative;
  overflow: hidden;
  border: none;
  margin: 0 auto;
  padding: clamp(30px, 6vw, 56px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-blue) 0%, #14a6e0 50%, var(--brand-teal) 100%);
  box-shadow: 0 26px 60px rgba(16, 32, 51, 0.26);
  color: #fff;
  text-align: center;
}

/* Decorative dashed inner frame + soft top-light. */
.certificate-card::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  border-radius: calc(var(--radius-lg) - 6px);
  pointer-events: none;
}

.certificate-shine {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 78% -15%, rgba(255, 255, 255, 0.4), transparent 46%);
  pointer-events: none;
}

.certificate-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.cert-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.cert-wordmark b {
  font-weight: 800;
}

.cert-smile {
  width: 78px;
  height: 30px;
}

.cert-eyebrow {
  position: relative;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.certificate-name {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.05;
  margin: 6px 0 2px;
  word-break: break-word;
}

.certificate-sub {
  position: relative;
  opacity: 0.92;
  font-weight: 500;
}

.certificate-scoreline {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 8vw, 56px);
  margin: 22px 0 8px;
}

.certificate-scoreline small {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

.certificate-scoreline .big-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  color: #fff;
}

.certificate-scoreline .big-score i {
  font-style: normal;
  font-size: 0.42em;
  font-weight: 700;
  opacity: 0.8;
}

.certificate-badge {
  font-size: 2.4rem;
  line-height: 1;
}

.certificate-note {
  position: relative;
  max-width: 460px;
  margin: 14px auto 0;
  color: rgba(255, 255, 255, 0.94);
}

.certificate-date {
  position: relative;
  margin-top: 18px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
}

/* Certificate controls (name + actions) sit below the card, on the page bg. */
.certificate-controls {
  margin-top: 22px;
}

.cert-name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 340px;
  margin: 0 auto 6px;
  text-align: left;
  font-weight: 600;
  color: var(--ink);
}

.cert-name-field input {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--ink);
  background: var(--card);
}

.cert-name-field input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-color: var(--blue);
}

/* One-shot celebration confetti (suppressed by reduced-motion block below). */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
}

/* About section */
.about-card {
  padding: clamp(24px, 5vw, 40px);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.about-grid div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.about-grid span,
.about-grid strong {
  display: block;
}

.about-grid span {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.about-grid p {
  color: var(--muted);
  font-size: 0.96rem;
}

.site-footer {
  padding: 28px 16px 42px;
  color: var(--muted);
  text-align: center;
  font-weight: 650;
}

/* Simple animations */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Laptop/tablet adjustments */
@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-links a {
    flex: 0 0 auto;
  }

  .hero,
  .results-grid,
  .habit-grid,
  .clinical-grid,
  .prevention-grid,
  .age-guidance-grid,
  .impact-two-column,
  .feature-showcase,
  .education-grid,
  .impact-metrics-grid,
  .expansion-timeline,
  .access-questions,
  .team-grid,
  .resource-grid,
  .explorer-grid,
  .achievement-list,
  .analytics-grid,
  .metric-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .clinical-illustration {
    min-height: 280px;
  }

  .metric-grid,
  .impact-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .science-popup {
    grid-template-columns: 1fr;
  }
}

/* Phone adjustments */
@media (max-width: 640px) {
  .nav-links a {
    padding-inline: 10px;
    font-size: 0.86rem;
  }

  .section-screen,
  .about {
    width: min(100% - 24px, 1120px);
    padding: 42px 0;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 14vw, 3.6rem);
    letter-spacing: -0.045em;
  }

  .hero-card,
  .quiz-card,
  .visual-dashboard,
  .report-card,
  .recommendation-card,
  .clinical-card,
  .prevention-card,
  .achievement-card,
  .dashboard-panel,
  .explorer-panel,
  .admin-panel,
  .impact-hero,
  .impact-section-card,
  .module-panel,
  .about-card {
    padding: 20px;
  }

  .hero-actions,
  .center-actions,
  .quiz-actions,
  .myth-actions,
  .dashboard-summary,
  .report-heading,
  .dashboard-topline,
  .history-card {
    flex-direction: column;
  }

  .history-card {
    display: flex;
    align-items: stretch;
    text-align: center;
  }

  .dashboard-summary,
  .report-heading,
  .dashboard-topline {
    align-items: stretch;
  }

  .btn,
  .quiz-actions .btn,
  .myth-actions .btn {
    width: 100%;
  }

  .donut-chart {
    width: 112px;
    height: 112px;
  }

  .risk-chart {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .impact-metrics-grid,
  .mini-stat-grid {
    grid-template-columns: 1fr;
  }

  .dental-chart {
    grid-template-columns: repeat(4, minmax(48px, 1fr));
    gap: 7px;
    padding: 12px;
  }

  .tooth-button {
    min-height: 72px;
  }

  .clinical-illustration {
    min-height: 250px;
  }

  .age-control-card label {
    align-items: flex-start;
    flex-direction: column;
  }

  .access-question-card div {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .brand span:last-child {
    white-space: normal;
  }

  .site-header {
    gap: 12px;
  }

  .big-score {
    font-size: 3rem;
  }

  .dental-chart {
    grid-template-columns: repeat(2, minmax(72px, 1fr));
  }
}
