html[data-theme="light"] {
  --bg-main: #eef1f4;
  --bg: #eef1f4;
  --bg-card: #f8fafb;
  --card: #f8fafb;
  --border: rgba(15, 23, 42, 0.08);
  --text-main: #0f172a;
  --text: #0f172a;
  --text-muted: #475569;
  --muted: #475569;
  --text-dim: #94a3b8;
  --accent: #059669;
  --accent-dim: rgba(5, 150, 105, 0.12);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg-main: #07080b;
  --bg: #07080b;
  --bg-card: #0e1117;
  --card: #0e1117;
  --border: rgba(255, 255, 255, 0.08);
  --text-main: #f8fafc;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  font-family: "IBM Plex Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  transition: background-color .18s ease, color .18s ease;
}

body.legal-page {
  margin: 0;
  padding: 40px 20px;
  background: var(--bg-main, var(--bg));
  color: var(--text-main, var(--text));
  line-height: 1.7;
}
.legal-page .container { max-width: 800px; margin: 0 auto; }
.legal-page header { display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:40px;padding-bottom:20px;border-bottom:1px solid var(--border); }
.legal-page .brand { display:inline-flex;align-items:center;gap:10px;color:var(--text-main, var(--text));font-size:16px;font-weight:800;text-decoration:none; }
.legal-page h1 { margin:0 0 8px;font-size:clamp(26px,5vw,32px);line-height:1.2;letter-spacing:-.025em; }
.legal-page h2 { margin:28px 0 10px;color:var(--text-main, var(--text));font-size:16px;line-height:1.4; }
.legal-page h2:first-of-type { margin-top:0; }
.legal-page p,.legal-page li { color:var(--text-muted, var(--muted));font-size:14px; }
.legal-page p { margin:0 0 16px; }
.legal-page p strong,.legal-page li strong { color:var(--text-main, var(--text)); }
.legal-page ul { margin:0 0 16px 20px;padding:0; }
.legal-page li { margin-bottom:6px; }
.legal-page a { color:var(--accent);text-decoration:none; }
.legal-page a:hover { text-decoration:underline; }
.legal-page .subtitle { margin-bottom:26px;color:var(--text-dim, var(--muted));font-size:12px;font-weight:650;letter-spacing:.04em;text-transform:uppercase; }
.legal-page .card { margin-bottom:24px;padding:32px;background:var(--bg-card, var(--card));border:1px solid var(--border); }
.legal-page .badge-box,.legal-page .note { margin-bottom:20px;padding:14px;border:1px solid rgba(16,185,129,.28);border-radius:4px;background:rgba(16,185,129,.07); }
.legal-page .badge-box p,.legal-page .note { color:var(--text-main, var(--text)); }
.legal-page footer { display:flex;justify-content:space-between;gap:20px;margin-top:32px;padding-top:22px;border-top:1px solid var(--border);color:var(--text-dim, var(--muted));font-size:12px; }
.legal-page .footer-links { display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px; }
.legal-page .footer-links a { color:var(--text-muted, var(--muted)); }

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace !important; }
.card { border-radius: 5px !important; }
.back-link { border-radius: 3px !important; }
.legal-header-actions { display:flex;align-items:center;gap:10px; }
.legal-controls { display:flex;align-items:center;gap:6px; }
.legal-control {
  min-height:30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:3px;
  background:var(--bg-card, var(--card));
  color:var(--text-main, var(--text));
  font:inherit;
  font-size:12px;
  font-weight:700;
  line-height:1;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
  transition:border-color .15s, transform .15s;
}
.legal-control:hover { border-color:var(--text-dim);transform:translateY(-1px);text-decoration:none; }
.legal-control:focus-visible { outline:3px solid var(--accent);outline-offset:3px; }
.legal-control--utility { width:32px;min-width:32px;height:32px;padding:0; }
#legalThemeToggle { min-width:32px; }
#legalThemeIcon { display:inline-flex;align-items:center;justify-content:center;font-size:15px;line-height:1; }
#legalThemeLabel { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
.translation-notice { padding:12px 14px;border-left:3px solid var(--accent);background:rgba(16,185,129,.07);color:var(--text-muted, var(--muted));font-size:12px;line-height:1.55;margin-bottom:22px; }

@media (max-width: 620px) {
  body { padding:24px 14px !important; }
  header { align-items:flex-start !important;gap:16px !important; }
  .legal-header-actions { align-items:flex-end;flex-direction:column-reverse; }
  .back-link { padding:5px 8px !important;font-size:11px !important; }
  .card { padding:22px 18px !important; }
  .legal-page footer { flex-direction:column; }
  .legal-page .footer-links { justify-content:flex-start; }
}
