/* TPS Repair site: visual system.
 *
 * This file is normative. It is the design, not a description of it: an agent
 * building a new page changes markup and reuses these classes, and does not
 * invent sizes, colours, or spacing. See README.md beside this file for what
 * each component is for and for the rules CSS cannot hold.
 *
 * Direction: "documentation shell", with a sticky in-page contents rail beside a
 * text column held to the prose measure. Chosen 2026-08-15.
 *
 * No web fonts and no build step. The consent controller and the checkout form
 * controller are the only site JavaScript, and every page is complete without
 * either; Google Analytics is loaded only after affirmative consent on the
 * three allowlisted information routes.
 * On the deployed site this file is served as /assets/site.css.
 */

/* ---------------------------------------------------------------- tokens -- */

:root {
  color-scheme: light dark;
  --paper: #ffffff;      /* page background */
  --rail: #fafafa;       /* footer, code blocks, quiet panels */
  --ink: #15181b;        /* body text */
  --muted: #62686e;      /* secondary text, table labels, rail links */
  --rule: #e4e5e4;       /* hairline separators */
  --rule-strong: #c8cac9;/* borders that must read as an edge */
  --accent: #1c4a78;     /* links and the primary action. The only colour. */
  --measure: 34rem;      /* prose column: ~57 characters */
  --rail-w: 13.5rem;     /* contents rail */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111315;
    --rail: #16191c;
    --ink: #e3e4e3;
    --muted: #949a9f;
    --rule: #272a2d;
    --rule-strong: #3f4347;
    --accent: #8fb6de;
  }
}

/* ------------------------------------------------------------- base type -- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16.5px/1.64 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Monospace is reserved for filenames, commands, hashes, versions, exit codes,
   and measured values. Never for emphasis. */
code, kbd, pre, samp, .mono { font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; }
code, samp { font-size: 0.89em; }

a { color: var(--accent); text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:focus-visible, .btn:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 0.75rem; border: 1px solid var(--rule-strong); z-index: 5; }

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 2rem; }

/* ---------------------------------------------------------------- header -- */

.site-head { border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--paper); z-index: 3; }
.site-head .wrap { display: flex; align-items: center; gap: 1.5rem; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.98rem; }
.brand img, .brand svg { width: 19px; height: 19px; flex: none; }
.site-nav { margin-left: auto; display: flex; gap: 1.35rem; align-items: center; font-size: 0.92rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
/* The current destination, and only it, is emphasised. One mechanism, not
 * two: what a screen reader announces as current is what the eye sees. A
 * page that is not a nav destination emphasises nothing. */
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.lang { font-size: 0.82rem; letter-spacing: 0.05em; color: var(--muted); }
.lang a { color: var(--muted); }
.lang b { color: var(--ink); }

/* ----------------------------------------------------------------- shell -- */

.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); gap: 0 3.5rem; padding: 2.6rem 0 4rem; }
.shell > * { min-width: 0; }
.shell.no-rail { grid-template-columns: minmax(0, 1fr); }
.shell.no-rail .doc { max-width: 48rem; }

.rail { position: sticky; top: 4.2rem; align-self: start; font-size: 0.88rem; padding-top: 0.5rem; }
.rail h2 { font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; margin: 0 0 0.6rem; border: 0; padding: 0; }
.rail ul { list-style: none; margin: 0 0 1.8rem; padding: 0; border-left: 1px solid var(--rule); }
.rail li { margin: 0; }
.rail a { display: block; padding: 0.25rem 0 0.25rem 0.85rem; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; }
.rail a:hover { color: var(--ink); border-left-color: var(--rule-strong); }
.rail a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }

.doc { max-width: var(--measure); }

/* --------------------------------------------------------------- headings -- */

h1 { font-size: 1.95rem; line-height: 1.22; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 0.9rem; }
h2 { font-size: 1.12rem; font-weight: 600; letter-spacing: -0.008em; margin: 2.6rem 0 0.8rem; padding-top: 1.6rem; border-top: 1px solid var(--rule); }
h3 { font-size: 0.99rem; font-weight: 600; margin: 1.7rem 0 0.35rem; }
p { margin: 0 0 1.05rem; }
.lede { font-size: 1.1rem; line-height: 1.55; }
.note { color: var(--muted); font-size: 0.9rem; }

