/* ============================================================================================
   LEGAL DOCUMENT TEMPLATE  --  PENDING UPSTREAM, DELETE THIS FILE WHEN THE DESIGN SYSTEM SHIPS

   Every block below is marked with the section of HANDOVER_legal_design.md it came from, and
   every value is that document's literal value unless a DEVIATION note says otherwise.

   Why it is here rather than in the design system. The handover's section 1 routes the prose
   styles, the table styles and the "In short" block UPSTREAM, to returnmeplz-design-system,
   because the recovery app needs the same treatment for its own privacy notice. That export
   has not happened -- Claude Design authors it, exports a zip, and the site re-syncs its
   mirror. Building the nine pages against tokens that do not exist yet would mean writing CSS
   to delete, so this file holds the literal values in the meantime.

   The whole FILE is the pending-upstream boundary, deliberately. When the design system
   publishes, the swap is: delete assets/legal.css, add the token <link> to the nine pages.
   Nothing has to be picked out of a larger stylesheet. Same pattern as the motion tokens in
   style.css's local-only :root, one file up instead of four declarations.

   What is NOT here, and must not be moved here: the consent banner and the grouped footer.
   Handover section 1 puts both in the marketing site permanently -- consent cannot be shared
   across domains, and the footer carries navigation the app does not have -- so they live in
   style.css, which is already fetched on every page.

   assets/design-system/ is a MIRROR and is overwritten on the next copy, per its own
   HOW-TO-UPDATE.md. Nothing new goes in there.
   ============================================================================================ */

:root {
  /* PENDING UPSTREAM -- handover section 4. The only two colour values in this build with no
     token behind them. Structural hairlines rather than brand colours: E5E7EB is the border
     and the contents-rail rest state, F3F4F6 the row separator inside a table. Brief section
     A4 says not to introduce new colour values; this is a knowing deviation, recorded here
     and in the commit, because the handover specifies both literally and no existing token is
     close. They go upstream with the rest of this file. */
  --legal-border: #E5E7EB;
  --legal-rule: #F3F4F6;
}

/* ---------------------------------------------------------------------------------------------
   THE PAGE SHELL  --  handover section 3, header block
   --------------------------------------------------------------------------------------------- */

/* DEVIATION, the same one approved for the footer in item 1: the handover's horizontal padding
   of 56px is artefact geometry, measured from a standalone page with nothing around it. These
   pages sit under the site's own header, and their content has to line up with the header logo
   and with the footer below. So the horizontal rhythm is the site's .container -- 1120px with
   24px gutters -- and the handover's VERTICAL values are used unchanged. */
.legal-head { background: var(--grey); border-bottom: 1px solid var(--legal-border); padding: 44px 0 36px; }
.legal-crumb { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.legal-crumb a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.legal-crumb a:hover { color: var(--dark-teal); }
.legal-crumb [aria-current] { color: var(--charcoal); }
.legal-head h1 { font-family: 'Poppins', sans-serif; font-size: 40px; font-weight: 700; color: var(--dark-teal); line-height: 1.15; }
.legal-accent { width: 32px; height: 2px; background: var(--yellow); margin: 16px 0 18px; }
.legal-sub { font-size: 18px; font-weight: 500; color: var(--charcoal); max-width: 68ch; }
/* Four of the nine subtitles carry a cross-link -- Terms of Service points at Terms of Sale,
   Acceptable Use at Terms of Service. Without this they render in the UA's default blue, which
   is the one colour on the page that belongs to no part of the brand. */
.legal-sub a { color: var(--dark-teal); text-decoration: underline; text-underline-offset: 2px; }
/* Hover thickens the underline and does NOT change the colour. var(--teal) was here: #17B8B0
   on this block's #F2F4F5 measures 2.23:1, against 5.51:1 resting. A hover state is still text,
   so it still owes 4.5:1 -- brightening made the link harder to read at the exact moment of
   interaction. Same treatment as p a:not(.btn):hover in style.css, so the two files agree. */
.legal-sub a:hover { text-decoration-thickness: 2px; }
.legal-sub a:focus-visible, .legal-crumb a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 2px; }
/* The version line is a trust signal and a compliance artefact -- the effective date is legally
   meaningful. It stays visible at the top; it does not move to the bottom of the page. */
