/* Toothcation brand system: black/baby-blue/yellow, Geist + Geist Mono,
   "almost surgical, borrowed trust" per the owner's brand decision.
   Ruled tables and photo rails, never boxed text cards. Mobile-first:
   16px gutters, no horizontal scroll at 375px. */

:root {
  --ink: #111214;
  --white: #FFFFFF;
  --cream: #FBFAF7;
  --yellow: #F5C542;
  --babyblue: #BFE3F4;
  --blue-accent: #7CC4E6;
  --link-blue: #1F6FA8;
  --link-blue-dark: #16537F;
  --border: #E3E3E6;
  --muted: #6B6B70;
  --muted-2: #3A3A3C;
  --panel: #F4F4F6;
  --tint-blue: #EAF5FB;
  --soft-yellow: #FEF6DC;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --gutter: 16px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Geist', -apple-system, "Segoe UI", sans-serif;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: var(--ink); text-decoration: none; }
a.link, .prose a { color: var(--link-blue); }
a.link:hover, .prose a:hover { color: var(--link-blue-dark); }
.mono { font-family: 'Geist Mono', monospace; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 900px) {
  .wrap { padding: 0 48px; }
}

/* --- header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
  background: var(--white);
}
.site-header .row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 68px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 20px;
  letter-spacing: -0.03em; color: var(--ink); }
.site-nav { display: none; gap: 26px; font-size: 16px; align-items: center; }
.site-nav a:hover { color: var(--link-blue); }
@media (min-width: 900px) {
  .site-nav { display: flex; }
}
.header-cta { flex-shrink: 0; }
/* Below ~420px the brand wordmark + this pill + the hamburger no longer
   reliably fit on one 68px row without forcing horizontal overflow; the
   same link lives at the top of the hamburger's own panel (hdr-quote-mnav)
   so nothing is lost, just moved behind the menu tap. */
a.hdr-quote-mnav { display: none; }
@media (max-width: 420px) {
  /* a.hdr-quote-btn (element+class), not .hdr-quote-btn: the general
     .btn{display:inline-flex} rule below is the SAME specificity and
     comes later in this file, so a same-specificity override here was
     silently losing the cascade and the button never actually hid. */
  a.hdr-quote-btn { display: none; }
  a.hdr-quote-mnav { display: block; font-weight: 600; }
}
.menu-toggle { display: inline-flex; }
@media (min-width: 900px) {
  .menu-toggle { display: none; }
}
details.mnav { position: relative; }
details.mnav summary { list-style: none; cursor: pointer; padding: 8px; }
details.mnav summary::-webkit-details-marker { display: none; }
.mnav-panel {
  /* Closed <details> hides its non-summary children via the UA
     stylesheet (details:not([open]) > *:not(summary){display:none}) --
     an unconditional `display:flex` here overrode that and the panel
     sat laid out (and overflowing past the viewport edge) even while
     closed. Explicit display:none by default, flex only when open, so
     the native disclosure behavior is never fought. */
  display: none;
}
details.mnav[open] .mnav-panel {
  position: absolute; right: 0; top: 44px; background: var(--white);
  border: 1px solid var(--border); border-radius: 14px; padding: 10px;
  display: flex; flex-direction: column; min-width: 200px;
  box-shadow: 0 16px 34px rgba(17,18,20,0.14);
}
details.mnav .mnav-panel a { padding: 10px 12px; border-radius: 8px; }
details.mnav .mnav-panel a:hover { background: var(--panel); }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px; padding: 14px 24px;
  border-radius: var(--radius-pill); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #2b2c2f; }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--border); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.underline-yellow { border-bottom: 2px solid var(--yellow); padding-bottom: 2px; font-weight: 600; }

/* --- type --- */
.eyebrow { font-family: 'Geist Mono', monospace; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: 42px; line-height: 1.05; }
h2 { font-size: 30px; line-height: 1.08; }
h3 { font-size: 20px; }
@media (min-width: 700px) { h1 { font-size: 58px; } h2 { font-size: 38px; } }
@media (min-width: 1100px) { h1 { font-size: 78px; } h2 { font-size: 46px; } }
.lede { font-size: 18px; line-height: 1.55; color: var(--muted-2); }
@media (min-width: 700px) { .lede { font-size: 20px; } }

/* --- hero: text left, photo full height right ---------------------
   Ported verbatim from the live holding page (toothcation.com), per the
   owner's 2026-09-25 rule: a photo shows a full head or no head, never
   half -- a wide band cropped at the eyes is exactly what this replaces. */
.hero { display: grid; grid-template-columns: 1fr; gap: 0; background: var(--cream); }
.hero-text { padding: 48px var(--gutter) 40px; max-width: 640px; }
.hero-photo { position: relative; min-height: 420px; background: var(--panel); }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); min-height: 640px; }
  .hero-text { padding: 96px 48px 72px max(48px, calc((100vw - 1200px) / 2 + 48px)); max-width: none; align-self: center; }
  .hero-text > * { max-width: 600px; }
  .hero-photo { min-height: 640px; }
}

