:root {
  --text-min: 14px;
  --text-base: 16px;
  --bg: #ffffff;
  --bg2: #f6f5f1;
  --card: #ffffff;
  --ink: #252620;
  --muted: #5f6258;
  --line: #dedfd5;
  --accent: #343d2d;
  --accent-h: #1d2818;
  --accent-soft: #eef1e8;
  --accent2: #2f6841;
  --warn: #86500a;
  --danger: #a12828;
  --ok: #2f6841;
  --focus: #8c442f;
  --r: 12px;
}

* { box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--bg2);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.55;
  letter-spacing: 0;
}
img, svg { max-width: 100%; }
a { color: #294f36; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-h); }
p { overflow-wrap: break-word; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; }
h1 { margin: 0 0 16px; font-size: 34px; font-weight: 600; letter-spacing: -0.025em; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 17px; }
strong, b { font-weight: 650; }
small { font-size: var(--text-min); }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 32px; }
header {
  position: relative;
  z-index: 10;
  margin: 16px 20px 0;
  border-radius: 18px;
  background: #20231e;
  color: #ffffff;
}
header > .wrap { padding: 0 22px; }
nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  min-height: 76px;
  padding: 12px 0;
}
nav .brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  margin-right: 8px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}
nav .brand:hover { color: #ffffff; }
nav .brand .brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding-right: 3px;
  border: 1px solid #f5b299;
  border-radius: 50%;
  color: #f5b299;
  font-size: 27px;
  letter-spacing: -2px;
}
nav .brand .brand-name { color: #ffffff; }
.brand-name small {
  display: block;
  margin-top: 4px;
  color: #d7dacd;
  font-size: var(--text-min);
  font-weight: 400;
  letter-spacing: 0.04em;
}
nav a.nav {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 44px;
  padding: 7px 0;
  border: 0;
  color: #e0e2d8;
  font-size: var(--text-min);
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}
nav a.nav:hover { color: #ffc2aa; text-decoration: none; }
nav a.nav.active {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: #f7b197;
  text-underline-offset: 7px;
}
nav .spacer { flex: 1 1 auto; }
nav .who {
  max-width: 270px;
  color: #e0e2d8;
  font-size: var(--text-min);
  overflow-wrap: anywhere;
}
nav .who + .badge { background: #ffffff1f; color: #ffffff; }
nav .badge.demo { background: #ffffff1f; color: #ffd0bd; }
nav .badge.n { background: #b94938; color: #ffffff; }
nav form.inline { margin: 0; }
nav form.inline button { margin: 0; }
nav .secondary { border-color: #ffffff55; background: #ffffff0d; color: #ffffff; }
nav .secondary:hover { border-color: #ffffff88; background: #ffffff20; color: #ffffff; }

main { min-height: calc(100vh - 220px); padding: 38px 0 64px; }
footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-min);
}
.skip-link {
  position: fixed;
  top: -120px;
  left: 20px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: var(--text-base);
  box-shadow: 0 4px 20px #00000025;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 1px; }
.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;
}
.clipboard-helper { position: fixed; left: -10000px; top: 0; }

.page-head, .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 24px;
}
.page-head > *, .head > * { min-width: 0; }
.page-head h1, .head h1 { margin-bottom: 8px; }
.page-head p, .head p { margin: 6px 0 0; }
.page-eyebrow {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: var(--text-min);
  font-weight: 650;
  letter-spacing: 0.08em;
}
.page-description { max-width: 75ch; color: var(--muted); font-size: var(--text-base); }
.head .num, .num { font-size: 29px; font-weight: 650; letter-spacing: -0.02em; }
.actions, .form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.form-actions { margin: 8px 0 24px; }
.form-actions > p { flex: 1 1 280px; margin: 0; }
.spaced { margin-top: 18px; }

.card {
  min-width: 0;
  margin: 0 0 20px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 0 1px 2px #00000008;
}
.card h2, .card h3 { margin: 0 0 14px; font-weight: 600; letter-spacing: -0.01em; }
.card > :last-child { margin-bottom: 0; }
.narrow { max-width: 1080px; margin: 0 auto; }
.auth-card { max-width: 720px; margin: 0 auto 20px; }
.deal-summary { border-top: 4px solid var(--accent); }
.deal-summary .page-head { align-items: center; margin-bottom: 20px; }
.deal-summary .page-head p { max-width: 85ch; }
.section-intro { margin: 0 0 18px; color: var(--muted); font-size: var(--text-base); }
.box {
  margin: 14px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f8f4;
}
.box.action { border-color: #cdd7c1; background: #f0f3ea; }
.box.action.card { padding: 26px; }
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.confirm-card { border-left: 4px solid var(--accent); }
.review-form { margin-top: 16px; }
.empty-state { padding: 32px 18px; color: var(--muted); text-align: center; }
.empty-state strong { display: inline-block; margin-bottom: 6px; font-size: 17px; }

.grid, .grid3 { display: grid; gap: 20px; align-items: start; }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > *, .grid3 > * { min-width: 0; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.summary-grid > div { min-width: 0; }
.overview {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  margin-bottom: 26px;
  padding: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #eeeee6;
}
.overview > div { min-width: 0; padding: 0 26px; border-right: 1px solid #d1d4c7; }
.overview > div:last-child { border-right: 0; }
.overview > div > span {
  display: block;
  margin-bottom: 10px;
  color: #555c4b;
  font-size: var(--text-min);
}
.overview strong { font-size: 29px; font-weight: 550; font-variant-numeric: tabular-nums; }
.overview small { color: #555c4b; font-size: var(--text-min); font-weight: 400; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.overdue { color: var(--danger); }

.tabs {
  display: flex;
  gap: 4px;
  margin: 20px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.tabs a {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 11px 16px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: var(--text-min);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { border-color: var(--accent); color: var(--accent); }
.documents-card { width: 100%; }
.documents-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.documents-head h2 { margin-bottom: 8px; }
.documents-head .section-intro { max-width: 86ch; margin: 0; }
.documents-add { flex: 0 0 auto; margin-top: 2px; white-space: nowrap; }
.documents-card .table-scroll { overflow-x: auto; }
.documents-table { min-width: 1080px; }
.documents-table .hash-cell { max-width: 240px; }
.documents-readonly-note { margin: 18px 0 0; padding: 12px 14px; border-radius: 8px; background: #f6f5f1; }
.document-upload-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90vh, 900px);
  margin: auto;
  padding: 24px 28px 26px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 80px #14171040;
}
.document-upload-dialog::backdrop { background: #20231ecc; backdrop-filter: blur(2px); }
.document-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.document-dialog-head .page-eyebrow { margin-bottom: 5px; }
.document-dialog-head h2 { margin: 0; }
.document-dialog-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; margin: 0; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font-size: 28px; line-height: 1; }
.document-dialog-close:hover { background: var(--bg2); color: var(--ink); }
.document-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.document-dialog-actions button { margin: 0; }

.kv {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
  gap: 10px 18px;
  font-size: var(--text-base);
}
.kv > div { min-width: 0; overflow-wrap: anywhere; }
.kv > div:nth-child(odd) { color: var(--muted); font-size: var(--text-min); }
.deal-facts { margin-bottom: 18px; }
.data-snapshot {
  max-width: 100%;
  max-height: 420px;
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f4;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: var(--text-min);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 16px;
}
.table-toolbar h2 { margin: 0; }
.deals-card { padding: 0; overflow: hidden; }
.deals-card .table-toolbar { margin: 0; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.deals-card .table-scroll th:first-child, .deals-card .table-scroll td:first-child { padding-left: 24px; }
.filter-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.filter-form .field { min-width: 230px; margin: 0; }
.filter-form button, .filter-form .btn { margin-top: 0; }
.registry-toolbar { align-items: flex-start; }
.registry-filters { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(200px, 1fr) minmax(250px, 1.25fr) auto; align-items: start; gap: 14px; width: 100%; }
.registry-filters .field { min-width: 0; }
.registry-filters .field .hint { display: block; margin-top: 5px; }
.registry-filters > .filter-check, .registry-filters > .filter-actions { margin-top: 30px; }
.queue-filters { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(220px, 1.2fr) minmax(190px, auto) auto; gap: 14px; width: 100%; }
.queue-filters .field { min-width: 0; }
.queue-filters .field .hint { display: block; margin-top: 5px; }
.queue-filter-checks { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.queue-filter-checks .filter-check { min-height: 32px; }
.task-kind { display: inline-block; margin-bottom: 6px; color: var(--muted); font-size: var(--text-min); font-weight: 600; }
.task-overdue td:first-child { border-left: 3px solid var(--danger); }
.deals-card .table-scroll table { min-width: 1040px; }
.filter-check { min-height: 48px; margin: 0; align-items: center; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 48px; }
.registry-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding: 18px 24px; }
.registry-footer .hint { margin: 0; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.page-link.current { border-color: var(--accent); background: var(--accent); color: #fff; }
.pagination-gap { min-width: 20px; text-align: center; }
.next-action { font-weight: 600; }
.next-action.mine { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.money-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.table-scroll table { min-width: 760px; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-min); }
th, td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
th {
  background: #f8f8f4;
  color: #505448;
  font-size: var(--text-min);
  font-weight: 650;
  line-height: 1.4;
}
td { font-size: var(--text-min); }
td.small { font-size: var(--text-min); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbf7; }
td a { font-weight: 600; }
.hash-cell, .params-cell { min-width: 210px; max-width: 420px; overflow-wrap: anywhere; word-break: break-word; }
.hash-cell .mono, .params-cell .mono { white-space: normal; }

.badge, .state {
  display: inline-block;
  max-width: 100%;
  border-radius: 999px;
  font-size: var(--text-min);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.badge { padding: 3px 9px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge.demo { background: #fff0d9; color: var(--warn); }
.badge.n { padding: 2px 7px; background: var(--danger); color: #ffffff; }
.state { padding: 5px 11px; background: #eeefe9; color: #4e5347; font-weight: 600; }
.state.money { background: #e2f0e3; color: #2d6139; }
.state.alert { background: #f9e6df; color: #913e2f; }
.state.wait { background: #fff0d9; color: var(--warn); }
.state.done { background: #e9ebe5; color: #555b4e; }
.msg { margin: 0 0 16px; padding: 13px 16px; border-radius: 10px; font-size: var(--text-base); font-weight: 500; }
.msg.ok { background: #e2f0e3; color: #285a35; }
.msg.err { background: #fbe8e5; color: #8d2727; }
.muted { color: var(--muted); }
.small { font-size: var(--text-min); }
.mono {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: var(--text-min);
  overflow-wrap: anywhere;
}
.hint { margin: 6px 0 0; color: var(--muted); font-size: var(--text-min); line-height: 1.5; }
.field-error { margin: 6px 0 0; color: var(--danger); font-size: var(--text-min); font-weight: 600; }

form { min-width: 0; }
form.inline { display: inline-block; max-width: 100%; margin: 0 8px 8px 0; vertical-align: top; }
form.inline button { margin-top: 0; }
.action .decline-form { margin-top: 12px; }
.action .decline-form button { margin-top: 0; }
.stacked-form > * { max-width: 100%; }
fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}
fieldset.card { padding: 26px; }
legend {
  max-width: 100%;
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.form-section { scroll-margin-top: 24px; }
.form-subsection { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-row > * { min-width: 0; }
.field { min-width: 0; margin: 0 0 18px; }
label {
  display: block;
  margin: 0 0 7px;
  color: #45483f;
  font-size: var(--text-min);
  font-weight: 650;
  line-height: 1.45;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="tel"], input[type="url"], input[type="search"],
select, textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #c9ccbe;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.4;
}
textarea { min-height: 112px; resize: vertical; }
select { max-width: 100%; }
input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px dashed #b8bdac;
  border-radius: 8px;
  background: #fafbf7;
  color: var(--ink);
  font-size: var(--text-min);
  line-height: 1.5;
}
input[type="file"]::file-selector-button {
  min-height: 40px;
  margin-right: 12px;
  padding: 7px 13px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent);
  font: inherit;
  font-size: var(--text-min);
  cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #7c8c6730;
}
input::placeholder, textarea::placeholder { color: #6e7167; letter-spacing: 0; opacity: 1; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"],
.invalid input, .invalid textarea, .invalid select { border-color: var(--danger); }
.invalid > label, .consent-field.invalid { color: var(--danger); }
input[type="checkbox"], input[type="radio"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  font-size: var(--text-min);
}
.checkbox-label, .checks label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 400;
}
.checkbox-label span, .checks label span { min-width: 0; }
.consent-field { margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; }
.consent-field.invalid { border-color: var(--danger); }
.checks { margin: 12px 0 18px; }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  margin: 8px 8px 0 0;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: var(--text-min);
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
}
button:hover, .btn:hover { border-color: var(--accent-h); background: var(--accent-h); color: #ffffff; text-decoration: none; }
button:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary, .btn.secondary { background: #ffffff; color: var(--accent); }
button.secondary:hover, .btn.secondary:hover { background: var(--accent-soft); color: var(--accent-h); }
button.danger, .btn.danger { border-color: var(--danger); background: #ffffff; color: var(--danger); }
button.danger:hover, .btn.danger:hover { background: #fbe8e5; color: #7f1f1f; }
button.ok, .btn.ok { border-color: var(--accent2); background: var(--accent2); }
button.ok:hover, .btn.ok:hover { border-color: #214c2f; background: #214c2f; }
button.small, .btn.small { min-height: 40px; padding: 7px 13px; font-size: var(--text-min); }
.secondary-action { margin-left: 8px; }

ul.clean { margin: 0; padding: 0; list-style: none; }
ul.clean li { padding: 11px 0; border-bottom: 1px solid var(--line); }
ul.clean li:last-child { border-bottom: 0; }
.list-row { padding: 15px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row > :last-child { margin-bottom: 0; }
details { max-width: 100%; }
details summary { color: #294f36; font-weight: 650; cursor: pointer; }
details summary::marker { color: var(--accent); }
details[open] > summary { margin-bottom: 10px; }
.timeline { font-size: var(--text-min); }
.timeline .row {
  display: grid;
  grid-template-columns: 135px 160px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.notification-history { padding: 24px 28px; }
.notification-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.notification-history-head h2 { margin: 0 0 8px; }
.notification-history-head .section-intro { max-width: 82ch; margin: 0; }
.notification-count { flex: 0 0 auto; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: var(--text-min); }
.notification-events { display: grid; gap: 14px; margin-top: 18px; }
.notification-event { padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.notification-event-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; color: var(--muted); font-size: var(--text-min); }
.notification-event-meta time { color: var(--ink); font-weight: 650; }
.notification-event-body { display: grid; grid-template-columns: 126px minmax(0, 1fr); gap: 12px; margin-top: 15px; }
.notification-event-label { padding-top: 2px; color: var(--muted); font-size: var(--text-min); font-weight: 600; }
.notification-event-body p { max-width: 82ch; margin: 0; overflow-wrap: anywhere; }
.delivery-heading { margin: 18px 0 0; padding: 0 0 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-min); font-weight: 650; }
.delivery-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.delivery-item { display: grid; grid-template-columns: 126px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid #ecece5; }
.delivery-item:last-child { border-bottom: 0; padding-bottom: 0; }
.delivery-channel { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.delivery-channel-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: var(--text-min); font-weight: 700; }
.delivery-result { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; min-height: 30px; }
.delivery-status { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; font-size: var(--text-min); font-weight: 650; }
.delivery-status.sent { background: #e8f1e8; color: #315c36; }
.delivery-status.not-sent { background: #f7efe0; color: #765218; }
.delivery-detail { color: var(--muted); font-size: var(--text-min); }
.notification-empty { margin: 18px 0 0; color: var(--muted); }
.notification-row {
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 18px 12px;
  border-bottom: 1px solid var(--line);
}
.notification-row:last-child { border-bottom: 0; }
.notification-row.unread { border-left: 4px solid var(--accent); background: #f0f3ea; }
.notification-meta { color: var(--muted); font-size: var(--text-min); }
.notification-row form { margin: 0; }
.notification-row button { margin-top: 0; }
.legal-text { max-width: 82ch; }
.legal-text h2 { margin-top: 30px; }
.legal-text h3 { margin-top: 24px; }

.demo-code {
  display: inline-block;
  min-height: 48px;
  margin: 0 0 8px;
  padding: 9px 18px;
  border: 1px dashed #c58c3d;
  border-radius: 10px;
  background: #fff0d9;
  color: #704006;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 28px;
  letter-spacing: 6px;
  cursor: pointer;
}
.demo-code:hover { border-color: var(--warn); background: #ffe6bf; color: #704006; }
.demo-challenge { margin: 14px 0; }
.demo-list { overflow: hidden; }
.demo-title { margin-bottom: 10px; }
.demo-list .demo-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.demo-list .demo-fill {
  justify-content: flex-start;
  min-height: 40px;
  margin: 0;
  padding: 7px 12px;
  border-color: #b8c3aa;
  background: #ffffff;
  color: var(--accent);
  font-size: var(--text-min);
  text-align: left;
}
.demo-list .demo-fill:hover { border-color: var(--accent); background: var(--accent); color: #ffffff; }
.demo-list .demo-val {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: var(--text-min);
  overflow-wrap: anywhere;
}
.demo-list .copy {
  flex: 0 0 auto;
  width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
.demo-list .copy:hover { background: var(--accent-soft); color: var(--accent); }
.demo-list .copy.is-copied { background: #e2f0e3; color: var(--ok); }
.secret-once { border: 2px solid var(--warn); background: #fff8e9; }
.temporary-password { font-size: 22px; font-weight: 650; overflow-wrap: anywhere; }

.wizard-layout {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.wizard-layout > * { min-width: 0; }
.wizard-progress {
  position: sticky;
  top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #f8f8f4;
}
.wizard-progress ol { margin: 0; padding: 0; list-style: none; }
.wizard-progress-mobile { display: none; }
.wizard-progress-mobile > summary { min-height: 44px; padding: 5px 4px; font-size: var(--text-base); }
.wizard-progress li + li { margin-top: 4px; }
.wizard-progress a, .wizard-step-link {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 52px;
  padding: 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: var(--text-min);
  text-decoration: none;
}
.wizard-progress a:hover { background: var(--accent-soft); color: var(--accent); }
.wizard-progress .current > a, .wizard-progress .current > .wizard-step-link {
  background: var(--accent);
  color: #ffffff;
  font-weight: 650;
}
.wizard-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid #b8bdac;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.wizard-progress .complete .wizard-step-number { border-color: var(--accent2); color: var(--accent2); }
.wizard-progress .current .wizard-step-number { border-color: #ffffff; color: #ffffff; }
.wizard-progress small { display: block; margin-top: 3px; font-size: var(--text-min); font-weight: 400; }
.wizard-heading { margin-bottom: 22px; }
.wizard-heading h2 { margin: 0 0 10px; }
.wizard-heading .section-intro { max-width: 75ch; margin-bottom: 0; }
.wizard-form fieldset.card { margin-bottom: 18px; }
.matrix-row { margin: 18px 0; padding: 20px; border: 1px solid var(--line); border-radius: 10px; }
.matrix-row:first-of-type { margin-top: 0; }
.matrix-row h3 { margin-bottom: 18px; }
.matrix-row-removed { opacity: 0.7; }
.danger-option { color: var(--danger); }
.review-group { padding: 20px 0; border-top: 1px solid var(--line); }
.review-group:first-of-type { padding-top: 4px; border-top: 0; }
.review-group:last-child { padding-bottom: 0; }
.review-group-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.review-group-head h3 { margin-bottom: 12px; }
.review-group-head a { flex: 0 0 auto; font-size: var(--text-min); }
.wizard-review > h2 { margin-bottom: 10px; }
.wizard-review .table-scroll table { min-width: 620px; }
.wizard-fee { margin-bottom: 20px; }

@media (max-width: 1180px) {
  nav { gap: 5px 13px; }
  nav .who { max-width: 210px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .wrap { padding: 0 22px; }
  header { margin: 12px 12px 0; border-radius: 14px; }
  header > .wrap { padding: 0 18px; }
  nav .spacer { flex-basis: 0; }
  .grid, .grid3 { grid-template-columns: 1fr; }
  .overview { grid-template-columns: 1fr 1fr; }
  .overview > div { padding: 0 20px; }
  .overview > div:nth-child(2) { border-right: 0; }
  .overview > div:last-child {
    grid-column: 1 / -1;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #d1d4c7;
  }
  .notification-row { grid-template-columns: 150px minmax(0, 1fr); }
  .notification-history { padding: 20px; }
  .notification-event { padding: 16px; }
  .notification-event-body, .delivery-item { grid-template-columns: 104px minmax(0, 1fr); }
  .wizard-layout { grid-template-columns: 1fr; gap: 20px; }
  .wizard-progress { position: static; }
  .wizard-progress ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .wizard-progress li + li { margin-top: 0; }
  .notification-row > :last-child { grid-column: 2; }
  .table-toolbar { align-items: flex-start; }
  .registry-filters, .queue-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .registry-filters > .filter-check, .registry-filters > .filter-actions { margin-top: 0; }
  .queue-filter-checks { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  header { margin: 8px 8px 0; }
  header > .wrap { padding: 0 14px; }
  nav { gap: 4px 12px; padding: 12px 0; }
  nav .brand { width: 100%; margin: 0 0 4px; }
  nav a.nav { min-height: 44px; }
  nav .who { max-width: 100%; white-space: normal; }
  nav .spacer { display: none; }
  nav form.inline { margin-left: auto; }
  main { padding: 26px 0 44px; }
  footer { padding: 22px 16px; }
  h1 { font-size: 29px; }
  h2 { font-size: 22px; }
  .page-head, .head { gap: 12px; margin-bottom: 20px; }
  .page-head .actions, .page-head > .btn, .head > .btn { width: 100%; }
  .page-head .actions .btn, .page-head > .btn, .head > .btn { flex: 1 1 auto; }
  .card, fieldset.card, .box.action.card { padding: 20px 16px; }
  .deals-card { padding: 0; }
  .wizard-progress { padding: 12px; }
  .wizard-layout > .wizard-progress:not(.wizard-progress-mobile) { display: none; }
  .wizard-progress-mobile { display: block; }
  .wizard-progress ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-progress a, .wizard-step-link { padding: 9px 7px; }
  .matrix-row { padding: 16px; }
  .form-row, .summary-grid { grid-template-columns: 1fr; }
  .overview { grid-template-columns: 1fr; padding: 0 18px; }
  .overview > div, .overview > div:nth-child(2), .overview > div:last-child {
    grid-column: auto;
    margin: 0;
    padding: 17px 0;
    border: 0;
    border-bottom: 1px solid #d1d4c7;
  }
  .overview > div:last-child { border-bottom: 0; }
  .overview > div > span { margin-bottom: 6px; }
  .overview strong { font-size: 26px; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv > div:nth-child(even) { margin-bottom: 12px; }
  .table-toolbar, .filter-form { align-items: stretch; flex-direction: column; }
  .filter-form, .filter-form .field, .filter-form button, .filter-form .btn { width: 100%; }
  .filter-form .field { min-width: 0; }
  .deals-card .table-toolbar { padding: 18px 16px; }
  .registry-filters, .queue-filters { grid-template-columns: 1fr; }
  .queue-filter-checks { align-items: stretch; flex-direction: column; }
  .registry-footer { align-items: flex-start; flex-direction: column; padding: 16px; }
  .filter-actions { align-items: stretch; flex-direction: column; }
  .tabs a { padding: 11px 12px; }
  .timeline .row, .notification-row { grid-template-columns: 1fr; gap: 7px; }
  .notification-row > :last-child { grid-column: auto; }
  .notification-row { padding: 16px 8px; }
  .notification-history { padding: 20px 16px; }
  .documents-head { flex-direction: column; gap: 14px; }
  .documents-add { width: 100%; }
  .document-upload-dialog { width: calc(100vw - 24px); max-height: 92vh; padding: 20px 16px; }
  .document-dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .document-dialog-actions button { width: 100%; }
  .notification-history-head { flex-direction: column; gap: 10px; }
  .notification-event { padding: 14px; }
  .notification-event-body, .delivery-item { grid-template-columns: 1fr; gap: 5px; }
  .delivery-result { padding-left: 34px; }
  .demo-list .demo-row { grid-template-columns: 1fr; }
  .demo-list .demo-fill { width: 100%; }
  .demo-code { font-size: 25px; letter-spacing: 4px; }
  button.small, .btn.small, .demo-list .copy { min-height: 44px; }
  .demo-list .copy { width: 44px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions button, .form-actions .btn { width: 100%; margin-right: 0; }
}

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

@media print {
  header, footer, .tabs, .actions, .form-actions, button, .btn, .skip-link { display: none !important; }
  body { background: #ffffff; color: #000000; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .card, .box { break-inside: avoid; box-shadow: none; }
  .table-scroll { overflow: visible; }
  .table-scroll table { min-width: 0; }
  a { color: #000000; }
}
