/*
 * Documentação do Judô One. Tema "Dojo Noturno", o mesmo do app.
 * Toda cor vem de assets/tokens.css (gerado de src/index.css) em canais "R G B":
 * use rgb(var(--token)) ou rgb(var(--token) / alfa). Nenhuma cor literal aqui.
 * Mobile first: o padrão é o celular; @media (min-width) acrescenta o desktop.
 */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
  overflow-x: clip;
}

body {
  margin: 0;
  background: rgb(var(--background));
  color: rgb(var(--ink));
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: 'cv11', 'ss03';
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.menu-aberto {
  overflow: hidden;
}

a {
  color: rgb(var(--link));
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid rgb(var(--focus));
  outline-offset: 2px;
  border-radius: calc(var(--radius) * 0.6);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pular {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 60;
  padding: 0.5rem 0.875rem;
  background: rgb(var(--action));
  color: rgb(var(--action-ink));
  border-radius: var(--radius);
  font-weight: 600;
}

.pular:focus {
  top: 0.5rem;
}

/* ─── Topo ─────────────────────────────────────────────────────────────── */
.topo {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--header-height);
  padding: 0 0.75rem;
  background: rgb(var(--shell));
  border-bottom: 1px solid rgb(var(--edge) / 0.06);
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: rgb(var(--ink));
  text-decoration: none;
}

.marca-obi {
  width: 2rem;
  height: 1.25rem;
  fill: rgb(var(--accent));
  stroke: rgb(var(--accent));
  flex: none;
}

.marca-nome {
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.marca-tag {
  display: none;
  padding: 0.0625rem 0.5rem;
  border-radius: 9999px;
  background: rgb(var(--raised));
  color: rgb(var(--ink-muted));
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.topo-acoes {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.topo-link {
  padding: 0.5rem 0.75rem;
  color: rgb(var(--ink-muted));
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: calc(var(--radius) * 0.8);
}

.topo-link:hover {
  color: rgb(var(--ink));
  background: rgb(var(--raised));
}

.btn-entrar {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border-radius: var(--radius);
  background: rgb(var(--action));
  color: rgb(var(--action-ink));
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-entrar:hover {
  background: rgb(var(--action-hover));
}

.icone-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) * 0.8);
  background: transparent;
  color: rgb(var(--ink));
  cursor: pointer;
}

.icone-btn:hover {
  background: rgb(var(--raised));
}

.icone-btn svg,
.busca-icone svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.so-desktop {
  display: none;
}

/* ─── Casca: menu lateral (gaveta no celular) + conteúdo ─────────────── */
.casca {
  position: relative;
}

.lateral {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: min(20rem, 88vw);
  display: flex;
  flex-direction: column;
  background: rgb(var(--shell));
  border-right: 1px solid rgb(var(--edge) / 0.06);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.2s ease, visibility 0.2s;
}

body.menu-aberto .lateral {
  transform: none;
  visibility: visible;
}

.lateral-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 0.5rem 0 1rem;
  flex: none;
}

.lateral-titulo {
  font-weight: 600;
}

.veu {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgb(var(--scrim) / 0.6);
}

.busca {
  position: relative;
  margin: 0 0.75rem 0.75rem;
  flex: none;
}

.busca-icone {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(var(--ink-muted));
  display: flex;
}

.busca input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid rgb(var(--edge) / 0.1);
  border-radius: var(--radius);
  background: rgb(var(--field));
  color: rgb(var(--ink));
  font: inherit;
  font-size: 1rem;
}

.busca input::placeholder {
  color: rgb(var(--ink-muted));
}

.busca input:focus-visible {
  outline-offset: 0;
}

.busca-resultados,
.nav-grupos {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0.75rem 1.5rem;
}

.busca-resultados ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.busca-resultados li + li {
  margin-top: 0.25rem;
}

.busca-resultados a {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: calc(var(--radius) * 0.8);
  color: rgb(var(--ink));
  text-decoration: none;
}

.busca-resultados a:hover,
.busca-resultados a:focus-visible {
  background: rgb(var(--raised));
}

.busca-resultados strong {
  display: block;
  font-size: 0.9375rem;
}

.busca-resultados span {
  display: block;
  font-size: 0.8125rem;
  color: rgb(var(--ink-muted));
  line-height: 1.45;
}

.busca-resultados mark {
  background: none;
  color: rgb(var(--accent));
  font-weight: 600;
}

.busca-vazia {
  padding: 0.75rem;
  color: rgb(var(--ink-muted));
  font-size: 0.875rem;
}

.nav-grupo + .nav-grupo {
  margin-top: 1.25rem;
}

.nav-grupo h2 {
  margin: 0 0 0.25rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--ink-muted));
}

.nav-grupo ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-grupo a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) * 0.8);
  color: rgb(var(--ink));
  font-size: 0.9375rem;
  line-height: 1.35;
  text-decoration: none;
}

.nav-grupo a:hover {
  background: rgb(var(--raised));
}

