@charset "UTF-8";

/* ============================================================
   منصة صحة | Siha — moqe' ta'reefi
   Design tokens are derived from the product itself:
   apps/mobile/lib/theme/tokens.dart and the #41B7FD launcher icon.
   One stylesheet serves both /ar (rtl) and /en (ltr) via logical
   properties — never use left/right, only inline-start/inline-end.
   ============================================================ */

/* ---------- 1. Font ---------- */

@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo-var.woff2") format("woff2-variations");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. Tokens ---------- */

:root {
  /* Brand — the launcher icon's sky blue is the anchor */
  --sky: #41b7fd;
  --sky-ink: #0b5e8f; /* text/links on white — passes 4.5:1, --sky does not */
  --sky-deep: #1b8fd6;
  --sky-wash: #eaf4fc; /* the cooler "clinic" ground */
  --sky-mist: #f2f9ff;

  /* Neutrals — lifted from tokens.dart so the site and the app agree */
  --paper: #f7f9fc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --border: #e8edf3;
  --border-strong: #d5dfeb;

  /* Clinical legend — mirrors ToothConditionType.color in schema.prisma.
     This is the only multi-colour palette on the site and it appears
     nowhere except inside the chart and its condition chips. */
  --c-sound: #cfe3f3;
  --c-filling: #4f46e5;
  --c-caries: #ef4444;
  --c-crown: #f59e0b;
  --c-root: #8b5cf6;
  --c-missing: #94a3b8;
  --c-implant: #0d9488;

  /* Radii — tokens.dart: sm 12 / md 16 / lg 22 / pill 100 */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 100px;

  /* Shadows, tinted toward the brand rather than neutral grey */
  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(11, 94, 143, 0.05);
  --sh-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 14px 30px -10px rgba(11, 94, 143, 0.15);
  --sh-lg: 0 4px 10px rgba(15, 23, 42, 0.04), 0 30px 64px -22px rgba(11, 94, 143, 0.28);

  /* Rhythm */
  --gutter: clamp(20px, 5vw, 44px);
  --maxw: 1200px;
  --section-py: clamp(64px, 9vw, 128px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 3. Reset & base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Cairo", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 1.0625rem;
  /* Arabic sits on a deeper line than Latin — descenders in ج ح ي need room */
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--sky-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--sky-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--sky);
  color: #fff;
}

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--gutter);
  z-index: 200;
  padding: 12px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus {
  inset-block-start: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- 4. Typography ---------- */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  color: var(--ink);
  text-wrap: balance;
}

.display {
  font-size: clamp(2.35rem, 5.6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.18;
}

.h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  font-weight: 800;
  line-height: 1.34;
}

.h3 {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 700;
  line-height: 1.55;
}

.lead {
  font-size: clamp(1.05rem, 1.45vw, 1.28rem);
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0;
  text-wrap: pretty;
}

p {
  margin: 0 0 1.15em;
  text-wrap: pretty;
}
p:last-child {
  margin-bottom: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--sky-ink);
}
.eyebrow::before {
  content: "";
  inline-size: 26px;
  block-size: 2px;
  border-radius: 2px;
  background: var(--sky);
  flex: none;
}

/* Latin gets a whisper of tracking; Arabic never does — it breaks the joins */
html[lang="en"] .eyebrow,
html[lang="en"] .btn,
html[lang="en"] .kicker {
  letter-spacing: 0.02em;
}
html[lang="en"] .display {
  line-height: 1.06;
  letter-spacing: -0.02em;
}
html[lang="en"] .h2 {
  line-height: 1.18;
  letter-spacing: -0.01em;
}
html[lang="en"] body {
  line-height: 1.75;
}

/* FDI tooth numbers are always Western digits, in any language */
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- 5. Layout ---------- */

.wrap {
  inline-size: min(100% - var(--gutter) * 2, var(--maxw));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-py);
  position: relative;
}

/* Ground modifiers only ever change colour and density — never padding,
   so they cannot cancel .section out. */
.section--paper {
  background: var(--paper);
}
.section--white {
  background: var(--surface);
}
.section--clinic {
  background: var(--sky-wash);
  --r-lg: 14px;
  --r-md: 12px;
}
.section--tight {
  --section-py: clamp(48px, 6vw, 84px);
}

