:root {
  --md-primary-fg-color: #17324f;
  --md-accent-fg-color: #1565c0;
}
[data-md-color-scheme="default"] {
  --md-default-bg-color: #ffffff;
  --md-default-fg-color: #243449;
  --md-typeset-a-color: #125b9b;
  --md-code-bg-color: #f2f5f9;
}
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #161e2b;
  --md-default-fg-color: #e4eaf2;
  --md-primary-fg-color: #233a58;
  --md-accent-fg-color: #83bcff;
  --md-typeset-a-color: #91c7ff;
  --md-code-bg-color: #222e40;
}
.md-typeset table:not([class]) { display: table; width: 100%; }

/* Oculta o titulo duplicado no menu esquerdo. */
.md-sidebar--primary .md-nav--primary > .md-nav__title {
  display: none;
}

/* Mantem as dimensoes nativas do grid do Material.
   Compacta somente a tipografia e o espacamento do indice direito. */
@media screen and (min-width: 76.25em) {
  .md-sidebar--secondary .md-nav__link {
    font-size: .65rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
  .md-sidebar--secondary .md-nav__item {
    padding: 0;
  }
}

/* Mantem o nome da biblioteca fixo no cabecalho durante o scroll. */
.md-header__title .md-header__topic:first-child {
  transform: none !important;
  opacity: 1 !important;
}
.md-header__title .md-header__topic:nth-child(2) {
  display: none !important;
}

/* Botao de retorno discreto no topo das fichas normativas. */
.md-typeset a.back-link {
  display: inline-flex;
  align-items: center;
  padding: .3rem .65rem;
  border-radius: .35rem;
  background: var(--md-code-bg-color);
  color: var(--md-typeset-a-color);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}
.md-typeset a.back-link:hover,
.md-typeset a.back-link:focus-visible {
  text-decoration: underline;
}

/* Tabelas de navegacao: links visuais neutros e linha inteira clicavel. */
.md-typeset table a.row-link,
.md-typeset table a.row-link:hover {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.md-typeset table[data-clickable-rows] tbody tr.is-row-link {
  cursor: pointer;
  transition: background-color .15s ease;
}
.md-typeset table[data-clickable-rows] tbody tr.is-row-link:hover,
.md-typeset table[data-clickable-rows] tbody tr.is-row-link:focus-within {
  background-color: var(--md-code-bg-color);
}
.md-typeset table[data-clickable-rows] tbody tr.is-unavailable {
  opacity: .5;
  cursor: default;
}
.md-typeset table a.row-link:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Tabelas informativas e itens indisponiveis nao reagem ao mouse. */
.md-typeset table:not([data-clickable-rows]) tbody tr:hover,
.md-typeset table[data-clickable-rows] tbody tr.is-unavailable:hover {
  background-color: transparent;
}

/* Titulo da pagina e secao ativa usam o mesmo azul nos dois temas. */
.md-typeset h1,
.md-sidebar--primary .md-nav__link--active {
  color: var(--md-accent-fg-color);
}

/* Compacta discretamente os nomes nas tabelas de navegacao em desktop.
   Evita linhas de alturas diferentes por pequenas quebras de texto.
   Em telas estreitas a quebra continua permitida para legibilidade. */
@media screen and (min-width: 76.25em) {
  .md-typeset table[data-clickable-rows] a.row-link {
    font-size: .92em;
    white-space: nowrap;
  }
}

/* Desktop: reduz o espaço do menu esquerdo e amplia a área de leitura.
   Não altera margens negativas ou posicionamento das barras laterais. */
@media screen and (min-width: 76.25em) {
  .md-main__inner.md-grid {
    max-width: 1440px;
  }
  .md-sidebar--primary {
    width: 9rem;
  }
}

/* Os três valores Pe / Ps / Pa nunca são repartidos entre linhas.
   Se a viewport for estreita, a tabela rola horizontalmente. */
.md-typeset .md-typeset__table {
  max-width: 100%;
  overflow-x: auto;
}
.md-typeset .pressure-values {
  display: inline-block;
  white-space: nowrap;
  font-size: .92em;
  font-variant-numeric: tabular-nums;
}
.md-typeset table:has(.pressure-values) th,
.md-typeset table:has(.pressure-values) td {
  padding-left: .55em;
  padding-right: .55em;
}

/* Em telas de celular, a cor azul identifica as linhas navegaveis
   sem depender de hover; no desktop permanece a cor neutra. */
@media screen and (max-width: 44.99em) {
  .md-typeset table a.row-link,
  .md-typeset table a.row-link:hover {
    color: var(--md-typeset-a-color);
  }
}
