/* ============================================================================
   demo.css — /demo/nolimits (No Limits Distribution developer demo)
   Page-local layer. Sits on top of /static/ds/styles.css with
   data-brand="payments" (the green ramp). Authors against DS semantic aliases;
   only the code-surface dark + the statement teal card-present accent are local
   hex (per CONTRACT §4b / ref-design §4).
   60/30/10: ~60% ink neutrals, ~30% text/structure, ~10% green spice.
   ========================================================================== */

:root {
  --code-bg:      #04070b;
  --code-border:  var(--border-subtle);     /* rgba(174,184,208,0.10) */
  --code-kw:      var(--brand-bright);       /* #2BF5A6 */
  --code-comment: var(--text-faint);         /* #4A5A78 */
  --code-text:    var(--text-body);          /* #AEB8D0 */
  --rail-line:    var(--grad-brand);         /* green->teal */
  --join-key:     var(--brand);              /* #00E18C — purchaseId==txn id highlight */
  --card-present: #1f9d8b;                   /* statement teal — terminal rail chip */
  --nl-maxw: 1180px;
}

/* ---- base / reset ---------------------------------------------------------*/
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--brand-tint-strong); color: var(--text-strong); }

/* full-bleed ambient + grid scaffold */
.nl-page {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
}
.nl-shell {
  position: relative;
  z-index: 1;
  max-width: var(--nl-maxw);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 640px) { .nl-shell { padding: 0 16px; } }

/* section rhythm */
.nl-section { padding: 88px 0; position: relative; }
.nl-section + .nl-section { padding-top: 24px; }
@media (max-width: 720px) { .nl-section { padding: 56px 0; } }

.nl-kicker {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--brand); font-weight: 600; margin: 0 0 14px;
  display: inline-flex; align-items: center; gap: 10px;
}
.nl-kicker::before {
  content: ""; width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand));
}
.nl-h2 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; margin: 0 0 14px;
  color: var(--text-strong);
}
.nl-lede { font-size: 16px; line-height: 1.6; color: var(--text-body); max-width: 64ch; margin: 0 0 28px; }
.spice { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nl-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.nl-faint { color: var(--text-faint); }
.nl-muted { color: var(--text-muted); }

/* ---- scroll progress bar --------------------------------------------------*/
#nl-progress { width: 0; }

/* ---- sticky sub-nav -------------------------------------------------------*/
.nl-subnav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in srgb, var(--bg-page) 78%, transparent);
  border-bottom: 1px solid var(--border-subtle);
}
.nl-subnav__inner {
  max-width: var(--nl-maxw); margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 6px; overflow-x: auto;
  scrollbar-width: none;
}
.nl-subnav__inner::-webkit-scrollbar { display: none; }
.nl-subnav__brand {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em;
  font-size: 15px; color: var(--text-strong); margin-right: 14px; white-space: nowrap;
}
.nl-subnav__brand b { font-weight: 800; }
.nl-navlink {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 6px 10px; border-radius: var(--radius-full); white-space: nowrap;
  position: relative; transition: color var(--dur-fast) var(--ease-out);
}
.nl-navlink:hover { color: var(--text-body); text-decoration: none; }
.nl-navlink.is-active { color: var(--brand); }
.nl-navlink.is-active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 1px; height: 2px;
  background: var(--grad-brand); border-radius: 2px;
}

/* ---- buttons --------------------------------------------------------------*/
.nl-btn {
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border-radius: var(--radius-md); padding: 12px 20px; border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  text-decoration: none;
}
.nl-btn:hover { text-decoration: none; }
.nl-btn--primary {
  color: var(--text-on-brand); background: var(--grad-brand); border: 0;
  box-shadow: 0 10px 30px -8px var(--brand-tint-strong), inset 0 1px 0 rgba(255,255,255,.3);
}
.nl-btn--primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.nl-btn--ghost {
  color: var(--text-strong); background: transparent; border: 1px solid var(--border-strong);
}
.nl-btn--ghost:hover { transform: translateY(-1px); border-color: var(--brand); color: var(--brand); }
.nl-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }
.nl-btn--sm { padding: 8px 14px; font-size: 13px; }
.nl-btn--block { width: 100%; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .nl-btn:hover { transform: none; } }

/* ---- glass panel helpers (layered on .lds-glass) --------------------------*/
.nl-panel { padding: 28px; }
@media (max-width: 640px) { .nl-panel { padding: 20px; } }

/* ============================================================================
   1. HERO
   ========================================================================== */
.nl-hero { padding: 92px 0 56px; }
.nl-hero__panel {
  padding: 40px 44px 44px;
  display: grid; grid-template-columns: 1.4fr .8fr; gap: 32px; align-items: center;
}
@media (max-width: 880px) { .nl-hero__panel { grid-template-columns: 1fr; gap: 18px; padding: 28px 22px; } }
.nl-hero__lockup { height: 30px; margin-bottom: 22px; display: block; }
.nl-hero h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -.035em;
  font-size: clamp(32px, 5.4vw, 60px); line-height: 1.02; margin: 0 0 18px;
  color: var(--text-strong);
}
.nl-hero__sub { font-size: 17px; line-height: 1.6; color: var(--text-body); max-width: 56ch; margin: 0 0 26px; }
.nl-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.nl-hero__mark { display: flex; align-items: center; justify-content: center; }
.nl-hero__mark img { width: 100%; max-width: 260px; height: auto; filter: drop-shadow(0 18px 40px rgba(0,225,140,.10)); }
@media (max-width: 880px) { .nl-hero__mark { display: none; } }