.legal-version { font-size: 13px; color: var(--text-muted); margin-top: 16px; }
/* Each segment of the version line is unbreakable; the line as a whole is not.

   Measured: a three-part line at 13px renders 382px wide in a 382px block at a 430px viewport,
   and 342px in 342px at 390px. THAT IS NOT MARGINAL, IT IS EXACTLY AT THE LIMIT -- which is why
   every three-part line wraps and no two-part one does. It also means the line was one character
   away from wrapping at any width: a two-digit day, or "September" becoming "November", would
   have started it wrapping somewhere it previously did not. So this rule is not cosmetic; it
   removes a dependency on how long a month's name happens to be.

   Without it the break fell mid-date -- "Last updated 10" / "September 2026" at 430, on every
   three-part page -- which reads as a rendering defect rather than a wrap, on the one line whose
   whole job is to be a credible compliance artefact. Two pages were ALREADY doing this before
   the v1.1 content change; that change would have spread an existing defect from two pages to
   eight rather than introducing a new one.

   The separator travels with the segment it follows, so a wrapped line ends "Version 1.1 ·",
   which reads as continuing, rather than starting "· Effective", which reads as broken. The
   segments are emitted by tools/legal-build.mjs, split from the markdown's own version string --
   nothing here knows what that string says.

   Do NOT solve this by shrinking the type: 13px is the floor for this block. */
.legal-version span { white-space: nowrap; }

/* HANDOVER CORRECTION, not a build deviation. Handover section 3 gives the breadcrumb and the
   version line as rgba(31,41,51,.6) on #F2F4F5. Measured, that is 3.93:1 -- it FAILS the 4.5:1
   gate the handover itself sets in section 7.4, and fails it exactly the way the consent
   banner's "Always on" label did at 3.41:1, which the same document flags three sections later.
   The wrong value was specified, not chosen here.

   --text-muted (#46555e) is the site's existing muted token, picked during the contrast audit
   for this precise problem, and measures 6.99:1 on this background. Using it also avoids
   introducing a colour value, which brief section A4 asks for.

   Recorded as a correction so the wrong value does not come back on the next read of the
   handover. Do not "restore" the opacity. */

/* Handover section 3, body grid. */
.legal-body { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 56px; padding: 44px 0 56px; align-items: start; }

/* ---------------------------------------------------------------------------------------------
   CONTENTS RAIL  --  handover section 3
   --------------------------------------------------------------------------------------------- */

/* A <details open> so the mobile treatment the handover asks for is the same element, not a
   second copy of the list. At desktop the summary is hidden and assets/legal.js forces it open,
   because a visitor who collapses it on a phone and then rotates to landscape would otherwise
   land on a desktop layout with an empty rail. */
/* The first four declarations undo style.css's FAQ accordion, which styles every <details> on
   the site as a white card with a radius and a shadow. The rail is a <details> for the mobile
   behaviour the handover asks for, not because it is an accordion, and at desktop it rendered
   inside a floating card until this was added.

   max-height and overflow-y are not in the handover, and are needed because it was drawn for a
   document with six or seven sections. Terms of Service has seventeen and Privacy sixteen: at
   1440x900 the rail is taller than the viewport, so the last sections are unreachable while it
   is stuck. Scrolling the rail itself is the only fix that keeps it sticky. */
.legal-toc { background: none; box-shadow: none; border-radius: 0; padding: 0; margin-bottom: 0;
  position: sticky; top: 88px; font-size: 14px;
  max-height: calc(100vh - 112px); overflow-y: auto; overscroll-behavior: contain; }
