/* Nexinity onboarding · brand: infinity mark #46e696, Lora wordmark, ink/anthracite #1a1a1a, green #238c51 */
:root {
  --green: #238c51;
  --mark: #46e696;
  --anthracite: #1a1a1a;
  --green-dark: #1a6c3e;
  --green-soft: #eaf4ee;
  --ink: #1a1a1a;
  --ink-2: #4a4a46;
  --muted: #74736d;
  --paper: #faf9f6;
  --card: #ffffff;
  --line: #e7e4dc;
  --warn: #9a5b00;
  --warn-soft: #fff4dd;
  --err: #b42318;
  --err-soft: #fdecea;
  --info: #3a5a8c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(26, 26, 26, .04), 0 8px 24px rgba(26, 26, 26, .05);
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--green-dark); }
h1, h2, h3, .h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); line-height: 1.15; }
.h3, h2 { font-size: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.075rem; color: var(--ink-2); max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--green); margin: 0 0 .6rem; }

/* header */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 46px; height: 22px; color: var(--green); }
.brand-logo { display: block; height: 40px; width: auto; }
.brand-word { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; letter-spacing: .02em; }
.topbar-tag { color: var(--muted); font-size: .9rem; border-left: 1px solid var(--line); padding-left: 16px; }
.lang { margin-left: auto; }
.lang select { border: 1px solid var(--line); border-radius: 999px; padding: 7px 30px 7px 14px; font: 500 .875rem var(--sans); background-color: var(--paper); }

/* stepper */
.stepper { background: var(--card); border-bottom: 1px solid var(--line); }
.stepper ol { list-style: none; display: flex; gap: 4px; padding-top: 12px; padding-bottom: 12px; margin: 0 auto; overflow-x: auto; }
.step { flex: 1 1 0; min-width: 0; }
.step-inner { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; padding: 4px 6px; border-radius: 10px; }
.step a:hover { background: var(--green-soft); }
.step .dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 600;
  border: 1.5px solid var(--line); color: var(--muted); background: var(--card); }
