:root {
  --blue: #2763eb;
  --blue-dark: #1452df;
  --navy: #06122d;
  --text: #0b1734;
  --muted: #536078;
  --line: #dce4f2;
  --soft: #f4f7fc;
  --white: #fff;
  --warning-bg: #fff8e8;
  --warning-line: #f2d28b;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--soft);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.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;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--white);
  background: var(--navy);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.legal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 228, 242, .9);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}
.legal-header-inner {
  width: min(1080px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.legal-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 7px 18px rgba(65, 82, 226, .18);
}
.legal-header-actions { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; font-weight: 650; }
.legal-header-actions > a:hover, .legal-header-actions > a:focus-visible { color: var(--blue); }
.legal-language-picker { position: relative; display: inline-flex; align-items: center; }
.legal-language-picker::after {
  content: "";
  position: absolute;
  right: 13px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}
.legal-language-picker select {
  min-width: 126px;
  min-height: 42px;
  padding: 8px 34px 8px 13px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  appearance: none;
  cursor: pointer;
}
.legal-language-picker select:focus-visible { outline: 3px solid rgba(39, 99, 235, .2); border-color: var(--blue); }

.legal-main { min-height: calc(100vh - 138px); padding: 72px 24px 84px; }
.legal-shell { width: min(820px, 100%); margin: 0 auto; }
.legal-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.legal-eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.legal-title-row h1 { margin: 0; font-size: clamp(38px, 6vw, 60px); line-height: 1.05; letter-spacing: -.055em; }
.legal-subtitle { margin: 18px 0 0; color: var(--muted); font-size: 19px; }
.legal-version { margin: 5px 0 0; color: #7a8497; font-size: 14px; }
.embedded-language-picker { display: none; margin-top: 2px; }

.legal-tabs {
  display: inline-flex;
  gap: 6px;
  margin: 38px 0 28px;
  padding: 5px;
  background: #e9eef8;
  border-radius: 13px;
}
.legal-tabs a { padding: 9px 16px; color: var(--muted); border-radius: 9px; font-size: 14px; font-weight: 700; }
.legal-tabs a[aria-current="page"] { color: var(--blue); background: var(--white); box-shadow: 0 4px 15px rgba(31, 56, 105, .08); }
.legal-tabs a:hover, .legal-tabs a:focus-visible { color: var(--blue-dark); }

.legal-article { display: grid; gap: 14px; }
.legal-clause {
  padding: 26px 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(26, 52, 105, .045);
}
.legal-clause:first-child { background: var(--warning-bg); border-color: var(--warning-line); box-shadow: none; }
.legal-clause h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; letter-spacing: -.018em; }
.legal-clause p { margin: 0; color: #3f4c63; }

.legal-footer { padding: 22px 24px; color: #7a8497; background: var(--white); border-top: 1px solid var(--line); text-align: center; font-size: 13px; }
.legal-footer p { margin: 0; }

html[dir="rtl"] .legal-language-picker::after { right: auto; left: 13px; }
html[dir="rtl"] .legal-language-picker select { padding-right: 13px; padding-left: 34px; }

html.embedded body { background: var(--white); }
html.embedded .legal-chrome { display: none; }
html.embedded .legal-main {
  min-height: 100vh;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
html.embedded .legal-shell { width: min(760px, 100%); }
html.embedded .embedded-language-picker { display: inline-flex; flex: 0 0 auto; }
html.embedded .legal-title-row h1 { font-size: clamp(32px, 8vw, 48px); }
html.embedded .legal-tabs { margin-top: 30px; }
html.embedded .legal-clause { padding: 22px 0; border-width: 0 0 1px; border-radius: 0; box-shadow: none; }
html.embedded .legal-clause:first-child { padding: 20px; border: 1px solid var(--warning-line); border-radius: 14px; }

@media (max-width: 620px) {
  .legal-header-inner { width: min(100% - 32px, 1080px); min-height: 68px; }
  .legal-header-actions > a { display: none; }
  .legal-main { padding: 48px 18px 64px; }
  .legal-title-row { gap: 18px; }
  .legal-title-row h1 { font-size: 38px; }
  .legal-subtitle { font-size: 17px; }
  .legal-tabs { width: 100%; }
  .legal-tabs a { flex: 1; text-align: center; }
  .legal-clause { padding: 22px 20px; border-radius: 15px; }
  html.embedded .legal-title-row { align-items: flex-start; }
  html.embedded .legal-language-picker select { min-width: 108px; max-width: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
