/* ==========================================================================
   CrewPlay Legal Centre -- Neo-Retro PartyBox on the web.

   The app's own design system (CLAUDE.md section 2), applied to the fine
   print: warm paper, everything outlined in charcoal ink (never pure black),
   depth as a hard offset shadow with ZERO blur, and pressing something moves
   it exactly as far as its own shadow. Labels are uppercase and tracked out;
   buttons, chips and tags are pills; containers are not.

   Accessibility rule of this sheet: body text only ever sits on paper, white,
   mustard or a slab dark enough for cream (sage, plum, teal, brick, ink).
   Terracotta and dusty blue are mid-tones that neither ink nor cream reads on
   at body size, so they frame a cream "mount" instead of carrying text.
   ========================================================================== */

:root {
  --canvas: #FCF9F3;
  --surface: #F9F6F0;
  --lowest: #FFFFFF;
  --variant: #E5E2DC;
  --ink: #2D2D2D;
  --ink-muted: #444841;
  --tape: rgba(216, 211, 200, .72);

  --sage: #4F614A;
  --terracotta: #D37A5A;
  --mustard: #E5B044;
  --dusk: #6C879B;
  --plum: #7E6191;
  --teal: #3C6E71;
  --brick: #A8503C;
  --rose: #C98C95;

  --b: 4px;
  --b-thin: 2px;
  --s: 8px;
  --s-mid: 4px;
  --s-sm: 2px;
  --r-sm: 8px;
  --r-card: 16px;
  --r-dialog: 24px;
  --r-lg: 32px;
  --r-pill: 999px;
  --gut: clamp(16px, 4vw, 28px);
  --head: 72px;

  /* Each page sets its own colour on <body data-doc="...">. */
  --doc: var(--sage);
  --on-doc: var(--canvas);
}

body[data-doc="privacy"]  { --doc: var(--plum);       --on-doc: var(--canvas); }
body[data-doc="terms"]    { --doc: var(--sage);       --on-doc: var(--canvas); }
body[data-doc="data"]     { --doc: var(--teal);       --on-doc: var(--canvas); }
body[data-doc="refunds"]  { --doc: var(--mustard);    --on-doc: var(--ink); }
body[data-doc="children"] { --doc: var(--terracotta); --on-doc: var(--ink); }
body[data-doc="security"] { --doc: var(--brick);      --on-doc: var(--canvas); }
body[data-doc="contact"]  { --doc: var(--dusk);       --on-doc: var(--ink); }
body[data-doc="hub"]      { --doc: var(--mustard);    --on-doc: var(--ink); }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head) + 20px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  font-family: Nunito, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--canvas);
  /* The paper: a faint dot grid, exactly like PlayfulBackground. */
  background-image: radial-gradient(circle at 1px 1px, rgba(45, 45, 45, .09) 1px, transparent 0);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

@media (min-width: 720px) {
  body { font-size: 1.0625rem; }
}

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.02em;
  margin: 0;
}

h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.8rem); }
h3 { font-size: 1.1rem; margin: 26px 0 8px; letter-spacing: -.01em; }
h4 { font-size: 1rem; margin: 18px 0 6px; }

p, ul, ol, dl, table { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 8px; }
li::marker { color: var(--ink-muted); font-weight: 800; }
strong, b { font-weight: 800; }
em, i { font-style: italic; }
small { font-size: .86em; }

a { color: var(--ink); font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--doc); }
a:hover { text-decoration-color: var(--ink); }
a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-left: .22em;
  vertical-align: -.02em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M4 1h7v7h-2V4.4L2.7 10.7 1.3 9.3 7.6 3H4z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M4 1h7v7h-2V4.4L2.7 10.7 1.3 9.3 7.6 3H4z'/></svg>") center / contain no-repeat;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .86em;
  background: var(--variant);
  border-radius: 6px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}

abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }

:focus-visible { outline: 3px solid var(--dusk); outline-offset: 3px; border-radius: 6px; }

::selection { background: var(--mustard); color: var(--ink); }

.wrap { width: min(1180px, 100% - var(--gut) * 2); margin-inline: auto; }
.narrow { width: min(820px, 100% - var(--gut) * 2); margin-inline: auto; }

