.terms-page {
  padding: var(--space-8) 0;
  background-color: var(--color-background);
}

.breadcrumb {
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
}

.breadcrumb__item:not(:last-child)::after {
  content: "/";
  margin-left: var(--space-2);
  color: var(--color-warm-gray-400);
}

.breadcrumb__link {
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

.breadcrumb__link:hover {
  color: var(--color-accent);
}

.breadcrumb__link[aria-current="page"] {
  color: var(--color-text-secondary);
  pointer-events: none;
}

.terms-page__header {
  text-align: center;
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.terms-page__title {
  font-size: var(--text-4xl);
  color: var(--color-sage-900);
  margin-bottom: var(--space-3);
  font-family: var(--font-heading);
}

.terms-page__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  max-width: none;
}

.terms-page__last-update {
  font-size: var(--text-sm);
  color: var(--color-warm-gray-600);
  font-style: italic;
  margin-bottom: 0;
}

.terms-page__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .terms-page__layout {
    grid-template-columns: 280px 1fr;
    gap: var(--space-10);
  }
}

.terms-page__sidebar {
  order: -1;
}

@media (min-width: 1024px) {
  .terms-page__sidebar {
    order: 0;
  }
}

.terms-toc {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: sticky;
  top: var(--space-6);
}

.terms-toc__title {
  font-size: var(--text-lg);
  font-family: var(--font-heading);
  color: var(--color-sage-900);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-sage-200);
}

.terms-toc__list {
  list-style: none;
}

.terms-toc__list li {
  margin-bottom: var(--space-2);
}

.terms-toc__list a {
  display: block;
  padding: var(--space-2) 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
  border-left: 3px solid transparent;
  padding-left: var(--space-3);
  margin-left: calc(-1 * var(--space-3));
  transition: all var(--transition-fast);
}

.terms-toc__list a:hover {
  color: var(--color-primary);
  border-left-color: var(--color-sage-400);
}

.terms-toc__link--active {
  color: var(--color-primary) !important;
  border-left-color: var(--color-sage-600) !important;
  font-weight: 500;
}

.terms-page__content {
  max-width: 75ch;
}

.terms-section {
  margin-bottom: var(--space-10);
  scroll-margin-top: var(--space-8);
}

.terms-section:last-child {
  margin-bottom: 0;
}

.terms-section h2 {
  font-size: var(--text-2xl);
  color: var(--color-sage-900);
  margin-bottom: var(--space-4);
  font-family: var(--font-heading);
  font-weight: 600;
}

.terms-section p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
  text-align: justify;
}

.terms-section a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.terms-section a:hover {
  color: var(--color-accent-hover);
}

@media print {
  .terms-page__sidebar,
  .breadcrumb {
    display: none;
  }
  
  .terms-page {
    padding: 0;
  }
  
  .terms-section {
    break-inside: avoid;
    margin-bottom: var(--space-6);
  }
  
  .terms-section h2 {
    break-after: avoid;
  }
  
  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }
  
  a {
    text-decoration: none;
    color: black;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 90%;
    opacity: 0.8;
  }
}