:root {
  color-scheme: dark;
  --bg: #080b11;
  --surface: #0d1119;
  --surface-raised: #111722;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f7fb;
  --muted: #9ba6b7;
  --soft: #c7cfda;
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.12);
  --danger: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --header-height: 68px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.export-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
button.primary-action, button.secondary-action, button.danger-action { font-family: inherit; cursor: pointer; }
button.secondary-action { background: transparent; color: var(--text); }
button:disabled { opacity: 0.65; cursor: wait; }
[data-export-status] { color: var(--soft); }
[data-account-export] p + p { margin-top: 10px; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 28px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 52% -14%, rgba(126, 91, 239, 0.12), transparent 34rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.legal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  border: 0;
  background: rgba(8, 11, 17, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.legal-brand img { display: block; }

.header-action,
.primary-action,
.secondary-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.header-action:hover,
.secondary-action:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.25);
}
.primary-action {
  border-color: rgba(167, 139, 250, 0.34);
  background: var(--accent-soft);
  color: #ddd3ff;
}
.primary-action:hover {
  border-color: rgba(167, 139, 250, 0.58);
  background: rgba(167, 139, 250, 0.17);
}
.danger-action {
  border-color: rgba(252, 165, 165, 0.28);
  background: var(--danger-soft);
  color: #fecaca;
}
.danger-action:hover {
  border-color: rgba(252, 165, 165, 0.48);
  background: rgba(248, 113, 113, 0.15);
}
.header-action:active,
.primary-action:active,
.secondary-action:active,
.danger-action:active { transform: translateY(1px); }

.legal-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 820px);
  gap: clamp(56px, 8vw, 112px);
  justify-content: center;
  align-items: start;
  padding: 54px 0 88px;
}

.legal-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 36px);
  min-width: 0;
}
.sidebar-label {
  margin: 0 0 18px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-nav {
  display: grid;
  gap: 4px;
}
.legal-nav a {
  position: relative;
  padding: 9px 10px 9px 14px;
  border-radius: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.legal-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}
.legal-nav a:hover {
  color: var(--soft);
  text-decoration: underline;
}
.legal-nav a[aria-current="true"] {
  color: var(--text);
  font-weight: 650;
}
.legal-nav a[aria-current="true"]::before { background: var(--accent); }
.sidebar-meta {
  margin: 30px 0 0;
  color: #707b8c;
  font-size: 11px;
  line-height: 1.65;
}

.legal-mobile-nav { display: none; }

.legal-content { min-width: 0; }

.legal-intro {
  padding: 22px 0 50px;
  border: 0;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 620;
}
.lede {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.72;
}
.dates {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 30px 0 0;
}
.dates div { display: grid; gap: 5px; }
.dates dt {
  color: #727e8f;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.075em;
}
.dates dd {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
}

.legal-section {
  padding: 60px 0 14px;
  border: 0;
}
.legal-section:last-of-type { border-bottom: 0; }

.section-heading { margin-bottom: 34px; }
.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.13;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.legal-section h3 {
  margin: 34px 0 11px;
  color: #f0f3f8;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.015em;
  font-weight: 620;
}
.legal-section p {
  margin: 0 0 16px;
  color: #b4becd;
  font-size: 14px;
  line-height: 1.82;
}
.legal-section strong { color: #eceff5; font-weight: 650; }
.legal-section > p a,
#support p a {
  color: #d7ccff;
  text-underline-offset: 3px;
  text-decoration-color: rgba(167, 139, 250, 0.45);
}
.legal-section > p a:hover,
#support p a:hover { text-decoration-color: var(--accent); }

.data-control { margin: 34px 0; }
.data-control h3 { margin-top: 0; }
.data-control p a { color: #d7ccff; text-underline-offset: 3px; }

.legal-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 42px 0 12px;
  color: #707b8c;
  font-size: 12px;
}
.legal-footer a {
  color: #9da7b6;
  text-decoration: none;
}
.legal-footer a:hover { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 880px) {
  .legal-shell {
    width: min(100% - 32px, 820px);
    display: block;
    padding-top: 26px;
  }
  .legal-sidebar { display: none; }
  .legal-mobile-nav {
    display: block;
    position: sticky;
    top: calc(var(--header-height) + 10px);
    z-index: 20;
    margin: 0 0 28px;
    border: 0;
    background: var(--bg);
    backdrop-filter: blur(14px);
  }
  .legal-mobile-nav summary {
    cursor: pointer;
    padding: 13px 15px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 600;
    list-style: none;
  }
  .legal-mobile-nav summary::-webkit-details-marker { display: none; }
  .legal-mobile-nav summary::after {
    content: "⌄";
    float: right;
    color: var(--muted);
  }
  .legal-mobile-nav[open] summary::after { transform: rotate(180deg); }
  .legal-mobile-nav nav {
    display: grid;
    gap: 2px;
    padding: 0 8px 8px;
  }
  .legal-mobile-nav a {
    padding: 10px 8px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
  }
  .legal-mobile-nav a:hover { color: var(--text); text-decoration: underline; }
  .legal-intro { padding-top: 12px; }
}

@media (max-width: 620px) {
  :root { --header-height: 62px; }
  .legal-header { padding: 0 16px; }
  .header-action { min-height: 36px; padding: 0 13px; }
  .legal-shell { width: min(100% - 28px, 820px); padding-bottom: 56px; }
  .legal-intro { padding-bottom: 38px; }
  h1 { font-size: 39px; }
  .lede { font-size: 15px; line-height: 1.68; }
  .legal-section { padding-top: 48px; }
  .section-heading { margin-bottom: 28px; }
  .section-heading h2 { font-size: 30px; }
  .legal-section p { font-size: 13.5px; line-height: 1.78; }
  .primary-action,
  .secondary-action,
  .danger-action { justify-self: start; }
  .dates { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
[data-deletion-form] { display: grid; gap: 14px; margin-top: 16px; }
[data-deletion-form][hidden] { display: none; }
[data-deletion-form] label { display: block; }
[data-deletion-confirm] { display: block; max-width: 100%; width: 24ch; padding: 10px 0; margin-top: 8px; font: inherit; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--muted); border-radius: 0; }
[data-deletion-start]:disabled { opacity: .5; cursor: not-allowed; }
