@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f2f4f3;
  --surface: #ffffff;
  --surface-sunken: #f7f8f8;
  --ink: #16211f;
  --muted: #55635f;
  --line: #e1e6e4;
  --line-strong: #c3ccc9;
  --primary: #0f6e66;
  --primary-dark: #0a5049;
  --primary-soft: #e5f3f0;
  --ring: rgba(15, 110, 102, .22);

  --pine: #0e2b28;
  --pine-line: rgba(255, 255, 255, .12);
  --pine-hover: rgba(255, 255, 255, .07);
  --pine-active: rgba(255, 255, 255, .12);
  --pine-text: #c9d8d5;
  --pine-muted: #93aca7;
  --pine-accent: #7fe3d2;

  --ok-bg: #e4f4ec;
  --ok-line: #bfe3d1;
  --ok-ink: #0b5e43;
  --wait-bg: #fdf3d9;
  --wait-line: #f0dca3;
  --wait-ink: #6e4d00;
  --bad-bg: #fbe9e7;
  --bad-line: #f2c6c2;
  --bad-ink: #9c1f18;
  --idle-bg: #edf0ef;
  --idle-line: #d9dfdd;
  --idle-ink: #4a5653;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(14, 43, 40, .05), 0 2px 8px rgba(14, 43, 40, .04);
  --shadow-lift: 0 18px 50px rgba(0, 0, 0, .28);
  --control: 40px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.012em; }