.nl-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: 30px; background: var(--border-subtle);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden;
}
@media (max-width: 720px) { .nl-kpis { grid-template-columns: repeat(2, 1fr); } }
.nl-kpi { background: var(--surface-card); padding: 18px 20px; }
.nl-kpi__num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-metric); font-weight: 700; color: var(--brand); line-height: 1; }
.nl-kpi__lbl { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ============================================================================
   2. ARCHITECTURE
   ========================================================================== */
.nl-arch { display: grid; grid-template-columns: 1fr; gap: 20px; }
.nl-rails { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 880px) { .nl-rails { grid-template-columns: 1fr; } }
.nl-rail { padding: 22px; }
.nl-rail__icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  background: var(--brand-tint); color: var(--brand); font-family: var(--font-mono); font-weight: 700; font-size: 13px;
}
.nl-rail--present .nl-rail__icon { background: color-mix(in srgb, var(--card-present) 18%, transparent); color: var(--card-present); }
.nl-rail__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text-strong); margin: 0 0 6px; }
.nl-rail__desc { font-size: 13.5px; line-height: 1.55; color: var(--text-body); margin: 0 0 14px; }
.nl-rail__tag {
  font-family: var(--font-mono); font-size: 11px; color: var(--brand);
  background: var(--brand-tint); border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  border-radius: var(--radius-full); padding: 5px 10px; display: inline-block;
}
.nl-rail--present .nl-rail__tag { color: var(--card-present); background: color-mix(in srgb, var(--card-present) 14%, transparent); border-color: color-mix(in srgb, var(--card-present) 30%, transparent); }

.nl-flow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin: 6px 0; }
@media (max-width: 880px) { .nl-flow { grid-template-columns: 1fr; text-align: center; } }
.nl-flow__node {
  padding: 18px 22px; border-radius: var(--radius-lg); text-align: center;
  background: var(--surface-card); border: 1px solid var(--border-default);
}
.nl-flow__node--order { border-color: color-mix(in srgb, var(--brand) 45%, transparent); box-shadow: 0 0 0 3px var(--brand-tint); }
.nl-flow__node small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: .12em; text-transform: uppercase; }
.nl-flow__node b { display: block; font-family: var(--font-mono); font-size: 18px; color: var(--text-strong); margin-top: 6px; font-variant-numeric: tabular-nums; }
.nl-flow__node span { font-size: 12.5px; color: var(--text-body); }
.nl-flow__arrow { font-family: var(--font-mono); color: var(--brand); font-size: 22px; }
@media (max-width: 880px) { .nl-flow__arrow { transform: rotate(90deg); } }

.nl-join { padding: 24px 26px; margin-top: 4px; }
.nl-join__eq {
  font-family: var(--font-mono); font-size: clamp(15px, 2.4vw, 21px); color: var(--text-body);
  background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius-md);
  padding: 16px 18px; margin-bottom: 14px; overflow-x: auto;
}
.nl-join__eq .k { color: var(--join-key); font-weight: 700; }
.nl-join__eq .op { color: var(--brand-bright); }

/* ============================================================================
   shared: live widget two-col layout / forms / result chips
   ========================================================================== */
.nl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 880px) { .nl-two { grid-template-columns: 1fr; } }

.nl-field { margin-bottom: 14px; }
.nl-field:last-child { margin-bottom: 0; }
.nl-label {
  display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px;
}
.nl-input, .nl-select {
  width: 100%; font-family: var(--font-sans); font-size: 14px; color: var(--text-strong);
  background: var(--surface-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: 11px 13px; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.nl-input::placeholder { color: var(--text-faint); }
.nl-input:focus, .nl-select:focus, .cj-field.cj-focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,225,140,.14);
}
.nl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nl-row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 480px) { .nl-row, .nl-row--3 { grid-template-columns: 1fr; } }

/* Collect.js hosted-field containers (iframes inject here) */
.cj-field {
  width: 100%; min-height: 44px; background: var(--surface-raised);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  padding: 0 13px; display: flex; align-items: center;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.cj-field.cj-invalid { border-color: var(--error); }
.cj-field iframe { width: 100% !important; }

.nl-result {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--surface-sunken); border: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: 12.5px; color: var(--code-text);
  min-height: 46px; white-space: pre-wrap; word-break: break-word;
}
.nl-result.is-empty { color: var(--text-faint); }
.nl-result .k { color: var(--code-kw); }
.nl-result .ok { color: var(--brand); }
.nl-result .warn { color: var(--warning); }
.nl-result .bad { color: var(--error); }

/* result chip */
.nl-chip {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .04em; padding: 7px 12px; border-radius: var(--radius-full);
  border: 1px solid; margin: 6px 6px 0 0;
}
.nl-chip--ok { color: var(--brand); background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.nl-chip--pending { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); border-color: color-mix(in srgb, var(--warning) 34%, transparent); }
.nl-chip--present { color: var(--card-present); background: color-mix(in srgb, var(--card-present) 12%, transparent); border-color: color-mix(in srgb, var(--card-present) 32%, transparent); }
.nl-chip--bad { color: var(--error); background: color-mix(in srgb, var(--error) 12%, transparent); border-color: color-mix(in srgb, var(--error) 32%, transparent); }
.nl-chip__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.nl-note {
  font-size: 12.5px; line-height: 1.5; color: var(--brand);
  background: var(--brand-tint); border-left: 2px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 9px 12px; margin: 14px 0 0;
}
.nl-note--warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, transparent); border-left-color: var(--warning); }

