/*
 * Launch Check — shared tool design system.
 *
 * Served at /tools/tools.css and loaded by every static tool page
 * (/device-info/, /website-analyzer/). It holds everything the tools share:
 * tokens, the page chrome, buttons, cards, badges, the mode selector, FAQ,
 * toast and print rules. Page-specific layout lives in each tool's own
 * stylesheet, loaded after this one.
 *
 * The tokens are Launch Check's, copied from
 * responsive-viewer/apps/web/src/styles.css so the static tools and the React
 * app are one product: a light surface built from the logo's own colours —
 * navy #032b5b, blue #025ebc, sky #0399e3 and emerald #03b983 — with blue as
 * the only accent, emerald reserved for pass states so it never competes with
 * the call to action, JetBrains Mono for measurements and IBM Plex Sans for
 * prose. `ink-*` is the surface ramp (900 is the page ground), `fog-*` the
 * text ramp (50 is the strongest).
 *
 * Plain CSS, no build step. These pages ship as static files, so a utility
 * framework would mean either a pipeline to maintain or a large CDN script to
 * read a screen size.
 */

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

/*
 * Two themes, one set of names.
 *
 * Light is the default and lives on :root. Dark is an override keyed on
 * data-theme, set by the toggle in the header and persisted per visitor. Only
 * the colour values change — every component reads the same token, so neither
 * theme needs component-level special cases.
 *
 * The ramps keep their roles in both: `ink-*` is the surface ramp (900 is the
 * page ground, 400 the strongest rule) and `fog-*` the text ramp (500 quietest,
 * 50 strongest). That is why the light values run light-to-dark and the dark
 * values run dark-to-light; the direction flips, the meaning does not.
 */
:root {
  --ink-900: #eef3f9;
  --ink-850: #f7fafd;
  --ink-800: #ffffff;
  --ink-700: #e2eaf3;
  --ink-600: #cfdcea;
  --ink-500: #b3c5d8;
  --ink-400: #8fa6be;

  --fog-500: #5b7186;
  --fog-300: #3d566e;
  --fog-100: #16304c;
  --fog-50: #0a1f38;

  --brand-500: #025ebc;
  --brand-600: #01458c;
  --brand-300: #d8e9fb;

  --pass-500: #06805c;
  --warn-500: #9a6700;
  --fail-500: #c4322a;
  --info-500: #0369a1;

  /* Tints, used for section bands and soft fills in both themes. */
  --brand-wash: #e8f1fd;
  --grid-line: rgba(47, 78, 115, 0.09);

  --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  /* Shape and control sizing, taken from the homepage. Every tool consumes
     these rather than restating a radius or a height. */
  --radius-card: 12px;
  --radius-control: 8px;
  --control-h: 46px;
  --gutter: clamp(16px, 4vw, 32px);
  --maxw: 1180px;

  color-scheme: light;
}

:root[data-theme='dark'] {
  --ink-900: #07090c;
  --ink-850: #0b0e13;
  --ink-800: #0f141b;
  --ink-700: #161c26;
  --ink-600: #1e2733;
  --ink-500: #2a3542;
  --ink-400: #3d4a5a;

  --fog-500: #7d8ea3;
  --fog-300: #9aa8b8;
  --fog-100: #dfe6ee;
  --fog-50: #f4f7fa;

  /* Lifted off the logo blue: #025ebc is too dark to read on near-black, so
     the dark theme uses the logo's sky instead and keeps the same role. */
  --brand-500: #4da3f0;
  --brand-600: #7dbdf5;
  --brand-300: #12314f;

  --pass-500: #3fb950;
  --warn-500: #d29922;
  --fail-500: #f85149;
  --info-500: #58a6ff;

  --brand-wash: #0d1826;
  --grid-line: rgba(120, 150, 185, 0.10);

  color-scheme: dark;
}

/* -------------------------------------------------------------- foundation */

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

html {
  /* Stops iOS inflating text in landscape, which breaks measurement grids. */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* A column so the footer's margin-top:auto holds it to the bottom on short
     pages, the same way the React pages use flex-1 on <main>. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink-900);
  color: var(--fog-100);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* No page may scroll sideways at any width. Long user agents, URLs and
     technology names are the usual causes, and each is also handled at its own
     container. */
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fog-50);
  text-wrap: balance;
}

p { margin: 0; }

a {
  color: var(--brand-500);
  text-underline-offset: 3px;
}
a:hover { color: var(--brand-600); }

