/* Geo Ops — camada de fidelidade sobre o design system fs-* (padrões extraídos
 * dos componentes .dc do Claude Design: WidgetCard/WidgetHead). Prefixo gw-. */

/* ── tokens da camada gw (P1 — fonte única; JS lê via tok(), nunca hex no JS) ── */
:root {
  /* paleta de marcas concorrentes (ordem estável por índice) */
  --gw-brand-1: #673ab7;  /* Hostinger */
  --gw-brand-2: #8b1e1e;  /* Kinsta */
  --gw-brand-3: #00695c;  /* HostGator */
  --gw-brand-4: #2e7d32;  /* SiteGround */
  --gw-brand-5: #0f766e;  /* WP Engine */
  --gw-brand-6: #6d28d9;  /* KingHost */
  --gw-brand-7: #dc2626;  /* Locaweb */
  --gw-brand-8: #1d4ed8;  /* AIOSEO */
  --gw-brand-9: #5b21b6;  /* SEOPress */
  --gw-brand-10: #546e7a; /* fallback */
  /* tons semânticos (status/sentiment/tone) */
  --gw-ok: #12b76a;     --gw-ok-bg: #e7f6ee;   --gw-ok-ink: #12784a;
  --gw-warn: #f79009;   --gw-warn-bg: #fff4e0; --gw-warn-ink: #b25e09;
  --gw-err: #f04438;    --gw-err-bg: #feeceb;  --gw-err-ink: #b42318;
  /* thresholds de sentimento: good >= 75 · mid >= 60 · bad < 60 (contrato do painel) */
}

/* ── layouts de tabela (P1 — mata grid-template-columns inline; 1 classe = 1 layout) ── */
.gw-cols-rankings  { grid-template-columns: 24px 1fr 76px 64px 86px; }
.gw-cols-positions { grid-template-columns: 24px 1fr 110px 90px; }
.gw-cols-sov       { grid-template-columns: 28px 1fr 90px; }
.gw-cols-urls      { grid-template-columns: 1fr 110px 120px 70px 60px; }
.gw-cols-responses { grid-template-columns: 44px 1fr 90px 70px 80px 70px 70px; }
.gw-cols-facts     { grid-template-columns: 36px 1fr 150px; }
.gw-cols-topics    { grid-template-columns: 1fr 130px repeat(10, 34px); }
.gw-cols-topic-pos { grid-template-columns: 1fr 120px; }
.gw-cols-analysis  { grid-template-columns: 24px 1fr 60px 60px; }
/* hooks data-cols (renderers JS emitem o atributo; layout mora AQUI) */
[data-cols="responses"]  { grid-template-columns: 44px 1fr 90px 70px 80px 70px 70px; }
[data-cols="facts"]      { grid-template-columns: 36px 1fr 150px; }
[data-cols="urls"]       { grid-template-columns: 1fr 110px 120px 70px 60px; }
[data-cols="topic-pos"]  { grid-template-columns: 1fr 120px; }
[data-cols="topics"]     { grid-template-columns: 1fr 130px repeat(10, 34px); }
[data-cols="analysis"]   { grid-template-columns: 24px 1fr 60px 60px; }
[data-cols="matrix5"]    { grid-template-columns: 1fr repeat(5, 52px); }
[data-cols="modal-rank"] { grid-template-columns: 24px 1fr 70px 70px; }

/* ── skeleton / shimmer (P2 — estado de loading entre fetch e render) ────────── */
.gw-skeleton { position: relative; overflow: hidden; background: var(--fs-surface-soft); border-radius: 8px; }
.gw-skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: gw-shimmer 1.3s infinite;
}
@keyframes gw-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.gw-skel-row { height: 14px; margin: 10px 16px; }
.gw-skel-kpi { height: 34px; width: 120px; margin: 4px 0; }
.gw-skel-chart { height: 200px; margin: 8px 0; }