.step .label { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.current .dot { border-color: var(--green); background: var(--green); color: #fff; }
.step.current .label { color: var(--ink); font-weight: 600; }
.step.done .label { color: var(--ink-2); }
.step.complete .dot { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.progress { height: 3px; background: var(--line); }
.progress span { display: block; height: 100%; background: var(--green); transition: width .3s; }

/* layout */
.main { flex: 1; padding-top: 36px; padding-bottom: 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-bottom: 20px; }
.step-head { margin-bottom: 24px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; margin-bottom: 40px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.hero-card { background: linear-gradient(180deg, #fff, var(--green-soft)); }
.checklist-plain { padding: 0; margin: 0 0 14px; list-style: none; }
.checklist-plain li { padding: 7px 0 7px 28px; position: relative; border-bottom: 1px dashed var(--line); }
.checklist-plain li::before { content: ''; position: absolute; left: 4px; top: 14px; width: 12px; height: 6px; border: solid var(--green); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-item { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.how-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; }
.how-item p { margin: 2px 0 0; }

/* forms */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field-full { grid-column: 1 / -1; }
.field > label, .field legend { font-weight: 500; font-size: .93rem; padding: 0; }
.req { color: var(--green); }
.opt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.hint { margin: 0; font-size: .84rem; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=password], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid #d9d5cb; border-radius: var(--radius-sm);
  padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234a4a46' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(35, 140, 81, .15); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--err); }
.field-error { margin: 0; color: var(--err); font-size: .84rem; font-weight: 500; }
.affix { display: flex; }
.affix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.affix span { display: grid; place-items: center; padding: 0 13px; border: 1px solid #d9d5cb; border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--paper); color: var(--muted); }
.choice-row, .choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 9px 15px; border: 1px solid #d9d5cb; border-radius: 999px; background: #fff; font-size: .92rem; transition: all .15s; }
.choice-grid .choice span { border-radius: var(--radius-sm); }
.choice input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); font-weight: 500; }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(35, 140, 81, .2); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; }
[data-show-if][hidden] { display: none !important; }

.persons { display: flex; flex-direction: column; gap: 14px; margin: 6px 0 12px; }
.person { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; position: relative; background: var(--paper); margin: 0; }
.person > legend { font-family: var(--serif); font-weight: 600; padding: 0 6px; }
[data-add-person] { align-self: flex-start; }
.person .remove { position: absolute; top: 12px; right: 16px; }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.form-actions.plain { border-top: 0; margin-top: 8px; }
.form-actions .right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-left: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .95rem var(--sans); border-radius: 999px; padding: 12px 24px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; position: relative; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; border-color: #cfcabe; color: var(--ink); }
.btn-ghost:hover { border-color: var(--green); color: var(--green-dark); }
.btn-link { background: none; border: 0; color: var(--ink-2); padding: 12px 6px; text-decoration: underline; text-underline-offset: 3px; }
.btn-small { padding: 7px 14px; font-size: .84rem; }
.btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.link-btn.danger { color: var(--err); }
.link { font-weight: 500; }

/* flash */
.flash { padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 22px; font-weight: 500; }
.flash-ok { background: var(--green-soft); color: var(--green-dark); }
.flash-error { background: var(--err-soft); color: var(--err); }
.flash-info { background: var(--warn-soft); color: var(--warn); white-space: pre-line; }
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { padding: 10px 0; border-top: 1px solid var(--line, #e6e4dd); }
.event-list li:first-child { border-top: 0; }
.admin-actions { display: grid; gap: 12px; }
.admin-actions textarea { width: 100%; min-height: 70px; }
.admin-actions .row { display: flex; flex-wrap: wrap; gap: 8px; }
.idv-person { border-top: 1px solid var(--line); padding: 16px 0; display: grid; gap: 8px; }
.idv-person p { margin: 0; }
.idv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.idv-person label input { margin-top: 4px; font-size: .85rem; }
.idv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.idv-actions input[type=text] { flex: 1 1 240px; }

/* documents */
.dropzone { border: 2px dashed #cfd9d2; background: #fcfdfb; text-align: center; padding: 36px 24px; transition: all .15s; }
.dropzone.dragover { border-color: var(--green); background: var(--green-soft); }
.dz-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dz-icon { width: 40px; height: 40px; color: var(--green); }
.dz-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 4px 0 0; }
.dz-inner .btn { margin-top: 10px; }
.dz-progress { margin-top: 18px; height: 6px; border-radius: 6px; background: var(--line); position: relative; }
.dz-progress span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 6px; transition: width .2s; }
.dz-progress em { display: block; font-style: normal; font-size: .82rem; color: var(--muted); margin-top: 10px; }

.checklist-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-ok { background: var(--green-soft); color: var(--green-dark); }
.meter { height: 6px; background: var(--line); border-radius: 6px; margin: 12px 0 8px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--green); transition: width .3s; }
.doc-list, .file-list, .checks { list-style: none; padding: 0; margin: 0; }
.doc-row { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-list.compact .doc-row { grid-template-columns: 30px 1fr auto; padding: 9px 0; }
.doc-text { display: flex; flex-direction: column; min-width: 0; }
.doc-text strong { font-weight: 500; }
.doc-state, .file-state { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.badge { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .82rem; font-weight: 700; border: 1.5px dashed #c9c4b8; color: #fff; flex: none; }
.status-ok .badge { background: var(--green); border: 0; }
.status-warning .badge, .status-unassigned .badge { background: #d98a10; border: 0; }
.status-rejected .badge { background: var(--err); border: 0; }
.status-ok .doc-state, .status-ok .file-state { color: var(--green-dark); }
.status-warning .doc-state, .status-warning .file-state, .status-unassigned .file-state { color: var(--warn); }
.status-rejected .doc-state, .status-rejected .file-state { color: var(--err); }
.status-missing .doc-state { color: var(--muted); }

.file { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 12px; border-left-width: 4px; }
.file.status-ok { border-left-color: var(--green); }
.file.status-warning, .file.status-unassigned { border-left-color: #d98a10; }
.file.status-rejected { border-left-color: var(--err); background: #fffafa; }
.file-head { display: flex; gap: 12px; align-items: center; }
.file-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-name strong { font-weight: 500; overflow-wrap: anywhere; }
.checks { margin: 10px 0 0 38px; font-size: .88rem; }
.checks li { padding: 2px 0 2px 22px; position: relative; color: var(--ink-2); }
.checks li::before { position: absolute; left: 0; top: 2px; font-weight: 700; }
.checks .lvl-ok::before { content: '✓'; color: var(--green); }
.checks .lvl-info::before { content: 'i'; color: var(--info); font-style: italic; left: 4px; }
.checks .lvl-warn { color: var(--warn); }
.checks .lvl-warn::before { content: '!'; color: var(--warn); left: 4px; }
.checks .lvl-error { color: var(--err); font-weight: 500; }
.checks .lvl-error::before { content: '×'; color: var(--err); }
.file-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0 0 38px; flex-wrap: wrap; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline select { width: auto; max-width: 100%; padding: 7px 34px 7px 11px; font-size: .88rem; }

/* review */
.summary-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.summary-head h2 { margin: 0; }
.summary-head .link { margin-left: auto; }
.summary.incomplete { border-color: #ecd3a2; }
.kv { display: grid; grid-template-columns: minmax(160px, 34%) 1fr; gap: 8px 18px; margin: 12px 0 0; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* done */
.card.done, section.done { text-align: center; padding: 56px 28px; max-width: 680px; margin: 0 auto; }
.done-mark { width: 90px; height: 42px; color: var(--green); margin-bottom: 18px; }
.card.done .lead, section.done .lead { margin: 0 auto; }
.reference { font-size: 1.1rem; margin: 22px 0; }
.reference strong { font-family: var(--serif); color: var(--green-dark); }
.next-steps { text-align: left; max-width: 460px; margin: 0 auto 28px; color: var(--ink-2); }
.next-steps li { margin: 6px 0; }

/* admin */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.json { background: var(--paper); border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; font-size: .82rem; }

/* footer */
.footer { border-top: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: .85rem; }
.footer-inner { display: flex; gap: 24px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
.footer .resume { margin-left: auto; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .how { grid-template-columns: 1fr; }
  .step .label { display: none; }
  .step.current .label { display: inline; }
  .step { flex: 0 0 auto; }
  .step.current { flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .card { padding: 20px 18px; }
  .grid { grid-template-columns: 1fr; }
  .topbar-tag { display: none; }
  .doc-row { grid-template-columns: 30px 1fr; }
  .doc-row .doc-state { grid-column: 2; }
  .doc-row .btn { grid-column: 2; justify-self: start; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .checks, .file-actions { margin-left: 0; }
  .form-actions .right { width: 100%; justify-content: space-between; }
  .footer .resume { margin-left: 0; }
}

/* address check */
.address-check { gap: 4px; }
.addr-note { margin: 0; font-size: .9rem; }
.addr-note.ok { color: var(--green-dark); font-weight: 500; }
.addr-note.ok .muted { font-weight: 400; display: block; margin-left: 18px; }
.addr-note.info { color: var(--muted); }
.addr-warn { background: var(--warn-soft); border: 1px solid #f0d49c; border-radius: var(--radius-sm); padding: 14px 16px; color: var(--warn); }
.addr-warn p { margin: 6px 0 10px; color: var(--ink-2); }
.addr-warn .check span { color: var(--ink); }
.address-check.has-error .addr-warn { border-color: var(--err); }

/* upload result directly under the dropzone */
.upload-result { margin-bottom: 20px; }
.upload-result .result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-result .result-head h2 { margin: 0; }
.upload-result.has-problems { border-color: #ecd3a2; }
.upload-result.all-bad { border-color: var(--err); }
.upload-result .file { margin-top: 10px; }
.upload-error { background: var(--err-soft); color: var(--err); border-radius: var(--radius-sm); padding: 13px 16px; font-weight: 500; margin-bottom: 20px; }
.dz-progress em { min-height: 1.2em; }
.pill-bad { background: var(--err-soft); color: var(--err); }
[hidden] { display: none !important; }
#upload-result, #address-check, #form { scroll-margin-top: 90px; }

/* quick start */
.quickstart .dz-inner { gap: 8px; }
.quickstart [data-qs-names] { color: var(--green-dark); font-weight: 500; margin: 4px 0; min-height: 1.2em; }
.qs-note { text-align: center; margin: 16px 0 0; }
.prefill-list { list-style: none; padding: 0; margin: 0; }
.prefill-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.prefill-list li:last-child { border-bottom: 0; }
.pf-row { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; gap: 2px 16px; }
.pf-row .muted { grid-column: 2; }
.pf-value { overflow-wrap: anywhere; }
.prefill-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--green-soft); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-size: .92rem; }
@media (max-width: 640px) { .pf-row { grid-template-columns: 1fr; } .pf-row .muted { grid-column: 1; } }
.prefill-list .check .pf-row { flex: 1; grid-template-columns: 240px 1fr; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* applicant overview */
.topbar-link { margin-left: auto; font-weight: 600; font-size: .9rem; color: var(--green-dark); text-decoration: none; padding: 7px 14px; border-radius: 999px; background: var(--green-soft); white-space: nowrap; }
.topbar-link:hover { background: #d9efe2; }
.topbar-link + .lang { margin-left: 0; }
.ov-status { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border-radius: var(--radius); margin-bottom: 20px; }
.ov-status.is-ready { background: var(--green-soft); color: var(--green-dark); }
.ov-status.is-open { background: var(--warn-soft); color: var(--warn); }
.ov-status span { font-size: .9rem; }
.todo-list { list-style: none; padding: 0; margin: 8px 0 0; }
.todo-list li { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 9px 0; border-top: 1px dashed var(--line); }
.todo-list li:first-child { border-top: 0; }
.todo-list li .link { white-space: nowrap; }
.todo-list .lvl-error > span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--err); margin-right: 8px; vertical-align: 1px; }
.open-items { border-color: #ecd3a2; scroll-margin-top: 90px; }
.open-items h2 { margin-top: 0; }
.doc-text .why { display: block; color: var(--err); font-size: .84rem; margin-top: 2px; }
.doc-text .small { display: block; }
.ov-unassigned { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); }
.ov-unassigned ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 640px) {
  .topbar-link { padding: 6px 10px; font-size: .82rem; }
  .todo-list li { flex-direction: column; gap: 4px; }
}
.doc-list.ov-docs .doc-row { grid-template-columns: 30px 1fr auto auto; }
.doc-list.ov-docs .doc-row .btn { grid-column: auto; }
@media (max-width: 640px) {
  .doc-list.ov-docs .doc-row { grid-template-columns: 30px 1fr; }
  .doc-list.ov-docs .doc-row .doc-state, .doc-list.ov-docs .doc-row .btn { grid-column: 2; justify-self: start; }
}

/* waiting indicator: infinity mark */
.nx-busy { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(250, 249, 245, .72); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.nx-busy.on { opacity: 1; pointer-events: auto; cursor: progress; }
.nx-busy-box { display: grid; justify-items: center; gap: 14px; }
.nx-busy svg { width: 112px; height: 56px; overflow: visible; }
.nx-busy path { fill: none; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.nx-busy-track { stroke: var(--mark); opacity: .16; }
.nx-busy-run { stroke: var(--mark); stroke-dasharray: 26 74; animation: nx-run 1.5s linear infinite; }
.nx-busy-label { color: var(--muted); font-weight: 500; font-size: .95rem; }
@keyframes nx-run { to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) { .nx-busy-run { animation-duration: 4s; } }

/* admin area: full page width */
.admin-area .wrap { max-width: none; padding-left: 32px; padding-right: 32px; }
.admin-area .lead { max-width: none; }
.admin-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; font-weight: 500; font-size: .93rem; }
.admin-nav a { color: var(--ink-2); text-decoration: none; }
.admin-nav a:hover { color: var(--green-dark); }
.admin-nav form { margin: 0; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
.admin-toolbar .inline-link { width: 420px; max-width: 100%; font-size: .82rem; padding: 6px 10px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.card.narrow { max-width: 560px; }
.auth-card { max-width: 440px; margin: 40px auto; }
.auth-logo { height: 30px; width: auto; margin-bottom: 22px; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
.auth-form label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; }
.auth-form .btn { justify-self: start; margin-top: 4px; }
.inline-form { display: flex; gap: 6px; }
.inline-form input { width: 130px; padding: 6px 10px; font-size: .85rem; }
.team-upload { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; padding: 14px; margin: 0 0 18px; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.team-upload label { display: grid; gap: 6px; font-size: .88rem; font-weight: 500; }
.team-banner { background: var(--warn-soft); color: var(--warn); font-weight: 500; padding: 10px 0; }
.team-banner .wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
tr.muted td { opacity: .6; }
@media (max-width: 980px) { .admin-grid { grid-template-columns: 1fr; } .admin-area .wrap { padding-left: 16px; padding-right: 16px; } .admin-nav { gap: 12px; flex-wrap: wrap; } }

/* admin: menu on the left */
.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.admin-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 26px 18px; background: var(--card); border-right: 1px solid var(--line); }
.admin-brand img { height: 40px; width: auto; display: block; }
.admin-side-tag { margin: 6px 0 18px; color: var(--muted); font-size: .85rem; }
.admin-menu { display: grid; gap: 2px; }
.admin-menu a { padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.admin-menu a:hover { background: var(--paper); color: var(--ink); }
.admin-menu a.on { background: var(--green-soft); color: var(--green-dark); }
.admin-me { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-me form { margin-top: 8px; }
.admin-shell .main { padding-top: 32px; }
.journey-check { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; padding: 14px 16px; margin: 0 0 18px; border-radius: var(--radius-sm); background: var(--warn-soft); }
.journey-check.is-done { background: var(--green-soft); }
.admin-docs .doc-row, .doc-list.compact.admin-docs .doc-row { grid-template-columns: 30px minmax(0, 1fr) auto auto; }
.admin-docs .inline-form input { width: 230px; }
.status-waived .badge { background: var(--line); color: var(--ink-2); }
.small-head { font-size: 1.05rem; margin-top: 26px; }
.file-edit { margin-top: 10px; flex-wrap: wrap; }
.file-edit select { width: auto; max-width: 260px; padding: 6px 30px 6px 10px; font-size: .85rem; }
.btn.danger { color: var(--err); border-color: #e9b8b3; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; } .admin-menu { display: flex; flex-wrap: wrap; } .admin-me { margin: 0 0 0 auto; border: 0; padding: 0; } .admin-side-tag { display: none; } }

/* Merchant Management: invoicing and customers */
.admin-menu-group { margin: 14px 12px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.admin-menu-group:first-child { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.grid-2 label, .invoice-form label { display: grid; gap: 4px; font-weight: 500; }
.invoice-form { display: grid; gap: 16px; }
.invoice-form .h3 { margin: 6px 0 0; }
.table.lines input, .table.lines select { width: 100%; padding: 6px 8px; font-size: .88rem; }
.table.lines .w-s { width: 70px; } .table.lines .w-m { width: 110px; }
.row-actions { display: flex; gap: 10px; justify-content: flex-end; }
.dup-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; flex-wrap: wrap; }
.ksef-box { border-left: 4px solid var(--warn); }
.ksef-box ol { margin: 6px 0 12px; padding-left: 20px; }
.ksef-box .inline-form input { width: 340px; max-width: 100%; }
.invoice-frame { width: 100%; height: 1150px; border: 1px solid var(--line, #e4e4ee); border-radius: var(--radius-sm); background: #fff; margin-top: 10px; }
.admin-toolbar .inline-form input[type=text] { width: 260px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } .table.lines { min-width: 640px; } }
.table-wrap > .h3 { padding: 18px 20px 6px; margin: 0; }
#add-line { justify-self: start; }
/* invoice list filters and sorting */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 18px; margin-bottom: 16px; }
.filter-bar label { display: grid; gap: 4px; font-size: .82rem; font-weight: 500; }
.filter-bar select, .filter-bar input { padding: 6px 10px; font-size: .88rem; min-width: 150px; }
.table a.sort { color: inherit; text-decoration: none; }
.table a.sort.on { color: var(--green-dark); }
.nowrap { white-space: nowrap; }

/* sidebar: brand tag, groups, smaller text, anthracite account block */
.admin-side { padding-bottom: 0; }
.admin-side-tag { display: inline-block; align-self: flex-start; margin: 10px 0 16px; padding: 4px 10px; border-radius: 6px; background: var(--mark); color: var(--anthracite); font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.admin-menu a { font-size: .86rem; padding: 7px 12px; }
.admin-menu-group { margin: 16px 0 4px; padding: 0 12px 6px; border-bottom: 1px solid var(--line); font-size: .66rem; }
.admin-menu-group:first-child { margin-top: 0; }
.admin-me { margin: auto -18px 0; padding: 16px 18px 22px; background: var(--anthracite); color: #fff; border-top: 0; }
.admin-me .muted { color: rgba(255, 255, 255, .62); }
.admin-me .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); background: transparent; }
.admin-me .btn-ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
/* page actions: under the title, right aligned */
.admin-toolbar { justify-content: flex-end; }
.step-head + .admin-toolbar { margin-top: -6px; }
/* collapsible card with a subtle arrow */
details.collapsible > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary h2 { margin: 0; }
details.collapsible .chev { width: 9px; height: 9px; border-right: 1.5px solid #a9a69e; border-bottom: 1.5px solid #a9a69e; transform: rotate(45deg); transition: transform .15s; margin: 0 6px 4px 12px; }
details.collapsible[open] .chev { transform: rotate(225deg); margin-bottom: -2px; }
details.collapsible[open] > summary { margin-bottom: 12px; }
.pager { display: flex; gap: 14px; justify-content: flex-end; align-items: center; margin-top: 10px; }
/* combined bank statement period */
.coverage { display: block; margin-top: 2px; }
.coverage.ok { color: var(--green-dark); }
.coverage.short { color: var(--warn); }
.status-incomplete .badge { background: #d98a10; border: 0; color: #fff; }
/* full-width brand bar, logo aligned with the menu text (sidebar padding 18px + item padding 12px) */
.admin-side-tag { display: block; align-self: stretch; margin: 12px -18px 16px; padding: 9px 30px; border-radius: 0; font-weight: 400; font-size: .82rem; }
.admin-brand { padding-left: 10px; }
/* sidebar: light grey account block, full-width group lines */
.admin-me { background: #f0efea; color: var(--ink); border-top: 1px solid var(--line); }
.admin-me .muted { color: var(--muted); }
.admin-me .btn-ghost { color: var(--ink); border-color: var(--line); background: #fff; }
.admin-me .btn-ghost:hover { background: var(--paper); border-color: var(--ink-2); }
.admin-menu-group { margin: 16px -18px 4px; padding: 0 30px 6px; }
.admin-menu-group:first-child { margin-top: 0; }
/* page head: title, description with actions on the right, figures below */
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 8px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-head-row .lead { margin: 0; max-width: 680px; }
.page-head-row .admin-toolbar { margin: 0; flex: none; flex-wrap: nowrap; }
.page-stats { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) { .page-head-row { flex-direction: column; } }
/* icons (Lucide) */
.icon { display: inline-block; vertical-align: -3px; flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--green-dark); border-color: var(--green); }
.icon-btn.copied { color: #fff; background: var(--green); border-color: var(--green); }
/* detail page: merchant link left, actions right */
.detail-toolbar { align-items: center; }
.merchant-link { margin-right: auto; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.merchant-link a.link { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* icon buttons: plain grey icon like the text, no outline */
.icon-btn { width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted); border-radius: 5px; }
.icon-btn:hover { color: var(--ink); background: transparent; }
.icon-btn.copied { color: var(--green); background: transparent; }
.icon-btn:focus-visible { outline: 2px solid var(--green-soft); outline-offset: 1px; }
/* page head v2: description, then figures (left) and actions (right) on one line */
.page-head > .lead { margin: 0; max-width: 760px; }
.page-head-row { align-items: center; margin-top: 12px; }
.page-head-row .page-stats { margin: 0; }
/* menu items: active and hover state across the full width of the sidebar */
.admin-menu a { margin: 0 -18px; padding: 8px 30px; border-radius: 0; }
/* ---------- transaction imports ---------- */
.tx-new-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.req-list { padding-left: 18px; margin: 6px 0 14px; display: grid; gap: 6px; }
.req-list .muted { display: block; }
.map-options { align-items: flex-end; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.map-side { padding: 18px; }
.map-side h2 { margin: 0 0 12px; }
.col-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; max-height: 1180px; overflow: auto; padding-right: 2px; }
.col-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.col-card.used { border-color: #b9dcc6; background: #fbfdfb; }
.col-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; padding: 8px 8px 6px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
.col-head strong { display: block; font-size: .86rem; word-break: break-word; }
.col-used { display: block; color: var(--green-dark) !important; }
.col-values { list-style: none; margin: 0; padding: 4px 10px 8px; font-size: .78rem; color: var(--ink-2); }
.col-values li { padding: 2px 0; border-bottom: 1px dashed #eeece6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-values li:last-child { border-bottom: 0; }
.arrow-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: var(--green); color: #fff; cursor: pointer; }
.arrow-btn:hover { background: var(--green-dark); }
.arrow-btn:disabled { background: #d9d6ce; cursor: default; }
.map-group { margin: 14px 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line); font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 10px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; }
.field-row:hover { background: var(--paper); }
.field-row.active { border-color: var(--green); background: var(--green-soft); }
.field-row .pill { margin-left: 6px; font-size: .68rem; padding: 1px 7px; }
.field-row.done .pill-bad { background: var(--green-soft); color: var(--green-dark); }
.field-help { display: block; margin-top: 2px; }
.field-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.slot-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 7px; background: #fff; border: 1px solid #b9dcc6; font-size: .84rem; font-weight: 500; }
.slot-chip[hidden], .slot-empty[hidden], .fixed-input[hidden], .slot-auto[hidden] { display: none; }
.slot-sample { flex-basis: 100%; }
.field-row:not(.done)[data-req="1"] .slot-empty { color: var(--err); }
.fixed-input { width: 100%; padding: 6px 9px; font-size: .84rem; }
.map-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; position: sticky; bottom: 0; z-index: 5; margin-top: 18px; }
.ok-text { color: var(--green-dark); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 2px; }
.tile-num { font-size: 1.2rem; font-weight: 600; }
.tile-label { font-size: .78rem; color: var(--muted); }
.tile.bad { border-color: #f1c4bf; background: var(--err-soft); } .tile.bad .tile-num { color: var(--err); }
.tile.good .tile-num { color: var(--green-dark); }
.tile.warn { border-color: #f1dcae; background: var(--warn-soft); } .tile.warn .tile-num { color: var(--warn); }
.notice { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; background: var(--paper); border: 1px solid var(--line); }
.notice-bad { background: var(--err-soft); border-color: #f1c4bf; }
.notice-good { background: var(--green-soft); border-color: #b9dcc6; }
.import-confirm { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.import-confirm .check { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.lvl-dot { display: inline-flex; }
.lvl-error .lvl-dot { color: var(--err); }
.lvl-warning .lvl-dot { color: #d98a10; }
.table.spec code, .table.issues code { font-size: .8rem; background: var(--paper); padding: 1px 5px; border-radius: 4px; }
.table-wrap > h2.h3 .link { margin-left: 10px; font-weight: 400; }
.btn .icon { margin-right: 4px; }
@media (max-width: 1000px) { .map-grid, .tx-new-grid { grid-template-columns: 1fr; } .field-row { grid-template-columns: 1fr; } }
.table.issues th, .table.issues td { white-space: normal; }
.table.issues td:nth-child(4) code { word-break: break-all; }
.table.issues td code { display: inline-block; max-width: 280px; }
.map-options select { min-width: 210px; }
.table.spec th, .table.spec td { white-space: normal; vertical-align: top; }
.table td.wrap-cell { white-space: normal; overflow-wrap: anywhere; min-width: 160px; max-width: 260px; }
.table-note { margin: -4px 16px 8px; }
/* platform section on an imported batch */
.platform-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.platform-head h2 { margin: 0; }
.small-tiles .tile { padding: 9px 12px; }
.small-tiles .tile-num { font-size: 1.05rem; }
.small-head { font-size: 1rem; margin: 0; }
.merchant-platform { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; }
.platform-form { margin-top: 10px; align-items: end; }
.platform-form .form-end { display: flex; align-items: end; }
.notice-warn { background: var(--warn-soft); border-color: #f1dcae; }
.approve-box { display: grid; gap: 10px; }
.approve-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.approve-actions input { width: 220px; }
.send-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 14px; }
.send-box > div { margin-right: auto; }
.send-box input[type=text] { width: 260px; }
.refresh-form { align-items: center; gap: 10px; margin: 4px 0 12px; }
.table.runs td { vertical-align: top; }
.table.kv td:first-child { color: var(--muted); width: 190px; }
.table.tx-table { font-size: .82rem; }
.table.tx-table th, .table.tx-table td { padding: 9px 10px; }
.table.tx-table td.wrap-cell { min-width: 120px; max-width: 180px; }
.table-title { padding: 18px 20px 6px; margin: 0; }
.table.kv td { white-space: normal; overflow-wrap: anywhere; }
