:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-hover: #222222;
  --border: #2a2a2a;
  --text: #e5e5e5;
  --text-muted: #888888;
  --yellow: #facc15;
  --yellow-dim: rgba(250, 204, 21, 0.12);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --orange: #f97316;
  --orange-dim: rgba(249, 115, 22, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --sidebar-width: 260px;
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand { padding: 24px 20px 16px; border-bottom: 1px solid var(--border); }
.brand-logo { display: flex; align-items: center; gap: 12px; }

.brand-icon {
  width: 40px; height: 40px;
  background: var(--yellow);
  color: #0f0f0f;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.sidebar-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text-muted); padding: 20px 20px 8px; text-transform: uppercase;
}

.nav-list { list-style: none; padding: 0 12px; flex: 1; }

.nav-item a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-item a:hover { background: var(--surface-hover); color: var(--text); }
.nav-item a.active { background: var(--yellow-dim); color: var(--yellow); }
.nav-icon { width: 18px; text-align: center; font-size: 14px; opacity: 0.7; }

.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted);
}

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px;
  max-width: 1200px;
}

.page-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--yellow);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 20px; padding: 4px 12px; margin-bottom: 16px;
}

.page-badge::before {
  content: ''; width: 6px; height: 6px;
  background: var(--yellow); border-radius: 50%;
}

.page-title { font-size: 32px; font-weight: 700; margin-bottom: 6px; }
.page-title span { color: var(--yellow); }
.page-subtitle { font-size: 15px; color: var(--text-muted); margin-bottom: 32px; }
.page-subtitle a { color: var(--yellow); text-decoration: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
}

.card-title { font-size: 22px; font-weight: 700; color: var(--yellow); margin-bottom: 6px; }
.card-meta { font-size: 13px; color: var(--text-muted); }
.card-text { font-size: 14px; margin-top: 12px; line-height: 1.7; }

.hero-card {
  margin-bottom: 32px;
  background: linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
}

.section-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 16px; margin-top: 8px;
}

.policy-alert {
  background: var(--orange-dim);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.7;
}

.policy-alert strong { color: var(--orange); }

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.analysis-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.analysis-item h4 {
  font-size: 12px; font-weight: 600; color: var(--yellow);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em;
}

.analysis-item p, .analysis-item ul {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
}

.analysis-item ul { padding-left: 16px; margin-top: 4px; }
.analysis-item li { margin-bottom: 4px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
}

.summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 197, 94, 0.4);
}

.summary-status {
  position: absolute; top: 16px; right: 16px;
  width: 8px; height: 8px;
  background: var(--green); border-radius: 50%;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.summary-icon { font-size: 20px; margin-bottom: 10px; opacity: 0.8; }
.summary-step { font-size: 11px; color: var(--green); font-weight: 600; margin-bottom: 4px; }
.summary-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.summary-desc { font-size: 12px; color: var(--text-muted); }
.summary-value { font-size: 28px; font-weight: 700; color: var(--yellow); margin-top: 8px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text);
}

