/* ─────────────────────────────────────────────────────────────
   Capraseo — competitor-gap page
   One-click competitor scan → two sections: keyword gap and a
   referring-domain comparison cross-referenced to the marketplace.
   ───────────────────────────────────────────────────────────── */

/* ── Empty-state sales card ──────────────────────────────────── */
.cg-intro {
  text-align: center;
  padding: 48px 32px 40px;
  max-width: 640px;
  margin: 24px auto;
}
.cg-intro-art {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241,.12), rgba(99, 102, 241,.04));
  color: var(--accent);
}
.cg-intro h2 { font-size: 22px; font-weight: 600; margin: 0 0 10px; }
.cg-intro-lead {
  color: var(--text-muted, #6b7280);
  font-size: 14.5px; line-height: 1.6;
  margin: 0 auto 24px; max-width: 520px;
}
.cg-intro-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 0 0 24px; text-align: left;
}
.cg-step {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 14px 12px;
  background: rgba(var(--wash-rgb), .03);
  border: 1px solid var(--line, rgba(var(--wash-rgb), .08));
  border-radius: 12px;
}
.cg-step-num {
  width: 22px; height: 22px; margin-bottom: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(99, 102, 241,.12); color: var(--accent);
  font-size: 11px; font-weight: 700;
}
.cg-step b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.cg-step > span:last-child { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.cg-intro-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.cg-intro-actions .btn { min-width: 180px; justify-content: center; }
.cg-fetch-cta {
  background: var(--accent); color: var(--cyan-bg);
  border: 0; font-weight: 700;
  box-shadow: 0 4px 18px rgba(99, 102, 241,.22);
}
.cg-fetch-cta:hover { background: var(--accent); color: var(--cyan-bg); filter: brightness(1.08); }
.cg-intro-cost { color: var(--text-muted, #6b7280); font-size: 13px; margin: 0; }
.cg-intro-notice {
  color: var(--gold); background: rgba(230,196,122,.08);
  border: 1px solid rgba(230,196,122,.22); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; line-height: 1.55;
  margin: 14px auto 0; max-width: 520px; text-align: left;
}
.cg-intro-error { color: #e24b4a; font-size: 13px; margin: 12px 0 0; }

/* provenance strip above the results (AI-picked competitor set) */
.cg-source-note {
  background: rgba(99, 102, 241,.05);
  border: 1px solid rgba(99, 102, 241,.18); border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; line-height: 1.55;
  color: var(--muted); margin-bottom: 14px;
}

/* ── Loading state ───────────────────────────────────────────── */
.cg-loading {
  text-align: center; padding: 48px 32px;
  color: var(--text-muted, #6b7280); font-size: 14px;
}
.cg-spinner {
  width: 28px; height: 28px; margin: 0 auto 16px;
  border: 3px solid rgba(99, 102, 241,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cg-spin .8s linear infinite;
}
@keyframes cg-spin { to { transform: rotate(360deg); } }

/* ── Shared table chrome ─────────────────────────────────────── */
.cg-table-wrap { overflow-x: auto; }
.cg-kw-table, .cg-rd-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.cg-kw-table th, .cg-rd-table th {
  text-align: left; font-weight: 500; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid rgba(var(--wash-rgb), 0.08);
  white-space: nowrap;
}
.cg-kw-table td, .cg-rd-table td {
  padding: 11px 12px; border-bottom: 1px solid rgba(var(--wash-rgb), 0.05);
  vertical-align: middle; color: var(--text);
}
.cg-kw-table tr:hover, .cg-rd-table tbody tr:hover { background: rgba(var(--wash-rgb), .03); }
.col-tight { width: 1%; white-space: nowrap; }
.cg-empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.cg-muted { color: var(--muted-2); }

/* ── Keyword gap table ───────────────────────────────────────── */
.cg-kw { font-weight: 500; color: var(--text); }
.cg-val { color: var(--cyan-1); font-weight: 500; }
.cg-rivals {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: rgba(var(--wash-rgb), .08);
  font-size: 12px; font-weight: 600; color: var(--text);
}
.cg-best-rank {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: #8fe6f0; background: rgba(99, 102, 241,.16);
  border-radius: 5px; padding: 1px 5px; margin-right: 4px;
}
.cg-page { color: var(--blue-1); text-decoration: none; font-weight: 500; }
.cg-page:hover { text-decoration: underline; }
.cg-page-path { color: var(--muted); font-weight: 400; }
.cg-gap-pill {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: #ff9a9a; background: rgba(226,75,74,.16);
  border-radius: 5px; padding: 2px 7px; text-transform: uppercase; letter-spacing: .03em;
}
.cg-rank { font-weight: 600; color: var(--text); }

/* ── Referring-domain comparison table ───────────────────────── */
.cg-rd { font-weight: 500; color: var(--text); white-space: nowrap; }
.cg-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: linear-gradient(135deg, #0f1b2d, #2a3c54);
  color: #fff; font-size: 11px; font-weight: 600;
  vertical-align: middle; margin-right: 8px;
}
.cg-avatar.sm { width: 22px; height: 22px; font-size: 10px; }
/* Horizontal competitor column headers — keeps the header row short.
   The table scrolls horizontally (.cg-table-wrap) if the domains are wide. */
.cg-comp-col {
  text-align: center; vertical-align: middle;
  padding: 10px 10px; white-space: nowrap;
}
.cg-comp-name {
  display: inline-block;
  white-space: nowrap; text-transform: none; letter-spacing: 0;
  font-size: 11.5px; font-weight: 500; color: var(--text);
}
.cg-has, .cg-hasnt { text-align: center; }
.cg-dot { color: var(--accent); font-size: 13px; }
.cg-rd-table .is-owned { opacity: .55; }
.cg-own { font-size: 11px; color: var(--cyan-1); font-weight: 500; margin-left: 4px; }
.cg-buy {
  display: inline-block; font-size: 12.5px; font-weight: 600;
  color: var(--cyan-1); text-decoration: none;
  border: 1px solid rgba(99, 102, 241,.35); border-radius: 6px;
  padding: 3px 9px; white-space: nowrap;
}
.cg-buy:hover { background: rgba(99, 102, 241,.08); }

/* ═══════════════════════════════════════════════════════════════
   Content plays — keyword gaps grouped into the pages that win them.
   Adapted from the standalone mockup into the app theme (Inter +
   the shared CSS variables), not its own :root/Sora palette.
   ═══════════════════════════════════════════════════════════════ */
:root { --cg-amber: var(--gold); }

/* Scaled to match the keywords page density — the app works at a ~13px
   body scale with a single 28px headline number (.kwr-kpi-value), not the
   standalone mockup's 14px-base larger scale. */

/* The AI card's avatar sizes its width from its stretched height via
   aspect-ratio:1/1 — that transfer only resolves inside a flex context.
   This wrapper is otherwise a plain block, which collapses the avatar to
   ~0px wide; making it a flex column gives the card a definite height so
   the avatar renders square (matching /keywords/ & /referring-domains/). */
[data-role="sec-keywords"] { display: flex; flex-direction: column; align-items: stretch; }
/* This page spaces stacked cards with per-card margins (the column has no flex
   gap), so the shared .ai-prompt-card — which carries no own margin by design —
   needs one here to sit off the Content plays card below it. Matches the 16px
   used by .cg-verdict / .cg-comp-panel. */
[data-role="sec-keywords"] .ai-prompt-card { margin-bottom: 16px; }

/* ── summary stats (mirror .kwr-kpi) ────────────────────────── */
/* ── Specialist verdict banner (the page hero) ───────────────────── */
/* No overflow:hidden — the model dropdown's menu must escape the card.
   The left accent uses an inset shadow so it respects the card's radius. */
.cg-verdict {
  position: relative;
  margin-bottom: 16px; padding: 22px 24px 20px 26px;
  border: 1px solid rgba(99, 102, 241,.24);
  border-radius: 14px;
  background:
    radial-gradient(130% 150% at 0% 0%, rgba(99, 102, 241,.12), rgba(99, 102, 241,0) 58%),
    rgba(var(--wash-rgb), .02);
  box-shadow: inset 3px 0 0 var(--accent, var(--accent));
}
.cgv-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent, var(--accent)); margin-bottom: 10px;
}
.cgv-eyebrow-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(99, 102, 241,.14); color: var(--accent, var(--accent));
}
.cgv-eyebrow-dot svg { width: 13px; height: 13px; }
.cgv-verdict {
  margin: 0 0 14px; font-size: 15px; line-height: 1.5; font-weight: 500;
  color: var(--text); max-width: none;
}
.cgv-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cgv-topic {
  display: inline-flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(99, 102, 241,.07); border: 1px solid rgba(99, 102, 241,.16);
}
.cgv-topic-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cgv-topic-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cgv-kw {
  font-size: 13px; color: var(--muted); margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.cgv-kw strong { color: var(--text); font-weight: 600; }
.cgv-kw .cgv-win { color: var(--accent, var(--accent)); }
.cgv-hint { display: block; margin: 0; font-size: 12px; color: var(--text-muted, #6b7280); }

.cg-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px;
}
.cg-stat {
  background: rgba(var(--wash-rgb), 0.025); border: 1px solid rgba(var(--wash-rgb), 0.06);
  border-radius: 12px; padding: 14px 16px;
}
.cg-stat-lab {
  font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 8px;
}
.cg-stat-big {
  font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1.05;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.cg-stat-big.g { color: var(--accent); }
.cg-stat-name { font-size: 15px; font-weight: 600; }
.cg-stat-tag {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  vertical-align: middle; margin-left: 6px;
  background: rgba(99, 102, 241,.13); color: var(--accent);
}
.cg-stat-sub { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.4; }

/* ── competitor landscape ───────────────────────────────────── */
.cg-comp-panel { margin-bottom: 16px; padding: 16px 18px; }
.cg-comp-panel[hidden] { display: none; }
.cg-comp-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 12px;
}
.cg-comp-top h2 { font-size: 14px; font-weight: 500; margin: 0 0 3px; color: var(--text-1); }
.cg-comp-top .card-sub { font-size: 12px; color: var(--muted-2); margin: 0; }
.cg-comp-tot { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cg-comp-tot strong { color: var(--gold); font-weight: 600; }
.cg-comp-list { display: flex; flex-direction: column; gap: 2px; }
.cg-comp {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.cg-comp:hover { background: rgba(var(--wash-rgb), .03); }
.cg-comp.on { background: rgba(var(--wash-rgb), .04); border-color: var(--c, var(--line-strong)); }
.cg-comp-av {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #0a0c0e;
}
.cg-comp-main { min-width: 0; }
/* Override the vertical referring-header rule for the landscape rows. */
.cg-comp-list .cg-comp-name {
  writing-mode: horizontal-tb; transform: none;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.cg-threat {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px;
}
.cg-threat.hi { background: rgba(255,122,122,.14); color: var(--danger); }
.cg-threat.med { background: rgba(230,196,122,.12); color: var(--gold); }
.cg-threat.low { background: rgba(var(--wash-rgb), .06); color: var(--muted); }
.cg-comp-bar { height: 5px; background: rgba(var(--wash-rgb), .06); border-radius: 4px; overflow: hidden; }
.cg-comp-bar span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 4px; }
.cg-comp-meta { text-align: right; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.cg-comp-gaps { display: block; color: var(--text); font-weight: 600; font-size: 12px; }

/* ── plays card body — inset to match .card-head padding ───── */
.cg-plays-body { padding: 16px 20px 18px; }

/* ── Worth — backlink value vs competitors ──────────────────── */
.cg-worth-card { padding: 16px 18px 18px; }
.cg-worth-card[hidden] { display: none; }
.cg-worth-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 14px;
}
/* Phones: the stat cluster drops under the title instead of squeezing it. */
@media (max-width: 560px) {
  .cg-worth-top { flex-direction: column; gap: 8px; }
  .cg-worth-stat { align-items: flex-start; text-align: left; white-space: normal; }
}
.cg-worth-top h2 { font-size: 14px; font-weight: 500; margin: 0 0 3px; color: var(--text-1); }
.cg-worth-top .card-sub { font-size: 12px; color: var(--muted-2); margin: 0; max-width: 560px; }
.cg-worth-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.cg-worth-stat-main { font-size: 12px; color: var(--muted); }
.cg-worth-stat-main strong { color: var(--accent); font-weight: 600; }
.cg-worth-stat-sub { font-size: 11px; color: var(--muted-2, var(--muted)); }
.cg-worth-lost { color: var(--danger); }
.cg-worth-list { display: flex; flex-direction: column; gap: 3px; }
.cg-worth-item { border-radius: 10px; }
.cg-worth-item.open { background: rgba(var(--wash-rgb), .02); }
.cg-worth-row {
  display: grid; grid-template-columns: 180px 1fr 150px 14px; gap: 14px; align-items: center;
  padding: 9px 10px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
}
.cg-worth-row:hover { background: rgba(var(--wash-rgb), .025); }
.cg-worth-row.is-you { background: rgba(99, 102, 241,.06); border-color: rgba(99, 102, 241,.18); }
.cg-worth-chev { color: var(--muted); font-size: 16px; line-height: 1; justify-self: end; transition: transform .2s; }
.cg-worth-item.open .cg-worth-chev { transform: rotate(90deg); }

/* expandable per-competitor intel */
.cg-worth-detail { display: none; padding: 2px 12px 14px 14px; }
.cg-worth-item.open .cg-worth-detail { display: block; }
.cg-wd-read { font-size: 12.5px; color: var(--lt8); line-height: 1.55; margin: 0 0 12px; max-width: 780px; }
.cg-wd-read strong { color: var(--text); }
.cg-wd-read a { color: var(--blue-1); text-decoration: none; }
.cg-wd-read a:hover { text-decoration: underline; }
.cg-wd-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.cg-wd-tile { background: rgba(var(--wash-rgb), .025); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; min-width: 120px; }
.cg-wd-tile-lab { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.cg-wd-tile-val { font-size: 14px; font-weight: 600; color: var(--text); }
.cg-wd-buy { margin-bottom: 12px; }
.cg-wd-buy-head { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.cg-wd-buy-list { display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.cg-wd-buy-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(var(--wash-rgb), .02); text-decoration: none;
}
.cg-wd-buy-row:hover { border-color: var(--line-strong); background: rgba(var(--wash-rgb), .04); }
.cg-wd-buy-dom { font-size: 12.5px; color: var(--blue-1); }
.cg-wd-buy-price { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.cg-wd-buy-more { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.cg-wd-note { font-size: 11px; color: var(--muted-2, var(--muted)); line-height: 1.5; margin: 0 0 12px; max-width: 640px; }
.cg-wd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cg-wd-ai, .cg-wd-deepen {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px;
  border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.cg-wd-ai { border: 1px solid rgba(99, 102, 241,.3); background: rgba(99, 102, 241,.06); color: var(--accent); }
.cg-wd-ai:hover { background: rgba(99, 102, 241,.1); }
.cg-wd-deepen { border: 1px solid var(--line-strong); background: rgba(var(--wash-rgb), .03); color: var(--text); }
.cg-wd-deepen:hover { background: rgba(var(--wash-rgb), .06); }
.cg-wd-deepen:disabled { opacity: .6; cursor: default; }
.cg-wd-ai svg, .cg-wd-deepen svg { width: 14px; height: 14px; }
.cg-worth-name { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cg-worth-dom {
  font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 8px;
}
.cg-worth-row.is-you .cg-worth-dom { font-weight: 600; }
.cg-worth-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cg-worth-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px; background: rgba(99, 102, 241,.14); color: var(--accent);
}
/* two stacked bars on one shared scale: worth (gold / green for you) + lost (red) */
.cg-worth-bars { display: flex; flex-direction: column; gap: 4px; }
.cg-worth-bar { height: 7px; background: rgba(var(--wash-rgb), .05); border-radius: 4px; overflow: hidden; }
.cg-worth-bar span { display: block; height: 100%; border-radius: 4px; }
.cg-worth-bar.worth span { background: var(--gold); }
.cg-worth-row.is-you .cg-worth-bar.worth span { background: var(--accent); }
.cg-worth-bar.lost span { background: var(--danger); }
.cg-worth-val { text-align: right; display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.cg-worth-v-worth { font-size: 13px; font-weight: 600; color: var(--text); }
.cg-worth-v-lost { font-size: 11.5px; color: var(--danger); white-space: nowrap; }
.cg-worth-v-lost.none { color: var(--muted-2, var(--muted)); }
.cg-worth-foot { margin: 12px 0 0; font-size: 11.5px; color: var(--muted-2, var(--muted)); line-height: 1.5; }
@media (max-width: 720px) {
  .cg-worth-row { grid-template-columns: 110px 1fr 92px 14px; }
  .cg-worth-meta { display: none; }
  .cg-wd-tile { min-width: 0; flex: 1 1 45%; }
}

/* ── filter tabs — shared .toggle-pill (count badge replicated from
   keywords.css since that sheet isn't loaded here) ──────────── */
.cg-tabs { margin-bottom: 14px; }
.cg-tabs .toggle-pill { flex-wrap: wrap; }
.tab-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 15px; margin-left: 5px; padding: 0 5px;
  border-radius: 999px; background: rgba(var(--wash-rgb), 0.06);
  font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; color: inherit;
}
.cg-tabs .toggle-pill button.active .tab-n { background: rgba(var(--well-rgb), var(--well-a24)); }

.cg-filter-note {
  font-size: 12px; color: var(--muted); margin: 0 0 14px;
  padding: 8px 12px; background: rgba(var(--wash-rgb), .03);
  border: 1px solid var(--line); border-radius: 8px;
}
.cg-filter-note[hidden] { display: none; }
.cg-filter-note strong { color: var(--text); }
.cg-clear { color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ── play card (mirror .act-card scale) ─────────────────────── */
.cg-play {
  background: rgba(var(--wash-rgb), 0.02); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 10px; overflow: hidden; position: relative;
}
.cg-play::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.cg-play--stretch::before { background: var(--gold); }
.cg-play--longshot::before { background: var(--muted); }
.cg-phead { padding: 13px 18px; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.cg-prank {
  font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
  background: rgba(var(--wash-rgb), .04); border: 1px solid var(--line); border-radius: 8px;
  min-width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cg-play--reachable .cg-prank { color: var(--accent); border-color: rgba(99, 102, 241,.3); background: rgba(99, 102, 241,.1); }
.cg-pmid { flex: 1; min-width: 0; }
.cg-ptitle-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.cg-ptitle { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.cg-badge { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.cg-badge.b-reach { background: rgba(99, 102, 241,.13); color: var(--accent); }
.cg-badge.b-quick { background: rgba(99, 102, 241,.18); color: var(--accent); }
.cg-badge.b-stretch { background: rgba(230,196,122,.12); color: var(--gold); }
.cg-badge.b-long { background: rgba(var(--wash-rgb), .06); color: var(--muted); }
.cg-badge.b-unknown { background: rgba(var(--wash-rgb), .06); color: var(--muted); }
.cg-play--unknown::before { background: var(--muted-2, var(--muted)); }
.cg-badge.b-top { background: transparent; border: 1px solid rgba(99, 102, 241,.4); color: var(--accent); }
.cg-kd-note {
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  padding: 11px 14px; margin-bottom: 14px;
  background: rgba(230,196,122,.06); border: 1px solid rgba(230,196,122,.22); border-radius: 9px;
}
.cg-kd-note strong { color: var(--gold); }
.cg-pmeta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cg-pmeta b { color: var(--text); font-weight: 600; }
.cg-impact { text-align: right; flex-shrink: 0; }
.cg-impact .n { font-size: 17px; font-weight: 700; color: var(--accent); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cg-impact .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cg-impact.muted .n { color: var(--muted); }
.cg-chev { color: var(--muted); flex-shrink: 0; transition: transform .2s; margin-top: 4px; font-size: 16px; line-height: 1; }
.cg-play.open .cg-chev { transform: rotate(90deg); }

.cg-pbody { display: none; padding: 0 18px 16px; }
.cg-play.open .cg-pbody { display: block; }
.cg-read { font-size: 13px; color: var(--lt8); line-height: 1.55; margin: 0 0 12px; max-width: 760px; }
.cg-read .ux { color: var(--text); font-weight: 600; }
.cg-beating {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted);
  margin-bottom: 12px; flex-wrap: wrap;
}
.cg-beat-link { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.cg-beat-link:hover .cg-beat-dom { text-decoration: underline; }
.cg-beat-dom { color: var(--blue-1); }
.cg-beat-path { color: var(--muted-2, var(--muted)); }
.cg-ext { width: 11px; height: 11px; flex-shrink: 0; color: var(--muted-2, var(--muted)); }
.cg-beat-link:hover .cg-ext, .cg-kw-link:hover .cg-ext { color: var(--blue-1); }
.cg-kw-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.cg-kw-link:hover { color: var(--text); text-decoration: underline; }
.cg-pos { background: rgba(99, 102, 241,.13); color: var(--accent); border-radius: 6px; padding: 1px 7px; font-weight: 600; font-size: 11px; }
.cg-caveat {
  background: rgba(230,196,122,.08); border-left: 2px solid rgba(230,196,122,.35);
  border-radius: 0 8px 8px 0; padding: 10px 14px; font-size: 12px; color: #d8c08a;
  margin-bottom: 14px; line-height: 1.5;
}
.cg-caveat b { color: var(--gold); text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; margin-right: 6px; }

/* Action row — mirrors keywords .act-actions: tight cards that flex to
   ~equal widths and wrap, never a full-width 2-up grid. */
.cg-actions { display: flex; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.cg-act-btn {
  flex: 1 1 0; min-width: 220px; max-width: 360px;
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; text-align: left;
  background: rgba(var(--wash-rgb), 0.022); border: 1px solid rgba(var(--wash-rgb), 0.07);
  border-radius: 10px; cursor: pointer; transition: border-color .16s ease, background .16s ease;
}
.cg-act-btn:hover { border-color: var(--line-strong); background: rgba(var(--wash-rgb), 0.04); }
.cg-act-btn-icon {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; color: var(--cyan-4); background: rgba(99, 102, 241,0.08);
}
.cg-act-btn-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cg-act-btn-label { font-size: 9px; font-weight: 600; letter-spacing: .10em; text-transform: uppercase; color: var(--muted-2); }
.cg-act-btn-title { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.cg-act-btn-sub { font-size: 11px; line-height: 1.4; color: var(--muted); }

.cg-ai-hint {
  flex: 1 1 220px; min-width: 200px; max-width: 340px;
  display: flex; flex-direction: column; gap: 10px; padding: 11px 12px; border-radius: 10px;
  background: rgba(99, 102, 241,0.05); border: 1px solid rgba(99, 102, 241,0.18);
}
.cg-ai-hint-head { display: flex; align-items: flex-start; gap: 9px; }
.cg-ai-hint-icon {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; color: var(--cyan-4); background: rgba(99, 102, 241,0.1);
}
.cg-ai-hint-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cg-ai-hint-txt b { font-size: 9px; font-weight: 700; letter-spacing: .10em; text-transform: uppercase; color: var(--accent); }
.cg-ai-hint-txt span { font-size: 11px; line-height: 1.45; color: var(--muted); }
.cg-start-task {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 12px; border: 0; border-radius: 8px; background: var(--accent); color: var(--cyan-bg);
  font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .14s ease, transform .14s ease;
}
.cg-start-task:hover { filter: brightness(1.08); }
.cg-act-btn-icon svg, .cg-ai-hint-icon svg { width: 14px; height: 14px; }
.cg-start-task svg { width: 14px; height: 14px; }

/* nested keyword table */
.cg-kwtoggle {
  margin-top: 12px; background: none; border: none; color: var(--muted); font: inherit;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 5px 0;
}
.cg-kwtoggle:hover { color: var(--text); }
.cg-kwtoggle .cg-ar { transition: transform .2s; display: inline-block; }
.cg-kwtable { display: none; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cg-kwtable.show { display: block; }
.cg-kwhead, .cg-kwrow { display: grid; grid-template-columns: 1fr 90px 90px 150px; gap: 12px; padding: 7px 12px; align-items: center; }
.cg-kwhead { background: rgba(var(--wash-rgb), .03); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.cg-kwhead .r, .cg-kw-num.r { text-align: right; }
.cg-kwrow { border-top: 1px solid var(--line); font-size: 12px; }
.cg-kw-name { font-weight: 500; color: var(--text); }
.cg-kw-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.cg-kw-num.val { color: var(--accent); }
.cg-kw-src { font-size: 11.5px; color: var(--muted-2, var(--muted)); }
.cg-kw-p { color: var(--accent); background: rgba(99, 102, 241,.13); border-radius: 4px; padding: 1px 5px; margin-right: 5px; }

.cg-foot { margin-top: 14px; color: var(--muted-2, var(--muted)); font-size: 11.5px; }
.cg-plays .cg-empty { padding: 28px 12px; }

/* ── responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cg-stats { grid-template-columns: repeat(2, 1fr); }
  .cg-comp-top { flex-direction: column; }
  .cg-intro-steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cg-comp { grid-template-columns: 30px 1fr; }
  .cg-comp-meta { display: none; }
  .cg-act-btn, .cg-ai-hint { min-width: 0; max-width: none; }
  .cg-kwhead, .cg-kwrow { grid-template-columns: 1fr 70px; }
  .cg-kwhead span:nth-child(3), .cg-kwhead span:nth-child(4),
  .cg-kw-num.val, .cg-kw-src { display: none; }
  .cg-impact { display: none; }
}
