:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: #020304;
  color: #f6f8fc;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #020304; }

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 12% -5%, rgba(56, 143, 255, 0.19), transparent 31rem),
    radial-gradient(circle at 95% 10%, rgba(117, 80, 255, 0.12), transparent 29rem),
    linear-gradient(180deg, #05070b, #010203 70%);
  color: #f6f8fc;
  line-height: 1.62;
}

a { color: #74b9ff; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #a9d6ff; }

.legal-shell {
  width: min(880px, calc(100% - 28px));
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 0 max(54px, env(safe-area-inset-bottom));
}

.legal-topbar {
  position: sticky;
  z-index: 10;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(8, 11, 17, .7);
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 16px 44px rgba(0,0,0,.35);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
}

.legal-back,
.legal-home {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(116,185,255,.24);
  border-radius: 999px;
  background: rgba(116,185,255,.08);
  color: #e8f4ff;
  font-size: .82rem;
  font-weight: 800;
  text-decoration: none;
}

.legal-brand { font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.legal-hero {
  margin-bottom: 18px;
  padding: clamp(24px, 7vw, 54px);
  overflow: hidden;
  border: 1px solid rgba(116,185,255,.2);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(116,185,255,.14), transparent 46%),
    rgba(7,10,15,.86);
  box-shadow: inset 0 1px rgba(255,255,255,.11), 0 28px 80px rgba(0,0,0,.42);
}

.legal-kicker { margin: 0 0 7px; color: #74b9ff; font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.legal-hero h1 { margin: 0; font-size: clamp(2.25rem, 8vw, 4.4rem); line-height: .98; letter-spacing: -.055em; }
.legal-hero > p:last-child { max-width: 650px; margin: 16px 0 0; color: #aab3c2; }

.legal-warning {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 183, 77, .42);
  border-radius: 18px;
  background: rgba(255, 151, 35, .1);
  color: #ffd697;
}
.legal-warning strong { display: block; margin-bottom: 4px; color: #fff0d6; }
.legal-warning[hidden] { display: none; }

.legal-nav {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.legal-nav::-webkit-scrollbar { display: none; }
.legal-nav a { flex: 0 0 auto; padding: 9px 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(255,255,255,.035); color: #cbd3df; font-size: .75rem; font-weight: 800; text-decoration: none; }
.legal-nav a[aria-current="page"] { border-color: rgba(116,185,255,.34); background: rgba(116,185,255,.12); color: white; }

.legal-card {
  margin-bottom: 14px;
  padding: clamp(20px, 5vw, 34px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  background: rgba(7,9,13,.78);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 18px 58px rgba(0,0,0,.25);
}
.legal-card h2 { margin: 0 0 12px; font-size: 1.28rem; letter-spacing: -.02em; }
.legal-card h3 { margin: 24px 0 8px; font-size: 1rem; }
.legal-card p { margin: 8px 0; color: #b8c0cd; }
.legal-card ul { margin: 9px 0; padding-left: 21px; color: #b8c0cd; }
.legal-card li + li { margin-top: 6px; }
.legal-card strong { color: #f6f8fc; }
.legal-card code { color: #9ecfff; }
.legal-card address { color: #c6ced9; font-style: normal; }

.legal-language-divider { margin: 34px 0 18px; border: 0; border-top: 1px solid rgba(255,255,255,.12); }
.legal-language-title { margin-bottom: 14px; color: #8e9aab; font-size: .72rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.legal-missing-value { color: #ffb15e !important; font-weight: 850; }
.legal-meta { color: #8490a1 !important; font-size: .78rem; }
.legal-footer { padding: 20px 8px; color: #778394; font-size: .75rem; text-align: center; }
.license-text { padding: 15px; overflow-x: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; background: #020304; color: #b9c2cf; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .72rem; white-space: pre-wrap; }

@media (max-width: 520px) {
  .legal-shell { width: min(100% - 18px, 880px); }
  .legal-topbar { top: 6px; }
  .legal-brand { display: none; }
  .legal-topbar { justify-content: space-between; }
  .legal-card { border-radius: 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  .legal-hero, .legal-card { animation: legal-enter .52s cubic-bezier(.16,.86,.2,1) both; }
  .legal-card:nth-of-type(2) { animation-delay: .06s; }
  @keyframes legal-enter { from { opacity: 0; transform: translateY(12px); } }
}