/* ── motion (P2 — tokens --fs-duration/--fs-ease finalmente em uso) ──────────── */
.gw-menu { transform-origin: top left; animation: gw-pop var(--fs-duration-fast, .13s) var(--fs-ease-out, ease-out); }
@keyframes gw-pop { from { opacity: 0; transform: scale(.97) translateY(-3px); } }
.gw-modal.is-open { animation: gw-modal-in .18s var(--fs-ease-out, ease-out); }
@keyframes gw-modal-in { from { opacity: 0; transform: scale(.975); } }
.gw-drawer.is-open { animation: gw-drawer-in .2s var(--fs-ease-out, ease-out); }
@keyframes gw-drawer-in { from { transform: translateX(24px); opacity: 0; } }
.gw-scrim.is-open { animation: gw-fade .16s ease-out; }
@keyframes gw-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .gw-menu, .gw-modal.is-open, .gw-drawer.is-open, .gw-scrim.is-open { animation: none; }
  .gw-skeleton::after { animation: none; }
}

/* ── foco visível (P2 — WCAG 2.4.7) ──────────────────────────────────────────── */
.fs-tab:focus-visible, .gw-chip:focus-visible, .gw-toggle:focus-visible,
.gw-menu__item:focus-visible, .fs-btn:focus-visible, .gw-close:focus-visible,
.fs-nav-item:focus-visible {
  outline: 2px solid var(--fs-ink);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── widget card (fiel ao WidgetCard.dc) ─────────────────────────────────── */
.gw-card {
  background: #fff;
  border: 1px solid var(--fs-hairline);
  border-radius: 12px;
  box-shadow: var(--fs-shadow-card);
  display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}
.gw-card__head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fs-hairline);
  min-width: 0; flex: none;
}
.gw-card__icon { display: inline-flex; align-items: center; color: #667085; flex: none; }
.gw-card__title { font: var(--fs-text-section-title); color: var(--fs-ink); letter-spacing: -.1px; white-space: nowrap; flex: none; }
.gw-card__info { display: inline-flex; align-items: center; color: var(--fs-gray-400); cursor: help; flex: none; }
.gw-card__sep { color: var(--fs-gray-300); font-size: 13px; line-height: 1; flex: none; }
.gw-card__desc { font-size: 12.5px; color: var(--fs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.gw-card__tools { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.gw-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.gw-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 16px;
  background: var(--fs-surface-soft);
  border-top: 1px solid var(--fs-hairline);
  font-size: 12px; color: var(--fs-muted); flex: none;
}

/* toggle de tipo de gráfico (28×26, ativo = branco + hairline + sombra) */
.gw-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 26px; border-radius: 7px;
  border: 1px solid transparent; background: transparent;
  color: var(--fs-gray-400); cursor: pointer; padding: 0;
}
.gw-toggle.is-active {
  border-color: var(--fs-hairline); background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
  color: var(--fs-ink);
}

/* ── KPI dentro do card ──────────────────────────────────────────────────── */
.gw-kpi-label { font-size: 12.5px; color: var(--fs-muted); }
.gw-kpi-row { display: flex; align-items: center; gap: 10px; }
.gw-kpi { font-size: 30px; font-weight: 750; letter-spacing: -.5px; color: var(--fs-ink); font-variant-numeric: tabular-nums; }
.gw-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: #e7f6ee; color: #12784a; font-variant-numeric: tabular-nums;
}
.gw-delta.is-down { background: #feeceb; color: #b42318; }
.gw-delta.is-flat { background: var(--fs-surface-soft); color: var(--fs-muted); }

/* ── faixa branca sob a topbar (tabs + filtros, fiel à referência .dc) ───── */
.gw-subhead {
  background: #fff;
  border-bottom: 1px solid var(--fs-hairline);
  padding: 0 24px;
  position: sticky; top: var(--fs-header-height); z-index: 19;
}
.gw-subhead .fs-tabs { margin: 0 -24px; padding: 0 24px; }
.gw-subhead .gw-filters { padding: 10px 0 12px; margin: 0; }

/* ── linha de filtros sob as tabs ────────────────────────────────────────── */
.gw-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; }
.gw-filters__spacer { flex: 1; }
.gw-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--fs-hairline); background: #fff;
  font-size: 12.5px; font-weight: 400; color: var(--fs-body);
  cursor: pointer; white-space: nowrap;
}
.gw-chip:hover { border-color: var(--fs-gray-300); }
.gw-chip img { width: 16px; height: 16px; border-radius: 50%; }
.gw-chip .gw-caret { color: var(--fs-gray-400); display: inline-flex; }

