/* Dentivello. Brand palette and faces are fixed by docs/BRAND.md.
   Porcelain and terracotta: the crown's material and the clinic's warmth. */

@font-face { font-family: "DM Sans"; src: url("./fonts/dm-sans.woff2") format("woff2"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "DM Serif"; src: url("./fonts/dm-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;

  /* Brand */
  --terracotta: #764b3e;
  --terracotta-deep: #5f3a2f;
  --ink: #493e37;
  --espresso: #2f2823;
  --porcelain: #f4f7f3; /* page */
  --celadon: #e5edde;   /* tinted bands and map panels, from sage */
  --sage: #d5dfc9;
  --sand: #e8c098; /* from the logo's smile; decoration and dark surfaces only */

  /* Derived roles */
  --surface: #ffffff;
  --muted: #6f5f53;
  --sage-ink: #56664b;
  --line: #d8ded6;
  --line-strong: #bdc4b8;
  --error: #a4452f;

  /* Type */
  --serif: "DM Serif", "Iowan Old Style", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --t-xs: .8125rem;   /* 13px metadata */
  --t-sm: .875rem;    /* 14px secondary, controls */
  --t-md: 1rem;       /* 16px body */
  --t-lg: 1.1875rem;  /* 19px lead */
  --t-xl: 1.375rem;   /* 22px small titles */
  --h3: 1.125rem;
  --h2: clamp(1.75rem, 1.35rem + 1.5vw, 2.625rem);
  --h1: clamp(2.375rem, 1.6rem + 2.8vw, 4rem);
  --display: clamp(2.75rem, 1.5rem + 4.2vw, 5.25rem);

  /* Space (4px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --section: clamp(64px, 8vw, 120px);

  /* Shape and depth */
  --r-s: 8px;
  --r-m: 16px;
  --r-l: 28px;
  --float: 0 2px 6px rgb(47 40 35 / .08), 0 18px 40px -16px rgb(47 40 35 / .32);

  /* Motion */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --fast: 150ms;
  --base: 240ms;

  --header-h: 68px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;

  font-family: var(--sans);
  font-size: 100%;
  color: var(--ink);
  background: var(--porcelain);
  accent-color: var(--terracotta);
  caret-color: var(--terracotta);
  scrollbar-color: var(--line-strong) var(--porcelain);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s4)); scroll-padding-bottom: 96px; scrollbar-gutter: stable; }
html:has(dialog[open]) { overflow: hidden; }
body { margin: 0; min-height: 100vh; font-size: var(--t-md); line-height: 1.6; background: var(--porcelain); overflow-x: clip; -webkit-tap-highlight-color: rgb(118 75 62 / .14); }
body.has-tray { padding-bottom: 88px; }
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
a, button, input, label { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
main > .container { padding-bottom: var(--section); }
::selection { background: rgb(232 192 152 / .6); color: var(--espresso); }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
input::placeholder { color: var(--muted); opacity: 1; }
code { font-family: var(--mono); font-size: .9em; }
noscript { display: block; max-width: 640px; margin: var(--s7) auto; padding: var(--s5); text-align: center; }

h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: var(--h1); line-height: 1.04; }
h2 { font-size: var(--h2); line-height: 1.1; }
h3 { font-size: var(--h3); line-height: 1.35; font-weight: 600; letter-spacing: -.01em; }
p { text-wrap: pretty; }

.i { display: inline-block; flex: none; width: 20px; height: 20px; vertical-align: middle; }
.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.lead { max-width: 56ch; font-size: var(--t-lg); line-height: 1.55; color: var(--muted); }
.measure { max-width: 62ch; }
.skip { position: fixed; left: var(--s4); top: var(--s3); z-index: 100; padding: var(--s3) var(--s4); border-radius: 999px; background: var(--espresso); color: var(--porcelain); font-weight: 600; transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------- Controls ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: var(--s3) 22px; border: 1px solid transparent; border-radius: 999px; font-size: .9375rem; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background-color var(--fast), border-color var(--fast), color var(--fast), transform var(--fast) var(--ease); }
.btn .i { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--terracotta); color: var(--porcelain); }
.btn-primary:hover { background: var(--terracotta-deep); }
.btn-secondary { border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { border-color: var(--terracotta); color: var(--terracotta); }
.btn-light { background: var(--porcelain); color: var(--terracotta); }
.btn-light:hover:not(:disabled) { background: #fff; }
.btn-ghost { padding-inline: var(--s4); color: var(--ink); }
.btn-ghost:hover { background: var(--celadon); }
.btn-ghost .i { width: 18px; height: 18px; }
.btn-sm { min-height: 40px; padding: var(--s2) var(--s4); font-size: var(--t-sm); }
.btn-block { width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); transition: border-color var(--fast), color var(--fast); }
.icon-button:hover { border-color: var(--terracotta); color: var(--terracotta); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1.5px; text-underline-offset: 5px; transition: color var(--fast), text-decoration-color var(--fast); }
.text-link .i { width: 16px; height: 16px; }
.text-link:hover { color: var(--terracotta); text-decoration-color: currentColor; }
.text-button { padding: var(--s1) var(--s2); border-radius: var(--r-s); font-size: var(--t-xs); font-weight: 600; color: var(--terracotta); }
.text-button:hover { background: var(--surface); }
.source-note { display: flex; align-items: flex-start; gap: var(--s2); max-width: 68ch; margin-top: var(--s5); font-size: var(--t-xs); line-height: 1.55; color: var(--muted); }
.source-note .i { width: 16px; height: 16px; margin-top: 1px; }
.source-note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.source-note a:hover { color: var(--terracotta); }
mark { padding: 0 1px; border-radius: 2px; background: rgb(232 192 152 / .6); color: inherit; }

.save-toggle { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: var(--t-sm); font-weight: 600; color: var(--ink); transition: color var(--fast); }
.save-toggle .i { width: 19px; height: 19px; }
.save-toggle .i path { fill: transparent; transition: fill var(--fast); }
.save-toggle:hover, .save-toggle[aria-pressed="true"] { color: var(--terracotta); }
.save-toggle[aria-pressed="true"] .i path { fill: currentColor; }
.motion .save-toggle[aria-pressed="true"] .i { animation: press var(--base) var(--ease); }
.compare-toggle { position: relative; display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; font-size: var(--t-sm); font-weight: 600; cursor: pointer; user-select: none; }
.compare-toggle input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background-color var(--fast); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform var(--base) var(--ease); }
.compare-toggle input:checked + .switch { background: var(--terracotta); }
.compare-toggle input:checked + .switch::after { transform: translateX(14px); }
.compare-toggle input:focus-visible + .switch { outline: 2px solid var(--terracotta); outline-offset: 3px; }
.check-box { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface); color: transparent; transition: background-color var(--fast), border-color var(--fast), color var(--fast); }
.check-box .i { width: 15px; height: 15px; stroke-width: 2.4; }
input:checked + .check-box { border-color: var(--terracotta); background: var(--terracotta); color: var(--porcelain); }
input:focus-visible + .check-box { outline: 2px solid var(--terracotta); outline-offset: 3px; }

