/* Documentos jurídicos (Termos de Uso, Política de Privacidade e versões
   anteriores). Páginas estáticas, fora do app: mesmos tokens do Pollen v2,
   leitura longa em primeiro lugar. Gerado à mão; o HTML vem de
   scripts/legal/build.mjs. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage/bricolage-grotesque-latin-opsz-normal.woff2")
    format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter/inter-latin-wght-normal.woff2")
    format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter/inter-latin-ext-wght-normal.woff2")
    format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --bg-2: #ebe7da;
  --card: #fffdf7;
  --ink: #16130d;
  --muted: #5b5547;
  --subtle: #756e5e;
  --line: #e2ddcf;
  --accent: #ffb91d;
  --accent-deep: #9a5f00;
  --note-bg: #fff0c2;
  --note-ink: #4d3400;
  --out: cubic-bezier(0.22, 1, 0.36, 1);
}
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #12110e;
  --bg-2: #1b1a16;
  --card: #1f1d18;
  --ink: #f7f2e4;
  --muted: #b9b2a0;
  --subtle: #9c9584;
  --line: #2e2b25;
  --accent-deep: #ffb91d;
  --note-bg: #33270a;
  --note-ink: #ffd57a;
}
/* Sem JavaScript o tema salvo no app não é lido: segue o do sistema. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #12110e;
    --bg-2: #1b1a16;
    --card: #1f1d18;
    --ink: #f7f2e4;
    --muted: #b9b2a0;
    --subtle: #9c9584;
    --line: #2e2b25;
    --accent-deep: #ffb91d;
    --note-bg: #33270a;
    --note-ink: #ffd57a;
  }
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16.5px/1.65 Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  font-variant-numeric: lining-nums;
  caret-color: var(--accent-deep);
  scrollbar-color: var(--subtle) transparent;
}
::selection {
  background: color-mix(in oklab, var(--accent) 55%, transparent);
  color: var(--ink);
}
a {
  color: inherit;
  text-decoration-color: var(--accent-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
@media (hover: hover) {
  a:hover {
    text-decoration-color: var(--ink);
  }
}
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 6px;
}
b,
strong {
  font-weight: 650;
}

html {
  scroll-padding-top: calc(env(safe-area-inset-top) + 88px);
}

/* ── Barra fixa: marca (ou o título, depois de rolar), volta ao app e
   progresso da leitura. Cobre também a barra de status do app instalado. ── */
.bar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 0.3s var(--out);
}
.bar[data-scrolled] {
  box-shadow: 0 1px 0 var(--line);
}
.bar-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: min(100% - 32px, 1080px);
  min-height: 64px;
  margin-inline: auto;
}
.brand,
.bar-title {
  grid-area: 1 / 1;
  transition:
    opacity 0.3s var(--out),
    translate 0.3s var(--out);
}
.brand img {
  display: block;
  width: 136px;
  height: auto;
}
.bar-title {
  overflow: hidden;
  margin: 0;
  font:
    700 17px/1.2 "Bricolage Grotesque",
    Inter,
    sans-serif;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0;
  translate: 0 6px;
  pointer-events: none;
}
.bar[data-scrolled] .brand {
  opacity: 0;
  translate: 0 -6px;
  pointer-events: none;
}
.bar[data-scrolled] .bar-title {
  opacity: 1;
  translate: 0 0;
}
.bar-progress {
  height: 2px;
}
.bar-progress span {
  display: block;
  height: 100%;
  background: var(--accent-deep);
  transform: scaleX(var(--read, 0));
  transform-origin: left;
}
.open-app svg {
  display: none;
  margin-left: -4px;
}
.open-app[data-returning] svg {
  display: block;
}

/* ── Topo ── */
.top,
body > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
  padding: max(20px, calc(env(safe-area-inset-top) + 10px)) 0 20px;
}
.top img,
body > header img {
  display: block;
  width: 144px;
  height: auto;
}
img.logo-night {
  display: none;
}
:root[data-theme="night"] img.logo-day {
  display: none;
}
:root[data-theme="night"] img.logo-night {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) img.logo-day {
    display: none;
  }
  :root:not([data-theme]) img.logo-night {
    display: block;
  }
}
.top nav,
body > header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
  font-size: 14.5px;
  font-weight: 600;
}
.open-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: opacity 0.2s;
}
@media (hover: hover) {
  .open-app:hover {
    opacity: 0.86;
  }
}