/* --- section rhythm --- */
.section { padding: 56px 0 0; }
.section:first-child { padding-top: 0; }
.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head .fill { flex: 1; height: 1px; background: var(--border); min-width: 24px; }
.dark-band { background: var(--ink); color: var(--white); }
.dark-band .muted { color: #D1D1D6; }

/* --- ruled tables (never boxed cards) --- */
.rtable { border-top: 2px solid var(--ink); }
.rtable .rhead {
  display: grid; padding: 12px 0; font-family: 'Geist Mono', monospace;
  font-size: 11px; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase;
}
.rtable .rrow {
  display: grid; gap: 8px; align-items: baseline; padding: 16px 0;
  border-top: 1px solid var(--border); font-size: 16px;
}
.rtable a.rrow { text-decoration: none; color: inherit; }
.price { font-family: 'Geist Mono', monospace; white-space: nowrap; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; }
.cols-clinic { grid-template-columns: 2fr 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .rtable .rhead { display: none; }
  .rtable .rrow { grid-template-columns: 1fr !important; gap: 4px; }
  .rtable .rrow > span:first-child, .rtable .rrow > a:first-child { font-weight: 600; }
}

/* --- stat tiles (rule, not a box) --- */
.stat { padding-top: 14px; border-top: 2px solid var(--ink); display: flex; flex-direction: column; gap: 4px; }
.stat.accent { border-top: 4px solid var(--yellow); }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-family: 'Geist Mono', monospace; font-size: 26px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }

/* --- photo tiles / rail --- */
.tiles { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 800px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: block; border-radius: var(--radius-md); overflow: hidden;
  text-decoration: none; }
.tile img { width: 100%; height: 220px; object-fit: cover; object-position: center 30%; }
.tile .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 14px;
  background: linear-gradient(transparent, rgba(17,18,20,0.75));
  color: var(--white); display: flex; justify-content: space-between; align-items: flex-end;
  gap: 8px;
}
.tile .cap .name { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.rail { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.rail-card { flex: 0 0 260px; }
@media (min-width: 700px) { .rail-card { flex: 0 0 320px; } }
.rail-card img { width: 100%; height: 340px; object-fit: cover; border-radius: var(--radius-md); }

/* --- pills / badges --- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  background: var(--panel); color: var(--muted-2); padding: 6px 12px; border-radius: var(--radius-pill); }
.pill-blue { background: var(--tint-blue); color: var(--link-blue); }

/* --- forms --- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #52525A; margin-bottom: 14px; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid #D1D1D6;
  border-radius: 12px; background: var(--white); color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.checkbox-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ink); flex-shrink: 0; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.plain legend { font-size: 14px; color: #52525A; margin-bottom: 6px; padding: 0; }
.checkgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.checkgrid label {
  display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 9px 13px;
  border: 1px solid #D1D1D6; border-radius: var(--radius-pill); cursor: pointer;
}
.checkgrid input { accent-color: var(--ink); }
.panel-card {
  border-radius: var(--radius-lg); padding: 24px; box-shadow: inset 0 0 0 1px var(--border);
}
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- 3-step quote quiz (owner instruction, 2026-09-26) ------------------
   quiz-form.js toggles which .quiz-step is visible; with JS off, the
   <noscript> rule in _quote_form.html shows every step and hides this nav,
   so it degrades to one plain long form. */
.quiz-progress { margin-bottom: 22px; }
.quiz-progress-bar { height: 4px; background: #E7E7EA; border-radius: 2px; overflow: hidden; }
.quiz-progress-bar span { display: block; height: 100%; background: var(--yellow, #F5C542); transition: width .25s ease; }
.quiz-progress-label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.quiz-nav .btn { flex: 0 0 auto; }
.quiz-nav .quiz-next, .quiz-nav button[type="submit"] { margin-left: auto; }

/* --- footer --- */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 32px 0; }
.footer-row { display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--muted); }
@media (min-width: 700px) { .footer-row { flex-direction: row; justify-content: space-between; align-items: center; } }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--muted); }

/* --- misc --- */
.crumb { font-size: 14px; color: var(--muted); }
.crumb a { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 2fr 1fr; } }
.grid-2.reverse { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2.reverse { grid-template-columns: 1fr 2fr; } }
.sidebar-block { padding: 18px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.faq-row { display: flex; justify-content: space-between; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--border); font-size: 18px; }
.hr2 { border-top: 2px solid var(--ink); margin: 0; }