/* ---------- Header and footer ---------- */

.preview-bar { padding: var(--s2) var(--gutter); background: var(--espresso); color: rgb(244 247 243 / .86); font-size: var(--t-xs); text-align: center; }
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); border-bottom: 1px solid transparent; background: var(--porcelain); transition: border-color var(--base); view-transition-name: site-header; }
.site-header.is-scrolled { border-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: var(--s5); height: 100%; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 600; line-height: 1; letter-spacing: -.05em; }
.logo img { width: 34px; height: 34px; }
.nav { display: flex; gap: var(--s6); margin-inline: auto; }
.nav a { padding: var(--s2) 0; font-size: var(--t-sm); font-weight: 500; text-decoration: underline 2px transparent; text-underline-offset: 10px; transition: color var(--fast), text-decoration-color var(--fast); }
.nav a:hover { color: var(--terracotta); }
.nav a.is-active { color: var(--terracotta); text-decoration-color: currentColor; }
.header-actions { display: flex; align-items: center; gap: var(--s3); }
.saved-link { display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s2); font-size: var(--t-sm); font-weight: 500; transition: color var(--fast); }
.saved-link:hover, .saved-link.is-active { color: var(--terracotta); }
.saved-link .i { width: 19px; height: 19px; }
.save-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--terracotta); color: var(--porcelain); font-size: var(--t-xs); font-weight: 600; line-height: 1; }
.menu-button { display: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); }

.menu-sheet { position: fixed; inset: 0 0 0 auto; width: min(100vw, 420px); max-width: 100vw; height: 100dvh; max-height: none; margin: 0; padding: var(--s3) var(--s5) var(--s6); border: 0; background: var(--porcelain); color: var(--ink); flex-direction: column; gap: var(--s5); box-shadow: var(--float); overflow-y: auto; transition: transform var(--base) var(--ease), overlay var(--base) allow-discrete, display var(--base) allow-discrete; }
.menu-sheet[open] { display: flex; }
.menu-sheet:not([open]) { transform: translateX(100%); }
@starting-style { .menu-sheet[open] { transform: translateX(100%); } }
.menu-sheet::backdrop { background: rgb(47 40 35 / .4); }
.menu-top { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.menu-nav { display: grid; }
.menu-nav a { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); font-size: var(--t-lg); font-weight: 500; transition: color var(--fast); }
.menu-nav a:hover, .menu-nav a[aria-current] { color: var(--terracotta); }

.site-footer { padding-top: var(--s8); background: var(--espresso); color: rgb(244 247 243 / .84); }
.site-footer :focus-visible { outline-color: var(--sand); }
.footer-tagline { font-family: var(--serif); font-size: clamp(2.5rem, 1.5rem + 3.6vw, 4.5rem); line-height: 1; letter-spacing: -.02em; color: var(--porcelain); }
.footer-tagline span { color: var(--sand); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: var(--s6); padding: var(--s8) 0 var(--s7); }
.footer-brand .logo { color: var(--porcelain); }
.footer-brand p, .footer-facts { margin-top: var(--s4); max-width: 36ch; font-size: var(--t-sm); line-height: 1.6; }
.footer-h { font-size: var(--t-sm); font-weight: 600; color: var(--sand); }
.footer-grid nav a { display: block; width: fit-content; margin-top: var(--s3); font-size: var(--t-sm); transition: color var(--fast); }
.footer-grid nav a:hover { color: var(--porcelain); text-decoration: underline; text-underline-offset: 4px; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5) 0 var(--s6); border-top: 1px solid rgb(244 247 243 / .14); font-size: var(--t-xs); color: rgb(244 247 243 / .72); }
.to-top { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-weight: 600; color: rgb(244 247 243 / .86); }
.to-top:hover { color: var(--porcelain); }
.to-top .i { width: 15px; height: 15px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s5); font-size: var(--t-xs); color: var(--muted); }
.crumbs a:hover { color: var(--terracotta); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); }
.crumb-sep { color: var(--line-strong); }

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--s6); margin-bottom: var(--s7); }
.section-head > .lead { grid-column: 1; margin-top: var(--s4); }
.section-head > .text-link { grid-column: 2; grid-row: 1; }
.page-top { max-width: 820px; padding: var(--s7) 0 var(--s6); }
.page-top h1 { margin-bottom: var(--s4); }

/* ---------- Home: hero ---------- */