.legal-toc > summary { display: none; }
.legal-toc-label { font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dark-teal); margin-bottom: 12px; }
.legal-toc ul { list-style: none; }
.legal-toc li > a { display: block; padding: 7px 12px; border-left: 2px solid var(--legal-border); color: var(--charcoal); text-decoration: none; line-height: 1.35; }
.legal-toc li > a:hover { color: var(--dark-teal); }
.legal-toc li > a.is-current { border-left-color: var(--teal); background: rgba(23,184,176,.08); color: var(--dark-teal); }
.legal-toc a:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.legal-toc-siblings { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--legal-border); }
.legal-toc-siblings a { display: block; padding: 6px 0; color: var(--text-muted); text-decoration: none; }
.legal-toc-siblings a:hover { color: var(--dark-teal); text-decoration: underline; }

/* ---------------------------------------------------------------------------------------------
   THE ARTICLE  --  handover section 3, heading scale and measure
   --------------------------------------------------------------------------------------------- */

/* max-width 68ch. container-type is what drives the table switch below -- see section 4. */
.legal-doc { max-width: 68ch; container-type: inline-size; container-name: doc; }

/* The site's global h2 is fluid: clamp(1.5rem, 3.5vw, 2.25rem). Left alone it would make these
   headings a different size at every viewport width and never the 25px the handover specifies.
   Fixed sizes scoped here, deliberately overriding the marketing scale -- a document is not a
   landing page and does not want type that reacts to the window. */
.legal-doc h2 { font-family: 'Poppins', sans-serif; font-size: 25px; font-weight: 600; color: var(--dark-teal); line-height: 1.25; margin: 48px 0 14px; scroll-margin-top: 96px; }
.legal-doc h3 { font-family: 'Poppins', sans-serif; font-size: 18px; font-weight: 600; color: var(--charcoal); line-height: 1.3; margin: 32px 0 10px; scroll-margin-top: 96px; }
.legal-doc > :first-child { margin-top: 0; }
.legal-doc p { font-size: 16px; line-height: 1.75; color: var(--charcoal); margin-bottom: 16px; }
.legal-doc ul, .legal-doc ol { margin: 0 0 16px 22px; }
.legal-doc li { font-size: 16px; line-height: 1.75; color: var(--charcoal); margin-bottom: 10px; }
.legal-doc li > ul, .legal-doc li > ol { margin-top: 10px; }

/* Handover section 3, "bold carries legal weight". In these documents ** marks liability
   carve-outs, the return-postage line, and statutory rights that cannot be excluded. Inter 600
   in FULL charcoal -- heavier than the surrounding text, never a colour change and never a
   lighter weight. It has to read as more important, not merely different. */
.legal-doc strong { font-weight: 600; color: var(--charcoal); }
.legal-doc em { font-style: italic; }

/* The pack cites regulators and third parties by full URL, written out in the prose rather than
   hidden behind link text -- deliberately, on a disclosure page. A URL has no break opportunity
   in it, so https://policies.google.com/technologies/cookies is one 374px word: at 390px it
   pushed the whole page 8px wider than the viewport, and at 320px, 78px wider. break-word on the
   article covers prose; anywhere on links lets a URL break mid-token, which is the only way one
   fits a 320px screen. */
.legal-doc { overflow-wrap: break-word; }
.legal-doc a { overflow-wrap: anywhere; }

.legal-doc a { color: var(--dark-teal); text-decoration: underline; text-underline-offset: 2px; }
/* As .legal-sub a:hover above, and for the same measured reason: #17B8B0 on white is 2.46:1
   against 6.08:1 resting. This is the body prose of all nine documents -- 81 links -- so it is
   the larger of the two. */
.legal-doc a:hover { text-decoration-thickness: 2px; }
.legal-doc a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 2px; }

/* The source documents separate sections with a markdown rule. Kept, because it is the authors'
   own structure; the one immediately after the version line is dropped by the converter, since
   the header block already provides that separation. */