/* Measurements are compared column-wise; without tabular figures the digits
   jitter and the eye cannot scan them. */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* The outline follows the element's own border-radius in every current
   browser, so this must NOT set one — doing so silently overrode the radius of
   whichever control happened to be focused. */
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brand-500);
  color: var(--ink-900);
  font-weight: 600;
  border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

/*
 * The hidden attribute must beat any class that sets display.
 *
 * The browser's own rule is `[hidden] { display: none }`, which a single class
 * like `.card { display: flex }` outranks — so an element toggled with
 * `el.hidden = true` stays on screen while every script believes it is gone.
 * This is the one place in the system where !important is the correct tool: the
 * alternative is a `[hidden]` override beside every component that sets display,
 * and forgetting one is invisible until a panel appears in the wrong state.
 */
[hidden] {
  display: none !important;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ink-900) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-700);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-block: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
/* The emblem only. The logo's own "LAUNCH" wordmark is dark navy and would be
   unreadable on this background, so the name beside it stays live text. */
.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}
.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fog-50);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fog-300);
  text-decoration: none;
  border: 1px solid transparent;
}
.site-nav a:hover {
  color: var(--fog-50);
  background: var(--ink-800);
}
.site-nav a[aria-current='page'] {
  color: var(--fog-50);
  background: var(--ink-800);
  border-color: var(--ink-600);
}

/* Theme toggle and menu button, kept together at the end of the bar. */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/*
 * Theme toggle.
 *
 * One button, not a two-option switch: there are exactly two themes and the
 * button says which one it will move you to. Both glyphs are in the markup and
 * CSS shows the relevant one, so switching costs no request and no repaint of
 * an icon font.
 */
.theme-toggle,
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid var(--ink-600);
  border-radius: 8px;
  background: var(--ink-800);
  color: var(--fog-300);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.theme-toggle:hover,
.nav-toggle:hover {
  color: var(--brand-500);
  border-color: var(--brand-500);
}
.theme-toggle svg,
.nav-toggle svg {
  grid-area: 1 / 1;
  width: 17px;
  height: 17px;
}

/*
 * Menu button.
 *
 * Hidden until the bar runs out of room. Four tool names plus the brand and the
 * theme toggle need about 690px; below that the nav wrapped onto two and three
 * lines and the header ate a third of a phone screen.
 */
.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded='true'] .icon-menu { display: none; }
.nav-toggle[aria-expanded='true'] .icon-close { display: block; }
/* Show the destination, not the current state: in light you see the moon. */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-moon { display: none; }
:root[data-theme='dark'] .theme-toggle .icon-sun { display: block; }

/*
 * Collapsed navigation.
 *
 * The links become a panel on their own row rather than a slide-in drawer or an
 * overlay: the header is already sticky, there are four destinations, and a
 * drawer would need a scroll lock, a focus trap and a backdrop to be correct.
 * A disclosure needs none of that and stays operable if the JS never arrives —
 * the panel is only hidden once the button that opens it exists, so a visitor
 * with no JavaScript sees the plain wrapped list rather than nothing.
 */
@media (max-width: 1023px) {
  .nav-toggle { display: inline-grid; }

  .site-header .wrap {
    flex-wrap: wrap;
    row-gap: 0;
  }
  .brand { order: 1; }
  .header-actions { order: 2; margin-left: auto; }

  /* Spacing here is kept identical to SiteNav.tsx, so the panel is the same
     height on a static tool page as on the React ones. */
  /* `js` is set by tools.js. Without it the list simply stays visible. */
  .js .site-nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-top: 8px;
    padding-bottom: 4px;
    border-top: 1px solid var(--ink-700);
  }
  .js .site-nav[data-open='true'] { display: flex; }

  .site-nav a {
    min-height: 44px;
    padding: 6px 12px;
    font-size: 13.5px;
  }
}

/* -------------------------------------------------------------------- hero */

.hero {
  padding-block: clamp(36px, 7vw, 64px) clamp(24px, 4vw, 36px);
  border-bottom: 1px solid var(--ink-700);
  /* A faint measurement grid, echoing the canvas in the Responsive Tester. */
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 120px 120px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px 10px;
  border: 1px solid var(--ink-600);
  border-radius: 999px;
  background: var(--ink-850);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog-300);
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pass-500);
  flex-shrink: 0;
}

.hero h1 {
  font-size: clamp(28px, 5.4vw, 44px);
  line-height: 1.1;
}
.hero .lede {
  margin-top: 12px;
  max-width: 62ch;
  font-size: clamp(14.5px, 2.2vw, 17px);
  color: var(--fog-300);
}
.hero .privacy-line {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fog-500);
}

