/* Privacy Policy and Terms of Service */
:root {
  --legal-ink: #111827;
  --legal-muted: #4b5563;
  --legal-line: #e5e7eb;
  --legal-soft: #f3f6ff;
  --legal-accent: #0A4DFF;
  --legal-bg: #fff;
}

body { margin: 0; background: var(--legal-bg); color: var(--legal-ink); }

.legal {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 16px 64px;
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.back-link { display: inline-block; min-height: 44px; line-height: 44px; color: var(--legal-accent); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.legal h1 { margin: 16px 0 4px; font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.2; }
.legal .updated { margin: 0 0 24px; color: var(--legal-muted); }
.legal h2 { margin: 40px 0 8px; font-size: 1.3rem; line-height: 1.3; scroll-margin-top: 16px; }
.legal h3 { margin: 24px 0 4px; font-size: 1.05rem; }
.legal p, .legal li { color: var(--legal-ink); }
.legal ul, .legal ol { padding-left: 1.3em; }
.legal li { margin: 4px 0; }
.legal a { color: var(--legal-accent); }

.legal .summary {
  margin: 0 0 28px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--legal-soft);
  border: 1px solid #dbe4ff;
}
.legal .summary h2 { margin: 0 0 6px; font-size: 1.05rem; }
.legal .summary ul { margin: 0; }

.legal .toc { margin: 0 0 8px; padding: 16px 20px; border: 1px solid var(--legal-line); border-radius: 14px; }
.legal .toc h2 { margin: 0 0 6px; font-size: 1rem; }
.legal .toc ol { margin: 0; columns: 2; column-gap: 32px; }
.legal .toc li { break-inside: avoid; }

.legal .caps { text-transform: uppercase; font-size: .95rem; }

.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--legal-line); }
.legal th { background: #f9fafb; font-weight: 600; }
.legal th.num { white-space: nowrap; }
.legal td:nth-child(n+2):not(:last-child:nth-child(2)) { white-space: nowrap; }
.legal .table-wrap { overflow-x: auto; }

.legal .fill-in { background: #fff3c4; padding: 0 4px; border-radius: 4px; }

@media (max-width: 600px) {
  .legal .toc ol { columns: 1; }
  .legal table { font-size: .9rem; }
  .legal th, .legal td { padding: 8px; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --legal-ink: #e5e7eb;
    --legal-muted: #9ca3af;
    --legal-line: #2b3240;
    --legal-soft: #111a33;
    --legal-accent: #7aa2ff;
    --legal-bg: #0b0f17;
  }
  :root:not([data-theme="light"]) .legal .summary { border-color: #23315c; }
  :root:not([data-theme="light"]) .legal th { background: #121826; }
  :root:not([data-theme="light"]) .legal .fill-in { background: #5c4a00; }
}

/* Delete account page */
.legal .delete-form {
  display: grid;
  gap: 8px;
  max-width: 420px;
  margin: 16px 0 8px;
  padding: 20px;
  border: 1px solid var(--legal-line);
  border-radius: 14px;
}
.legal .delete-form label { font-weight: 600; }
.legal .delete-form input[type="email"],
.legal .delete-form input[type="password"] {
  min-height: 44px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--legal-line);
  border-radius: 10px;
  background: var(--legal-bg);
  color: var(--legal-ink);
  font: inherit;
}
.legal .delete-form .delete-confirm { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.legal .delete-form .delete-confirm input { width: 20px; height: 20px; margin-top: 4px; flex: none; }
.legal .delete-form button {
  min-height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  background: #b42318;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.legal .delete-form button:disabled { opacity: .6; cursor: wait; }
.legal .delete-status { margin: 4px 0 0; min-height: 1.7em; color: var(--legal-muted); }
.legal .delete-status.is-error { color: #b42318; }
.legal .delete-status.is-success { color: #067647; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .legal .delete-status.is-error { color: #fda29b; }
  :root:not([data-theme="light"]) .legal .delete-status.is-success { color: #75e0a7; }
}
