/* ============================================================
   RankBox — Design System
   rankbox.com.br | Uma iniciativa da RankRider
   Fonte: DM Sans + DM Mono (Google Fonts)
   Tema: Dark mode padrão com suporte a light mode
   ============================================================ */

/* ------------------------------------------------------------
   IMPORTS
------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ------------------------------------------------------------
   TOKENS — DARK MODE (padrão)
------------------------------------------------------------ */
:root {
  /* Cor de destaque */
  --accent:          #4ade80;
  --accent-dark:     #16a34a;
  --accent-dim:      rgba(74, 222, 128, 0.12);
  --accent-glow:     rgba(74, 222, 128, 0.22);
  --accent-text:     #0a1a0f;

  /* Backgrounds */
  --bg:              #0e0f11;
  --surface:         #16181c;
  --surface-2:       #1e2127;
  --surface-3:       #252830;

  /* Bordas */
  --border:          rgba(255, 255, 255, 0.07);
  --border-md:       rgba(255, 255, 255, 0.12);
  --border-lg:       rgba(255, 255, 255, 0.18);

  /* Textos */
  --text:            #f0f0ee;
  --text-2:          #9a9da6;
  --text-3:          #5c5f6a;
  --text-4:          #3a3d46;

  /* Semânticas */
  --red:             #f87171;
  --red-dim:         rgba(248, 113, 113, 0.12);
  --amber:           #fbbf24;
  --amber-dim:       rgba(251, 191, 36, 0.12);
  --blue:            #60a5fa;
  --blue-dim:        rgba(96, 165, 250, 0.12);
  --purple:          #a78bfa;
  --purple-dim:      rgba(167, 139, 250, 0.12);

  /* Tipografia */
  --font-sans:       'DM Sans', system-ui, sans-serif;
  --font-mono:       'DM Mono', 'Courier New', monospace;

  /* Espaçamentos */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Raios */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Layout */
  --container:      860px;
  --container-wide: 1100px;
  --header-h:       56px;

  /* Transições */
  --ease:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ease-out:   cubic-bezier(0, 0, 0.2, 1);
  --duration:   0.18s;
}

/* Light mode */
@media (prefers-color-scheme: light) {
  :root {
    --accent:      #16a34a;
    --accent-dark: #15803d;
    --accent-dim:  rgba(22, 163, 74, 0.1);
    --accent-glow: rgba(22, 163, 74, 0.18);
    --accent-text: #ffffff;

    --bg:          #f4f5f7;
    --surface:     #ffffff;
    --surface-2:   #f0f1f3;
    --surface-3:   #e8e9ec;

    --border:      rgba(0, 0, 0, 0.07);
    --border-md:   rgba(0, 0, 0, 0.12);
    --border-lg:   rgba(0, 0, 0, 0.18);

    --text:   #0e0f11;
    --text-2: #555860;
    --text-3: #9a9da6;
    --text-4: #c8cad0;

    --red-dim:    rgba(220, 38, 38, 0.08);
    --amber-dim:  rgba(180, 117, 23, 0.08);
    --blue-dim:   rgba(37, 99, 235, 0.08);
    --purple-dim: rgba(124, 58, 237, 0.08);
  }
}

/* Classe manual para forçar light/dark */
[data-theme="light"] {
  --accent:      #16a34a;
  --accent-dark: #15803d;
  --accent-dim:  rgba(22, 163, 74, 0.1);
  --accent-glow: rgba(22, 163, 74, 0.18);
  --accent-text: #ffffff;
  --bg:          #f4f5f7;
  --surface:     #ffffff;
  --surface-2:   #f0f1f3;
  --surface-3:   #e8e9ec;
  --border:      rgba(0, 0, 0, 0.07);
  --border-md:   rgba(0, 0, 0, 0.12);
  --border-lg:   rgba(0, 0, 0, 0.18);
  --text:   #0e0f11;
  --text-2: #555860;
  --text-3: #9a9da6;
  --text-4: #c8cad0;
}

[data-theme="dark"] {
  --accent:      #4ade80;
  --accent-dark: #16a34a;
  --accent-dim:  rgba(74, 222, 128, 0.12);
  --accent-glow: rgba(74, 222, 128, 0.22);
  --accent-text: #0a1a0f;
  --bg:          #0e0f11;
  --surface:     #16181c;
  --surface-2:   #1e2127;
  --surface-3:   #252830;
  --border:      rgba(255, 255, 255, 0.07);
  --border-md:   rgba(255, 255, 255, 0.12);
  --border-lg:   rgba(255, 255, 255, 0.18);
  --text:   #f0f0ee;
  --text-2: #9a9da6;
  --text-3: #5c5f6a;
  --text-4: #3a3d46;
}