.hero { padding-top: var(--s7); background: var(--terracotta); color: var(--porcelain); }
.hero + .section { position: relative; z-index: 1; background: var(--porcelain); box-shadow: 0 -1px 0 var(--line-strong), 0 -14px 18px -14px rgb(47 40 35 / .22); }
.hero :focus-visible { outline-color: var(--porcelain); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.hero-copy { align-self: start; padding-bottom: var(--s8); }
.hero h1 { margin-bottom: var(--s5); font-size: var(--display); line-height: 1; letter-spacing: -.03em; color: var(--porcelain); }
.hero-intro { max-width: 34em; margin-bottom: var(--s6); font-size: var(--t-lg); line-height: 1.55; color: rgb(244 247 243 / .88); }
.hero-search { position: relative; z-index: 5; max-width: 560px; }
.search-shell { display: flex; align-items: center; gap: var(--s3); min-height: 64px; padding: var(--s2) var(--s2) var(--s2) var(--s5); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); transition: border-color var(--fast), box-shadow var(--base); }
.search-shell:focus-within { border-color: var(--terracotta); box-shadow: 0 0 0 4px rgb(118 75 62 / .14); }
.hero .search-shell { border-color: transparent; }
.hero .search-shell:focus-within { box-shadow: 0 0 0 4px rgb(244 247 243 / .5); }
.hero .search-shell .btn-primary { background: var(--espresso); }
.hero .search-shell .btn-primary:hover { background: #000; }
.search-icon { color: var(--terracotta); }
.search-shell input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: none; background: transparent; font-size: var(--t-md); }
.suggest { position: absolute; top: calc(100% + var(--s2)); left: 0; right: 0; padding: var(--s2); border-radius: var(--r-m); background: var(--surface); color: var(--ink); box-shadow: var(--float); }
.motion .suggest { animation: drop var(--base) var(--ease); }
.suggest :focus-visible { outline-color: var(--terracotta); }
.suggest-head { padding: var(--s2) var(--s3); font-size: var(--t-xs); color: var(--muted); }
.suggest-list { display: grid; max-height: 300px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.suggest-list [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3); border-radius: var(--r-s); cursor: pointer; }
.suggest-list [role="option"]:hover, .suggest-list [aria-selected="true"] { background: var(--celadon); }
.suggest-list [aria-selected="true"] b { color: var(--terracotta); }
.opt-text b { display: block; font-weight: 600; }
.opt-text small { font-size: var(--t-xs); color: var(--muted); }
.opt-price { font-size: var(--t-xs); font-weight: 600; color: var(--muted); white-space: nowrap; }
.suggest-empty { padding: var(--s3); font-size: var(--t-sm); color: var(--muted); }
.hero-shortcuts { margin-top: var(--s4); font-size: var(--t-sm); color: rgb(244 247 243 / .82); }
.hero-shortcuts a { color: var(--porcelain); font-weight: 600; text-decoration: underline; text-decoration-color: rgb(244 247 243 / .45); text-underline-offset: 4px; }
.hero-shortcuts a:hover { text-decoration-color: currentColor; }

/* The quote: a paper document issued from the bottom edge of the hero. */
.quote { position: relative; padding: var(--s5) var(--s6) var(--s4); border-radius: var(--r-m) var(--r-m) 0 0; background: var(--surface); color: var(--ink); box-shadow: 0 24px 48px -20px rgb(47 40 35 / .55); }
.quote :focus-visible { outline-color: var(--terracotta); }
.quote-head { display: flex; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); padding-bottom: var(--s3); border-bottom: 1.5px dashed var(--line-strong); font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.quote-from { font-size: var(--t-sm); color: var(--muted); }
.quote-from a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.quote-from .i { width: 13px; height: 13px; margin-left: 2px; vertical-align: -1px; }
.quote-from a:hover { color: var(--terracotta); text-decoration-color: currentColor; }
.quote-price { margin: var(--s2) 0 var(--s1); font-family: var(--serif); font-size: clamp(3rem, 2rem + 3vw, 4.5rem); line-height: 1; letter-spacing: -.02em; color: var(--terracotta); }
.quote-label { margin-bottom: var(--s4); font-size: var(--t-sm); font-weight: 600; }
.quote-lines { margin: 0; border-top: 1px solid var(--line); }
.quote-lines div { position: relative; display: flex; align-items: last baseline; justify-content: space-between; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
/* Dot leader: one ruled line per row, masked by the label and status so the dots run from the last word to the status. */
.quote-lines div::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(10px + .45em); border-bottom: 1.5px dotted var(--line-strong); transform-origin: left; }
.quote-lines dt, .quote-lines dd { position: relative; }
.quote-lines dt { min-width: 0; font-weight: 400; }
.quote-lines dd { flex: none; margin: 0; font-size: var(--t-sm); font-weight: 600; }
.quote-lines dt span { padding-right: var(--s2); background: var(--surface); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.quote-lines dd span { padding-left: var(--s2); background: var(--surface); }
.quote-lines .s-in dd { color: var(--sage-ink); }
.quote-lines .s-out dd { color: var(--terracotta); }
.quote-lines .s-extra dd { color: var(--terracotta-deep); }
.quote-lines .s-ask dd { color: var(--muted); }
.quote-foot { max-width: 56ch; margin-top: var(--s4); font-size: var(--t-xs); color: var(--muted); }
.quote-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s4); }

/* The one authored moment: the quote is issued from the hero's edge and its leaders are ruled in. */
.motion .quote { animation: issue 900ms var(--ease) backwards; }
.motion .quote-lines div::before { animation: rule 600ms var(--ease) backwards; animation-delay: calc(350ms + var(--i) * 60ms); }

/* ---------- Price anatomy ---------- */