.legal-doc hr { border: 0; border-top: 1px solid var(--legal-border); margin: 40px 0; }

/* Handover section 3, the "In short" block. Used on every document that has one. */
.legal-summary { background: var(--grey); border-radius: 12px; padding: 28px 32px; margin-bottom: 32px; }
.legal-summary h2 { font-size: 20px; margin: 0 0 14px; }
.legal-summary ul { margin: 0 0 0 20px; }
.legal-summary li { font-size: 16px; line-height: 1.7; margin-bottom: 12px; }
.legal-summary li:last-child { margin-bottom: 0; }
.legal-summary p:last-child { font-size: 15px; color: rgba(31,41,51,.7); margin: 14px 0 0; }

/* Handover section 3, the statutory callout. For rights the reader must not skim past.
   Yellow tint as a SURFACE is fine. Yellow as legal text is not -- the yellow-on-teal and
   yellow-body-text failures are already recorded. The ink stays charcoal. */
.legal-callout { background: rgba(255,200,87,.16); border: 1px solid rgba(255,200,87,.55); border-radius: 12px; padding: 20px 24px; margin: 24px 0; }
.legal-callout p { font-size: 16px; font-weight: 500; color: var(--charcoal); margin: 0; }
.legal-callout p + p { margin-top: 12px; }

/* ---------------------------------------------------------------------------------------------
   TABLES  --  handover section 4. TWO STRUCTURES, ONE SWITCH POINT.
   --------------------------------------------------------------------------------------------- */

/* The switch is a CONTAINER query on the article, not a viewport media query, because the
   question the handover is actually asking is "does this table fit the column it is in" -- and
   that column is 68ch at desktop and viewport-minus-gutters on a phone, two different
   relationships to the viewport. A container query asks the real question directly.

   The DEFAULT, outside any query, is the bordered table with overflow-x: auto. That is the
   right failure mode on a browser too old for container queries: a table that scrolls sideways
   is usable and loses no column. The @supports block below gives those browsers the switch
   anyway, at the viewport widths where the container reaches 520px. */

.legal-cards { display: none; }

/* Above a 520px container: bordered table. */
.legal-table-wrap {
  border: 1px solid var(--legal-border);
  border-radius: 12px;
  /* LOAD-BEARING, and the handover says so twice. The original overflow: hidden was there to
     clip the border radius and it silently ate the fifth column below 469px -- content gone,
     no scrollbar, no indication anything was missing. On a disclosure page that is the worst
     available failure mode. If the radius clip ever matters more to someone, they add a scroll
     fallback; they do not remove this. */
  overflow-x: auto;
  overflow-y: hidden;
  margin: 20px 0 24px;
}
.legal-table-wrap table { width: 100%; border-collapse: collapse; }
.legal-table-wrap thead th { background: var(--grey); font-family: 'Poppins', sans-serif; font-size: 13px; font-weight: 600; color: var(--dark-teal); text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--legal-border); }
.legal-table-wrap td, .legal-table-wrap tbody th { font-size: 15px; line-height: 1.55; color: var(--charcoal); vertical-align: top; text-align: left; padding: 12px 14px; border-top: 1px solid var(--legal-rule); }
.legal-table-wrap tbody tr:first-child > * { border-top: 0; }
.legal-table-wrap tbody th { font-weight: 600; }
.legal-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--grey); border-radius: 8px; padding: 2px 6px; }