/* ── tabela de rankings (3 métricas + dot de sentimento) ─────────────────── */
.gw-table { display: flex; flex-direction: column; min-width: 0; }
.gw-table__head, .gw-table__row {
  display: grid; align-items: center; gap: 10px;
  padding: 9px 16px; min-width: 0;
}
.gw-table__head {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fs-muted); background: var(--fs-surface-soft);
  border-bottom: 1px solid var(--fs-hairline);
}
.gw-table__row { border-bottom: 1px solid var(--fs-hairline); font-size: 13px; }
.gw-table__row:last-child { border-bottom: 0; }
.gw-table__row:hover { background: var(--fs-yellow-cream); }
.gw-table__row.is-you { background: var(--fs-yellow-cream); }
.gw-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.gw-dot { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; font-weight: 600; font-variant-numeric: tabular-nums; }
.gw-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, #98a2b3); }
.gw-dot.is-good { --dot: #12b76a; }
.gw-dot.is-mid { --dot: #f79009; }
.gw-dot.is-bad { --dot: #f04438; }

/* ── grid da tela Visibilidade (produto: 2 colunas IGUAIS, gap 20) ───────── */
.gw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 1100px) { .gw-grid { grid-template-columns: 1fr; } }

/* linha de KPIs no topo da aba Visibilidade (mesmos 4 do Início, padrão insights) */
.gw-kpirow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.gw-kpirow .gw-card__body { padding: 16px 18px; gap: 6px; }
@media (max-width: 1100px) { .gw-kpirow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px)  { .gw-kpirow { grid-template-columns: 1fr; } }

/* barras por marca (card Visibilidade) — hover = coluna soft + tooltip */
.gw-visbar { flex: 1; display: flex; flex-direction: column; cursor: pointer; background: transparent; }
.gw-visbar:hover { background: var(--fs-surface-soft); }
.gw-visbar [data-tt] { display: none; }
.gw-visbar:hover [data-tt] { display: block; }

/* ── badge DEMO (topbar) ─────────────────────────────────────────────────── */
.gw-demo-badge {
  display: none; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  background: #17140a; color: #ffd910;
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
}
.gw-demo-badge.is-on { display: inline-flex; }

/* ── funil Decision Journey ──────────────────────────────────────────────── */
.gw-funnel { display: flex; flex-direction: column; gap: 10px; }
.gw-funnel__row { display: grid; grid-template-columns: 92px 1fr 64px 84px; gap: 10px; align-items: center; }
.gw-funnel__stage { font-size: 12.5px; font-weight: 700; color: var(--fs-ink); }
.gw-funnel__stage small { display: block; font-weight: 600; color: var(--fs-muted); font-size: 10.5px; letter-spacing: .05em; }
.gw-funnel__track { height: 10px; border-radius: 999px; background: var(--fs-surface-soft); overflow: hidden; }
.gw-funnel__bar { height: 100%; border-radius: 999px; background: var(--fs-yellow); }
.gw-funnel__pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.gw-status { display: inline-flex; justify-content: center; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }
.gw-status.is-critical { background: var(--gw-err-bg); color: var(--gw-err-ink); }
.gw-status.is-weak     { background: var(--gw-warn-bg); color: var(--gw-warn-ink); }
.gw-status.is-good     { background: var(--gw-ok-bg); color: var(--gw-ok-ink); }
.gw-status.is-low      { background: var(--fs-surface-soft); color: var(--fs-muted); }

/* ── jornada dos 4 pilares (Início) ─────────────────────────────────────── */
.gw-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .gw-pillars { grid-template-columns: 1fr 1fr; } }
.gw-pillar { text-decoration: none; transition: transform var(--fs-duration-fast, .13s) var(--fs-ease-out, ease-out), box-shadow var(--fs-duration-fast, .13s); }
.gw-pillar:hover { transform: translateY(-2px); box-shadow: var(--fs-nav-shadow); }
.gw-pillar__eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fs-gold-text); }
.gw-pillar__cta { font-size: 12px; font-weight: 700; color: var(--fs-ink); }