.section-head {
  max-inline-size: 62ch;
  margin-block-end: clamp(36px, 5vw, 60px);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head .lead {
  margin-block-start: 18px;
}

.grid {
  display: grid;
  gap: clamp(18px, 2.4vw, 28px);
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 76px);
  align-items: center;
}
.split--wide-start {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

/* The dental-arch divider: the section boundary carries the curve of the
   arch from the hero chart instead of a straight hairline. */
.arch-rule {
  display: block;
  inline-size: 100%;
  block-size: clamp(28px, 4vw, 54px);
  color: var(--border-strong);
}
.arch-rule path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ---------- 6. Buttons & chips ---------- */

.btn {
  --btn-bg: var(--sky);
  --btn-fg: #fff;
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  min-block-size: 52px;
  border: 1.5px solid var(--btn-bd);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}
.btn:active {
  transform: translateY(0);
}

/* Deep ink on the brand blue rather than white. White on #41B7FD is only
   2.23:1 — the brand colour stays exactly as it is, the label just stops
   being unreadable (7.6:1). */
.btn--primary {
  --btn-bg: var(--sky);
  --btn-fg: var(--ink);
  box-shadow: 0 10px 24px -10px rgba(65, 183, 253, 0.85);
}
.btn--primary:hover {
  --btn-bg: #6ac8ff;
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--border-strong);
}
.btn--ghost:hover {
  --btn-bd: var(--sky);
  --btn-fg: var(--sky-ink);
}

.btn--ink {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
}