.label {
  display: inline-block;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.muted { color: var(--ink-muted); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--mustard);
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
  box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink);
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* --- Chunky primitives --------------------------------------------------- */

.chunk {
  background: var(--surface);
  border: var(--b) solid var(--ink);
  border-radius: var(--r-card);
  box-shadow: var(--s) var(--s) 0 var(--ink);
}
.chunk.sm { border-width: var(--b-thin); box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink); }
.chunk.lg { border-radius: var(--r-lg); }
.chunk.white { background: var(--lowest); }

/* Pressing means travelling: the face moves exactly as far as its own shadow
   while the shadow collapses, so the outer footprint never changes. Hover is
   only a hint of it, and only where there is a real pointer -- a phone keeps
   a "hover" stuck on whatever was last tapped. */
.press { transition: transform .12s ease-out, box-shadow .12s ease-out; }
.press:active { transform: translate(var(--s), var(--s)); box-shadow: 0 0 0 var(--ink); }
.chunk.sm.press:active { transform: translate(var(--s-mid), var(--s-mid)); box-shadow: 0 0 0 var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .press:hover { transform: translate(2px, 2px); box-shadow: 6px 6px 0 var(--ink); }
  .chunk.sm.press:hover { transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--ink); }
  .press:active { transform: translate(var(--s), var(--s)); box-shadow: 0 0 0 var(--ink); }
  .chunk.sm.press:active { transform: translate(var(--s-mid), var(--s-mid)); box-shadow: 0 0 0 var(--ink); }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--lowest);
  color: var(--ink);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: var(--s-sm) var(--s-sm) 0 var(--ink);
  line-height: 1.4;
}
.tag.solid { background: var(--mustard); }
.tag.ink { background: var(--ink); color: var(--canvas); }
.tag.flat { box-shadow: none; }
.tag.yes { background: #D8E4D2; }
.tag.no { background: var(--variant); }
.tag svg { width: 14px; height: 14px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: var(--b) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--sage);
  color: var(--canvas);
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink);
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.btn:active { transform: translate(var(--s-mid), var(--s-mid)); box-shadow: 0 0 0 var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
  .btn:active { transform: translate(var(--s-mid), var(--s-mid)); box-shadow: 0 0 0 var(--ink); }
}
.btn.alt { background: var(--lowest); color: var(--ink); }
.btn.accent { background: var(--mustard); color: var(--ink); }
.btn.ink { background: var(--ink); color: var(--canvas); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: .9rem; border-width: var(--b-thin); box-shadow: var(--s-sm) var(--s-sm) 0 var(--ink); }
.btn.small:active { transform: translate(var(--s-sm), var(--s-sm)); box-shadow: 0 0 0 var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* A quiet key: a pill with a thin outline, for secondary actions. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--lowest);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: .86rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--s-sm) var(--s-sm) 0 var(--ink);
  transition: transform .12s ease-out, box-shadow .12s ease-out, background .12s;
}
.chip svg { width: 16px; height: 16px; flex: none; }
.chip:active { transform: translate(var(--s-sm), var(--s-sm)); box-shadow: 0 0 0 var(--ink); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] {
  background: var(--mustard);
  transform: translate(var(--s-sm), var(--s-sm));
  box-shadow: 0 0 0 var(--ink);
}

/* Masking tape, for the scrapbook feel. Scenery only. */
.tape {
  position: absolute;
  width: 96px;
  height: 24px;
  background: var(--tape);
  border: var(--b-thin) solid rgba(45, 45, 45, .26);
  z-index: 2;
  pointer-events: none;
}

/* --- Header ---------------------------------------------------------------- */

header.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  border-bottom: var(--b) solid var(--ink);
}
.nav-in { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; flex: none; }
.brand img { width: 40px; height: 40px; flex: none; }
.brand span { font-size: 1.28rem; font-style: italic; color: var(--terracotta); letter-spacing: -.02em; }
.brand + .crumb {
  display: none;
  padding-left: 12px;
  border-left: var(--b-thin) solid var(--ink);
  font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted); text-decoration: none;
}
@media (min-width: 560px) { .brand + .crumb { display: inline-block; } }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-links > a:not(.chip) {
  padding: 9px 14px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-weight: 700;
  font-size: .94rem;
}
@media (hover: hover) { .nav-links > a:not(.chip):hover { background: var(--variant); } }
@media (max-width: 760px) { .nav-links .hide-s { display: none; } }

