/* ============================================================================
   Site Chat Grader (/grader/).

   A credit-report-style audit, not a landing page gimmick: one reading column,
   a big score, verdict chips that carry a glyph as well as a colour, and quotes
   side by side. Tokens reuse the Buyer Eval values (public/static/buyer-eval.css),
   which reuse the v2 site values.

   Agency co-branding sets --brand (and shows the agency logo); everything else
   stays Salespeak. Scoped under .sg so nothing leaks into webflow.css. Served
   from /static/ so the /assets/** immutable-cache rule does not pin it.
   ========================================================================= */

.sg {
  --ink: #1a1a1a;
  --body: #3d4146;
  --muted: #62666b;
  --faint: #8d8d8d;
  --paper: #ffffff;
  --warm: #f1f0ee;
  --warm-soft: #f8f7f6;
  --line: #e6e1d9;
  --line-soft: #eee9e2;
  --brand: #410e93;
  --brand-tint: #f1ebff;
  --brand-line: #ddcbfa;

  --v-correct: #135c34;
  --v-correct-bg: #e3f3e8;
  --v-dodged: #8a4a06;
  --v-dodged-bg: #fcf0dc;
  --v-wrong: #9f2a1f;
  --v-wrong-bg: #fbe6e2;
  --v-gap: #4d5157;
  --v-gap-bg: #f0efec;

  --r: 0.875rem;
  --r-sm: 0.5rem;
  --sans: "Inter 18 Pt", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  font-family: var(--sans);
  color: var(--body);
  background: var(--warm-soft);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 70vh;
}
.sg *, .sg *::before, .sg *::after { box-sizing: border-box; }
.sg h1, .sg h2, .sg h3, .sg p, .sg ul, .sg ol, .sg blockquote, .sg figure { margin: 0; padding: 0; }
.sg ul, .sg ol { list-style: none; }
.sg a { color: inherit; }
.sg h1, .sg h2, .sg h3 { color: var(--ink); font-family: var(--sans); }
.sg [hidden] { display: none !important; }

.sg .wrap { width: 100%; max-width: 52rem; margin: 0 auto; padding: 0 1.25rem; }
.sg section { padding: 3rem 0; }
.sg .eyebrow {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand);
}
.sg h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
.sg h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.sg h3 { font-size: 1.1rem; font-weight: 650; line-height: 1.35; }
.sg .lead { font-size: 1.15rem; line-height: 1.6; color: var(--muted); }
.sg .note { font-size: 0.875rem; color: var(--muted); }
.sg .link { color: var(--brand); text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 3px; }
.sg .link:hover { text-decoration-color: var(--brand); }

/* ---------- Co-brand bar ---------- */
.sg .cobrand {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.9rem 0; border-bottom: 1px solid var(--line-soft); background: var(--paper);
}
.sg .cobrand img { height: 1.75rem; width: auto; max-width: 10rem; }
.sg .cobrand .powered { font-size: 0.8125rem; color: var(--muted); }
.sg .cobrand .powered strong { color: var(--ink); }

/* ---------- Buttons + form ---------- */
.sg .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none;
  background: #0a0d12; color: #fff; border: 1px solid #0a0d12; border-radius: 999px;
  padding: 0.85rem 1.4rem; font-family: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.3;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.sg .btn:hover { background: #fff; color: #0a0d12; }
.sg .btn:disabled { opacity: 0.6; cursor: wait; }
.sg .btn-plain {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.85rem 1.4rem; font-family: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.3;
  cursor: pointer; transition: border-color 0.15s ease;
}
.sg .btn-plain:hover { border-color: var(--ink); }
.sg .cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.sg .field { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.75rem; }
.sg .field input {
  flex: 1 1 16rem; min-width: 0; font-family: inherit; font-size: 1.05rem; color: var(--ink);
  padding: 0.85rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.sg .field input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.sg .form-error { margin-top: 0.75rem; color: var(--v-wrong); font-size: 0.9rem; font-weight: 600; }

/* ---------- Landing ---------- */
.sg .hero { background: var(--paper); padding: 4rem 0 3rem; }
.sg .hero h1 { margin-top: 0.9rem; max-width: 44rem; }
.sg .hero .lead { margin-top: 1.1rem; max-width: 40rem; }
.sg .hero .note { margin-top: 0.9rem; }
.sg .qlist { display: grid; gap: 0.6rem; margin-top: 1.25rem; counter-reset: q; }
.sg .qlist li {
  counter-increment: q; display: grid; grid-template-columns: 2rem 1fr; gap: 0.5rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.8rem 1rem;
  color: var(--ink);
}
.sg .qlist li::before { content: counter(q, decimal-leading-zero); font-family: var(--mono); font-size: 0.8rem; color: var(--brand); padding-top: 0.15rem; }

/* ---------- Running ---------- */
.sg .steps { display: grid; gap: 0.5rem; margin-top: 1.5rem; }
.sg .steps li {
  display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.6rem; align-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.85rem 1rem;
  color: var(--muted); transition: color 0.2s ease;
}
.sg .steps li .mark { font-weight: 800; text-align: center; line-height: 1.6; }
.sg .steps li[data-state="active"] { color: var(--ink); border-color: var(--brand-line); }
.sg .steps li[data-state="active"] .mark::before { content: ""; display: inline-block; width: 0.9rem; height: 0.9rem; border: 2px solid var(--brand-line); border-top-color: var(--brand); border-radius: 50%; animation: sg-spin 0.8s linear infinite; vertical-align: -0.1rem; }
.sg .steps li[data-state="done"] { color: var(--ink); }
.sg .steps li[data-state="done"] .mark::before { content: "✓"; color: var(--v-correct); }
.sg .steps li[data-state="skipped"] .mark::before { content: "–"; }
.sg .steps li[data-state="failed"] .mark::before { content: "✕"; color: var(--v-wrong); }
.sg .steps li[data-state="pending"] .mark::before { content: "·"; }
@keyframes sg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sg .steps li[data-state="active"] .mark::before { animation: none; } }

/* ---------- Report header ---------- */
.sg .report-head { background: var(--paper); padding: 3rem 0 2.25rem; border-bottom: 1px solid var(--line-soft); }
.sg .scoreline { display: flex; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.25rem; }
.sg .score { font-size: clamp(4rem, 12vw, 6.5rem); font-weight: 650; line-height: 0.9; letter-spacing: -0.04em; color: var(--brand); font-variant-numeric: tabular-nums; }
.sg .score small { font-size: 0.45em; color: var(--faint); font-weight: 600; letter-spacing: -0.02em; }
.sg .score-label { font-size: 0.95rem; color: var(--muted); max-width: 16rem; padding-bottom: 0.4rem; }
.sg .verdict-line { margin-top: 1.25rem; font-size: clamp(1.2rem, 2.4vw, 1.5rem); font-weight: 500; line-height: 1.35; color: var(--ink); max-width: 42rem; }
.sg .meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin-top: 1.25rem; font-size: 0.875rem; color: var(--muted); }
.sg .meta span + span::before { content: "·"; margin-right: 1rem; color: var(--faint); }
.sg .legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 1.25rem; font-size: 0.8125rem; color: var(--muted); }
.sg .legend li { display: flex; align-items: center; gap: 0.4rem; }