.implant { width: 100%; max-width: 400px; height: auto; margin-inline: auto; overflow: visible; }
.imp-disc { fill: var(--celadon); }
.imp-axis { stroke: var(--line-strong); stroke-width: 1.2; stroke-dasharray: 3 6; }
.imp-crown { fill: var(--surface); stroke: var(--terracotta); stroke-width: 2.4; }
.imp-abutment { fill: var(--sand); stroke: var(--terracotta); stroke-width: 2; }
.imp-line { stroke: var(--terracotta); stroke-width: 1.5; opacity: .45; }
.imp-body { fill: url(#imp-metal); stroke: #8f7d6d; stroke-width: 1.5; }
.imp-threads path { stroke: #8f7d6d; stroke-width: 3.2; stroke-linecap: round; opacity: .75; }
.leader { stroke: var(--line-strong); stroke-width: 1.2; }
.part-name { font: 600 13px var(--sans); fill: var(--ink); }
.part-status { font: 500 13px var(--sans); fill: var(--muted); }
.part-status.s-in { fill: var(--sage-ink); }
.part-status.s-ask { fill: var(--terracotta); }
.part { transition: opacity var(--base); }
[data-anatomy][data-active="crown"] .part:not([data-part="crown"]), [data-anatomy][data-active="abutment"] .part:not([data-part="abutment"]), [data-anatomy][data-active="implant"] .part:not([data-part="implant"]) { opacity: .25; }
[data-anatomy][data-active="crown"] li[data-part="crown"] b, [data-anatomy][data-active="abutment"] li[data-part="abutment"] b, [data-anatomy][data-active="implant"] li[data-part="implant"] b { color: var(--terracotta); }
.anatomy-list { margin: var(--s6) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.anatomy-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.status-label { font-size: var(--t-sm); font-weight: 600; }
.s-in .status-label { color: var(--sage-ink); }
.s-out .status-label { color: var(--terracotta); }
.s-extra .status-label { color: var(--terracotta-deep); }
.s-ask .status-label { color: var(--muted); }
.anatomy-text b { display: block; font-weight: 600; transition: color var(--fast); }
.anatomy-text span { display: block; font-size: var(--t-sm); color: var(--muted); }

/* ---------- Maps ---------- */

.dk-map { position: relative; width: 100%; aspect-ratio: 280 / 330; }
.dk { width: 100%; height: 100%; overflow: visible; }
.dk-land { fill: var(--land, var(--celadon)); stroke: rgb(118 75 62 / .3); stroke-width: .8; }
.dk-dots { fill: url(#dk-dots); opacity: .3; }
.pin { position: absolute; left: var(--x); top: var(--y); z-index: 1; width: 0; height: 0; }
.pin:hover, .pin.is-hot, .pin:focus-visible { z-index: 2; outline: none; }
.pin-dot { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--surface); background: var(--terracotta); transition: transform var(--fast) var(--ease); }
.pin-label { position: absolute; top: 0; left: 16px; padding: var(--s1) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--surface); font-size: var(--t-sm); font-weight: 600; white-space: nowrap; transform: translateY(-50%); transition: border-color var(--fast), color var(--fast); }
.pin.left .pin-label { left: auto; right: 16px; }
.pin.up .pin-label { transform: translateY(-80%); }
.pin.down .pin-label { transform: translateY(-20%); }
.pin:hover .pin-dot, .pin.is-hot .pin-dot, .pin:focus-visible .pin-dot { transform: scale(1.25); }
.pin:hover .pin-label, .pin.is-hot .pin-label { border-color: var(--terracotta); color: var(--terracotta); }
.pin:focus-visible .pin-label { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.pin.is-muted { opacity: .35; }
.map-note { margin-top: var(--s3); font-size: var(--t-xs); color: var(--muted); }
.mini-map { --land: var(--surface); width: 100%; height: 100%; }
.mm-halo { fill: rgb(118 75 62 / .14); }
.mm-pin { fill: var(--terracotta); stroke: var(--surface); stroke-width: 2.5; }
.mm-other { fill: rgb(118 75 62 / .35); }

/* ---------- Clinic cards ---------- */

.explore { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.explore-map { --land: var(--surface); position: sticky; top: calc(var(--header-h) + var(--s5)); padding: var(--s6); border-radius: var(--r-l); background: var(--celadon); }
.explore-list, .results { display: grid; gap: var(--s4); }
.clinic-card { position: relative; container-type: inline-size; padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); transition: border-color var(--fast); }
.clinic-card:hover { border-color: var(--line-strong); }
.clinic-card.is-hot { border-color: var(--terracotta); }
.clinic-inner { display: grid; gap: var(--s4); }
.clinic-place { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); }
.clinic-place strong { font-family: var(--serif); font-size: var(--t-xl); font-weight: 400; line-height: 1.1; }
.clinic-place span { font-size: var(--t-xs); color: var(--muted); }
.clinic-body { display: grid; gap: var(--s2); }
.clinic-name { font-size: var(--h3); }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-m); }
.card-link:hover { color: var(--terracotta); }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 2px solid var(--terracotta); outline-offset: 3px; }
.clinic-address { font-size: var(--t-sm); color: var(--muted); }
.clinic-price { display: grid; margin-top: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line); }
.price-label, .price-note { font-size: var(--t-xs); color: var(--muted); }
.price { font-family: var(--serif); font-size: 1.625rem; font-weight: 400; line-height: 1.2; }
.price-unknown { padding: var(--s1) 0; font-size: var(--t-md); font-weight: 600; }
.clinic-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s5); }
@container (min-width: 560px) {
  .clinic-inner { grid-template-columns: 160px minmax(0, 1fr); gap: var(--s5); }
  .clinic-place { flex-direction: column; gap: var(--s1); }
}

/* ---------- Home: start an enquiry ---------- */

.start { padding-block: var(--section); background: var(--celadon); }
.start-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.arch { aspect-ratio: 4 / 5; max-height: 600px; overflow: hidden; border-radius: 999px 999px var(--r-l) var(--r-l); background: var(--line); }
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 47% 30%; }
.start-figure figcaption { margin-top: var(--s3); font-size: var(--t-xs); color: var(--muted); }
.start-title { margin-bottom: var(--s5); font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.75rem); line-height: 1.02; letter-spacing: -.025em; }
.start-accent { position: relative; display: inline-block; color: var(--terracotta); }
.smile-arc { position: absolute; left: 36%; bottom: -.2em; width: 62%; height: auto; aspect-ratio: 300 / 24; overflow: visible; }
.smile-arc path { fill: none; stroke: var(--sand); stroke-width: 4.5; stroke-linecap: round; }
.start-text { max-width: 46ch; margin-bottom: var(--s6); font-size: var(--t-lg); line-height: 1.55; color: var(--muted); }
.start-q { margin-bottom: var(--s3); font-size: var(--t-md); font-weight: 600; }
.start-options { display: grid; gap: var(--s3); }
.start-option { display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px; align-items: center; gap: var(--s4); width: 100%; min-height: 60px; padding: var(--s3) var(--s5); border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font-size: var(--t-md); font-weight: 600; text-align: left; transition: border-color var(--fast), color var(--fast), background-color var(--fast); }
.start-option .i { color: var(--terracotta); }
.start-option:hover { border-color: var(--terracotta); color: var(--terracotta); }
.start-option:active { transform: scale(.99); }
.start-foot { margin-top: var(--s4); font-size: var(--t-sm); color: var(--muted); }

