:root {
  color-scheme: dark;
  --legal-bg: #090b0d;
  --legal-panel: rgba(22, 25, 28, 0.94);
  --legal-line: rgba(255, 255, 255, 0.14);
  --legal-text: #f5f1e8;
  --legal-muted: #b4bdc1;
  --legal-teal: #42d6c6;
  --legal-amber: #f0b35b;
  --legal-rose: #e36b84;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body.legal-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(66, 214, 198, 0.14), transparent 32rem),
    radial-gradient(circle at 88% 5%, rgba(240, 179, 91, 0.1), transparent 28rem),
    var(--legal-bg);
  color: var(--legal-text);
}

.legal-shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 0 calc(56px + env(safe-area-inset-bottom, 0px));
}

.legal-nav,
.legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.legal-nav {
  justify-content: space-between;
  margin-bottom: 18px;
}

.legal-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.legal-page a {
  color: var(--legal-teal);
  text-underline-offset: 3px;
}

.legal-brand {
  color: var(--legal-text) !important;
  font-size: 1.05rem;
  font-weight: 900;
  text-decoration: none;
}

.legal-card {
  padding: clamp(20px, 5vw, 44px);
  border: 1px solid var(--legal-line);
  border-radius: 14px;
  background: var(--legal-panel);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

.legal-card h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1;
}

.legal-card h2 {
  margin: 32px 0 10px;
  font-size: 1.25rem;
}

.legal-card h3 {
  margin: 22px 0 8px;
  font-size: 1rem;
}

.legal-card p,
.legal-card li {
  color: var(--legal-muted);
  line-height: 1.65;
}

.legal-card li + li {
  margin-top: 7px;
}

.legal-meta,
.legal-eyebrow {
  color: var(--legal-muted);
  font-size: 0.85rem;
}

.legal-eyebrow {
  margin: 0 0 8px;
  color: var(--legal-teal);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.release-warning,
.danger-notice,
.info-notice {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 9px;
  line-height: 1.55;
}

.release-warning {
  border: 1px solid rgba(240, 179, 91, 0.5);
  background: rgba(240, 179, 91, 0.1);
  color: #ffe0ad;
}

.danger-notice {
  border: 1px solid rgba(227, 107, 132, 0.5);
  background: rgba(227, 107, 132, 0.1);
  color: #ffd4dd;
}

.info-notice {
  border: 1px solid rgba(66, 214, 198, 0.42);
  background: rgba(66, 214, 198, 0.09);
  color: #c8fff9;
}

.account-panel {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--legal-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.account-panel[hidden] {
  display: none;
}

.account-panel h2 {
  margin-top: 0;
}

.deletion-form {
  display: grid;
  gap: 15px;
}

.deletion-form label {
  display: grid;
  gap: 7px;
  color: var(--legal-muted);
  font-weight: 750;
}

.deletion-form input[type="text"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--legal-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--legal-text);
  padding: 0 12px;
  font: inherit;
}

.deletion-form input[type="text"]:focus-visible,
.legal-button:focus-visible,
.legal-page a:focus-visible {
  outline: 3px solid rgba(66, 214, 198, 0.36);
  outline-offset: 3px;
}

.confirm-check {
  grid-template-columns: 20px 1fr;
  align-items: start;
}

.confirm-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--legal-rose);
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--legal-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--legal-text);
  padding: 9px 15px;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.legal-button.danger {
  border-color: rgba(227, 107, 132, 0.6);
  background: linear-gradient(135deg, rgba(163, 49, 75, 0.95), rgba(111, 27, 51, 0.95));
}

.legal-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.account-status {
  min-height: 24px;
  margin: 4px 0 0;
  font-weight: 750;
}

.account-status[data-tone="error"] {
  color: #ffb1c2;
}

.account-status[data-tone="success"] {
  color: #aaf0b0;
}

.legal-footer {
  justify-content: center;
  margin-top: 20px;
  color: var(--legal-muted);
  font-size: 0.82rem;
}

.placeholder-token {
  color: var(--legal-amber);
  font-weight: 850;
}

@media (max-width: 560px) {
  .legal-shell {
    width: min(100% - 20px, 880px);
    padding-top: 12px;
  }

  .legal-card {
    padding: 20px 16px;
  }

  .legal-nav {
    align-items: flex-start;
  }

  .legal-actions,
  .legal-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
