.terms-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: var(--space-8);
}

.terms-hero {
  grid-column: 1 / -1;
  margin-bottom: var(--space-4);
}

.terms-meta {
  margin-top: var(--space-3);
}

.terms-content-wrapper {
  display: contents;
}

.terms-toc {
  align-self: flex-start;
  position: sticky;
  top: 6rem;
}

.terms-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.terms-toc a {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.terms-toc a:hover {
  color: var(--color-primary-strong);
}

.terms-content {
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.terms-section + .terms-section {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-200);
}

.terms-section h2 {
  font-size: var(--font-size-2xl);
}

.terms-section h3 {
  font-size: var(--font-size-lg);
  margin-top: var(--space-4);
}

.terms-section ul {
  margin: var(--space-2) 0 var(--space-4);
  padding-left: 1.2rem;
}

.terms-section li {
  margin-bottom: 0.3rem;
}

@media (max-width: 992px) {
  .terms-layout {
    grid-template-columns: 1fr;
  }

  .terms-toc {
    position: static;
    order: -1;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background-color: var(--color-surface-soft);
  }

  .terms-content {
    padding: var(--space-4);
  }
}

@media (max-width: 600px) {
  .terms-hero .hero-title {
    font-size: clamp(2rem, 7vw, 2.4rem);
  }

  .terms-toc ul {
    flex-wrap: wrap;
    flex-direction: row;
    gap: 0.6rem 1.2rem;
  }
}
