/* Distal.ai: the one stylesheet for distal.ai, pathways.distal.ai and validate.distal.ai.
   Source of truth: company/brand/distal.css. Each site's build copies it to /assets/distal.css;
   a Distal Validate report, which must stand alone, carries it inline.
   Colours are checked for contrast by company/brand/check.py. Change a token there and here together. */

:root {
  color-scheme: light dark;
  --bg: #faf9f6;          /* page */
  --surface: #ffffff;     /* cards, tables, code */
  --ink: #1c1b19;         /* text */
  --muted: #5a5852;       /* secondary text */
  --line: #dcd8cf;        /* decorative rules */
  --edge: #857f73;        /* borders that carry meaning: inputs, buttons */
  --accent: #1f4e79;      /* links, primary buttons, labels */
  --accent-ink: #ffffff;  /* text on --accent */
  --good: #1a6b43;
  --flag: #8f4a08;
  --bad: #9b1c1c;
  --up: #b3261e;          /* a reaction scored as activated */
  --down: #1f5fa8;        /* a reaction scored as suppressed */
  --focus: #b45309;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 70ch;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a; --surface: #1c2024; --ink: #e9e6e0; --muted: #a8acb2; --line: #353a40; --edge: #7d848c;
    --accent: #9cc3ee; --accent-ink: #10202f; --good: #6fcf9d; --flag: #e3a765; --bad: #f09a9a;
    --up: #ff9a8f; --down: #8fc0ff; --focus: #f6b354;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.6 var(--sans); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Text */
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 2.75rem); margin-bottom: 0.8rem; }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.7rem); margin-bottom: 0.7rem; }
h3 { font-size: 1.15rem; font-weight: 650; margin-bottom: 0.4rem; }
h4 { font-size: 1rem; font-weight: 650; margin-bottom: 0.3rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
p, li, dd { max-width: var(--measure); }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.3rem; }
a { color: var(--accent); text-underline-offset: 0.15em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.14em; }
strong, b { font-weight: 650; }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
code { overflow-wrap: anywhere; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; overflow-x: auto; margin: 0 0 1rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[id] { scroll-margin-top: 1rem; }

.eyebrow { font: 650 0.8rem/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.4rem; }
.lede { font-size: 1.2rem; line-height: 1.5; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small, .meta { font-size: 0.875rem; line-height: 1.5; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The hidden attribute wins over any component's display value. */
[hidden] { display: none !important; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Page frame */
.wrap { max-width: 65rem; margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: 0.5rem; top: -4rem; z-index: 10; background: var(--accent); color: var(--accent-ink); padding: 0.6rem 0.9rem; border-radius: var(--radius); font-weight: 650; }
.skip:focus { top: 0.5rem; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; font: 700 1.15rem/1.2 var(--serif); }
.brand a { color: var(--ink); text-decoration: none; padding: 0.45rem 0; }
.brand a:hover { text-decoration: underline; }
.brand .sep { color: var(--edge); font-weight: 400; }
.brand .product { color: var(--accent); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.1rem; list-style: none; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a { display: inline-block; padding: 0.55rem 0; font-size: 0.95rem; text-decoration: none; color: var(--ink); }
.site-nav a:hover { text-decoration: underline; }
.site-nav a[aria-current] { font-weight: 650; box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav .family.first { border-left: 1px solid var(--line); padding-left: 1.1rem; }
.site-nav .family a { color: var(--accent); }
main { display: block; padding-bottom: 3.5rem; }
.hero { padding: 3.2rem 0 2rem; }
.section { padding: 2.6rem 0 0.4rem; border-top: 1px solid var(--line); margin-top: 2.2rem; }
.section > h2 { max-width: 36ch; }
/* A report: long, plain section headings. */
.report .section > h2 { max-width: 44ch; }
.report .section { margin-top: 1.6rem; padding-top: 2rem; }
.breadcrumb { font-size: 0.875rem; color: var(--muted); padding-top: 1.4rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0 0.5rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; color: var(--edge); }
.breadcrumb + .wrap > .hero:first-child { padding-top: 1.2rem; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 1.8rem 0 2.6rem; font-size: 0.875rem; line-height: 1.6; color: var(--muted); }
.site-footer p { max-width: none; margin-bottom: 0.6rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0; }
.site-footer a { display: inline-block; padding: 0.3rem 0; }
.banner { background: var(--flag); color: var(--bg); font-weight: 650; font-size: 0.9rem; padding: 0.5rem 1.25rem; text-align: center; }

/* Buttons */
.btn { display: inline-block; font: 650 1rem/1.2 var(--sans); padding: 0.8rem 1.15rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; margin: 1.3rem 0 0; }

/* Blocks */
.grid { display: grid; gap: 1rem; margin: 1.2rem 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.3rem; display: flex; flex-direction: column; }
.card > :last-child { margin-bottom: 0; }
.card .btn, .card .more { margin-top: auto; align-self: flex-start; }
.card.good { border-top: 4px solid var(--good); } .card.mixed { border-top: 4px solid var(--flag); } .card.bad { border-top: 4px solid var(--bad); }
.card.featured { border-color: var(--accent); }
.stat { font: 700 1.9rem/1.15 var(--serif); color: var(--accent); margin: 0 0 0.2rem; }
.price { font: 700 1.9rem/1.15 var(--serif); margin: 0.2rem 0 0.6rem; }
.price small { font: 400 0.95rem var(--sans); color: var(--muted); }
.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 0.85rem 1.1rem; margin: 1.4rem 0; max-width: 78ch; font-size: 0.98rem; }
.note.flag { border-left-color: var(--flag); }
.verdict { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--good); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.verdict.mixed { border-left-color: var(--flag); } .verdict.bad { border-left-color: var(--bad); }
.verdict .big { display: block; font: 700 1.3rem/1.3 var(--serif); margin-bottom: 0.4rem; }
.tag { display: inline-block; font-size: 0.8rem; line-height: 1.3; padding: 0.15rem 0.5rem; border-radius: 4px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.tag.good { background: var(--good); border-color: var(--good); color: var(--bg); font-weight: 650; }
.tag.flag { background: var(--flag); border-color: var(--flag); color: var(--bg); font-weight: 650; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.tags li { margin: 0; }
.tags a { display: inline-block; padding: 0.4rem 0.7rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); text-decoration: none; font-size: 0.92rem; }
.tags a:hover { border-color: var(--accent); text-decoration: underline; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; max-width: none; margin: 0; }
.steps li::before { content: counter(step); display: block; font: 700 1.4rem/1 var(--serif); color: var(--accent); margin-bottom: 0.5rem; }
.audit { list-style: none; padding: 0; }
.audit li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.95rem; margin: 0.5rem 0; max-width: none; }
details { border-bottom: 1px solid var(--line); padding: 0.2rem 0; max-width: 78ch; }
summary { cursor: pointer; font-weight: 650; padding: 0.75rem 0; }
details p { margin: 0 0 0.9rem; }
figure { margin: 1.2rem 0; }
figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.4rem; }
img, svg { max-width: 100%; height: auto; }
.plot { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem; overflow-x: auto; }
.plot img { display: block; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
/* A wide table scrolls sideways inside its box on a narrow screen instead of squeezing its columns. */
.table-wrap table { min-width: 34rem; }
caption { text-align: left; font-weight: 650; padding: 0.7rem 0.8rem; caption-side: top; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--edge); white-space: nowrap; }
tbody th { font-weight: 400; }
tbody th a { font-weight: 650; }
td.good, .good-text { color: var(--good); font-weight: 650; } td.mixed { color: var(--flag); font-weight: 650; } td.bad { color: var(--bad); font-weight: 650; }
.up { color: var(--up); font-weight: 650; } .down { color: var(--down); font-weight: 650; }

/* Forms */
label { font-weight: 650; display: block; margin-bottom: 0.35rem; }
input[type="file"], input[type="text"], select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 0.55rem 0.7rem; max-width: 100%; }
.dropzone { border: 2px dashed var(--edge); border-radius: var(--radius); padding: 1.2rem; background: var(--bg); margin: 1rem 0; }
.status { min-height: 1.6em; font-size: 0.95rem; color: var(--muted); }
.status[role="alert"] { color: var(--bad); font-weight: 650; min-height: 0; }
.status:empty { margin: 0; min-height: 0; }

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .hero { padding-top: 2rem; }
  .site-nav .family.first { border-left: 0; padding-left: 0; }
}
@media print {
  .site-header, .site-footer, .skip, .banner, .actions { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; }
  .card, .note, .verdict, .table-wrap, pre { break-inside: avoid; }
}