/* The policies menu: a native <details>, so it opens without script. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .caret { transition: transform .18s ease-out; }
.menu[open] > summary .caret { transform: rotate(180deg); }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(330px, calc(100vw - 32px));
  padding: 10px;
  background: var(--lowest);
  border: var(--b) solid var(--ink);
  border-radius: var(--r-card);
  box-shadow: var(--s) var(--s) 0 var(--ink);
  z-index: 70;
}
.menu-panel a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
}
.menu-panel a:hover, .menu-panel a:focus-visible { background: var(--surface); }
.menu-panel a[aria-current="page"] { background: var(--variant); }
.menu-panel a small { display: block; font-weight: 600; color: var(--ink-muted); font-size: .8rem; line-height: 1.3; }
.dot {
  width: 14px; height: 14px; flex: none;
  border-radius: 50%;
  border: var(--b-thin) solid var(--ink);
  background: var(--c, var(--doc));
}

.progress {
  position: absolute;
  left: 0; right: 0; bottom: calc(var(--b) * -1 - 6px);
  height: 6px;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--doc);
  border-bottom: var(--b-thin) solid var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}

/* --- Hero -------------------------------------------------------------------- */

.doc-hero { padding: clamp(28px, 6vw, 58px) 0 20px; position: relative; }
.crumbs { font-size: .86rem; margin-bottom: 14px; color: var(--ink-muted); }
.crumbs a { font-weight: 800; }
.doc-hero h1 { margin: 8px 0 14px; }
.lede { font-size: clamp(1.05rem, 2vw, 1.22rem); max-width: 64ch; margin-bottom: 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0 0 6px; }
.meta li { margin: 0; }

.medal {
  position: absolute;
  right: 0;
  top: clamp(24px, 5vw, 48px);
  width: clamp(88px, 16vw, 150px);
  aspect-ratio: 1;
  display: none;
}
@media (min-width: 760px) { .medal { display: block; } }
.medal svg { width: 100%; height: 100%; display: block; }
.doc-hero .lede, .doc-hero h1 { padding-right: 0; }
@media (min-width: 760px) {
  .doc-hero .lede, .doc-hero h1 { padding-right: clamp(110px, 18vw, 170px); }
}

/* The short version: a slab of the page's colour with a cream mount inside. */
.summary {
  position: relative;
  background: var(--doc);
  padding: clamp(18px, 3.5vw, 26px);
  margin: 26px 0 24px;
}
.summary > .tag { margin-bottom: 14px; }
.summary .tape { left: 26px; top: -13px; transform: rotate(-3deg); }
.mount {
  background: var(--lowest);
  border: var(--b-thin) solid var(--ink);
  border-radius: 12px;
  padding: clamp(16px, 3vw, 22px) clamp(16px, 3vw, 24px);
}
.summary .mount ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.summary .mount li { margin: 0; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: 1.02rem; }
.summary .mount li > svg { width: 28px; height: 28px; margin-top: 1px; }
@media (min-width: 900px) {
  .summary .mount ul { grid-template-columns: 1fr 1fr; column-gap: 28px; }
}

/* Small icon medallions: a disc of the page's colour, drawn in whichever of
   cream or ink reads on it -- the web's version of GameMedallion. */
.ico { width: 28px; height: 28px; flex: none; overflow: visible; }
.ico .bg { fill: var(--doc); stroke: var(--ink); stroke-width: 2; }
.ico .fg { fill: none; stroke: var(--on-doc); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ico .fgf { fill: var(--on-doc); }

/* --- Reading tools ------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 28px;
}
/* Tools only work with script: keep their room, so nothing jumps when they
   arrive, but show nothing a reader without script could not use. */
.toolbar[hidden] { display: flex; visibility: hidden; }

.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--lowest);
  box-shadow: var(--s-sm) var(--s-sm) 0 var(--ink);
}
.seg button {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  font: inherit;
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--canvas); }

