/* ===========================================================
   Practice Grader, in SEO for Dentists' house style.
   Navy ink and SFD blue for brand and action; green, amber and red
   are kept for grades and states only, never decoration. Neutrals are
   tinted a touch toward the navy rather than warm (the old cream
   background was a borrowed look, not this brand).
   =========================================================== */

/* Titillium Web, self-hosted: the site's CSP allows fonts from itself only.
   Latin subset, the two weights headings use. SIL Open Font License. */
@font-face { font-family: "Titillium Web"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("/fonts/tw-600.woff2") format("woff2"); }
@font-face { font-family: "Titillium Web"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/fonts/tw-700.woff2") format("woff2"); }

:root {
  /* surfaces */
  --bg:            #f5f7fc;
  --surface:       #ffffff;
  --surface-sub:   #eef1f8;
  --surface-field: #e8ebf4;

  /* ink: SFD navy and its ramp. Every step clears 4.5:1 on every surface
     below, including the grade tints. */
  --ink:           #0b1233;
  --ink-2:         #2e3654;
  --ink-3:         #4c5574;
  --ink-4:         #5b6482;
  --hairline:      rgba(11, 18, 51, 0.09);

  /* brand: SFD blue. Primary actions, focus, progress, selection. */
  --brand-700:     #1f3bd6;
  --brand-600:     #2b4dff;
  --brand-100:     #e9edff;
  --brand-50:      #f3f5ff;

  /* success: grades and passes only */
  --green-900:     #102215;
  --green-800:     #1d431a;
  --green-700:     #2f6a1a;
  --green-500:     #3d7a22;
  --green-200:     #d1ebb9;
  --green-100:     #e8f3dc;
  --green-chip:    #bbdb99;

  /* status */
  --red-700:       #b13d3d;
  --red-500:       #d65353;
  --red-100:       #fae8e8;
  --red-50:        #f7e6e6;
  --amber-600:     #8a5d14;
  --amber-100:     #f6e3b4;
  --warm-100:      #eceff6;

  /* grade tints for the score panel, set from the score itself */
  --tint-poor:     #fbedeb;
  --tint-fair:     #fbf2e0;
  --tint-good:     #eaf4e3;
  --tint-none:     #eef1f8;

  /* type: SFD's Titillium for headings, the system sans for everything else */
  --font-head:     "Titillium Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* layers */
  --z-sticky: 50; --z-toast: 70; --z-toast-top: 71; --z-modal: 80;

  /* spacing — 4px base. Replaces 61 distinct raw px values. */
  --space-1:  4px;   --space-2:  8px;   --space-3: 12px;
  --space-4: 16px;   --space-5: 20px;   --space-6: 24px;
  --space-7: 32px;   --space-8: 40px;   --space-9: 48px;

  /* type ramp — replaces 25 ad-hoc font sizes */
  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   16px;
  --text-xl:   18px;
  --text-2xl:  21px;
  --text-3xl:  23px;
  --text-display: 46px;

  /* motion */
  --dur-fast: .18s;
  --dur-base: .3s;
  --dur-slow: .5s;

  /* geometry */
  --r-card:        16px;
  --r-lg:          24px;
  --r-pill:        9999px;
  --shadow-card:   0 1px 2px rgba(11,18,51,.04), 0 8px 24px rgba(11,18,51,.05);
  --shadow-pop:    0 12px 40px rgba(11,18,51,.14);
  --shadow-modal:  0 24px 70px rgba(11,18,51,.18);

  --ease:          cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

/* Visible keyboard focus. Previously the UI relied entirely on the browser
   default and removed it outright on the search input, leaving keyboard
   users with no indicator on the primary control. */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
}
.field:focus-within { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* headings carry the SFD typeface; product text stays on the system sans */
h1, h2, h3, .hero-title, .gate h2 { font-family: var(--font-head); text-wrap: balance; }
input  { font: inherit; }
a { color: inherit; }

[hidden] { display: none !important; }

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

/* ---------------- top bar ---------------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar { gap: 12px; }
.logo { min-width: 0; flex-shrink: 1; }
.logo-img, .logo svg { max-width: 100%; }
/* On a phone the bar is one row: a smaller wordmark that never wraps,
   icon-only PDF and link buttons (their aria-labels carry the text), and
   a compact Log in. Anything else stacks and lands on the score ring. */
@media (max-width: 560px) {
  .topbar { padding: 12px 14px; gap: 8px; }
  .topbar-actions { gap: 6px; flex: none; }
  .logo { gap: 7px; }
  .logo-img { height: 26px; }
  .btn-pdf span { display: none; }
  .btn-pdf { padding: 10px 12px; min-width: 44px; min-height: 44px; justify-content: center; gap: 0; }
}
.topbar.is-hidden { opacity: 0; visibility: hidden; transition: opacity .3s; }

/* "Practice Grader by SEO for Dentists": the product name goes home, the
   SEO for Dentists mark goes to their site. Two links, one lockup. */
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; min-width: 0; }
.logo svg { display: block; flex: none; }
.logo-product { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; min-width: 44px; min-height: 44px; }
.logo-product span, .logo > span:first-child {
  font-family: var(--font-head);
  font-size: 26px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap;
}
.logo-by { font-size: 14px; color: var(--ink-3); margin: 0 1px; flex: none; }
.logo-brand { display: inline-flex; align-items: center; line-height: 0; flex: none; min-height: 44px; }
.logo-img { display: block; height: 32px; width: auto; }
@media (max-width: 760px) {
  .logo { gap: 7px; }
  .logo-product span { font-size: 20px; }
  .logo svg { width: 24px; height: 24px; }
  .logo-img { height: 24px; }
}
/* A phone report header has three buttons, which leaves ~150px for the
   lockup - not enough for both marks. Keep the icon and the SEO for
   Dentists wordmark; the page title still says Practice Grader. */
@media (max-width: 560px) {
  /* Home page: the whole lockup fits only as two lines - the product on
     the first, "by SEO for Dentists" small beneath it. */
  .logo { flex-wrap: wrap; row-gap: 2px; column-gap: 6px; align-items: baseline; }
  .logo-product { flex: 0 0 100%; }
  .logo-by { font-size: 12px; margin-left: 31px; }
  .logo-img { height: 17px; }
  /* Report page: three buttons on the right leave no room for either
     line, so keep the icon and the SEO for Dentists mark only. */
  .topbar:has(#btnPdf:not([hidden])) .logo { flex-wrap: nowrap; align-items: center; }
  .topbar:has(#btnPdf:not([hidden])) .logo-product { flex: none; }
  .topbar:has(#btnPdf:not([hidden])) .logo-product span { font-size: 17px; }
  .topbar:has(#btnPdf:not([hidden])) .logo-by { margin-left: 0; }
  .topbar:has(#btnPdf:not([hidden])) .logo-img { height: 16px; }
}
/* the narrowest phones: the report keeps the product name and drops "by" */
@media (max-width: 400px) {
  .topbar:has(#btnPdf:not([hidden])) .logo-by { display: none; }
  .topbar:has(#btnPdf:not([hidden])) .logo-product span { font-size: 16px; }
  .topbar:has(#btnPdf:not([hidden])) .logo-img { height: 14px; }
}


.btn-login {
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 9px 20px;
  font-size: 15px; font-weight: 500;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.btn-login:hover { background: #fff; transform: translateY(-1px); }

/* ---------------- stage machinery ---------------- */

.stage { display: none; }
.stage.is-active { display: block; }

/* =========================================================
   STAGE 1 — search
   ========================================================= */

.search-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 96px 24px 120px;
}

.search-inner {
  width: 100%;
  max-width: 668px;
  text-align: center;
  animation: rise .5s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(26px, 2.5vw, 34px);
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 500;
  text-wrap: balance;
}
.hero-sub {
  margin: 0 auto 30px;
  max-width: 44rem;
  font-size: 16px;
  color: var(--ink-3);
  text-wrap: balance;
}

/* the field is a tall rounded slab with the caret parked top-left
   and the submit button pinned bottom-right — like a chat composer */
.field {
  position: relative;
  background: var(--surface-field);
  border-radius: var(--r-lg);
  padding: 18px 22px 56px;
  text-align: left;
  transition: box-shadow .2s var(--ease), background .2s var(--ease);
}
.field:focus-within {
  background: var(--surface-field);
  box-shadow: 0 0 0 3px rgba(43,77,255,.12);
}

.field input {
  width: 100%;
  border: 0; outline: 0; background: none;
  font-size: 16px; color: var(--ink);
}
.field input::placeholder { color: var(--ink-3); }

.field-submit {
  position: absolute; right: 10px; bottom: 10px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--brand-600);
  color: #fff;
  transition: transform .18s var(--ease), background .18s var(--ease), opacity .18s;
}
.field-submit:hover { background: var(--brand-700); transform: translateY(-1px); }
.field-submit:disabled { opacity: .45; cursor: default; transform: none; }

/* autocomplete — opens UPWARD, sitting above the field */
.ac {
  position: absolute;
  left: 0; right: 0; bottom: calc(100% + 8px);
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  overflow: hidden auto;
  max-height: min(330px, calc(100vh - 220px));
  overscroll-behavior: contain;
  display: none;
  animation: acIn .16s var(--ease) both;
}
.ac.is-open { display: block; }
@keyframes acIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.ac-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 22px;
  transition: background .12s;
}
.ac-item + .ac-item { box-shadow: inset 0 1px 0 var(--hairline); }
.ac-item strong { display: block; font-size: 15px; font-weight: 500; line-height: 1.4; }
.ac-item span   { display: block; font-size: 13.5px; color: var(--ink-3); line-height: 1.4; margin-top: 1px; }

/* the active row goes full-bleed dark green, white text */
.ac-item.is-active { background: var(--brand-600); }
.ac-item.is-active strong,
.ac-item.is-active span { color: #fff; }
.ac-item.is-active span { color: rgba(255,255,255,.82); }

/* suggestion chips */
.chips {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px; margin-top: 28px;
}
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface-sub);
  border-radius: var(--r-pill);
  padding: 8px 20px 8px 8px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.chip:hover { transform: translateY(-2px); background: var(--surface-field); }
.chip i {
  width: 28px; height: 28px; border-radius: var(--r-pill);
  display: grid; place-items: center; flex: none;
}
.chip-seo   i { background: var(--green-chip); }
.chip-site  i { background: var(--red-50); }
.chip-comp  i { background: var(--warm-100); }

/* =========================================================
   STAGE 2 — scanning
   ========================================================= */

.scan-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.scan-panel {
  position: relative;
  margin: 8px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 44px 40px 32px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-card);
}
.scan-panel h2 {
  margin: 0 0 30px;
  font-size: 21px; font-weight: 500; letter-spacing: -.02em;
}

/* checklist with a connector line between the bullets */
.checklist { list-style: none; margin: 0; padding: 0; }
.check {
  position: relative;
  display: flex; align-items: center; gap: 20px;
  padding: 9px 0;
  font-size: 15px;
  color: var(--ink-4);
  transition: color .3s var(--ease);
}
.check::after {                       /* connector to the next bullet */
  content: "";
  position: absolute; left: 11px; top: 34px;
  width: 1px; height: 12px;
  background: var(--hairline);
  opacity: 0;
  transition: opacity .3s;
}
.check:last-child::after { display: none; }
.check.is-done::after { opacity: 1; }

.check.is-active { color: var(--ink); font-weight: 500; }
.check.is-done   { color: var(--ink); }

.check .dot {
  position: relative;
  width: 22px; height: 22px; flex: none;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--hairline);
  display: grid; place-items: center;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
/* spinner ring on the active row */
.check.is-active .dot {
  border-color: rgba(11,18,51,.12);
  border-top-color: var(--ink);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.check.is-done .dot {
  background: var(--ink); border-color: var(--ink);
  animation: pop .28s var(--ease);
}
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

.check .dot svg { opacity: 0; transition: opacity .2s .06s; }
.check.is-done .dot svg { opacity: 1; }

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

/* countdown pill at the bottom of the panel, with a progress hairline */
.scan-foot { margin-top: auto; position: relative; }
.scan-progress {
  position: absolute; left: 0; right: 0; top: -14px; height: 2px;
  background: var(--hairline); border-radius: 2px; overflow: hidden;
}
.scan-progress i {
  display: block; height: 100%; width: 100%;
  background: var(--brand-600);
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s linear;
}
.scan-pill {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 15px; font-weight: 500;
}
.scan-pill .spin {
  width: 16px; height: 16px; flex: none;
  border-radius: var(--r-pill);
  border: 2px solid rgba(11,18,51,.15);
  border-top-color: var(--ink);
  animation: spin .7s linear infinite;
}

.scan-fail {
  margin-top: var(--space-5); padding: var(--space-4) var(--space-5);
  background: var(--red-50); border: 1px solid var(--red-100);
  border-radius: 12px;
}
.scan-fail b { display: block; font-size: var(--text-md); color: var(--red-700); margin-bottom: var(--space-1); }
.scan-fail p { margin: 0 0 var(--space-3); font-size: var(--text-base); color: var(--ink-2); line-height: 1.5; }
.btn-retry {
  background: var(--ink); color: #fff; border-radius: var(--r-pill);
  padding: var(--space-2) var(--space-5); font-size: var(--text-base); font-weight: 500;
}
.btn-retry:hover { opacity: .88; }

/* right-hand viewport where the scanned artifacts appear */
.scan-view {
  position: relative;
  display: grid; place-items: center;
  padding: 40px;
  overflow: hidden;
}

.artifact {
  position: absolute;
  opacity: 0;
  transform: translateY(18px) scale(.985);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  pointer-events: none;
}
.artifact.is-in { opacity: 1; transform: none; }

/* the green laser sweeping top→bottom across the view */
.scanline {
  position: absolute; left: 0; right: 0; top: 0; height: 180px;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(87,170,48,0) 0%,
      rgba(87,170,48,.05) 55%,
      rgba(87,170,48,.16) 92%,
      rgba(87,170,48,.9) 100%);
  filter: blur(.2px);
  animation: sweep 3.4s var(--ease) infinite;
}
@keyframes sweep {
  0%   { transform: translateY(-190px); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* --- artifact: fake google search bar --- */
.mock-search {
  width: 620px; max-width: 70vw;
  background: #fff; border-radius: var(--r-pill);
  box-shadow: var(--shadow-card);
  padding: 16px 24px;
  display: flex; align-items: center; gap: 14px;
  font-size: 17px; color: var(--ink-2);
}
.mock-search .caret {
  display: inline-block; width: 1px; height: 19px;
  background: var(--ink); margin-left: 1px;
  animation: blink 1s steps(2) infinite;
  vertical-align: -3px;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- artifact: google business profile card --- */
.mock-gbp {
  width: 520px; max-width: 62vw;
  background: #fff; border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 12px 12px 24px;
}
.mock-map {
  height: 172px; border-radius: 10px; position: relative; overflow: hidden;
  background:
    linear-gradient(#eef2ea, #eef2ea);
}
.mock-map .park { position: absolute; background: #dfe9d6; border-radius: 4px; }
.mock-map .road { position: absolute; background: #fff; }
.mock-map .pin {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%);
  width: 30px; height: 30px; border-radius: var(--r-pill);
  background: var(--ink); display: grid; place-items: center;
}
.mock-gbp h3 { margin: 18px 0 8px 12px; font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.mock-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 10px 12px; font-size: 15px; color: var(--ink-2); }
.mock-meta .sep { color: var(--hairline); }
.mock-gbp p { margin: 0 12px; font-size: 15px; color: var(--ink-3); }

.stars { display: inline-flex; gap: 2px; }
.stars svg { display: block; }

/* --- artifact: their Google Business Profile photos --- */
.mock-photos {
  width: 540px; max-width: 64vw;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.mock-photos .ph {
  aspect-ratio: 4 / 3;
  border-radius: 12px; overflow: hidden;
  background: var(--surface-sub);
  box-shadow: var(--shadow-card);
  opacity: 0; transform: translateY(10px) scale(.97);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.mock-photos .ph.is-in { opacity: 1; transform: none; }
.mock-photos .ph.is-fail { opacity: .35; }
.mock-photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mock-photos .no-photos {
  grid-column: 1 / -1; padding: 40px; text-align: center;
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-card);
  color: var(--ink-3); font-size: 15px;
}

/* --- artifact: phone frame --- */
.mock-phone {
  width: 282px; height: 580px;
  background: #fff; border-radius: 34px;
  box-shadow: var(--shadow-card);
  padding: 12px 10px; position: relative;
}
.mock-phone .nub { position: absolute; right: -3px; top: 150px; width: 3px; height: 46px; background: rgba(11,18,51,.07); border-radius: 2px; }
.mock-phone .bar { display: flex; align-items: center; justify-content: center; height: 62px; position: relative; }
.mock-phone .burger { position: absolute; left: 14px; display: grid; gap: 4px; }
.mock-phone .burger i { display: block; width: 18px; height: 2px; background: #2f6d76; border-radius: 2px; }
.mock-phone .brand {
  width: 74px; height: 44px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #2f6d76; letter-spacing: -.01em;
}
.mock-phone .shot {
  height: 468px; border-radius: 4px; overflow: hidden;
  background: linear-gradient(165deg, #dbeef0, #9cc6cc 55%, #4d858e);
  position: relative;
  display: grid; place-items: center;
  padding: 0 20px; text-align: center;
  color: rgba(255,255,255,.95);
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  line-height: 1.35; overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgba(20,60,66,.35);
}

/* =========================================================
   STAGE 3 — report
   ========================================================= */

.report-stage {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: 8px 8px 80px;
}

/* --- sticky score rail --- */
.score-rail {
  position: sticky; top: 8px;
  /* Fills the viewport, but grows if the contact card and benchmark
     line need more - a fixed height let the last category row fall
     out of the tinted panel on a shorter window. */
  min-height: calc(100vh - 16px);
  border-radius: var(--r-lg);
  padding: 64px 34px 34px;
  display: flex; flex-direction: column;
  background: var(--tint-none);
  transition: background-color .3s var(--ease);
}
/* The panel stays the brand's cool neutral; the grade lives in the ring
   and the grade word, so a Fair score doesn't paint the panel beige. */
.score-rail[data-grade="poor"] #gradeWord { color: var(--red-700); }
.score-rail[data-grade="fair"] #gradeWord { color: var(--amber-600); }
.score-rail[data-grade="good"] #gradeWord { color: var(--green-700); }
.rail-label strong { font-family: var(--font-head); font-weight: 700; }
@media (min-width: 901px) and (max-height: 860px) {
  .score-rail { padding: 60px 28px 24px; }
  .dial { width: 140px; height: 140px; margin-top: 0; }
  .dial svg { width: 140px; height: 140px; }
  .dial .num b { font-size: 38px; }
  .rail-label { margin-top: 14px; }
  .rail-label strong { font-size: 20px; }
  .rail-cta { margin-top: var(--space-4); padding: var(--space-4); }
  .rail-cta p { margin-bottom: var(--space-3); }
  .bench-rank { margin-bottom: 12px; padding: 8px 12px; }
  .rail-cats { gap: 14px; }
}

.dial { position: relative; width: 170px; height: 170px; margin: 8px auto 0; }
.dial svg { transform: rotate(-90deg); display: block; }
.dial .num {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.dial .num b { display: block; font-size: 46px; font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.dial .num small { display: block; font-size: 14px; color: var(--ink-3); margin-top: 5px; }

.rail-label { text-align: center; margin-top: 22px; }
.rail-label span { display: block; font-size: 14px; color: var(--ink-2); }
.rail-label strong { display: block; font-size: 23px; font-weight: 400; margin-top: 4px; letter-spacing: -.02em; }

.bench-rank {
  margin: 0 0 18px; padding: 11px 14px;
  background: rgba(255,255,255,.55); border-radius: 10px;
  font-size: 13px; color: var(--ink-2); line-height: 1.5; text-align: center;
}
.bench-rank b { font-weight: 600; }

/* category breakdown pinned to the bottom of the rail */
.rail-cats { margin-top: auto; display: grid; gap: 22px; }
.rail-cat { display: flex; align-items: center; gap: 18px; min-width: 0; }
.rail-cat .txt { min-width: 0; }
.rail-cat .txt b { overflow-wrap: anywhere; }
.rail-cat .mini { width: 34px; height: 34px; flex: none; }
.rail-cat .mini svg { transform: rotate(-90deg); display: block; }
.rail-cat .txt { flex: 1; }
.rail-cat .txt b { display: block; font-size: 16px; font-weight: 500; }
.rail-cat .txt span { display: block; font-size: 14px; font-weight: 600; margin-top: 1px; }
.rail-cat .score { font-size: 15px; color: var(--ink-2); }

.g-pending { color: var(--ink-4); font-style: italic; }
.rail-cat.is-pending .txt b { color: var(--ink-3); }
.score-rail.is-provisional .dial .num b { opacity: .78; }
.g-poor { color: var(--red-700); }
.g-fair { color: var(--amber-600); }
.g-good { color: var(--green-500); }

/* --- report body --- */
/* The top bar is fixed and ~82px tall; the first card must start under
   it, not behind it. The phone rule below resets this, since there the
   rail comes first and already clears the bar. */
.report-body { display: grid; gap: 20px; padding: 92px 24px 0 8px; }

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.card-head h2 {
  margin: 0 0 6px;
  font-size: 23px; font-weight: 500; letter-spacing: -.02em; line-height: 1.22;
  text-wrap: balance;
}
.card-head p { margin: 0; color: var(--ink-3); font-size: 14px; }

.report-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }

/* money-at-risk card */
.biz { margin: 22px 0 20px; }
.biz b { display: block; font-size: 18px; font-weight: 500; }
.biz span { display: block; font-size: 14px; color: var(--ink-3); }

.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.problems li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--ink-2); }
.problems li svg { flex: none; margin-top: 2px; }

/* competitor leaderboard */
.ranks { list-style: none; margin: 20px 0 0; padding: 0; }
.rank {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
  font-size: 15px;
}
.rank:last-child { box-shadow: none; }
.rank .av {
  width: 34px; height: 34px; flex: none; border-radius: 8px;
  background: var(--surface-sub);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
}
.rank .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .rt { display: flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 14px; }
.rank .pos { width: 44px; text-align: right; color: var(--ink-3); font-size: 14px; }
.rank.is-you { font-weight: 600; }
.rank.is-you .av { background: var(--red-50); color: var(--red-700); }
.rank.is-you .pos { color: var(--red-700); }

/* keyword ranking table */
.kw-table { margin-top: 22px; }
.kw {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 16px;
  padding: 15px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.kw:last-child { box-shadow: none; }
.kw .term { display: flex; align-items: center; gap: 12px; font-size: 15px; min-width: 0; }
.kw .term .g { flex: none; }
.kw .term .t { min-width: 0; }
.kw .term .t b { display: block; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw .term .t .vol {
  display: block; font-size: 12px; color: var(--ink-4); margin-top: 2px;
}
.kw .term .t em.is-win { color: var(--green-700); font-weight: 500; }
.kw .term .t em {
  display: block; font-style: normal; font-size: 13px; color: var(--red-700); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kw .slot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.badge {
  border-radius: 7px; padding: 5px 10px;
  font-size: 13px; font-weight: 500;
  background: var(--surface-sub); color: var(--ink-3);
}
.badge.is-ranked { background: var(--green-100); color: var(--green-700); }

/* --- detail sections --- */
.sect-head {
  display: flex; align-items: flex-start; gap: 18px;
  margin-bottom: 26px;
}
.sect-head .idx {
  font-size: 22px; font-weight: 500; letter-spacing: -.02em; color: var(--ink-4);
  line-height: 1.15;
}
.sect-head .txt { flex: 1; }
.sect-head h3 { margin: 0; font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.sect-head p  { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.sect-head .pts { font-size: 18px; font-weight: 500; white-space: nowrap; }

.group { margin-top: 26px; }
.group h4 {
  margin: 0 0 6px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-4);
}

.checks { list-style: none; margin: 0; padding: 0; }
.crow {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 13px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.crow:last-child { box-shadow: none; }
.crow .ic { flex: none; margin-top: 1px; }
.crow .body { flex: 1; min-width: 0; }
.crow .body b { display: block; font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.crow .body p { margin: 3px 0 0; font-size: 14px; color: var(--ink-3); }
/* values must be allowed to wrap — keyword lists and descriptions are long
   enough to force the whole row off-canvas when held on one line */
.crow .val {
  font-size: 14px; color: var(--ink-3);
  min-width: 0; max-width: 42%;
  text-align: right; overflow-wrap: anywhere;
}

/* page speed strip */
.speed { display: flex; align-items: center; gap: 14px; margin: 20px 0 18px; }
.speed .big { font-size: 30px; font-weight: 500; letter-spacing: -.02em; }
.pass { background: var(--green-100); color: var(--green-700); border-radius: 7px; padding: 5px 11px; font-size: 13px; font-weight: 600; }
.pass.is-warn { background: var(--amber-100); color: #8a5d14; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 18px; margin-top: 18px; }
.metric { background: var(--bg); border-radius: 12px; padding: 16px; }
.metric b { display: block; font-size: 20px; font-weight: 500; }
.metric span { display: block; font-size: 13px; color: var(--ink-3); margin-top: 3px; }

/* still being checked — must not read as a failure */
.crow.is-pending .body b { color: var(--ink-3); }
.crow.is-pending .val { color: var(--ink-4); font-style: italic; }
.spin-ic { animation: spin .9s linear infinite; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: reduce) { .spin-ic { animation: none; } }

/* rows we genuinely couldn't check */
.crow.is-unknown .body b { color: var(--ink-3); }
.crow.is-unknown .val { color: var(--ink-4); font-style: italic; }

/* scan caveats */
.card.notice { background: var(--tint-fair); box-shadow: none; border: 1px solid var(--amber-100); padding: 22px 26px; }
.card.notice b { display: block; font-size: 15px; margin-bottom: 8px; }
.card.notice ul { margin: 0; padding-left: 18px; }
.card.notice li { font-size: 14px; color: var(--ink-2); margin: 4px 0; }

/* empty state for missing SERP data */
.empty { background: var(--bg); border-radius: 12px; padding: 26px; margin-top: 20px; }
.empty b { display: block; font-size: 16px; margin-bottom: 8px; }
.empty p { margin: 0 0 10px; font-size: 14px; color: var(--ink-3); line-height: 1.6; }
.empty code {
  background: #fff; border: 1px solid var(--hairline); border-radius: 6px;
  padding: 2px 7px; font-size: 13px;
}
.empty code.pid { display: inline-block; margin-bottom: 12px; font-size: 13px; word-break: break-all; }

/* demo-data note — informative, not alarming */
.sample-flag {
  background: var(--bg); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 11px 16px; margin-top: 18px;
}
.sample-flag span { font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.sample-flag b { color: var(--ink-2); font-weight: 500; }

/* revenue working */
.working { margin-top: 22px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.working summary {
  cursor: pointer; font-size: 14px; color: var(--ink-3);
  list-style: none; display: flex; align-items: center; gap: 7px;
}
.working summary::-webkit-details-marker { display: none; }
.working summary::before { content: "▸"; font-size: 11px; transition: transform .15s; }
.working[open] summary::before { transform: rotate(90deg); }
.working summary:hover { color: var(--ink); }
.working-body { margin-top: 14px; }
.wrow {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; font-size: 14px;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.wrow span { color: var(--ink-3); }
.wrow b { font-weight: 500; white-space: nowrap; }
.wrow.is-total { box-shadow: none; font-weight: 600; padding-top: 12px; }
.wrow.is-total span { color: var(--ink); }
.wnote { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-4); line-height: 1.6; }
.wnote code { background: var(--surface-sub); border-radius: 4px; padding: 1px 5px; }

/* review benchmark bars */
.bench { margin-top: 22px; display: grid; gap: 12px; }
.bench-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.bench-row .bl { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench-row .bar { height: 12px; background: var(--surface-sub); border-radius: var(--r-pill); overflow: hidden; }
.bench-row .bar i { display: block; height: 100%; background: var(--green-700); border-radius: var(--r-pill); }
.bench-row.is-rival .bar i { background: #c3c9da; }
.bench-row.is-rival .bl { color: var(--ink-3); font-weight: 400; }
.bench-row .bv { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.bench-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.bench-note.caveat { color: var(--ink-4); font-style: italic; }

/* sentiment themes */
.senti { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.senti-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.senti-head b { font-size: 15px; }
.senti-count { font-size: 13px; color: var(--ink-3); }
.themes { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.themes li { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.themes .tn { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.themes .tbar { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-sub); }
.themes .tbar i { display: block; }
.themes .tbar .p { background: var(--green-500); }
.themes .tbar .n { background: #c3c9da; }
.themes .tbar .g { background: var(--red-500); }
.themes .tc { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

@media (max-width: 700px) {
  .bench-row, .themes li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .bench-row .bar, .themes .tbar { order: 3; }
}

/* --- the gate --- */
.gated { filter: blur(7px); pointer-events: none; user-select: none; }

.gate-scrim {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(251,248,245,.25);
  backdrop-filter: blur(1px);
}
.gate {
  width: 100%; max-width: 520px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  padding: 44px 44px 40px;
  text-align: center;
  animation: rise .35s var(--ease) both;
}
.gate .lock { margin-bottom: 12px; }
.gate h2 { margin: 0 0 12px; font-size: 32px; font-weight: 400; letter-spacing: -.025em; }
.gate > p { margin: 0 0 26px; color: var(--ink-2); font-size: 16px; text-wrap: balance; }

.verify {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 18px 20px;
  background: var(--surface-sub);
  text-align: left;
  width: 100%;
  transition: background .18s;
}
.verify:hover { background: var(--surface-field); }
.verify .box {
  width: 26px; height: 26px; flex: none;
  border: 2px solid rgba(11,18,51,.25);
  border-radius: 4px; background: #fff;
  display: grid; place-items: center;
}
.verify .box svg { opacity: 0; transition: opacity .2s; }
.verify.is-checked .box { background: var(--brand-600); border-color: var(--brand-600); }
.verify.is-checked .box svg { opacity: 1; }
.verify .lbl { flex: 1; font-size: 17px; }
.verify .mark { text-align: right; font-size: 11px; color: var(--ink-3); line-height: 1.3; }
.verify .mark b { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; }

.gate .legal { margin: 22px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.gate .legal a { text-decoration: underline; display: inline-block; padding: 4px 2px; }

/* real site screenshot inside the phone mock */
.mock-phone .shot.has-shot {
  background-size: cover; background-position: top center;
  text-shadow: none;
}

/* the practice's own logo in the header chip */
.mock-phone .brand.has-logo {
  border: 0; width: auto; max-width: 140px; height: 44px;
  padding: 0 6px;
}
.mock-phone .brand.has-logo img {
  max-width: 100%; max-height: 40px;
  object-fit: contain; display: block;
}

/* who's buying ads on these terms */
.ads-note {
  margin-top: 22px; padding: 16px 20px;
  background: var(--bg); border-radius: 12px;
}
.ads-note b { display: block; font-size: 14px; margin-bottom: 6px; }
.ads-note p { margin: 0; font-size: 14px; color: var(--ink-3); line-height: 1.7; }
.ads-note .adv {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--r-pill);
  padding: 3px 11px; margin: 3px 4px 0 0; font-size: 13px; color: var(--ink-2);
}
.ads-note .adv i { font-style: normal; font-size: 11px; color: var(--ink-4); }

/* --- priced action plan --- */
.card.plan { border: 1px solid var(--brand-100); }
.actions { list-style: none; margin: 22px 0 0; padding: 0; counter-reset: a; }
.action {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start; gap: 16px;
  padding: 18px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.action:last-child { box-shadow: none; padding-bottom: 0; }
.anum {
  width: 26px; height: 26px; border-radius: var(--r-pill);
  background: var(--green-800); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}
.abody b { display: block; font-size: 16px; font-weight: 500; }
.ahow { margin: 5px 0 0; font-size: 14px; color: var(--ink-2); }
.awhy { margin: 4px 0 0; font-size: 13px; color: var(--ink-4); }
.ameta { text-align: right; white-space: nowrap; }
.aval { display: block; font-size: 19px; font-weight: 600; color: var(--green-700); }
.aval small { font-size: 12px; font-weight: 400; color: var(--ink-4); }
.aeff {
  display: inline-block; margin-top: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  border-radius: var(--r-pill); padding: 3px 9px;
}
.eff-low    { background: var(--green-100); color: var(--green-700); }
.eff-medium { background: var(--amber-100); color: #8a5d14; }
.eff-high   { background: var(--red-50);    color: var(--red-700); }

/* --- website screenshots --- */
.shots { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; margin-top: 20px; }
.shot-fig { margin: 0; }
.shot-frame {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--hairline); background: #fff;
  aspect-ratio: 9 / 13; display: grid; place-items: center;
  box-shadow: var(--shadow-card);
}
.shot-frame.tall { aspect-ratio: 9 / 16; max-width: 240px; }
.shot-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.shot-none { font-size: 13px; color: var(--ink-4); }
.shot-fig figcaption {
  margin-top: 9px; font-size: 12.5px; color: var(--ink-3);
  text-align: center; overflow-wrap: anywhere;
}

.sitecard-body { display: flex; gap: 26px; align-items: flex-start; margin-top: 20px; flex-wrap: wrap; }
.sitecard-meta { flex: 1; min-width: 200px; display: grid; gap: 8px; align-content: start; }
.sitecard-meta .pg {
  display: flex; gap: 10px; align-items: baseline;
  padding: 9px 0; box-shadow: inset 0 -1px 0 var(--hairline);
}
.sitecard-meta .pg b {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--green-700); min-width: 66px;
}
.sitecard-meta .pg span { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }

@media (max-width: 560px) { .shots { grid-template-columns: minmax(0,1fr); } }

/* --- head-to-head --- */
.vs-lede { margin: 20px 0 0; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.vs { margin-top: 20px; }
.vs-head, .vs-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px;
  align-items: center; gap: 12px;
}
.vs-head { padding-bottom: 10px; box-shadow: inset 0 -1px 0 var(--hairline); }
.vs-head span { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-4); text-align: center; overflow-wrap: anywhere; min-width: 0; }
.vs-head span:first-child { text-align: left; }
.vs-head .vs-you { color: var(--ink); }
.vs-row { padding: 11px 0; box-shadow: inset 0 -1px 0 var(--hairline); }
.vs-row:last-child { box-shadow: none; }
.vs-row.is-gap { background: linear-gradient(90deg, rgba(250,232,232,.5), transparent 70%); border-radius: 8px; }
.vs-label { font-size: 14px; }
.vs-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vs-cell i { font-style: normal; font-size: 11px; color: var(--ink-4); text-align: center; }

@media (max-width: 640px) {
  .crow { flex-wrap: wrap; }
  .crow .val { max-width: 100%; text-align: left; padding-left: 31px; }

  .action { grid-template-columns: 26px minmax(0, 1fr); }
  .ameta { grid-column: 2; text-align: left; margin-top: 6px; }
  .vs-head, .vs-row { grid-template-columns: minmax(0, 1fr) 64px 64px; gap: 8px; }
}

/* --- PDF / print --- */

.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.btn-pdf {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-pill); padding: 9px 18px; min-height: 44px; white-space: nowrap;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-card);
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.btn-pdf:hover { transform: translateY(-1px); background: var(--brand-50); }
/* the wordmark never shrinks under its neighbours; between phone and desktop
   the two header buttons go icon-only so the lockup keeps its room */
@media (min-width: 561px) { .logo-product, .logo-by, .logo-brand { flex: none; } }
@media (max-width: 1100px) {
  .btn-pdf span { display: none; }
  .btn-pdf { padding: 10px 12px; min-width: 44px; justify-content: center; gap: 0; }
}

.print-mark { display: none; }

@media print {
  @page { size: A4; margin: 14mm 12mm 12mm; }

  /* Watermark and footer on every page. Fixed elements are repeated per
     printed page; the footer sits in the bottom margin so it never
     overlaps the content. */
  .print-mark { display: block; }
  .pm-diag {
    position: fixed; left: 50%; top: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 64px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap;
    color: #010100; opacity: .045; z-index: 0; pointer-events: none;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  /* The table wrapper (added by the PDF handler) repeats its tfoot at
     the foot of every page, which reserves the strip the fixed footer
     is drawn in. A fixed element hanging into the page margin is
     fragmented onto the next page by Chromium, so it cannot live there. */
  .print-table { width: 100%; border-collapse: collapse; }
  .print-table td { padding: 0; vertical-align: top; }
  .print-table .pt-space { height: 12mm; }
  .pm-foot {
    position: fixed; left: 0; right: 0; bottom: 0; height: 9mm;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 9px; color: #6b6560; border-top: 1px solid #e6e1db; padding-top: 4px;
  }
  .pm-brand { display: inline-flex; align-items: center; gap: 5px; color: #010100; font-weight: 500; }
  .pm-brand em { font-style: normal; color: #6b6560; font-weight: 400; }
  .pm-brand img { height: 14px; width: auto; display: block; }
  .pm-right { white-space: nowrap; }
  .report-stage, .report-body, .card, .score-rail { position: relative; z-index: 1; }
  .card { background: transparent !important; }

  html, body { background: #fff !important; }

  /* chrome that shouldn't print */
  .topbar, .gate-scrim, .scan-stage, .search-stage { display: none !important; }

  /* the report becomes a single column so nothing is cropped */
  .report-stage { display: block !important; padding: 0 !important; }

  .score-rail {
    position: static !important; height: auto !important; min-height: 0 !important;
    break-inside: avoid; page-break-inside: avoid;
    padding: 20px 24px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center; gap: 28px;
    margin-bottom: 14px;
  }
  .score-rail .dial { margin: 0; }
  .rail-label { text-align: left; margin: 0; }
  .rail-cats { margin-top: 14px !important; grid-column: 1 / -1; }

  .report-body { padding: 0 !important; gap: 12px !important; }

  .card {
    box-shadow: none !important;
    border: 1px solid #e6e1db;
    padding: 18px 20px !important;
    break-inside: avoid; page-break-inside: avoid;
  }
  .report-cols { grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; gap: 12px !important; }

  /* keep rows and groups intact across page breaks */
  .crow, .kw, .rank, .bench-row, .themes li, .metric, .wrow,
  .action, .vs-row { break-inside: avoid; page-break-inside: avoid; }
  .group { break-inside: avoid-page; }

  /* expanded working, no interactive affordances */
  .working summary { list-style: none; color: var(--ink-2); }
  .working summary::before { display: none; }

  .gated { filter: none !important; }

  /* tighten type for paper */
  .card-head h2 { font-size: 18px !important; }
  .sect-head h3 { font-size: 17px !important; }
  .crow .body b, .kw .term .t b { font-size: 13px !important; }
  .crow .body p { font-size: 12px !important; }

  a { text-decoration: none; color: inherit; }
}

/* --- responsive --- */
@media (max-width: 1080px) {
  .report-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .scan-stage { grid-template-columns: minmax(0, 1fr); }
  .scan-view { display: none; }
  .report-stage { grid-template-columns: minmax(0, 1fr); padding-bottom: 40px; }
  /* the fixed top bar is ~64px on a phone; the ring must start below it */
  .score-rail { position: static; height: auto; padding: 84px 28px 40px; }
  .rail-cats { margin-top: 34px; }
  .report-body { padding: 0; }
  .card { padding: 28px; }
  .card-head h2 { font-size: 24px; }
  .gate { padding: 32px 24px; }
  .gate h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* secondary line inside an empty-state panel */
.empty .muted { color: var(--ink-4); font-size: 13px; }



/* ---------- technical SEO review ----------
   Uses this stylesheet's own tokens (--space-*, --hairline, --surface-sub).
   An earlier version referenced --s4 / --line / --sub from a different
   project, so every gap, border and background silently did nothing. */
.da-head {
  display: flex; gap: var(--space-7); flex-wrap: wrap; align-items: flex-start;
  padding-bottom: var(--space-4); margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--hairline);
}
.da-stat { display: flex; flex-direction: column; gap: 2px; }
.da-stat b {
  font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.da-stat b.is-bad { color: var(--red-500); }
.da-stat span { font-size: 12px; color: var(--ink-4); white-space: nowrap; }
.da-partial {
  flex-basis: 100%; margin: var(--space-2) 0 0; font-size: 12.5px; color: var(--amber-600);
}

.da-group { margin-bottom: var(--space-6); }
.da-group h3 {
  margin: 0 0 var(--space-2); font-size: 11.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-4);
}
.da-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr);
  column-gap: var(--space-4); row-gap: 0;
  align-items: baseline;
  padding: var(--space-3) 0; border-top: 1px solid var(--hairline);
}
.da-count {
  font-size: 20px; font-weight: 600; line-height: 1.2; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.da-row.sev-high .da-count   { color: var(--red-500); }
.da-row.sev-medium .da-count { color: var(--amber-600); }
.da-body { min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.da-text { font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.da-eg { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.da-eg code {
  font-size: 11.5px; color: var(--ink-4); background: var(--surface-sub);
  padding: 3px 8px; border-radius: 6px; overflow-wrap: anywhere;
}
.da-clean {
  display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center;
  padding-top: var(--space-4); margin-top: var(--space-2);
  border-top: 1px solid var(--hairline);
  font-size: 12px; color: var(--ink-4);
}
.da-clean span {
  background: var(--surface-sub); color: var(--ink-3);
  padding: 3px 10px; border-radius: var(--r-pill, 999px);
}
.da-allclear { margin: 0; font-size: 14.5px; }

@media (max-width: 640px) {
  .da-head { gap: var(--space-5); }
  .da-row { grid-template-columns: 44px minmax(0, 1fr); column-gap: var(--space-3); }
  .da-stat b { font-size: 24px; }
}

/* Rankings take 10-30s to come back. An indeterminate indicator is
   honest about that; a percentage would be invented, since the provider
   reports no progress. */
.serp-loading { display: flex; gap: 6px; padding-top: var(--space-3); }
.serp-loading i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4);
  animation: serpPulse 1.2s ease-in-out infinite;
}
.serp-loading i:nth-child(2) { animation-delay: .18s; }
.serp-loading i:nth-child(3) { animation-delay: .36s; }
@keyframes serpPulse { 0%, 80%, 100% { opacity: .2 } 40% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) {
  .serp-loading i { animation: none; opacity: .5; }
}

/* ---------- contact CTA in the score rail ----------
   Sits in the space between the grade and the category rows, which was
   empty on every report. The rail is sticky, so this stays in view for
   the whole scroll. */
.rail-cta {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--r-lg);
  backdrop-filter: blur(4px);
}
.rail-cta b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.rail-cta p { margin: 6px 0 var(--space-4); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.cta-btn {
  display: block; text-align: center; text-decoration: none;
  background: var(--brand-600); color: #fff;
  padding: 12px 16px; min-height: 44px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500;
  transition: transform .15s var(--ease), opacity .15s var(--ease);
}
.cta-btn:hover { transform: translateY(-1px); background: var(--brand-700); }
.cta-btn:active, .gate-go:active, .field-submit:active { transform: translateY(0); }
.cta-alt {
  display: block; text-align: center; margin-top: var(--space-2);
  font-size: 12.5px; color: var(--ink-3);
}

/* the rail collapses on small screens, so the CTA follows the content */
@media (max-width: 900px) {
  .rail-cta { grid-column: 1 / -1; margin-top: var(--space-4); }
}


/* Phone readability: the 11px eyebrow labels and URL chips are fine on a
   desktop but sit under the 12px floor on a phone, and the details
   toggle was a 20px-tall tap target. */
@media (max-width: 560px) {
  .aeff, .sitecard-meta .pg b, .vs-cell i, .ads-note .adv i, .verify .mark { font-size: 12px; }
  .da-group h3 { font-size: 12px; }
  .da-eg code { font-size: 12.5px; padding: 4px 9px; }
  .working summary { min-height: 44px; padding: 8px 0; font-size: 15px; }
  .rail-label strong { font-size: 26px; }
  .card { padding: 22px 18px; }
  .card-head h2 { font-size: 22px; }
}


/* ---------- lead capture gate ---------- */
.gate-form { display: grid; gap: 12px; text-align: left; margin: 0 0 18px; }
.gf { display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); }
.gf span em { font-style: normal; color: var(--ink-4); }
.gf input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 1px solid var(--hairline); border-radius: 10px; background: #fff;
}
.gf input:focus { outline: 2px solid var(--brand-600); outline-offset: 1px; border-color: var(--brand-600); }
.gf input[aria-invalid="true"] { border-color: var(--red-700); }
/* the honeypot: off-canvas, not display:none, so a bot's DOM walk still finds it */
.gf-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.gate-go {
  margin-top: 4px; padding: 14px 20px; border-radius: var(--r-pill);
  background: var(--brand-600); color: #fff; font: inherit; font-size: 16px; font-weight: 600;
  border: 0; cursor: pointer;
}
.gate-go:hover:not(:disabled) { background: var(--brand-700); }
.gate-go:disabled { opacity: .6; cursor: progress; }
.gate-err { margin: 0; color: var(--red-700); font-size: 13px; }


/* ---------- privacy page ---------- */
.legal-body { background: var(--bg); }
.legal-page { max-width: 42rem; margin: 0 auto; padding: 120px 24px 80px; color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.legal-page h1 { font-size: 34px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; color: var(--ink); }
.legal-page h2 { font-size: 20px; font-weight: 700; margin: 34px 0 10px; color: var(--ink); }
.legal-page p, .legal-page li { margin: 0 0 12px; }
.legal-page ul { padding-left: 20px; }
.legal-page a { color: inherit; }
.legal-updated { color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }
.legal-note { margin-top: 36px; color: var(--ink-3); font-size: 14px; }
.legal-body .topbar { pointer-events: auto; }


/* ---------- what the wider reads add to the report ----------
   None of this is a new card except the AI one: the review, search and
   rival cards already asked these questions and simply had no answer.
   Styling therefore borrows the vocabulary already in those cards -
   .bench rows, .themes bars, .rank rows - rather than inventing a
   parallel one. */

/* reviews: two figures above the themes */
.rv-stats { display: flex; gap: 10px; margin: 0 0 18px; flex-wrap: wrap; }
.rv-stat { flex: 1 1 140px; padding: 11px 14px; border-radius: 10px; background: var(--surface-sub); }
.rv-stat b { display: block; font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1; }
.rv-stat span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }
.rv-stat.is-good { background: var(--green-100); } .rv-stat.is-good b { color: var(--green-700); }
.rv-stat.is-bad  { background: var(--red-50); }    .rv-stat.is-bad b  { color: var(--red-700); }
/* the theme bar gains a treatment tone and a remainder track */
.themes .tbar i.t { background: #8a5d14; }
.themes .tbar i.z { background: var(--surface-sub); }

/* search: footprint, gap, and the reason behind both */
.footprint { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 4px; }
.footprint.is-solo { grid-template-columns: 1fr; }
.fp-caveat { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-4); line-height: 1.5; }
.footprint .fp-side { padding: 15px 16px; border-radius: 11px; background: var(--surface-sub); }
.footprint b { display: block; font-size: 34px; font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.footprint b.is-low { color: var(--red-700); }
.footprint span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 7px; }

.gapbox { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.gap-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gap-head b { font-size: 14px; font-weight: 600; }
.gap-head span { font-size: 11.5px; color: var(--ink-4); }
.gaps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gaps li { display: grid; grid-template-columns: 40px 1fr auto; gap: 11px; align-items: center;
           padding: 8px 11px; border-radius: 8px; background: var(--tint-fair); font-size: 13px; }
.gaps .gp { font-size: 11.5px; font-weight: 600; color: var(--amber-600); }
.gaps .gk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gaps .gv { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.why { margin: 16px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.why b { color: var(--ink); font-weight: 600; }

/* rivals: who is also buying the click */
.rank .adflag { display: inline-block; margin-left: 7px; font-size: 10px; font-weight: 700; letter-spacing: .04em;
                text-transform: uppercase; color: var(--red-700); background: var(--red-100);
                padding: 1px 6px; border-radius: 999px; vertical-align: 1px; }
.ads-note { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--hairline);
            font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.ads-note b { color: var(--ink); font-weight: 600; }

/* the one new question */
.ai-top { display: flex; gap: 14px; align-items: center; margin: 16px 0 14px; max-width: 54rem; }
.ai-count { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-content: center;
            text-align: center; background: var(--surface-sub); }
.ai-count b { display: block; font-size: 23px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.ai-count span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.ai-count.is-all  { background: var(--green-100); } .ai-count.is-all b  { color: var(--green-700); }
.ai-count.is-some { background: var(--amber-100); } .ai-count.is-some b { color: var(--amber-600); }
.ai-count.is-none { background: var(--red-100); }   .ai-count.is-none b { color: var(--red-700); }
.ai-line { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

.ai-gaps { margin: 0 0 16px; padding: 10px 13px; border-radius: 9px; background: var(--red-50); font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.ai-gaps b { color: var(--red-700); font-weight: 600; }
.ai-split { margin: -8px 0 16px; padding: 10px 13px; border-radius: 9px; background: var(--amber-100);
  font-size: 13px; color: var(--amber-600); line-height: 1.5; }
.ai-engine + .ai-engine { margin-top: 18px; }
.ai-engine-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding-bottom: 7px; margin-bottom: 4px; border-bottom: 1px solid var(--hairline); }
.ai-engine-head b { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); }
.ai-engine-head span { font-size: 12px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.ai-q em { display: block; font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink-4); margin-bottom: 3px; }
.ai-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ai-list li { display: grid; gap: 5px; padding: 13px 0; box-shadow: inset 0 -1px 0 var(--hairline); }
.ai-list li:last-child { box-shadow: none; }
.ai-q { font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.ai-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.ai-meta b { font-size: 11.5px; font-weight: 600; color: var(--green-700); }
.ai-meta b.out { color: var(--red-700); }
.ai-meta .src { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.ai-meta .src.own { background: var(--green-100); color: var(--green-700); }
.ai-meta .src.other { background: var(--amber-100); color: var(--amber-600); }
.ai-also { font-size: 11.5px; color: var(--ink-4); line-height: 1.45; }
.ai-list li.is-out .ai-q { color: var(--red-700); }
/* a question that timed out is said out loud rather than quietly
   dropped, which would have shrunk the denominator and flattered */
.ai-missed { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-4); font-style: italic; }

@media (max-width: 560px) {
  .footprint { grid-template-columns: 1fr; }
  .ai-top { gap: 13px; }
  /* the report holds a 12px floor on a phone; these labels sit under it
     at desktop sizes and must come up to meet it */
  .gaps .gp, .gaps .gv, .ai-also, .ai-meta .src, .ai-meta b,
  .gap-head span, .rv-stat span, .adflag { font-size: 12px; }
  .gaps li { grid-template-columns: 34px 1fr auto; gap: 9px; }
  .gap-head { gap: 6px; }
}

/* paper: these read as part of the card they joined */
@media print {
  .footprint, .gapbox, .ai-top, .ai-list li, .rv-stats { break-inside: avoid; page-break-inside: avoid; }
  .ai-card { break-inside: auto; }
}


/* ---------- build progress: gate panel, report bar, done toast ---------- */
.gate-progress {
  margin: -8px 0 22px; padding: 14px 16px 12px;
  border-radius: 12px; background: var(--surface-sub);
  text-align: left;
}
.gp-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.gp-head b { flex: 1; font-weight: 600; color: var(--ink); min-width: 0; }
.gp-count { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gp-spin {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid rgba(11,18,51,.14); border-top-color: var(--brand-600);
  animation: spin .9s linear infinite;
}
.gp-bar { height: 4px; margin: 10px 0 0; border-radius: 4px; background: rgba(11,18,51,.08); overflow: hidden; }
.gp-bar i { display: block; height: 100%; width: 100%; background: var(--brand-600); border-radius: 4px;
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.gate-progress.is-done .gp-bar i { background: var(--green-500); }
.gp-found { margin: 9px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.gp-found:empty { display: none; }
.gate-progress.is-done { background: var(--green-100); }
.gate-progress.is-done .gp-spin {
  animation: none; border: 0; background: var(--green-500)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.build-bar {
  /* centred by margin, not transform: the rise animation owns transform */
  position: fixed; left: 16px; right: 16px; bottom: 20px; z-index: var(--z-toast);
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px;
  padding: 12px 16px 10px;
  background: var(--surface); border-radius: 14px;
  box-shadow: 0 10px 34px rgba(11,18,51,.16), 0 0 0 1px var(--hairline);
  font-size: 13px; color: var(--ink-2);
  animation: rise .35s var(--ease) both;
}
.build-bar[hidden] { display: none; }
.bb-text { min-width: 0; line-height: 1.4; }
.bb-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bb-track { grid-column: 1 / -1; display: block; height: 3px; border-radius: 3px; background: rgba(11,18,51,.08); overflow: hidden; }
.bb-track i { display: block; height: 100%; width: 100%; background: var(--brand-600);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }

.build-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: var(--z-toast-top);
  transform: translate(-50%, 16px); opacity: 0;
  width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; font-size: 14px;
  box-shadow: 0 10px 30px rgba(11,18,51,.22);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.build-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.build-toast b { font-weight: 600; }
.bt-tick { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--green-500); display: grid; place-items: center; }

@media (max-width: 600px) {
  .build-toast { border-radius: 14px; }
}
@media print {
  .build-bar, .build-toast { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .gp-spin { animation-duration: 2.4s; }
  .gp-bar i, .bb-track i, .build-toast { transition: none; }
}


/* the practice's name heads the report: the page's h1 */
.rail-name {
  margin: 0 0 18px; text-align: center;
  padding-top: 18px;
  font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.005em; color: var(--ink);
}
.rail-name:focus { outline: none; }
.rail-name:empty { display: none; }

/* unsubscribe page: the legal-page frame, one action */
.unsub-page { max-width: 34rem; }
.unsub-page h1 { margin-top: 0; }
.unsub-page form { margin-top: 24px; }
.unsub-page .gate-go { min-width: 220px; }
