/* seo-ai-search.css: SEO & AI search (services/seo-ai-search.html). Prefix seo-. */

/* ---- The results page: rows are placed by --i (finished state); JS moves them ---- */
.seo-card {
  position: relative;
  padding: 18px;
  border-radius: 20px;
  background: var(--mkt-glass-strong);
  border: 1px solid var(--mkt-edge);
  box-shadow: var(--mkt-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  --row: 52px;
  --step: 60px;
}
.seo-card::before { content: ""; position: absolute; inset: 0; background: var(--mkt-sheen); pointer-events: none; }
.seo-card::after {            /* light that follows the cursor */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 30%), rgba(42, 159, 214, 0.16), transparent 62%);
}
.seo-stage.is-hover .seo-card::after { opacity: 1; }
.seo-bar {
  position: relative; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; margin-bottom: 14px;
  border-radius: 999px; background: var(--mkt-field); box-shadow: 0 0 0 1px var(--mkt-hairline);
  color: var(--mkt-accent); font-size: 0.88rem;
}
.seo-bar svg { width: 17px; height: 17px; flex: none; }
.seo-bar span { color: var(--mkt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-list { position: relative; height: calc(var(--step) * 5 + var(--row)); }
.seo-row {
  position: absolute; left: 0; right: 0; top: 0; height: var(--row);
  display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 12px;
  background: var(--mkt-accent-soft); box-shadow: inset 0 0 0 1px var(--mkt-hairline);
  transform: translateY(calc(var(--i, 0) * var(--step)));
  will-change: transform;
}
.seo-fav {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(15, 95, 166, 0.16); color: #fff; font: 700 0.75rem var(--font-display);
}
.seo-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.seo-txt i { display: block; height: 7px; border-radius: 4px; background: rgba(15, 95, 166, 0.16); }
.seo-txt i:first-child { width: 58%; }
.seo-txt i:last-child { width: 82%; }
.seo-txt b { font: 600 0.9rem var(--font-display); color: var(--mkt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-txt em { font-style: normal; font-size: 0.72rem; color: var(--mkt-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-you {
  z-index: 2; background: var(--mkt-glass-strong); border: 1px solid var(--mkt-edge);
  box-shadow: 0 0 0 1px var(--mkt-accent-line), 0 12px 26px -12px rgba(15, 95, 166, 0.6);
}
.seo-you .seo-fav { background: linear-gradient(135deg, var(--med), var(--med-sea)); }
.seo-rank {
  flex: none; padding: 3px 10px; border-radius: 999px; color: #fff; font: 600 0.72rem var(--font-mono); letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--med), var(--med-sea)); transition: box-shadow 0.4s;
}
.seo-you.is-top .seo-rank { box-shadow: 0 0 0 4px rgba(42, 159, 214, 0.25), 0 0 16px rgba(42, 159, 214, 0.7); }
.seo-tag {
  position: absolute; font: 600 0.62rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mkt-text-2); padding: 3px 9px; border-radius: 999px; background: var(--mkt-glass-strong); box-shadow: 0 0 0 1px var(--mkt-hairline);
}

/* ---- Hero version ---- */
.seo-hero-vis { position: relative; width: 100%; max-width: 440px; margin: 0 auto; padding-top: 8px; }
.seo-hero-vis .seo-tag { top: -10px; left: 14px; }

/* ---- Hero: typed query, caret, Yarrabrook logo chip ---- */
.seo-bar .seo-q { flex: 1; min-width: 0; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.seo-q-text { display: inline-block; min-height: 1.2em; line-height: 1.2; transition: opacity 0.2s linear; }
.seo-caret { flex: none; display: inline-block; width: 1.5px; height: 1.1em; margin-left: 2px; background: var(--mkt-accent); border-radius: 1px; opacity: 1; }
.seo-bar.is-typing .seo-caret { animation: none; opacity: 1; }
/* Favicon-style chip: the round 26px chip shows only the house mark from the Yarrabrook wordmark
   (the full 5:1 wordmark is unreadable at this size; the name sits in text beside it). White in light and dark. */
.seo-fav--logo { position: relative; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(15, 95, 166, 0.2); }
.seo-fav--logo img { position: absolute; left: 3.5px; top: 50%; height: 16px; width: auto; max-width: none; transform: translateY(-50%); }
.seo-you .seo-fav.seo-fav--logo { background: #fff; }   /* beats the gradient set on .seo-you .seo-fav */
.seo-hero-vis .seo-tag { max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: no-preference) {
  .seo-caret { animation: seoCaret 1.05s steps(1) infinite; }
}
@keyframes seoCaret { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
.seo-bubble {
  position: absolute; right: -6px; bottom: -22px; display: flex; align-items: center; gap: 8px; max-width: 250px;
  padding: 10px 14px; border-radius: 14px; font-size: 0.8rem; line-height: 1.35; color: var(--mkt-text);
  background: var(--mkt-glass-strong); border: 1px solid var(--mkt-edge); box-shadow: var(--mkt-shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 1; transform: none; transition: opacity 0.5s, transform 0.5s;
}
.seo-bubble svg { width: 16px; height: 16px; flex: none; color: var(--med-sea); }
.seo-bubble.is-off { opacity: 0; transform: translateY(10px) scale(0.96); }

/* ---- Section stage ---- */
.seo-stage { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; align-items: start; max-width: 940px; margin: 36px auto 0; }
.seo-stage .seo-tag--stage { left: 50%; bottom: -34px; transform: translateX(-50%); white-space: nowrap; }
.seo-stage .seo-serp { --row: 56px; --step: 66px; }
.seo-ai { min-height: 100%; }
.seo-ai-head { position: relative; display: flex; align-items: center; gap: 8px; font: 600 0.7rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mkt-accent); }
.seo-ai-head svg { width: 16px; height: 16px; }
.seo-ai-q { position: relative; margin: 14px 0 12px; padding: 9px 13px; border-radius: 12px; font-size: 0.85rem; background: var(--mkt-accent-soft); color: var(--mkt-text); }
.seo-ai-think { display: none; gap: 6px; padding: 8px 2px; }
.seo-ai-think i { width: 7px; height: 7px; border-radius: 50%; background: var(--med-sea); opacity: 0.5; }
.seo-ai.is-thinking .seo-ai-think { display: flex; }
.seo-ai.is-thinking .seo-ai-a { display: none; }
.seo-ai-a { position: relative; margin: 0; min-height: 7.2em; font-size: 0.92rem; line-height: 1.6; color: var(--mkt-text); }
.seo-ai-a .seo-cite { font-weight: 700; color: var(--mkt-accent); background: var(--mkt-accent-soft); padding: 1px 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--mkt-accent-line); }
.seo-ai-a sup { color: var(--mkt-accent); font-weight: 700; margin-left: 2px; }
.seo-ai-src { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.seo-src { height: 28px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border-radius: 999px; font-size: 0.74rem; box-shadow: inset 0 0 0 1px var(--mkt-hairline); background: var(--mkt-accent-soft); }
.seo-src i { width: 54px; height: 6px; border-radius: 3px; background: rgba(15, 95, 166, 0.18); }
.seo-src b { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 0.62rem; color: #fff; background: var(--med); }
.seo-src--you { color: var(--mkt-text); font-weight: 600; background: var(--mkt-glass-strong); box-shadow: 0 0 0 1px var(--mkt-accent-line); transition: opacity 0.4s, transform 0.4s; }
.seo-src--you.is-off { opacity: 0; transform: translateX(-8px); }

/* ---- Scope list ---- */
.seo-scope { list-style: none; margin: 64px auto 0; padding: 0; max-width: 940px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 22px; }
.seo-scope li { display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; row-gap: 2px; align-items: start; padding: 4px 2px; }
.seo-scope svg { grid-row: 1 / 3; width: 20px; height: 20px; margin-top: 2px; color: var(--mkt-accent); }
.seo-scope strong { font: 600 0.95rem var(--font-display); color: var(--mkt-text); }
.seo-scope span { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }

/* ---- Proof ---- */
.seo-proof-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.seo-pcard { padding: 28px; display: flex; flex-direction: column; }
.seo-pcard .mkt-proof-logo { height: 40px; margin-bottom: 18px; }
.seo-pfig { margin: 0; font: 800 1.5rem var(--font-display); background: var(--mkt-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.seo-pline { margin: 6px 0 0; color: var(--text-secondary); line-height: 1.5; }
.seo-pcard .mkt-chips { margin: 16px 0 0; }

/* ---- Joins up: the orange hand-off ---- */
.seo-join { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; padding: 36px 40px; max-width: 1080px; margin: 0 auto; }
.seo-join-copy { flex: 1 1 360px; min-width: 0; max-width: 680px; }   /* keeps the pills beside the copy now the card wraps */
.seo-join-copy .section-title { font-size: 1.6rem; margin: 0 0 8px; text-align: left; }
.seo-join-copy p { margin: 0 0 10px; color: var(--text-secondary); }
.seo-join-pills { display: flex; flex-direction: column; gap: 10px; flex: none; }
.seo-orange {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  color: #c24d00; background: rgba(255, 107, 0, 0.1); border: 1px solid rgba(255, 107, 0, 0.35); text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.seo-orange svg { width: 17px; height: 17px; }
.seo-orange:hover { background: rgba(255, 107, 0, 0.18); transform: translateX(3px); }

/* ---- Calls flow: blue search hands off to orange Rufen systems ---- */
.seo-flow-wrap { flex: 0 0 100%; margin-top: 10px;
  --o: #ff6b00; --o-soft: rgba(255,107,0,0.10); --o-line: rgba(255,107,0,0.38); --o-text: #c24d00; }
.seo-flow-key { display: flex; gap: 16px; justify-content: flex-end; margin-bottom: 10px; font: 600 0.62rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mkt-text-2); }
.seo-k { display: inline-flex; align-items: center; gap: 6px; }
.seo-k i { width: 8px; height: 8px; border-radius: 50%; }
.seo-k--b i { background: var(--med-sea); }
.seo-k--o i { background: var(--o); }
.seo-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.seo-fs { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; min-width: 0; border-radius: 14px;
  background: var(--mkt-glass-strong); border: 1px solid var(--mkt-edge);
  box-shadow: 0 0 0 1px var(--mkt-hairline);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.6s ease, box-shadow 0.6s ease; }
.seo-fs-top { display: flex; gap: 8px; align-items: flex-start; }
.seo-fs-n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 0.68rem var(--font-display); color: #fff; }
.seo-fs--b .seo-fs-n { background: linear-gradient(135deg, var(--med), var(--med-sea)); }
.seo-fs--o .seo-fs-n { background: linear-gradient(135deg, #ff6b00, #ff8c00); }
.seo-fs-cap { font: 600 0.8rem/1.3 var(--font-display); color: var(--mkt-text); }
.seo-fs-body { position: relative; flex: 1; min-height: 168px; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: var(--mkt-field); box-shadow: inset 0 0 0 1px var(--mkt-hairline); font-size: 0.72rem; line-height: 1.35; color: var(--mkt-text); overflow: hidden; }
.seo-fs-body p, .seo-fs-body b, .seo-fs-body em { margin: 0; }
.seo-fs-body em { font-style: normal; color: var(--mkt-text-2); }
/* connectors: line from each tile to the next (not on the last) */
.seo-fs:not(:last-child)::after { content: ""; position: absolute; left: calc(100% + 1px); top: 50%; width: 16px; height: 2px; border-radius: 2px; background: var(--mkt-hairline); }
.seo-fs:not(:last-child)::before { content: ""; position: absolute; left: calc(100% + 1px); top: 50%; width: 16px; height: 2px; border-radius: 2px; z-index: 1; transform-origin: left; transform: scaleX(1); transition: transform 0.6s ease 0.2s; background: var(--o); }
.seo-fs--b:not(:last-child)::before { background: linear-gradient(90deg, var(--med-sea), var(--o)); }
/* body bits: blue (step 1) */
.seo-m-q { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--mkt-accent-soft); color: var(--mkt-accent); box-shadow: inset 0 0 0 1px var(--mkt-hairline); }
.seo-m-q svg { width: 13px; height: 13px; flex: none; }
.seo-m-q span { color: var(--mkt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-m-res { display: flex; flex-direction: column; gap: 3px; padding: 8px; min-width: 0; border-radius: 10px; background: var(--mkt-glass-strong); box-shadow: 0 0 0 1px var(--mkt-accent-line); }
.seo-m-res b { font: 600 0.78rem var(--font-display); color: var(--mkt-accent); }
.seo-m-res em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-m-call { position: relative; align-self: flex-start; margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font: 600 0.68rem var(--font-mono); white-space: nowrap; color: #fff; background: linear-gradient(135deg, var(--med), var(--med-sea)); transition: box-shadow 0.4s; }
.seo-m-call > svg { width: 12px; height: 12px; flex: none; }
.seo-cursor svg { display: block; width: 20px; height: 20px; }
.seo-m-call.is-tap { box-shadow: 0 0 0 5px rgba(42,159,214,0.28); }
.seo-cursor { position: absolute; left: 62%; top: 52%; width: 20px; height: 20px; color: #0b1f33;   /* dark fill + white outline reads in light and dark */ pointer-events: none; transform: translate(0, 0); }
/* orange bits (steps 2-5) */
.seo-m-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--o-text); background: var(--o-soft); box-shadow: inset 0 0 0 1px var(--o-line); }
.seo-m-ico svg { width: 15px; height: 15px; }
.seo-m-ring { position: relative; width: 30px; height: 30px; margin: 8px 0 4px 6px; }
.seo-m-ring .seo-m-ico { position: relative; z-index: 1; }
.seo-wave { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--o); opacity: 0; }
.seo-m-line { display: flex; flex-direction: column; gap: 2px; }
.seo-m-line b { font: 600 0.78rem var(--font-display); }
.seo-m-chip { align-self: flex-start; padding: 2px 9px; border-radius: 999px; font: 600 0.62rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--o-text); background: var(--o-soft); box-shadow: inset 0 0 0 1px var(--o-line); }
.seo-m-agent { display: flex; align-items: center; gap: 8px; }
.seo-m-lab { font: 600 0.74rem var(--font-display); color: var(--o-text); }
.seo-bars { display: inline-flex; align-items: center; gap: 2px; height: 14px; margin-left: auto; }
.seo-bars i { width: 3px; height: 5px; border-radius: 2px; background: var(--o); opacity: 0.55; }
.seo-m-say { padding: 7px 9px; border-radius: 10px 10px 10px 2px; background: var(--o-soft); box-shadow: inset 0 0 0 1px var(--o-line); }
.seo-m-ask { padding: 7px 9px; border-radius: 10px 10px 2px 10px; background: var(--mkt-accent-soft); color: var(--mkt-text-2); }
.seo-m-kb { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; color: var(--mkt-text-2); box-shadow: inset 0 0 0 1px var(--mkt-hairline); transition: background 0.5s, box-shadow 0.5s, color 0.5s; }
.seo-m-kb svg { width: 13px; height: 13px; flex: none; }
/* lit by JS at step 4; static view (no JS, reduced motion) shows it lit */
.seo-m-kb.is-lit, .seo-flow:not(.is-live) .seo-m-kb { color: var(--o-text); background: var(--o-soft); box-shadow: inset 0 0 0 1px var(--o-line), 0 0 14px -2px rgba(255,107,0,0.45); }
.seo-m-crm { display: flex; align-items: center; gap: 6px; font: 600 0.62rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--o-text); }
.seo-m-crm svg { width: 13px; height: 13px; }
.seo-m-ghost { display: flex; flex-direction: column; gap: 6px; }
.seo-m-ghost i { display: block; height: 22px; border-radius: 8px; background: var(--mkt-accent-soft); box-shadow: inset 0 0 0 1px var(--mkt-hairline); }
.seo-m-lead { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; border-radius: 10px; background: var(--mkt-glass-strong); box-shadow: 0 0 0 1px var(--o-line), 0 8px 18px -10px rgba(255,107,0,0.5); }
.seo-m-lead-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 6px; }
.seo-m-lead-h b { font: 600 0.74rem var(--font-display); white-space: nowrap; }
.seo-m-lead-h .seo-m-chip { padding: 2px 7px; letter-spacing: 0.06em; white-space: nowrap; }
.seo-m-lead p { font-weight: 600; }

/* ACTIVE / DONE STATES (live only) */
.seo-flow.is-live .seo-fs { opacity: 0.45; }
.seo-flow.is-live .seo-fs.is-done { opacity: 0.85; }
.seo-flow.is-live .seo-fs.is-on { opacity: 1; }
.seo-flow.is-live .seo-fs--b.is-on { box-shadow: 0 0 0 1px var(--mkt-accent-line), 0 10px 26px -14px rgba(15,95,166,0.55); }
.seo-flow.is-live .seo-fs--o.is-on { box-shadow: 0 0 0 1px var(--o-line), 0 10px 26px -14px rgba(255,107,0,0.5); }
.seo-flow.is-live .seo-fs:not(.is-done)::before { transform: scaleX(0); }   /* connector fills when the NEXT tile starts */
/* sequenced bits are hidden until JS adds is-show */
.seo-flow.is-live .seo-s { opacity: 0; transform: translateY(6px); transition: opacity 0.5s ease, transform 0.5s ease; }
.seo-flow.is-live .seo-s.is-show { opacity: 1; transform: none; }
.seo-flow.is-live .seo-cursor { opacity: 0; transform: translate(40px, 34px); transition: opacity 0.4s ease, transform 1.2s cubic-bezier(.4,0,.2,1); }
.seo-flow.is-live .seo-cursor.is-show { opacity: 1; transform: translate(0, 0); }

/* Ring waves, waveform bars: only while that tile is the active one and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .seo-flow.is-live .seo-fs.is-on .seo-wave { animation: seoWave 1.8s ease-out infinite; }
  .seo-flow.is-live .seo-fs.is-on .seo-wave:nth-child(2) { animation-delay: 0.9s; }
  .seo-flow.is-live .seo-fs.is-on .seo-bars i { animation: seoBar 0.9s ease-in-out infinite; }
  .seo-flow.is-live .seo-fs.is-on .seo-bars i:nth-child(2) { animation-delay: 0.15s; }
  .seo-flow.is-live .seo-fs.is-on .seo-bars i:nth-child(3) { animation-delay: 0.3s; }
}
/* off screen or tab hidden: JS adds is-paused so the ring and bars stop too */
.seo-flow.is-paused .seo-wave, .seo-flow.is-paused .seo-bars i { animation-play-state: paused !important; }
@keyframes seoWave { 0% { transform: scale(0.8); opacity: 0.55; } 100% { transform: scale(2); opacity: 0; } }
@keyframes seoBar { 0%, 100% { height: 4px; } 50% { height: 13px; } }
/* narrow desktops (901-1100px): tighten the five tiles so the number pill fits */
@media (min-width: 901px) and (max-width: 1100px) {
  .seo-join { padding: 32px 28px; }
  .seo-flow { gap: 12px; }
  .seo-fs { padding: 9px; }
  .seo-fs-body { padding: 8px; }
  .seo-m-res { padding: 6px; }
  .seo-fs:not(:last-child)::after, .seo-fs:not(:last-child)::before { width: 10px; }
}
.seo-flow-note { margin: 12px 0 0; text-align: center; font: 600 0.62rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mkt-text-2); }

@media (max-width: 900px) {
  .seo-stage { grid-template-columns: minmax(0, 1fr); }
  .seo-stage .seo-tag--stage { bottom: -30px; }
  .seo-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-proof-grid { grid-template-columns: minmax(0, 1fr); }
  .seo-join { flex-direction: column; align-items: flex-start; }
  /* calls flow: single column on tablet and phone */
  .seo-flow-wrap { width: 100%; }
  .seo-flow { grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 460px; margin: 0 auto; }
  .seo-fs-body { min-height: 0; }
  .seo-fs:not(:last-child)::after, .seo-fs:not(:last-child)::before { left: 50%; top: calc(100% + 2px); width: 2px; height: 18px; transform-origin: top; }
  .seo-flow.is-live .seo-fs:not(.is-done)::before { transform: scaleY(0); }
  .seo-fs:not(:last-child)::before { transform: scaleY(1); }
  .seo-fs--b:not(:last-child)::before { background: linear-gradient(180deg, var(--med-sea), var(--o)); }
  .seo-flow-key { justify-content: center; }
}
@media (max-width: 560px) {
  .seo-scope { grid-template-columns: minmax(0, 1fr); margin-top: 52px; }
  .seo-join { padding: 28px 22px; }
  .seo-fs { padding: 12px; }
  .seo-fs-cap { font-size: 0.85rem; }
  .seo-card { padding: 14px; }
  .seo-stage .seo-serp { --row: 50px; --step: 58px; }
}
@media (prefers-reduced-motion: no-preference) {
  .seo-ai-think i { animation: seoDot 1s infinite ease-in-out; }
  .seo-ai-think i:nth-child(2) { animation-delay: 0.15s; }
  .seo-ai-think i:nth-child(3) { animation-delay: 0.3s; }
}
@keyframes seoDot { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-4px); opacity: 1; } }

/* ===== Stage v2: Google-style + ChatGPT-style windows (#what-you-get) ===== */
/* Only the #what-you-get stage uses these. Prefixes: .seo-win (window), .gz- (Google), .cg- (chat). */
.seo-stage { align-items: stretch; }

/* shared window */
.seo-win { --w-bg:#fff; --w-text:#202124; --w-text-2:#5f6368; --w-line:#dadce0; --w-grey:#e8eaed; --w-link:#1a0dab; --w-soft:#f1f3f4; --w-accent:#0f5fa6;
  position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 16px; overflow: hidden;
  background: var(--w-bg); color: var(--w-text); border: 1px solid var(--mkt-edge); box-shadow: var(--mkt-shadow); }
.seo-win.cg { font-family: Inter, system-ui, sans-serif; }
.seo-win.cg { --w-soft:#f4f4f4; --w-text:#0d0d0d; --w-text-2:#6b6b6b; --w-line:#e5e5e5; }  /* before the dark rule so dark wins */
.seo-win-bar { display:flex; align-items:center; gap:10px; height:32px; padding:0 12px; background: var(--w-soft); border-bottom:1px solid var(--w-line); }
.seo-win-dots { display:flex; gap:5px; } .seo-win-dots i { width:8px; height:8px; border-radius:50%; background: var(--w-grey); }
.seo-win-label { font: 600 0.62rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--w-text-2); }
.seo-win svg { stroke-width: 2; }

/* google */
.gz { font-family: Arial, 'Inter', sans-serif; --gstep: 90px; --grow: 84px; }
.gz-body { padding: 14px 16px 16px; }
.gz-search { display:flex; align-items:center; gap:10px; height:42px; padding:0 14px; border-radius:999px; border:1px solid var(--w-line); box-shadow:0 1px 6px rgba(32,33,36,.18); font-size:14px; background:var(--w-bg); color: var(--w-text); }
.gz-search svg { width:17px; height:17px; flex:none; color: var(--w-text-2); } .gz-search span { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } .gz-search .gz-mic { color:#4285f4; }
.gz-tabs { display:flex; gap:20px; margin:12px 0 0; border-bottom:1px solid var(--w-line); font-size:13px; color: var(--w-text-2); overflow:hidden; }
.gz-tabs span { padding:6px 0 8px; white-space:nowrap; } .gz-tabs .is-on { color: var(--w-link); box-shadow: inset 0 -3px 0 var(--w-link); }
.gz-count { margin:10px 0 12px; } .gz-count i { display:block; width:150px; height:7px; border-radius:4px; background: var(--w-grey); }
.gz-list { position:relative; height: calc(var(--gstep) * 3 + var(--grow)); }
.gz-item { position:absolute; left:0; right:0; top:0; height: var(--grow); padding:6px 8px 0; overflow:hidden; transform: translateY(calc(var(--i,0) * var(--gstep))); will-change: transform; border-radius:10px; }
.gz-site { display:flex; align-items:center; gap:10px; margin-bottom:2px; }
.gz-fav { flex:none; width:22px; height:22px; border-radius:50%; background: var(--w-grey); display:grid; place-items:center; color:#fff; font: 700 0.7rem var(--font-display); }
.gz-sitetxt { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; line-height:1.25; }
.gz-sitetxt b { font-weight:400; font-size:14px; color: var(--w-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gz-sitetxt em { font-style:normal; font-size:12px; color: var(--w-text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gz-title { font-size:16px; line-height:1.3; color: var(--w-link); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:1px; }
.gz-snip { font-size:12.5px; line-height:1.4; color: var(--w-text-2); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.gz-item i { display:block; height:7px; border-radius:4px; background: var(--w-grey); margin:5px 0; }  /* placeholder bars */
.gz-sitetxt i { margin:0; }
.gz-title i { margin:4px 0; }
.gz-snip i { margin:3px 0; }
.gz-sitetxt i:first-child{width:34%} .gz-sitetxt i:last-child{width:48%} .gz-title i{width:62%; height:11px; background: color-mix(in srgb, var(--w-link) 35%, var(--w-grey));} .gz-snip i:first-child{width:96%} .gz-snip i:last-child{width:72%}
.gz-you { z-index:2; background: var(--w-bg); box-shadow: 0 0 0 1px var(--mkt-accent-line), 0 10px 24px -14px rgba(15,95,166,.55); }
.gz-you .gz-fav { background: linear-gradient(135deg, var(--med), var(--med-sea)); }
.gz-rank { flex:none; padding:3px 10px; border-radius:999px; color:#fff; font:600 0.72rem var(--font-mono); background: linear-gradient(135deg, var(--med), var(--med-sea)); transition: box-shadow .4s; }
.gz-you.is-top .gz-rank { box-shadow: 0 0 0 4px rgba(42,159,214,.25), 0 0 16px rgba(42,159,214,.6); }

/* chat */
.cg-body { flex:1; display:flex; flex-direction:column; padding:16px; gap:14px; min-height:0; }
.cg-msgs { flex:1; display:flex; flex-direction:column; gap:16px; }
.cg-user { align-self:flex-end; max-width:82%; padding:10px 16px; border-radius:20px; background: var(--w-soft); color: var(--w-text); font-size:15px; line-height:1.5; }
.cg-think { display:none; gap:5px; padding:6px 2px; } .cg-think i { width:8px; height:8px; border-radius:50%; background: var(--w-text-2); opacity:.5; }
.cg.is-thinking .cg-think { display:flex; } .cg.is-thinking .cg-bot { display:none; }
.cg-a { margin:0; min-height:7.5em; font-size:15px; line-height:1.65; color: var(--w-text); } .cg-a b { font-weight:700; }
.cg-src { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; transition: opacity .4s; } .cg-src.is-off { opacity:0; }
.cg-chip { height:28px; display:inline-flex; align-items:center; gap:6px; padding:0 11px; border-radius:999px; font-size:12px; background: var(--w-soft); color: var(--w-text); }
.cg-chip svg { width:12px; height:12px; color: var(--w-text-2); } .cg-chip .cg-bar { width:56px; height:6px; border-radius:3px; background: var(--w-grey); }
.cg-chip--you { box-shadow: 0 0 0 1px var(--mkt-accent-line); } .cg-chipfav { width:16px; height:16px; border-radius:50%; display:grid; place-items:center; color:#fff; font:700 .55rem var(--font-display); background: linear-gradient(135deg, var(--med), var(--med-sea)); }
.cg-input { display:flex; align-items:center; gap:10px; height:48px; padding:0 8px 0 14px; border-radius:999px; background: var(--w-soft); color: var(--w-text-2); font-size:15px; }
.cg-input svg { width:18px; height:18px; } .cg-input span { flex:1; }
.cg-input b { width:32px; height:32px; border-radius:50%; display:grid; place-items:center; background: #0d0d0d; color: #fff; }
.cg-input b svg { width:16px; height:16px; }
/* Thinking dots run only while the stage is near the screen (JS sets .is-live) and motion is allowed. */
@media (prefers-reduced-motion: no-preference) { .seo-stage.is-live .cg-think i { animation: seoDot 1s infinite ease-in-out; } .seo-stage.is-live .cg-think i:nth-child(2){animation-delay:.15s} .seo-stage.is-live .cg-think i:nth-child(3){animation-delay:.3s} }

@media (max-width: 900px) { .seo-stage { gap: 40px; } .seo-stage .seo-tag--stage { bottom: -30px; } }
@media (max-width: 560px) { .gz { --gstep: 90px; --grow: 84px; } .gz-body, .cg-body { padding: 12px; } .gz-title { font-size: 15px; } .gz-tabs { gap: 14px; } .cg-user, .cg-a { font-size: 14px; } }

/* Smaller windows (Mars: they were unnecessarily large). */
.seo-stage { max-width: 820px; }
.cg-user, .cg-a { font-size: 14px; }
.cg-a { min-height: 6.6em; }
.cg-input { height: 42px; font-size: 14px; }
.cg-input b { width: 28px; height: 28px; }
.gz-snip { -webkit-line-clamp: 1; }
.gz-snip i:last-child { display: none; }

/* ===== Dark mode ===== */

/* ===== Dark mode (html[data-theme="dark"]) ===== */
:root[data-theme="dark"] .seo-card{ -webkit-backdrop-filter:none; backdrop-filter:none; }
:root[data-theme="dark"] .seo-card::after{ background:radial-gradient(260px circle at var(--mx,50%) var(--my,30%),rgba(113,193,224,.08),transparent 62%); }
:root[data-theme="dark"] .seo-bar{ box-shadow:inset 0 0 0 1px var(--dk-control); }
:root[data-theme="dark"] .seo-fav{ background:var(--dk-s4); }
:root[data-theme="dark"] .seo-you{ background:var(--dk-s3); border-color:var(--dk-line-3); box-shadow:0 0 0 1px var(--mkt-accent-line); }
:root[data-theme="dark"] .seo-you .seo-fav{ background:var(--btn-mkt); }
:root[data-theme="dark"] :is(.seo-rank,.gz-rank,.seo-fs--b .seo-fs-n,.seo-m-call){ background:var(--btn-mkt); color:#fff; }
:root[data-theme="dark"] .seo-you.is-top .seo-rank,:root[data-theme="dark"] .gz-you.is-top .gz-rank{ box-shadow:0 0 0 3px rgba(113,193,224,.30); }
:root[data-theme="dark"] .seo-tag{ background:var(--dk-s2); box-shadow:inset 0 0 0 1px var(--dk-line-2); }
:root[data-theme="dark"] .seo-bubble{ background:var(--dk-s3); border-color:var(--dk-line-3); box-shadow:inset 0 1px 0 var(--dk-light-top); -webkit-backdrop-filter:none; backdrop-filter:none; }
:root[data-theme="dark"] .seo-src b{ background:var(--btn-mkt); }
/* Google-style and chat-style windows: a window, three levels */
:root[data-theme="dark"] .seo-win,:root[data-theme="dark"] .seo-win.cg{
  --w-bg:var(--dk-s2); --w-text:var(--text-primary); --w-text-2:var(--text-secondary); --w-line:var(--dk-line-3); --w-grey:var(--dk-line-3);
  --w-soft:var(--dk-s3); --w-link:var(--blue-text); --w-accent:var(--blue-text);
  border-color:var(--dk-edge); box-shadow:inset 0 1px 0 var(--dk-edge-hi);
}
:root[data-theme="dark"] .gz-search{ background:var(--dk-s1); border-color:var(--dk-control); box-shadow:none; }
:root[data-theme="dark"] .gz-search .gz-mic{ color:var(--blue-text); }
:root[data-theme="dark"] .gz-you{ background:var(--dk-s3); box-shadow:0 0 0 1px var(--mkt-accent-line); }
:root[data-theme="dark"] .gz-you .gz-fav{ background:var(--btn-mkt); }
:root[data-theme="dark"] .cg-input{ background:var(--dk-s1); box-shadow:inset 0 0 0 1px var(--dk-control); }
:root[data-theme="dark"] .cg-input b{ background:var(--btn-mkt); color:#fff; }
:root[data-theme="dark"] .cg-chip--you{ box-shadow:0 0 0 1px var(--mkt-accent-line); }
/* calls flow: blue search hands off to orange Rufen systems */
:root[data-theme="dark"] .seo-flow-wrap{ --o:#f39d5e; --o-soft:var(--dk-s3); --o-line:#f39d5e; --o-text:#f39d5e; }
:root[data-theme="dark"] :is(.seo-m-ico,.seo-m-chip,.seo-m-say){ box-shadow:inset 0 0 0 1px var(--dk-edge); }
:root[data-theme="dark"] .seo-fs{ -webkit-backdrop-filter:none; backdrop-filter:none; box-shadow:none; }
:root[data-theme="dark"] .seo-fs--o .seo-fs-n{ background:var(--btn-orange); color:var(--btn-orange-ink); }
:root[data-theme="dark"] .seo-flow.is-live .seo-fs{ opacity:.9; }
:root[data-theme="dark"] .seo-flow.is-live .seo-fs.is-done{ opacity:.95; }
:root[data-theme="dark"] .seo-flow.is-live .seo-fs.is-on{ opacity:1; }
:root[data-theme="dark"] .seo-bars i{ opacity:1; }
:root[data-theme="dark"] .seo-flow.is-live .seo-fs--b.is-on{ box-shadow:0 0 0 1px var(--mkt-accent-line); }
:root[data-theme="dark"] .seo-flow.is-live .seo-fs--o.is-on{ box-shadow:0 0 0 1px var(--o-line); }
:root[data-theme="dark"] .seo-m-kb.is-lit,:root[data-theme="dark"] .seo-flow:not(.is-live) .seo-m-kb{ box-shadow:inset 0 0 0 1px var(--o-line); }
:root[data-theme="dark"] .seo-m-lead{ box-shadow:0 0 0 1px var(--o-line); }
:root[data-theme="dark"] .seo-m-call.is-tap{ box-shadow:0 0 0 4px rgba(113,193,224,.28); }
:root[data-theme="dark"] .seo-orange{ color:var(--orange-text); background:var(--dk-s3); border-color:#f39d5e; }
:root[data-theme="dark"] .seo-orange:hover{ background:var(--dk-s4); border-color:#f39d5e; }
:root[data-theme="dark"] .seo-wave{ border-color:#f39d5e; }
:root[data-theme="dark"] :is(.seo-txt i,.seo-src i){ background:rgba(113,193,224,.22); }