.find {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 260px;
  max-width: 440px;
  min-height: 48px;
  padding: 4px 6px 4px 14px;
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--lowest);
  box-shadow: var(--s-sm) var(--s-sm) 0 var(--ink);
}
.find:focus-within { box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink); }
.find > svg { width: 18px; height: 18px; flex: none; }
.find input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 16px; /* 16px or a phone zooms the page on focus */
  color: var(--ink);
  padding: 6px 2px;
}
.find input::placeholder { color: var(--ink-muted); opacity: .8; }
.find input::-webkit-search-cancel-button { display: none; }
.find-count { font-size: .76rem; font-weight: 800; letter-spacing: .06em; color: var(--ink-muted); white-space: nowrap; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: none;
  border: var(--b-thin) solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:active { transform: scale(.94); }
.icon-btn[disabled] { opacity: .35; cursor: default; }

mark.hit { background: #F3D98F; color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px rgba(45, 45, 45, .35); }
mark.hit.current { background: var(--mustard); box-shadow: 0 0 0 2px var(--ink); }

/* --- Layout: contents beside the text ----------------------------------------- */

.doc-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1024px) {
  .doc-grid { grid-template-columns: 290px minmax(0, 1fr); gap: 44px; }
}
.doc { min-width: 0; max-width: 820px; }

.toc { position: relative; }
@media (min-width: 1024px) {
  .toc { position: sticky; top: calc(var(--head) + 22px); max-height: calc(100vh - var(--head) - 44px); overflow: auto; padding: 2px 10px 12px 2px; }
}
.toc-card { background: var(--lowest); padding: 16px 16px 12px; }
.toc-card > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  min-height: 32px;
}
.toc-card > summary::-webkit-details-marker { display: none; }
.toc-card > summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--ink); transition: transform .2s ease-out; }
.toc-card[open] > summary::after { transform: rotate(45deg); }
@media (min-width: 1024px) {
  .toc-card > summary { pointer-events: none; }
  .toc-card > summary::after { display: none; }
}
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: toc; }
.toc li { margin: 0; counter-increment: toc; }
.toc a {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 7px 8px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.35;
}
.toc a::before {
  content: counter(toc);
  font-size: .74rem;
  font-weight: 800;
  text-align: center;
  color: var(--ink-muted);
}
@media (hover: hover) { .toc a:hover { background: var(--surface); } }
.toc a[aria-current="true"] { background: var(--ink); color: var(--canvas); }
.toc a[aria-current="true"]::before { color: var(--mustard); }

/* --- Sections ------------------------------------------------------------------ */

.s {
  position: relative;
  background: var(--lowest);
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-card);
  box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink);
  padding: clamp(20px, 3.4vw, 32px);
  margin-bottom: 24px;
}
.s > h2 { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; padding-right: 44px; }
.s > h2 .n {
  flex: none;
  min-width: 36px;
  padding: 4px 10px;
  margin-top: 2px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: center;
  color: var(--on-doc);
  background: var(--doc);
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
}
.anchor {
  position: absolute;
  right: clamp(14px, 2.6vw, 22px);
  top: clamp(16px, 3vw, 26px);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: var(--b-thin) solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  opacity: .8;
  padding: 0;
}
.anchor svg { width: 16px; height: 16px; }
.anchor:hover, .anchor:focus-visible { opacity: 1; background: var(--mustard); }
.anchor:active { transform: scale(.94); }

.tldr {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: start;
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #FBF1D8;
  border: var(--b-thin) solid var(--ink);
  border-radius: 12px;
  font-size: .98rem;
}
.tldr::before {
  content: "In short";
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 3px 10px;
  margin-top: 2px;
  background: var(--mustard);
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .tldr { grid-template-columns: 1fr; }
  .tldr::before { justify-self: start; }
}

.expand {
  display: none;
  margin-top: 2px;
}
html[data-mode="short"] .s:not(.open) .more { display: none; }
html[data-mode="short"] .s .expand { display: inline-flex; }
html[data-mode="short"] .s .tldr { margin-bottom: 14px; }

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

/* Numbered clauses read as a legal document should: 3.1, 3.2 ... */
.clauses { list-style: none; padding: 0; counter-reset: clause; }
.clauses > li { counter-increment: clause; position: relative; padding-left: 46px; margin-bottom: 12px; }
.clauses > li::before {
  content: attr(data-n);
  position: absolute; left: 0; top: .12em;
  min-width: 36px;
  font-size: .74rem; font-weight: 800; letter-spacing: .04em;
  text-align: center;
  padding: 1px 6px;
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--surface);
}