/* ---------- Guides ---------- */

.guide-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.guide-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) 24px; grid-template-areas: "title intro arrow" "meta intro arrow"; gap: var(--s2) var(--s6); align-items: start; padding: var(--s6) 0; border-bottom: 1px solid var(--line); }
.guide-title { grid-area: title; font-size: var(--t-xl); font-weight: 600; line-height: 1.25; transition: color var(--fast); }
.guide-intro { grid-area: intro; color: var(--muted); }
.guide-meta { grid-area: meta; font-size: var(--t-xs); color: var(--muted); }
.guide-arrow { grid-area: arrow; align-self: center; width: 22px; height: 22px; color: var(--terracotta); transition: transform var(--fast) var(--ease); }
.guide-row:hover .guide-title { color: var(--terracotta); }
.guide-row:hover .guide-arrow { transform: translateX(4px); }

/* ---------- Directory ---------- */

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s4) var(--s5); margin-bottom: var(--s5); padding-bottom: var(--s5); border-bottom: 1px solid var(--line); }
.filter-search { flex: 1 1 320px; display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s3) 0 var(--s4); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); transition: border-color var(--fast), box-shadow var(--base); }
.filter-search:focus-within { border-color: var(--terracotta); box-shadow: 0 0 0 4px rgb(118 75 62 / .14); }
.filter-search > .i { color: var(--terracotta); }
.filter-search input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: none; background: transparent; font-size: var(--t-md); }
.clear-q { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--celadon); }
.clear-q .i { width: 14px; height: 14px; }
.segmented { min-width: 0; margin: 0; padding: 0; border: 0; }
.segmented legend { padding: 0 0 var(--s2) var(--s1); font-size: var(--t-xs); color: var(--muted); }
.seg-track { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--celadon); }
.seg-track label { position: relative; cursor: pointer; }
.seg-track input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg-track span { display: block; padding: 10px var(--s4); border-radius: 999px; font-size: var(--t-sm); font-weight: 500; white-space: nowrap; color: var(--muted); transition: background-color var(--fast), color var(--fast); }
.seg-track label:hover span { color: var(--ink); }
.seg-track input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; }
.seg-track input:focus-visible + span { outline: 2px solid var(--terracotta); outline-offset: 1px; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); margin-bottom: var(--s4); font-size: var(--t-sm); }
#result-count { font-weight: 600; }
#result-count:focus { outline: none; }
.results-hint { color: var(--muted); }
.directory { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.directory-map { --land: var(--surface); position: sticky; top: calc(var(--header-h) + var(--s5)); padding: var(--s5); border-radius: var(--r-l); background: var(--celadon); }
.empty { display: grid; justify-items: start; gap: var(--s3); padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.empty h2 { font-size: var(--t-xl); }
.empty p { max-width: 50ch; margin-bottom: var(--s2); color: var(--muted); }

/* ---------- Clinic profile ---------- */

.profile-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: start; padding: var(--s7) 0 var(--s8); }
.profile-title { margin-bottom: var(--s4); view-transition-name: clinic-title; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s6); margin: var(--s6) 0; padding-top: var(--s5); border-top: 1px solid var(--line); }
.facts dt { font-size: var(--t-xs); color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.facts a { color: var(--terracotta); text-decoration: underline; text-underline-offset: 3px; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
.profile-map { position: relative; aspect-ratio: 5 / 4; overflow: hidden; border-radius: var(--r-l); background: var(--celadon); }
.profile-map .mini-map { position: absolute; inset: 0; }
.profile-map-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--s6) var(--s5) var(--s4); background: linear-gradient(to top, var(--celadon) 45%, rgb(229 237 222 / 0)); }
.profile-map-caption strong { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 400; line-height: 1.1; }
.profile-map-caption span { font-size: var(--t-xs); color: var(--muted); }
.profile-section { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s4) var(--s6); padding-block: var(--s7); border-top: 1px solid var(--line); }
.profile-section h2 { font-size: clamp(1.5rem, 1.25rem + .8vw, 1.875rem); }
.profile-section .anatomy-list { margin-top: 0; }
.price-big { font-family: var(--serif); font-size: clamp(2.5rem, 2rem + 2vw, 3.5rem); line-height: 1; color: var(--terracotta); }
.price-unknown-big { font-size: var(--t-xl); font-weight: 600; }
.price-caption { margin: var(--s2) 0 var(--s4); font-size: var(--t-sm); color: var(--muted); }
.profile-section .measure + .text-link { margin-top: var(--s4); }
.checklist { margin: var(--s4) 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.checklist label, .consent-label { position: relative; display: flex; align-items: center; gap: var(--s3); cursor: pointer; }
.checklist label { min-height: 56px; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.checklist input, .consent-label input { position: absolute; z-index: 1; left: 0; top: 50%; width: 22px; height: 22px; margin: -11px 0 0; opacity: 0; cursor: pointer; }
.checklist input:checked ~ span:last-child { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.checklist-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.checklist-progress { display: flex; align-items: center; gap: var(--s3); font-size: var(--t-sm); color: var(--muted); }
.meter { width: 120px; height: 4px; overflow: hidden; border-radius: 999px; background: var(--celadon); }
.meter i { display: block; height: 100%; background: var(--terracotta); transform-origin: left; transform: scaleX(var(--p)); transition: transform var(--base) var(--ease); }
.more-clinics { padding-top: var(--s8); border-top: 1px solid var(--line); }
.card-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }

/* ---------- Guide article and long-form pages ---------- */

.article-wrap, .narrow-wrap { max-width: 760px; }
.article-head { padding: var(--s7) 0 var(--s5); }
.article-head h1 { margin-bottom: var(--s4); }
.article-meta { max-width: 60ch; margin-top: var(--s4); font-size: var(--t-xs); color: var(--muted); }
.article { max-width: 680px; padding-bottom: var(--s4); }
.article-sec { padding-top: var(--s6); }
.article-sec h2 { margin-bottom: var(--s3); font-size: clamp(1.5rem, 1.25rem + .9vw, 2rem); }
.article-sec p, .prose p { max-width: 58ch; font-size: 1.0625rem; line-height: 1.75; }
.article-figure { margin-top: var(--s6); padding: var(--s6); border-radius: var(--r-l); background: var(--celadon); }
.article-figure .imp-disc { fill: var(--porcelain); }
.article-figure figcaption { max-width: 62ch; margin-top: var(--s4); font-size: var(--t-sm); color: var(--muted); }
.article-note { display: flex; gap: var(--s3); max-width: 64ch; margin: var(--s7) 0 var(--s5); font-size: var(--t-sm); color: var(--muted); }
.article-note .i { width: 18px; height: 18px; margin-top: 2px; }
.article-note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.next-guide { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s1) var(--s4); margin-top: var(--s8); padding: var(--s6) 0; border-block: 1px solid var(--line); }
.next-guide span { font-size: var(--t-xs); color: var(--muted); }
.next-guide strong { grid-column: 1; font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 400; line-height: 1.15; transition: color var(--fast); }
.next-guide .i { grid-column: 2; grid-row: 1 / span 2; width: 24px; height: 24px; color: var(--terracotta); transition: transform var(--fast) var(--ease); }
.next-guide:hover strong { color: var(--terracotta); }
.next-guide:hover .i { transform: translateX(4px); }
.prose { max-width: 680px; }
.prose h2 { margin: var(--s7) 0 var(--s3); font-size: clamp(1.5rem, 1.25rem + .9vw, 2rem); }
.prose > :first-child { margin-top: 0; }
.prose p { margin-bottom: var(--s4); }
.prose .lead { margin-bottom: var(--s5); font-size: var(--t-lg); color: var(--ink); }
.ledger + .prose { margin-top: var(--s7); }
.brand-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s4); margin: var(--s6) 0; padding: 0; list-style: none; }
.brand-palette li { display: grid; gap: 2px; font-size: var(--t-sm); }
.swatch-chip { aspect-ratio: 1; margin-bottom: var(--s2); border: 1px solid var(--line); border-radius: var(--r-m); }
.brand-palette code { font-size: var(--t-xs); color: var(--muted); }
.ledger { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.ledger-row { display: grid; grid-template-columns: 1.2fr 1.6fr .7fr 1fr; gap: var(--s5); padding: var(--s5); border-top: 1px solid var(--line); }
.ledger-head { padding-block: var(--s3); border-top: 0; background: var(--celadon); font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.ledger-row [role="cell"] { display: grid; justify-items: start; align-content: start; gap: var(--s1); }
.ledger-row b { font-weight: 600; }
.ledger-row small { font-size: var(--t-xs); line-height: 1.5; color: var(--muted); }
.longform { display: grid; grid-template-columns: minmax(0, 680px) minmax(260px, 320px); justify-content: space-between; gap: clamp(32px, 6vw, 96px); align-items: start; padding-bottom: var(--s4); }
.storage { position: sticky; top: calc(var(--header-h) + var(--s5)); display: grid; justify-items: start; gap: var(--s3); padding: var(--s5); border-radius: var(--r-m); background: var(--celadon); }
.storage h2 { font-size: var(--t-xl); }
.storage p { font-size: var(--t-sm); color: var(--muted); }
.storage code { padding: 2px 6px; border-radius: 4px; background: var(--surface); color: var(--ink); }
.storage-list { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; font-size: var(--t-sm); }
.not-found { display: grid; justify-items: start; gap: var(--s4); max-width: 640px; padding: var(--s9) 0; }

/* ---------- Enquiry demonstration ---------- */

.match-page { padding: var(--s7) 0 var(--s8); }
.match-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s6); align-items: start; max-width: 1040px; margin: 0 auto; }
.match-card { min-width: 0; padding: clamp(24px, 4vw, 48px); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); }
.match-progress { margin-bottom: var(--s6); }
.step-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s4); margin-bottom: var(--s3); font-size: var(--t-sm); font-weight: 600; }
.step-meta span { font-weight: 400; color: var(--muted); }
.step-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.step-bars i { position: relative; height: 4px; overflow: hidden; border-radius: 999px; background: var(--celadon); }
.step-bars i::after { content: ""; position: absolute; inset: 0; background: var(--terracotta); transform-origin: left; transform: scaleX(0); }
.step-bars i.done::after, .step-bars i.active::after { transform: scaleX(1); }
.motion .step-bars i.active::after { animation: fill-bar 450ms var(--ease) both; }
.motion .step-body[data-dir="forward"] { animation: step-forward var(--base) var(--ease); }
.motion .step-body[data-dir="back"] { animation: step-back var(--base) var(--ease); }
.step-body h1 { margin-bottom: var(--s3); font-size: clamp(1.875rem, 1.5rem + 1.6vw, 2.75rem); }
.step-body h1:focus { outline: none; }
.step-text { max-width: 52ch; margin-bottom: var(--s6); color: var(--muted); }
.options { display: grid; gap: var(--s3); margin: 0; padding: 0; border: 0; }
.option { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; align-items: center; gap: var(--s4); padding: var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--porcelain); cursor: pointer; transition: border-color var(--fast), background-color var(--fast); }
.option:hover { border-color: var(--terracotta); }
.option input { position: absolute; z-index: 1; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.option-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-s); background: var(--celadon); color: var(--terracotta); }
.option-text b { display: block; font-weight: 600; }
.option-text small { font-size: var(--t-xs); color: var(--muted); }
.option-radio { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); transition: border-color var(--fast), box-shadow var(--fast); }
.option:has(input:checked) { border-color: var(--terracotta); background: var(--surface); box-shadow: inset 0 0 0 1px var(--terracotta); }
.option:has(input:checked) .option-radio { border-color: var(--terracotta); box-shadow: inset 0 0 0 5px var(--terracotta); }
.option:has(input:focus-visible) { outline: 2px solid var(--terracotta); outline-offset: 3px; }
.step-buttons { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); }
.request-summary { display: grid; gap: var(--s1); margin-bottom: var(--s5); padding-bottom: var(--s5); border-bottom: 1px solid var(--line); }
.request-summary strong { font-size: var(--t-lg); }
.request-summary p { margin-bottom: var(--s2); font-size: var(--t-sm); color: var(--muted); }
.request-summary .text-link { justify-self: start; }
.demo-note { display: flex; align-items: flex-start; gap: var(--s2); margin-bottom: var(--s5); font-size: var(--t-sm); color: var(--sage-ink); }
.demo-note .i { width: 18px; height: 18px; margin-top: 1px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: var(--s2); font-size: var(--t-sm); font-weight: 600; }
.field label span { font-weight: 400; color: var(--muted); }
.input-wrap { display: flex; align-items: center; gap: var(--s3); min-height: 52px; padding: 0 var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--porcelain); transition: border-color var(--fast), box-shadow var(--base); }
.input-wrap:focus-within { border-color: var(--terracotta); background: var(--surface); box-shadow: 0 0 0 4px rgb(118 75 62 / .14); }
.input-wrap:has([aria-invalid="true"]) { border-color: var(--error); }
.input-wrap .i { width: 18px; height: 18px; color: var(--muted); }
.input-wrap input { flex: 1; min-width: 0; min-height: 44px; border: 0; outline: none; background: transparent; font-size: var(--t-md); }
.field-error { margin-top: var(--s2); font-size: var(--t-sm); font-weight: 500; color: var(--error); }
.consent-label { align-items: flex-start; margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); font-size: var(--t-sm); line-height: 1.55; }
.consent-label input { top: calc(var(--s5) + 1px); margin: 0; }
.consent-label + .field-error { padding-left: 34px; }
.success-mark { width: 56px; height: 56px; margin-bottom: var(--s5); }
.success-mark svg { width: 100%; height: 100%; }
.success-mark circle { fill: var(--sage); }
.success-mark path { fill: none; stroke: var(--sage-ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.motion .success-mark path { animation: draw 500ms var(--ease) 120ms both; }
.receipt { margin: var(--s2) 0 var(--s5); padding: var(--s5); border: 1px dashed var(--line-strong); border-radius: var(--r-m); background: var(--porcelain); }
.receipt-head { display: flex; justify-content: space-between; margin-bottom: var(--s3); font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.receipt-head span:last-child { color: var(--terracotta); }
.receipt strong { display: block; margin-bottom: var(--s3); font-family: var(--serif); font-size: var(--t-xl); font-weight: 400; }
.receipt dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin: 0; }
.receipt dt { font-size: var(--t-xs); color: var(--muted); }
.receipt dd { margin: 0; font-size: var(--t-sm); font-weight: 600; }
.match-aside { position: sticky; top: calc(var(--header-h) + var(--s5)); padding: var(--s5); border-radius: var(--r-m); background: var(--celadon); }
.aside-title { margin-bottom: var(--s2); font-family: var(--sans); font-size: var(--t-sm); font-weight: 600; letter-spacing: 0; }
.summary-list { margin: 0; padding: 0; list-style: none; }
.summary-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line-strong); }
.summary-list li:last-child { border-bottom: 0; }
.summary-list small { display: block; font-size: var(--t-xs); color: var(--muted); }
.summary-list b { display: block; font-size: var(--t-sm); font-weight: 600; line-height: 1.35; }
.summary-list li:not(.filled) b { font-weight: 400; color: var(--muted); }
.summary-list li.current small { color: var(--terracotta); font-weight: 600; }
.match-foot { max-width: 60ch; margin: var(--s6) auto 0; text-align: center; font-size: var(--t-sm); color: var(--muted); }
.match-foot a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Floating layers: comparison tray, dialog, toast ---------- */