/* ----------------------------------------------------------- mode selector */

/*
 * "What would you like to check?"
 *
 * Two large targets rather than tabs, because the choice is between two
 * different jobs — reading your own device, and analysing someone else's site —
 * and a tab strip would imply they are views of one thing. The active card is
 * marked with aria-current, and its state is carried by border and background
 * as well as colour.
 */
.mode-select {
  margin-top: 26px;
}
.mode-select h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-500);
  margin-bottom: 10px;
}
.mode-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
}

.mode {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-850);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.mode:hover {
  border-color: var(--ink-400);
  background: var(--ink-800);
  color: inherit;
}
.mode[aria-current='page'] {
  border-color: var(--brand-500);
  background: color-mix(in srgb, var(--brand-500) 8%, var(--ink-850));
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ink-700);
  color: var(--fog-300);
  flex-shrink: 0;
}
.mode[aria-current='page'] .mode-icon {
  background: var(--brand-500);
  color: var(--ink-900);
}

.mode-body { min-width: 0; }
.mode-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fog-50);
}
.mode-desc {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fog-500);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* ------------------------------------------------------------ form controls */

/*
 * The URL row.
 *
 * Every tool that takes a website address uses this — the tester, the analyzer,
 * the health checker and anything added later — so the control is defined once
 * here rather than copied into each tool's stylesheet. It was previously
 * duplicated byte-for-byte in two of them, which is how the radius drifted
 * apart from the rest of the system.
 */
.url-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 620px) {
  .url-row { flex-direction: row; }
}
.url-row .btn { flex-shrink: 0; }

.url-input {
  /* min-width:0 lets the input shrink inside the flex row instead of forcing
     the row wider than the page on narrow screens. */
  min-width: 0;
  flex: 1;
  min-height: var(--control-h);
  padding: 11px 14px;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-control);
  background: var(--ink-800);
  color: var(--fog-50);
  font-family: inherit;
  font-size: 14.5px;
}
.url-input::placeholder { color: var(--fog-500); }
.url-input:focus { border-color: var(--brand-500); }
.url-input[aria-invalid='true'] { border-color: var(--fail-500); }

.url-hint { margin-top: 8px; font-size: 12px; color: var(--fog-500); }
.url-error {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fail-500);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* 44px is the minimum comfortable touch target and the reason these never
     shrink on mobile. */
  min-height: var(--control-h);
  padding: 10px 18px;
  border-radius: var(--radius-control);
  border: 1px solid var(--ink-600);
  background: var(--ink-800);
  color: var(--fog-100);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover {
  background: var(--ink-700);
  border-color: var(--ink-500);
  color: var(--fog-50);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: var(--ink-900);
}
.btn-primary:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: var(--ink-900);
}

.btn-sm {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 500;
}

.btn[disabled],
.btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }

.btn svg { flex-shrink: 0; }

/* ---------------------------------------------------------------- sections */

.section {
  padding-block: clamp(36px, 6vw, 56px);
  border-bottom: 1px solid var(--ink-700);
}

.section-head { margin-bottom: 22px; }
.section-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(19px, 3vw, 24px);
}
.section-head .blurb {
  margin-top: 8px;
  max-width: 78ch;
  font-size: 13.5px;
  color: var(--fog-500);
}

.section-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--ink-700);
  color: var(--brand-500);
  flex-shrink: 0;
}

/* ----------------------------------------------------------------- badges */

/* Badges carry their own text, so status is never conveyed by colour alone. */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid;
  font-family: var(--font-sans);
  /* 11px is the floor for a small uppercase label; 9.5px was hard to read on
     a phone, which is where these badges matter most. */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-partial {
  color: var(--warn-500);
  border-color: color-mix(in srgb, var(--warn-500) 40%, transparent);
  background: color-mix(in srgb, var(--warn-500) 12%, transparent);
}
.badge-na {
  color: var(--fog-500);
  border-color: var(--ink-600);
  background: var(--ink-800);
}
.badge-live {
  color: var(--info-500);
  border-color: color-mix(in srgb, var(--info-500) 40%, transparent);
  background: color-mix(in srgb, var(--info-500) 12%, transparent);
}
.badge-ok {
  color: var(--pass-500);
  border-color: color-mix(in srgb, var(--pass-500) 40%, transparent);
  background: color-mix(in srgb, var(--pass-500) 12%, transparent);
}

/* --------------------------------------------------------------- code block */