/* --- "what it costs" / US-reference tables --------------------------
   Ported verbatim (class names and rules) from the live holding page at
   toothcation.com, per the owner's 2026-09-25 instruction that the home
   page's what-it-costs section copy its structure and styles exactly.
   Reused as-is on every other page that shows a procedure's price list
   (prices_index, procedure_prices, city, city_procedure, clinic_detail)
   so the US-reference row and the vs-US column look identical everywhere. */
.prices-block table { width: 100%; max-width: 100%; border-collapse: collapse; margin-top: 8px; table-layout: fixed; }
.prices-block th, .prices-block td { text-align: left; padding: 14px 0; border-bottom: 1px solid var(--border); font-weight: 400; }
.prices-block th { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.prices-block td.num, .prices-block th.num { text-align: right; }
.prices-block td.num { font-family: 'Geist Mono', monospace; font-size: 20px; font-weight: 500; white-space: nowrap; }
.prices-block tr td:first-child { font-size: 18px; }
.prices-block .country { color: var(--muted); font-size: 15px; }
.prices-block tr.us td { color: var(--muted); border-bottom: 2px solid var(--ink); }
.prices-block tr.us td.num { text-decoration: line-through; text-decoration-color: rgba(17,18,20,.4); }
/* Hand-drawn red circle around the struck-through US price (owner
   instruction, 2026-09-26). The wrapping span is display:inline-block so
   the circle can be positioned relative to it -- but an inline-block
   boundary also stops a text-decoration line from an ANCESTOR (the .num
   <td>) from drawing through its content, per spec, which is why the
   strike-through silently disappeared once the price got wrapped (found
   in QA, 2026-09-26). Fixed by setting the decoration on the span
   itself instead of relying on inheritance from the <td>. */
.prices-block .us-price-circled { position: relative; display: inline-block; }
.prices-block tr.us .us-price-circled { text-decoration: line-through; text-decoration-color: rgba(17,18,20,.4); }
/* The SVG is sized by inset alone (top/bottom/left/right all set, no
   width/height) so it always covers the FULL price text regardless of
   how many digits/characters it has -- a fixed em size only ever wrapped
   the middle of a long price like "$15,000-$25,000" (found in QA,
   2026-09-26). Paired with preserveAspectRatio="none" and
   vector-effect="non-scaling-stroke" on the SVG/path themselves (see
   _us_highlight_circle.html) so the shape stretches to fit while the
   stroke width stays constant. */
.prices-block .us-highlight-circle {
  position: absolute; top: -0.35em; bottom: -0.35em; left: -0.6em; right: -0.6em;
  width: auto; height: auto;
  pointer-events: none;
}
.prices-block td.save { font-size: 16px; color: var(--link-blue); white-space: nowrap; }
.prices-block .proc { margin: 0 0 36px; }
.prices-block .proc-with-render {
  display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start;
}
@media (min-width: 900px) {
  .prices-block .proc-with-render { grid-template-columns: 2fr 1fr; }
}
.prices-block .proc h3 { font-size: 20px; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 4px; }
.prices-block .note { font-size: 15px; color: var(--muted); margin: 18px 0 0; max-width: 46em; }
@media (max-width: 520px) {
  /* table-layout:fixed above stops the table from forcing the page
     wider than the viewport; letting these cells wrap (instead of the
     nowrap used at desktop widths) is what actually keeps a figure like
     "$15,000-$25,000" inside its column instead of pushing past 375px. */
  .prices-block td.num, .prices-block td.save { white-space: normal; word-break: break-word; }
  .prices-block td.num { font-size: 14px; }
  .prices-block td.save { font-size: 12px; padding-left: 4px; }
  .prices-block th.num:last-child { padding-left: 4px; }
  .prices-block tr td:first-child { font-size: 15px; padding-right: 6px; }
  .prices-block .country { display: block; font-size: 13px; }
}

/* Same highlighter technique as .vs-us below, on the hero's own headline --
   the "yellow highlighter underline" the owner asked the vs-US treatment
   to match. */
.hero-highlight { background: linear-gradient(transparent 80%, var(--yellow) 80%); }

/* --- clinic logo / monogram (owner design pass, 2026-09-25) --------- */
.clinic-logo {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border);
  object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center;
  justify-content: center; vertical-align: middle;
}
.clinic-monogram {
  color: #FFFFFF; font-weight: 600; font-size: 15px; font-family: 'Geist Mono', monospace;
}
.with-logo { display: flex; align-items: center; gap: 10px; }