/* ---- theme selector (§3) --------------------------------------------------*/
.nl-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-full); flex-wrap: wrap; }
.nl-seg button {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .03em; cursor: pointer;
  color: var(--text-muted); background: transparent; border: 0; padding: 8px 14px;
  border-radius: var(--radius-full); transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nl-seg button:hover { color: var(--text-body); }
.nl-seg button.is-active { color: var(--text-on-brand); background: var(--grad-brand); }

/* ---- code-block component (§9) --------------------------------------------*/
.nl-cb { margin-top: 16px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--code-border); background: var(--code-bg); }
.nl-cb__head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--code-border); background: color-mix(in srgb, var(--surface-card) 60%, transparent); flex-wrap: wrap; }
.nl-cb__tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nl-cb__tab {
  font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; color: var(--text-muted);
  background: transparent; border: 0; padding: 5px 11px; border-radius: var(--radius-full);
  position: relative; transition: color var(--dur-fast) var(--ease-out);
}
.nl-cb__tab:hover { color: var(--text-body); }
.nl-cb__tab.is-active { color: var(--brand); }
.nl-cb__tab.is-active::after { content:""; position:absolute; left:11px; right:11px; bottom:-1px; height:2px; background:var(--grad-brand); }
.nl-cb__actions { display: flex; gap: 6px; }
.nl-cb__btn {
  font-family: var(--font-mono); font-size: 11px; cursor: pointer; color: var(--text-muted);
  background: transparent; border: 1px solid var(--border-subtle); padding: 5px 10px; border-radius: var(--radius-full);
  display: inline-flex; gap: 6px; align-items: center; transition: all var(--dur-fast) var(--ease-out); text-decoration: none;
}
.nl-cb__btn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); background: var(--brand-tint); text-decoration: none; }
.nl-cb__btn.is-copied { color: var(--brand); border-color: var(--brand); }
.nl-cb pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.nl-cb code { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: var(--code-text); white-space: pre; font-variant-numeric: tabular-nums; }
.nl-cb code .kw { color: var(--code-kw); }
.nl-cb code .str { color: #7fe3c0; }
.nl-cb code .cm { color: var(--code-comment); font-style: italic; }
.nl-cb code .num { color: #9ad7ff; }
.nl-cb__cap { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); padding: 8px 18px; border-top: 1px solid var(--code-border); }
.nl-cb__why { font-family: var(--font-sans); font-size: 12.5px; color: var(--brand); padding: 0 18px 12px; }
.nl-cb__missing { padding: 16px 18px; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

/* ---- tables (§6, §8) ------------------------------------------------------*/
.nl-tablewrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); margin-top: 16px; }
.nl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nl-table th {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); text-align: left; padding: 11px 14px; background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-subtle); white-space: nowrap;
}
.nl-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text-body); white-space: nowrap; }
.nl-table tr:last-child td { border-bottom: 0; }
.nl-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.nl-table tbody tr:hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.nl-table .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.nl-table .amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-strong); }
.nl-table .is-live { box-shadow: inset 2px 0 0 var(--brand); }

.nl-pill { font-family: var(--font-mono); font-size: 10.5px; padding: 3px 9px; border-radius: var(--radius-full); border: 1px solid; display: inline-block; }
.nl-pill--nmi { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 34%, transparent); background: var(--brand-tint); }
.nl-pill--mav { color: var(--card-present); border-color: color-mix(in srgb, var(--card-present) 34%, transparent); background: color-mix(in srgb, var(--card-present) 12%, transparent); }
.nl-pill--settled { color: var(--brand); }
.nl-pill--pending { color: var(--warning); }
.nl-pill--returned { color: var(--error); }
.nl-join-hl { color: var(--join-key); font-weight: 700; }

/* sample badge */
.nl-sample {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--card-present); background: color-mix(in srgb, var(--card-present) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-present) 34%, transparent);
  border-radius: var(--radius-full); padding: 6px 12px; display: inline-flex; gap: 8px; align-items: center;
}
.nl-sample__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--card-present); }
.nl-section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---- POS screen (§7) ------------------------------------------------------*/
.nl-pos { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; }
@media (max-width: 980px) { .nl-pos { grid-template-columns: 1fr; } }
.nl-order__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.nl-order__num { font-family: var(--font-mono); font-size: 16px; color: var(--text-strong); }
.nl-order__cust { font-size: 12.5px; color: var(--text-muted); }
.nl-lineitems { border-top: 1px solid var(--border-subtle); }
.nl-li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13.5px; }
.nl-li span:first-child { color: var(--text-body); }
.nl-li .q { color: var(--text-faint); font-family: var(--font-mono); font-size: 12px; }
.nl-li .amt { font-family: var(--font-mono); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.nl-li--total { font-weight: 700; border-bottom: 0; padding-top: 14px; }
.nl-li--total span:first-child { color: var(--text-strong); }
.nl-li--total .amt { color: var(--brand); font-size: 18px; }

.nl-paytabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 18px; }
.nl-paytab {
  font-family: var(--font-sans); font-weight: 600; font-size: 13px; cursor: pointer;
  color: var(--text-muted); background: transparent; border: 0; padding: 12px 16px; position: relative;
  transition: color var(--dur-fast) var(--ease-out);
}
.nl-paytab:hover { color: var(--text-body); }
.nl-paytab.is-active { color: var(--brand); }
.nl-paytab.is-active::after { content:""; position:absolute; left:14px; right:14px; bottom:-1px; height:2px; background:var(--grad-brand); }
.nl-paypane { display: none; }
.nl-paypane.is-active { display: block; }
.nl-subseg { display: inline-flex; gap: 4px; margin-bottom: 14px; }
.nl-subseg button { font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; color: var(--text-muted); background: var(--surface-sunken); border: 1px solid var(--border-subtle); padding: 7px 12px; border-radius: var(--radius-full); transition: all var(--dur-fast) var(--ease-out); }
.nl-subseg button.is-active { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); background: var(--brand-tint); }

.nl-orderchips { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-subtle); min-height: 30px; }
.nl-converge { margin-top: 16px; }

/* ---- reporting (§8) -------------------------------------------------------*/
.nl-aggs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; margin-top: 16px; }
@media (max-width: 720px) { .nl-aggs { grid-template-columns: repeat(2, 1fr); } }
.nl-agg { background: var(--surface-card); padding: 14px 16px; }
.nl-agg__n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-metric-sm); color: var(--brand); font-weight: 700; }
.nl-agg__l { font-size: 11px; color: var(--text-muted); margin-top: 5px; font-family: var(--font-mono); letter-spacing: .06em; }
.nl-deposit-net { color: var(--brand); font-weight: 700; font-family: var(--font-mono); }
.nl-subhead { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin: 26px 0 0; }

/* ---- footer ---------------------------------------------------------------*/
.nl-footer { border-top: 1px solid var(--border-subtle); padding: 40px 0 60px; margin-top: 40px; text-align: center; }
.nl-footer__lock { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--text-strong); margin-bottom: 12px; }
.nl-footer__disc { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 16px; }
.nl-footer__links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 13px; }