/* --------------------------------------------------------------- actions -- */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.35rem; margin: 1.5rem 0 1rem; }
.btn {
  display: inline-block; background: var(--accent); color: var(--paper);
  padding: 0.58rem 1.05rem; border-radius: 3px; text-decoration: none;
  font-size: 0.94rem; font-weight: 500; border: 1px solid var(--accent);
  font-family: inherit; cursor: pointer;
  /* Stated, because a button and a link styled as one otherwise disagree by
     five pixels: the UA gives button a normal line-height and the anchor
     inherits the body's. They sit side by side on the checkout review. */
  line-height: 1.6;
}
@media (prefers-color-scheme: dark) { .btn { color: #0d1319; } }
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: transparent; color: var(--accent); border-color: var(--rule-strong); }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:disabled { color: var(--paper); }
@media (prefers-color-scheme: dark) { .btn:disabled { color: #0d1319; } }

.availability {
  border-left: 2px solid var(--rule-strong);
  padding: 0.15rem 0 0.15rem 1rem;
  margin: 1rem 0 1.6rem;
}
.availability p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- consent -- */

.consent-settings {
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
}
.consent-settings p:last-child { margin-bottom: 0; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.consent-actions .btn { min-width: 8.5rem; text-align: center; }
.consent-state { color: var(--muted); }

.consent-banner {
  position: fixed;
  z-index: 10;
  inset: auto 0 0;
  padding: 1rem 0;
  border-top: 1px solid var(--rule-strong);
  background: var(--paper);
  box-shadow: 0 -0.25rem 1rem rgb(0 0 0 / 12%);
}
.consent-banner .consent-layout {
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
}
.consent-banner p { flex: 1 1 25rem; margin: 0; }
.consent-banner .consent-actions { flex: 1 1 18rem; margin: 0; }
.consent-banner .btn { flex: 1 1 8.5rem; }

/* ----------------------------------------------------------------- lists -- */

ol.steps, ul.limits { margin: 0 0 1.05rem; padding-left: 1.35rem; }
ol.steps li, ul.limits li { margin-bottom: 0.32rem; }
dl.tiers { margin: 0 0 1.05rem; }
dl.tiers dt { font-weight: 600; margin-top: 0.95rem; }
dl.tiers dt:first-child { margin-top: 0; }
dl.tiers dd { margin: 0.08rem 0 0; color: var(--muted); }

/* -------------------------------------------------------- real artifacts -- */

/* A screenshot, sample report, first-party recording, or other real evidence.
   May exceed the prose measure; must never be decoration. */
figure.shot { margin: 1.9rem 0; width: min(44rem, calc(100vw - 4rem)); }
figure.shot > a { display: block; }
figure.shot img, figure.shot video { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 3px; }
figure.shot figcaption { margin-top: 0.6rem; font-size: 0.88rem; color: var(--muted); max-width: var(--measure); }

/* Chapters of a recording: links that seek the player above them. */
figure.shot ol.chapters { list-style: none; margin: 0.8rem 0 0; padding: 0; columns: 2; column-gap: 2rem; font-size: 0.92rem; }
figure.shot ol.chapters li { break-inside: avoid; padding: 0.16rem 0; }
figure.shot ol.chapters time { display: inline-block; min-width: 2.6rem; font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; font-size: 0.85rem; color: var(--muted); }
figure.shot ol.chapters a[aria-current="true"] { color: var(--ink); font-weight: 600; }
@media (max-width: 34rem) { figure.shot ol.chapters { columns: 1; } }

/* --------------------------------------------------------------- tabular -- */

table.facts { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; font-size: 0.92rem; }
table.facts th, table.facts td { text-align: left; vertical-align: top; padding: 0.45rem 0.9rem 0.45rem 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
table.facts th { color: var(--muted); width: 8rem; white-space: nowrap; }
table.facts td { font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; font-size: 0.85rem; word-break: break-all; }
table.facts td.plain { font-family: inherit; font-size: 0.92rem; word-break: normal; }
table.facts thead th { width: auto; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--rule-strong); }

/* A comparison table may exceed the prose measure. */
table.compare { border-collapse: collapse; width: min(44rem, 100%); margin: 0 0 1.5rem; font-size: 0.92rem; }
table.compare th, table.compare td { text-align: left; vertical-align: top; padding: 0.5rem 1rem 0.5rem 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
table.compare thead th { font-weight: 600; border-bottom: 1px solid var(--rule-strong); }
table.compare th[scope="row"] { color: var(--muted); }

pre { margin: 0 0 1.5rem; padding: 0.8rem 1rem; overflow-x: auto; background: var(--rail); border: 1px solid var(--rule); border-radius: 3px; font-size: 0.84rem; line-height: 1.5; }
pre, table { max-width: 100%; }

.inline-links { color: var(--muted); font-size: 0.92rem; }
.release-notes ul { padding-left: 1.35rem; }
.release-notes li { margin-bottom: 0.55rem; }

/* ------------------------------------------------------- long documents -- */

/* Terms, Privacy, and the licence agreement. The document occupies the page so
   browser search, printing, linking, and keyboard navigation work normally.
   Never place an agreement in a fixed-height scrolling box. */
.legal-meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.6rem; }
.legal-body h2 { font-size: 1.05rem; }
.legal-body h3 { font-size: 0.95rem; }
.legal-body ol, .legal-body ul { padding-left: 1.35rem; }
.legal-body li { margin-bottom: 0.4rem; }
.legal-body table { display: block; width: 100%; overflow-x: auto; }
.terms-document table { border-collapse: collapse; font-size: 0.92rem; }
.terms-document th, .terms-document td {
  vertical-align: top;
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 400;
}
.terms-document thead th { font-weight: 600; border-bottom-color: var(--rule-strong); }
.terms-document th:first-child, .terms-document td:first-child { min-width: 6rem; white-space: nowrap; }
.terms-document th:nth-child(2), .terms-document td:nth-child(2) { min-width: 13rem; white-space: nowrap; }
.legal-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  line-height: inherit;
}
.license-document .legal-text {
  font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
}

/* --------------------------------------------------- private buyer page -- */

/* Order and build state. Always noindex, nofollow, noarchive, no-store. */
dl.meta { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.4rem 1rem; margin: 0 0 1.5rem; font-size: 0.94rem; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }
dl.meta dd.mono { font-size: 0.88rem; }

/* One functional status panel, not a decorative card. Exactly one state shows:
   ready, preparing, not prepared or failed, hosted access ended, licence ended. */
.state { border: 1px solid var(--rule-strong); border-radius: 3px; padding: 1.1rem 1.2rem; margin: 0 0 1.5rem; }
.state > *:first-child { margin-top: 0; }
.state > *:last-child { margin-bottom: 0; }
.state h3 { margin-top: 0; }
.state .status { color: var(--muted); font-size: 0.92rem; }

details.versions { border-top: 1px solid var(--rule); padding-top: 1rem; }

.buyer dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 1rem; }
.buyer dl dt { color: var(--muted); }
.buyer dl dd { margin: 0; overflow-wrap: anywhere; }
.buyer .current, .buyer .upgrade { border: 1px solid var(--rule-strong); padding: 1.1rem 1.2rem; margin-top: 1.5rem; }
.buyer .primary { display: inline-block; margin-top: 0.5rem; font-weight: 600; }
.buyer .muted { color: var(--muted); }
.buyer .history { padding-left: 1.25rem; }
.buyer details { margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.buyer summary { cursor: pointer; font-weight: 600; }
.buyer button { font: inherit; padding: 0.55rem 0.8rem; }
.error-page { padding-top: 4rem; padding-bottom: 6rem; }

/* Checkout review uses the same restrained document shell, with form controls
   added to the system instead of falling back to browser-default fieldsets. */
.checkout .shell { padding-top: 2.8rem; }
.checkout .doc { max-width: 44rem; }
.checkout-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  gap: 0.35rem 1.5rem;
  align-items: start;
  margin-top: 2rem;
}
.checkout-summary h2 { border: 0; margin: 0.1rem 0 0.3rem; padding: 0; }
.checkout-summary p { margin-bottom: 0; }
.checkout-eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.76rem; color: var(--muted); margin: 0; }
.checkout-price { text-align: right; }
.checkout-price strong { display: block; font-size: 1.45rem; line-height: 1.25; }
.checkout-price span { display: block; color: var(--muted); font-size: 0.84rem; }
.checkout-includes { grid-column: 1 / -1; margin: 0.9rem 0 0; }
.checkout-summary-note { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 0.8rem; margin-top: 0.9rem; }

.checkout-form { margin-top: 1.8rem; }
.checkout-form fieldset {
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 1.2rem;
  margin: 0 0 1.2rem;
}
.checkout-form legend { font-weight: 600; padding: 0 0.45rem; margin-left: -0.45rem; }
.checkout-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.checkout-field { display: block; min-width: 0; }
.checkout-field > span { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.28rem; }
.checkout-field input, .checkout-field select {
  display: block;
  width: 100%;
  min-height: 2.7rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.checkout-field input:focus, .checkout-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.checkout-field .note { margin: 0.35rem 0 0; font-weight: 400; }
.checkout-wide { grid-column: 1 / -1; }
.checkout-business { display: grid; gap: 0.9rem; padding-top: 0.2rem; }
.checkout-business > .note:first-child { margin: 0; }
.checkout-check { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: 0.65rem; align-items: start; margin: 0 0 0.9rem; }
.checkout-check:last-child { margin-bottom: 0; }
.checkout-check input { width: 1rem; height: 1rem; margin: 0.32rem 0 0; accent-color: var(--accent); }
.checkout-consumer-supply .note { margin: -0.35rem 0 0 1.75rem; }
.checkout-form [hidden] { display: none; }
.checkout-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.8rem 1rem; margin-top: 1.4rem; }
.checkout-actions .btn { min-width: 14rem; }
.checkout-actions .btn.secondary { min-width: 0; }

/* A rejected submission is stated in words, position, and weight. There is no
   error colour: the summary is a bordered block above the fields carrying a
   heavier leading edge, and an invalid control carries a heavier border. */
.checkout-errors { border: 1px solid var(--rule-strong); border-left-width: 4px; border-radius: 3px; padding: 1rem 1.2rem; margin: 0 0 1.4rem; }
.checkout-errors h2 { font-size: 1rem; font-weight: 600; margin: 0 0 0.5rem; padding: 0; border: 0; }
.checkout-errors p { font-size: 0.94rem; margin: 0 0 0.6rem; }
.checkout-errors ul { margin: 0; padding-left: 1.15rem; font-size: 0.94rem; }
.checkout-errors li { margin-bottom: 0.2rem; }
.checkout-errors li:last-child { margin-bottom: 0; }
.checkout-field-error { display: block; font-size: 0.9rem; font-weight: 600; margin-top: 0.35rem; }
.checkout-check + .checkout-field-error { margin: -0.55rem 0 0.9rem 1.75rem; }
.checkout-field input[aria-invalid="true"], .checkout-field select[aria-invalid="true"] { border-width: 2px; border-color: var(--ink); }
.checkout-check input[aria-invalid="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 34rem) {
  .buyer dl { grid-template-columns: 1fr; }
  .buyer dl dd { margin-bottom: 0.45rem; }
  .checkout .shell { padding-top: 2rem; }
  .checkout-summary { grid-template-columns: 1fr; }
  .checkout-price { text-align: left; }
  .checkout-fields { grid-template-columns: 1fr; }
  .checkout-wide { grid-column: auto; }
  .checkout-actions { align-items: stretch; flex-direction: column; }
  .checkout-actions .btn { width: 100%; }
}
details.versions summary { cursor: pointer; font-size: 0.94rem; font-weight: 500; }
details.versions table { margin-top: 1rem; }

/* ---------------------------------------------------------------- footer -- */

.site-foot { border-top: 1px solid var(--rule); background: var(--rail); padding: 2.4rem 0 3.5rem; font-size: 0.88rem; color: var(--muted); }
.foot-cols { display: grid; grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 1.65fr); gap: 1.8rem 3.5rem; }
.foot-cols > * { min-width: 0; }
.site-foot h2 { font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink); font-weight: 600; margin: 0 0 0.55rem; border: 0; padding: 0; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 0.28rem; }
.site-foot a { color: var(--muted); }
.site-foot p { margin: 0 0 0.45rem; }
.legal-links a { margin-right: 0.9rem; }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 58rem) {
  body { font-size: 16px; }
  h1 { font-size: 1.75rem; }
  .shell { grid-template-columns: 1fr; gap: 0; }
  .rail { position: static; border-bottom: 1px solid var(--rule); padding-bottom: 1.2rem; margin-bottom: 1.8rem; }
  .rail ul { margin-bottom: 1rem; }
  .site-head { position: static; }
  .site-head .wrap { flex-wrap: wrap; gap: 0.6rem 1.1rem; }
  .site-nav { margin-left: 0; width: 100%; gap: 1rem; }
  .foot-cols { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); }
  .foot-cols section:last-child { grid-column: 1 / -1; }
  dl.meta { grid-template-columns: 1fr; gap: 0; }
  dl.meta dt { margin-top: 0.6rem; }
  .consent-banner .consent-layout { align-items: stretch; flex-direction: column; }
  .consent-banner p, .consent-banner .consent-actions { flex-basis: auto; }
}
@media (max-width: 34rem) { .foot-cols { grid-template-columns: 1fr; } }

@media print {
  .site-head, .rail, .site-foot, .skip, .consent-banner, .consent-settings { display: none; }
  .shell { display: block; padding: 0; }
  .doc { max-width: none; }
  a { color: inherit; }
}

/* Measured sample-report counters, kept readable without a screenshot. */
.report-excerpt { margin: 1.8rem 0 0; max-width: 48rem; }
.report-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); margin: 0; border: 1px solid var(--rule); background: var(--rail); }
.report-metrics > div { padding: 0.85rem; }
.report-metrics dt { font-size: 0.82rem; color: var(--muted); }
.report-metrics dd { margin: 0.25rem 0 0; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.report-excerpt figcaption { margin-top: 0.65rem; font-size: 0.88rem; color: var(--muted); }
@media (max-width: 34rem) { .report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