.code-block {
  position: relative;
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-900);
  overflow: hidden;
}
.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 13px;
  border-bottom: 1px solid var(--ink-700);
  background: var(--ink-850);
}
.code-block-head > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-500);
}
.code-block pre {
  margin: 0;
  padding: 13px;
  /* Wrap rather than scroll for prose-like values: a phone cannot discover a
     horizontal scroll region it cannot see. The JSON block opts into scrolling
     with .scroll, because wrapping would destroy its indentation. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--fog-100);
}
.code-block pre.scroll {
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  max-height: 380px;
  overflow-y: auto;
}
.code-block pre::-webkit-scrollbar { width: 10px; height: 10px; }
.code-block pre::-webkit-scrollbar-track { background: var(--ink-900); }
.code-block pre::-webkit-scrollbar-thumb {
  background: var(--ink-500);
  border: 2px solid var(--ink-900);
  border-radius: 999px;
}

/* Kept in the stylesheet rather than a style attribute so the pages need no
   inline-style allowance from the site's Content Security Policy. */
.code-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------------- privacy */

.privacy-card {
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-850);
  padding: clamp(18px, 3.5vw, 28px);
}
.privacy-card h2 { font-size: clamp(18px, 3vw, 22px); }
.privacy-card p {
  margin-top: 12px;
  max-width: 76ch;
  font-size: 14px;
  color: var(--fog-300);
}
.privacy-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}
.privacy-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--fog-300);
}
.privacy-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--brand-500);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------- faq */

.faq-list { display: grid; gap: 8px; }

.faq {
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-850);
  overflow: hidden;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  min-height: 44px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fog-50);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  color: var(--fog-500);
  flex-shrink: 0;
}
.faq[open] summary::after { content: '−'; }
.faq summary:hover { background: var(--ink-800); }
.faq-answer {
  padding: 0 16px 15px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--fog-300);
  max-width: 80ch;
}

/* ---------------------------------------------------------------- sibling */

.cross-link {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: clamp(16px, 3vw, 22px);
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-850);
}
.cross-link + .cross-link { margin-top: 10px; }
.cross-link-body { flex: 1 1 280px; min-width: 0; }
/* These strings can carry an interpolated hostname, and a long host has no
   space to break at — without this it forces the card wider than the page.
   Caught at 320px with an 82-character hostname. */
.cross-link h3 {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.cross-link p {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--fog-500);
  overflow-wrap: anywhere;
}

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

/*
 * Site footer.
 *
 * Matches SiteFooter.tsx in the React app exactly — same two blocks, same
 * spacing, same tool list — so every page on the site ends the same way
 * whichever stack rendered it.
 */
.site-footer {
  margin-top: auto;
  padding-block: 40px;
  border-top: 1px solid var(--ink-700);
  background: var(--ink-850);
  color: var(--fog-500);
  font-size: 13px;
}
.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
@media (min-width: 640px) {
  .site-footer .wrap {
    flex-direction: row;
    /* Wrap so the legal line can take a full-width row of its own beneath the
       two columns rather than becoming a third one. */
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.footer-brand { max-width: 24rem; }
.footer-brand .footer-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-brand img {
  width: 26px;
  height: 26px;
  display: block;
}
.footer-brand .footer-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--fog-50);
}
.footer-brand p {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fog-500);
}

.site-footer nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer nav h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-500);
}
.site-footer a {
  font-size: 13px;
  color: var(--fog-300);
  text-decoration: none;
}
.site-footer a:hover { color: var(--brand-500); }

/*
 * The legal line.
 *
 * A full-width row under the two footer columns, not a third column: it applies
 * to the site rather than to the tool list beside it, and on a phone it stays
 * put while the columns above it stack. `flex-basis: 100%` is what breaks it
 * onto its own line inside the footer's flex row.
 */
.footer-legal {
  flex-basis: 100%;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--ink-700);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--fog-500);
}
.footer-legal a {
  font-size: inherit;
  color: var(--fog-300);
  text-decoration: underline;
  text-decoration-color: var(--ink-500);
  text-underline-offset: 3px;
}
.footer-legal a:hover {
  color: var(--brand-500);
  text-decoration-color: currentColor;
}

/* ----------------------------------------------------------------- support */

/*
 * The support reminder.
 *
 * A small dismissible card placed IN THE PAGE FLOW at the end of a tool's
 * finished results (support.js puts it there), never fixed over the page: at
 * the bottom-right corner of the results on wide screens, full width after
 * them on phones. It cannot cover a result, never traps focus and is removed
 * from the DOM entirely when closed.
 */
