.terms-page {
  min-height: 100vh;
  background: var(--background-deep);
  color: var(--text-primary);
}

.terms-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background-deep) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.terms-header-inner {
  width: min(1040px, calc(100% - 2rem));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.terms-shell {
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) 0 5rem;
}

.terms-document {
  padding: clamp(1.4rem, 4vw, 3.25rem);
}

.terms-document-heading {
  padding-bottom: 1.4rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.terms-document-heading h1 {
  margin: .35rem 0 .45rem;
  font-size: clamp(2rem, 5vw, 3.15rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.terms-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: .92rem;
}

.terms-content {
  max-width: 76ch;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.terms-content h2,
.terms-content h3,
.terms-content h4 {
  margin: 2rem 0 .75rem;
  line-height: 1.2;
  color: var(--text-primary);
}

.terms-content h2 { font-size: 1.55rem; }
.terms-content h3 { font-size: 1.25rem; }
.terms-content h4 { font-size: 1.08rem; }
.terms-content p { margin: 0 0 1rem; }
.terms-content ul,
.terms-content ol { margin: .65rem 0 1.2rem; padding-left: 1.5rem; }
.terms-content li + li { margin-top: .4rem; }
.terms-content a { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }

.terms-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: var(--text-secondary);
}
.terms-empty p { margin: .5rem 0 0; }

@media (max-width: 640px) {
  .terms-header-inner,
  .terms-shell { width: min(100% - 1rem, 900px); }
  .terms-header-inner { min-height: 62px; }
  .terms-header .logo { font-size: .9rem; }
  .terms-document { padding: 1.15rem; }
}