/* utility */
.nl-hidden { display: none !important; }
.nl-spin { width: 14px; height: 14px; border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; border-radius: 50%; animation: nl-spin .7s linear infinite; display: inline-block; }
@keyframes nl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .nl-spin { animation: none; } }

/* fade-in on reveal */
.nl-reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.nl-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .nl-reveal { opacity: 1; transform: none; transition: none; } }

/* connector animation */
@keyframes nl-dash { to { background-position: 200% 0; } }

/* ============================================================================
   10. PLUGINS — "Drop-in plugin code" (SPEC §4e). On existing DS tokens only.
   Premium green code cards + output-format switcher + reconcile dedup hero.
   ========================================================================== */
.nl-plugins { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
/* grid items default to min-width:auto, which lets a wide <pre> blow out the
   column past the viewport — pin to 0 so the code scrolls internally instead. */
.nl-plugin, .nl-plugin__cb { min-width: 0; }
.nl-plugin__cb pre { max-width: 100%; }

/* premium card: extends .nl-cb with a green top edge-light + soft lift */
.nl-plugin__cb { position: relative; margin-top: 0; transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.nl-plugin__cb::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 60%, transparent), color-mix(in srgb, var(--card-present) 50%, transparent), transparent);
  opacity: .7; pointer-events: none;
}
.nl-plugin__cb:hover { border-color: color-mix(in srgb, var(--brand) 28%, var(--code-border)); }

/* the reconcile star gets a little more presence */
.nl-plugin--hero .nl-plugin__cb {
  box-shadow: 0 0 0 1px var(--brand-tint-strong), 0 24px 60px -34px var(--brand-tint-strong);
}
.nl-plugin--hero .nl-plugin__cb::before { opacity: 1; height: 2px; }

.nl-plugin__title {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  color: var(--text-strong); margin-right: 6px; white-space: nowrap;
}

/* ---- output region (Table/JSON/CSV/Ledger) -------------------------------*/
.nl-out { border-top: 1px solid var(--code-border); background: var(--surface-sunken); }
.nl-out__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: var(--space-4) 18px var(--space-2);
}
.nl-out__lbl {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted);
}
.nl-out__fmt { padding: 3px; }
.nl-out__fmt button { padding: 6px 12px; font-size: 11.5px; }
.nl-out__body { padding: 0 18px 18px; }
.nl-out__body .nl-tablewrap { margin-top: 0; }
.nl-out__table { background: var(--code-bg); }
.nl-out__table th { background: color-mix(in srgb, var(--surface-card) 60%, transparent); }
.nl-out__table td { color: var(--text-body); }
.nl-out__json, .nl-out__csv {
  margin: 0; padding: 14px 16px; background: var(--code-bg);
  border: 1px solid var(--code-border); border-radius: var(--radius-md); overflow-x: auto;
}
.nl-out__json code, .nl-out__csv code {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--code-text);
  white-space: pre; font-variant-numeric: tabular-nums;
}
.nl-out__json code .kw { color: var(--code-kw); }
.nl-out__json code .str { color: #7fe3c0; }
.nl-out__json code .num { color: #9ad7ff; }

/* ---- ledger view ---------------------------------------------------------*/
.nl-ledger {
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: var(--radius-md); padding: 6px 16px;
}
.nl-ledger__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--border-subtle);
}
.nl-ledger__row:last-child { border-bottom: 0; }
.nl-ledger__lbl { font-family: var(--font-mono); font-size: 12px; color: var(--text-body); }
.nl-ledger__amt { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nl-ledger__total { border-top: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); border-bottom: 0; margin-top: 2px; }
.nl-ledger__total .nl-ledger__lbl { color: var(--text-strong); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.nl-ledger__total .nl-ledger__amt { color: var(--brand); font-weight: 700; font-size: 15px; }

/* ---- semantic cell flags (color is never the ONLY signal — text carries it)*/
.nl-cell--dup { color: var(--error); }
.nl-cell--join { color: var(--join-key); }
.nl-cell--present { color: var(--card-present); }
.nl-tr--dup td { background: color-mix(in srgb, var(--error) 9%, transparent); }
.nl-tr--dup .nl-cell--dup { text-decoration: line-through; }
.nl-tr--join td { background: var(--brand-tint); }
.nl-ledger__row--dup .nl-ledger__amt { text-decoration: line-through; }
.nl-ledger__row--dup { background: color-mix(in srgb, var(--error) 8%, transparent); }
.nl-ledger__row--join { background: var(--brand-tint); }
.nl-ledger__row--present .nl-ledger__lbl { color: var(--card-present); }

/* ---- reconcile dedup ON/OFF hero toggle ----------------------------------*/
.nl-dedup {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; padding: 18px; margin: 0 18px;
  background: var(--surface-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.nl-dedup__toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; border-radius: var(--radius-full); padding: 4px; }
.nl-dedup__toggle:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring); }
.nl-dedup__track {
  width: 46px; height: 26px; border-radius: var(--radius-full); position: relative;
  background: var(--grad-brand); transition: background var(--dur-base) var(--ease-out), filter var(--dur-base) var(--ease-out);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.3);
}
.nl-dedup__knob {
  position: absolute; top: 3px; left: 23px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.35);
  transition: left var(--dur-base) var(--ease-out);
}
.nl-dedup__label { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-body); }
.nl-dedup__label code { color: var(--join-key); }
/* OFF (naive) state */
.is-naive .nl-dedup__track { background: color-mix(in srgb, var(--error) 60%, var(--surface-raised)); }
.is-naive .nl-dedup__knob { left: 3px; }

.nl-dedup__totals { display: flex; gap: 10px; }
@media (max-width: 640px) { .nl-dedup { flex-direction: column; align-items: stretch; } .nl-dedup__totals { width: 100%; } .nl-dedup__total { flex: 1; } }
.nl-dedup__total {
  text-align: right; padding: 8px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); background: var(--surface-card); opacity: .5;
  transition: opacity var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.nl-dedup__total.is-active { opacity: 1; }
