:root {
  --ink: #2c3e50;
  --accent: #e67e22;
  --bg: #fdfbf7;
  --muted: #7f8c8d;
  --rule: #e6e0d5;
  --panel: #f6f2ea;
  --bar-h: 64px;   /* the sticky header — also the anchor-jump offset */
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--accent); }
a:hover { color: var(--accent); border-bottom-color: transparent; }

/* --- chrome ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--rule);
  background: rgba(253, 251, 247, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Borrowed from credcount.app, which has had both of these since launch.
   Guarded, because a page that jumps 3000px in an animation is exactly what
   someone who has asked their OS for less motion is asking not to get. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Anything the sticky header would otherwise cover when jumped to — every
   contents link, every § cross-reference, and #doc from the skip link. */
[id] { scroll-margin-top: calc(var(--bar-h) + 12px); }

.topbar .in,
footer .in {
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* main and the contents live inside .layout now, which owns their width. */
.layout {
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.layout main { max-width: none; margin: 0; }

.topbar .in {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--bar-h);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* The bar is now the height --bar-h says it is. It was not before: the height
   came out of the padding and the line box, and --bar-h was a number typed
   beside it that happened to be close. Everything that offsets against the
   header — every anchor jump, the sticky contents rail, the panel below —
   measures from that variable, so it has to be the truth rather than an
   estimate. */

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  border-bottom: none;
}

.brand .mark { color: var(--accent); }

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-left: auto;
}

.topbar nav a {
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: none;
  white-space: nowrap;
}

.topbar nav a:hover { color: var(--accent); }
.topbar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* The menu button. Borrowed from credcount.app, which grew one when its own
   header turned out to have no navigation at all on a phone. Declared here at
   every width and shown only by the rule further down, so there is one
   definition of what it looks like. */
.navtoggle {
  display: none;
  margin-left: auto;
  flex: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  /* Safari paints a blue block over the whole button on tap otherwise, which
     on a 42px control reads as the button having broken rather than fired. */
  -webkit-tap-highlight-color: transparent;
}
.navtoggle:hover { border-color: var(--accent); color: var(--accent); }
.navtoggle:focus { outline: none; }
.navtoggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.navtoggle .bars {
  display: block;
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.navtoggle .bars::before,
.navtoggle .bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}
.navtoggle .bars::before { top: -6px; }
.navtoggle .bars::after  { top: 6px; }
.navtoggle[aria-expanded="true"] .bars { background: transparent; }
.navtoggle[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
.navtoggle[aria-expanded="true"] .bars::after  { top: 0; transform: rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .navtoggle .bars::before,
  .navtoggle .bars::after { transition: none; }
}

footer {
  margin-top: 4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

footer .in { padding-top: 2rem; padding-bottom: 3rem; }
footer address { font-style: normal; margin-bottom: 0.4rem; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* The footer used to carry one link, to /versions, and the address. With five
   pages on the site it carries the same list the header does — the header's
   copy is behind a button on a phone, and the bottom of a long document is
   exactly where someone has finished reading and wants somewhere to go. */
.footnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.footnav a { border-bottom: none; }
.footnav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Visible only when focused. Without it, keyboard and screen-reader users
   tab through the whole contents list before reaching the text. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.7rem 1.1rem;
  border: 0;
  z-index: 10;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

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

main { padding-top: 2.5rem; }

h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 1.2rem;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin: 3rem 0 0.9rem;
  padding-top: 0.4rem;
}

h3 {
  font-size: 1.08rem;
  margin: 2rem 0 0.7rem;
}

h1 + p.meta {
  color: var(--muted);
  font-size: 0.95rem;
  border-left: 3px solid var(--accent);
  padding: 0.6rem 0 0.6rem 1rem;
  margin-bottom: 2rem;
}

p { margin: 0 0 1.1rem; }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
li { margin-bottom: 0.5rem; }
li > ul, li > ol { margin-top: 0.5rem; }

strong { font-weight: 700; }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  overflow-wrap: break-word;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* Same-document § references. Kept quiet — they appear dozens of times and
   underlining every one turns the page into a rash. */
a.xref {
  border-bottom: none;
  color: var(--accent);
  white-space: nowrap;
}

a.xref:hover { border-bottom: 1px solid var(--accent); }

/* The pointer to the change page rides the version number on the meta line,
   and the engine emits it flush against </strong> — no whitespace in the
   markup, so the gap is a decision made here rather than one a stray space
   makes for us. Without this rule it reads "Version 2What changed". */
a.vchg { margin-left: 0.7rem; }

/* The arrow closing "What changed" here and "See what changed" on /versions.
   Same reason: emitted tight against the last letter, spaced from it here. */
.arw { margin-left: 0.3em; }

/* The markdown puts --- before every ##; without this the rule and the
   heading's own top margin stack into an accidental-looking void. */
hr + h2 {
  margin-top: 1.4rem;
}

/* The summary is the most-read part of the document. */
.summary {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.2rem 1.4rem 1.1rem;
  margin: 2rem 0 0.5rem;
}

.summary h2 {
  margin-top: 1.3rem;
}

.summary > :last-child {
  margin-bottom: 0;
}

/* --- the right-to-object callout ---------------------------------------- */
/* Art 21(4) requires this to be presented clearly and separately from
   everything else. That is a legal requirement, not a design flourish, so it
   gets the one piece of emphatic styling on the page. */

blockquote {
  margin: 2rem 0;
  padding: 1.2rem 1.4rem 0.4rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
}

blockquote h3 { margin-top: 0; font-size: 1.05rem; }
blockquote > :last-child { margin-bottom: 0.8rem; }

/* --- tables ------------------------------------------------------------- */

.tw {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

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

thead th {
  background: var(--panel);
  font-weight: 700;
  white-space: nowrap;
}

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

/* --- contents rail ------------------------------------------------------
   Sticky beside the document on desktop, a collapsed <details> on mobile —
   the same navigation model as credcount.app's legal pages. It used to be a
   two-column block sitting on top of the document, which pushed the text
   below the fold, read in the wrong order (§3 bottom-left, §4 top-right) and
   scrolled away the moment you started reading. Ten sections is still ten
   sections, and people arrive at a privacy notice with one question. */

.toc-mobile {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 1.6rem 0 0;
}

.toc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.toc-summary::-webkit-details-marker { display: none; }

.toc h2,
.toc-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0;
  padding: 0;
  border: 0;
}

.toc-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 3px;
}

details[open] .toc-chevron { transform: rotate(-135deg); }
.toc-mobile .toc-in { margin-top: 0.8rem; }

.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0 0 0.35rem; font-size: 0.9rem; }
.toc li.sub { padding-left: 1.1rem; font-size: 0.85rem; }