/* Below a 520px container: stacked <dl> pairs, one card per row. */
.legal-card { border: 1px solid var(--legal-border); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.legal-card-head { background: var(--grey); font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600; color: var(--dark-teal); padding: 11px 14px; }
/* HANDOVER CORRECTION, not a build deviation. The handover specifies the card treatment for a
   table WITH a header row -- head + <dl> -- and says nothing about the other shape. A HEADERLESS
   source table, the two-column kind where the first cell is the label and the second the value
   (Terms of Service section 1's "Trading name / ReturnMePlz"), renders as head + body instead,
   and no rule was ever written for the body.

   So .legal-card-head had padding: 11px 14px and .legal-card-body had none. Measured by text
   position rather than box position -- the head's padding is internal, so comparing boxes reports
   0px and hides it -- the label's text started at x=39 and its value at x=25 on every headerless
   card on Terms of Service, Terms of Sale and Privacy, at 320, 360 and 390 alike. A 14px step is
   enough to read as a new row rather than as the value belonging to the label above it.

   Note what this is NOT: the dt/dd padding asymmetry it was first reported as. The <dl> cards
   never stack -- grid-template-columns stays 80px + 190-260px down to 320px and every pair shares
   a row. Do not "fix" the dt/dd gutters; they are correct.

   The same 14px as the head, so label and value share one left edge. The <p> also loses the
   article's 16px paragraph margin, which would otherwise leave a gap inside the card.
   Verified at 320/360/390 across all five pages with cards: 207 cards, 0 misaligned.
   This goes upstream with the rest of this file. */
.legal-card-body { padding: 11px 14px; }
.legal-card-body p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--charcoal); }
.legal-card dl { display: grid; grid-template-columns: 80px minmax(0, 1fr); font-size: 14px; line-height: 1.6; }
.legal-card dt { font-weight: 600; color: var(--dark-teal); padding: 10px 8px 10px 14px; border-top: 1px solid var(--legal-rule); }
.legal-card dd { color: var(--charcoal); padding: 10px 14px 10px 8px; border-top: 1px solid var(--legal-rule); }
.legal-card dl > dt:first-child, .legal-card dl > dt:first-child + dd { border-top: 0; }

@container doc (max-width: 579px) {
  .legal-table-wrap { display: none; }
  .legal-cards { display: block; margin: 20px 0 24px; }
}

/* 580px. THE HANDOVER SAYS 520, AND 520 IS WRONG -- corrected here with the measurement.

   Handover section 4 derives its switch point from "the worst-case table's min-content width
   measures 469px", giving "~50px of headroom". Measured on the built page, the strictly-
   necessary cookie table's min-content is 566px, not 469. So 520 gave no headroom at all: it
   gave a 46px sideways scroll across viewports 568-615, where the table rendered into a
   container too narrow for it.

   The INTENT behind the number is the thing to keep -- the table renders only when it actually
   fits -- so 580 honours the intent and 520 does not. That is ~14px over the measured minimum,
   and it closes the scroll window completely.

   Not fixed by shrinking the type: only the bottom of the handover's own ranges PLUS tighter
   padding (14px body / 12px head / 10px pad) gets min-content under 520, at 507px, and the
   handover argues against exactly that trade -- "shrinking the type to make it fit is the wrong
   trade on a page people read because they need it". It was right. Cards showing between a 566
   and 580px container, where a table would only just fit, is the right side to err on.

   If the table ever gains a column or the type changes, re-measure. Do not assume 580 still
   holds any more than 469 did. */

/* BEFORE RE-LITIGATING 580 BECAUSE A CELL WRAPS ODDLY: check whether the table FITS first.

   It happened once. The complaints timetable broke "1. Acknowledgement" across two lines and the
   switch point was the obvious suspect. It was not involved. Measured: the table's min-content
   was 394px in a 686px container -- it fit with 292px to SPARE. The first column was 163px while
   the label needed 164px, because auto table layout hands the first column whatever the wider
   columns leave. The table had room; the column was starved.

   The fix was therefore on the table rule, not here: numbers are bound to the word they quantify
   with a non-breaking space, in tools/legal-build.mjs. A cell wrapping badly is evidence about
   COLUMN distribution far more often than about the switch point. Compare the table's min-content
   to its container before touching anything in this block.

   Fallback for browsers with no container-query support. The viewport widths here are DERIVED
   from the layout rather than guessed: at desktop the article column is the container minus the
   rail (232px), the grid gap (56px) and the page gutters (48px), so it reaches 580px at a 916px
   viewport; below the 900px rail breakpoint the article is the viewport minus 48px of gutters,
   so it reaches 580px at 628px. If either number changes this block changes with it -- which is
   exactly why the container query is the primary mechanism and this is only the fallback. */