/* ── Abas entre os documentos ── */
.doc-tabs {
  border-bottom: 1px solid var(--line);
}
.doc-tabs > div {
  display: flex;
  gap: 28px;
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.doc-tabs a {
  flex: none;
  padding: 12px 0 11px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.doc-tabs a[aria-current="page"] {
  border-bottom-color: var(--accent-deep);
  color: var(--ink);
}
@media (hover: hover) {
  .doc-tabs a:hover {
    color: var(--ink);
  }
}

/* ── Título do documento, em toda a largura ── */
.hero {
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
  padding: clamp(32px, 6vw, 56px) 0 clamp(24px, 4vw, 40px);
}
.hero h1 {
  margin-bottom: 12px;
}

/* ── Estrutura: índice ao lado, documento em uma coluna de leitura ── */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
}
.toc {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 90px);
  max-height: calc(100dvh - env(safe-area-inset-top) - 114px);
  overflow-y: auto;
  padding: 6px 4px 6px 0;
  font-size: 14px;
  line-height: 1.4;
}
.toc summary {
  margin-bottom: 10px;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 650;
  list-style: none;
  cursor: default;
}
.toc summary::-webkit-details-marker {
  display: none;
}
.toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}
.toc a::before {
  content: counter(toc);
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}
.toc a[data-plain]::before {
  content: "";
}
.toc a[aria-current="true"] {
  background: var(--card);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 0 0 1px var(--line);
}
.toc a[aria-current="true"]::before {
  color: var(--accent-deep);
}
@media (hover: hover) {
  .toc a:hover {
    color: var(--ink);
  }
}

.doc {
  max-width: 760px;
  padding-bottom: 32px;
}
body > main {
  padding: 44px clamp(20px, 5vw, 60px) 48px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
}
body > main {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
}

/* ── Cabeçalho do documento ── */
h1 {
  margin: 0 0 14px;
  font:
    700 clamp(34px, 6vw, 50px) / 1.04 "Bricolage Grotesque",
    Inter,
    sans-serif;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.print {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline 2px var(--accent-deep);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: text-decoration-color 0.2s;
}
.print::before {
  content: "";
  width: 17px;
  height: 17px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Cpath d='M6 14h12v7H6z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
@media (hover: hover) {
  .print:hover {
    text-decoration-color: var(--ink);
  }
}
.updated {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}
.lede {
  max-width: 62ch;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

/* ── Resumo em linguagem direta ── */
.summary {
  margin: 0 0 12px;
  padding: 24px clamp(18px, 4vw, 28px) 22px;
  border-radius: 22px;
  background: color-mix(in oklab, var(--accent) 15%, var(--card));
}
.summary h2 {
  margin: 0 0 12px;
  font-size: 20px;
}
.summary ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.summary li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  max-width: none;
  margin: 0;
}
.summary li::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--ink)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffb91d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E")
    center / 13px no-repeat;
}
.summary-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* ── Seções ── */
h2 {
  margin: 44px 0 10px;
  font:
    700 24px/1.18 "Bricolage Grotesque",
    Inter,
    sans-serif;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.sec > h2 {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.sec > h2 .n {
  min-width: 26px;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
h3 {
  margin: 26px 0 6px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
}
p,
li,
dd,
td {
  max-width: 68ch;
  text-wrap: pretty;
  overflow-wrap: break-word;
}
p {
  margin: 0 0 14px;
}
ul,
ol.steps {
  margin: 0 0 14px;
  padding-left: 1.25em;
}
li + li {
  margin-top: 6px;
}
li::marker {
  color: var(--accent-deep);
}
/* Cláusula numerada: o número fica na margem, o texto alinha em bloco. */
.cl {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 0 8px;
  max-width: calc(68ch + 54px);
}
.cl > .n {
  color: var(--subtle);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.95;
}
.cl > div > :last-child {
  margin-bottom: 14px;
}
.cl ul {
  margin-top: -6px;
}

/* ── Aviso em destaque (cláusulas que limitam direitos, pontos de atenção) ── */
.note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--note-bg);
  color: var(--note-ink);
}
.note::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-top: 3px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.note p {
  max-width: none;
  margin: 0;
}
.note p + p {
  margin-top: 8px;
}

/* ── Tabelas ── */
.scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  margin: 6px 0 18px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
th,
td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  font-weight: 650;
}
tr > th:first-child,
tr > td:first-child {
  padding-left: 0;
}
thead th {
  border-top: 0;
  padding-top: 0;
  color: var(--subtle);
  font-size: 13px;
}
tbody th {
  width: 26%;
}
/* A long first column (a purpose, a kind of data) reads as a sentence. */
table.first-wide tbody th {
  width: 38%;
  font-weight: 600;
}
td code,
th code {
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
}
@media (max-width: 640px) {
  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack th,
  table.stack td {
    display: block;
    width: auto;
  }
  table.stack thead {
    display: none;
  }
  table.stack tr {
    padding: 14px 0;
    border-top: 1px solid var(--line);
  }
  table.stack th,
  table.stack td {
    padding: 0;
    border: 0;
  }
  table.stack tbody th,
  table.first-wide.stack tbody th {
    width: auto;
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.4;
    text-wrap: balance;
  }
  table.stack td + td {
    margin-top: 8px;
  }
  table.stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--subtle);
    font-size: 12.5px;
    font-weight: 650;
  }
}