.lc-support-pop {
  position: relative;
  width: min(324px, 100%);
  margin: 18px 0 0 auto;
  padding: 15px 16px 16px;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-800);
  box-shadow: 0 18px 40px -22px rgba(10, 31, 56, 0.45);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.lc-support-pop[data-open='true'] {
  opacity: 1;
  transform: translateY(0);
}

.lc-pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.lc-pop-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--fog-50);
}
.lc-pop-close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fog-500);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.lc-pop-close:hover { color: var(--fog-50); background: var(--ink-700); }

.lc-pop-body {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fog-300);
}
.lc-pop-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-control);
  background: var(--brand-500);
  color: var(--ink-900);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.lc-pop-cta:hover { background: var(--brand-600); color: var(--ink-900); }

@media (max-width: 480px) {
  /* After the results, full width of the content column. */
  .lc-support-pop {
    width: auto;
    margin: 16px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lc-support-pop { transition: none; transform: none; }
}

/* ------------------------------------------------------------------ toasts */

/* Confirmations are announced to screen readers through the live region in the
   markup; this is only the visual half. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 11px 17px;
  border: 1px solid var(--ink-500);
  border-radius: 8px;
  background: var(--ink-700);
  color: var(--fog-50);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast::before {
  content: '✓';
  color: var(--pass-500);
  font-weight: 700;
}
.toast.error::before { content: '!'; color: var(--fail-500); }

/* ---------------------------------------------------------------- noscript */

.noscript {
  margin: 20px auto;
  max-width: var(--maxw);
  padding: 16px 18px;
  border: 1px solid var(--warn-500);
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn-500) 10%, transparent);
  color: var(--fog-50);
  font-size: 14px;
}

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

@media (max-width: 560px) {
  .actions .btn { flex: 1 1 100%; }
  /* The bar keeps its 60px minimum at every width: the header is the one piece
     of furniture shared with the React pages, and a shorter one here made the
     site jump 4px on every navigation between them. */
  .brand-name { font-size: 15px; }
}

/* Below 380px the nav labels and the brand together overflow the bar. Dropping
   the brand wordmark keeps the mark, which is enough to identify the site. */
@media (max-width: 379px) {
  .brand-name { display: none; }
  .site-nav a { padding: 6px 9px; font-size: 13px; }
}

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

/* ------------------------------------------------------------ legal pages */

/*
 * Privacy, Terms, Refunds, Shipping, Contact and the support thank-you page:
 * long-form text in one readable column. Colours come from the tokens above,
 * so both themes work without a rule of their own.
 */
.legal {
  max-width: 72ch;
  padding-block: clamp(24px, 4vw, 40px) clamp(36px, 6vw, 56px);
  font-size: 15px;
  line-height: 1.7;
  color: var(--fog-300);
}
.legal h2 {
  margin-top: 34px;
  font-size: clamp(18px, 2.6vw, 21px);
  color: var(--fog-50);
}
.legal h3 {
  margin-top: 22px;
  font-size: 16px;
  color: var(--fog-50);
}
.legal p, .legal ul, .legal table { margin-top: 12px; }
.legal ul { padding-left: 1.3em; }
.legal li + li { margin-top: 6px; }
.legal strong { color: var(--fog-50); font-weight: 600; }
.legal a:not(.btn) { color: var(--brand-500); text-underline-offset: 3px; }
.legal .actions { margin-top: 22px; }
.legal .legal-meta { font-size: 13px; color: var(--fog-500); }
.legal .table-scroll { overflow-x: auto; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.55;
}
.legal th, .legal td {
  padding: 10px 12px;
  border: 1px solid var(--ink-600);
  text-align: left;
  vertical-align: top;
}
.legal th { background: var(--ink-850); color: var(--fog-50); font-weight: 600; }
.legal .legal-callout {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  background: var(--ink-800);
}
.legal .legal-callout > :first-child { margin-top: 0; }

/* Print a clean report: drop the chrome, keep the data, force legible ink. */
@media print {
  .site-header, .site-footer, .actions, .cross-link, .toast, .skip, .mode-select {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .field, .cap, .summary, .privacy-card, .code-block, .faq, .tech, .snapshot-item {
    background: #fff;
    border-color: #bbb;
  }
  .field-label, .field-note, .cap-note, .section-head .blurb { color: #444; }
  .field-value, .cap-name, h1, h2, h3 { color: #000; }
  .faq[open] .faq-answer { color: #222; }
  .section { break-inside: avoid; }
}