/* --- yellow highlighter on a "vs US" saving --------------------------
   An INLINE marker behind the text only (same technique as the hero's
   .hero-highlight) -- this must never land on a table-cell/block element,
   or the background fills the whole cell width like a bar chart instead
   of a highlighter stroke. Always apply the class to a <span> that wraps
   just the saving text, never to the <td> itself (found in QA, 2026-09-25). */
.vs-us {
  display: inline; background: linear-gradient(transparent 60%, var(--yellow) 60%);
  padding: 0 2px; color: var(--ink); font-weight: 500;
  /* A <span> that is a DIRECT CHILD of a `.rtable .rrow` grid container
     becomes a grid item and stretches to fill its cell in both axes by
     default -- regardless of its own display:inline -- which is what
     turned this into a full-cell bar instead of a text highlight. These
     two rules stop that stretch; harmless where .vs-us sits inside a
     <td> instead (not a grid item there, so both are no-ops). */
  justify-self: start; align-self: center;
}

/* --- soft yellow stat band (price pages) ----------------------------- */
.stat-band {
  background: var(--soft-yellow); border-radius: var(--radius-md);
  padding: 20px 24px; margin-top: 24px;
}
.stat-band .stat { border-top-color: rgba(17,18,20,0.25); }

/* --- brand dividers, ported from elements.html ------------------------ */
.divider-horizon {
  position: relative; border-top: 1.5px solid var(--ink); margin: 56px 0; height: 0;
}
.divider-horizon::before {
  content: ""; position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 32px; background: var(--yellow); border-radius: 32px 32px 0 0;
}
.divider-route { display: block; width: 100%; height: auto; margin: 48px 0; }
.divider-smile { display: block; width: 100%; height: auto; margin: 48px 0; max-width: 480px; }

/* --- procedure render images ------------------------------------------ */
.render-hero { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; }
.render-hero img { width: 100%; height: auto; border-radius: var(--radius-lg); display: block; }
@media (min-width: 900px) {
  .render-hero { grid-template-columns: 1fr 1fr; gap: 40px; }
  .render-hero.reverse { grid-template-columns: 1fr 1fr; }
}
.render-thumb { width: 100%; height: auto; border-radius: var(--radius-md); display: block; margin-top: 18px; }

/* --- destinations mega-menu (owner instruction, 2026-09-26: country
   nav, "people won't know the city names") -------------------------- */
