/* ==========================================================================
   /analyze/<domain> — the free AI-visibility report            (ADR-17)
   Sits between pp.css (the .zr-pp shell, cards, chips, buttons) and ui.css
   in the master order. Everything here is scoped to .zr-an; the structure
   and copy follow the live report (components/analyzed/*), re-skinned into
   the light zr-* system: white cards on #EDF1F7 hairlines, 18px radii, the
   blue accent. The report body is client-rendered by analyze.js; the shell
   ships the loading state (progress card + skeleton score cards) and the
   three failure states, toggled by data-state on #zr-an.
   ========================================================================== */
/* the state cards and the Turnstile slot are display:flex/grid, which would beat the UA's [hidden] */
.zr-an [hidden]{ display:none !important; }
.zr-an{ --an-max:1048px; --an-ok:#0F7A45; --an-ok-bg:#E4F7EC; --an-warn:#9A5B00; --an-warn-bg:#FFF3E0; --an-hot:#C2410C; --an-hot-bg:#FFEDD5; --an-bad:#B42318; --an-bad-bg:#FDECEC; }

/* ── hero: the platform card, one column, no full-screen height, no cue ─── */
.zr-an .zr-pp__hero{ min-height:0; padding-bottom:clamp(40px,4.4vw,64px); }
.zr-an .zr-pp__hero::after{ display:none; }
.zr-an .zr-pp__hero-grid{ grid-template-columns:minmax(0,1fr); width:min(var(--an-max),100%); }
.zr-an .zr-pp__copy{ align-items:flex-start; text-align:left; }
.zr-an__h1{ max-width:820px; font-size:clamp(32px,4vw,52px); }
/* The domain is underlined the way the live report does it (`underline decoration-<accent> underline-offset-4`):
   a real text underline in the heading's own ink (black), set a little below the baseline, that breaks around descenders
   (skip-ink) — not a full-width bar under the box. */
.zr-an__h1 u{
  text-decoration:underline; text-decoration-color:currentColor;
  text-decoration-thickness:.05em; text-underline-offset:.12em; text-decoration-skip-ink:auto;
}
.zr-an__lede{ max-width:760px; }

/* ── report body ────────────────────────────────────────────────────────── */
.zr-an__body{ padding-top:clamp(28px,3.2vw,44px); }
.zr-an__wrap{ width:min(var(--an-max),100%); }
.zr-an__sec{ position:relative; margin-top:clamp(40px,4.8vw,60px); }
.zr-an__sec-head{ display:flex; align-items:center; justify-content:space-between; gap:12px 20px; flex-wrap:wrap; margin-bottom:20px; }
.zr-an__h2{ display:flex; align-items:center; gap:10px; margin:0; font-size:clamp(20px,2vw,23px); font-weight:500; line-height:1.25; letter-spacing:-.02em; color:var(--pp-ink); }
.zr-an__h2 svg{ width:24px; height:24px; flex:0 0 auto; color:var(--zr-blue); }
.zr-an__more{ display:inline-flex; align-items:center; gap:6px; font-size:14px; font-weight:500; color:var(--zr-blue); text-decoration:none; }
.zr-an__more svg{ transition:translate .25s var(--zr-ease-out-quart,ease); }
.zr-an__more:hover svg{ translate:2px -2px; }

/* generic bits */
.zr-an__logo{ display:grid; place-items:center; flex:0 0 auto; overflow:hidden; background:#F6F7F9; border:1px solid var(--pp-hair); border-radius:10px; width:40px; height:40px; color:var(--pp-ink); font-weight:600; font-size:15px; }
.zr-an__logo img{ display:block; width:24px; height:24px; border-radius:5px; object-fit:contain; }
.zr-an__logo--lg{ width:64px; height:64px; border-radius:14px; font-size:24px; }
.zr-an__logo--lg img{ width:40px; height:40px; border-radius:8px; }
.zr-an__logo--lock{ color:var(--pp-dim); }
.zr-an__logo--lock svg{ width:20px; height:20px; }
.zr-an__btn{ display:inline-flex; align-items:center; gap:8px; height:38px; padding-inline:14px; border:1px solid var(--pp-hair); border-radius:9px; background:#fff; color:var(--pp-ink); font:500 13.5px/1 var(--zr-font); cursor:pointer; white-space:nowrap; transition:background .16s linear, border-color .16s linear; }
.zr-an__btn:hover{ background:#FAFBFD; border-color:#C9D6F2; }
.zr-an__btn:focus-visible{ outline:2px solid var(--zr-blue); outline-offset:2px; }
.zr-an__btn--li{ background:#0A66C2; border-color:#0A66C2; color:#fff; }
.zr-an__btn--li:hover{ background:#0957A8; border-color:#0957A8; }
.zr-an__btn.is-done{ color:var(--an-ok); border-color:#BFE8CF; background:var(--an-ok-bg); }

/* ── company card ───────────────────────────────────────────────────────── */
.zr-an__company{ display:flex; align-items:center; justify-content:space-between; gap:20px 32px; flex-wrap:wrap; padding:22px 24px; }
.zr-an__company-main{ display:flex; align-items:flex-start; gap:16px; min-width:0; flex:1 1 360px; }
.zr-an__company-copy{ min-width:0; }
.zr-an__company-name{ margin:0 0 4px; font-size:20px; font-weight:500; line-height:1.3; letter-spacing:-.02em; color:var(--pp-ink); }
.zr-an__company-desc{ margin:0; max-width:520px; font-size:14px; line-height:22px; color:var(--pp-body); text-wrap:pretty; }
.zr-an__company-desc .zr-an__sk{ width:min(420px,100%); height:14px; margin-top:4px; }
.zr-an__company-side{ display:flex; flex-direction:column; align-items:flex-end; gap:12px; flex:0 1 auto; }
.zr-an__generated{ margin:0; font-size:12.5px; color:var(--pp-dim); }
.zr-an__generated b{ font-weight:500; color:var(--pp-body); }
.zr-an__actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }

/* ── progress + failure states ──────────────────────────────────────────── */
.zr-an__progress, .zr-an__state{ display:flex; flex-direction:column; align-items:center; text-align:center; margin-top:24px; padding:clamp(28px,4vw,48px) 24px; }
.zr-an__spinner{ position:relative; display:grid; place-items:center; width:80px; height:80px; margin-bottom:22px; color:var(--zr-blue); }
.zr-an__spinner::before{ content:""; position:absolute; inset:0; border-radius:50%; border:4px solid #E8F0FE; border-top-color:var(--zr-blue); animation:zr-an-spin 1s linear infinite; }
.zr-an__progress-h, .zr-an__state-h{ margin:0 0 8px; font-size:20px; font-weight:500; line-height:1.3; letter-spacing:-.02em; color:var(--pp-ink); }
.zr-an__progress-p, .zr-an__state-p{ margin:0; max-width:460px; font-size:15px; line-height:24px; color:var(--pp-body); text-wrap:pretty; }
.zr-an__steps{ list-style:none; margin:26px 0 0; padding:0; display:flex; flex-direction:column; gap:12px; width:min(360px,100%); text-align:left; }
.zr-an__step{ display:flex; align-items:center; gap:12px; font-size:14px; line-height:20px; color:var(--pp-dim); }
.zr-an__step-dot{ display:grid; place-items:center; flex:0 0 auto; width:20px; height:20px; border-radius:50%; border:2px solid var(--pp-hair); color:#fff; }
.zr-an__step-dot svg{ display:none; }
.zr-an__step[data-status="loading"]{ color:var(--pp-ink); }
.zr-an__step[data-status="loading"] .zr-an__step-dot{ border-color:#CFE0FF; border-top-color:var(--zr-blue); animation:zr-an-spin .9s linear infinite; }
.zr-an__step[data-status="done"]{ color:var(--pp-body); }
.zr-an__step[data-status="done"] .zr-an__step-dot{ border-color:var(--an-ok); background:var(--an-ok); }
.zr-an__step[data-status="done"] .zr-an__step-dot svg{ display:block; }
.zr-an__state-icon{ display:grid; place-items:center; width:48px; height:48px; margin-bottom:16px; border-radius:50%; background:#E8F0FE; color:var(--zr-blue); }
.zr-an__state--error .zr-an__state-icon{ background:var(--an-bad-bg); color:var(--an-bad); }
.zr-an__state .zr-pp__btn{ margin-top:22px; }
/* "Try again" (+ Back to Home in the error card); the rate-limited one is disabled for the Retry-After */
.zr-an__state-actions{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:12px; margin-top:22px; }
.zr-an__state-actions .zr-pp__btn{ margin-top:0; }
.zr-an__state .zr-pp__btn[disabled]{ opacity:.55; cursor:default; font-variant-numeric:tabular-nums; }
@keyframes zr-an-spin{ to{ transform:rotate(360deg); } }

/* what each state shows */
.zr-an[data-state="ready"] #zr-an-progress,
.zr-an[data-state="error"] #zr-an-progress, .zr-an[data-state="unavailable"] #zr-an-progress, .zr-an[data-state="limited"] #zr-an-progress,
.zr-an[data-state="error"] #zr-an-vis, .zr-an[data-state="unavailable"] #zr-an-vis, .zr-an[data-state="limited"] #zr-an-vis{ display:none; }
/* the challenge belongs to the loading state only; "Try again" brings it back with the progress card */
.zr-an:not([data-state="loading"]) .zr-an__ts{ display:none; }

/* ── skeletons ──────────────────────────────────────────────────────────── */
.zr-an__sk{ display:inline-block; border-radius:6px; background:#EEF1F5; animation:zr-an-pulse 1.6s ease-in-out infinite; }
.zr-an__sk--line{ height:12px; width:120px; }
.zr-an__sk--w1{ width:96px; } .zr-an__sk--w2{ width:140px; height:10px; }
.zr-an__sk--logo{ width:40px; height:40px; border-radius:10px; flex:0 0 auto; }
.zr-an__sk--ring{ width:40px; height:40px; border-radius:50%; }
.zr-an__score--sk .zr-an__score-id{ display:flex; flex-direction:column; gap:6px; }
@keyframes zr-an-pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.45; } }

/* ── visibility & competitors ───────────────────────────────────────────── */
.zr-an__scores{ display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:16px; }
.zr-an__score{ padding:18px 20px 12px; min-width:0; }
.zr-an__score-head{ display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.zr-an__score-id{ min-width:0; }
.zr-an__score-name{ display:block; margin:0; font-size:15px; font-weight:500; line-height:20px; color:var(--pp-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.zr-an__score-domain{ display:block; margin:0; font-size:12.5px; line-height:16px; color:var(--pp-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.zr-an__rows{ list-style:none; margin:0; padding:0; }
.zr-an__row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid #F2F4F7; }
.zr-an__row:first-child{ border-top:0; }
.zr-an__platform{ display:inline-flex; align-items:center; gap:10px; font-size:14px; color:var(--pp-body); }
.zr-an__platform .zr-an__logo{ width:26px; height:26px; border-radius:50%; font-size:11px; }
.zr-an__platform .zr-an__logo img{ width:16px; height:16px; border-radius:50%; }
.zr-an__ring{ display:grid; place-items:center; width:40px; height:40px; border-radius:50%; border:2px solid var(--pp-hair); font-size:14px; font-weight:600; font-variant-numeric:tabular-nums; color:var(--pp-ink); }
.zr-an__ring--ok  { border-color:var(--an-ok);   color:var(--an-ok);   background:var(--an-ok-bg); }
.zr-an__ring--warn{ border-color:#D69E2E;         color:var(--an-warn); background:var(--an-warn-bg); }
.zr-an__ring--hot { border-color:#F97316;         color:var(--an-hot);  background:var(--an-hot-bg); }
.zr-an__ring--bad { border-color:var(--an-bad);  color:var(--an-bad);  background:var(--an-bad-bg); }

/* ── the two gated blocks ───────────────────────────────────────────────── */
.zr-an__toggle{ display:inline-flex; align-items:center; gap:8px; font-size:13.5px; color:var(--pp-body); }
.zr-an__switch{ position:relative; display:inline-block; width:36px; height:20px; border-radius:999px; background:var(--zr-blue); }
.zr-an__switch::after{ content:""; position:absolute; top:2px; right:2px; width:16px; height:16px; border-radius:50%; background:#fff; }
.zr-an__blur > *{ filter:blur(3px); pointer-events:none; user-select:none; -webkit-user-select:none; }
.zr-an__grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:16px; }
.zr-an__sug{ padding:18px 20px; min-width:0; }
.zr-an__sug-head{ display:flex; align-items:flex-start; gap:10px; margin-bottom:10px; }
.zr-an__sug-head svg{ width:22px; height:22px; flex:0 0 auto; color:var(--pp-dim); margin-top:1px; }
.zr-an__sug-title{ margin:0; font-size:14.5px; font-weight:500; line-height:20px; color:var(--pp-ink); }
.zr-an__sug-desc{ margin:0 0 14px; font-size:13.5px; line-height:21px; color:var(--pp-body); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.zr-an__sug-foot{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.zr-an__mentions{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.zr-an__mention i{ display:grid; place-items:center; width:16px; height:16px; border-radius:4px; background:#DCE6F8; color:#1D4ED8; font-style:normal; font-size:10px; font-weight:600; }
.zr-an__ago{ font-size:12px; color:var(--pp-dim); white-space:nowrap; }
.zr-an__table-wrap{ overflow:hidden; }
.zr-an__table{ width:100%; border-collapse:collapse; }
.zr-an__table th{ padding:12px 20px; font-size:12px; font-weight:500; line-height:16px; color:var(--pp-dim); text-align:left; border-bottom:1px solid #EDF1F7; }
.zr-an__table td{ padding:14px 20px; font-size:14px; line-height:20px; color:var(--pp-body); border-bottom:1px solid #F2F4F7; vertical-align:middle; }
.zr-an__table tr:last-child td{ border-bottom:0; }
.zr-an__src{ display:inline-flex; align-items:center; gap:10px; color:var(--pp-ink); }
.zr-an__src .zr-an__logo{ width:22px; height:22px; border-radius:6px; font-size:10px; }
.zr-an__src .zr-an__logo img{ width:14px; height:14px; border-radius:3px; }
.zr-an__gate{ position:relative; min-height:340px; }
.zr-an__unlock{ position:absolute; inset:0; z-index:2; display:flex; align-items:center; justify-content:center; padding:24px 16px; pointer-events:none; background:linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.55) 38%, rgba(255,255,255,.94) 100%); border-radius:18px; }
.zr-an__unlock-card{ pointer-events:auto; width:min(380px,100%); padding:26px 26px 24px; text-align:center; box-shadow:0 18px 40px -16px rgba(31,36,41,.22), 0 6px 16px -6px rgba(31,36,41,.06); }
.zr-an__unlock-icon{ display:grid; place-items:center; width:40px; height:40px; margin:0 auto 14px; border-radius:50%; background:#E8F0FE; color:var(--zr-blue); }
.zr-an__unlock-h{ margin:0 0 6px; font-size:18px; font-weight:500; line-height:1.3; letter-spacing:-.02em; color:var(--pp-ink); }
.zr-an__unlock-p{ margin:0 0 18px; font-size:14px; line-height:22px; color:var(--pp-body); text-wrap:pretty; }
.zr-an__unlock-cta{ width:100%; height:44px; font-size:14.5px; }

/* ── the Turnstile slot (opened only for an interactive challenge) ──────
   Directly under the progress card, as wide as its step list; data-size=flexible fills the width. */
.zr-an__ts{ display:flex; flex-direction:column; align-items:center; gap:10px; margin-top:16px; scroll-margin-block:24px; }
.zr-an__ts .cf-turnstile{ width:min(360px,100%); }
.zr-an__ts-hint{ margin:0; font-size:14px; line-height:20px; font-weight:500; color:var(--pp-ink); text-align:center; }

/* ── "partial data" note above the score cards (a degraded report, never cached) ── */
.zr-an__note{ margin:0 0 16px; padding:10px 14px; border:1px solid #F3D9A4; border-radius:10px; background:var(--an-warn-bg); color:var(--an-warn); font-size:13.5px; line-height:20px; text-wrap:pretty; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width:760px){
  .zr-an__grid{ grid-template-columns:minmax(0,1fr); }
  .zr-an__company{ padding:20px; }
  .zr-an__company-side{ align-items:flex-start; width:100%; }
  .zr-an__actions{ justify-content:flex-start; }
  .zr-an__table th:nth-child(3), .zr-an__table td:nth-child(3){ display:none; }
  /* the one-column suggestion stack is tall: keep the unlock card near its top instead of mid-way down */
  .zr-an__gate--top .zr-an__unlock{ align-items:flex-start; padding-top:32px; }
  .zr-an__table th, .zr-an__table td{ padding-inline:14px; }
}
@media (max-width:420px){
  .zr-an__actions{ flex-direction:column; align-items:stretch; }
  .zr-an__btn{ justify-content:center; }
  .zr-an__company-main{ flex-direction:column; }
}
@media (prefers-reduced-motion:reduce){
  .zr-an__spinner::before, .zr-an__step[data-status="loading"] .zr-an__step-dot, .zr-an__sk{ animation:none; }
}
