/* Document pages — /privacy and /terms.
 *
 * These load before, and without, js/app.js so they stay readable to a
 * logged-out visitor and to Google's OAuth reviewers.
 *
 * On a 1920px screen the previous version was a 720px column of 14px text in
 * the middle of a black field. Two things changed, and neither is "stretch the
 * column":
 *
 *   - Type scales with the viewport. Body reaches 17px on a large monitor;
 *     fine print never drops below 13px. A 1920px-wide line of text would be
 *     unreadable, so the measure stays near 70 characters and the SIZE grows
 *     instead.
 *   - The spare width holds a section index rather than padding. These
 *     documents have real sections, so navigation is information, not
 *     decoration — and it is what makes a policy page usable rather than
 *     something to scroll past.
 *
 * Same duotone treatment as the sign-in screen, so the public pages read as
 * one place.
 */

/* app.css:122 locks the viewport -- html, body { height: 100%; overflow: hidden }
   -- because the dashboard is a fixed-height app that scrolls inside its own
   panes. These pages load app.css for the theme tokens and inherited that
   lock, so neither a wheel nor a finger could move them. Undo it here; this
   sheet loads after, so plain order wins without !important. */
html, body {
  height: auto; min-height: 100%; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;   /* momentum on iOS */
  overscroll-behavior-y: contain;
}

body {
  background: var(--bg); color: var(--text);
  min-height: 100vh;
}

/* app.css hides the scrollbar down to 3px, which suits a dense dashboard and
   is nearly impossible to grab on a long document. */
.doc-shell ::-webkit-scrollbar,
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 5px;
}
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Colour behind everything. Fixed so it does not scroll away. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50vw 50vh at 85% 0%,
      color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    radial-gradient(45vw 45vh at 0% 100%,
      color-mix(in srgb, var(--down) 10%, transparent), transparent 70%);
}

.doc-shell {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 72px);
  max-width: 1280px; margin: 0 auto;
  padding: clamp(36px, 5vw, 72px) clamp(20px, 4vw, 48px) 96px;
}

/* The index appears only when there is genuinely room beside the text. */
@media (min-width: 1040px) {
  .doc-shell { grid-template-columns: 230px minmax(0, 1fr); }
}

/* ── section index ────────────────────────────────────────────────────────── */

.doc-nav { display: none; }
@media (min-width: 1040px) {
  .doc-nav {
    display: block; position: sticky; top: clamp(36px, 5vw, 72px);
    align-self: start;
  }
}
.doc-nav-title {
  font-family: var(--font); font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 14px;
}
.doc-nav a {
  display: block; padding: 7px 0 7px 14px;
  border-left: 2px solid var(--border-soft);
  font-family: var(--font); font-size: 14px; line-height: 1.4;
  color: var(--text-muted); text-decoration: none;
  transition: color .15s, border-color .15s;
}
.doc-nav a:hover { color: var(--text); border-left-color: var(--accent); }

.doc-nav-foot {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-soft);
  font-family: var(--font); font-size: 13px;
}
.doc-nav-foot a { color: var(--text-muted); text-decoration: none; display: block; padding: 4px 0; }
.doc-nav-foot a:hover { color: var(--accent); }

/* ── the document ─────────────────────────────────────────────────────────── */

.doc { max-width: 70ch; }
.doc a { color: var(--accent); }

.doc-brand {
  display: inline-block;
  font-family: var(--font); font-weight: 700; letter-spacing: -.01em;
  font-size: clamp(22px, 2vw, 28px);
  color: var(--accent); text-decoration: none;
}
.doc-brand em { font-style: normal; color: var(--text); }

.doc h1 {
  font-family: var(--font); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(38px, 4.4vw, 60px); line-height: 1.02;
  color: var(--text); margin: 26px 0 10px;
}

.doc .updated {
  font-family: var(--mono); font-size: 13px; color: var(--text-muted);
  margin-bottom: 30px;
}

.doc h2 {
  font-family: var(--font); font-weight: 700;
  font-size: clamp(20px, 1.7vw, 25px); line-height: 1.25;
  color: var(--text); margin: 52px 0 14px;
  scroll-margin-top: 28px;
}

.doc p, .doc li {
  font-family: var(--font);
  font-size: clamp(15px, 1.05vw, 17px); line-height: 1.75;
  color: var(--text);
}
.doc p { margin: 0 0 16px; }

.doc ul { padding-left: 22px; margin: 14px 0 20px; }
.doc li { margin-bottom: 10px; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--text); font-weight: 600; }

.doc table {
  width: 100%; border-collapse: collapse; margin: 18px 0 26px;
  font-family: var(--font); font-size: clamp(14px, .95vw, 16px);
}
.doc th, .doc td {
  text-align: left; padding: 13px 14px;
  border-bottom: 1px solid var(--border-soft); vertical-align: top;
  line-height: 1.6;
}
.doc th {
  color: var(--text-muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .08em;
}
.doc tr:hover td { background: color-mix(in srgb, var(--surface) 45%, transparent); }

/* The one thing on these pages that must not be skimmed past. The left rule is
   in --accent so it reads as the page's own emphasis, not a warning. */
.callout {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 18px 22px; margin: 24px 0;
}
.callout p { margin: 0; }

.doc-foot {
  margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--border-soft);
  font-family: var(--font); font-size: 14px; color: var(--text-muted);
}
.doc-foot a { color: var(--text-muted); text-decoration: none; }
.doc-foot a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  .doc-nav a, .doc-foot a { transition: none; }
}
