/* Shared styling for the standalone doc pages (help / privacy / terms). The page
   background mirrors the app's current background (set by doc-bg.js via [data-theme]
   /[data-bg]); the doc card + type adapt to dark/light too. Only the 'default'
   background exists today — future packs add a [data-bg="x"] block (with light+dark).

   H5 top/bottom unification (same rule as the app): the gradient reaches --bg-0 before
   the screen edges and theme-color == --bg-0, so the status/nav bars never seam. Keep
   the --bg-0 values here in sync with doc-bg.js's BG_EDGES (and the app's --bg-0). */

/* iOS-style: flat paper + ink (matches the app). dark = #141414 / light = #fff. */
:root[data-theme="dark"] {
  --bg-0: #141414; --bg-1: #141414; --bg-2: #141414;
  --doc-card: #1c1c1c; --doc-bd: rgba(237, 237, 237, .14);
  --doc-ink: #d7d7d7; --doc-strong: #f5f5f5;
  --doc-muted: rgba(237, 237, 237, .5); --doc-rule: rgba(237, 237, 237, .14);
  --doc-violet: #ededed;
}
:root[data-theme="light"] {
  --bg-0: #ffffff; --bg-1: #ffffff; --bg-2: #ffffff;
  --doc-card: #ffffff; --doc-bd: rgba(20, 20, 20, .10);
  --doc-ink: #2a2a2a; --doc-strong: #0a0a0a;
  --doc-muted: rgba(20, 20, 20, .5); --doc-rule: rgba(20, 20, 20, .1);
  --doc-violet: #141414;
}

* { box-sizing: border-box; }
html { background-color: var(--bg-0); }   /* overscroll/rubber-band stays --bg-0 */
body {
  margin: 0; min-height: 100vh;
  background-color: var(--bg-0);   /* flat paper — matches the app's iOS reskin */
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--doc-ink); -webkit-font-smoothing: antialiased;
  padding: calc(34px + env(safe-area-inset-top, 0px)) 18px calc(40px + env(safe-area-inset-bottom, 0px));
}
.doc {
  max-width: 680px; margin: 0 auto;
  background: var(--doc-card); border: 1px solid var(--doc-bd); border-radius: 24px;
  padding: 34px 30px 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.doc-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.back { display: inline-block; color: var(--doc-violet); font-weight: 800; text-decoration: none; font-size: 14px; }
.back:hover { text-decoration: underline; }
.lang-switch {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  color: var(--doc-muted); border: 1px solid var(--doc-bd); border-radius: 999px;
  padding: 5px 9px; background: color-mix(in srgb, var(--doc-card) 92%, var(--doc-ink));
  transition: color .15s ease, border-color .15s ease;
}
.lang-switch:hover, .lang-switch:focus-within { color: var(--doc-strong); border-color: currentColor; }
.lang-switch svg { width: 14px; height: 14px; flex: none; }
.lang-switch select {
  min-width: 0; max-width: 108px; padding: 0 14px 0 0; border: 0; outline: 0;
  color: inherit; background: transparent; font: 700 12.5px/1.4 "Nunito", system-ui, -apple-system, sans-serif;
  cursor: pointer;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
h1 { font-size: 28px; font-weight: 800; color: var(--doc-strong); margin: 0 0 4px; }
.updated { color: var(--doc-muted); font-weight: 700; font-size: 13px; margin: 0 0 20px; }
h2 { font-size: 17px; font-weight: 800; color: var(--doc-strong); margin: 26px 0 8px; }
p, li { font-size: 15px; line-height: 1.65; color: var(--doc-ink); font-weight: 500; }
ul { padding-left: 20px; margin: 8px 0; }
li { margin: 4px 0; }
strong { color: var(--doc-strong); }
a { color: var(--doc-violet); }
.foot { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--doc-rule); color: var(--doc-muted); font-size: 12.5px; font-weight: 700; text-align: center; }

/* Terms page: the credits row — names + the licence each one obliges us to name, on one
   line. Reads as a footnote, not body copy. */
.credits { font-size: 13.5px; color: var(--doc-muted); }
.credits span { white-space: nowrap; }   /* a work never breaks away from its licence */

/* Contact page: copy-to-clipboard chip after the support address (built by build-docs.js).
   Line style to match the app's icons — soft rounded strokes, no filled circle, no emoji.
   .done (set for ~1.8s after a copy) swaps the glyph for a tick and the label for "copied". */
.copy {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
  margin-left: 9px; padding: 2px 9px;
  font-family: inherit; font-size: 12.5px; font-weight: 700; line-height: 1.5;
  color: var(--doc-muted); background: none;
  border: 1px solid var(--doc-bd); border-radius: 999px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color .15s ease, border-color .15s ease, transform .1s ease;
}
.copy:hover { color: var(--doc-strong); border-color: currentColor; }
.copy:active { transform: scale(.96); }
.copy svg { width: 12px; height: 12px; flex: none; }
.copy .i-done { display: none; }
.copy.done { color: var(--doc-strong); border-color: currentColor; }
.copy.done .i-copy { display: none; }
.copy.done .i-done { display: block; }

@media (max-width: 420px) {
  body { padding-left: 12px; padding-right: 12px; }
  .doc { padding: 26px 20px 22px; border-radius: 20px; }
  .doc-nav { gap: 10px; }
  .lang-switch select { max-width: 92px; }
}
