:root {
  --font-base: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #010101;
  --bg-top: #041127;
  --surface-card: #101010;
  --surface-soft: rgba(255, 255, 255, 0.05);
  --surface-control: rgba(255, 255, 255, 0.12);
  --text: #fff;
  --text-inverse: #000;
  --text-muted: rgba(255, 255, 255, 0.46);
  --text-body: rgba(255, 255, 255, 0.72);
  --text-soft: rgba(255, 255, 255, 0.84);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-control: rgba(255, 255, 255, 0.13);
  --accent-blue: #76a9ff;
  --accent-blue-soft: #cfe1ff;
  --accent-blue-haze: rgba(64, 130, 222, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(25, 75, 143, 0.34), transparent 42vw),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 420px, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

.legal-page {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(18px, 2.5vw, 42px) clamp(16px, 4vw, 42px) clamp(48px, 6vw, 96px);
}

.legal-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  margin-bottom: clamp(44px, 7vw, 104px);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.legal-brand img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.legal-doc-tabs,
.legal-lang-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border-card);
  border-radius: 18px;
}

.legal-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 14px;
  color: var(--text-body);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.legal-tab:hover {
  background: var(--surface-control);
  color: var(--text);
}

.legal-tab.is-active {
  background: var(--text);
  color: var(--text-inverse);
}

.legal-actions {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.legal-app-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 16px;
  background: var(--text);
  color: var(--text-inverse);
  font-size: 14px;
  font-weight: 700;
}

.legal-hero {
  max-width: 920px;
  margin: 0 auto clamp(24px, 4vw, 56px);
  text-align: center;
}

.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 18px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(118, 169, 255, 0.1);
  border: 1px solid rgba(118, 169, 255, 0.28);
  color: var(--accent-blue-soft);
  font-size: 13px;
  font-weight: 700;
}

.legal-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 5vw, 76px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
}

.legal-hero p {
  max-width: 760px;
  margin: clamp(14px, 2vw, 24px) auto 0;
  color: var(--text-body);
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 500;
  line-height: 1.5;
}

.legal-card {
  position: relative;
  overflow: hidden;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px);
  border-radius: clamp(22px, 2.4vw, 34px);
  background: var(--surface-card);
  border: 1px solid var(--border-card);
}

.legal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 0%, var(--accent-blue-haze), transparent 34%);
  pointer-events: none;
}

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

.legal-state {
  color: var(--text-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.legal-state:empty { display: none; }

.legal-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 16px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--text);
  color: var(--text-inverse);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

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

.legal-content h2 {
  margin: 30px 0 10px;
  color: var(--text);
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 700;
  line-height: 1.25;
}

.legal-content h2:first-of-type { margin-top: 0; }

.legal-content p {
  margin: 10px 0;
  color: var(--text-body);
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 500;
  line-height: 1.68;
}

.legal-content ul,
.legal-content ol {
  margin: 10px 0;
  padding-left: 22px;
  color: var(--text-body);
}

.legal-content li {
  margin: 6px 0;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.68;
}

.legal-content strong { color: var(--text); }

.legal-content a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-footer {
  max-width: 920px;
  margin: 28px auto 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 760px) {
  .legal-page { padding: 16px 16px 54px; }
  .legal-topbar {
    grid-template-columns: 1fr;
    margin-bottom: 44px;
  }
  .legal-brand,
  .legal-actions {
    justify-self: stretch;
  }
  .legal-brand { justify-content: center; }
  .legal-doc-tabs,
  .legal-lang-tabs,
  .legal-app-link {
    width: 100%;
  }
  .legal-doc-tabs,
  .legal-lang-tabs {
    overflow-x: auto;
  }
  .legal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .legal-tab { flex: 1 0 auto; }
  .legal-hero { text-align: left; }
  .legal-card { padding: 22px 18px 26px; }
}
