.terms-section {
  padding-top: 8px;
  padding-bottom: 88px;
}

.terms-layout {
  display: grid;
  grid-template-columns: minmax(196px, 232px) minmax(0, 72ch);
  gap: 28px 64px;
  align-items: start;
}

.terms-nav {
  position: sticky;
  top: calc(var(--header) + 18px);
  max-height: calc(100vh - var(--header) - 36px);
  overflow: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.terms-nav::-webkit-scrollbar { width: 8px; }
.terms-nav::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 999px;
}

.terms-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: madde;
}

.terms-nav li { counter-increment: madde; }

.terms-nav a {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 7px 0 7px 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  text-decoration: none;
}

.terms-nav a::before {
  content: counter(madde);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--navy);
}

.terms-nav a:hover { color: var(--ink); }

.terms-nav a.is-current {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--navy);
}

.terms-nav a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 6px;
}

.terms-doc {
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.terms-doc ::selection {
  background: #e4c56a;
  color: #111827;
}

.terms-updated {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.terms-doc h2 {
  margin: 2.4rem 0 0.7rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  scroll-margin-top: calc(var(--header) + 18px);
}

.terms-doc h2:first-of-type { margin-top: 0.2rem; }

.terms-doc p { margin: 0 0 0.95rem; }

.terms-doc a {
  color: var(--navy);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.terms-doc a:hover { color: var(--navy-2); }

.terms-doc a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 4px;
}

.terms-doc ul {
  margin: 0.15rem 0 1rem;
  padding: 0;
  list-style: none;
}

.terms-doc li {
  position: relative;
  margin: 0.42rem 0;
  padding-left: 1.15rem;
}

.terms-doc li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.terms-notice {
  margin: 1.15rem 0 1.15rem;
  padding: 18px 20px;
  border: 1px solid #ead9a8;
  border-radius: 20px;
  background: #fbf6ea;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
  line-height: 1.55;
}

.terms-notice strong { font-weight: 800; }

.terms-end {
  margin-top: 2rem;
  padding: 22px 24px 8px;
}

.terms-end p { margin-bottom: 0.7rem; }

.terms-sign {
  margin-top: 0.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (max-width: 991.98px) {
  .terms-layout { display: block; }

  .terms-nav {
    position: static;
    max-height: none;
    overflow: visible;
    margin: 0 0 28px;
    padding: 0;
  }

  .terms-nav ol {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .terms-nav ol::-webkit-scrollbar { display: none; }

  .terms-nav li { flex: 0 0 auto; }

  .terms-nav a {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    white-space: nowrap;
  }

  .terms-nav a.is-current {
    border-color: var(--navy);
    background: var(--soft);
  }
}

@media (max-width: 767.98px) {
  .terms-section { padding-bottom: 64px; }
  .terms-doc { font-size: 1rem; }
  .terms-doc h2 { font-size: 1.2rem; }
  .terms-notice,
  .terms-end { padding: 16px 16px 6px; }
  .terms-notice { padding-bottom: 16px; }
}

html[data-theme="dark"] .terms-notice {
  background: #2a2416;
  border-color: #6b5830;
  color: #f6edd8;
  box-shadow: none;
}

html[data-theme="dark"] .terms-nav a {
  background: transparent;
}

html[data-theme="dark"] .terms-doc ::selection {
  background: #c6a046;
  color: #111827;
}

@media (max-width: 991.98px) {
  html[data-theme="dark"] .terms-nav a {
    background: #162033;
    border-color: #2c3b54;
    color: #a8b3c7;
  }

  html[data-theme="dark"] .terms-nav a.is-current {
    background: #1c283d;
    border-color: #9eb6e8;
    color: #e8edf5;
  }
}

@media print {
  .terms-nav,
  .site-header,
  .topbar,
  .site-footer,
  .to-top { display: none !important; }

  .terms-layout { display: block; }
  .terms-doc { max-width: none; font-size: 11pt; }
  .terms-notice,
  .terms-end { box-shadow: none; }
}