.btn--sm {
  padding: 9px 18px;
  min-block-size: 40px;
  font-size: 0.9rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-block-start: 34px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.7;
}
.chip .dot {
  inline-size: 9px;
  block-size: 9px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ---------- 7. Header ---------- */

.header {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  background: rgba(247, 249, 252, 0.86);
  border-block-end: 1px solid transparent;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.header.is-stuck {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-block-end-color: var(--border);
  box-shadow: 0 1px 20px -8px rgba(11, 94, 143, 0.22);
}

.header__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-block-size: 76px;
  transition: min-block-size 0.25s var(--ease);
}
.header.is-stuck .header__bar {
  min-block-size: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  flex: none;
}
.brand img {
  inline-size: 38px;
  block-size: 38px;
  border-radius: 10px;
  box-shadow: 0 3px 10px -3px rgba(11, 94, 143, 0.4);
}
.brand__name {
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.2;
}
.brand__latin {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}
.nav a {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.94rem;
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover {
  color: var(--sky-ink);
  background: var(--sky-mist);
}
.nav a[aria-current="page"] {
  color: var(--sky-ink);
  background: var(--sky-wash);
}
/* The in-drawer language link is for the mobile menu only — the desktop
   switch lives in .header__end */
.nav .lang-switch {
  display: none;
}

.header__end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  /* The drawer is a sibling inside .header, so the header's own z-index does
     not lift the close button above it — this does. */
  position: relative;
  z-index: 95;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.lang-switch:hover {
  border-color: var(--sky);
  color: var(--sky-ink);
}

.burger {
  display: none;
  align-items: center;
  justify-content: center;
  inline-size: 46px;
  block-size: 46px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.burger span {
  position: relative;
  display: block;
  inline-size: 19px;
  block-size: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.15s;
}
.burger span::before,
.burger span::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  block-size: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.25s var(--ease);
}
.burger span::before {
  inset-block-start: -6px;
}
.burger span::after {
  inset-block-start: 6px;
}
.burger[aria-expanded="true"] span {
  background: transparent;
}
.burger[aria-expanded="true"] span::before {
  transform: translateY(6px) rotate(45deg);
}
.burger[aria-expanded="true"] span::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- 8. Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(40px, 6vw, 76px) clamp(48px, 7vw, 96px);
  background: linear-gradient(180deg, var(--sky-mist) 0%, var(--paper) 72%);
  overflow: hidden;
}
.hero::before {
  /* a wide, very soft brand halo behind the chart — not a gradient hero,
     just enough light to lift the arch off the page */
  content: "";
  position: absolute;
  inset-block-start: -22%;
  inset-inline-end: -12%;
  inline-size: 60vw;
  block-size: 60vw;
  max-inline-size: 780px;
  max-block-size: 780px;
  background: radial-gradient(circle, rgba(65, 183, 253, 0.17) 0%, rgba(65, 183, 253, 0) 68%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(30px, 4vw, 56px);
  align-items: center;
}

.hero__copy .display {
  margin-block-end: 22px;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 30px;
  padding: 0;
  list-style: none;
}

/* ---------- 9. Odontogram (the signature) ---------- */

.chart {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: clamp(14px, 2vw, 24px);
}

.chart__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-block-end: 14px;
  margin-block-end: 6px;
  border-block-end: 1px solid var(--border);
}
.chart__title {
  font-weight: 800;
  font-size: 0.95rem;
}
.chart__hint {
  margin-inline-start: auto;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.chart__stage {
  position: relative;
}

.odontogram {
  inline-size: 100%;
  block-size: auto;
  touch-action: manipulation;
}

/* Each tooth is three nested groups. .tooth carries the placement as an
   SVG transform ATTRIBUTE; every CSS transform lives on .tooth__scale so
   it can never overwrite that placement. */
.tooth {
  cursor: pointer;
}
.tooth:focus {
  outline: none;
}
.tooth__scale {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.22s var(--ease-out);
}
.tooth__shape {
  fill: var(--surface);
  stroke: #a9c4d8;
  stroke-width: 1.7;
  transition: stroke 0.18s, stroke-width 0.18s;
}
/* The crown edge redrawn above the fills */
.tooth__edge {
  fill: none;
  stroke: #a9c4d8;
  stroke-width: 1.7;
  transition: stroke 0.18s, stroke-width 0.18s;
}
/* Surface divisions stay drawn even when unfilled — that is what makes the
   glyph read as an M/O/D/B/L chart tooth rather than a rounded box */
.tooth__surface {
  fill: transparent;
  stroke: #dae7f1;
  stroke-width: 1;
  transition: fill 0.22s var(--ease);
}
.tooth__num {
  font-size: 13px;
  font-weight: 700;
  fill: var(--muted);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  transition: fill 0.18s;
}
.tooth__hit {
  fill: transparent;
  stroke: none;
}

.tooth-unit:hover .tooth__shape,
.tooth-unit:hover .tooth__edge,
.tooth-unit.is-active .tooth__shape,
.tooth-unit.is-active .tooth__edge {
  stroke: var(--sky-deep);
  stroke-width: 2.4;
}
.tooth-unit:hover .tooth__num,
.tooth-unit.is-active .tooth__num {
  fill: var(--sky-ink);
}
.tooth-unit:hover .tooth__scale,
.tooth-unit.is-active .tooth__scale {
  transform: scale(1.12);
}
.tooth:focus-visible .tooth__shape,
.tooth:focus-visible .tooth__edge {
  stroke: var(--ink);
  stroke-width: 3;
}

/* Missing teeth read as absent, not as "a tooth coloured grey" */
.tooth[data-condition="missing"] .tooth__shape {
  fill: #f1f5f9;
  stroke: var(--c-missing);
  stroke-dasharray: 4 3.5;
}
.tooth-unit:has([data-condition="missing"]) .tooth__num {
  fill: var(--c-missing);
}

/* Legend filter: teeth outside the active filter recede */
.odontogram.is-filtered .tooth-unit {
  opacity: 0.2;
  transition: opacity 0.25s var(--ease);
}
.odontogram.is-filtered .tooth-unit.is-match {
  opacity: 1;
}

/* Load-in: the arch fills itself in FDI reading order —
   Q1 18→11, Q2 21→28, Q3 31→38, Q4 41→48 */
.odontogram.is-armed .tooth-unit {
  opacity: 0;
}
.odontogram.is-running .tooth-unit {
  animation: tooth-in 0.5s var(--ease-out) var(--d, 0ms) forwards;
}
.odontogram.is-running .tooth__scale {
  animation: tooth-pop 0.5s var(--ease-out) var(--d, 0ms) forwards;
}
@keyframes tooth-in {
  to {
    opacity: 1;
  }
}
@keyframes tooth-pop {
  from {
    transform: scale(0.55);
  }
  to {
    transform: scale(1);
  }
}

.chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-block-start: 12px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--border);
}
.legend-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.legend-btn .dot {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 3px;
  flex: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
}
.legend-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-alt);
}
.legend-btn[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

/* The record card — the same shape of data as PatientToothRecord */
.record {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: translate(0, -50%);
  inline-size: min(252px, 46%);
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.24s var(--ease-out);
}
/* Centre the card inside the arch rather than beside it */
.record {
  inset-inline-start: 50%;
  margin-inline-start: calc(min(252px, 46%) / -2);
}
.record.is-visible {
  opacity: 1;
}
.record__top {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-block-end: 4px;
}
.record__fdi {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
}
.record__quad {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}
.record__name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
  margin-block-end: 10px;
}
.record__cond {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.7;
  background: var(--surface-alt);
  color: var(--ink-soft);
}
.record__cond .dot {
  inline-size: 9px;
  block-size: 9px;
  border-radius: 3px;
  flex: none;
}
.record__surfaces {
  display: flex;
  gap: 5px;
  margin-block-start: 12px;
  /* M O D B L is fixed clinical notation, not prose — it must not reverse
     under RTL the way the surrounding Arabic text does */
  direction: ltr;
}
.surface-key {
  inline-size: 27px;
  block-size: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.surface-key.is-on {
  border-color: transparent;
  color: #fff;
}
.record__note {
  margin-block-start: 12px;
  padding-block-start: 11px;
  border-block-start: 1px dashed var(--border-strong);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

.chart__empty {
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
  padding-block: 10px 2px;
}

/* ---------- 10. Cards ---------- */

.card {
  padding: clamp(22px, 2.6vw, 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease),
    transform 0.25s var(--ease);
}
.card:hover {
  border-color: #cfe3f3;
  box-shadow: var(--sh-md);
}
.card .h3 {
  margin-block: 16px 10px;
}
.card p {
  color: var(--ink-soft);
  font-size: 0.99rem;
  line-height: 1.85;
}

.card__icon {
  inline-size: 46px;
  block-size: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--sky-wash);
  color: var(--sky-ink);
}
.card__icon svg {
  inline-size: 23px;
  block-size: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Denser card for the clinic ground */
.section--clinic .card {
  padding: clamp(18px, 2vw, 24px);
  background: var(--surface);
  border-color: #d8e8f5;
}
.section--clinic .card .h3 {
  margin-block: 13px 7px;
  font-size: 1.05rem;
}
.section--clinic .card p {
  font-size: 0.94rem;
  line-height: 1.78;
}
.section--clinic .card__icon {
  inline-size: 38px;
  block-size: 38px;
  border-radius: 10px;
  background: #dcedfa;
}
.section--clinic .card__icon svg {
  inline-size: 19px;
  block-size: 19px;
}

.feature-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 13px;
}
.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.8;
  color: var(--ink-soft);
}
.feature-list li::before {
  content: "";
  flex: none;
  inline-size: 21px;
  block-size: 21px;
  margin-block-start: 6px;
  border-radius: 50%;
  background: var(--sky-wash)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b5e8f' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

/* ---------- 11. Numbered steps (only where order is real information) ---------- */

.steps {
  counter-reset: step;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: clamp(16px, 2vw, 22px);
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: clamp(18px, 2.2vw, 26px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.steps li::before {
  content: counter(step);
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sky);
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.steps .h3 {
  margin-block-end: 6px;
}
.steps p {
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- 12. Phone mockup ---------- */

.phone {
  position: relative;
  inline-size: min(300px, 78vw);
  margin-inline: auto;
  aspect-ratio: 300 / 620;
  padding: 11px;
  border-radius: 44px;
  background: linear-gradient(160deg, #223349, #0f172a 60%);
  box-shadow: var(--sh-lg), inset 0 0 0 1.5px rgba(255, 255, 255, 0.09);
}
.phone__screen {
  position: relative;
  block-size: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: var(--paper);
  display: grid;
  grid-template-rows: auto 1fr auto;
  direction: rtl;
}
html[lang="en"] .phone__screen {
  direction: ltr;
}
.phone::after {
  /* the notch */
  content: "";
  position: absolute;
  inset-block-start: 20px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  inline-size: 92px;
  block-size: 22px;
  border-radius: var(--r-pill);
  background: #0f172a;
  z-index: 3;
}

.scr {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease-out),
    visibility 0s linear 0.4s;
}
.scr.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.scr__top {
  padding: 46px 18px 12px;
  /* deeper than the brand blue so the white app-bar text stays legible */
  background: linear-gradient(160deg, #14719f, #0b5379);
  color: #fff;
}
.scr__top b {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.5;
}
.scr__top span {
  font-size: 0.68rem;
  opacity: 0.9;
  font-weight: 600;
}

.scr__body {
  padding: 14px;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 10px;
}

.scr__tabs {
  display: grid;
  grid-auto-flow: column;
  justify-content: space-around;
  padding: 10px 8px 16px;
  background: var(--surface);
  border-block-start: 1px solid var(--border);
}
.scr__tabs i {
  inline-size: 20px;
  block-size: 20px;
  border-radius: 6px;
  background: #d9e3ee;
  display: block;
}
.scr__tabs i.on {
  background: var(--sky);
}

.mini {
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 0.66rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.mini b {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.5;
}
.mini--accent {
  background: var(--sky-wash);
  border-color: #cfe6f8;
}
.mini__row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mini__av {
  inline-size: 32px;
  block-size: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, #7fd0ff, var(--sky));
  flex: none;
}
.mini__pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--sky-wash);
  color: var(--sky-ink);
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.7;
}
.mini__slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-block-start: 8px;
}
.mini__slot {
  padding: 6px 0;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}
.mini__slot.on {
  background: var(--sky);
  border-color: var(--sky);
  color: #fff;
}
.mini__slot.off {
  opacity: 0.4;
  text-decoration: line-through;
}
.mini__bar {
  block-size: 6px;
  border-radius: 3px;
  background: var(--surface-alt);
  overflow: hidden;
  margin-block-start: 7px;
}
.mini__bar i {
  display: block;
  block-size: 100%;
  background: var(--sky);
  border-radius: 3px;
}
.mini__teeth {
  display: flex;
  gap: 3px;
  margin-block-start: 8px;
}
.mini__teeth i {
  flex: 1;
  block-size: 15px;
  border-radius: 3px 3px 5px 5px;
  background: #e3edf6;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-block-start: 22px;
}
.dots button {
  inline-size: 9px;
  block-size: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border-strong);
  cursor: pointer;
  transition: background-color 0.2s, inline-size 0.25s var(--ease);
}
.dots button[aria-selected="true"] {
  inline-size: 26px;
  border-radius: var(--r-pill);
  background: var(--sky);
}

/* ---------- 13. Store & misc blocks ---------- */

.product {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.product__thumb {
  block-size: 104px;
  border-radius: var(--r-sm);
  background: linear-gradient(150deg, var(--sky-mist), var(--sky-wash));
  display: grid;
  place-items: center;
  margin-block-end: 13px;
  color: var(--sky);
}
.product__thumb svg {
  inline-size: 40px;
  block-size: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product b {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.6;
}
.product span {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Treatment plan — PatientTreatmentPlan in PHASED mode */
.plan__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-block-end: 16px;
  border-block-end: 1px solid var(--border);
}
.plan__head b {
  font-size: 1.02rem;
  font-weight: 800;
}
.plan__head .mini__pill {
  margin-inline-start: auto;
  font-size: 0.72rem;
}
.plan__steps {
  counter-reset: phase;
  margin: 0;
  padding: 0;
  list-style: none;
}
.plan__steps li {
  counter-increment: phase;
  display: flex;
  align-items: center;
  gap: 13px;
  padding-block: 15px;
  border-block-end: 1px dashed var(--border);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.plan__steps li:last-child {
  border-block-end: none;
  padding-block-end: 0;
}
.plan__steps li::before {
  content: counter(phase);
  flex: none;
  inline-size: 28px;
  block-size: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.plan__steps li > i {
  margin-inline-start: auto;
  flex: none;
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  background: var(--surface-alt);
  color: var(--muted);
  line-height: 1.75;
}
.plan__steps li.is-done::before {
  content: "";
  border-color: var(--c-implant);
  background: var(--c-implant)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}
.plan__steps li.is-done {
  color: var(--muted);
}
.plan__steps li.is-done > i {
  background: #dcfce7;
  color: #15803d;
}
.plan__steps li.is-now::before {
  border-color: var(--sky);
  background: var(--sky);
  color: #fff;
}
.plan__steps li.is-now {
  color: var(--ink);
  font-weight: 700;
}
.plan__steps li.is-now > i {
  background: var(--sky-wash);
  color: var(--sky-ink);
}
.plan__foot {
  margin-block-start: 18px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.7;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 26px);
  margin-block-start: clamp(30px, 4vw, 44px);
}
.stat {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
/* Labelled facts, not numeric stat tiles — the display size a big number
   would want makes a short phrase compete with the section heading. */
.stat b {
  display: block;
  margin-block-end: 7px;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.6;
  color: var(--sky-ink);
}
.stat span {
  font-size: 0.94rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

/* ---------- 14. FAQ ---------- */

.faq {
  display: grid;
  gap: 12px;
  max-inline-size: 860px;
  margin-inline: auto;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq details[open] {
  border-color: #cfe3f3;
}
.faq summary {
  padding: 19px 22px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.7;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "";
  margin-inline-start: auto;
  flex: none;
  inline-size: 15px;
  block-size: 15px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b5e8f' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after {
  transform: rotate(135deg);
}
.faq .faq__a {
  padding: 0 22px 21px;
  color: var(--ink-soft);
  font-size: 0.99rem;
}

/* ---------- 15. CTA band ---------- */

/* Deep end of the brand hue, not the bright end — white body copy needs
   5:1 and #41B7FD only gives 2.23:1. */
.cta {
  position: relative;
  padding-block: clamp(52px, 7vw, 88px);
  background: linear-gradient(138deg, #1476b1 0%, #0d5f8f 55%, #084a70 100%);
  color: #fff;
  overflow: hidden;
}
.cta::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: -60px;
  transform: translateY(-50%);
  inline-size: 330px;
  block-size: 330px;
  background: url("../img/mark-white.png") center / contain no-repeat;
  opacity: 0.09;
  pointer-events: none;
}
.cta .h2,
.cta .display {
  color: #fff;
}
.cta .lead {
  color: rgba(255, 255, 255, 0.92);
}
.cta__inner {
  position: relative;
  max-inline-size: 660px;
}
.cta .btn--primary {
  --btn-bg: #fff;
  --btn-fg: var(--sky-ink);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.4);
}
.cta .btn--primary:hover {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
}
.cta .btn--ghost {
  --btn-fg: #fff;
  --btn-bd: rgba(255, 255, 255, 0.55);
}
.cta .btn--ghost:hover {
  --btn-bd: #fff;
  --btn-fg: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 22px;
  border-radius: var(--r-md);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  text-decoration: none;
  transition: background-color 0.18s, border-color 0.18s;
}
.store-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
}
.store-btn svg {
  inline-size: 23px;
  block-size: 23px;
  fill: currentColor;
  flex: none;
}
.store-btn i {
  font-style: normal;
  line-height: 1.35;
}
.store-btn i small {
  display: block;
  font-size: 0.68rem;
  opacity: 0.85;
  font-weight: 600;
}
.store-btn i b {
  font-size: 0.98rem;
  font-weight: 800;
}
.store-btn[aria-disabled="true"] {
  opacity: 0.66;
  cursor: default;
}
.store-btn[aria-disabled="true"]:hover {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
}

/* ---------- 16. Forms ---------- */

.field {
  display: grid;
  gap: 7px;
  margin-block-end: 18px;
}
.field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 1rem;
  padding: 13px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea {
  min-block-size: 140px;
  resize: vertical;
  line-height: 1.8;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(65, 183, 253, 0.18);
}
.form-note {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.75;
  margin-block-start: 14px;
}

.contact-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding-block: 16px;
  border-block-end: 1px solid var(--border);
}
.contact-item:last-child {
  border-block-end: none;
}
.contact-item .card__icon {
  inline-size: 40px;
  block-size: 40px;
  border-radius: 11px;
  flex: none;
}
.contact-item .card__icon svg {
  inline-size: 19px;
  block-size: 19px;
}
.contact-item b {
  display: block;
  font-size: 0.92rem;
  line-height: 1.6;
}
.contact-item a,
.contact-item span {
  font-size: 0.95rem;
  color: var(--ink-soft);
  word-break: break-word;
}

/* ---------- 17. Legal pages ---------- */

.legal {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

.toc {
  position: sticky;
  inset-block-start: 96px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  max-block-size: calc(100vh - 128px);
  overflow-y: auto;
}
.toc b {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-block-end: 11px;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 2px;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.toc a::before {
  content: counter(toc) ".";
  color: var(--muted);
  font-weight: 700;
  margin-inline-end: 6px;
  font-variant-numeric: tabular-nums;
}
.toc a:hover,
.toc a.is-current {
  background: var(--sky-wash);
  color: var(--sky-ink);
}

.prose {
  counter-reset: clause;
  max-inline-size: 74ch;
}
.prose section {
  padding-block-end: 34px;
  margin-block-end: 34px;
  border-block-end: 1px solid var(--border);
  scroll-margin-block-start: 100px;
}
.prose section:last-of-type {
  border-block-end: none;
  margin-block-end: 0;
}
.prose h2 {
  counter-increment: clause;
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 800;
  line-height: 1.55;
  margin-block-end: 14px;
}
.prose h2::before {
  content: counter(clause);
  flex: none;
  inline-size: 32px;
  block-size: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--sky-wash);
  color: var(--sky-ink);
  font-size: 0.88rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  transform: translateY(3px);
}
.prose h3 {
  font-size: 1.03rem;
  font-weight: 700;
  margin-block: 22px 8px;
}
.prose p,
.prose li {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.92;
}
.prose ul {
  margin: 0 0 1.15em;
  padding-inline-start: 22px;
}
.prose li {
  margin-block-end: 7px;
}
.prose li::marker {
  color: var(--sky);
}
.prose strong {
  color: var(--ink);
  font-weight: 700;
}

.legal-hero {
  padding-block: clamp(44px, 6vw, 76px) clamp(28px, 3vw, 40px);
  background: linear-gradient(180deg, var(--sky-mist), var(--paper));
  border-block-end: 1px solid var(--border);
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 22px;
}

.callout {
  padding: 18px 22px;
  background: var(--sky-mist);
  border: 1px solid #cfe6f8;
  border-inline-start: 4px solid var(--sky);
  border-radius: var(--r-sm);
  margin-block-end: 30px;
}
.callout p {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- 18. Footer ---------- */

.footer {
  background: var(--ink);
  color: #cbd5e1;
  padding-block: clamp(48px, 6vw, 76px) 30px;
}
.footer a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s;
}
.footer a:hover {
  color: #fff;
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: clamp(26px, 3.5vw, 48px);
  padding-block-end: 34px;
  border-block-end: 1px solid rgba(255, 255, 255, 0.12);
}
.footer__brand .brand__name {
  color: #fff;
}
/* --muted only reaches 3.75:1 on the dark footer */
.footer .brand__latin {
  color: #94a3b8;
}
.footer__brand p {
  margin-block-start: 16px;
  font-size: 0.93rem;
  line-height: 1.85;
  color: #94a3b8;
  max-inline-size: 40ch;
}
.footer h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  margin-block-end: 15px;
}
.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  font-size: 0.92rem;
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-block-start: 26px;
  font-size: 0.86rem;
  color: #94a3b8;
}
.credit {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.credit:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);
}
.credit small {
  color: #94a3b8;
  font-size: 0.8rem;
}
.credit b {
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
}
html[lang="ar"] .credit b {
  letter-spacing: 0.01em;
}

/* ---------- 19. Scroll reveal ---------- */

/* Scoped to .js — a one-line inline script in <head> sets that class. With
   JavaScript disabled the class is never added, so nothing is ever hidden
   and every section renders normally. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 20. Responsive ---------- */

@media (max-width: 1080px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero__copy {
    max-inline-size: 62ch;
  }
  .legal {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
    max-block-size: none;
  }
  .toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
  }
}

@media (max-width: 900px) {
  .nav,
  .header__end .lang-switch {
    display: none;
  }
  .burger {
    display: flex;
  }
  .header__end {
    margin-inline-start: auto;
  }

  .nav.is-open {
    display: grid;
    position: fixed;
    inset-block-start: 0;
    inset-inline-end: 0;
    inline-size: min(320px, 86vw);
    block-size: 100dvh;
    padding: 96px 24px 32px;
    background: var(--surface);
    box-shadow: var(--sh-lg);
    align-content: start;
    gap: 4px;
    z-index: 90;
    overflow-y: auto;
  }
  .nav.is-open a {
    padding: 14px 16px;
    font-size: 1.05rem;
    border-radius: var(--r-sm);
  }
  .nav.is-open .lang-switch {
    display: inline-flex;
    justify-self: start;
    margin-block-start: 14px;
    padding: 10px 18px;
    font-size: 0.95rem;
  }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 80;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
  }
  .nav-backdrop.is-on {
    opacity: 1;
  }
  body.nav-open {
    overflow: hidden;
  }

  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split {
    grid-template-columns: 1fr;
    gap: 38px;
  }
  .split--flip > :first-child {
    order: 2;
  }
  .footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-row {
    grid-template-columns: 1fr;
  }

  /* On narrow screens the record card sits below the arch, not over it */
  .record {
    position: static;
    transform: none;
    margin-inline: auto;
    inline-size: 100%;
    max-inline-size: 340px;
    margin-block-start: 14px;
    display: none;
  }
  .record.is-visible {
    display: block;
  }
}

@media (max-width: 620px) {
  /* The chart panel breaks out of the page gutter so 32 teeth get every
     pixel of a phone screen, and the FDI numbers scale back up — at
     fit-to-width they would otherwise render around 6px. */
  .chart {
    margin-inline: calc(var(--gutter) * -1 + 4px);
    border-radius: var(--r-md);
    padding-inline: 10px;
  }
  .tooth__num {
    font-size: 19px;
  }
  .tooth__shape,
  .tooth__edge {
    stroke-width: 2.2;
  }
  .tooth__surface {
    stroke-width: 1.4;
  }
}

@media (max-width: 620px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
  .btn-row .btn {
    inline-size: 100%;
  }
  .steps li {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .credit {
    margin-inline-start: 0;
  }
  .toc ol {
    grid-template-columns: 1fr;
  }
  .chart__hint {
    inline-size: 100%;
    margin-inline-start: 0;
  }
  .brand__latin {
    display: none;
  }
}

/* ---------- 21. Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .odontogram.is-armed .tooth-unit,
  .odontogram.is-running .tooth-unit {
    opacity: 1;
    animation: none;
  }
  .odontogram.is-running .tooth__scale {
    animation: none;
  }
  .tooth-unit:hover .tooth__scale,
  .tooth-unit.is-active .tooth__scale {
    transform: none;
  }
  .scr {
    transform: none;
  }
}

/* ---------- Join / registration flow ---------- */

.wrap--narrow {
  inline-size: min(100% - var(--gutter) * 2, 760px);
}

.join {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: clamp(20px, 4vw, 36px);
}

/* Role picker */
.join__tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-block-end: 26px;
}
.join__tab {
  font: inherit;
  text-align: start;
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.join__tab strong {
  font-size: 1rem;
  color: var(--ink);
}
.join__tab small {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}
.join__tab:hover {
  border-color: var(--sky-deep);
}
.join__tab.is-active {
  border-color: var(--sky);
  background: var(--sky-mist);
  box-shadow: 0 0 0 3px rgba(65, 183, 253, 0.15);
}
.join__tab.is-active strong {
  color: var(--sky-ink);
}

/* Step indicator */
.join__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}
.join__steps li {
  display: flex;
  align-items: center;
  gap: 7px;
}
.join__steps span {
  inline-size: 24px;
  block-size: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.78rem;
  transition: background 0.2s, color 0.2s;
}
.join__steps li.is-active {
  color: var(--sky-ink);
}
.join__steps li.is-active span {
  background: var(--sky);
  color: #fff;
}
/* display:flex above would otherwise beat the [hidden] UA rule. */
.join__steps[hidden] {
  display: none;
}

/* Messages */
.join__alert {
  border-radius: var(--r-sm);
  padding: 13px 16px;
  margin-block-end: 20px;
  font-size: 0.92rem;
  line-height: 1.7;
  border: 1px solid transparent;
}
.join__alert--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.join__alert--info {
  background: var(--sky-wash);
  border-color: #bfdcf5;
  color: var(--sky-ink);
}
.join__alert--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.field__hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.field input[type="file"] {
  padding: 10px 12px;
  background: var(--paper);
  cursor: pointer;
}

/* Terms checkbox */
.join__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-block: 6px 20px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.join__check input {
  inline-size: 20px;
  block-size: 20px;
  margin-block-start: 2px;
  accent-color: var(--sky);
  flex: none;
}

.join__done {
  text-align: center;
  padding-block: 12px;
}
.join__done p {
  color: var(--ink-soft);
  line-height: 1.85;
  margin-block: 10px 22px;
}
.join__done .btn-row {
  justify-content: center;
}

/* Before join.js runs, only the first panel/step should be visible. */
.join:not(.is-ready) .join__panel:not(:first-of-type),
.join:not(.is-ready) [data-step]:not([data-step="1"]) {
  display: none;
}

@media print {
  .header,
  .footer,
  .cta,
  .toc,
  .skip-link {
    display: none;
  }
  body {
    background: #fff;
  }
  .prose section {
    break-inside: avoid;
  }
}