.nav-grupo a[aria-current='page'] {
  background: rgb(var(--accent) / 0.12);
  color: rgb(var(--accent));
  font-weight: 600;
}

/* ─── Conteúdo ───────────────────────────────────────────────────────── */
.conteudo {
  min-width: 0;
  padding: 1rem 1rem 3rem;
}

.conteudo:focus {
  outline: none;
}

.artigo {
  min-width: 0;
  max-width: 46rem;
  margin: 0 auto;
}

.trilha ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.8125rem;
  color: rgb(var(--ink-muted));
}

.trilha li + li::before {
  content: '/';
  margin-right: 0.25rem;
  color: rgb(var(--ink-muted) / 0.6);
}

.trilha a {
  color: rgb(var(--ink-muted));
}

.trilha [aria-current] {
  color: rgb(var(--ink));
}

.sobretitulo {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--accent));
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.375rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  margin: 0.75rem 0 0;
  font-size: 1.125rem;
  line-height: 1.55;
  color: rgb(var(--ink-muted));
  text-wrap: pretty;
}

.atualizado {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: rgb(var(--ink-muted));
}

.cabeca {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgb(var(--edge) / 0.06);
}

.sumario-movel {
  margin: 1rem 0 0;
  border: 1px solid rgb(var(--edge) / 0.1);
  border-radius: var(--radius);
  background: rgb(var(--panel));
}

.sumario-movel summary {
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.sumario-movel ol {
  margin: 0;
  padding: 0 1rem 0.875rem 2.25rem;
  font-size: 0.9375rem;
}

.sumario-movel li + li {
  margin-top: 0.25rem;
}

.secao {
  padding-top: 0.5rem;
}

h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.4;
}

.ancora {
  color: inherit;
  text-decoration: none;
}

.ancora:hover::after {
  content: ' #';
  color: rgb(var(--ink-muted));
}

p,
ul,
ol {
  margin: 0.75rem 0;
}

li + li {
  margin-top: 0.375rem;
}

strong {
  font-weight: 600;
}

/* Rótulo literal de botão, aba ou campo da tela. */
.ui {
  display: inline-block;
  padding: 0 0.375rem;
  border: 1px solid rgb(var(--edge) / 0.15);
  border-radius: calc(var(--radius) * 0.6);
  background: rgb(var(--raised));
  font-size: 0.875em;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}

/* Passo a passo numerado. */
.passos {
  counter-reset: passo;
  list-style: none;
  padding: 0;
}

.passos > li {
  counter-increment: passo;
  position: relative;
  padding-left: 2.5rem;
}

.passos > li + li {
  margin-top: 0.75rem;
}

.passos > li::before {
  content: counter(passo);
  position: absolute;
  left: 0;
  top: 0.0625rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: rgb(var(--accent));
  color: rgb(var(--accent-ink));
  font-size: 0.8125rem;
  font-weight: 700;
}

/* Avisos. */
.aviso {
  margin: 1rem 0;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgb(var(--info) / 0.35);
  background: rgb(var(--info) / 0.08);
}

.aviso > :first-child {
  margin-top: 0;
}

.aviso > :last-child {
  margin-bottom: 0;
}

.aviso-titulo {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: rgb(var(--info));
}

.aviso.atencao {
  border-color: rgb(var(--warning) / 0.4);
  background: rgb(var(--warning) / 0.08);
}

.aviso.atencao .aviso-titulo {
  color: rgb(var(--warning));
}

/* "O que acontece se..." e erros: pergunta em destaque, resposta embaixo. */
.casos {
  margin: 0.75rem 0;
}

.casos dt {
  margin-top: 1rem;
  font-weight: 600;
}

.casos dt:first-child {
  margin-top: 0;
}

.casos dd {
  margin: 0.25rem 0 0;
  color: rgb(var(--ink-muted));
}

/* Tabelas. */
.tabela-wrap {
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid rgb(var(--edge) / 0.1);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  padding: 0.625rem 0.875rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgb(var(--edge) / 0.06);
}