details.dest-menu { position: relative; display: none; }
@media (min-width: 900px) { details.dest-menu { display: inline-block; } }
details.dest-menu summary { list-style: none; cursor: pointer; color: var(--ink); }
details.dest-menu summary::-webkit-details-marker { display: none; }
details.dest-menu summary::after { content: " \25BE"; font-size: 11px; }
.dest-panel { display: none; }
details.dest-menu[open] .dest-panel {
  display: flex; gap: 28px; position: absolute; left: 50%; top: 38px;
  transform: translateX(-50%); background: var(--white); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 24px; box-shadow: 0 20px 44px rgba(17,18,20,0.16);
  z-index: 40; min-width: 460px;
}
.dest-col { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.dest-country { font-weight: 600; margin-bottom: 4px; }
.dest-col a { font-size: 14px; padding: 3px 0; display: flex; justify-content: space-between; gap: 10px; }
.dest-count { color: var(--muted); font-family: "Geist Mono", monospace; font-size: 12px; }

/* --- sticky mobile "Get free quotes" bar (owner instruction,
   2026-09-26: "on every page") -- desktop already has the header CTA,
   so this only shows below the same breakpoint the hamburger takes
   over at. ------------------------------------------------------------ */
.mobile-cta-bar {
  display: none;
}
@media (max-width: 899px) {
  .mobile-cta-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--white); border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(17,18,20,0.08);
  }
  .mobile-cta-bar .btn { width: 100%; justify-content: center; }
  /* Room at the bottom of the page so the fixed bar never sits over the
     last bit of real content or the footer's own links. */
  body { padding-bottom: 64px; }
}

/* --- page header photo (owner instruction, 2026-09-26: "a header image
   on every main page") -- country/city/procedure/guide headers. -------- */
.page-header-photo {
  width: 100%; max-height: 340px; object-fit: cover; object-position: center 30%;
  border-radius: var(--radius-lg); display: block; margin-bottom: 28px;
}

/* --- emotion photography (owner instruction, 2026-09-26: "we sell the
   emotion, not the product") -- replaces every procedure render.
   object-position keeps faces in frame at any crop width -- these are
   wide group/lifestyle shots with heads in the upper third, never dead
   center or top-aligned (either crops a head on a narrow phone card). */
.emotion-img { object-fit: cover; object-position: center 20%; }

/* --- guide pages (Markdown-rendered prose) ----------------------------- */
.guide-prose {
  max-width: 720px; font-size: 17px; line-height: 1.7;
  /* The Sources list ends each entry with a bare, unbroken URL (no
     autolink markup in the source .md, just plain text) -- without this,
     a long URL with no spaces can't wrap at all and forces the whole
     page wider, causing real horizontal overflow at phone widths (found
     in QA, 2026-09-26: /guides/all-on-4/ at 375px was 640px wide). */
  overflow-wrap: anywhere;
}
.guide-prose h2 { font-size: 24px; margin-top: 40px; scroll-margin-top: 90px; }
.guide-prose h3 { font-size: 19px; margin-top: 28px; }
.guide-prose p, .guide-prose ul, .guide-prose ol { margin-top: 14px; }
.guide-prose a { color: var(--link-blue); }
.guide-prose li { margin-top: 6px; }
/* A citation superscript: a small numbered link, never full body-text size. */
sup.cite { font-size: 11px; margin-left: 1px; }
sup.cite a { color: var(--link-blue); text-decoration: none; }
/* Anchor targets (glossary terms, #source-N) land clear of the sticky
   header instead of tucked underneath it. */
.guide-prose [id] { scroll-margin-top: 90px; }
/* A Markdown table (which-treatment.md) -- ruled like the price tables,
   never boxed, and horizontally scrollable so it never widens the page
   on a phone. */