/* --- Callouts ------------------------------------------------------------------ */

.note {
  position: relative;
  margin: 18px 0;
  padding: 14px 18px 14px 18px;
  background: var(--surface);
  border: var(--b-thin) solid var(--ink);
  border-left-width: 8px;
  border-left-color: var(--sage);
  border-radius: 12px;
}
.note > :last-child { margin-bottom: 0; }
.note.warn { border-left-color: var(--terracotta); }
.note.info { border-left-color: var(--dusk); }
.note.key { border-left-color: var(--plum); }
.note.gold { border-left-color: var(--mustard); background: #FFF8E6; }
.note .label { display: block; margin-bottom: 4px; color: var(--ink); }

/* --- Tables ---------------------------------------------------------------------- */

.table {
  margin: 16px 0 20px;
  border: var(--b-thin) solid var(--ink);
  border-radius: 12px;
  overflow-x: auto;
  background: var(--lowest);
  -webkit-overflow-scrolling: touch;
}
.table table { width: 100%; border-collapse: collapse; margin: 0; font-size: .93rem; line-height: 1.5; min-width: 560px; }
.table.fit table { min-width: 0; }
.table.fit td { overflow-wrap: anywhere; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: var(--b-thin) solid var(--variant); }
.table tr:last-child td { border-bottom: 0; }
.table th {
  background: var(--variant);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: var(--b-thin) solid var(--ink);
  white-space: nowrap;
}
.table td:first-child { font-weight: 800; }
.table td .tag { font-size: .66rem; padding: 3px 9px; box-shadow: none; }

/* --- Glossary ------------------------------------------------------------------ */

.glossary { display: grid; gap: 10px; margin: 0; }
.glossary > div { padding: 12px 16px; border: var(--b-thin) solid var(--ink); border-radius: 12px; background: var(--surface); }
.glossary dt { font-weight: 800; }
.glossary dd { margin: 4px 0 0; color: var(--ink-muted); }
a.term { text-decoration-style: dotted; text-decoration-color: var(--ink); cursor: help; font-weight: 800; }

/* The definition card slides up from the bottom, like a sheet. */
.pop {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  width: min(520px, calc(100vw - 24px));
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--lowest);
  border: var(--b) solid var(--ink);
  border-radius: var(--r-dialog);
  box-shadow: var(--s) var(--s) 0 var(--ink);
  padding: 18px 20px 16px;
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), opacity .2s;
}
.pop.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.pop h4 { margin: 0 44px 6px 0; font-size: 1.05rem; }
.pop p { margin: 0 0 10px; color: var(--ink-muted); }
.pop .icon-btn { position: absolute; right: 12px; top: 12px; }
.pop a { font-size: .9rem; }

/* --- Tabs --------------------------------------------------------------------- */

.tablist { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 16px; }
.tablist[hidden] { display: none; }
.tabpanel { padding: 18px 20px; border: var(--b-thin) solid var(--ink); border-radius: 12px; background: var(--surface); margin-bottom: 14px; }
.tabpanel > h3:first-child { margin-top: 0; }
.tabpanel > :last-child { margin-bottom: 0; }
.tab-note { font-size: .84rem; color: var(--ink-muted); margin: -6px 0 12px; }

/* --- Choosers: pick what happened, see what to do -------------------------------- */

