/*
  Safety Desk — the public record.
  Read by risk and compliance officers at payment partners, and printed by them.
  Light, exact, quiet. The only colour that appears is a decision state.
*/

:root {
  --paper: #edf0ef;
  --paper-raised: #f7f9f8;
  --ink: #14181b;
  --ink-soft: #56616a;
  --ink-faint: #7d8891;
  --rule: #ccd4d1;
  --rule-strong: #14181b;

  /* Borrowed from the desk's own verdicts, not invented for decoration. */
  --allow: #2f6f4f;
  --hold: #8a6014;
  --refuse: #8c2f2a;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  /* One width governs the masthead, the opening and every band, so every rule
     on the page starts and stops on the same two vertical lines. */
  --page: calc(74rem + 2 * var(--gutter));

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.018em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  max-width: var(--page);
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: -0.03em;
}
.wordmark svg { width: 1.35em; height: 1.35em; display: block; }
.wordmark b { font-weight: 500; }
.wordmark span { color: var(--ink-faint); font-weight: 400; }

.masthead nav {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.005em;
  display: flex;
  gap: 1.4rem;
  color: var(--ink-soft);
}

/* -------------------------------------------------------------------- line */

/*
  The page's spine. The claim this operation lives or dies on is a boundary,
  so the boundary is the layout: allowed on one side, never on the other,
  with a real rule between them that runs the height of the opening.
*/
.line {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  border-bottom: 1px solid var(--rule);
  max-width: var(--page);
  margin-inline: auto;
}
.line > .rule { background: var(--rule-strong); }
.line > section { padding: clamp(2.5rem, 6vw, 5rem) var(--gutter); }
/* Each half keeps its own measure so the rule between them reads as the divide
   it is, rather than as a gap between two stranded blocks. */
.line > section > * { max-width: 37rem; }

.line h1 {
  font-size: clamp(2rem, 1.1rem + 3.4vw, 3.6rem);
  line-height: 1.06;
  margin-bottom: 1.1rem;
}
.line .lede { font-size: 1.0625em; color: var(--ink-soft); }

.side-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin: 0 0 1.6rem;
}

/* The twelve, as a list you can count. */
.clauses-brief {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  columns: 2;
  column-gap: 2rem;
}
.clauses-brief li {
  break-inside: avoid;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}
.clauses-brief .code {
  color: var(--refuse);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  min-width: 1ch;
}

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

/*
  A document has a width. Left full-bleed, the prose columns strand in the
  middle of a 1600px screen with the measure capped at 34rem, and the settings
  table stretches until the description column is unreadable.
*/
.band { padding: clamp(3rem, 6vw, 5.5rem) var(--gutter); border-bottom: 1px solid var(--rule); max-width: var(--page); margin-inline: auto; }
.band > h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem);
  line-height: 1.14;
  margin-bottom: 0.7rem;
}
.band > .intro { color: var(--ink-soft); margin-bottom: 2.6rem; }

.band--raised { background: var(--paper-raised); box-shadow: 0 0 0 100vmax var(--paper-raised); clip-path: inset(0 -100vmax); }

/* The pipeline genuinely is a sequence, so it is numbered. */
.stages { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
@media (min-width: 62rem) { .stages { grid-template-columns: repeat(3, 1fr); } }

.stage { background: var(--paper-raised); padding: 1.6rem 1.5rem; }
.stage-n {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.9rem;
}
.stage h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.stage p { font-size: 0.9375rem; color: var(--ink-soft); max-width: none; }
.stage .verdict {
  font-family: var(--sans);
  font-size: 0.8125rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  color: var(--ink);
}

.state { font-weight: 500; }
.state--allow { color: var(--allow); }
.state--hold { color: var(--hold); }
.state--refuse { color: var(--refuse); }

/* ------------------------------------------------------------------ tables */

.sheet { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.9375rem; }
.sheet caption { text-align: left; color: var(--ink-soft); font-family: var(--serif); font-size: 1rem; margin-bottom: 1.2rem; max-width: var(--measure); }
.sheet th, .sheet td { text-align: left; padding: 0.72rem 1rem 0.72rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sheet thead th { font-weight: 500; color: var(--ink-faint); font-size: 0.78rem; border-bottom-color: var(--rule-strong); }
.sheet td:first-child { font-weight: 500; width: 34%; }
.sheet .setting-state { width: 12rem; }
.sheet td:last-child, .sheet th:last-child { padding-right: 0; }
.sheet .note { color: var(--ink-soft); }

.clause-book td:first-child { width: 2.5rem; color: var(--refuse); font-variant-numeric: tabular-nums; }
.clause-book td:nth-child(2) { width: 26%; font-weight: 500; }
.clause-book td:last-child { color: var(--ink-soft); }

/* ------------------------------------------------------------------ closing */

.two-up { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 56rem) { .two-up { grid-template-columns: 1fr 1fr; } }
.two-up p { max-width: 32rem; }

.aside-note {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule-strong);
  padding-left: 1.1rem;
}
.aside-note p { max-width: 30rem; }

.colophon {
  max-width: var(--page);
  margin-inline: auto;
  padding: 2.4rem var(--gutter) 3.4rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}

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

@media (max-width: 61.99rem) {
  .line { grid-template-columns: 1fr; }
  .line > .rule { height: 1px; background: var(--rule-strong); }
  .clauses-brief { columns: 1; }
  .sheet td:first-child { width: auto; }
  .sheet, .sheet thead, .sheet tbody, .sheet tr, .sheet td { display: block; }
  .sheet thead { display: none; }
  .sheet tr { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; }
  .sheet td { border: 0; padding: 0.1rem 0; }
  .sheet .setting-state { width: auto; }
  .clause-book td:nth-child(2) { width: auto; }
}

@media print {
  :root { --paper: #fff; --paper-raised: #fff; }
  .masthead nav { display: none; }
  .band, .line > section { padding: 1.2rem 0; break-inside: auto; }
  .stage, .sheet tr { break-inside: avoid; }
  a { text-decoration: none; }
}

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