/* Shared styling for the public legal pages.
 *
 * An external file rather than an inline <style> block, because these pages are served with the
 * strict `default-src 'none'` policy every non-admin path gets, and that blocks inline styles
 * outright — the pages rendered as raw unstyled HTML for anyone who opened them, app-store
 * reviewers included. `style-src 'self'` admits this file and nothing else, so the pages get their
 * styling back without loosening the policy to `'unsafe-inline'`.
 *
 * No web fonts, for the same reason: a font host would need its own CSP exception and would fail
 * silently in exactly the situations these pages matter most — a bad connection, a filtered
 * network, an air raid. The system stack is always already there.
 */

:root {
  color-scheme: light dark;
  --ground: #f7f9f8;
  --surface: #ffffff;
  --ink: #16201c;
  --ink-muted: #55645e;
  --rule: #dde5e2;
  --rule-strong: #c3d0cb;
  --accent: #1d7a5f;
  --accent-soft: #e7f2ee;
  --warn: #8a5a00;
  --warn-soft: #fdf4e3;
  --warn-rule: #d9a441;
  --code-bg: #eef2f1;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d1310;
    --surface: #141d19;
    --ink: #e4ece8;
    --ink-muted: #98a8a1;
    --rule: #24322c;
    --rule-strong: #33453d;
    --accent: #5cc79f;
    --accent-soft: #16261f;
    --warn: #e8b563;
    --warn-soft: #2a2013;
    --warn-rule: #8a6520;
    --code-bg: #1c2823;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 20px 96px;
  background: var(--ground);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ---- masthead ------------------------------------------------------------------------------ */

.masthead {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.brand-role {
  color: var(--ink-muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(26px, 4.6vw, 34px);
  line-height: 1.18;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.updated {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.langbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.langbar a {
  display: inline-block;
  padding: 6px 13px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
}

.langbar a:hover,
.langbar a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- prose --------------------------------------------------------------------------------- */

h2 {
  font-size: clamp(19px, 2.6vw, 22px);
  line-height: 1.3;
  margin: 2.6em 0 0.7em;
  padding-top: 1.1em;
  border-top: 1px solid var(--rule);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 1.6em;
}

h3 {
  font-size: 17px;
  margin: 1.9em 0 0.5em;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
}

li {
  margin-bottom: 0.55em;
}

li > ul,
li > ol {
  margin-top: 0.55em;
}

strong {
  font-weight: 660;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:focus-visible,
.langbar a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

code {
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.87em;
  overflow-wrap: anywhere;
}

/* ---- callouts ------------------------------------------------------------------------------ */

.callout {
  background: var(--warn-soft);
  border: 1px solid var(--warn-rule);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 16px 18px;
  margin: 1.8em 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  color: var(--warn);
}

.note {
  background: var(--accent-soft);
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 16px 18px;
  margin: 1.8em 0;
}

.note p:last-child {
  margin-bottom: 0;
}

/* ---- data table ---------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  margin: 1.5em 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 15px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
}

thead th {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--ground);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---- footer -------------------------------------------------------------------------------- */

.pagefoot {
  margin-top: 3.4em;
  padding-top: 1.4em;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 14.5px;
}

.lang-divider {
  margin-top: 4em;
  padding-top: 2.2em;
  border-top: 3px double var(--rule-strong);
}

@media (max-width: 480px) {
  body {
    font-size: 16.5px;
    padding: 0 16px 72px;
  }
}