.toc a {
  border-bottom: none;
  color: var(--ink);
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 2px 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a:hover { color: var(--accent); }

.toc .n {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 2.6em;
  transition: color 0.15s ease;
}

.toc a:hover .n { color: var(--accent); }
.toc a.here { font-weight: 600; }
.toc a.here .n { color: var(--accent); }

/* Unnumbered entries reserve a §-width spacer so the column stays straight. */
.toc li.unnumbered > a::before { content: ""; flex: 0 0 auto; width: 1.5em; }

@media (max-width: 1099px) {
  .toc-desktop { display: none; }
  .toc-mobile ol {
    max-height: 38vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 6px;
  }
}

@media (min-width: 1100px) {
  .toc-mobile { display: none; }
  /* One width for the whole page. The bar and the footer widen with the
     document so the wordmark never shifts between this page and the home
     page — the same mistake was made and fixed on credcount.app. */
  .layout,
  .topbar .in,
  footer .in { max-width: 66rem; }
  .layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 3rem;
  }
  .layout main { padding-top: 2.5rem; padding-bottom: 4rem; max-width: 40rem; }
  .toc-desktop {
    position: sticky;
    top: 5rem;
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 7rem);
  }
  .toc-title { margin-bottom: 0.7rem; padding-left: 0.8rem; flex: none; }
  .toc-rail {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding-right: 1.2rem;
    padding-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(127, 140, 141, 0.3) transparent;
  }
  .toc-rail::-webkit-scrollbar { width: 4px; }
  .toc-rail::-webkit-scrollbar-track { background: transparent; }
  .toc-rail::-webkit-scrollbar-thumb {
    background: rgba(127, 140, 141, 0.3);
    border-radius: 4px;
  }
  .toc-desktop a {
    border-left: 2px solid transparent;
    padding: 3px 0 3px 0.8rem;
    margin-left: -0.9rem;
  }
  .toc-desktop a:hover { border-left-color: var(--rule); }
  .toc-desktop a.here { border-left-color: var(--accent); }
}

/* Download row above the summary. */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 1rem;
  margin: 0 0 1.6rem;
}

.actions .lbl { color: var(--muted); font-size: 0.85rem; margin-right: 0.1rem; }

