:root {
  color-scheme: light;
  --dl-bg-lavender: #f0e9ff;
  --dl-ink: #221d46;
  --dl-muted: #4b456c;
  --dl-accent: #4e34bc;
  --dl-accent-hover: #3b2499;
  --dl-header-bg: rgba(26, 22, 71, 0.90);
  --dl-footer-bg: #1f1952;
}

.legal-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--dl-ink);
  background:
    radial-gradient(ellipse min(33rem, 37vw) 24rem at 0 23rem, rgba(210, 187, 248, 0.38), transparent 100%),
    radial-gradient(ellipse min(32rem, 35vw) 27rem at 100% 40rem, rgba(222, 207, 250, 0.52), transparent 100%),
    linear-gradient(165deg, #f8f4ff, var(--dl-bg-lavender) 48%, #f6f2ff);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

.legal-page *,
.legal-page *::before,
.legal-page *::after {
  box-sizing: border-box;
}

.legal-page a {
  color: inherit;
  text-decoration: none;
}

.legal-page a:focus-visible,
.legal-page select:focus-visible {
  outline: 2px solid #fde68a;
  outline-offset: 2px;
  border-radius: 6px;
}

.legal-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.legal-page .skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  transform: translateY(-180%);
  z-index: 50;
  background: #fde68a;
  color: #1a1647;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.legal-page .skip-link:focus {
  transform: translateY(0);
}

/* Header matching apps/web SiteHeader */
.legal-page .legal-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--dl-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
}

.legal-page .legal-header-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-page .legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.legal-page .legal-brand .brand-icon {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 7px rgba(245, 211, 140, 0.38));
}

.legal-page .legal-brand .brand-wordmark {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.legal-page .legal-brand .brand-suffix {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.legal-page .legal-brand .brand-suffix:empty {
  display: none;
}

.legal-page .header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legal-page .locale-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
}

.legal-page .locale-switcher svg {
  width: 14px;
  height: 14px;
  color: #fde68a;
  flex-shrink: 0;
}

.legal-page .locale-switcher select {
  background: transparent;
  border: 0;
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding-right: 2px;
}

.legal-page .locale-switcher select option {
  background: #1b174a;
  color: #fff;
}

.legal-page .header-link {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.legal-page .header-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.legal-page .header-link-primary {
  background: #fff;
  color: #3f2ca8;
  font-weight: 600;
}

.legal-page .header-link-primary:hover {
  background: #fffbeb;
  color: #3f2ca8;
}

/* Main glass card matching apps/web LegalPage */
.legal-page .legal-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.legal-page .legal-card {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.80);
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 20px 50px -24px rgba(59, 41, 128, 0.18);
}

.legal-page .legal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.legal-page .back-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  font-size: 14px;
  font-weight: 600;
  color: var(--dl-accent);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.legal-page .back-pill:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
}

.legal-page .back-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.legal-page .doc-tabs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.legal-page .doc-tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dl-muted);
  transition: background 0.18s ease, color 0.18s ease;
}

.legal-page .doc-tabs a:hover {
  background: rgba(78, 52, 188, 0.08);
  color: var(--dl-accent);
}

.legal-page .doc-tabs a[aria-current="page"] {
  background: #4e34bc;
  color: #fff;
}

.legal-page h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--dl-ink);
}

.legal-page .legal-intro {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--dl-muted);
}

.legal-page .legal-link {
  color: var(--dl-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.legal-page .legal-link:hover {
  color: var(--dl-accent-hover);
}

.legal-page .identity-box {
  margin: 24px 0 0;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid #e0e7ff;
  background: rgba(238, 242, 255, 0.65);
  font-size: 14px;
  line-height: 1.65;
  color: var(--dl-muted);
  display: grid;
  gap: 12px;
}

.legal-page .identity-box dt {
  font-weight: 600;
  color: var(--dl-ink);
  margin: 0 0 2px;
}

.legal-page .identity-box dd {
  margin: 0;
}

.legal-page .merchant-inline-link {
  margin-left: 12px;
  display: inline-block;
}

.legal-page .legal-sections {
  margin-top: 32px;
  display: grid;
  gap: 28px;
}

.legal-page .legal-section {
  scroll-margin-top: 100px;
}

.legal-page .legal-section h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--dl-ink);
}

.legal-page .legal-section p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--dl-muted);
}

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

.legal-page .legal-subsection {
  padding-top: 14px;
}

.legal-page .legal-subsection h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--dl-ink);
}

/* Footer matching apps/web SiteFooter */
.legal-page .legal-footer {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(117, 88, 198, 0.35), transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(78, 52, 188, 0.28), transparent 55%),
    var(--dl-footer-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

.legal-page .legal-footer-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 36px 24px 32px;
}

.legal-page .footer-brand-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}

.legal-page .footer-brand-row .legal-brand .brand-icon {
  height: 28px;
}

.legal-page .footer-brand-row .legal-brand .brand-wordmark {
  height: 34px;
}

.legal-page .footer-tagline {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.75);
}

.legal-page .footer-disclaimer {
  margin: 22px 0 0;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.legal-page .footer-bottom {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.legal-page .footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.legal-page .footer-nav a {
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.15s ease;
}

.legal-page .footer-nav a:hover,
.legal-page .footer-nav a[aria-current="page"] {
  color: #fff;
}

@media (max-width: 640px) {
  .legal-page .legal-header-inner {
    padding: 10px 16px;
  }

  .legal-page .legal-brand .brand-icon {
    height: 26px;
  }

  .legal-page .legal-brand .brand-wordmark {
    height: 30px;
  }

  .legal-page .legal-brand .brand-suffix {
    font-size: 12px;
  }

  .legal-page .header-link-company {
    display: none;
  }

  .legal-page .legal-main {
    padding: 28px 16px 48px;
  }

  .legal-page .legal-card {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .legal-page h1 {
    font-size: 22px;
  }

  .legal-page .legal-footer-inner {
    padding: 28px 16px 26px;
  }
}