/* ── matriz Position Distribution / heatmap de posição ───────────────────── */
.gw-matrix { display: flex; flex-direction: column; }
.gw-matrix__row { display: grid; gap: 6px; align-items: center; padding: 5px 0; }
.gw-matrix__cell {
  height: 26px; border-radius: 6px; background: var(--fs-surface-soft);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--fs-ink); font-variant-numeric: tabular-nums;
}
.gw-matrix__cell.is-hot { background: #e7f6ee; color: #12784a; }
.gw-matrix__head { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--fs-muted); text-align: center; text-transform: uppercase; }

/* ── perception ring (conic) ─────────────────────────────────────────────── */
.gw-ring { position: relative; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--fs-yellow) calc(var(--val) * 1%), var(--fs-surface-soft) 0); }
.gw-ring::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: #fff; }
.gw-ring__val { position: relative; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gw-ring__val small { font-size: 12px; color: var(--fs-muted); font-weight: 600; }

/* ── barra de distribuição pos/neu/neg ───────────────────────────────────── */
.gw-distbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; }
.gw-distbar span:nth-child(1) { background: #12b76a; }
.gw-distbar span:nth-child(2) { background: #d0d5dd; }
.gw-distbar span:nth-child(3) { background: #f04438; }

/* ── treemap tonal (atributos / tópicos) ─────────────────────────────────── */
.gw-treemap { display: flex; flex-wrap: wrap; gap: 8px; }
.gw-treemap__cell {
  border-radius: 10px; padding: 10px 12px; min-width: 96px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
  background: var(--fs-surface-soft); border: 1px solid var(--fs-hairline);
}
.gw-treemap__cell .lbl { font-size: 12px; font-weight: 700; color: var(--fs-ink); line-height: 1.25; }
.gw-treemap__cell .pct { font-size: 12px; font-weight: 700; color: var(--fs-muted); font-variant-numeric: tabular-nums; }
.gw-treemap__cell.is-good    { background: #e7f6ee; border-color: #c4ecd6; }
.gw-treemap__cell.is-bad     { background: #feeceb; border-color: #f6cdc9; }
.gw-treemap__cell.is-neutral { background: #fffbe8; border-color: #f1e9c4; }

/* ── head-to-head ────────────────────────────────────────────────────────── */
.gw-h2h__bars { display: flex; flex-direction: column; gap: 8px; }
.gw-h2h__row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; font-size: 12.5px; }
.gw-h2h__track { height: 12px; border-radius: 999px; background: var(--fs-surface-soft); overflow: hidden; }
.gw-h2h__fill { height: 100%; border-radius: 999px; }

/* ── responses / engines ─────────────────────────────────────────────────── */
.gw-engine { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--fs-surface-soft); font-size: 10px; font-weight: 800; }
.gw-yesno { font-size: 12px; font-weight: 700; }
.gw-yesno.is-yes { color: #12784a; }
.gw-yesno.is-no  { color: #b42318; }
.gw-group-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--fs-surface-soft); border-bottom: 1px solid var(--fs-hairline); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.gw-group-head .fs-badge { font-weight: 600; }
.gw-group-head .gw-caret { margin-left: auto; color: var(--fs-gray-400); transition: transform .13s var(--fs-ease-out, ease); }
.gw-group-head.is-open .gw-caret { transform: rotate(180deg); }

/* ── badges de tipo de fonte ─────────────────────────────────────────────── */
.gw-srctype { font-size: 10.5px; font-weight: 800; letter-spacing: .03em; padding: 3px 8px; border-radius: 6px; }
.gw-srctype.is-owned      { background: #fff3bf; color: #8a6d00; }
.gw-srctype.is-editorial  { background: #e0ecff; color: #1d4ed8; }
.gw-srctype.is-competitor { background: #feeceb; color: #b42318; }
.gw-srctype.is-social     { background: #ede9fe; color: #6d28d9; }
.gw-srctype.is-corporate  { background: #e2e8f0; color: #475569; }
.gw-srctype.is-other      { background: var(--fs-surface-soft); color: var(--fs-muted); }

/* ── menu dropdown (mecanismo p/ .fs-menu do design system) ──────────────── */
.gw-menu-host { position: relative; }
.gw-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 210px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--fs-hairline); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .12);
  padding: 6px;
}
.gw-menu__item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: 8px; border: 0; background: transparent;
  font-size: 13px; color: var(--fs-ink); cursor: pointer; text-align: left;
}
.gw-menu__item:hover { background: var(--fs-yellow-cream); }
.gw-menu__item .check { margin-left: auto; color: var(--fs-ink); }

/* ── modal / drawer (mecanismo) ──────────────────────────────────────────── */
.gw-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(23, 20, 10, .38); display: none; }
.gw-scrim.is-open { display: block; }
.gw-modal {
  position: fixed; z-index: 95; inset: 0; margin: auto;
  width: min(880px, calc(100vw - 40px)); height: min(640px, calc(100vh - 60px));
  background: var(--fs-cream, #fffbe8); border-radius: 16px; overflow: auto;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .22); display: none;
  padding: 22px 24px;
}
.gw-modal.is-open { display: block; }
.gw-drawer {
  position: fixed; z-index: 95; top: 0; right: 0; bottom: 0;
  width: min(480px, 92vw); background: #fff; overflow: auto; display: none;
  box-shadow: -18px 0 44px rgba(16, 24, 40, .18); padding: 22px 24px;
}
.gw-drawer.is-open { display: block; }
.gw-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--fs-hairline); background: #fff; cursor: pointer; font-size: 14px; }

/* ── donut com CTA central ───────────────────────────────────────────────── */
.gw-donut-wrap { position: relative; height: 230px; }
.gw-donut-center {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; text-align: center;
}
.gw-donut-center span {
  font-size: 12px; font-weight: 600; color: var(--fs-muted);
  max-width: 110px; line-height: 1.35;
}

/* layouts de tabela do AI Search */
[data-cols="issues"] { display: grid; gap: 10px; grid-template-columns: 1fr 110px 110px 70px; }
[data-cols="pages"]  { display: grid; gap: 10px; grid-template-columns: 1fr 70px 70px 84px 70px 110px; }

/* ── segmented control (linha/tabela — padrão do produto) ────────────────── */
.gw-seg { display: inline-flex; gap: 2px; background: var(--fs-surface-soft); border: 1px solid var(--fs-hairline); border-radius: 9px; padding: 2px; }
.gw-seg button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--fs-gray-400); cursor: pointer; padding: 0; }
.gw-seg button.is-active { background: #fff; color: var(--fs-ink); box-shadow: 0 1px 2px rgba(16,24,40,.06); }

/* linhas de resposta (Todas as respostas) — hover do produto */
.gw-resprow:hover { background: var(--fs-yellow-cream); }

/* hidden SEMPRE esconde — regra de autor (.fs-empty display:flex) vencia o UA stylesheet */
[hidden] { display: none !important; }

/* tooltips/overlays por hover puro (chips de atributo, score ring, tile overlay) */
.gw-hovertip { position: relative; }
.gw-hovertip > [data-htt] { display: none; }
.gw-hovertip:hover > [data-htt] { display: block; }
/* botão que só aparece no hover da linha (Expandir / Mostrar detalhes) */
.gw-hoverrow [data-hbtn] { visibility: hidden; }
.gw-hoverrow:hover [data-hbtn] { visibility: visible; }
.gw-hoverrow:hover [data-hidehover] { display: none; }
.gw-hover-soft:hover { background: var(--fs-surface-soft); }
/* linha tracejada do gráfico de fontes só no hover */
.gw-srcplot [data-dash] { stroke: transparent; }
.gw-srcplot:hover [data-dash] { stroke: #98A2B3; }

/* botão Ver detalhes (SoV): ghost → amarelo no hover (produto) */
.gw-btn-detail {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--fs-hairline); background: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--fs-ink);
  cursor: pointer; font-family: inherit;
  transition: background var(--fs-duration-fast, .13s), border-color var(--fs-duration-fast, .13s);
}
.gw-btn-detail:hover { background: var(--fs-yellow); border-color: var(--fs-yellow); }
.gw-sov-center:hover { color: var(--fs-ink); }

/* tooltip do hover sobe acima dos irmãos (badges do SoV têm z-index inline) */
.gw-hovertip:hover { z-index: 40 !important; }

/* toggle switch (Tipos de conteúdo — AI Content) */
.gw-switch {
  position: relative; width: 34px; height: 20px; border-radius: 999px;
  background: #E4E7EC; border: 0; cursor: pointer; flex: none; padding: 0;
  transition: background var(--fs-duration-fast, .13s);
}
.gw-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
  transition: left var(--fs-duration-fast, .13s);
}
.gw-switch.is-on { background: var(--fs-yellow); }
.gw-switch.is-on::after { left: 16px; }

/* overlay dos tiles do treemap: escondido até o hover (inline display:flex vencia o data-htt) */
.gw-hovertip > .gw-tile-hover { display: none; }
.gw-hovertip:hover > .gw-tile-hover { display: flex; }

/* ── P4 responsivo: grids de layout dos renderers (markers vencem inline) ── */
/* .gw-2col = grid de 2 colunas de cards (1fr 1fr, 1fr 340px, 1fr 300px…) */
@media (max-width: 1024px) {
  .gw-2col { grid-template-columns: 1fr !important; }
  .gw-2col > [style*="position:sticky"] { position: static !important; }
}
/* .gw-4col = fileira de 4 stat cards */
@media (max-width: 1024px) { .gw-4col { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 640px)  { .gw-4col { grid-template-columns: 1fr !important; } }
/* .gw-8col = hero stats do source-detail */
@media (max-width: 1024px) { .gw-8col { grid-template-columns: repeat(4, 1fr) !important; } }
@media (max-width: 640px)  { .gw-8col { grid-template-columns: repeat(2, 1fr) !important; } }

@media (max-width: 640px) {
  /* tabelas (grids com colunas fixas) rolam dentro do card — nunca a página */
  .gw-card { overflow-x: auto; }
  .gw-card div[style*="grid-template-columns"]:not(.gw-2col):not(.gw-4col):not(.gw-8col),
  .gw-card .gw-table { min-width: 560px; }
  /* funil causal empilha */
  .gw-card__body[style*="flex-direction:row"] { flex-wrap: wrap; }
  /* subhead/filtros respiram menos */
  .gw-subhead { padding: 0 14px; }
  .gw-subhead .fs-tabs { margin: 0 -14px; padding: 0 14px; }
  /* chips de filtro: rolagem horizontal em vez de pilha alta */
  .gw-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .gw-filters::-webkit-scrollbar { display: none; }
  .gw-filters .gw-chip { flex-shrink: 0; }
  .gw-filters__spacer { display: none; }
  /* pilares do início empilham */
  .gw-pillars { grid-template-columns: 1fr !important; }
  /* modal de prompt ocupa a tela */
  .gw-modal { width: calc(100vw - 16px) !important; max-height: 92vh !important; }
}

/* filhos de grid/flex têm min-width:auto — sem isto, conteúdo largo (desc nowrap,
   tabelas) alarga a página em vez de truncar/rolar */
.gw-grid > *, .gw-2col > *, .gw-4col > *, .gw-8col > *, .fs-content-inner > * { min-width: 0; }
@media (max-width: 640px) {
  .gw-card { min-width: 0; max-width: 100%; }
  [data-panel] { min-width: 0; }
}

@media (max-width: 640px) {
  /* subhead nunca alarga a página; desc do outHead trunca em vez de empurrar */
  .gw-subhead { overflow-x: clip; }
  .gw-2col [style*="min-height:26px"] > span[style*="ellipsis"] { flex: 1; }
}

@media (max-width: 640px) {
  /* chips/pills (atributos, beats) mais largos que a tela quebram linha */
  .gw-hovertip { max-width: 100%; }
  .gw-hovertip > span[style*="white-space:nowrap"] { white-space: normal !important; height: auto !important; }
}

/* ── Geo Ops Copilot — drawer de chat (R-028, design FULL Copilot.dc) ──────
   Estrutura (launcher/scrim/drawer/animações) aqui; o miolo segue o padrão do
   design com estilos inline nos renders. flex:none nos filhos do scroller. */
.gw-chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 20px 0 16px; border-radius: 999px;
  border: 1px solid var(--fs-yellow-soft); background: #fff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .16);
  color: var(--fs-ink); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .13s ease, box-shadow .13s ease;
}
.gw-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(16, 24, 40, .2); }
.gw-chat-scrim {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(16, 24, 40, .28); display: none;
}
.gw-chat-scrim.is-open { display: block; }
.gw-chat {
  position: fixed; top: 0; right: 0; z-index: 46;
  width: 456px; max-width: 94vw; height: 100vh;
  background: #fff; border-left: 1px solid var(--fs-hairline);
  box-shadow: -18px 0 48px rgba(16, 24, 40, .14);
  display: none; flex-direction: column;
}
.gw-chat.is-open { display: flex; animation: gw-chat-slide .22s ease-out both; }
@keyframes gw-chat-slide { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.gw-chat-in { animation: gw-chat-rise .28s ease-out both; }
@keyframes gw-chat-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.gw-chat__thread::-webkit-scrollbar { width: 8px; }
.gw-chat__thread::-webkit-scrollbar-thumb { background: var(--fs-hairline); border-radius: 999px; }

/* chips "Conhecida por" (H2H): rolam quando passam da altura — o card não estica.
   Tooltip do chip precisa escapar do overflow: por isso o hover eleva o z-index. */
.gw-known-scroll { scrollbar-width: thin; scrollbar-color: var(--fs-hairline) transparent; }
.gw-known-scroll::-webkit-scrollbar { width: 7px; }
.gw-known-scroll::-webkit-scrollbar-thumb { background: var(--fs-hairline); border-radius: 999px; }
.gw-known-scroll::-webkit-scrollbar-track { background: transparent; }
.gw-chat__send {
  width: 38px; height: 38px; flex: none; border: 0; border-radius: 11px;
  cursor: not-allowed; display: inline-flex; align-items: center; justify-content: center;
  background: var(--fs-surface-soft); color: var(--fs-gray-400); transition: background .15s;
}
.gw-chat__send.is-ready { cursor: pointer; background: var(--fs-yellow, #FFD910); color: var(--fs-on-yellow, var(--fs-ink)); }
.gw-chat-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--fs-gray-400);
  animation: gw-chat-dotp 1s infinite;
}
@keyframes gw-chat-dotp { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .gw-chat.is-open, .gw-chat-in { animation: none; }
  .gw-chat-dot { animation: none; }
  .gw-chat-fab { transition: none; }
}
@media (max-width: 640px) {
  .gw-chat-fab { right: 14px; bottom: 14px; height: 46px; font-size: 13px; }
  .gw-chat { width: 100vw; max-width: 100vw; }
}
