/* Client setup sections — approved design (docs/client-setup-design, PR 20, 2026-10-17). Tracker tokens + BNB purple. */
.cs-sec{--cs-purple:#7c3aed;--cs-tint:#f1eaff;--cs-open:#ccb5f7;background:var(--surface,#fff);border:1px solid var(--border,#e6e4f0);border-radius:14px;margin:10px 0;box-shadow:0 2px 5px #32205b08;color:var(--text,#171528)}
[data-theme="dark"] .cs-sec{--cs-purple:#bda1ff;--cs-tint:#34274c;--cs-open:#68518e;box-shadow:0 2px 5px #00000020}
.cs-sec[open]{border-color:var(--cs-open)}
.cs-sec>summary{list-style:none;display:grid;grid-template-columns:38px minmax(0,1fr) auto 18px;align-items:center;gap:13px;padding:16px 19px;border-radius:14px;cursor:pointer;user-select:none}
.cs-sec>summary::-webkit-details-marker{display:none}
.cs-sec>summary:hover{background:var(--surface-2,#f8f7fc)}
.cs-sec[open]>summary{border-radius:14px 14px 0 0}
.cs-sec>summary:focus-visible{outline:2px solid var(--cs-purple);outline-offset:2px}
.cs-tile{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:var(--cs-tint);color:var(--cs-purple)}
.cs-sec .cs-ic{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.cs-name{min-width:0}
.cs-name strong{display:block;font-size:14px;letter-spacing:-.2px;font-weight:650;line-height:1.4}
.cs-name small{display:block;font-size:11px;color:var(--text-muted,#6b6785);margin-top:3px}
.cs-tag{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:6px;font-size:11px;line-height:1.3;font-weight:500;color:var(--cs-purple);background:var(--cs-tint);white-space:nowrap}
.cs-tag .cs-ic{width:12px;height:12px}
.cs-tags{display:inline-flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px}.cs-tags>[hidden]{display:none}
.cs-chev{width:15px;height:15px;fill:none;stroke:var(--text-muted,#6b6785);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s ease}
.cs-sec[open]>summary>.cs-chev{transform:rotate(180deg);stroke:var(--cs-purple)}
.cs-body{padding:2px 19px 18px;border-top:1px solid var(--border,#e6e4f0)}

/* the tracker's own section content sits inside without its old frame/title (its buttons stay) */
.cs-body>.phase{border:0!important;box-shadow:none!important;background:transparent!important;margin:0!important;padding:0!important;border-radius:0!important}
.cs-body>.phase>.phase-header{display:flex;justify-content:flex-end;align-items:center;gap:6px;padding:8px 0 0!important;border:0!important;background:none!important;min-height:0}
.cs-body>.phase>.phase-header:is(:not(:has(button)),:empty){display:none}
.cs-body>.phase>.phase-header :is(.pname,.ptrack,.ppct,.chev){display:none!important}
html.ui2 #view .cs-body .onboarding-card .phase-body,.cs-body .phase-body{padding:0!important}

/* Onboarding grouped by purpose */
.cs-group-label{font-size:11px;font-weight:650;letter-spacing:.6px;text-transform:uppercase;color:var(--text-muted,#6b6785);margin:16px 0 0}
.cs-group+.cs-group{border-top:1px solid var(--border,#e6e4f0);margin-top:6px}
/* quiet secondary buttons inside the sections (the app's filled purple stays everywhere else) */
html #view .cs-sec .obtn:not(.ghost),html.ui2 #view .cs-sec .obtn:not(.ghost){background:var(--cs-tint);color:var(--cs-purple);border:1px solid transparent;box-shadow:none}
html #view .cs-sec .obtn:not(.ghost):hover,html.ui2 #view .cs-sec .obtn:not(.ghost):hover{background:var(--cs-tint);color:var(--cs-purple);border-color:var(--cs-purple);box-shadow:none;filter:none}
details.cs-admin{margin-top:10px;border-top:1px solid var(--border,#e6e4f0);padding-top:4px}
details.cs-admin>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;min-height:40px;font-size:12px;font-weight:600;color:var(--text-muted,#6b6785)}
details.cs-admin>summary::-webkit-details-marker{display:none}
details.cs-admin>summary::after{content:"";width:6px;height:6px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin:-3px 0 0 4px;transition:transform .15s}
details.cs-admin[open]>summary::after{transform:rotate(225deg);margin-top:3px}

/* E-2 visa: native checkbox as a switch, whole row is the tap target */
.cs-switch-row{display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer;width:100%}
.cs-switch-txt{flex:1;min-width:0}
.cs-switch-txt b{display:block;font-size:13px;font-weight:600}
.cs-switch-txt small{display:block;font-size:11px;color:var(--text-muted,#6b6785);margin-top:2px}
.cs-switch-state{font-size:11px;color:var(--text-muted,#6b6785);min-width:22px;text-align:right}
input.cs-switch{appearance:none;-webkit-appearance:none;position:relative;width:44px;height:26px;flex:0 0 44px;margin:0;border:0;border-radius:30px;background:var(--border,#e6e4f0);cursor:pointer;transition:background .15s}
input.cs-switch::before{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #241d3726;transition:transform .15s}
[data-theme="dark"] input.cs-switch::before{background:#16141f}
input.cs-switch:checked{background:var(--cs-purple,#7c3aed)}
input.cs-switch:checked::before{transform:translateX(18px)}
input.cs-switch:focus-visible{outline:2px solid var(--cs-purple,#7c3aed);outline-offset:2px}

/* phones: tag under the title, no description, comfortable taps, 16px fields */
@media (max-width:640px){
  .cs-sec>summary{grid-template-columns:32px minmax(0,1fr) 16px;gap:9px 10px;padding:15px 13px;min-height:44px}
  .cs-tile{width:32px;height:32px;border-radius:9px;grid-column:1;grid-row:1/3;align-self:start;margin-top:2px}
  .cs-name{grid-column:2;grid-row:1}
  .cs-name small{display:none}
  .cs-sec>summary>.cs-tag{grid-column:2;grid-row:2;justify-self:start;padding:4px 6px}
  .cs-sec>summary>.cs-tags{grid-column:2;grid-row:2;justify-self:start;justify-content:flex-start}.cs-tags>.cs-tag{padding:4px 6px}
  .cs-chev{grid-column:3;grid-row:1/3}
  .cs-body{padding:2px 13px 16px}
  .cs-body :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px}
  .cs-body .obtn{min-height:44px}
}
@media (prefers-reduced-motion:reduce){.cs-chev,input.cs-switch,input.cs-switch::before,details.cs-admin>summary::after{transition:none}}

/* ---- Section content (PR 20 inner layout) ---- */
.cs-content{--cs-soft:var(--surface-2,#faf9fd)}
.cs-sec .cs-i{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.cs-block{padding:16px 0 4px}
.cs-block+.cs-block{border-top:1px solid var(--border,#e6e4f0);margin-top:12px}
.cs-block-label{font-size:11px;letter-spacing:.8px;font-weight:650;text-transform:uppercase;color:var(--text-muted,#6b6785);margin:0 0 10px}
/* document tiles */
.cs-docs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.cs-doc{display:flex;align-items:flex-start;gap:10px;min-width:0;border:1px solid var(--border,#e6e4f0);border-radius:10px;padding:13px;background:var(--surface,#fff);color:inherit;text-decoration:none}
a.cs-doc:hover{border-color:var(--cs-purple)}
.cs-doc>.cs-i:first-child{color:var(--cs-purple);margin-top:1px}
.cs-doc>.cs-i:last-child{width:14px;height:14px;color:var(--text-muted,#6b6785);margin-left:auto;align-self:center}
.cs-doc-main{min-width:0;flex:1;display:block}
.cs-doc-main strong{display:block;font-size:12.5px;font-weight:600}
.cs-doc-main small{display:flex;align-items:center;gap:4px;color:var(--text-muted,#6b6785);font-size:11px;margin-top:3px}
.cs-doc.is-done .cs-doc-main small{color:var(--cs-purple)}
.cs-doc-main small .cs-i{width:12px;height:12px}
.cs-doc-acts{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:9px}
.cs-doc-acts:empty{display:none}
/* invoice summary row (invoices.js adds its chips inside) */
.cs-invoice{display:flex;align-items:center;flex-wrap:wrap;gap:10px 12px;background:var(--cs-soft);border-radius:10px;padding:12px 14px;margin-top:12px}
.cs-invoice .cs-inv-ic{display:inline-flex;color:var(--text-muted,#6b6785)}
.cs-invoice>.onb-label{font-size:12.5px;font-weight:600;width:auto!important;margin-right:2px}
.cs-invoice>.onb-act{display:flex;align-items:center;flex-wrap:wrap;gap:8px;flex:1;min-width:0}
.cs-invoice>.onb-mid:empty{display:none}
.cs-invoice>.onb-paid{margin-left:auto}
.cs-invoice .onb-units input{width:56px}
.cs-legal{margin-top:10px}
/* rows */
.cs-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--border,#e6e4f0)}
.cs-block .cs-row:last-child{border-bottom:0}
.cs-row-main{display:flex;align-items:center;gap:10px;min-width:0}
.cs-row-main>.cs-i{color:var(--text-muted,#6b6785)}
.cs-row-title{display:block;font-size:12.5px;font-weight:500;color:var(--text,#171528)}
.cs-row-sub{display:block;font-size:11px;color:var(--text-muted,#6b6785);margin-top:3px;font-weight:400}
.cs-row-acts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.cs-row-acts select{max-width:100%}
.cs-ok{display:inline-flex;align-items:center;gap:4px;color:var(--cs-purple);font-size:11.5px;font-weight:500}
.cs-ok .cs-i{width:13px;height:13px}
.cs-muted{font-size:11.5px;color:var(--text-muted,#6b6785)}
label.cs-switch-row.cs-row{min-height:60px}
/* quiet buttons */
html #view .cs-sec .cs-btn,html.ui2 #view .cs-sec .cs-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:8px 11px;border:1px solid var(--border,#e6e4f0);border-radius:8px;background:var(--surface,#fff);color:var(--text,#171528);font-size:11.5px;font-weight:500;box-shadow:none;text-decoration:none;cursor:pointer}
html #view .cs-sec .cs-btn:hover,html.ui2 #view .cs-sec .cs-btn:hover{border-color:var(--cs-purple);color:var(--cs-purple);filter:none}
.cs-tools{display:flex;flex-wrap:wrap;gap:8px}
html #view .cs-sec .cs-tools .cs-btn,html.ui2 #view .cs-sec .cs-tools .cs-btn{color:var(--cs-purple)}
.cs-admin-acts{display:flex;flex-wrap:wrap;gap:8px;padding:6px 0 4px}
.cs-note{font-size:11px;color:var(--text-muted,#6b6785);margin:4px 0 2px}
details.cs-admin .onb-note{margin:8px 0 0}
/* business details */
.cs-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:6px}
.cs-info-grid dl{margin:0;min-width:0}
.cs-info-grid dt{color:var(--text-muted,#6b6785);font-size:11px}
.cs-info-grid dd{font-size:12.5px;font-weight:500;margin:4px 0 0;overflow-wrap:anywhere}
.cs-foot{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;padding-top:14px;margin-top:14px;border-top:1px solid var(--border,#e6e4f0);font-size:11px;color:var(--text-muted,#6b6785)}
.cs-foot a{color:var(--cs-purple);font-weight:600}
/* accounts: one row each; the login fields open inside */
details.cs-acct{border-bottom:1px solid var(--border,#e6e4f0)}
details.cs-acct>summary{list-style:none;display:grid;grid-template-columns:34px minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:12px 0;cursor:pointer}
details.cs-acct>summary::-webkit-details-marker{display:none}
.cs-acct-mark{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--border,#e6e4f0);border-radius:9px;background:var(--surface-2,#faf9fd);color:var(--cs-purple);font-weight:650;font-size:13px}
.cs-acct-name{min-width:0}
.cs-tag-s{display:inline-flex;align-items:center;gap:4px;padding:5px 8px;border-radius:6px;font-size:11px;font-weight:500;color:var(--cs-purple);background:var(--cs-tint);white-space:nowrap}
.cs-tag-s .cs-i{width:12px;height:12px}
.cs-tag-s.cs-tag-off{color:var(--text-muted,#6b6785);background:var(--surface-2,#f4f2f8)}
.cs-acct-view{border:1px solid var(--border,#e6e4f0);border-radius:8px;padding:7px 11px;font-size:11.5px;font-weight:500;background:var(--surface,#fff)}
details.cs-acct[open] .cs-acct-view{border-color:var(--cs-purple);color:var(--cs-purple)}
.cs-acct-body{padding:0 0 14px 44px;display:flex;flex-direction:column;gap:8px}
.cs-acct-body>.onb-mid{display:flex!important;gap:10px;flex-wrap:wrap}
.cs-link{font-size:11.5px;font-weight:600;color:var(--cs-purple);text-decoration:none}
@media (max-width:640px){
  .cs-docs{grid-template-columns:1fr}
  .cs-doc{min-height:64px}
  .cs-row{align-items:flex-start;flex-wrap:wrap;gap:9px}
  .cs-row-acts{margin-left:auto}
  .cs-invoice>.onb-paid{margin-left:0}
  .cs-info-grid{grid-template-columns:1fr;gap:14px}
  .cs-tools .cs-btn{flex:1 1 auto}
  html #view .cs-sec .cs-btn,html.ui2 #view .cs-sec .cs-btn,.cs-acct-view{min-height:44px}
  details.cs-acct>summary{grid-template-columns:30px minmax(0,1fr) auto}
  details.cs-acct>summary .cs-acct-view{display:none}
  .cs-acct-body{padding-left:0}
}
/* invoice chips (from invoices.js) inside the invoice row: match the theme */
.cs-invoice :is(.inv-chip,.inv-cardbtn){background:var(--surface,#fff);border:1px solid var(--border,#e6e4f0);color:var(--cs-purple)}
[data-theme="dark"] .cs-invoice :is(.inv-chip,.inv-cardbtn){background:var(--surface,#191527);border-color:var(--border,#312a45);color:var(--cs-purple)}
/* app logos in the account rows (PR 21): neutral light tile in both themes so every mark keeps its contrast */
.cs-acct-mark:has(img.app-logo){padding:0;border:0;overflow:hidden;background:none}
.cs-acct-mark img.app-logo{width:100%;height:100%;object-fit:cover;display:block}

/* Accounts & Logins: two cards across when the section has room, one on phones (Colin, PR 22 follow-up).
   auto-fit on the section's own width, so the sidebar is accounted for; closed cards keep their natural height. */
.cs-accts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,max(380px,calc((100% - 14px)/2))),1fr));gap:14px;align-items:start;padding-top:14px}
.cs-accts details.cs-acct{border:1px solid var(--border,#e6e4f0);border-radius:14px;background:var(--surface,#fff);padding:0 14px;min-width:0}
.cs-accts details.cs-acct[open]{border-color:var(--cs-open,#ccb5f7)}
.cs-accts details.cs-acct>summary{padding:12px 0}
.cs-accts .cs-acct-body{padding:0 0 14px;border-top:1px solid var(--border,#e6e4f0);padding-top:12px}
.cs-accts .cs-acct-body>.onb-mid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));gap:10px}
.cs-accts .acct-field{min-width:0;display:flex;flex-direction:column;gap:5px}
.cs-accts .acct-field input.acct-in{max-width:none!important;width:100%;min-width:0}
.cs-accts .acct-pw{display:flex;align-items:center;gap:4px;min-width:0}
.cs-accts .acct-pw input{flex:1;min-width:0}
@media (max-width:640px){
  .cs-accts{grid-template-columns:1fr}
  .cs-accts .acct-field input.acct-in{font-size:16px}
}

/* Onboarding actions: one heading, aligned controls and readable document links. */
html.ui2 #view .cs-content .cs-invoice{display:grid;grid-template-columns:20px minmax(0,1fr) auto;gap:12px 8px;padding:14px;border:1px solid var(--border);background:var(--cs-soft)}
html.ui2 #view .cs-invoice>.cs-inv-ic{grid-area:1/1;color:var(--cs-purple)}
html.ui2 #view .cs-invoice>.onb-label{grid-area:1/2}
html.ui2 #view .cs-invoice>.onb-paid{grid-area:1/3;margin:0;justify-self:end}
html.ui2 #view .cs-invoice>.onb-act{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) 88px;align-items:end;gap:12px}
html.ui2 #view .cs-invoice .onb-amt,html.ui2 #view .cs-invoice .onb-units{display:flex;flex-direction:column;align-items:stretch;gap:6px;min-width:0;font-size:11px;color:var(--text-muted)}
html.ui2 #view .cs-invoice .onb-amt{grid-column:1}
html.ui2 #view .cs-invoice .onb-units{grid-column:2}
html.ui2 #view .cs-invoice .exp-amt-wrap{width:100%;min-width:0;max-width:none;box-sizing:border-box}
html.ui2 #view .cs-invoice .exp-amt,html.ui2 #view .cs-invoice .onb-units input{width:100%;min-width:0;max-width:none;min-height:44px;box-sizing:border-box;background:var(--surface)}
html.ui2 #view .cs-invoice .inv-chips{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px;min-width:0}
html.ui2 #view .cs-invoice :is(.inv-chip,.inv-cardbtn){min-height:44px;padding:10px 12px;border-radius:8px;white-space:normal;text-align:left;justify-content:center;line-height:1.5;box-shadow:none;font-size:12px;font-weight:600;background:var(--surface);color:var(--cs-purple);border:1px solid var(--border);margin:0}
html.ui2 #view .cs-invoice .inv-chip .st{color:inherit;opacity:1}
html.ui2 #view .cs-invoice>.inv-cardbtn{grid-column:1/-1;justify-self:start}
html.ui2 #view .cs-invoice :is(.inv-chip,.inv-cardbtn):focus-visible{outline:2px solid var(--cs-purple);outline-offset:2px}
html.ui2 #view .cs-invoice>.onb-mid:empty{display:none}
html.ui2 #view .cs-content .ld-row .onb-act{display:flex;gap:8px;flex-wrap:wrap}
html.ui2 #view .cs-content .ld-row .obtn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;width:auto;flex:1 1 120px;border-radius:8px;padding:10px 12px;font-size:12px;line-height:1.4;text-align:center;box-shadow:none}
html.ui2[data-theme="dark"] #view .cs-invoice .inv-paidro.on{color:#8bdfbb}
html.ui2 #view .cs-content .u2r-agreement-party{min-width:0;flex:0 1 400px}
html.ui2 #view .cs-content .u2r-agreement-party label{width:100%;min-width:0}
html.ui2 #view .cs-content .u2r-agreement-party select{width:100%!important;min-height:44px;padding:10px 32px 10px 12px!important;box-sizing:border-box;border:1px solid var(--border);border-radius:8px;background-color:var(--surface);color:var(--text);font-family:inherit}
html.ui2 #view .cs-content .cs-switch-row{display:grid;grid-template-columns:16px minmax(0,1fr) auto 44px;align-items:center;gap:10px;box-sizing:border-box}
html.ui2 #view .cs-content .cs-switch-row>.cs-i{color:var(--text-muted)}
html.ui2 #view .cs-content .cs-switch-row .cs-switch{width:44px;height:26px;min-height:26px;padding:0}
@media(min-width:961px){
 html.ui2 #view .cs-invoice>.onb-act{grid-template-columns:minmax(160px,220px) 88px minmax(0,1fr)}
 html.ui2 #view .cs-invoice .inv-chips{grid-column:3;align-self:end}
}
@media(max-width:640px){
 html.ui2 #view .cs-content .cs-invoice{padding:12px;margin-top:8px}
 html.ui2 #view .cs-invoice .inv-chips{display:grid;grid-template-columns:minmax(0,1fr)}
 html.ui2 #view .cs-invoice :is(.inv-chip,.inv-cardbtn){width:100%;min-width:0}
 html.ui2 #view .cs-content .ld-row{grid-template-columns:20px minmax(0,1fr);gap:10px 8px}
 html.ui2 #view .cs-content .ld-row .onb-act{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-column:1/-1;gap:8px}
 html.ui2 #view .cs-content .ld-row .obtn{width:100%;min-width:0}
 html.ui2 #view .cs-content .ld-row .obtn:first-child{grid-column:1/-1}
 html.ui2 #view .cs-content .u2r-agreement-party{flex-basis:100%;margin:0}
 html.ui2 #view .cs-content .u2r-agreement-party select{font-size:16px}
 html.ui2 #view .cs-content .cs-switch-row{align-items:start;padding:14px 0}
 html.ui2 #view .cs-content .cs-switch-row>.cs-i{margin-top:3px}
 html.ui2 #view .cs-content .cs-switch-state{padding-top:4px}
}
/* Invoice amount: one field like Units (Colin, 2026-10-31: the tinted box showed around the input) */
html.ui2 #view .cs-invoice .exp-amt-wrap{background:var(--surface,#fff);min-height:44px}html.ui2 #view .cs-invoice .exp-amt-wrap .exp-amt{background:transparent;padding-left:6px}
