/* Help and legal pages, and the sign-in return page (server pages share this file). Palette copied from
   shared/brand/tokens.json (ground, text, surface, surface2, hairline, outline, muted, faint); web/tests/readability.test.ts
   checks it. B-readability §6: prefers-contrast: more swaps in colorMoreContrast, live, with no script.
   Type (brand.md §7, UX polish 2026-11-07): the Barlow faces the app bundles, copied to /site by
   scripts/copy-site-assets.mjs, never from a third party; body 17 px, at most about 68 characters a line. */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("/site/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("/site/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("/site/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap; src: url("/site/barlow-condensed-800-italic.woff2") format("woff2"); }
:root { color-scheme: dark; font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #000000; color: #ffffff; --bg: #000000; --fg: #ffffff; --surface: #101010; --hover: #1c1c1c; --line: #2c2c2c; --outline: #767676; --muted: #a6a6a6; --faint: #8f8f8f; --exponent: #f2c230; }
:root[data-theme="light"] { color-scheme: light; background: #ffffff; color: #000000; --bg: #ffffff; --fg: #000000; --surface: #f5f5f5; --hover: #ebebeb; --line: #d9d9d9; --outline: #767676; --muted: #4d4d4d; --faint: #5c5c5c; --exponent: #000000; }
@media (prefers-contrast: more) {
  :root:not([data-theme="light"]) { --line: #6b6b6b; --outline: #a6a6a6; --muted: #d6d6d6; --faint: #c2c2c2; }
  :root[data-theme="light"] { --line: #808080; --outline: #4d4d4d; --muted: #262626; --faint: #333333; }
}
* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
/* W-44: the website's grid (src/ui/welcome.css .welcome): a 1120 px page with the app's 16 px margin on a phone (W-22)
   and 36 px from 700 px, so the wordmark sits exactly where it does on the welcome page. The text keeps a reading
   column of about 68–72 characters of the 17 px body (31 em), on the page's left edge. */
body { max-width: 1120px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); font-size: 1.0625rem; line-height: 1.65; overflow-wrap: break-word; }
main, footer, .policy-tabs { max-width: 31em; }
@media (min-width: 700px) { body { padding-left: max(36px, env(safe-area-inset-left)); padding-right: max(36px, env(safe-area-inset-right)); } }
/* W-40: no one-word last lines in paragraphs; headings balance their lines. */
p, li { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* Header (W-44, W-33, D32; W-32 round 5): the welcome page's header, a 44 px row 24 px under the top with the wordmark
   centred in it, at the same place and size (29 px tall on a phone, 24 px from 700 px), led by the page's one back button: a chevron icon, a 44 px target, its name saying where it goes
   ("Back to track2.fit"; "Back to Help" for a browser signed in to the web app, policy.js; "Back to Support" on Delete
   account). From 1240 px it sits in the margin, so the wordmark stays exactly where the welcome page has it. */
.policy-header { display: flex; align-items: center; gap: 4px; padding-top: max(24px, env(safe-area-inset-top)); margin-bottom: 28px; }
.policy-home { display: inline-flex; align-items: center; min-height: 44px; border-radius: 8px; text-decoration: none; }
.policy-wordmark { display: block; width: 158px; height: 29px; color: var(--fg); }
@media (min-width: 700px) { .policy-wordmark { width: 132px; height: 24px; } .policy-header { margin-bottom: 40px; } }
.policy-back { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px; border-radius: 50%; color: var(--fg); text-decoration: none; }
.policy-back:hover { background: var(--surface); }
.policy-back .chevron { flex: none; width: 24px; height: 24px; }
@media (min-width: 1240px) { .policy-back { margin-left: -52px; } .policy-header { gap: 8px; } }
.only-help { display: none; }
:root[data-account] .only-site { display: none; }
:root[data-account] .only-help { display: inline-flex; }
:root[data-account] span.only-help { display: inline; }

/* Privacy | Terms: the app's segmented control, a pill with pill segments; full width on a phone, its content's width
   from 700 px (W-28, the app's rule for segmented controls). */
.policy-tabs { display: flex; gap: 3px; width: 100%; padding: 3px; margin-bottom: 32px; border: 1px solid var(--outline); border-radius: 999px; }
.policy-tabs a { display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; min-height: 44px; min-width: 96px; padding: 0 20px; border-radius: 999px; color: var(--muted); font-weight: 600; text-align: center; text-decoration: none; }
@media (min-width: 700px) { .policy-tabs { width: fit-content; } .policy-tabs a { flex: 0 0 auto; } }
.policy-tabs a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.policy-tabs a:not([aria-current]):hover { background: var(--hover); color: var(--fg); }

/* Titles: the display face, like the app's screen titles (brand.md §7). */
h1 { margin: 0 0 8px; font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-style: italic; font-weight: 800; font-size: 2.625rem; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
h2 { margin: 40px 0 10px; font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 16px; }
/* A title with no update date under it (Support, Delete account) still keeps its distance from the text. */
h1 + p:not(.date) { margin-top: 20px; }
.date { margin-bottom: 28px; color: var(--muted); font-size: 0.875rem; font-weight: 500; }
/* A named face: the generic `monospace` alone shrinks to the browser's 13 px monospace default. */
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
footer { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 48px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.9375rem; font-weight: 500; }
/* Footer links are a row of navigation, not links in a sentence: no underline until hovered (as the welcome page's). */
footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--fg); text-decoration: underline; }

/* W-33: on a wide screen a long document gets a sticky "On this page" index (policy.js), marking the section being
   read. W-32 (round 5): the index stands 64 px from the reading column, both on the left under the wordmark, instead of
   at the page's right edge (a 280 px gap that split the page in two); the reading column keeps its ~70 characters. */
.policy-index { display: none; }
@media (min-width: 1100px) {
  body { display: grid; grid-template-columns: minmax(0, 31em) minmax(0, 15rem); column-gap: 64px; justify-content: start; align-items: start; }
  .policy-header { grid-column: 1 / -1; }
  .policy-tabs, main, footer { grid-column: 1; }
  .policy-index { display: block; grid-column: 2; grid-row: 2 / span 3; position: sticky; top: 32px; padding-top: 4px; }
}
.policy-index-label { margin: 0 0 10px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.12em; line-height: 1.3; text-transform: uppercase; }
.policy-index ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.policy-index a { display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; color: var(--muted); font-size: 0.9375rem; font-weight: 500; line-height: 1.35; text-decoration: none; }
.policy-index a:hover { color: var(--fg); }
.policy-index a[aria-current] { border-left-color: var(--fg); color: var(--fg); font-weight: 600; }
html { scroll-padding-top: 24px; }
