html:has(.legal-body),
body.legal-body {
  min-width: 0;
}

.legal-body {
  min-height: 100dvh;
  background: var(--brand-bg);
}

.legal-bar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(20px, 4vw, 56px);
}

.legal-brand .brand-logo {
  display: block;
  width: clamp(112px, 12vw, 148px);
  height: auto;
}

.legal-back {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-purple-deep);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 800;
  text-decoration: none;
}

.legal-page {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 24px clamp(18px, 3vw, 36px) 64px;
}

.legal-card {
  min-height: 60vh;
  padding: clamp(28px, 5vw, 60px) clamp(24px, 7vw, 76px);
  border: 1px solid #e4e7f2;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--card-shadow);
}

.legal-heading {
  padding-bottom: 28px;
  border-bottom: 1px solid #eef0f7;
}

.legal-title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 14px 0 0;
  color: #7b84a2;
  font-size: 14px;
  line-height: 1.7;
}

.legal-content {
  color: #3f4a6b;
  font-size: 16px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.legal-content h2,
.legal-content h3,
.legal-content h4,
.legal-content h5,
.legal-content h6 {
  margin: 34px 0 0;
  color: #30206f;
  font-weight: 900;
  line-height: 1.55;
  scroll-margin-top: 24px;
}

.legal-content h2 { font-size: 25px; }
.legal-content h3 { margin-top: 28px; font-size: 21px; }
.legal-content h4 { margin-top: 24px; font-size: 18px; }
.legal-content h5,
.legal-content h6 { margin-top: 20px; font-size: 16px; }

.legal-content p {
  margin: 16px 0 0;
}

.legal-content strong {
  color: #2b2450;
  font-weight: 900;
}

.legal-content ul,
.legal-content ol {
  margin: 10px 0 0;
  padding-left: 1.6em;
}

.legal-content li {
  margin-top: 8px;
  padding-left: 0.2em;
}

.legal-content li::marker {
  color: var(--brand-purple);
  font-weight: 800;
}

.legal-table-wrap {
  width: 100%;
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid #e4e7f2;
  border-radius: 12px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  color: #47516f;
  font-size: 14px;
  line-height: 1.7;
}

.legal-table th,
.legal-table td {
  min-width: 130px;
  padding: 12px 14px;
  border-right: 1px solid #e4e7f2;
  border-bottom: 1px solid #e4e7f2;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  color: #30206f;
  background: #f2f0ff;
  font-weight: 900;
}

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

.legal-content hr {
  height: 1px;
  margin: 30px 0;
  border: 0;
  background: #e9ebf4;
}

.legal-footer {
  padding-top: 42px;
  color: #9aa1b8;
  font-size: 13px;
  text-align: center;
}

.legal-loading,
.legal-error {
  padding: 72px 0;
  text-align: center;
}

.legal-loading { color: var(--text-secondary); }

.legal-error-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 900;
}

.legal-error-message {
  margin: 12px 0 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal-retry { margin-top: 24px; }

@media (max-width: 640px) {
  .legal-bar { min-height: 64px; padding: 12px 18px; }
  .legal-page { padding: 12px 12px 36px; }
  .legal-card { padding: 24px 20px 30px; border-radius: 18px; }
  .legal-title { font-size: 28px; }
  .legal-content { font-size: 15px; }
  .legal-content h2 { font-size: 22px; }
  .legal-content h3 { font-size: 19px; }
  .legal-table th,
  .legal-table td { padding: 10px 12px; }
}