.tag.negative { border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.tag.group { border-color: rgba(250, 204, 21, 0.3); color: var(--yellow); }

.tag.tag-phrase {
  border-color: rgba(96, 165, 250, 0.35);
  padding-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag.tag-phrase.long-tail {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.tag.tag-phrase.tier-pilar {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.06);
}

.tag.tag-phrase.tier-nucleo {
  border-color: rgba(96, 165, 250, 0.35);
}

.tag.tag-phrase.tier-cauda {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.tag.tag-phrase.tier-risco {
  border-color: rgba(251, 146, 60, 0.55);
  background: rgba(251, 146, 60, 0.1);
}

.tag.tag-phrase.tier-pilar .tier-badge,
.tag.tag-phrase.tier-pilar .match-badge {
  background: rgba(250, 204, 21, 0.2);
  color: #fde047;
}

.tag.tag-phrase.tier-nucleo .tier-badge,
.tag.tag-phrase.tier-nucleo .match-badge {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

.tag.tag-phrase.tier-cauda .tier-badge,
.tag.tag-phrase.tier-cauda .match-badge {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

.tag.tag-phrase.tier-risco .tier-badge,
.tag.tag-phrase.tier-risco .match-badge {
  background: rgba(251, 146, 60, 0.22);
  color: #fdba74;
}

.tier-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.tier-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tier-dot.tier-pilar { background: #fde047; }
.tier-dot.tier-nucleo { background: #93c5fd; }
.tier-dot.tier-cauda { background: #6ee7b7; }
.tier-dot.tier-risco { background: #fdba74; }

.tier-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
}

.tier-chip.tier-pilar { background: rgba(250, 204, 21, 0.15); color: #fde047; }
.tier-chip.tier-nucleo { background: rgba(96, 165, 250, 0.12); color: #93c5fd; }
.tier-chip.tier-cauda { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; }
.tier-chip.tier-risco { background: rgba(251, 146, 60, 0.18); color: #fdba74; }

.row-kw-risk td { background: rgba(251, 146, 60, 0.06); }

.kw-mix-bars { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.kw-mix-row { display: grid; grid-template-columns: 72px 1fr 40px; align-items: center; gap: 10px; font-size: 12px; }
.kw-mix-label.tier-pilar { color: #fde047; }
.kw-mix-label.tier-nucleo { color: #93c5fd; }
.kw-mix-label.tier-cauda { color: #6ee7b7; }
.kw-mix-label.tier-risco { color: #fdba74; }
.kw-mix-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.kw-mix-fill { height: 100%; border-radius: 3px; }
.kw-mix-fill.tier-pilar { background: linear-gradient(90deg, #ca8a04, #fde047); }
.kw-mix-fill.tier-nucleo { background: linear-gradient(90deg, #2563eb, #93c5fd); }
.kw-mix-fill.tier-cauda { background: linear-gradient(90deg, #059669, #6ee7b7); }
.kw-mix-fill.tier-risco { background: linear-gradient(90deg, #ea580c, #fdba74); }
.kw-mix-pct { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.kw-quality-alert {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  border: 1px solid var(--border);
  line-height: 1.45;
}
.kw-quality-alert.ok { border-color: rgba(52, 211, 153, 0.35); color: #6ee7b7; background: rgba(16, 185, 129, 0.06); }
.kw-quality-alert.warn { border-color: rgba(250, 204, 21, 0.35); color: #fde68a; background: rgba(250, 204, 21, 0.06); }
.kw-quality-alert.error { border-color: rgba(251, 146, 60, 0.4); color: #fdba74; background: rgba(251, 146, 60, 0.08); }

.tier-inline.pilar { color: #fde047; }
.tier-inline.nucleo { color: #93c5fd; }
.tier-inline.cauda { color: #6ee7b7; }
.tier-inline.risco { color: #fdba74; }

.tier-note {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-left: 6px;
}

.match-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
  flex-shrink: 0;
}

.tag.tag-phrase.long-tail .match-badge {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

.match-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
}

.group-kw-meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 8px;
}

.keyword-policy-card .policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.policy-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.policy-item strong {
  display: block;
  margin-top: 4px;
  color: var(--yellow);
  font-size: 14px;
}

.compliance-list { display: flex; flex-direction: column; gap: 10px; }

.compliance-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
}

.status-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}

.status-badge.ok { background: var(--green-dim); color: var(--green); }
.status-badge.warn { background: var(--orange-dim); color: var(--orange); }
.status-badge.risk { background: var(--red-dim); color: var(--red); }

.compliance-text { color: var(--text-muted); line-height: 1.5; }
.compliance-text strong { color: var(--text); display: block; margin-bottom: 2px; }

.ad-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.ad-card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.ad-card-title { font-size: 16px; font-weight: 700; }

.ad-badge {
  font-size: 11px; font-weight: 600; color: var(--yellow);
  background: var(--yellow-dim);
  padding: 4px 10px; border-radius: 20px;
}

.ad-group-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 10px; margin-top: 16px;
}

.ad-group-label:first-of-type { margin-top: 0; }

.headlines-list, .descriptions-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.headline-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}

.headline-tag .char-count {
  font-size: 10px; color: var(--text-muted);
  background: var(--surface); padding: 2px 6px; border-radius: 4px;
}

.description-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  width: 100%;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}

.description-tag .char-count {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}

/* Preview Google Search */
.ad-preview-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.ad-preview-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 16px;
}

.ad-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ad-preview-wrap { display: flex; flex-direction: column; gap: 8px; }

.ad-preview-variant {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ad-preview-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  min-height: 120px;
}

.ad-preview-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ad-preview-badge {
  font-size: 12px;
  font-weight: 700;
  color: #202124;
}

.ad-preview-url {
  font-size: 13px;
  color: #3c4043;
  margin-bottom: 6px;
  line-height: 1.3;
}

.ad-preview-headline {
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 8px;
  font-weight: 400;
}

.ad-preview-headline > span {
  color: #1a0dab;
  cursor: default;
}

.ad-preview-headline > span:hover { text-decoration: underline; }

.ad-preview-sep {
  color: #1a0dab;
  font-weight: 400;
}

.ad-preview-desc {
  font-size: 14px;
  color: #4d5156;
  line-height: 1.55;
}

.ad-preview-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.5;
}

.estimates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.estimate-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.estimate-box .label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.estimate-box .value { font-size: 20px; font-weight: 700; color: var(--yellow); }

/* Exportação */
.export-card { border-color: rgba(250, 204, 21, 0.25); }

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow);
  color: #0f0f0f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-export:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-export:disabled { opacity: 0.5; cursor: wait; transform: none; }

.btn-export-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}

.export-files {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.export-file-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, color 0.2s;
}

.export-file-btn:hover {
  border-color: rgba(250, 204, 21, 0.4);
  color: var(--yellow);
}

.export-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.export-final-url {
  padding: 10px 14px;
  background: rgba(250, 204, 21, 0.06);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 8px;
}

.export-final-url a {
  color: var(--yellow);
  font-weight: 600;
  word-break: break-all;
}

.rsa-import-notice {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.rsa-import-notice strong {
  color: #93c5fd;
  display: block;
  margin-bottom: 6px;
}

.rsa-import-notice code {
  color: var(--yellow);
  font-size: 12px;
}

.rsa-steps {
  margin: 10px 0 8px 18px;
  padding: 0;
  color: #e2e8f0;
}

.rsa-steps li {
  margin-bottom: 6px;
}

.rsa-steps-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.export-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.export-meta span strong,
.export-stats-row span strong { color: var(--yellow); }

/* Rodapé global */
.site-footer {
  margin-top: 48px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer strong {
  color: var(--yellow);
  font-weight: 600;
}

.hub-body {
  padding: 48px 24px 0;
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hub-body .project-list {
  flex: 1;
  width: 100%;
  align-content: start;
}

.hub-body .site-footer {
  margin-top: auto;
  padding-top: 40px;
}

.hub-header {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hub-toolbar {
  width: 100%;
  max-width: 560px;
  margin: 0 auto 20px;
}

.hub-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.hub-search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.hub-search-input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hub-search-input::placeholder {
  color: var(--text-muted);
}

.hub-search-input:hover {
  border-color: rgba(250, 204, 21, 0.25);
}

.hub-search-input:focus {
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.08);
}

.hub-search-input::-webkit-search-cancel-button {
  display: none;
}

.hub-search-clear {
  position: absolute;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.hub-search-clear:hover {
  color: var(--yellow);
  background: var(--yellow-dim);
}

.hub-results-meta {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  min-height: 18px;
}

.hub-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px auto 0;
  padding-bottom: 8px;
}

.hub-page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--yellow);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.hub-page-btn:hover:not(:disabled) {
  border-color: rgba(250, 204, 21, 0.45);
  background: var(--yellow-dim);
}

.hub-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hub-page-nums {
  display: flex;
  gap: 4px;
}

.hub-page-num {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.hub-page-num:hover {
  border-color: rgba(250, 204, 21, 0.35);
  color: var(--text);
}

.hub-page-num.is-active {
  border-color: rgba(250, 204, 21, 0.55);
  background: var(--yellow-dim);
  color: var(--yellow);
}

.hub-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.hub-empty-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.hub-empty-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.hub-loading,
.hub-error {
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

.hub-error {
  color: #fca5a5;
}

.hub-header .page-badge {
  display: inline-flex;
  margin-bottom: 16px;
}

.hub-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.hub-header h1 { font-size: 28px; margin: 0; }
.hub-header h1 span { color: var(--yellow); }
.hub-header p { color: var(--text-muted); font-size: 14px; }

.hub-info-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--yellow);
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 50%;
  background: var(--yellow-dim);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.hub-info-link:hover {
  border-color: var(--yellow);
  background: rgba(250, 204, 21, 0.2);
  transform: scale(1.06);
}

.hub-info-link svg { display: block; }

.project-list {
  display: grid;
  gap: 8px;
  align-content: start;
  grid-auto-rows: min-content;
}

.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  min-height: 0;
  height: auto;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}

.project-card:hover {
  border-color: rgba(250, 204, 21, 0.4);
  transform: translateY(-2px);
}

.project-info { min-width: 0; }

.project-info h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.25;
}

.project-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

.project-arrow {
  color: var(--yellow);
  font-size: 16px;
  flex-shrink: 0;
  margin-left: 12px;
}

/* —— Página metodológica (como-funciona.html) —— */
.hub-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hub-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color 0.2s, color 0.2s;
}

.hub-nav a:hover { color: var(--text); border-color: var(--text-muted); }
.hub-nav a.active { color: var(--yellow); border-color: rgba(250, 204, 21, 0.4); background: var(--yellow-dim); }

.doc-content { text-align: left; }

.doc-intro {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 28px;
}

.doc-content .card { margin-bottom: 16px; }
.doc-content .card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.doc-content .card h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--yellow);
}
.doc-content .card p,
.doc-content .card li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.doc-content .card ul,
.doc-content .card ol {
  padding-left: 20px;
  margin: 8px 0;
}
.doc-content .card li { margin-bottom: 6px; }
.doc-content .card li strong { color: var(--text); }

.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.flow-step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  position: relative;
}

.flow-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--yellow);
  color: #0f0f0f;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 8px;
}

.flow-step strong {
  display: block;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
}

.flow-step span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.source-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.source-item h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.source-item p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

.config-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.config-table th,
.config-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.config-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg);
}

.config-table td:first-child {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--yellow);
  white-space: nowrap;
}

.config-table td:last-child { color: var(--text-muted); }

.doc-callout {
  background: var(--yellow-dim);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.doc-callout strong { color: var(--yellow); }

.export-order {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.export-order-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
}

.export-order-row code {
  font-size: 11px;
  color: var(--yellow);
  min-width: 200px;
}

.export-order-row span { color: var(--text-muted); font-size: 12px; }

.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--yellow);
  text-decoration: none;
}

.doc-back:hover { text-decoration: underline; }

.intent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.intent-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.intent-card .intent-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.intent-trans .intent-label { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.intent-local .intent-label { background: rgba(96, 165, 250, 0.15); color: #93c5fd; }
.intent-com .intent-label { background: rgba(250, 204, 21, 0.15); color: var(--yellow); }
.intent-urg .intent-label { background: rgba(249, 115, 22, 0.15); color: var(--orange); }

.intent-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

.intent-card em { color: var(--text); font-style: normal; }

.kw-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  padding: 16px;
  background: var(--bg);
  border: 1px dashed rgba(250, 204, 21, 0.35);
  border-radius: var(--radius-sm);
}

.kw-block {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.kw-plus {
  color: var(--yellow);
  font-weight: 700;
  font-size: 18px;
}

.kw-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.kw-bad, .kw-good {
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 13px;
}

.kw-bad {
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.kw-good {
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.kw-bad h4, .kw-good h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.kw-bad h4 { color: #fca5a5; }
.kw-good h4 { color: var(--green); }

.kw-bad ul, .kw-good ul {
  padding-left: 18px;
  margin: 0 0 10px;
}

.kw-bad li { color: #fca5a5; font-family: ui-monospace, monospace; font-size: 11px; margin-bottom: 4px; }
.kw-good li { color: #86efac; font-family: ui-monospace, monospace; font-size: 11px; margin-bottom: 4px; }

.kw-bad p, .kw-good p {
  font-size: 11px;
  margin: 0;
  color: var(--text-muted);
}

.doc-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 11px;
  line-height: 1.6;
  color: #86efac;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  overflow-x: auto;
  margin: 12px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.menu-toggle {
  display: none;
  position: fixed; top: 16px; left: 16px; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); width: 40px; height: 40px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 18px;
}

@media (max-width: 900px) {
  .summary-grid, .analysis-grid { grid-template-columns: repeat(2, 1fr); }
  .estimates-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 24px 20px; padding-top: 72px; }
  .summary-grid, .analysis-grid, .estimates-grid, .export-files { grid-template-columns: 1fr; }
  .ad-preview-grid { grid-template-columns: 1fr; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .page-title { font-size: 24px; }
  .relevance-row { grid-template-columns: 1fr; }
  .seg-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 11px; }
}

/* ── Seções avançadas ── */
.muted-intro { margin-top: 0; color: var(--text-muted); font-size: 13px; }
.muted-intro strong { color: var(--yellow); }

.table-wrap { overflow-x: auto; margin-top: 12px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.intent-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--yellow-dim);
  color: var(--yellow);
  white-space: nowrap;
}

.priority-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-high { background: var(--green-dim); color: var(--green); }
.priority-med { background: var(--yellow-dim); color: var(--yellow); }
.priority-low { background: var(--bg); color: var(--text-muted); }

.relevance-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.relevance-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
}

.relevance-col .mini-label, .mini-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.url-col a { color: var(--yellow); font-size: 11px; word-break: break-all; text-decoration: none; }
.url-col a:hover { text-decoration: underline; }

.budget-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.budget-row {
  display: grid;
  grid-template-columns: 1fr 120px 80px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.budget-info { display: flex; flex-direction: column; gap: 2px; }
.budget-info span { font-size: 11px; color: var(--text-muted); }

.budget-bar-wrap {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.budget-bar {
  height: 100%;
  background: var(--yellow);
  border-radius: 3px;
  min-width: 4px;
}

.budget-values { text-align: right; font-size: 12px; }
.budget-pct { color: var(--yellow); font-weight: 700; display: block; }
.budget-amt { color: var(--text-muted); font-size: 11px; }

.seg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.seg-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 13px;
}

.seg-item h4 {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.seg-item ul { padding-left: 16px; color: var(--text-muted); }
.seg-item li { margin-bottom: 4px; }
.seg-note { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

.ext-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.ext-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
}

.ext-url { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.ext-desc { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ext-contact { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--text-muted); }

.tracking-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.tracking-row {
  display: flex;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
}

.check { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.check.done { background: var(--green-dim); color: var(--green); }
.check.pending { background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }

.tracking-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
}

.status-ok, .status-concluído, .status-concluido { background: var(--green-dim); color: var(--green); }
.status-pendente { background: var(--orange-dim); color: var(--orange); }

.tracking-row p { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.objection-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.objection-row {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  display: grid;
  gap: 10px;
}

.objection-q { color: var(--text); }
.objection-a { color: var(--yellow); }
.objection-l { color: var(--text-muted); font-size: 12px; }

.utm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.utm-grid code {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--yellow);
}

.utm-example {
  display: block;
  margin-top: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  word-break: break-all;
  color: var(--text-muted);
}

.export-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.export-mode label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
}

.export-mode input:checked + span { color: var(--yellow); }

.validation-list {
  margin-top: 12px;
  font-size: 12px;
}

.validation-ok { color: var(--green); }
.validation-warn { color: var(--orange); }
.validation-error { color: var(--red); }

/* —— Analisador de KW (analisador-kw.html) —— */
.hub-tools {
  margin: -12px auto 24px;
}

.hub-nav-btn-new {
  font-size: 13px;
  font-weight: 600;
  color: #0f0f0f;
  background: var(--yellow);
  border: 1px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.hub-nav-btn-new:hover {
  background: #e5b800;
  transform: translateY(-1px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  padding: 28px 32px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }

.modal-field {
  margin-bottom: 18px;
}
.modal-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.modal-field input {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-field input:focus {
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.08);
}
.modal-field input::placeholder { color: var(--text-muted); }
.modal-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-btn-generate {
  width: 100%;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #0f0f0f;
  background: var(--yellow);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}
.modal-btn-generate:hover { background: #e5b800; }

.modal-result {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.modal-result[hidden] { display: none; }
.modal-result label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal-result textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
}
.modal-result textarea:focus {
  border-color: rgba(250, 204, 21, 0.4);
}
.modal-btn-copy {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--yellow);
  background: var(--yellow-dim);
  border: 1px solid rgba(250, 204, 21, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.modal-btn-copy:hover {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(250, 204, 21, 0.45);
}
.modal-copy-feedback {
  text-align: center;
  font-size: 12px;
  color: var(--green);
  margin-top: 8px;
}
.modal-copy-feedback[hidden] { display: none; }

.kw-analyzer-page {
  max-width: 820px;
}

.kw-analyzer-nav {
  margin-bottom: 8px;
}

.kw-analyzer-legend {
  justify-content: center;
  margin-bottom: 24px;
}

.kw-analyzer-input-card {
  margin-bottom: 24px;
}

.kw-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.kw-mode-tab {
  flex: 1;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.kw-mode-tab:hover {
  border-color: rgba(250, 204, 21, 0.3);
  color: var(--text);
}

.kw-mode-tab.is-active {
  border-color: rgba(250, 204, 21, 0.5);
  background: var(--yellow-dim);
  color: var(--yellow);
}

.kw-textarea-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kw-textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kw-textarea:focus {
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.08);
}

.kw-select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

.kw-select:focus {
  border-color: rgba(250, 204, 21, 0.5);
}

.kw-textarea-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.kw-analyzer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.kw-primary-btn {
  padding: 10px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #0a0a0a;
  background: var(--yellow);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.kw-primary-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.kw-primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.kw-secondary-btn {
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.kw-secondary-btn:hover {
  border-color: rgba(250, 204, 21, 0.35);
  color: var(--text);
}

.kw-analyzer-empty {
  margin-bottom: 24px;
}

.kw-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.kw-result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kw-result-header h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.kw-result-source {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.kw-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-action-btn {
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}

.kw-action-btn:hover:not(:disabled) {
  border-color: rgba(250, 204, 21, 0.4);
}

.kw-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.kw-action-risk {
  border-color: rgba(251, 146, 60, 0.35);
  color: #fdba74;
}

.kw-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 640px) {
  .kw-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.kw-stat-card {
  padding: 16px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.kw-stat-card.tier-pilar { border-color: rgba(250, 204, 21, 0.3); }
.kw-stat-card.tier-nucleo { border-color: rgba(96, 165, 250, 0.3); }
.kw-stat-card.tier-cauda { border-color: rgba(52, 211, 153, 0.3); }
.kw-stat-card.tier-risco { border-color: rgba(251, 146, 60, 0.35); }

.kw-stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.kw-stat-card.tier-pilar .kw-stat-value { color: #fde047; }
.kw-stat-card.tier-nucleo .kw-stat-value { color: #93c5fd; }
.kw-stat-card.tier-cauda .kw-stat-value { color: #6ee7b7; }
.kw-stat-card.tier-risco .kw-stat-value { color: #fdba74; }

.kw-stat-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.kw-stat-hint {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.kw-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.kw-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.kw-filter-chip span {
  font-size: 11px;
  opacity: 0.8;
}

.kw-filter-chip.is-active {
  color: var(--yellow);
  border-color: rgba(250, 204, 21, 0.45);
  background: var(--yellow-dim);
}

.kw-filter-chip.tier-pilar.is-active { color: #fde047; border-color: rgba(250, 204, 21, 0.5); }
.kw-filter-chip.tier-nucleo.is-active { color: #93c5fd; border-color: rgba(96, 165, 250, 0.45); }
.kw-filter-chip.tier-cauda.is-active { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.45); }
.kw-filter-chip.tier-risco.is-active { color: #fdba74; border-color: rgba(251, 146, 60, 0.45); }

.kw-analyzer-table .kw-num {
  width: 36px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.kw-table-empty {
  margin: 0;
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.kw-group-grid {
  display: grid;
  gap: 10px;
}

.kw-group-card {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.kw-group-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.kw-group-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11px;
  margin-bottom: 10px;
}

.kw-group-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 6px;
}

.kw-group-seg {
  display: block;
  height: 100%;
  min-width: 2px;
}

.kw-group-seg.tier-pilar { background: #fde047; }
.kw-group-seg.tier-nucleo { background: #93c5fd; }
.kw-group-seg.tier-cauda { background: #6ee7b7; }
.kw-group-seg.tier-risco { background: #fdba74; }

.kw-group-total {
  font-size: 11px;
  color: var(--text-muted);
}

/* —— Guia de camadas (analisador-kw.html) —— */
.kw-guide-card {
  margin-bottom: 20px;
  padding: 0;
  overflow: hidden;
}

.kw-guide-card[open] .kw-guide-chevron {
  transform: rotate(180deg);
}

.kw-guide-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--yellow);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.kw-guide-summary::-webkit-details-marker {
  display: none;
}

.kw-guide-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.kw-guide-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

.kw-guide-intro {
  margin: 16px 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.kw-guide-intro strong {
  color: var(--text);
}

.kw-tier-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .kw-tier-grid { grid-template-columns: 1fr; }
}

.kw-tier-card {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.kw-tier-card.tier-pilar { border-color: rgba(250, 204, 21, 0.25); }
.kw-tier-card.tier-nucleo { border-color: rgba(96, 165, 250, 0.25); }
.kw-tier-card.tier-cauda { border-color: rgba(52, 211, 153, 0.25); }
.kw-tier-card.tier-risco { border-color: rgba(251, 146, 60, 0.3); }

.kw-tier-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.kw-tier-words {
  font-size: 11px;
  color: var(--text-muted);
}

.kw-tier-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text);
}

.kw-tier-card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.kw-tier-card ul {
  margin: 0 0 10px;
  padding-left: 0;
  list-style: none;
}

.kw-tier-card li {
  margin-bottom: 6px;
  font-size: 12px;
}

.kw-tier-card code {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
}

.kw-tier-bad code {
  border-left: 2px solid #fdba74;
}

.kw-tier-note {
  margin: 0 !important;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12px !important;
  font-style: italic;
}

.kw-guide-mix {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.kw-guide-mix h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.kw-guide-mix-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
  font-size: 10px;
  font-weight: 700;
}

.kw-mix-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
  white-space: nowrap;
  overflow: hidden;
}

.kw-mix-seg.tier-pilar { background: #fde047; }
.kw-mix-seg.tier-nucleo { background: #93c5fd; }
.kw-mix-seg.tier-cauda { background: #6ee7b7; }

.kw-guide-mix p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.kw-guide-mix strong {
  color: var(--text);
}

/* —— Validador RSA (validador-rsa.html) —— */
.rsa-validator-page {
  max-width: 860px;
}

.rsa-limits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .rsa-limits-grid { grid-template-columns: 1fr; }
}

.rsa-limit-card {
  padding: 16px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.rsa-limit-num {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--yellow);
  line-height: 1;
  margin-bottom: 8px;
}

.rsa-limit-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.rsa-limit-card p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.rsa-niche-row {
  margin-bottom: 16px;
}

.rsa-niche-select {
  max-width: 100%;
}

.rsa-dual-input {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 700px) {
  .rsa-dual-input { grid-template-columns: 1fr; }
}

.rsa-textarea {
  min-height: 180px;
  font-family: inherit;
}

.rsa-url-block {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.rsa-url-block-title {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
}

.rsa-optional,
.rsa-char-hint {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  font-size: 10px;
}

.rsa-field {
  margin-bottom: 12px;
}

.rsa-field:last-child {
  margin-bottom: 0;
}

.rsa-field-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rsa-field-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.rsa-field-input:hover {
  border-color: rgba(250, 204, 21, 0.25);
}

.rsa-field-input:focus {
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.08);
}

.rsa-field-input:-webkit-autofill,
.rsa-field-input:-webkit-autofill:hover,
.rsa-field-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

.rsa-path-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .rsa-path-row { grid-template-columns: 1fr; }
}

.rsa-field-path {
  margin-bottom: 0;
}

.rsa-path-wrap {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rsa-path-wrap:focus-within {
  border-color: rgba(250, 204, 21, 0.5);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.08);
}

.rsa-path-prefix {
  display: flex;
  align-items: center;
  padding: 0 4px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  user-select: none;
}

.rsa-path-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  flex: 1;
  min-width: 0;
}

.rsa-path-input:focus {
  box-shadow: none !important;
}

.rsa-url-preview {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 12px;
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: var(--radius-sm);
  word-break: break-all;
  line-height: 1.4;
}

.rsa-url-preview:empty {
  display: none;
}

.rsa-url-preview::before {
  content: 'Exibido no Google: ';
  color: var(--text-muted);
  font-weight: 600;
}

.rsa-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.rsa-summary h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.rsa-summary p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.rsa-summary-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.rsa-status-ok {
  border-color: rgba(52, 211, 153, 0.4);
}
.rsa-status-ok .rsa-summary-icon {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}
.rsa-status-ok h2 { color: #6ee7b7; }

.rsa-status-warn {
  border-color: rgba(250, 204, 21, 0.4);
}
.rsa-status-warn .rsa-summary-icon {
  background: rgba(250, 204, 21, 0.15);
  color: #fde047;
}
.rsa-status-warn h2 { color: #fde047; }

.rsa-status-error {
  border-color: rgba(239, 68, 68, 0.4);
}
.rsa-status-error .rsa-summary-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}
.rsa-status-error h2 { color: #fca5a5; }

.rsa-char-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}

.rsa-char-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.rsa-char-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.2s;
}

.rsa-char-fill.status-ok { background: #6ee7b7; }
.rsa-char-fill.status-warn { background: #fde047; }
.rsa-char-fill.status-error { background: #f87171; }

.rsa-char-count {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rsa-char-count.status-ok { color: #6ee7b7; }
.rsa-char-count.status-warn { color: #fde047; }
.rsa-char-count.status-error { color: #fca5a5; }

.rsa-char-max {
  font-weight: 500;
  opacity: 0.6;
}

.rsa-row.status-error td {
  background: rgba(239, 68, 68, 0.05);
}

.rsa-row.status-warn td {
  background: rgba(250, 204, 21, 0.04);
}

.rsa-issues-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rsa-issue {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.45;
}

.rsa-issue strong {
  display: block;
  margin: 4px 0;
  color: var(--text);
}

.rsa-issue-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rsa-issue-text {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.rsa-issue-alt {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6ee7b7;
}

.rsa-issue-error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}

.rsa-issue-warn {
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.05);
}

.rsa-results .ad-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