/* ------------------------------------------------------------
   BASE
------------------------------------------------------------ */
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
  padding-top: var(--header-h);
}

/* ------------------------------------------------------------
   TIPOGRAFIA
------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-2); }
.text-dim     { color: var(--text-3); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.text-lg      { font-size: 16px; }
.font-medium  { font-weight: 500; }

/* ------------------------------------------------------------
   LAYOUT
------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--space-12) 0;
}

.section-sm {
  padding: var(--space-8) 0;
}

/* Grid utilitário */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }

/* ------------------------------------------------------------
   HEADER
------------------------------------------------------------ */
.rb-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.rb-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-5);
  gap: var(--space-6);
}

/* Logo */
.rb-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  text-decoration: none;
}

.rb-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity var(--duration) var(--ease);
}

.rb-logo-icon:hover { opacity: 0.85; }

.rb-logo-icon svg {
  width: 16px;
  height: 16px;
}

.rb-logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
}

.rb-logo-text span {
  color: var(--accent);
}

/* Navegação principal */
.rb-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}

.rb-nav-link {
  font-size: 13px;
  color: var(--text-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--duration) var(--ease),
              background var(--duration) var(--ease);
  white-space: nowrap;
}

.rb-nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.rb-nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Ações do header */
.rb-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Seletor de idioma PT/EN */
.rb-lang {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.rb-lang-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  letter-spacing: 0.04em;
}

.rb-lang-btn:hover { color: var(--text-2); }

.rb-lang-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Toggle dark/light */
.rb-theme-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
}

.rb-theme-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-md);
}

/* Menu mobile */
.rb-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.rb-menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: all var(--duration) var(--ease);
}

/* Drawer mobile */
.rb-drawer {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  z-index: 99;
  flex-direction: column;
  gap: var(--space-1);
}

.rb-drawer.open {
  display: flex;
}

.rb-drawer .rb-nav-link {
  padding: var(--space-3) var(--space-3);
}

/* ------------------------------------------------------------
   FOOTER
------------------------------------------------------------ */
.rb-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-16);
}

.rb-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.rb-footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.rb-footer-tagline {
  font-size: 12px;
  color: var(--text-3);
}

.rb-footer-rankrider {
  font-size: 12px;
  color: var(--text-3);
  transition: color var(--duration) var(--ease);
}

.rb-footer-rankrider:hover { color: var(--accent); }

.rb-footer-links {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.rb-footer-link {
  font-size: 12px;
  color: var(--text-3);
  transition: color var(--duration) var(--ease);
}

.rb-footer-link:hover { color: var(--text-2); }

.rb-footer-copy {
  font-size: 11px;
  color: var(--text-4);
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------
   HERO DA FERRAMENTA
------------------------------------------------------------ */
.rb-tool-hero {
  padding: var(--space-10) 0 var(--space-8);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-8);
}

.rb-tool-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(74, 222, 128, 0.2);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
  letter-spacing: 0.03em;
}

[data-theme="light"] .rb-tool-badge,
@media (prefers-color-scheme: light) {
  .rb-tool-badge {
    border-color: rgba(22, 163, 74, 0.25);
  }
}

.rb-tool-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.rb-tool-hero h1 {
  margin-bottom: var(--space-3);
}

.rb-tool-hero p {
  font-size: 15px;
  max-width: 520px;
}

/* ------------------------------------------------------------
   CARDS DE FERRAMENTA (home)
------------------------------------------------------------ */
.rb-tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-decoration: none;
  transition: border-color var(--duration) var(--ease),
              background var(--duration) var(--ease),
              transform var(--duration) var(--ease);
  cursor: pointer;
}

.rb-tool-card:hover {
  border-color: var(--border-md);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.rb-tool-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Variantes de cor por categoria */
.rb-icon-green  { background: rgba(74, 222, 128, 0.12); }
.rb-icon-blue   { background: rgba(96, 165, 250, 0.12); }
.rb-icon-amber  { background: rgba(251, 191, 36, 0.12); }
.rb-icon-purple { background: rgba(167, 139, 250, 0.12); }

.rb-tool-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.rb-tool-card-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
}