.chooser { margin: 16px 0 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.choices[hidden] { display: none; }
.choices .chip { text-transform: none; letter-spacing: 0; font-size: .95rem; }
.choice-panel {
  padding: 18px 20px;
  border: var(--b-thin) solid var(--ink);
  border-radius: 16px;
  background: var(--lowest);
  box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink);
  margin-bottom: 16px;
}
.choice-panel > h3:first-child { margin-top: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.choice-panel > :last-child { margin-bottom: 0; }
.js .chooser .choice-panel { animation: pop-in .26s cubic-bezier(.2, .8, .3, 1); }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.steps { list-style: none; padding: 0; margin: 12px 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding-left: 48px; min-height: 34px; margin-bottom: 12px; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font-weight: 800; font-size: .9rem;
  background: var(--doc);
  color: var(--on-doc);
  border: var(--b-thin) solid var(--ink);
  border-radius: 50%;
}

/* --- Data flow picture ----------------------------------------------------------- */

.flow-wrap { display: grid; gap: 18px; align-items: start; }
@media (min-width: 860px) { .flow-wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.flow-card { background: var(--lowest); padding: 12px; }
.flow { width: 100%; height: auto; display: block; }
.flow .edge { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; fill: none; opacity: .14; transition: opacity .25s; }
.flow .edge.on { opacity: 1; stroke-dasharray: 7 7; animation: flow-dash 1.1s linear infinite; }
@keyframes flow-dash { to { stroke-dashoffset: -28; } }
.flow .node rect { stroke: var(--ink); stroke-width: 3; transition: opacity .25s, transform .25s; }
.flow .node text { font-family: Nunito, system-ui, sans-serif; font-weight: 800; font-size: 13px; fill: var(--ink); letter-spacing: .02em; }
.flow .node .cross { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; opacity: 0; transition: opacity .25s; }
.flow .node.never rect { opacity: .45; }
.flow .node.never .cross { opacity: 1; }
.flow .node.dim { opacity: .45; }
.flow .node.hot rect { stroke-width: 4; }
.flow-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--ink-muted); margin: 8px 6px 2px; }
.flow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.flow-legend i { display: inline-block; width: 26px; height: 0; border-top: 3px dashed var(--ink); }
.flow-legend i.x { width: 14px; height: 14px; border: 0; background: linear-gradient(45deg, transparent 43%, var(--ink) 43% 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, var(--ink) 43% 57%, transparent 57%); }

/* --- Label cards (the Play Store style summary) --------------------------------- */

.label-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 6px 0 18px; }
.label-card { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 16px; background: var(--lowest); }
.label-card svg { width: 52px; height: 52px; }
.label-card b { display: block; font-size: 1.02rem; line-height: 1.25; }
.label-card span { display: block; font-size: .86rem; color: var(--ink-muted); line-height: 1.4; margin-top: 3px; }

/* --- Filters over tables ---------------------------------------------------------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.filters[hidden] { display: none; }
tr[hidden], .perm[hidden] { display: none; }

.perm-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 12px 0 18px; }
.perm { padding: 14px 16px; background: var(--lowest); border: var(--b-thin) solid var(--ink); border-radius: 14px; box-shadow: var(--s-sm) var(--s-sm) 0 var(--ink); }
.perm h4 { margin: 0 0 4px; font-size: .98rem; overflow-wrap: anywhere; }
.perm p { margin: 6px 0 0; font-size: .9rem; color: var(--ink-muted); line-height: 1.5; }
.perm .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.perm .tag { font-size: .62rem; padding: 3px 8px; box-shadow: none; }

/* --- Composer (contact) -------------------------------------------------------- */

