/* Shared style for the legal pages (privacy, terms, licences, account deletion).
   Used in-app (shown in a frame from Settings → Help & about) and on the web
   (Firebase Hosting copy, see tools/sync_legal_to_hosting.ps1). */
:root {
  --bg: #ffffff; --text: #1d232b; --muted: #5d6876; --line: #dde2e8; --accent: #3a6fe8;
  --danger: #c23a50; --panel: #f5f7fa;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --text: #e6edf3; --muted: #8b97a7; --line: #2a323d; --accent: #5b8cff;
    --danger: #e0566c; --panel: #161b22;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --text: #e6edf3; --muted: #8b97a7; --line: #2a323d; --accent: #5b8cff;
  --danger: #e0566c; --panel: #161b22;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 28px 0 6px; }
h3 { font-size: 16px; margin: 18px 0 4px; }
p, li { color: var(--text); }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
a { color: var(--accent); }
ul { padding-left: 22px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 8px 0; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 8px 6px; }
th { color: var(--muted); font-weight: 600; }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
pre.licence {
  white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-size: 12px; line-height: 1.45; overflow-x: auto;
}
form { display: grid; gap: 10px; max-width: 420px; }
input, button { font: inherit; }
input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); }
button {
  padding: 10px 16px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); cursor: pointer;
}
button.danger { border-color: var(--danger); color: var(--danger); background: transparent; font-weight: 600; }
button.danger:hover { background: var(--danger); color: #fff; }
button:disabled { opacity: .6; cursor: default; }
.msg { min-height: 1.5em; color: var(--muted); }
.msg.error { color: var(--danger); }
[hidden] { display: none !important; }

/* Website-only top banner (added by legal.js; matches the main site's banner). */
.site-banner {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-banner-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.site-brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap;
}
.site-brand img { border-radius: 8px; flex: none; }
.site-brand span { overflow: hidden; text-overflow: ellipsis; }
.site-tabs {
  display: flex; gap: 4px; padding: 4px; flex: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
}
.site-tabs a {
  padding: 6px 14px; border-radius: 999px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.site-tabs a:hover { color: var(--text); }
@media (max-width: 420px) {
  .site-brand span { font-size: 15px; }
  .site-tabs a { padding: 6px 10px; font-size: 13px; }
}

/* Website-only footer (added by legal.js; matches the main site's footer). */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 24px 16px;
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Sheet music credits (licenses.html, filled from music-credits.json). */
.credit-filter {
  width: 100%; box-sizing: border-box; margin: 4px 0 12px; padding: 10px 12px;
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
}
.credit-list { padding-left: 20px; }
.credit-list li { margin: 6px 0; overflow-wrap: anywhere; }
.credit-list li[hidden] { display: none; }
.credit-composer { color: var(--muted); }
.credit-empty { list-style: none; margin-left: -20px; color: var(--muted); }