@supports not (container-type: inline-size) {
  @media (max-width: 627px), (min-width: 900px) and (max-width: 915px) {
    .legal-table-wrap { display: none; }
    .legal-cards { display: block; margin: 20px 0 24px; }
  }
}

/* ---------------------------------------------------------------------------------------------
   NARROW  --  handover section 3, "contents on mobile"
   --------------------------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .legal-body { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 28px 0 40px; }
  /* <details open="open">, open by default, per the handover. */
  /* Own border rather than the FAQ card's shadow, so it reads as a contents list rather than as
     one of the accordions on the FAQ page. max-height is released: on a phone the rail is in
     the flow and scrolls with the document. */
  .legal-toc { position: static; max-height: none; overflow: visible; margin-bottom: 28px; border: 1px solid var(--legal-border); border-radius: 12px; padding: 4px 14px 10px; }
  .legal-toc > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; font-family: 'Poppins', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dark-teal); list-style: none; }
  .legal-toc > summary::-webkit-details-marker { display: none; }
  /* content: "+" / "" -- the second value is the pseudo-element's ALTERNATIVE TEXT, and an empty
     one keeps the glyph out of the accessible name. Without it the summary is announced as
     "ON THIS PAGE plus", because a screen reader reads generated content. The open/closed state
     is already carried properly by the <details> element itself, so the glyph is decoration and
     should say nothing. Browsers without alt-text support simply ignore the second value.
     style.css's FAQ accordions have the same wart; fixing those is not this branch's job. */
  .legal-toc > summary::after { content: "+" / ""; font-size: 1.3rem; color: var(--teal); line-height: 1; }
  .legal-toc[open] > summary::after { content: "\2013" / ""; }
  .legal-toc > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
  .legal-toc-label { display: none; }
  .legal-toc li > a { min-height: 44px; display: flex; align-items: center; }
  .legal-toc-siblings a { min-height: 44px; display: flex; align-items: center; }
  .legal-head { padding: 28px 0 26px; }
  .legal-head h1 { font-size: 30px; }
  .legal-sub { font-size: 17px; }
  .legal-doc h2 { font-size: 22px; margin-top: 38px; }
}

/* ---------------------------------------------------------------------------------------------
   PRINT  --  handover section 3
   --------------------------------------------------------------------------------------------- */

/* These documents get printed and saved. Hide the chrome; keep every word of the disclosure.
   Nothing is collapsed for print: a printed policy with hidden sections is not a disclosure. */
@media print {
  header, footer, .legal-toc, .cta-bar, .cookie-banner { display: none !important; }
  .legal-head { background: none; padding: 0 0 18px; }
  .legal-body { display: block; padding: 18px 0 0; }
  .legal-doc { max-width: none; }
  .legal-doc h2, .legal-doc h3 { break-after: avoid; page-break-after: avoid; }
  /* Both treatments have to be settled explicitly for print. Container queries do not resolve
     against the print box the way they do against the viewport, so the cards are hidden and the
     bordered table shown by name rather than left to chance -- and the table is allowed to
     break across pages with its header repeating. */
  .legal-cards { display: none !important; }
  .legal-table-wrap { display: block !important; overflow: visible !important; break-inside: auto; }
  .legal-table-wrap table { break-inside: auto; }
  thead { display: table-header-group; }
  tr, .legal-callout, .legal-summary { break-inside: avoid; page-break-inside: avoid; }
  .legal-doc a { color: #000; text-decoration: underline; }
  .legal-version, .legal-doc { color: #000; }
}
