:root {
  --terms-navy: #0d2f52;
  --terms-blue: #1764b0;
  --terms-lime: #7bc143;
  --terms-ink: #20364d;
  --terms-muted: #5a6f83;
  --terms-line: #d7e1ea;
  --terms-soft: #f4f8fb;
  --terms-white: #fff;
}

.terms-final-page {
  color: var(--terms-ink);
  background: var(--terms-white);
}

.terms-final-shell {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.terms-final-hero {
  padding: 62px 0 54px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 18%, rgba(123, 193, 67, .2), transparent 24%),
    linear-gradient(120deg, #081f38 0%, #0d365d 68%, #104a6c 100%);
  border-bottom: 4px solid var(--terms-lime);
}

.terms-final-hero h1 {
  max-width: 820px;
  margin: 0;
  color: #fff;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.035em;
}

.legal-document-navigation {
  position: sticky;
  top: 76px;
  z-index: 20;
  background: #eef4f8;
  border-bottom: 1px solid var(--terms-line);
  box-shadow: 0 8px 18px rgba(13, 47, 82, .08);
}

.legal-document-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.legal-document-tab {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  color: #3f566c;
  border-right: 1px solid var(--terms-line);
  border-bottom: 3px solid transparent;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.legal-document-tab:first-child { border-left: 1px solid var(--terms-line); }
.legal-document-tab:hover { color: var(--terms-navy); background: #fff; }
.legal-document-tab.is-active,
.legal-document-tab[aria-selected="true"] {
  color: var(--terms-navy);
  background: #fff;
  border-bottom-color: var(--terms-lime);
}

.legal-document-tab:focus-visible,
.legal-toc-toggle:focus-visible,
.legal-on-this-page a:focus-visible,
.legal-source-body a:focus-visible {
  outline: 3px solid #3f6de4;
  outline-offset: 3px;
}

.terms-final-content { padding: 54px 0 90px; }

.legal-reading-layout {
  display: block;
}

.terms-js .legal-reading-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 800px);
  gap: clamp(38px, 6vw, 82px);
  align-items: start;
  justify-content: center;
}

.legal-on-this-page {
  display: none;
}

.terms-js .legal-on-this-page {
  display: block;
  position: sticky;
  top: 162px;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 18px;
  background: var(--terms-soft);
  border: 1px solid var(--terms-line);
  border-radius: 12px;
}

.legal-toc-toggle {
  display: none;
  width: 100%;
  min-height: 44px;
  padding: 0 10px 10px;
  color: var(--terms-navy);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--terms-line);
  font: 800 14px/1.2 "Montserrat", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.legal-on-this-page nav {
  display: grid;
  gap: 3px;
  padding-top: 10px;
}

.legal-on-this-page a {
  padding: 8px 9px;
  color: #526a80;
  border-left: 3px solid transparent;
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

.legal-on-this-page a:hover,
.legal-on-this-page a.is-current {
  color: var(--terms-navy);
  background: #fff;
  border-left-color: var(--terms-lime);
}

.legal-on-this-page a[data-level="h3"] { padding-left: 18px; font-size: 12px; }
.legal-on-this-page a[data-level="h4"] { padding-left: 27px; font-size: 12px; }

.legal-source-body { width: min(100%, 800px); min-width: 0; margin-inline: auto; }
.terms-js .legal-source-body { width: auto; margin-inline: 0; }

.legal-source-intro {
  margin: 0 0 34px;
  padding: 18px 22px;
  color: var(--terms-navy);
  background: #eef5fa;
  border-left: 4px solid var(--terms-blue);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.65;
}

.legal-source-panel[hidden] { display: none; }
.legal-source-panel { min-width: 0; }

.legal-source-panel h2,
.legal-source-panel h3,
.legal-source-panel h4,
.legal-source-panel h5,
.legal-source-panel h6 {
  scroll-margin-top: 174px;
  color: var(--terms-navy);
  font-family: "Montserrat", Arial, sans-serif;
  line-height: 1.24;
}

.legal-source-panel h2 {
  margin: 52px 0 18px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--terms-line);
  font-size: clamp(23px, 2.8vw, 31px);
}

.legal-source-panel h3 {
  margin: 38px 0 15px;
  font-size: clamp(18px, 2.2vw, 23px);
}

.legal-source-panel h4 {
  margin: 28px 0 13px;
  font-size: 17px;
}

.legal-source-panel > h2:first-of-type { margin-top: 26px; }

.legal-source-panel p,
.legal-source-panel li,
.legal-source-panel td,
.legal-source-panel th {
  color: var(--terms-ink);
  font-family: "Roboto", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.legal-source-panel p { margin: 0 0 16px; }
.legal-source-panel ul,
.legal-source-panel ol { margin: 16px 0 24px; padding-left: 25px; }
.legal-source-panel li + li { margin-top: 10px; }
.legal-source-panel strong { color: #173653; }
.legal-source-panel a { color: #075ea8; text-underline-offset: 3px; }
.legal-source-panel a:hover { color: #073e70; }

.legal-source-panel table {
  width: 100%;
  margin-top: 26px;
  border-collapse: collapse;
  border: 1px solid var(--terms-line);
}

.legal-source-panel th,
.legal-source-panel td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--terms-line);
  text-align: left;
  vertical-align: top;
}

.legal-source-panel th {
  color: var(--terms-navy);
  background: var(--terms-soft);
  font-family: "Montserrat", Arial, sans-serif;
  font-weight: 700;
}

@media (max-width: 1020px) {
  .terms-final-shell { width: min(940px, calc(100% - 40px)); }
  .legal-document-navigation { top: 68px; }
  .terms-js .legal-reading-layout { grid-template-columns: 218px minmax(0, 1fr); gap: 34px; }
  .legal-on-this-page { top: 150px; }
}

@media (max-width: 760px) {
  .terms-final-shell { width: min(100% - 32px, 720px); }
  .terms-final-hero { padding: 42px 0 38px; }
  .terms-final-hero h1 { font-size: clamp(35px, 11vw, 48px); }
  .legal-document-navigation { position: static; }
  .legal-document-tabs { grid-template-columns: 1fr; }
  .legal-document-tab,
  .legal-document-tab:first-child { min-height: 52px; justify-content: flex-start; border: 0; border-bottom: 1px solid var(--terms-line); text-align: left; }
  .legal-document-tab.is-active,
  .legal-document-tab[aria-selected="true"] { box-shadow: inset 4px 0 0 var(--terms-lime); }
  .terms-final-content { padding: 30px 0 60px; }
  .terms-js .legal-reading-layout { grid-template-columns: 1fr; gap: 22px; }
  .terms-js .legal-on-this-page { position: static; max-height: none; }
  .terms-js .legal-toc-toggle { display: block; }
  .terms-js .legal-on-this-page nav { display: none; }
  .terms-js .legal-on-this-page.is-open nav { display: grid; }
  .legal-source-intro { margin-bottom: 24px; padding: 16px 17px; }
  .legal-source-panel h2 { margin-top: 38px; }
  .legal-source-panel p,
  .legal-source-panel li,
  .legal-source-panel td,
  .legal-source-panel th { font-size: 15px; line-height: 1.65; }
  .legal-source-panel table { display: block; overflow-x: auto; }
}

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

@media print {
  .site-header,
  .site-footer,
  .legal-document-navigation,
  .legal-on-this-page,
  #expert-dialog,
  .context-tooltip { display: none !important; }
  .terms-final-hero { padding: 0 0 18px; color: #000; background: #fff; border-bottom: 2px solid #000; }
  .terms-final-hero h1 { color: #000; font-size: 32px; }
  .terms-final-content { padding: 18px 0 0; }
  .terms-final-shell,
  .legal-reading-layout { display: block; width: 100%; }
  .legal-source-panel[hidden] { display: block; }
  .legal-source-panel { break-before: page; }
  .legal-source-panel::before {
    content: attr(data-legal-label);
    display: block;
    margin: 0 0 20px;
    color: #000;
    font: 700 24px/1.25 "Montserrat", Arial, sans-serif;
  }
  .legal-source-panel:first-of-type { break-before: auto; }
  .legal-source-panel a { color: #000; }
}