/* ---------- Verdict chips ---------- */
.sg .chip {
  display: inline-flex; align-items: center; gap: 0.35em; white-space: nowrap;
  padding: 0.2em 0.7em; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.75rem; font-weight: 700; line-height: 1.4;
}
.sg .chip--correct { color: var(--v-correct); background: var(--v-correct-bg); }
.sg .chip--correct::before { content: "✓"; }
.sg .chip--dodged { color: var(--v-dodged); background: var(--v-dodged-bg); }
.sg .chip--dodged::before { content: "!"; }
.sg .chip--wrong { color: var(--v-wrong); background: var(--v-wrong-bg); }
.sg .chip--wrong::before { content: "✕"; }
.sg .chip--not_on_site { color: var(--v-gap); background: var(--v-gap-bg); }
.sg .chip--not_on_site::before { content: "–"; }
.sg .chip--unverified, .sg .chip--skipped { color: var(--v-gap); background: #fff; border-color: #c9c5bd; border-style: dashed; }
.sg .chip--unverified::before { content: "?"; }
.sg .chip--skipped::before { content: "–"; }

/* ---------- Cards ---------- */
.sg .cards { display: grid; gap: 1rem; }
.sg .card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1.35rem 1.4rem; }
.sg .card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.sg .card .label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sg .card h3 { margin-top: 0.3rem; }
.sg .card .reason { margin-top: 0.6rem; color: var(--ink); }
.sg .sides { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-top: 1rem; }
.sg .side { border-radius: var(--r-sm); padding: 0.9rem 1rem; background: var(--warm-soft); border: 1px solid var(--line-soft); min-width: 0; }
.sg .side h4 { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sg .side p, .sg .side blockquote { margin-top: 0.5rem; font-size: 0.95rem; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.sg .side blockquote { border-left: 3px solid var(--brand-line); padding-left: 0.75rem; }
.sg .side .src { display: block; margin-top: 0.35rem; font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.sg .side .src a { color: var(--brand); text-decoration: none; }
.sg .side .src a:hover { text-decoration: underline; }
.sg .side .agent-answer { white-space: pre-line; }
.sg .side--pending p { color: var(--muted); }
.sg .conflict { margin-top: 1rem; border: 1px solid #f0c9c2; background: #fff8f6; border-radius: var(--r-sm); padding: 0.9rem 1rem; }
.sg .conflict h4 { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--v-wrong); }
.sg .why { margin-top: 1rem; font-size: 0.9rem; color: var(--muted); }
.sg .why strong { color: var(--ink); font-weight: 650; }

.sg .card--locked { position: relative; overflow: hidden; }
.sg .card--locked .blur { filter: blur(5px); user-select: none; pointer-events: none; margin-top: 1rem; }
.sg .card--locked .blur div { height: 0.7rem; border-radius: 4px; background: var(--line); margin-top: 0.5rem; }

/* ---------- Gate, next step, share ---------- */
.sg .panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem 1.5rem; }
.sg .panel--brand { border-color: var(--brand-line); background: linear-gradient(0deg, var(--paper), var(--paper)), var(--brand-tint); box-shadow: inset 4px 0 0 var(--brand); }
.sg .panel h2 { font-size: 1.3rem; }
.sg .panel p { margin-top: 0.5rem; }
.sg .panel .cta-row { margin-top: 1.1rem; }
.sg .gate { margin: 1rem 0; }
.sg .share { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.sg .share input { flex: 1 1 16rem; min-width: 0; font-family: var(--mono); font-size: 0.8125rem; padding: 0.6rem 0.9rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--warm-soft); color: var(--ink); }
.sg .method { margin-top: 2rem; font-size: 0.8125rem; color: var(--muted); max-width: 44rem; }

@media (max-width: 640px) {
  .sg section { padding: 2.25rem 0; }
  .sg .hero { padding: 2.75rem 0 2.25rem; }
  .sg .sides { grid-template-columns: 1fr; }
  .sg .card { padding: 1.1rem 1.1rem; }
  .sg .field .btn { width: 100%; }
  .sg .meta { gap: 0.2rem 0.9rem; }
  .sg .meta span + span::before { display: none; }
}
