.legal-document {
  --topbar-height: 72px;
  background: #f4f7fb;
}

.legal-document .topbar {
  border-top: 1px solid #111111;
}

.legal-document .topbar__inner {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.legal-document .brand {
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  flex-shrink: 1;
}

.legal-document .brand__logo {
  width: 58px;
  height: 58px;
}

.legal-document .brand__divider {
  height: 24px;
}

.legal-document .brand__text {
  font-size: 1rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legal-document .topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

.legal-document .topbar-link {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #243140;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid #dce6f1;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 8px 18px rgba(23, 32, 45, 0.06);
  flex-shrink: 0;
}

.legal-document .topbar-link--accent {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #ff6a2a, #ff8a52);
}

.legal-page {
  padding: 24px 0 8px;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 248px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.legal-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(23, 32, 45, 0.08);
}

.legal-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 16px);
  padding: 18px 16px;
}

.legal-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 106, 42, 0.18);
  background: #fff4ec;
  color: #143d8f;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal-sidebar h2,
.legal-section h2,
.legal-hero h1 {
  margin: 0;
}

.legal-sidebar h2 {
  margin-top: 14px;
  font-size: 1.34rem;
  line-height: 1.12;
  color: #13254f;
}

.legal-sidebar p {
  margin: 10px 0 0;
  color: #6b7a8d;
  font-size: 0.93rem;
  line-height: 1.7;
}

.legal-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.legal-nav a {
  display: block;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
  color: #182233;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(23, 32, 45, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.legal-nav a:hover {
  color: #143d8f;
  border-color: #c7d7ea;
  transform: translateY(-1px);
}

.legal-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.legal-hero,
.legal-section {
  padding: 26px 28px;
}

.legal-hero h1 {
  margin-top: 16px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: #13254f;
}

.legal-hero p,
.legal-section p,
.legal-section li {
  color: #667489;
  line-height: 1.78;
}

.legal-hero p {
  margin: 12px 0 0;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.legal-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
  color: #143d8f;
  font-size: 0.84rem;
  font-weight: 700;
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.legal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #c7d7ea;
  background: #ffffff;
  color: #143d8f;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.legal-button:hover {
  transform: translateY(-1px);
  border-color: #a8c2e1;
}

.legal-button--primary {
  border-color: #ff8d57;
  background: linear-gradient(135deg, #ff7a2f, #ff9c66);
  color: #ffffff;
}

.legal-button--primary:hover {
  border-color: #ff7a2f;
}

.legal-section h2 {
  margin-top: 14px;
  font-size: 1.58rem;
  line-height: 1.08;
  color: #13254f;
}

.legal-section p:first-of-type {
  margin-top: 12px;
}

.legal-section p:last-child,
.legal-section li:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.legal-section li + li {
  margin-top: 8px;
}

.legal-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.legal-info-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
}

.legal-info-card h3 {
  margin: 0 0 8px;
  color: #143d8f;
  font-size: 0.98rem;
}

.legal-info-card p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.65;
}

.legal-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 106, 42, 0.2);
  background: linear-gradient(180deg, #fff8f1 0%, #fff0e4 100%);
  color: #675845;
}

.legal-note strong {
  color: #143d8f;
}

.legal-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

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

  .legal-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .legal-document {
    --topbar-height: 66px;
  }

  .legal-document .topbar__inner {
    gap: 8px;
  }

  .legal-document .brand__logo {
    width: 50px;
    height: 50px;
  }

  .legal-document .brand__divider {
    display: none;
  }

  .legal-document .brand__text {
    font-size: 0.92rem;
  }

  .legal-document .topbar__actions {
    gap: 6px;
  }

  .legal-document .topbar-link {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.74rem;
    border-radius: 11px;
  }

  .legal-page {
    padding-top: 18px;
  }

  .legal-hero,
  .legal-section,
  .legal-sidebar {
    padding: 20px 18px;
  }

  .legal-hero h1 {
    font-size: 2rem;
  }

  .legal-info-grid,
  .legal-contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .legal-document .brand__text {
    font-size: 0.84rem;
  }

  .legal-document .topbar__actions {
    gap: 4px;
  }

  .legal-document .topbar-link {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.68rem;
  }
}