.compare-tray { position: fixed; left: 50%; bottom: max(var(--s4), env(safe-area-inset-bottom)); z-index: 70; width: max-content; max-width: calc(100% - 24px); opacity: 0; transform: translate(-50%, 24px); transition: transform var(--base) var(--ease), opacity var(--base); view-transition-name: compare-tray; }
.compare-tray.is-open { opacity: 1; transform: translate(-50%, 0); }
.tray-inner { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s5); border-radius: 999px; background: var(--ink); color: var(--porcelain); box-shadow: var(--float), 0 0 0 1px rgb(244 247 243 / .2); }
.compare-tray :focus-visible { outline-color: var(--sand); }
.tray-title { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }
.tray-slots { display: flex; gap: 6px; min-width: 0; }
.slot { display: inline-flex; align-items: center; gap: 2px; min-width: 0; height: 36px; padding: 0 2px 0 var(--s3); border-radius: 999px; background: rgb(244 247 243 / .14); font-size: var(--t-sm); font-weight: 600; }
.slot > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--porcelain); }
.slot button:hover { background: rgb(244 247 243 / .16); }
.slot .i { width: 14px; height: 14px; }
.tray-clear { min-height: 40px; padding: 0 var(--s3); border-radius: 999px; font-size: var(--t-sm); font-weight: 600; color: rgb(244 247 243 / .82); }
.tray-clear:hover { color: var(--porcelain); }

