* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

input, textarea, select {
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

table {
  border-collapse: collapse;
  width: 100%;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
}

pre, code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
}

/* Passo 12 — acabamento global: foco de teclado visível em qualquer botão/
   link/campo do projeto, mesmo nos que não têm :focus definido no CSS
   próprio (main-tab, btn-primario, catalogo-detalhe-btn, etc.). Nunca remove
   o outline padrão sem substituto — só reforça a cor pro tema escuro. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Texto longo (nome de produto, URL de pesquisa, nome de arquivo importado)
   nunca pode quebrar layout de tabela/card — sempre quebra dentro da célula. */
table td, table th {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* prefers-reduced-motion global: cobre TODA animação/transição do projeto
   (mapa, cabos, orbe do Agente, cards), não só as que já tinham guard local. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