h2 { font-size: 16px; line-height: 1.35; font-weight: 650; }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 232px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 18px 12px 16px;
  overflow-y: auto;
  background: var(--pine);
  color: var(--pine-text);
}
.sidebar :focus-visible { outline-color: var(--pine-accent); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 750; letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.sidebar .brand, .sidebar .brand:hover { color: #fff; }
.brand-mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius); background: var(--primary); color: #fff; }
.sidebar .brand-mark { background: var(--pine-accent); color: var(--pine); }

.nav { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--pine-text);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
}
.nav a svg { flex: none; opacity: .8; }
.nav a:hover { background: var(--pine-hover); color: #fff; }
.nav a[aria-current="page"] { background: var(--pine-active); color: #fff; font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--pine-accent); opacity: 1; }
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--pine-accent);
}
.nav-label { margin: 18px 10px 6px; color: var(--pine-muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.nav a.nav-end { margin-top: auto; }

.account { display: flex; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--pine-line); font-size: 14px; }
.account-avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--pine-active); color: var(--pine-text); }
.account-body { min-width: 0; }
.account strong { display: block; color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.account-role { color: var(--pine-muted); font-size: 13px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 6px; font-size: 13px; }
.account-actions a, .account-actions .link-button { color: var(--pine-text); }
.account-actions a:hover, .account-actions .link-button:hover { color: #fff; }

/* Mode: production and sandbox keep separate clients. Green means live, amber means test. */
:root {
  --live: #2fb67c;
  --test: #f0b43c;
}
.env-tag { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 750; letter-spacing: .08em; line-height: 16px; text-transform: uppercase; }
.env-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.env-production .env-dot { background: var(--live); box-shadow: 0 0 0 3px rgba(47, 182, 124, .22); }
.env-sandbox .env-dot { background: var(--test); box-shadow: 0 0 0 3px rgba(240, 180, 60, .25); }

.env-switch { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.env-switch-label { padding: 0 6px; color: var(--pine-muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.env-current { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid; border-radius: var(--radius); }
.env-current-top { display: flex; align-items: center; gap: 8px; }
.env-current strong { flex: 1 1 auto; color: #fff; font-size: 14px; font-weight: 700; }
.env-current-note { padding-left: 17px; font-size: 12.5px; }
.env-current.env-production { border-color: rgba(47, 182, 124, .45); background: rgba(47, 182, 124, .12); color: #9fe3c4; }
.env-current.env-production .env-tag { background: var(--live); color: #062b1b; }
.env-current.env-sandbox { border-color: rgba(240, 180, 60, .55); background: rgba(240, 180, 60, .14); color: #f6d58f; }
.env-current.env-sandbox .env-tag { background: var(--test); color: #3d2900; }
.env-switch-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--pine-line);
  border-radius: var(--radius);
  color: var(--pine-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
.env-switch-button:hover { background: var(--pine-hover); border-color: rgba(255, 255, 255, .28); color: #fff; }

/* The bar on top of every page, in both modes, so the mode is never in doubt. */
.mode-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 28px; border-bottom: 1px solid; font-size: 13px; }
.mode-bar strong { font-weight: 700; }
.mode-sandbox { border-color: var(--wait-line); background: var(--wait-bg); color: var(--wait-ink); }
.mode-sandbox .env-tag { background: var(--test); color: #3d2900; }
.mode-production { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.mode-production .env-tag { background: var(--live); color: #062b1b; }

/* The password dialog of the switch, and the page that does the same without JavaScript. */
.env-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
.env-dialog::backdrop { background: rgba(14, 43, 40, .55); }
.env-dialog form { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; }
.env-dialog-body, .env-page-body { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.env-dialog-body[hidden] { display: none; }
.env-dialog-body p, .env-page-body p { color: var(--muted); font-size: 14px; }
.env-dialog-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border: 1px solid; border-radius: 999px; font-size: 13px; font-weight: 700; }
.env-dialog-badge.env-production { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.env-dialog-badge.env-production .env-tag { background: var(--live); color: #062b1b; }
.env-dialog-badge.env-sandbox { border-color: var(--wait-line); background: var(--wait-bg); color: var(--wait-ink); }
.env-dialog-badge.env-sandbox .env-tag { background: var(--test); color: #3d2900; }
.env-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.env-confirm[hidden] { display: none; }
.env-confirm.env-to-production { border-color: #1f8a5c; background: #1f8a5c; color: #fff; }
.env-confirm.env-to-production:hover { border-color: #17704a; background: #17704a; color: #fff; }
.env-confirm.env-to-sandbox { border-color: #c98a12; background: var(--test); color: #3d2900; }
.env-confirm.env-to-sandbox:hover { border-color: #b07508; background: #e8a521; color: #3d2900; }

.link-button { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-button:hover { color: var(--primary-dark); }

.main { flex: 1 1 auto; min-width: 0; }
.content { display: flex; flex-direction: column; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 28px 32px 56px; }
.narrow { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 860px; margin: 0 auto; }
.narrow-sm { max-width: 520px; margin: 0; }
.narrow-sm p { color: var(--muted); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.page-head p { margin-top: 2px; color: var(--muted); }
.breadcrumb { margin-bottom: 4px; font-size: 14px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb a::before { content: "\2190\00a0"; }

/* Components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-body { display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; }
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface-sunken);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-sunken); border-color: var(--muted); color: var(--ink); }
.btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn-primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); color: #fff; }
.btn-danger { border-color: var(--bad-line); color: var(--bad-ink); }
.btn-danger:hover { border-color: var(--bad-ink); background: var(--bad-bg); color: var(--bad-ink); }
.btn:disabled { opacity: .6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.badge::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-ok { background: var(--ok-bg); color: var(--ok-ink); }
.tone-wait { background: var(--wait-bg); color: var(--wait-ink); }
.tone-bad { background: var(--bad-bg); color: var(--bad-ink); }
.tone-idle { background: var(--idle-bg); color: var(--idle-ink); }

.notice { padding: 11px 14px; border: 1px solid transparent; border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.notice-error { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-ink); }
.notice-info { border-color: #c5e3dd; background: var(--primary-soft); color: var(--primary-dark); }
.notice-warn { border-color: var(--wait-line); background: var(--wait-bg); color: var(--wait-ink); }

a.strong { color: var(--ink); font-weight: 600; text-decoration: none; }
a.strong:hover { color: var(--primary); text-decoration: underline; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--muted); }

/* Wizard */
.wizard { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.wizard-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 550; white-space: nowrap; }
.wizard-step:not(:first-child)::before { content: ""; width: 40px; height: 2px; margin-right: 4px; border-radius: 2px; background: var(--line-strong); }
.wizard-dot { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); font-size: 12px; font-weight: 700; }
.wizard-step.is-current { color: var(--ink); font-weight: 650; }
.wizard-step.is-current .wizard-dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.wizard-step.is-done .wizard-dot { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.wizard-step.is-current:not(:first-child)::before { background: var(--primary); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-weight: 600; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.4; }
/* Hints sit under the control, so controls in a row stay level whether or not they have one. */
.field > .hint { order: 1; }
.hint.is-invalid { color: var(--bad-ink); font-weight: 500; }

input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%;
  min-height: var(--control);
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  transition: border-color .12s, box-shadow .12s;
}
input.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2355635f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 11px center;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
  cursor: pointer;
}
input::placeholder, textarea::placeholder { color: #7b8783; }
input:hover:not([readonly]), select:hover, textarea:hover { border-color: var(--muted); }
input[type="text"]:focus-visible, input[type="password"]:focus-visible, input[type="search"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
input[readonly] { background: var(--surface-sunken); color: var(--muted); }
input[type="file"] { width: 100%; font: inherit; font-size: 13px; font-weight: 400; color: var(--muted); cursor: pointer; }
input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--muted); }

/* Date of birth: a typed field, with a calendar button that opens the browser's date picker. */
.date-control { position: relative; display: block; }
.date-control input[data-date-input] { padding-right: 44px; }
.date-button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.date-button:hover { background: var(--primary-soft); color: var(--primary-dark); }
.date-native {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 32px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.span-all { grid-column: 1 / -1; }

/* A form split into titled sections: the title on the left, its fields on the right. */
.form-section { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 16px 24px; padding: 22px 24px; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; }
.form-section-head h2 { font-size: 15px; }
.form-section-head p { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 14px; cursor: pointer; transition: border-color .12s, background-color .12s; }
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.choice:has(input:disabled) { border-color: var(--line); cursor: not-allowed; }
.choice:has(input:disabled):has(input:checked) { border-color: var(--line-strong); background: var(--surface-sunken); box-shadow: none; }
.choice:has(input[type="checkbox"]:checked) { box-shadow: none; }
.choice input { flex: none; align-self: flex-start; margin: 3px 0 0; accent-color: var(--primary); }
.choice strong { display: block; font-weight: 650; }
.choice span span { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { margin-bottom: 8px; padding: 0; font-weight: 600; font-size: 14px; }

/* Document upload: the whole box takes a click or a dropped file. */
.file-box { gap: 8px; }
.file-label { font-weight: 600; font-size: 14px; }
.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  transition: border-color .12s, background-color .12s, box-shadow .12s;
}
/* The input itself covers the box, so a click or a drop reaches it even without JavaScript. */
.file-drop input[type="file"] { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 400; text-align: center; }
.file-empty svg { color: var(--primary); }
.file-empty strong { color: var(--ink); font-weight: 600; }
.file-link { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.file-chosen { display: flex; align-items: center; gap: 14px; width: 100%; font-weight: 400; }
.file-chosen[hidden], .file-empty[hidden] { display: none; }
.file-thumb { flex: none; display: grid; place-items: center; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--bad-ink); font-size: 12px; font-weight: 750; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-meta { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; color: var(--muted); font-size: 13px; }
.file-meta strong { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.file-drop:hover, .file-box.is-dragover .file-drop { border-color: var(--primary); background: var(--primary-soft); }
.file-box.is-dragover .file-drop { border: 2px solid var(--primary); background: #d6eee9; box-shadow: 0 0 0 4px var(--ring); }
.file-box.is-dragover .file-empty svg { transform: translateY(-3px); }
.file-empty svg { transition: transform .12s; }
.file-drop:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.file-drop:has(input:valid) { border-style: solid; border-color: var(--ok-line); background: var(--ok-bg); }
.file-box.is-invalid .file-drop { border-style: solid; border-color: var(--bad-line); background: var(--bad-bg); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-sunken); color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .03em; text-align: left; white-space: nowrap; }
thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-sunken); }
td .sub { display: block; color: var(--muted); font-size: 13px; }
td code { color: var(--muted); font-size: 12px; }
.filters { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr)); gap: 12px; align-items: end; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.pager { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.empty { padding: 48px 20px; color: var(--muted); text-align: center; }

/* Check result */
.result-card { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 24px; padding: 20px 24px; border: 1px solid transparent; border-radius: var(--radius-lg); }
.result-card h1 { font-size: 22px; }
.result-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.result-ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.result-wait { border-color: var(--wait-line); background: var(--wait-bg); color: var(--wait-ink); }
.result-bad { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-ink); }
.result-idle { border-color: var(--idle-line); background: var(--idle-bg); color: var(--idle-ink); }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.step { display: flex; align-items: flex-start; gap: 10px; padding: 16px; border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step-icon { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.step strong { display: block; font-size: 14px; font-weight: 650; }
.step span { color: var(--muted); font-size: 13px; }
.state-done .step-icon { background: var(--ok-ink); color: #fff; }
.state-active .step-icon { background: var(--wait-bg); color: var(--wait-ink); }
.state-failed .step-icon { background: var(--bad-ink); color: #fff; }
.state-idle .step-icon, .state-skipped .step-icon { background: var(--idle-bg); color: var(--idle-ink); }

.two-col { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.col-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.facts { display: flex; flex-direction: column; margin: 0; font-size: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 550; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.reject-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 4px 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.reject-row code { color: var(--bad-ink); font-weight: 600; }
.doc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.doc-row:first-child { border-top: 0; padding-top: 0; }
.doc-row:last-child { padding-bottom: 0; }
.doc-name { flex: 1 1 200px; min-width: 0; }
.doc-name strong { display: block; font-weight: 600; }
.doc-name span { font-size: 13px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.link-row .field { flex: 1 1 320px; }
.activity { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.activity time, .activity .when { flex: 0 0 150px; color: var(--muted); font-size: 13px; }
.activity span:last-child { flex: 1 1 240px; }
.matrix th:not(:first-child), .matrix td:not(:first-child) { text-align: center; }
.matrix input { width: 18px; height: 18px; accent-color: var(--primary); }
.qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: var(--radius); }

/* Help */
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.help-body { order: -1; display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 860px; }
.help-section { scroll-margin-top: 16px; }
.help-toc { position: sticky; top: 28px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.help-toc-title { margin-bottom: 6px; padding: 0 10px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .03em; }
.help-toc a { padding: 5px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.help-toc a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.help-steps { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: help-step; }
.help-steps > li { position: relative; display: flex; flex-direction: column; gap: 6px; padding-left: 38px; counter-increment: help-step; }
.help-steps > li::before {
  content: counter(help-step);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}
.help-steps h3 { font-size: 15px; line-height: 1.4; font-weight: 650; }
.help-terms { display: flex; flex-direction: column; margin: 0; }
.help-terms > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.help-terms > div:first-child { border-top: 0; padding-top: 0; }
.help-terms dt { font-weight: 600; }
.help-terms dd { margin: 0; }
.help-table { min-width: 620px; }
.help-table th:first-child, .help-table td:first-child { width: 28%; }
.help-table td { vertical-align: top; }
.help-table .badge { white-space: normal; margin-bottom: 4px; }
.help-table tbody tr:hover td { background: none; }
.help-table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.help-section > .table-wrap:last-child tbody tr:last-child td { border-bottom: 0; }
.help-after-table { padding-top: 14px; padding-bottom: 16px; font-size: 14px; }

/* Sumsub log */
.log-table td { vertical-align: top; }
.log-table td:nth-child(1), .log-table td:nth-child(2), .log-table td:nth-child(5) { white-space: nowrap; }
.log-table td:nth-child(3) { min-width: 300px; }
.log-table td code { overflow-wrap: anywhere; }
.log-table td:last-child { min-width: 220px; overflow-wrap: anywhere; }

/* Sign-in */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--pine); }
.auth-card { width: 100%; max-width: 420px; border: 0; box-shadow: var(--shadow-lift); }
.auth-card .brand { padding: 0; }
.auth-card .card-body { gap: 18px; padding: 32px; }
.auth-card h1 { font-size: 22px; }
.auth-head { display: flex; flex-direction: column; gap: 4px; }
.auth-foot { font-size: 14px; text-align: center; }
.auth-card .btn-primary { width: 100%; }
.auth-card .qr { align-self: center; }
input.code-input {
  min-height: 52px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 24px;
  letter-spacing: .4em;
  text-align: center;
}

@media (max-width: 1100px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-body { order: 0; }
  .help-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .help-toc-title { display: none; }
  .help-toc a { background: var(--surface); border: 1px solid var(--line); }
}

@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .nav a.nav-end { margin-top: 0; }
  .help-terms > div { grid-template-columns: 1fr; }
  /* Each row stacks, so "What to do" is never hidden behind a sideways scroll. */
  .help-table { display: block; min-width: 0; }
  .help-table thead { display: none; }
  .help-table tbody, .help-table tr { display: block; }
  .help-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .help-table td, .help-table tbody tr:last-child td { display: block; width: auto; padding: 0 0 6px; border-bottom: 0; }
  .help-table th:first-child, .help-table td:first-child { width: auto; }
  .help-table td:last-child { padding-bottom: 0; font-weight: 600; }
  .help-section > .table-wrap:last-child tbody tr:last-child { border-bottom: 0; }
  .sidebar { position: static; flex: 0 0 auto; gap: 12px; height: auto; overflow: visible; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label { display: none; }
  .nav a[aria-current="page"]::before { display: none; }
  .content { padding: 20px 16px 40px; }
  .filters { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(2) { border-right: 0; }
  .reject-row { grid-template-columns: 1fr; }
  .form-section { grid-template-columns: 1fr; padding: 18px 16px; }
  .card-body { padding: 18px 16px; }
  .card-foot { padding: 12px 16px; }
  .wizard-step:not(:first-child)::before { width: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