/* ── Definições, contato e histórico ── */
dl.defs {
  display: grid;
  grid-template-columns: minmax(120px, 26%) minmax(0, 1fr);
  gap: 10px 18px;
  margin: 6px 0 18px;
}
dl.defs dt {
  font-weight: 650;
}
dl.defs dd {
  margin: 0;
  max-width: 62ch;
}
@media (max-width: 640px) {
  dl.defs {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  dl.defs dd {
    margin-bottom: 12px;
  }
}
.contact {
  display: grid;
  gap: 4px;
  margin: 10px 0 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--bg);
  font-style: normal;
}
.contact b {
  font-size: 17px;
}
.old-version {
  width: min(100% - 32px, 760px);
  margin: 14px auto 4px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--note-bg);
  color: var(--note-ink);
  font-weight: 600;
}

/* ── Rodapé ── */
footer {
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
  padding: 28px 0 56px;
  color: var(--muted);
  font-size: 14px;
}
body > main + footer {
  width: min(100% - 32px, 760px);
}
footer p {
  max-width: none;
  margin: 0 0 6px;
}

/* ── Telas estreitas: o índice vira um bloco que abre e fecha ── */
@media (max-width: 899px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .toc {
    position: static;
    max-height: none;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
  }
  .toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin: 0;
    padding: 0 18px;
    color: var(--ink);
    font-size: 15px;
    cursor: pointer;
  }
  .toc summary::after {
    content: "";
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border: solid var(--muted);
    border-width: 0 2px 2px 0;
    rotate: 45deg;
    translate: 0 -2px;
    transition: rotate 0.25s var(--out);
  }
  .toc details[open] summary::after {
    rotate: 225deg;
    translate: 0 2px;
  }
  .toc ol {
    padding: 0 8px 10px;
  }
  .toc a {
    padding: 10px;
  }
  .toc a[aria-current="true"] {
    background: var(--bg);
    box-shadow: none;
  }
  .cl {
    grid-template-columns: 40px minmax(0, 1fr);
  }
}

/* ── Impressão e PDF ── */
@media print {
  :root,
  :root[data-theme="night"] {
    --bg: #fff;
    --card: #fff;
    --ink: #000;
    --muted: #333;
    --subtle: #555;
    --line: #bbb;
    --accent-deep: #000;
    --note-bg: #f2f2f2;
    --note-ink: #000;
  }
  body {
    font-size: 11pt;
  }
  .toc,
  .top nav,
  .bar,
  .doc-tabs,
  .open-app,
  .print {
    display: none;
  }
  .hero {
    width: auto;
    padding: 12px 0 18px;
  }
  .layout {
    display: block;
    width: auto;
  }
  .doc {
    padding: 0;
    border: 0;
  }
  .logo-day {
    display: block !important;
  }
  .logo-night {
    display: none !important;
  }
  .summary {
    border: 1px solid var(--line);
    background: none;
  }
  .sec > h2,
  h3 {
    break-after: avoid;
  }
  .cl,
  tr,
  .note {
    break-inside: avoid;
  }
  a {
    text-decoration: none;
  }
}

/* ── Atalho de teclado para o conteúdo ── */
.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 2;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* ── Movimento ── */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise {
    from {
      opacity: 0;
      translate: 0 14px;
    }
  }
  .hero > *,
  .layout {
    animation: rise 0.6s var(--out) both;
  }
  .hero > :nth-child(2) {
    animation-delay: 60ms;
  }
  .layout {
    animation-delay: 120ms;
  }
  /* Índice no celular: abre e fecha deslizando. */
  .toc details {
    interpolate-size: allow-keywords;
  }
  .toc details::details-content {
    block-size: 0;
    overflow: hidden;
    transition:
      block-size 0.35s var(--out),
      content-visibility 0.35s allow-discrete;
  }
  .toc details[open]::details-content {
    block-size: auto;
  }
  /* A seção que você abriu pelo índice pisca de leve ao chegar. */
  @keyframes arrive {
    from {
      background: color-mix(in oklab, var(--accent) 22%, transparent);
    }
  }
  .sec:target > h2,
  .cl:target {
    animation: arrive 1.6s var(--out);
    border-radius: 10px;
  }
  .toc a,
  .doc-tabs a {
    transition:
      background 0.25s var(--out),
      color 0.25s var(--out),
      border-color 0.25s var(--out),
      box-shadow 0.25s var(--out);
  }
  .print::before {
    transition: translate 0.25s var(--out);
  }
  @media (hover: hover) {
    .print:hover::before {
      translate: 0 -1px;
    }
  }
  .open-app {
    transition:
      opacity 0.2s,
      scale 0.2s var(--out);
  }
  .open-app:active {
    scale: 0.97;
  }
}