.table-scroll { overflow-x: auto; margin-top: 18px; -webkit-overflow-scrolling: touch; }
/* min-width scoped to .table-scroll (the wrapper _wrap_tables() puts
   around a raw Markdown table, e.g. which-treatment.md's comparison
   table) -- NOT to every table in .guide-prose. An injected
   {{PRICE_TABLE:...}} table is a DIFFERENT table (from
   _us_price_table.html, never passed through _wrap_tables) and must stay
   fully responsive; the old blanket ".guide-prose table" selector forced
   ALL of them, including price tables, to a 640px floor and that is
   exactly what broke every guide page at 375px (found in QA, 2026-09-26:
   /guides/all-on-4/ has no Markdown table at all, only a price table, yet
   was still 640px wide). */
.table-scroll table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14px; }
.guide-prose table:not(.table-scroll table) { border-collapse: collapse; width: 100%; font-size: 14px; }
.guide-prose th, .guide-prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.guide-prose th { font-weight: 600; border-bottom: 1.5px solid var(--ink); }

/* --- guide H2 icons (owner instruction, 2026-09-26 round 3: a line icon
   per heading, no emoji) ---------------------------------------------- */
.h2-icon { width: 22px; height: 22px; margin-right: 10px; vertical-align: -5px; color: var(--ink); flex-shrink: 0; }

/* --- closing "your dentist decides" callout ---------------------------- */
.guide-callout {
  margin-top: 28px; padding: 16px 20px; background: var(--panel); border-radius: var(--radius-md);
  font-size: 15px; color: var(--muted-2);
}

/* --- "How it works, step by step" as a vertical timeline --------------- */
.guide-prose h2[id*="how-it-works"] + ol {
  list-style: none; margin: 20px 0 0; padding: 0; counter-reset: steps; position: relative;
}
.guide-prose h2[id*="how-it-works"] + ol::before {
  content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--border);
}
.guide-prose h2[id*="how-it-works"] + ol > li {
  position: relative; padding-left: 50px; margin-top: 20px; counter-increment: steps; list-style: none;
}
.guide-prose h2[id*="how-it-works"] + ol > li:first-child { margin-top: 0; }
.guide-prose h2[id*="how-it-works"] + ol > li::before {
  content: counter(steps); position: absolute; left: 0; top: -3px; width: 36px; height: 36px;
  border-radius: 50%; background: var(--yellow); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; color: var(--ink); font-family: "Geist Mono", monospace; z-index: 1;
}

/* --- "Questions to ask a clinic" as a printable checklist --------------- */
.guide-prose h2[id*="questions-to-ask"] + ol {
  list-style: none; margin: 20px 0 0; padding: 0;
}
.guide-prose h2[id*="questions-to-ask"] + ol > li {
  position: relative; padding-left: 36px; margin-top: 14px; list-style: none;
}
.guide-prose h2[id*="questions-to-ask"] + ol > li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px;
  border: 1.5px solid var(--ink); border-radius: 4px;
}
/* Sidebar sticks below the site header on desktop only (owner
   instruction, 2026-09-26: "the right column is empty at 1440" -- On
   this page / Get free quotes / See prices). .grid-2 already stacks it
   below the prose on phones (1fr until 900px), so `position:sticky` is
   scoped to the same breakpoint it would otherwise do nothing at. */
@media (min-width: 900px) {
  .guide-sidebar { position: sticky; top: 90px; }
}
/* --- guides hub: image-led tiles, no bordered boxes (owner instruction,
   2026-09-26 round 3: "no bordered text boxes... image-led tiles... like
   koveluxury.com" -- image on top, title + one-line summary underneath,
   an editorial grid with one large lead tile first). ------------------- */
.guide-tile { display: block; }
.guide-tile img { width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: var(--radius-md); display: block; }
.guide-tile-cap { margin-top: 14px; }
.guide-tile-cap h2, .guide-tile-cap h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.guide-tile-cap p { font-size: 15px; color: var(--muted); margin-top: 6px; }
.guide-tile-lead { display: block; }
.guide-tile-lead img { aspect-ratio: 16 / 7; }
.guide-tile-lead .guide-tile-cap h2 { font-size: 28px; }
.guide-tile-grid {
  margin-top: 36px; display: grid; grid-template-columns: 1fr; gap: 32px 28px;
}
@media (min-width: 640px) {
  .guide-tile-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .guide-tile-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.guide-tile-grid .guide-tile-cap h3 { font-size: 18px; }
.guide-inline-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--link-blue); margin-top: 10px; }