.rb-tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.rb-tool-card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
}

.rb-tag-free   { background: rgba(74, 222, 128, 0.1); color: var(--accent); }
.rb-tag-api    { background: var(--blue-dim); color: var(--blue); }
.rb-tag-coming { background: var(--surface-3); color: var(--text-3); }

.rb-tool-card-arrow {
  color: var(--text-4);
  transition: color var(--duration) var(--ease),
              transform var(--duration) var(--ease);
}

.rb-tool-card:hover .rb-tool-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ------------------------------------------------------------
   COMPONENTES DE FERRAMENTA
------------------------------------------------------------ */

/* Área de input principal */
.rb-input-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
  transition: border-color var(--duration) var(--ease);
}

.rb-input-area:focus-within {
  border-color: var(--border-md);
}

.rb-input-area-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.rb-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: vertical;
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  min-height: 160px;
}

.rb-textarea::placeholder { color: var(--text-4); }

.rb-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-4);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

.rb-input:focus {
  border-color: var(--border-md);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.rb-input::placeholder { color: var(--text-4); }

/* Área de resultado */
.rb-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.rb-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.rb-result-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rb-result-body {
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  overflow-x: auto;
}

/* Split screen (markdown / word) */
.rb-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  min-height: 500px;
}

.rb-split-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rb-split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

.rb-split-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rb-split-body {
  flex: 1;
  overflow: auto;
  padding: var(--space-4);
}

.rb-split-body textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}

.rb-split-body textarea::placeholder { color: var(--text-4); }

/* Preview HTML renderizado */
.rb-preview-html {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

.rb-preview-html h1,
.rb-preview-html h2,
.rb-preview-html h3 { margin: 1rem 0 0.5rem; color: var(--text); }
.rb-preview-html p  { margin-bottom: 0.75rem; color: var(--text-2); }
.rb-preview-html ul { padding-left: 1.25rem; list-style: disc; }
.rb-preview-html ol { padding-left: 1.25rem; list-style: decimal; }
.rb-preview-html li { margin-bottom: 0.25rem; color: var(--text-2); }
.rb-preview-html code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}
.rb-preview-html pre {
  background: var(--surface-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 0.75rem;
}
.rb-preview-html a { color: var(--accent); }
.rb-preview-html strong { font-weight: 500; color: var(--text); }
.rb-preview-html blockquote {
  border-left: 2px solid var(--border-md);
  padding-left: var(--space-4);
  color: var(--text-3);
  margin: 0.75rem 0;
}

/* Dropzone de upload */
.rb-dropzone {
  border: 1.5px dashed var(--border-md);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--duration) var(--ease),
              background var(--duration) var(--ease);
}

.rb-dropzone:hover,
.rb-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.rb-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.rb-dropzone-icon {
  width: 40px;
  height: 40px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
}

.rb-dropzone h3 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.rb-dropzone p {
  font-size: 12px;
  color: var(--text-3);
}

/* Formatos suportados */
.rb-format-tags {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.rb-format-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------
   CONTADORES E MÉTRICAS
------------------------------------------------------------ */
.rb-counter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 12px;
}

.rb-counter-val {
  font-weight: 500;
  color: var(--text);
  min-width: 28px;
}

.rb-counter-bar {
  flex: 1;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}

.rb-counter-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.15s var(--ease-out), background 0.15s;
}

.rb-counter-fill.ok      { background: var(--accent); }
.rb-counter-fill.warning { background: var(--amber); }
.rb-counter-fill.over    { background: var(--red); }

.rb-counter-label {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

/* Métricas em grid */
.rb-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.rb-metric {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.rb-metric-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.rb-metric-val.accent { color: var(--accent); }
.rb-metric-val.red    { color: var(--red); }
.rb-metric-val.amber  { color: var(--amber); }

.rb-metric-label {
  font-size: 11px;
  color: var(--text-3);
}

/* ------------------------------------------------------------
   PREVIEW DE SERP
------------------------------------------------------------ */
.rb-serp-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  margin: var(--space-4) 0;
}

.rb-serp-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-serp-title {
  font-size: 18px;
  color: #60a5fa;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-serp-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rb-serp-title.over  { color: var(--red); }
.rb-serp-desc.over   { color: var(--amber); }

/* ------------------------------------------------------------
   BOTÕES
------------------------------------------------------------ */
.rb-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-md);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.rb-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-lg);
}