.composer { display: grid; gap: 18px; }
@media (min-width: 900px) { .composer { grid-template-columns: minmax(0, 1fr) minmax(0, .92fr); align-items: start; } }
.composer[hidden] { display: none; }
.fields { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field[hidden] { display: none; }
.field > span { font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--lowest);
  border: var(--b-thin) solid var(--ink);
  border-radius: 12px;
  padding: 11px 14px;
  box-shadow: var(--s-sm) var(--s-sm) 0 var(--ink);
}
.field textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: 0; box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink); }
.field small { color: var(--ink-muted); font-size: .8rem; }
.letter { position: relative; background: var(--lowest); padding: 18px 18px 16px; }
.letter .tape { right: 26px; top: -12px; transform: rotate(4deg); }
.letter dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .9rem; margin: 0 0 12px; }
.letter dt { font-weight: 800; color: var(--ink-muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; padding-top: 3px; }
.letter dd { margin: 0; overflow-wrap: anywhere; }
.letter pre {
  margin: 0 0 14px;
  padding: 12px 14px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: .9rem;
  line-height: 1.5;
  background: var(--surface);
  border: var(--b-thin) dashed var(--ink);
  border-radius: 10px;
}
.letter .actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- Timeline (refunds) ----------------------------------------------------------- */

.timeline { position: relative; display: grid; gap: 14px; margin: 18px 0 8px; }
@media (min-width: 760px) {
  .timeline { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .timeline::before {
    content: "";
    position: absolute;
    left: 6%; right: 6%; top: 27px;
    border-top: var(--b) dashed var(--ink);
    z-index: 0;
  }
}
.tl-step { position: relative; z-index: 1; padding: 0; background: transparent; }
.tl-step .when {
  display: inline-grid;
  place-items: center;
  min-width: 56px; height: 56px;
  padding: 0 12px;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: .95rem;
  background: var(--c, var(--mustard));
  color: var(--oc, var(--ink));
  border: var(--b) solid var(--ink);
  border-radius: var(--r-pill);
  box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink);
}
.tl-step h4 { margin: 0 0 4px; }
.tl-step p { margin: 0; font-size: .92rem; color: var(--ink-muted); line-height: 1.5; }

/* --- Cards: related policies and the hub ---------------------------------------- */

.cards { display: grid; gap: clamp(16px, 2.6vw, 24px); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.policy-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--c, var(--sage));
  padding: 12px;
  color: var(--ink);
}
.policy-card[hidden] { display: none; }
.policy-card .art {
  background: var(--lowest);
  border: var(--b-thin) solid var(--ink);
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.policy-card .art svg { width: 64%; height: 82%; }
.policy-card .body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding: 14px 14px 12px;
  background: var(--lowest);
  border: var(--b-thin) solid var(--ink);
  border-radius: 12px;
  flex: 1;
}
.policy-card h3 { margin: 0; font-size: 1.18rem; }
.policy-card p { margin: 0; font-size: .92rem; color: var(--ink-muted); line-height: 1.5; font-weight: 600; }
.policy-card .card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.policy-card .card-tags .tag { font-size: .62rem; padding: 3px 9px; box-shadow: none; }
.policy-card ul.topics { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.policy-card ul.topics li { margin: 0; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid rgba(45, 45, 45, .25); }
.policy-card ul.topics li.hit { background: var(--mustard); border-color: var(--ink); }

.related { margin: 46px 0 10px; }
.related h2 { margin: 6px 0 18px; }

/* --- Stats (hub) ----------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 8px 0 34px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--lowest); padding: 18px 14px; text-align: center; }
.stat b { display: block; font-size: clamp(1.8rem, 4.4vw, 2.6rem); font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat span { display: block; margin-top: 8px; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); line-height: 1.35; }

.hub-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 22px; }
.hub-tools[hidden] { display: flex; visibility: hidden; }

/* --- Version history ---------------------------------------------------------- */

details.history { margin: 26px 0 0; background: var(--lowest); padding: 0; overflow: hidden; }
details.history > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}
details.history > summary::-webkit-details-marker { display: none; }
details.history > summary::after { content: "+"; margin-left: auto; font-size: 1.5rem; line-height: 1; transition: transform .2s ease-out; }
details.history[open] > summary::after { transform: rotate(45deg); }
details.history .table { margin: 0 20px 20px; }

/* Plain accordions for Q&A lists. */
.qa { display: grid; gap: 12px; margin: 14px 0; }
details.q { background: var(--lowest); border: var(--b-thin) solid var(--ink); border-radius: 14px; box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink); overflow: hidden; }
details.q > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
}
details.q > summary::-webkit-details-marker { display: none; }
details.q > summary::after { content: "+"; margin-left: auto; font-size: 1.5rem; line-height: 1; transition: transform .2s ease-out; flex: none; }
details.q[open] > summary::after { transform: rotate(45deg); }
details.q > summary .tag { flex: none; }
details.q .a { padding: 0 18px 16px; }
details.q .a > :last-child { margin-bottom: 0; }

/* --- Floating dock, toast, contents sheet ----------------------------------------- */

