.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(145deg, #93ffd0, #7685ff 61%, #816eff);
  box-shadow: 0 8px 22px rgba(109, 112, 248, 0.3);
}

.brand-mark img {
  width: 100%;
  height: 100%;
}

.legal-main {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: max(30px, calc(30px + var(--safe-top))) 0 max(70px, calc(70px + var(--safe-bottom)));
}

.legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 38px;
}

.legal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-back {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted-strong);
  background: var(--panel-soft);
  font-size: 14px;
  font-weight: 720;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.legal-back:hover,
.legal-back:focus-visible {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  transform: translateY(-1px);
}

.legal-theme {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  background: var(--panel-soft);
  font-size: 17px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.legal-theme:hover,
.legal-theme:focus-visible {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  transform: translateY(-1px);
}

.legal-card {
  position: relative;
  overflow: hidden;
  padding: clamp(23px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(119, 128, 255, 0.16), transparent 26%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, transparent), color-mix(in srgb, var(--panel) 80%, transparent));
  box-shadow: var(--shadow);
}

.legal-card::before {
  position: absolute;
  top: -170px;
  right: -120px;
  width: 430px;
  height: 330px;
  border-radius: 50%;
  content: "";
  background: rgba(110, 119, 255, .15);
  filter: blur(60px);
  pointer-events: none;
}

.legal-card > * { position: relative; }

.legal-kicker {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid rgba(130, 131, 255, 0.24);
  border-radius: 999px;
  color: #d9ddff;
  background: rgba(111, 105, 255, 0.1);
  font-size: 12px;
  font-weight: 750;
}

html[data-theme="light"] .legal-kicker {
  color: #4f548d;
}

.legal-card h1 {
  max-width: 690px;
  margin: 14px 0 7px;
  font-size: clamp(35px, 6vw, 57px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.legal-updated {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.legal-note {
  margin: 27px 0 30px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 190, 115, 0.26);
  border-radius: 16px;
  color: #efd2b1;
  background: rgba(255, 174, 98, 0.08);
  font-size: 14px;
  line-height: 1.58;
}

html[data-theme="light"] .legal-note {
  color: #7b502f;
}

.legal-card h2 {
  margin: 34px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 21px;
  letter-spacing: -0.035em;
}

.legal-card h1 + .legal-updated,
.legal-kicker + h1 { position: relative; }

.legal-card p,
.legal-card li {
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.68;
}

.legal-card p {
  margin: 0;
}

.legal-card p + p {
  margin-top: 11px;
}

.legal-card ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
  margin: 12px 0 0;
}

.legal-list {
  margin: 14px 0 18px;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 18px 0 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.legal-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  color: var(--muted-strong);
  font-size: 14px;
}

.legal-table th,
.legal-table td {
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal-table th:last-child,
.legal-table td:last-child {
  border-right: 0;
}

.legal-table tbody tr:last-child td {
  border-bottom: 0;
}

.legal-table th {
  color: var(--text);
  background: var(--panel-soft);
  font-weight: 760;
}

.legal-card a {
  color: #aebdff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.company-intro {
  max-width: 650px;
  margin-top: 12px !important;
  font-size: 16px !important;
}

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

.company-card {
  display: grid;
  min-height: 170px;
  align-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

.company-card.is-wide { grid-column: 1 / -1; min-height: 130px; }
.company-card-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: #07121a; background: linear-gradient(135deg, #71e8ae, #858aff); font-weight: 900; }
.company-card h2 { margin: 18px 0 7px; padding: 0; border: 0; font-size: 18px; }
.company-card p { color: var(--muted) !important; }
.company-card a { display: inline-flex; margin-top: 14px; font-weight: 760; }
.requisites-callout { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 28px; padding: 20px; border: 1px solid rgba(100,226,160,.22); border-radius: 18px; background: rgba(86,215,145,.07); }
.requisites-callout b { display: block; margin-bottom: 4px; }
.requisites-callout .button { color: #07121a; text-decoration: none; white-space: nowrap; }

@media (max-width: 580px) {
  .legal-main {
    width: min(100% - 28px, 900px);
    padding-top: calc(18px + var(--safe-top));
  }

  .legal-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
  }

  .legal-actions {
    width: 100%;
  }

  .legal-back {
    flex: 1;
  }

  .legal-card {
    border-radius: 23px;
  }

  .legal-card h2 {
    font-size: 19px;
  }

  .company-grid { grid-template-columns: 1fr; }
  .company-card.is-wide { grid-column: auto; }
  .requisites-callout { align-items: flex-start; flex-direction: column; }
}