.nl-dedup__total[data-side="with"].is-active { border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-tint); }
.nl-dedup__total[data-side="without"].is-active { border-color: color-mix(in srgb, var(--error) 45%, transparent); background: color-mix(in srgb, var(--error) 10%, transparent); }
.nl-dedup__n { display: block; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: clamp(20px, 3.2vw, 28px); font-weight: 700; line-height: 1; color: var(--brand); }
.nl-dedup__total[data-side="without"] .nl-dedup__n { color: var(--error); }
.nl-dedup__l { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; }
.nl-dedup__n.is-flip { animation: nl-flip var(--dur-base) var(--ease-out); }
@keyframes nl-flip { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nl-dedup__n.is-flip { animation: none; } .nl-dedup__knob, .nl-dedup__track { transition: none; } }
.nl-dedup__cap { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); padding: 10px 18px 0; margin: 0; }
.nl-dedup__cap code { color: var(--join-key); }

/* ---- "interactive examples" honesty banner -------------------------------*/
.nl-democ {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.55; color: var(--text-body);
  background: var(--brand-tint); border: 1px solid var(--brand);
  border-radius: var(--radius-md, 12px); padding: 12px 16px; margin: 0 0 22px;
}
.nl-democ b { color: var(--brand-bright); font-weight: 700; }
.nl-democ .nl-mono, .nl-democ code { font-family: var(--font-mono); }
.nl-democ__dot {
  flex: none; width: 9px; height: 9px; margin-top: 5px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint-strong);
}

/* ============================================================================
   §3 — LIVE FIELD-RESTYLE PREVIEW (the signature delight moment).
   A faux "checkout" frame whose surface, labels, fields and pay-button are all
   driven by --cj-* custom properties set by applyPreviewTheme(). The mock card
   fields are real <input class="nl-input cj-input">, so native ::placeholder /
   :focus apply directly. Honest: this is a STYLING preview — values mirror the
   live CollectJS.configure JSON exactly.
   ========================================================================== */
.cj-preview { transition: background var(--dur-base) var(--ease-out); }
.cj-checkout {
  background: var(--cj-surface, var(--surface-card));
  border: 1px solid var(--cj-border, var(--border-default));
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-md), var(--shadow-edge);
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.cj-checkout__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cj-checkout__brand { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--cj-surface-text, var(--text-strong)); transition: color var(--dur-base) var(--ease-out); }
.cj-checkout__lock { font-family: var(--font-mono); font-size: 11px; color: var(--cj-label, var(--text-muted)); transition: color var(--dur-base) var(--ease-out); }
.cj-preview .cj-lbl { color: var(--cj-label, var(--text-muted)); transition: color var(--dur-base) var(--ease-out); }