a.dl {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

a.dl::before { content: "↓"; color: var(--accent); font-weight: 400; }
a.dl .sz { color: var(--muted); font-weight: 400; font-size: 0.82em; }
a.dl:hover { border-color: var(--accent); color: var(--accent); }

/* Per-heading link control. No copy button here — this page ships no JS. */
.htools {
  display: inline-flex;
  margin-left: 0.6rem;
  vertical-align: middle;
  opacity: 0;
  transition: opacity 0.16s ease;
}

h2:hover .htools, h3:hover .htools, h4:hover .htools,
.htools:focus-within { opacity: 1; }

@media (hover: none) { .htools { opacity: 0.5; } }

.htools a {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.htools a:hover { color: var(--accent); border-color: var(--accent); }

.htools .i {
  grid-area: 1 / 1;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The tick only ever shows via JS, which this page doesn't load. */
.htools .i-b { display: none; }

.toc li.sub.unnumbered { padding-left: 1.1rem; }

/* Cross-page transitions, for browsers that have them. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* --- small screens ------------------------------------------------------ */

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.2rem; }
  .topbar .in, main, .toc, footer .in { padding-left: 1.1rem; padding-right: 1.1rem; }
}

/* --- header, small screens ----------------------------------------------
   The header used to stack here: the wordmark on one line, the links wrapped
   underneath, and --bar-h redefined to 95px to account for it. Two things
   were wrong with that. The bar ate a sixth of a phone screen and stayed
   there, because it is sticky — on the privacy policy, which is the longest
   thing on this site, you scrolled the whole document past a header that
   never got out of the way. And every anchor offset, every jump from the
   contents, was measured against a second, taller number that only applied
   at one width, so a link followed at 601px and a link followed at 599px
   landed in different places.

   The bar is one row at every width now, and --bar-h is 64px everywhere.
   The links move into a panel the button discloses — the same arrangement
   credcount.app uses, for the same reason. */
@media (max-width: 760px) {
  .navtoggle { display: flex; }
  .topbar nav {
    display: none;
    position: absolute;
    top: var(--bar-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.2rem 1.1rem 0.8rem;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 22px 34px -24px rgba(44, 62, 80, 0.45);
    max-height: calc(100vh - var(--bar-h));
    overflow-y: auto;
  }
  .topbar.open nav { display: flex; }
  .topbar nav a {
    padding: 0.85rem 0.1rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--rule);
  }
  .topbar nav a:last-child { border-bottom: none; }
}

/* Without JS there is no button to press, so the links stay in the bar and
   wrap — a cramped header beats a header with no navigation in it. */
html:not(.js) .navtoggle { display: none; }
@media (max-width: 760px) {
  html:not(.js) .topbar nav {
    display: flex;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem 1.1rem;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    font-size: 0.82rem;
  }
  html:not(.js) .topbar nav a { padding: 0; border: 0; font-size: 0.82rem; }
  html:not(.js) .topbar .in {
    flex-wrap: wrap;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
}

/* Restack tables rather than scrolling them sideways on a phone. */
@media (max-width: 600px) {
  .tw {
    overflow-x: visible;
    border: 0;
  }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr {
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    margin: 0 0 0.7rem;
    background: var(--panel);
  }
  td { border: 0; padding: 0.35rem 0; display: flex; gap: 0.8rem; align-items: baseline; }
  /* A flex item will not shrink below its own content, so one unbreakable
     token in a restacked cell — `cleverlittlegoose.com` in the privacy
     policy's §4 table — pushed the whole document 25px sideways on a phone.
     min-width:0 lets the cell shrink; `anywhere` lets the token itself break,
     which `overflow-wrap: break-word` does not do for a flex item's
     min-content size. */
  td > * { min-width: 0; }
  td code, td a { overflow-wrap: anywhere; }
  td::before {
    content: attr(data-label);
    flex: 0 0 36%;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
}

/* Back to top, revealed by legal.js once you are past the first screen. */
.totop {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 15;
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 50%;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.totop:hover { color: var(--accent); border-color: var(--accent); }
.totop[hidden] { display: none; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- print -------------------------------------------------------------- */
/* People do print privacy notices, usually when they are about to complain
   about one. */

@media print {
  body { font-size: 11pt; background: #fff; }
  .topbar nav, .navtoggle, .toc, .totop, .htools { display: none; }
  a { border-bottom: none; }
  a.xref { color: inherit; }
  blockquote { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  tr { break-inside: avoid; }
}

/* Full-width variant for pages with no contents rail. */
@media (min-width: 1000px) {
  .layout.wide { grid-template-columns: minmax(0,1fr); }
  .layout.wide main { margin-inline: auto; }
}