#modal { width: min(880px, calc(100% - 24px)); max-width: none; max-height: min(88vh, 900px); margin: auto; padding: 0; overflow: auto; border: 0; border-radius: var(--r-l); background: var(--surface); color: var(--ink); box-shadow: var(--float); opacity: 0; transform: translateY(12px); transition: opacity var(--base) var(--ease), transform var(--base) var(--ease), overlay var(--base) allow-discrete, display var(--base) allow-discrete; }
#modal[open] { opacity: 1; transform: none; }
@starting-style { #modal[open] { opacity: 0; transform: translateY(12px); } }
#modal::backdrop { background: rgb(47 40 35 / .45); }
.modal-inner { position: relative; padding: clamp(24px, 4vw, 48px); }
.modal-close { position: absolute; top: var(--s4); right: var(--s4); }
#modal h2 { margin-bottom: var(--s2); padding-right: var(--s7); }
.modal-lead { margin-bottom: var(--s6); color: var(--muted); }
.cmp { display: grid; border-top: 1px solid var(--line); }
.cmp-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.cmp-label { font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.cmp-cell { display: grid; justify-items: start; align-content: start; gap: var(--s1); font-size: var(--t-sm); line-height: 1.55; }
.cmp-cell small { font-size: var(--t-xs); color: var(--muted); }
.cmp-head { display: grid; gap: 2px; }
.cmp-head b { font-size: var(--t-md); }
.cmp-head small { font-size: var(--t-xs); color: var(--muted); }
.cmp-actions { border-bottom: 0; }

#toast { position: fixed; left: 50%; bottom: var(--s5); z-index: 90; display: flex; align-items: center; gap: var(--s2); width: max-content; max-width: calc(100% - 32px); padding: var(--s3) var(--s5) var(--s3) var(--s4); border-radius: 999px; background: var(--espresso); color: var(--porcelain); font-size: var(--t-sm); font-weight: 500; box-shadow: var(--float); opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity var(--base) var(--ease), transform var(--base) var(--ease); }
#toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
#toast .i { width: 18px; height: 18px; color: var(--sand); }
body.has-tray #toast { bottom: 92px; }

/* ---------- Motion ---------- */

@keyframes issue { from { transform: translateY(64px); } }
@keyframes rule { from { transform: scaleX(0); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
@keyframes press { 50% { transform: scale(.85); } }
@keyframes fill-bar { from { transform: scaleX(0); } }
@keyframes step-forward { from { opacity: 0; transform: translateX(12px); } }
@keyframes step-back { from { opacity: 0; transform: translateX(-12px); } }

::view-transition-old(root) { animation: 160ms ease-out both fade-out; }
::view-transition-new(root) { animation: 280ms var(--ease) both fade-in; }
::view-transition-group(clinic-title) { animation-duration: 420ms; animation-timing-function: var(--ease); }
::view-transition-group(site-header), ::view-transition-group(compare-tray) { animation-duration: 0s; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .directory { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 920px) {
  .nav, .saved-label { display: none; }
  .menu-button { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .hero-grid, .explore, .start-grid, .profile-hero, .profile-section, .longform, .match-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-bottom: 0; }
  .quote { max-width: 560px; }
  .start-figure { width: min(100%, 460px); }
  .explore-map, .directory-map, .storage, .match-aside { position: static; }
  .explore-map { max-width: 520px; }
  .directory { grid-template-columns: minmax(0, 1fr); }
  .directory-map { display: none; }
  .profile-section { gap: var(--s4); }
  .profile-map { aspect-ratio: 16 / 9; }
  .guide-row { grid-template-columns: minmax(0, 1fr) 24px; grid-template-areas: "title arrow" "intro arrow" "meta arrow"; gap: var(--s1) var(--s4); padding: var(--s5) 0; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .header-cta { display: none; }
  .preview-extra { display: none; }
  .logo { font-size: 1.375rem; }
  .logo img { width: 30px; height: 30px; }
  .hero { padding-top: var(--s6); }
  .search-shell { min-height: 60px; padding-left: var(--s4); }
  .search-shell .btn { width: 48px; padding: 0; }
  .search-shell .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .opt-price { display: none; }
  .quote { padding: var(--s5) var(--s4) var(--s4); }
  .quote-head { flex-direction: column; gap: 2px; }
  .arch { aspect-ratio: 1 / 1.1; }
  .section-head { grid-template-columns: minmax(0, 1fr); row-gap: var(--s4); }
  .section-head > .text-link { grid-column: 1; grid-row: auto; justify-self: start; }
  .anatomy-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .anatomy-list .status-label { order: 2; }
  .explore-map { padding: var(--s5); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .card-row { grid-template-columns: minmax(0, 1fr); }
  .filter-bar .segmented { flex: 1 1 100%; }
  .seg-track label { flex: 1; text-align: center; }
  .ledger-head { display: none; }
  .ledger-row { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .ledger-row:first-of-type { border-top: 0; }
  .ledger-row [data-label]::before { content: attr(data-label); font-size: var(--t-xs); color: var(--muted); }
  .brand-palette { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .match-card { padding: var(--s5) var(--s4); border-radius: var(--r-m); }
  .option { grid-template-columns: 36px minmax(0, 1fr) 22px; gap: var(--s3); padding: var(--s3); }
  .option-icon { width: 36px; height: 36px; }
  .step-buttons { flex-direction: column-reverse; align-items: stretch; }
  .contact-grid, .receipt dl { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .compare-tray { width: calc(100% - 24px); }
  .tray-inner { justify-content: space-between; padding-left: var(--s4); }
  .tray-title, .tray-clear { display: none; }
  .tray-slots { flex: 1; }
  .cmp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2) var(--s4); }
  .cmp-label { grid-column: 1 / -1; }
  .cmp-heads .cmp-label, .cmp-actions .cmp-label { display: none; }
  .cmp-actions .btn { padding-inline: var(--s3); font-size: var(--t-sm); }
  #modal { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: var(--r-l) var(--r-l) 0 0; transform: translateY(24px); }
  #modal[open] { transform: none; }
  @starting-style { #modal[open] { transform: translateY(24px); } }
  .menu-sheet { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .preview-bar, .site-header, .menu-sheet, .site-footer, .compare-tray, #toast, .profile-actions, .more-clinics, .checklist-foot .btn, .profile-map, .crumbs, .skip { display: none !important; }
  body { background: #fff; }
  .profile-hero, .profile-section { display: block; padding-block: var(--s4); }
}