/* the mock card fields + the amount/order inputs take the preset's field styling */
.cj-preview .cj-input, .cj-preview .cj-amount {
  color: var(--cj-fg, var(--text-strong));
  background: var(--cj-bg, var(--surface-raised));
  font-family: var(--cj-font, var(--font-sans));
  font-size: var(--cj-size, 14px);
  border-color: var(--cj-border, var(--border-default));
  transition: color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.cj-preview .cj-input::placeholder, .cj-preview .cj-amount::placeholder { color: var(--cj-ph, var(--text-faint)); }
.cj-preview .cj-input:focus, .cj-preview .cj-amount:focus {
  outline: 0; color: var(--cj-focus-fg, var(--text-strong));
  border-color: transparent; box-shadow: var(--cj-focus-ring, 0 0 0 3px rgba(0,225,140,.30));
}
/* valid/invalid: JS toggles .is-valid/.is-invalid on the card-number field */
.cj-preview .cj-input.is-valid { color: var(--cj-valid, var(--brand)); }
.cj-preview .cj-input.is-invalid { color: var(--cj-invalid, var(--error)); border-color: var(--cj-invalid, var(--error)); }
.cj-preview .cj-pay {
  background: var(--cj-pay-bg, var(--grad-brand)); color: var(--cj-pay-text, var(--text-on-brand));
  border: 0; box-shadow: none;
  transition: filter var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.cj-preview .cj-pay:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* delight: a brief ring sweep when the preset changes */
@keyframes cj-restyle-flash { 0% { box-shadow: var(--shadow-md), 0 0 0 3px var(--cj-focus-ring, rgba(0,225,140,.30)); } 100% { box-shadow: var(--shadow-md), var(--shadow-edge); } }
.cj-preview.is-restyle .cj-checkout { animation: cj-restyle-flash var(--dur-slow) var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .cj-preview, .cj-checkout, .cj-checkout__brand, .cj-checkout__lock,
  .cj-preview .cj-input, .cj-preview .cj-amount, .cj-preview .cj-lbl, .cj-preview .cj-pay { transition: none; }
  .cj-preview.is-restyle .cj-checkout { animation: none; }
  .cj-preview .cj-pay:hover { transform: none; }
}

/* ============================================================================
   §2 — PER-CALL DETAIL disclosure (.nl-cd*). Built only on existing tokens.
   Native <details>/<summary> — keyboard + SR accessible, no JS toggle.
   ========================================================================== */
.nl-cd {
  border-top: 1px solid var(--code-border);
  background: color-mix(in srgb, var(--surface-card) 40%, transparent);
}
.nl-cd[open] { background: color-mix(in srgb, var(--surface-card) 55%, transparent); }
.nl-cd__sum {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer;
  list-style: none; padding: 11px 18px; user-select: none;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nl-cd__sum::-webkit-details-marker { display: none; }
.nl-cd__sum:hover { color: var(--text-body); background: color-mix(in srgb, var(--brand) 4%, transparent); }
.nl-cd__sum:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--ring); }
.nl-cd__verb {
  font-weight: 700; font-size: 10px; letter-spacing: .08em; color: var(--brand);
  background: var(--brand-tint); border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  border-radius: var(--radius-sm); padding: 3px 7px; flex: none;
}
.nl-cd__ep { color: var(--text-body); font-size: 11.5px; word-break: break-all; }
.nl-cd__auth { color: var(--text-faint); font-size: 10.5px; }
.nl-cd__chev { margin-left: auto; color: var(--brand); transition: transform var(--dur-base) var(--ease-out); }
.nl-cd[open] .nl-cd__chev { transform: rotate(90deg); }
.nl-cd__body { padding: 4px 18px 18px; display: grid; gap: 16px; }
.nl-cd__block { display: block; }
.nl-cd__h {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 8px;
}
.nl-cd__tw { margin-top: 0; }
.nl-cd__params { font-size: 12px; }
.nl-cd__params th { font-size: 9.5px; padding: 8px 12px; background: var(--surface-sunken); }
.nl-cd__params td { padding: 8px 12px; vertical-align: top; white-space: normal; }
.nl-cd__params .nl-cd__pname { color: var(--code-kw); white-space: nowrap; }
.nl-cd__params .nl-cd__ex { color: var(--text-body); white-space: nowrap; }
.nl-cd__params .nl-cd__note { color: var(--text-muted); font-family: var(--font-sans); font-size: 11.5px; line-height: 1.45; }
.nl-cd__req {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; color: var(--brand);
  background: var(--brand-tint); border-radius: var(--radius-sm); padding: 2px 6px; display: inline-flex; align-items: center; gap: 5px;
}
.nl-cd__req::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.nl-cd__opt { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.nl-cd__opt::before { content: "—"; }
.nl-cd__gotchas { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.nl-cd__gotchas li { font-size: 12px; line-height: 1.5; color: var(--text-body); }
.nl-cd__gotchas li::marker { color: var(--brand); }
.nl-cd__joinwrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.nl-cd__join {
  font-family: var(--font-mono); font-size: 12px; background: var(--code-bg);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  border-radius: var(--radius-sm); padding: 5px 10px;
}
@media (prefers-reduced-motion: reduce) {
  .nl-cd__chev, .nl-cd__sum { transition: none; }
}

/* ============================================================================
   §3 — VISUAL ELEVATION (page-wide). Within the green system; reduced-motion safe.
   ========================================================================== */
/* Hero: soft animated gradient sheen behind the headline (low opacity, slow drift) */
.nl-hero__panel { position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.nl-hero__panel::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 80%; z-index: 0;
  background: var(--grad-brand); opacity: .06; filter: blur(60px);
  background-size: 200% 200%; animation: nl-sheen var(--dur-globe, 24s) var(--ease-in-out, ease-in-out) infinite;
  pointer-events: none;
}
.nl-hero__panel > * { position: relative; z-index: 1; }
@keyframes nl-sheen { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* KPIs: hairline top highlight */
.nl-kpis { box-shadow: var(--shadow-edge); }

/* Section intros: stagger kicker -> h2 -> lede on reveal */
.nl-intro { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); transition-delay: var(--nl-intro-d, 0ms); }
.nl-intro.is-in { opacity: 1; transform: none; }
/* animated underline draws in under the green .spice on h2 reveal */
.nl-h2 .spice { position: relative; }
.nl-h2.nl-intro .spice::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px;
  background: var(--grad-brand); border-radius: 2px; transition: right .6s var(--ease-out) .18s;
}
.nl-h2.nl-intro.is-in .spice::after { right: 0; }
@media (prefers-reduced-motion: reduce) {
  .nl-intro { opacity: 1; transform: none; transition: none; }
  .nl-hero__panel::before { animation: none; }
  .nl-h2.nl-intro .spice::after { transition: none; right: 0; }
}

/* Focus-visible halo on all interactive controls (a11y + polish) */
.nl-btn:focus-visible, .nl-seg button:focus-visible, .nl-paytab:focus-visible,
.nl-cb__tab:focus-visible, .nl-cb__btn:focus-visible, .nl-subseg button:focus-visible {
  outline: 0; box-shadow: 0 0 0 3px var(--ring);
}

/* Freshly-inserted live reporting rows pulse once (brand-tint -> transparent) */
@keyframes nl-rowpulse { 0% { background: var(--brand-tint); } 100% { background: transparent; } }
.nl-table tbody tr.is-live { animation: nl-rowpulse 1.2s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .nl-table tbody tr.is-live { animation: none; } }

/* Glass cards: cohesive rest -> hover depth + brand-tinted border */
.nl-rail { box-shadow: var(--shadow-md); transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
.nl-rail:hover { box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 26%, var(--border-default)); transform: translateY(-2px); }
.nl-rail--present:hover { border-color: color-mix(in srgb, var(--card-present) 30%, var(--border-default)); }
@media (prefers-reduced-motion: reduce) { .nl-rail:hover { transform: none; } }

/* Tables: subtle zebra for scanability */
.nl-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--brand) 2%, transparent); }
.nl-table tbody tr:nth-child(even):hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }

/* Deposit net cell: draw the eye to the payoff number */
.nl-deposit-net { box-shadow: inset 2px 0 0 var(--brand); padding-left: 12px; }

/* ============================================================================
   V5 — MONEY PIPELINE: pending hero + per-sale E2E lifecycle stage trackers.
   Green = done/funded accent · --warning strictly for flags/overdue · --error
   for returns · --card-present teal only on the Maverick rail pill. 60/30/10.
   ========================================================================== */