thead th {
  background: rgb(var(--panel));
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(var(--ink-muted));
  white-space: nowrap;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

td.sim {
  color: rgb(var(--success));
  font-weight: 600;
}

td.nao {
  color: rgb(var(--ink-muted));
}

caption {
  padding: 0.625rem 0.875rem;
  caption-side: bottom;
  text-align: left;
  font-size: 0.8125rem;
  color: rgb(var(--ink-muted));
}

/* Prints de tela: largura total no celular, com rolagem lateral quando a imagem pede. */
.print {
  margin: 1.25rem -1rem;
}

.print-moldura {
  overflow-x: auto;
  border-block: 1px solid rgb(var(--edge) / 0.1);
  background: rgb(var(--shell));
}

.print img {
  width: 100%;
  min-width: 0;
}

.print-movel .print-moldura {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

.print-movel img {
  width: min(100%, 20rem);
  border-radius: calc(var(--radius) * 1.4);
  border: 1px solid rgb(var(--edge) / 0.1);
}

.print figcaption {
  padding: 0.5rem 1rem 0;
  font-size: 0.8125rem;
  color: rgb(var(--ink-muted));
}

/* Cartões (mapa do sistema, veja também). */
.cartoes {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.cartoes li + li {
  margin-top: 0;
}

.cartoes a {
  display: block;
  height: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid rgb(var(--edge) / 0.1);
  border-radius: var(--radius);
  background: rgb(var(--card));
  color: rgb(var(--ink));
  text-decoration: none;
}

.cartoes a:hover {
  border-color: rgb(var(--edge) / 0.15);
  background: rgb(var(--raised));
}

.cartoes strong {
  display: block;
  color: rgb(var(--link));
}

.cartoes span {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgb(var(--ink-muted));
}

.bloco-mapa {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: calc(var(--radius) * 1.4);
  background: rgb(var(--panel));
}

.bloco-mapa h3 {
  margin-top: 0;
}

.bloco-mapa p {
  margin-top: 0.25rem;
  color: rgb(var(--ink-muted));
  font-size: 0.9375rem;
}

/* Perguntas frequentes. */
.faq details {
  border-bottom: 1px solid rgb(var(--edge) / 0.06);
}

.faq summary {
  padding: 0.875rem 0;
  font-weight: 600;
  cursor: pointer;
}

.faq-resp {
  padding-bottom: 0.75rem;
}

.faq-resp > :first-child {
  margin-top: 0;
}

/* Fecho de cada página. */
.duvida {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  border-radius: calc(var(--radius) * 1.4);
  background: rgb(var(--panel));
  border: 1px solid rgb(var(--edge) / 0.06);
}

.duvida h2 {
  margin: 0;
  font-size: 1.0625rem;
}

.duvida p {
  margin: 0.375rem 0 0;
  font-size: 0.9375rem;
  color: rgb(var(--ink-muted));
}

.ant-prox {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.ant-prox a {
  display: block;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgb(var(--edge) / 0.1);
  border-radius: var(--radius);
  color: rgb(var(--ink));
  text-decoration: none;
  min-width: 0;
}

.ant-prox a:hover {
  background: rgb(var(--raised));
}

.ant-prox .prox {
  text-align: right;
}

.ant-prox span {
  display: block;
  font-size: 0.75rem;
  color: rgb(var(--ink-muted));
}

.ant-prox strong {
  display: block;
  color: rgb(var(--link));
  overflow-wrap: anywhere;
}

.rodape {
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid rgb(var(--edge) / 0.06);
  background: rgb(var(--shell));
  font-size: 0.8125rem;
  color: rgb(var(--ink-muted));
  text-align: center;
}

.rodape a {
  color: rgb(var(--ink-muted));
}

.sumario {
  display: none;
}

/* ─── Tablet ─────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .marca-tag {
    display: inline-block;
  }

  .conteudo {
    padding: 1.5rem 1.5rem 4rem;
  }

  .print {
    margin-inline: 0;
  }

  .print-moldura {
    border: 1px solid rgb(var(--edge) / 0.1);
    border-radius: calc(var(--radius) * 1.4);
  }

  .print figcaption {
    padding-inline: 0;
  }

  .cartoes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ─── Desktop: menu fixo + coluna de leitura + sumário lateral ───────── */
@media (min-width: 1024px) {
  .so-movel,
  .lateral-topo,
  .veu {
    display: none !important;
  }

  .so-desktop {
    display: inline-flex;
  }

  .topo {
    padding: 0 1.25rem;
  }

  .casca {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
  }

  .lateral {
    position: sticky;
    top: var(--header-height);
    height: calc(100dvh - var(--header-height));
    width: auto;
    transform: none;
    visibility: visible;
    transition: none;
    padding-top: 1rem;
  }

  .conteudo {
    display: grid;
    grid-template-columns: minmax(0, 46rem);
    justify-content: center;
    gap: 3rem;
    padding: 2rem 2.5rem 5rem;
  }

  .sumario-movel {
    display: none;
  }
}

@media (min-width: 1280px) {
  .conteudo:not(.sem-sumario) {
    grid-template-columns: minmax(0, 46rem) 13.5rem;
  }

  .sumario {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: start;
    max-height: calc(100dvh - var(--header-height) - 4rem);
    overflow-y: auto;
    font-size: 0.875rem;
  }

  .sumario h2 {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(var(--ink-muted));
  }

  .sumario ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid rgb(var(--edge) / 0.1);
  }

  .sumario li + li {
    margin-top: 0;
  }

  .sumario a {
    display: block;
    padding: 0.3125rem 0 0.3125rem 0.875rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: rgb(var(--ink-muted));
    text-decoration: none;
    line-height: 1.4;
  }

  .sumario a:hover {
    color: rgb(var(--ink));
  }

  .sumario a.ativo {
    color: rgb(var(--accent));
    border-left-color: rgb(var(--accent));
  }

  .artigo {
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