/* iOS Safari zooms in when a focused control is <16px */
@media (max-width: 640px) {
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
}

/* --- Price Index + compare tool (round 18) ---------------------------
   Grid rows on the ruled-table pattern. On a phone the header row is hidden
   by .rtable's own rule, so each cell carries a small .lab label that only
   shows at that width. */
.pi-row { grid-template-columns: 1.7fr 1fr 1.3fr 1fr .7fr 1fr; }
.cmp-row { grid-template-columns: 1.5fr 1fr 1.4fr .6fr 1.3fr; }
.rtable .lab { display: none; }
@media (max-width: 640px) {
  .rtable .lab { display: inline; color: var(--muted); font-family: 'Geist', sans-serif; font-size: 13px; margin-right: 8px; }
  .pi-row > span, .cmp-row > span { display: block; }
}

/* --- Side gutter for pages built as <div class="wrap section"> (round 18) ---
   .section (padding: 56px 0 0) is declared after .wrap and resets its side
   padding to 0, so on a phone every such page ran edge to edge. Restore the
   gutter below the width where the 1200px column starts to centre itself;
   at 1248px and up nothing changes. */
@media (max-width: 1247px) { .wrap.section { padding-left: 48px; padding-right: 48px; } }
@media (max-width: 899px) { .wrap.section { padding-left: var(--gutter); padding-right: var(--gutter); } }

/* --- /quote/ on a phone (round 18) -------------------------------------
   Step 1 (heading, progress, treatment chips, city, Next) fits a 390x700
   screen with no scrolling; steps 2 and 3 are tightened the same way. Chips
   are 40px tall with a ::after that extends the tap area to 44px. */
.quote-page { max-width: 640px; padding-bottom: 80px; }
.quote-h1 { font-size: 34px; }
.quote-lede { margin-top: 10px; }
.quote-lede .q-short { display: none; }
.quote-form-wrap { margin-top: 24px; }
.quiz-city { margin-top: 16px; }
.quiz-progress { scroll-margin-top: 84px; }
@media (max-width: 480px) {
  .quote-page.wrap.section { padding-top: 14px; padding-bottom: 24px; }
  .quote-h1 { font-size: 26px; line-height: 1.1; }
  .quote-lede { margin-top: 4px; font-size: 15px; line-height: 1.35; }
  .quote-lede .q-long { display: none; }
  .quote-lede .q-short { display: inline; }
  .quote-page[data-step="2"] .quote-lede, .quote-page[data-step="3"] .quote-lede { display: none; }
  .quote-form-wrap { margin-top: 12px; }
  .quiz-progress { margin-bottom: 10px; }
  .quiz-progress-label { margin-top: 4px; font-size: 12px; line-height: 1.2; }
  .quiz-form fieldset.plain { margin-bottom: 8px; }
  .quiz-form fieldset.plain legend { font-size: 14px; margin-bottom: 6px; }
  .quiz-form .checkgrid { gap: 6px; }
  .quiz-form .checkgrid label { position: relative; min-height: 40px; padding: 0 12px; font-size: 14px; gap: 6px; }
  .quiz-form .checkgrid label::after { content: ""; position: absolute; left: 0; right: 0; top: -2px; bottom: -2px; }
  .quiz-step[data-step="1"] > .checkgrid { display: grid; grid-template-columns: 1fr 1fr; }
  .quiz-form .field { margin-bottom: 8px; gap: 3px; font-size: 13px; }
  .quiz-form .quiz-city { margin-top: 10px; margin-bottom: 0; }
  .quiz-form .field input, .quiz-form .field select { padding: 9px 12px; }
  .quiz-form .field textarea { padding: 9px 12px; height: 64px; }
  .quiz-form .checkbox-row { font-size: 12px; line-height: 1.4; margin-bottom: 10px !important; }
  .quiz-nav { margin-top: 10px; }
  .quiz-nav .btn { min-height: 44px; padding: 10px 22px; }
}