/* ---- pending / money-in-flight hero (nl-pending) ------------------------- */
.nl-pending { margin-top: 18px; }
.nl-pending__hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 40px;
  padding: 20px 22px; border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--border-default));
  background:
    radial-gradient(120% 140% at 0% 0%, var(--brand-tint) 0%, transparent 60%),
    var(--surface-card);
}
.nl-pending__big { display: flex; flex-direction: column; gap: 3px; }
.nl-pending__n, .nl-pending__fn {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-weight: 700; line-height: 1;
}
.nl-pending__n { font-size: clamp(30px, 6vw, 44px); color: var(--brand); }
.nl-pending__fn { font-size: clamp(22px, 4vw, 30px); color: var(--text-strong); }
.nl-pending__l, .nl-pending__fl {
  font-size: 11.5px; letter-spacing: .04em; color: var(--text-muted);
  margin-top: 4px; text-transform: uppercase; font-family: var(--font-mono);
}
.nl-pending__funded { display: flex; flex-direction: column; gap: 3px; }
.nl-pending__break {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px; margin-top: 14px;
}
.nl-pending__item {
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--surface-sunken); border: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 4px;
}
.nl-pending__item.is-flagged {
  border-color: color-mix(in srgb, var(--warning) 42%, transparent);
  background: color-mix(in srgb, var(--warning) 9%, var(--surface-sunken));
}
.nl-pending__amt {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 18px; font-weight: 700; color: var(--text-strong);
}
.nl-pending__item.is-flagged .nl-pending__amt { color: var(--warning); }
.nl-pending__kind { font-size: 12.5px; color: var(--text-body); font-weight: 600; }
.nl-pending__eta { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.nl-pending__item.is-flagged .nl-pending__eta { color: var(--warning); }
.nl-pending__foot {
  margin: 12px 0 0; font-size: 11.5px; color: var(--text-faint);
  font-family: var(--font-mono); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.nl-pending__flagbadge {
  color: var(--warning); background: color-mix(in srgb, var(--warning) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 34%, transparent);
  border-radius: var(--radius-full); padding: 2px 9px; font-weight: 700; letter-spacing: .03em;
}

/* ---- per-sale stage tracker (nl-track) ----------------------------------- */
.nl-lifecycle { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.nl-track {
  padding: 16px 18px; border-radius: var(--radius-md);
  background: var(--surface-card); border: 1px solid var(--border-subtle);
}
.nl-track--funded { box-shadow: inset 2px 0 0 var(--brand); }
.nl-track--flagged {
  box-shadow: inset 3px 0 0 var(--warning);
  background: color-mix(in srgb, var(--warning) 5%, var(--surface-card));
  border-color: color-mix(in srgb, var(--warning) 28%, var(--border-subtle));
}
.nl-track--returned { box-shadow: inset 3px 0 0 var(--error); }
.nl-track__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px;
}
.nl-track__method { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nl-track__ml { font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.nl-track__acct { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.nl-track__amt {
  margin-left: auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 17px; font-weight: 700; color: var(--text-strong);
}
.nl-track__order { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.nl-track__order--illus { color: var(--text-faint); font-style: italic; }
.nl-track__aging {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em;
  color: var(--text-muted); background: var(--surface-sunken);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-full); padding: 3px 10px;
}
.nl-track__aging.is-flagged {
  color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent);
  border-color: color-mix(in srgb, var(--warning) 34%, transparent); font-weight: 700;
}

/* stage timeline: vertical on mobile, connected horizontal row >=720px */
.nl-track__stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.nl-stage { position: relative; display: flex; gap: 11px; padding: 0 0 16px; }
.nl-stage:last-child { padding-bottom: 0; }
.nl-stage__dot {
  flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; margin-top: 2px;
  background: var(--surface-sunken); border: 2px solid var(--text-faint); position: relative; z-index: 1;
}
/* vertical connector (mobile) */
.nl-stage:not(:last-child)::before {
  content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px;
  background: var(--border-default);
}
.nl-stage__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nl-stage__label { font-size: 12.5px; font-weight: 600; color: var(--text-body); }
.nl-stage__date { font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); }
.nl-stage__detail { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.nl-stage__deposit { font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }
.nl-stage__alert {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 6px; border-radius: 4px;
  background: var(--warning); color: var(--text-on-brand); font-weight: 900; font-size: 11px;
  font-family: var(--font-sans); line-height: 1;
}

/* stage states */
.nl-stage.is-done .nl-stage__dot { background: var(--brand); border-color: var(--brand); }
.nl-stage.is-done:not(:last-child)::before { background: var(--brand); }
.nl-stage.is-done .nl-stage__label { color: var(--text-strong); }
.nl-stage.is-current .nl-stage__dot {
  background: var(--brand-bright); border-color: var(--brand-bright);
  box-shadow: 0 0 0 5px var(--brand-tint-strong);
}
.nl-stage.is-current .nl-stage__label { color: var(--brand-bright); font-weight: 700; }
.nl-stage.is-pending .nl-stage__dot { background: transparent; border-color: var(--text-faint); }
.nl-stage.is-pending .nl-stage__label,
.nl-stage.is-pending .nl-stage__date,
.nl-stage.is-pending .nl-stage__detail { color: var(--text-faint); }
.nl-stage.is-pending:not(:last-child)::before { background: repeating-linear-gradient(var(--border-default) 0 4px, transparent 4px 8px); }
.nl-stage.is-alert .nl-stage__dot { background: var(--warning); border-color: var(--warning); box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 22%, transparent); }
.nl-stage.is-alert .nl-stage__label { color: var(--warning); font-weight: 700; }
.nl-stage.is-returned .nl-stage__dot { background: var(--error); border-color: var(--error); }
.nl-stage.is-returned .nl-stage__label { color: var(--error); font-weight: 700; }

/* current-stage pulse (motion-safe) */
@keyframes nl-stagepulse { 0%,100% { box-shadow: 0 0 0 5px var(--brand-tint-strong); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 8%, transparent); } }
.nl-stage.is-current .nl-stage__dot { animation: nl-stagepulse 2.2s var(--ease-out) infinite; }
@media (prefers-reduced-motion: reduce) { .nl-stage.is-current .nl-stage__dot { animation: none; } }

.nl-track__flagnote { margin-top: 4px; }

/* horizontal connected timeline on wider viewports */
@media (min-width: 720px) {
  .nl-track__stages { flex-direction: row; gap: 0; }
  .nl-stage { flex: 1 1 0; flex-direction: column; gap: 7px; padding: 0 14px 0 0; }
  .nl-stage:last-child { padding-right: 0; }
  .nl-stage__dot { margin-top: 0; }
  .nl-stage:not(:last-child)::before {
    left: 14px; right: -14px; top: 6px; bottom: auto; width: auto; height: 2px;
  }
  .nl-stage.is-done:not(:last-child)::before { background: var(--brand); }
  .nl-stage.is-pending:not(:last-child)::before { background: repeating-linear-gradient(90deg, var(--border-default) 0 4px, transparent 4px 8px); }
  .nl-stage.is-alert:not(:last-child)::before { background: var(--warning); }
  .nl-stage.is-returned:not(:last-child)::before { background: var(--error, #ff6b6b); }
  .nl-stage__body { margin-top: 2px; }
}

/* visually-hidden helper for color-independent state text (WCAG 1.4.1) */
.nl-vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* deposit-row pulse when a lifecycle "funded" link points at it */
.nl-table tbody tr.nl-dep-pulse { animation: nl-rowpulse 1.3s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .nl-table tbody tr.nl-dep-pulse { animation: none; } }

/* ============================================================================
   LEVEL 3 — line-item data section (#level3). Same green system; the only new
   visual is the third "Optional (recommended)" flag (a bright-outline pill) that
   sits between the green Required pill and the muted Optional dash. Required-first
   grouping + a sub-table divider make the must-send set scannable at a glance.
   Framing is requirement/security/audit/dispute only — zero cost language.
   ========================================================================== */

/* why-it-matters strip */
.nl-l3why {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; margin-top: 26px;
}
.nl-l3why__card {
  padding: 18px 18px 16px; border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 9px;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.nl-l3why__card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 26%, var(--border-default)); }
.nl-l3why__tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-tint);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  border-radius: var(--radius-full); padding: 4px 11px; align-self: flex-start;
}
.nl-l3why__txt { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-body); }
@media (prefers-reduced-motion: reduce) { .nl-l3why__card:hover { transform: none; } }

