:root {
  --font-head: var(--font-display);
  --font-body: var(--font-sans);
  --r-sm: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;
  --shadow-2: 0 10px 25px -5px rgba(15, 23, 42, 0.18);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.legal-body {
  background: var(--white);
}

.legal-hero {
  position: relative;
  overflow: hidden;
  padding: 7.75rem 0 3.25rem;
  background: linear-gradient(180deg, var(--slate-50) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--slate-200);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font: 500 0.8125rem/1.25rem var(--font-body);
  color: var(--slate-500);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--slate-600);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs .sep {
  color: var(--slate-400);
  display: inline-flex;
  align-items: center;
}

.breadcrumbs .current {
  color: var(--primary-dark);
  font-weight: 700;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #E0F2FE;
  border: 1px solid #BAE6FD;
  color: var(--primary-dark);
  font: 600 12px/16px var(--font-body);
}

.legal-hero-head {
  max-width: 840px;
}

.legal-hero h1 {
  font-size: clamp(2rem, 3.5vw, 2.625rem);
  line-height: 1.18;
  font-weight: 800;
  margin: 0.875rem 0 1rem;
  color: var(--slate-900);
}

.legal-hero .lead {
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--slate-600);
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--slate-200);
  font-size: 0.8125rem;
  color: var(--slate-600);
}

.legal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legal-meta .material-symbols-outlined,
.legal-meta .icon-svg {
  font-size: 1.125rem;
  color: var(--primary);
}

.legal-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  padding: 3.5rem 0 4rem;
}

.legal-sidebar {
  position: sticky;
  top: 6.25rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  max-height: calc(100vh - 7.5rem);
  overflow-y: auto;
}

.legal-sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 700 0.75rem/1rem var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-900);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--slate-200);
}

.legal-sidebar-title .icon-svg {
  color: var(--primary);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-list a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  border-left: 2px solid transparent;
  font: 500 0.8125rem/1.25rem var(--font-body);
  color: var(--slate-600);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.toc-list a:hover {
  color: var(--primary-dark);
  background: var(--white);
}

.toc-list a.active {
  color: var(--primary-dark);
  background: #E0F2FE;
  border-left-color: var(--primary);
  font-weight: 700;
}

.sidebar-card {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-200);
  font-size: 0.78125rem;
  line-height: 1.45;
  color: var(--slate-600);
}

.sidebar-card strong {
  display: block;
  color: var(--slate-900);
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
}

.sidebar-card a {
  color: var(--primary-dark);
  font-weight: 600;
}

.sidebar-card a:hover {
  text-decoration: underline;
}

.legal-content {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--r-xl);
  padding: 3rem 3.5rem;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.05);
}

.legal-summary-box {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.25rem;
}

.legal-summary-box h2 {
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0 0 0.5rem !important;
  padding: 0 !important;
  border: 0 !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-summary-box p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--slate-600);
  margin: 0 !important;
}

.legal-section {
  scroll-margin-top: 6.5rem;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--slate-100);
}

.legal-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-section h2 {
  font-size: 1.375rem;
  line-height: 1.35;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.legal-section h2 .sec-num {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: #E0F2FE;
  color: var(--primary-dark);
  font: 800 0.8125rem/1 var(--font-head);
}

.legal-section h3 {
  font-size: 1.0625rem;
  line-height: 1.45;
  font-weight: 700;
  color: var(--slate-800);
  margin: 1.5rem 0 0.625rem;
}

.legal-section p {
  font-size: 0.96875rem;
  line-height: 1.7;
  color: var(--slate-600);
  margin-bottom: 0.875rem;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul,
.legal-section ol {
  margin: 0.75rem 0 1rem;
  padding-left: 1.375rem;
  color: var(--slate-600);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.legal-section ul {
  list-style: disc;
}

.legal-section ol {
  list-style: decimal;
}

.legal-section li strong,
.legal-section p strong {
  color: var(--slate-800);
}

.legal-section a,
.ntx-link,
.ntx360-link {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}

.legal-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--r-md);
  padding: 1.25rem;
}

.legal-card h4 {
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-card p {
  font-size: 0.84375rem !important;
  line-height: 1.55 !important;
  color: var(--slate-600);
  margin: 0 !important;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 1.125rem 0;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-md);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.legal-table th {
  background: var(--slate-50);
  color: var(--slate-800);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--slate-200);
}

.legal-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-600);
  vertical-align: top;
}

.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-contact-box {
  background: linear-gradient(135deg, var(--slate-900), #1E293B);
  color: var(--white);
  border-radius: var(--r-lg);
  padding: 1.75rem 2rem;
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.legal-contact-box h3 {
  color: var(--white) !important;
  margin: 0 0 0.5rem !important;
  font-size: 1.125rem;
}

.legal-contact-box p {
  color: var(--slate-300) !important;
  font-size: 0.875rem !important;
  line-height: 1.55 !important;
  margin: 0 !important;
}

.legal-contact-box ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0.875rem 0 0 !important;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.legal-contact-box li {
  color: var(--slate-200);
  font-size: 0.84375rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legal-contact-box .material-symbols-outlined,
.legal-contact-box .icon-svg {
  color: #7DD3FC;
  font-size: 1.125rem;
}

.legal-contact-box a:not(.btn) {
  color: #7DD3FC !important;
  text-decoration: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.375rem;
  border-radius: 0.625rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost {
  background: var(--slate-100);
  color: var(--slate-800) !important;
  border: 1px solid var(--slate-300);
}

.btn-ghost:hover {
  background: var(--slate-200);
  color: var(--slate-900) !important;
}

.btn-action {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: var(--white) !important;
  box-shadow: 0 8px 20px -4px rgba(194, 65, 12, 0.35);
}

.btn-action:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.legal-bottom-nav {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--slate-200);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  width: 2.875rem;
  height: 2.875rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: 0;
  box-shadow: var(--shadow-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease), background 0.2s;
}

.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

@media (max-width: 1023px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .legal-sidebar {
    position: static;
    max-height: none;
  }
  .legal-content {
    padding: 2rem 1.75rem;
  }
  .legal-grid-cards {
    grid-template-columns: 1fr;
  }
  .legal-contact-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .legal-hero {
    padding: 6.75rem 0 2rem;
  }
  .legal-hero h1 {
    font-size: 1.75rem;
    line-height: 1.25;
  }
  .legal-content {
    padding: 1.5rem 1.125rem;
  }
  .legal-section h2 {
    font-size: 1.1875rem;
    line-height: 1.35;
  }
}