.rb-btn:active { transform: scale(0.98); }

/* Primário */
.rb-btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

.rb-btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
  color: var(--accent-text);
  border-color: transparent;
}

/* Fantasma */
.rb-btn-ghost {
  border-color: transparent;
  background: transparent;
}

.rb-btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
}

/* Destrutivo */
.rb-btn-danger {
  color: var(--red);
  border-color: var(--red-dim);
}

.rb-btn-danger:hover {
  background: var(--red-dim);
}

/* Ícone */
.rb-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* Grupo de botões */
.rb-btn-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------
   BADGES E PILLS
------------------------------------------------------------ */
.rb-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.rb-badge-green  { background: rgba(74, 222, 128, 0.12); color: var(--accent); }
.rb-badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.rb-badge-amber  { background: var(--amber-dim);  color: var(--amber); }
.rb-badge-red    { background: var(--red-dim);    color: var(--red); }
.rb-badge-purple { background: var(--purple-dim); color: var(--purple); }
.rb-badge-gray   { background: var(--surface-2);  color: var(--text-3); }

/* Pill de categoria de ferramenta */
.rb-category-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ------------------------------------------------------------
   ADSENSE — SLOTS
------------------------------------------------------------ */

/* Topo de página (728x90 ou responsivo) */
.rb-ad-top {
  width: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-4) 0 var(--space-6);
  overflow: hidden;
}

/* Entre conteúdo e texto explicativo (336x280) */
.rb-ad-mid {
  width: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-8) 0;
  overflow: hidden;
}

/* Rodapé antes do texto (728x90) */
.rb-ad-bottom {
  width: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-6) 0 var(--space-4);
  overflow: hidden;
}

/* Placeholder visual para desenvolvimento */
.rb-ad-placeholder {
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------
   SEÇÃO DE CONTEÚDO INFORMATIVO (SEO da página)
------------------------------------------------------------ */
.rb-info-section {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.rb-info-section h2 {
  font-size: 1.2rem;
  margin-bottom: var(--space-3);
}

.rb-info-section p {
  margin-bottom: var(--space-4);
  max-width: 680px;
}

.rb-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.rb-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.rb-info-card h4 {
  font-size: 13px;
  margin-bottom: var(--space-2);
}

.rb-info-card p {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ------------------------------------------------------------
   NOTIFICAÇÕES / TOAST
------------------------------------------------------------ */
.rb-toast-wrap {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.rb-toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 13px;
  color: var(--text);
  pointer-events: auto;
  animation: toastIn 0.2s var(--ease) forwards;
  max-width: 320px;
}

.rb-toast.success { border-color: rgba(74, 222, 128, 0.3); }
.rb-toast.error   { border-color: rgba(248, 113, 113, 0.3); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   UTILITÁRIOS
------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

.copy-btn-wrap { position: relative; }

/* Animação de fade in nas páginas */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-fade-up {
  animation: fadeUp 0.3s var(--ease) forwards;
}

.anim-delay-1 { animation-delay: 0.05s; opacity: 0; }
.anim-delay-2 { animation-delay: 0.10s; opacity: 0; }
.anim-delay-3 { animation-delay: 0.15s; opacity: 0; }
.anim-delay-4 { animation-delay: 0.20s; opacity: 0; }

/* ------------------------------------------------------------
   RESPONSIVO
------------------------------------------------------------ */
@media (max-width: 768px) {
  :root {
    --space-10: 32px;
    --space-12: 40px;
    --space-16: 48px;
  }

  .rb-nav { display: none; }
  .rb-menu-btn { display: flex; }

  .rb-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .rb-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .rb-tool-hero { padding: var(--space-8) 0 var(--space-6); }

  .rb-ad-top,
  .rb-ad-bottom { min-height: 60px; }
}

@media (max-width: 480px) {
  .container,
  .container-wide {
    padding: 0 var(--space-4);
  }

  .rb-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------------------------------------
   SCROLLBAR CUSTOMIZADA (webkit)
------------------------------------------------------------ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-md); }

/* ------------------------------------------------------------
   SELEÇÃO DE TEXTO
------------------------------------------------------------ */
::selection {
  background: var(--accent-dim);
  color: var(--text);
}
