:root {
  --emni-blue: #0e2d52;
  --emni-ice: #f5f7fa;
  --emni-amber: #d4a017;
  --emni-dark: #0b1118;
  --surface: #ffffff;
  --muted: #536273;
  --line: #dce3ea;
  --focus: #8a6410;
  --shadow: 0 20px 55px rgba(14, 45, 82, 0.07);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--emni-ice);
  color: var(--emni-dark);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--emni-blue);
  text-decoration-color: rgba(14, 45, 82, 0.45);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
  overflow-wrap: anywhere;
}

a:hover { text-decoration-color: var(--emni-amber); }

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: var(--emni-dark);
  color: white;
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(14, 45, 82, 0.12);
  background: rgba(245, 247, 250, 0.96);
}

.header-inner,
.footer-inner {
  width: min(100% - 2rem, 1240px);
  margin-inline: auto;
}

.header-inner {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  color: var(--emni-blue);
  text-decoration: none;
}

.wordmark {
  position: relative;
  font-size: 1.35rem;
  font-weight: 820;
  letter-spacing: 0.16em;
}

.wordmark::after {
  content: "";
  position: absolute;
  width: 0.31rem;
  height: 0.31rem;
  top: -0.06rem;
  right: 0.12rem;
  border-radius: 50%;
  background: var(--emni-amber);
}

.byline {
  padding-left: 0.7rem;
  border-left: 1px solid rgba(14, 45, 82, 0.24);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.header-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 650;
}

main { min-height: calc(100vh - 15rem); }

.page-shell {
  width: min(100% - 2rem, 1240px);
  margin-inline: auto;
  padding: 2.25rem 0 5.5rem;
}

.breadcrumb {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.breadcrumb span { color: #7a8794; }

.legal-layout {
  display: grid;
  grid-template-columns: minmax(210px, 245px) minmax(0, 820px);
  justify-content: center;
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: start;
}

.document-index {
  position: sticky;
  top: 6.25rem;
  max-height: calc(100vh - 7.5rem);
  overflow: auto;
  padding: 1.1rem 1rem;
  border: 1px solid rgba(14, 45, 82, 0.1);
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 36px rgba(14, 45, 82, 0.04);
}

.index-title {
  margin: 0 0 0.85rem;
  color: var(--emni-blue);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.document-index ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-index li + li { margin-top: 0.15rem; }

.document-index a {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0.32rem 0.55rem;
  border-left: 2px solid transparent;
  color: #4c5c6d;
  font-size: 0.78rem;
  line-height: 1.3;
  text-decoration: none;
}

.document-index a:hover,
.document-index a:focus-visible {
  border-left-color: var(--emni-amber);
  color: var(--emni-blue);
  background: rgba(14, 45, 82, 0.035);
}

.legal-document {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 3.75rem);
  border: 1px solid rgba(14, 45, 82, 0.09);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-document > .level1 > h1 {
  max-width: 15ch;
  margin: 0;
  color: var(--emni-blue);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.legal-document > .level1 > h1::after {
  content: "";
  width: 3.2rem;
  height: 3px;
  display: block;
  margin-top: 1.35rem;
  border-radius: 99px;
  background: var(--emni-amber);
}

.legal-document > .level1 > h1 + p {
  margin: 1.6rem 0 3.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.8;
}

.legal-document h2,
.legal-document h3 {
  color: var(--emni-blue);
  scroll-margin-top: 6rem;
}

.legal-document h2 {
  margin: 3.8rem 0 1.2rem;
  font-size: clamp(1.4rem, 3vw, 1.72rem);
  line-height: 1.25;
  letter-spacing: -0.017em;
}

.legal-document h3 {
  margin: 2.2rem 0 0.75rem;
  font-size: 1.17rem;
  line-height: 1.35;
}

.legal-document p { margin: 0 0 1.15rem; }

.legal-document ul,
.legal-document ol {
  margin: 0.9rem 0 1.5rem;
  padding-left: 1.35rem;
}

.legal-document li { padding-left: 0.3rem; }
.legal-document li + li { margin-top: 0.38rem; }
.legal-document li::marker { color: var(--emni-blue); font-weight: 700; }

.legal-document hr {
  height: 1px;
  margin: 3.2rem 0 0;
  border: 0;
  background: var(--line);
}

.legal-document strong { color: #102b48; }

.legal-document section[id="4-google-oauth-e-dados-do-usuário-google"],
.legal-document section[id="22-informações-específicas-para-o-google-api-services-user-data-policy"] {
  margin: 3.25rem -1.25rem 0;
  padding: 0.2rem 1.25rem 1.4rem;
  border-left: 3px solid var(--emni-amber);
  border-radius: 0 0.75rem 0.75rem 0;
  background: rgba(212, 160, 23, 0.045);
}

.legal-document table {
  width: 100%;
  margin: 1.35rem 0 2rem;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.legal-document th,
.legal-document td {
  padding: 0.8rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal-document th {
  background: var(--emni-ice);
  color: var(--emni-blue);
}

.site-footer {
  border-top: 1px solid rgba(245, 247, 250, 0.12);
  background: var(--emni-dark);
  color: #dce4ec;
}

.footer-inner {
  min-height: 9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.footer-brand { margin: 0 0 0.3rem; color: white; font-weight: 760; letter-spacing: 0.08em; }
.footer-copy { margin: 0; color: #aebbc8; font-size: 0.875rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: #f0f4f7; }

@media (max-width: 960px) {
  .page-shell { padding-top: 1.5rem; }
  .legal-layout { grid-template-columns: minmax(0, 820px); gap: 1.25rem; }
  .document-index { position: static; max-height: none; }
  .document-index ol { columns: 2; column-gap: 1.25rem; }
  .document-index li { break-inside: avoid; }
}

@media (max-width: 640px) {
  .header-inner, .footer-inner, .page-shell { width: min(100% - 1.25rem, 1240px); }
  .header-inner { min-height: 4rem; }
  .byline { display: none; }
  .header-link { font-size: 0.82rem; }
  .breadcrumb { margin-bottom: 1.25rem; }
  .document-index { padding: 0.9rem 0.8rem; }
  .document-index ol { columns: 1; }
  .document-index a { font-size: 0.82rem; }
  .legal-document { padding: 1.35rem 1.05rem 2.25rem; border-radius: 0.8rem; }
  .legal-document > .level1 > h1 + p { font-size: 0.9rem; }
  .legal-document h2 { margin-top: 3.2rem; }
  .legal-document section[id="4-google-oauth-e-dados-do-usuário-google"],
  .legal-document section[id="22-informações-específicas-para-o-google-api-services-user-data-policy"] {
    margin-inline: -0.45rem;
    padding-inline: 0.9rem 0.45rem;
  }
  .legal-document table { display: block; overflow-x: auto; }
  .footer-inner { min-height: 11rem; flex-direction: column; align-items: flex-start; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .document-index, .site-footer, .breadcrumb { display: none; }
  body { background: white; color: black; }
  .page-shell { width: 100%; padding: 0; }
  .legal-layout { display: block; }
  .legal-document { padding: 0; border: 0; box-shadow: none; }
  a { color: inherit; }
}