.dock {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  gap: 10px;
}
.dock button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border: var(--b) solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--lowest);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  box-shadow: var(--s-mid) var(--s-mid) 0 var(--ink);
  transition: transform .12s ease-out, box-shadow .12s ease-out, opacity .2s;
}
.dock button:active { transform: translate(var(--s-mid), var(--s-mid)); box-shadow: 0 0 0 var(--ink); }
.dock button svg { width: 18px; height: 18px; }
.dock .to-top { width: 48px; padding: 0; justify-content: center; background: var(--mustard); }
.dock .to-top[hidden], .dock .open-toc[hidden] { display: none; }
@media (min-width: 1024px) { .dock .open-toc { display: none; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px);
  z-index: 95;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  padding: 11px 20px;
  background: var(--ink);
  color: var(--canvas);
  border: var(--b-thin) solid var(--ink);
  border-radius: var(--r-pill);
  box-shadow: var(--s-mid) var(--s-mid) 0 var(--mustard);
  font-weight: 800;
  font-size: .92rem;
  transition: transform .2s cubic-bezier(.2, .8, .3, 1), opacity .2s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

dialog.sheet {
  width: min(560px, 100vw);
  max-width: 100vw;
  max-height: 80vh;
  margin: auto auto 0;
  padding: 0;
  border: var(--b) solid var(--ink);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--lowest);
  color: var(--ink);
  box-shadow: 0 calc(var(--s) * -1) 0 var(--ink);
}
@media (min-width: 600px) { dialog.sheet { margin: auto; border-bottom: var(--b) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--s) var(--s) 0 var(--ink); } }
dialog.sheet::backdrop { background: rgba(45, 45, 45, .42); }
dialog.sheet[open] { animation: sheet-up .26s cubic-bezier(.2, .8, .3, 1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--lowest); border-bottom: var(--b-thin) solid var(--ink); }
.sheet-body { padding: 8px 12px 20px; overflow: auto; }
.sheet .toc ol { margin: 0; }

/* --- Footer ---------------------------------------------------------------------- */

.foot { background: var(--ink); color: var(--canvas); padding: clamp(36px, 6vw, 60px) 0 28px; margin-top: clamp(40px, 7vw, 80px); }
.foot a { color: var(--canvas); text-decoration: none; border-bottom: 2px solid rgba(252, 249, 243, .34); padding-bottom: 1px; font-weight: 700; }
.foot a:hover { border-bottom-color: var(--mustard); color: var(--mustard); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 28px 54px; align-items: flex-start; }
.foot-brand { flex: 1 1 260px; }
.foot-brand .brand { margin-bottom: 12px; border: 0; }
.foot-brand .brand span { color: var(--mustard); }
.foot-brand p { opacity: .86; max-width: 36ch; font-size: .95rem; }
.foot-links { display: flex; flex-direction: column; gap: 9px; font-size: .95rem; min-width: 160px; }
.foot-links .label { color: rgba(252, 249, 243, .62); margin-bottom: 2px; }
.foot-bottom { margin-top: 34px; padding-top: 22px; border-top: 2px solid rgba(252, 249, 243, .2); font-size: .85rem; opacity: .8; display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* --- Reveal on scroll ----------------------------------------------------------- */

.js .rise { opacity: 0; transform: translateY(18px); transition: opacity .5s ease-out, transform .5s cubic-bezier(.2, .8, .3, 1); }
.js .rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .rise { opacity: 1; transform: none; } }

/* --- Print: the whole document, and nothing that only works on a screen -------- */

@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; font-size: 11pt; line-height: 1.5; }
  header.nav, .toolbar, .toc, .dock, .toast, .pop, .anchor, .expand, .related, .foot-grid, .medal, .tape, .skip, dialog, .choices, .tablist, .filters, .hub-tools { display: none !important; }
  .doc-grid { display: block; }
  .doc { max-width: none; }
  .s, .chunk, .note, .tabpanel, .choice-panel, .mount, .summary { box-shadow: none !important; break-inside: auto; }
  .s { border-width: 1px; margin-bottom: 12pt; padding: 10pt 12pt; }
  .summary { background: #fff; border-width: 1px; }
  html[data-mode="short"] .s .more { display: block !important; }
  .tabpanel[hidden], .choice-panel[hidden], .field[hidden] { display: block !important; }
  .js .rise { opacity: 1 !important; transform: none !important; }
  a { text-decoration: underline; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-weight: 600; font-size: .85em; -webkit-mask: none; mask: none; background: none; width: auto; height: auto; display: inline; }
  .foot { background: #fff; color: #000; margin-top: 12pt; padding: 0; }
  .foot-bottom { border-top: 1px solid #000; opacity: 1; }
  .table { overflow: visible; }
  .table table { min-width: 0; }
  .flow-wrap { display: block; }
}