/* generic-builder step list */
.nl-l3steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .nl-l3steps { grid-template-columns: 1fr 1fr; } }
.nl-l3step {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--radius-md);
  background: var(--surface-sunken); border: 1px solid var(--border-subtle);
}
.nl-l3step__n {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--text-on-brand); background: var(--grad-brand);
}
.nl-l3step b { display: block; font-size: 13.5px; color: var(--text-strong); margin-bottom: 3px; }
.nl-l3step span { display: block; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }

/* field tables: req/opt flags + required-first grouping */
.nl-l3group { margin-top: 18px; }
.nl-l3group__h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin: 22px 0 0; padding-bottom: 6px;
}
.nl-l3group--req .nl-l3group__h { color: var(--brand); }
.nl-l3group__count { color: var(--text-faint); letter-spacing: .04em; }
.nl-l3group--req .nl-l3group__h::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
}
.nl-l3group__sub { font-family: var(--font-sans); font-size: 11.5px; text-transform: none; letter-spacing: 0; color: var(--text-muted); margin-left: auto; }

.nl-l3tbl { font-size: 12.5px; }
.nl-l3tbl th { font-size: 9.5px; }
.nl-l3tbl td { padding: 9px 13px; vertical-align: top; white-space: normal; }
.nl-l3tbl .nl-l3__name { color: var(--code-kw); font-family: var(--font-mono); white-space: nowrap; }
.nl-l3tbl .nl-l3__type { color: var(--text-body); font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }
.nl-l3tbl .nl-l3__note { color: var(--text-muted); font-size: 11.5px; line-height: 1.45; }
.nl-l3tbl tbody tr.is-req { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.nl-l3tbl tbody tr.is-req:hover { background: color-mix(in srgb, var(--brand) 7%, transparent); }

/* the three flag visuals (Required green · Optional muted · Optional-recommended bright outline) */
.nl-l3flag {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em;
  border-radius: var(--radius-sm); padding: 2px 7px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.nl-l3flag--req { color: var(--brand); background: var(--brand-tint); }
.nl-l3flag--req::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.nl-l3flag--opt { color: var(--text-faint); }
.nl-l3flag--opt::before { content: "—"; }
.nl-l3flag--rec {
  color: var(--brand-bright);
  border: 1px solid color-mix(in srgb, var(--brand-bright) 40%, transparent);
  background: color-mix(in srgb, var(--brand-bright) 8%, transparent);
}
.nl-l3flag--rec::before { content: ""; width: 5px; height: 5px; border-radius: 50%; border: 1.5px solid var(--brand-bright); }

.nl-l3legend {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  margin-top: 16px; font-size: 11.5px; color: var(--text-muted);
}
.nl-l3legend__item { display: inline-flex; align-items: center; gap: 7px; }
.nl-l3legend__src { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
@media (max-width: 720px) { .nl-l3legend__src { margin-left: 0; flex-basis: 100%; } }

/* gotchas */
.nl-l3gotchas { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
@media (max-width: 880px) { .nl-l3gotchas { grid-template-columns: 1fr; } }
.nl-l3gotcha { display: flex; flex-direction: column; gap: 10px; }
.nl-l3gotcha .nl-pill { align-self: flex-start; }
.nl-l3gotcha__h { margin: 4px 0 0; font-size: 15px; color: var(--text-strong); line-height: 1.35; }
.nl-l3gotcha__txt { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-body); }
.nl-l3gotcha__src { margin: 2px 0 0; font-size: 11px; color: var(--text-faint); }

/* try-it interactive */
.nl-l3try { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 18px; }
@media (max-width: 980px) { .nl-l3try { grid-template-columns: 1fr; } }
.nl-l3item {
  display: grid; grid-template-columns: 1fr 64px 92px; gap: 8px; margin-top: 8px; align-items: end;
}
.nl-l3item .nl-input { font-size: 12.5px; }
.nl-l3item__lbl { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; display: block; }
.nl-l3try__tpl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
@media (max-width: 540px) { .nl-l3try__tpl { grid-template-columns: 1fr; } }
.nl-l3recon {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5;
  border: 1px solid var(--border-subtle); background: var(--surface-sunken); color: var(--text-body);
}
.nl-l3recon.is-ok { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 34%, transparent); background: var(--brand-tint); }
.nl-l3recon.is-bad { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 38%, transparent); background: color-mix(in srgb, var(--warning) 10%, transparent); }
.nl-l3recon b { color: inherit; }
.nl-l3kv {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
  margin: 0; color: var(--code-text);
}
.nl-l3kv .k { color: var(--code-kw); }
.nl-l3kv .nl-l3kv__grp { color: var(--text-faint); display: block; margin-top: 8px; }
