/* Shares the Team workbench tokens, typography and page geometry.
   Preserve redesign: variance 3 / motion 2 / density 7 / assets 1 / brand fidelity 10.
   Keep selectors inside the group workspace so shell controls are unaffected. */
.cg-workbench { padding-bottom:48px; }
body.tm-body.xc-team.tm-workbench.cg-page :is(.tm-nav-label,.tm-nav-caption,.tm-panel-heading > span) { color:var(--ink2); }
html:not(.theme-dark):not(.studio-theme-dark) body.cg-page #creditsCollabVal { color:var(--brand-deep); }
.cg-workbench .cg-eyebrow { margin:0 0 5px; color:var(--ink2); }
.cg-muted { color:var(--ink2); font-size:13px; line-height:1.6; margin:5px 0; }
.cg-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cg-workbench :is(button,.cg-button), #cg-dialog button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; padding:8px 14px; border:1px solid var(--line); border-radius:9px; background:var(--tm-inset); color:var(--ink2); font:inherit; font-size:13px; font-weight:550; line-height:1.55; cursor:pointer; text-decoration:none; white-space:nowrap; transition:transform 140ms ease,opacity 140ms ease; }
.cg-workbench :is(button,.cg-button):hover, #cg-dialog button:hover { color:var(--ink); border-color:var(--ink3); }
.cg-workbench :is(button,.cg-button):active, #cg-dialog button:active { transform:translateY(1px); }
.cg-workbench button:disabled, #cg-dialog button:disabled { opacity:.5; cursor:not-allowed; }
.cg-workbench :is(button,a):focus-visible, #cg-dialog :is(button,a,input,select):focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
.cg-workbench button.cg-primary, #cg-dialog button.cg-primary { background:var(--brand); border-color:transparent; color:var(--panel); }
html:is(.theme-dark,.studio-theme-dark) :is(.cg-workbench,#cg-dialog) button.cg-primary { color:var(--bg); }
.cg-workbench button.cg-primary:hover, #cg-dialog button.cg-primary:hover { opacity:.9; color:var(--panel); }
.cg-workbench button.cg-danger { color:var(--err); background:var(--err-soft); border-color:color-mix(in srgb,var(--err) 25%,transparent); }
.cg-switcher { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:0 0 18px; color:var(--ink2); font-size:12px; }
.cg-switcher label { flex-shrink:0; }
.cg-switcher .tm-select { min-height:38px; width:min(310px,100%); min-width:0; max-width:100%; padding:8px 30px 8px 12px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:var(--tm-inset); font:inherit; font-size:13px; text-overflow:ellipsis; }
.cg-switcher select:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
.cg-switcher .cg-muted { font-size:12px; }
#cg-main { min-width:0; }
#cg-main[aria-busy=true] { opacity:.65; }
.cg-title .tinfo { min-width:0; }
.cg-title h2 { margin:0; font-size:inherit; font-weight:inherit; letter-spacing:inherit; overflow-wrap:anywhere; min-width:0; }
.cg-workbench .cg-rename { min-height:30px; padding:4px 8px; background:transparent; border-color:transparent; font-size:12px; }
.cg-workbench button svg { width:16px; height:16px; flex-shrink:0; }
.cg-title .ts b { color:var(--ink2); font-weight:550; font-variant-numeric:tabular-nums; }
.cg-empty-actions { justify-content:center; }
.cg-badge { display:inline-block; color:var(--brand); background:var(--brand-soft); border:1px solid var(--brand-line); border-radius:99px; padding:3px 9px; font-size:11px; font-weight:500; margin:8px 5px 0 0; white-space:nowrap; }
.cg-balances { display:grid; grid-template-columns:1.3fr repeat(3,minmax(0,1fr)); border:1px solid var(--line); border-radius:14px; background:var(--tm-surface); box-shadow:var(--tm-shadow); margin-bottom:18px; }
.cg-balance { min-width:0; padding:25px 22px; border-right:1px solid var(--line); }
.cg-balance:last-child { border-right:0; }
.cg-balance span, .cg-balance small { color:var(--ink2); font-size:12px; line-height:1.6; }
.cg-balance strong { display:block; margin:18px 0 12px; font-size:32px; font-weight:600; line-height:1.2; font-variant-numeric:tabular-nums; letter-spacing:-.035em; overflow-wrap:anywhere; }
.cg-balance:first-child strong { color:var(--brand); font-size:38px; }
.cg-flow { display:flex; justify-content:space-between; gap:14px; align-items:center; margin-bottom:24px; font-size:12px; line-height:1.8; color:var(--ink2); }
.cg-overview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.cg-info-card { padding:22px; border:1px solid var(--line); border-radius:14px; background:var(--tm-surface); }
.cg-info-card h3 { font-size:15px; font-weight:600; margin:0 0 12px; }
.cg-info-card .cg-muted { margin-bottom:18px; }
.cg-settlement { margin:0 0 28px; padding-top:22px; border-top:1px solid var(--line); }
.cg-transfer-path { display:grid; gap:8px; padding:14px; border:1px solid var(--line); border-radius:9px; background:var(--tm-inset); font-size:13px; overflow-wrap:anywhere; }
.cg-transfer-path span { color:var(--ink2); }
/* Public settings: DESIGN_VARIANCE 3 / MOTION_INTENSITY 2 / VISUAL_DENSITY 4.
   Preserve Team tokens and keep account controls out of node action bars. */
.cg-public-settings { max-width:880px; }
.cg-public-settings > section { padding:4px 0 24px; }
.cg-public-settings > section + section { border-top:1px solid var(--line); padding-top:24px; }
.cg-public-settings h3 { margin:0 0 8px; font-size:16px; font-weight:600; color:var(--ink); }
.cg-payment-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.3fr); gap:20px; margin-top:24px; }
.cg-payment-fields label { display:flex; flex-direction:column; gap:9px; min-width:0; color:var(--ink2); font-size:13px; }
.cg-payment-fields select { width:100%; min-width:0; min-height:42px; padding:10px 30px 10px 12px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:var(--tm-inset); font:inherit; text-overflow:ellipsis; }
.cg-payment-fields select:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
.cg-payment-hint { margin:12px 0 18px; }
.cg-public-rules { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:20px 0; }
.cg-public-rules dt { color:var(--ink2); font-size:12px; margin-bottom:8px; }
.cg-public-rules dd { margin:0; color:var(--ink); font-size:15px; font-variant-numeric:tabular-nums; }
.cg-public-settings .cg-muted + .cg-actions { margin-top:16px; }
.cg-transfer-path strong { font-weight:550; }
.cg-section-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:17px; min-height:32px; }
.cg-section-head h3 { font-size:19px; font-weight:600; letter-spacing:-.02em; margin:0; }
.cg-section-head>.cg-muted { font-size:12px; }
.cg-table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:14px; background:var(--tm-surface); box-shadow:var(--tm-shadow); }
.cg-table { width:100%; border-collapse:collapse; text-align:left; font-size:13px; white-space:nowrap; }
.cg-table th { font-weight:500; color:var(--ink2); font-size:11px; background:var(--tm-inset); padding:12px; border-bottom:1px solid var(--line); }
.cg-table td { padding:14px 12px; border-bottom:1px solid var(--line2); font-variant-numeric:tabular-nums; }
.cg-table tr:last-child td { border-bottom:0; }
.cg-table tbody tr:hover td { background:var(--tm-inset); }
.cg-table td:first-child { min-width:92px; max-width:240px; white-space:normal; overflow-wrap:anywhere; }
.cg-workbench .cg-table button { min-height:34px; padding:6px 11px; font-size:12px; }
.cg-projects { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(235px,100%),1fr)); gap:18px; }
.cg-project { border:1px solid var(--line); border-radius:14px; padding:22px; background:var(--tm-surface); box-shadow:var(--tm-shadow); }
.cg-project h3 { font-size:15px; font-weight:600; margin:0 0 8px; overflow-wrap:anywhere; }
.cg-project p { font-size:12px; line-height:1.6; color:var(--ink2); margin:0 0 18px; }
.cg-empty { border:1px solid var(--line); border-radius:14px; padding:38px 24px; background:var(--tm-surface); text-align:center; color:var(--ink2); font-size:14px; line-height:1.8; }
.cg-empty h2 { color:var(--ink); font-size:23px; font-weight:600; }
.cg-settings { max-width:760px; }
.cg-settings section { padding:20px 0; border-bottom:1px solid var(--line); }
.cg-settings section:first-child { padding-top:0; }
.cg-settings h3 { font-size:15px; font-weight:600; }
.cg-code { font-family:ui-monospace,"Cascadia Mono","Consolas",monospace; overflow-wrap:anywhere; font-size:13px; padding:12px; background:var(--tm-inset); border:1px solid var(--line); border-radius:9px; margin:12px 0; }
.cg-message { padding:14px 18px; background:var(--brand-soft); border:1px solid var(--brand-line); border-radius:12px; margin-bottom:18px; font-size:13px; overflow-wrap:anywhere; }
.cg-error, #cg-dialog .cg-error { color:#b6352c; font-size:13px; }
html:is(.theme-dark,.studio-theme-dark) :is(.cg-error,#cg-dialog .cg-error) { color:var(--err); }
#cg-dialog { color:var(--ink); background:var(--tm-surface); border:1px solid var(--line); border-radius:14px; padding:26px; width:min(460px,calc(100vw - 32px)); box-sizing:border-box; max-height:calc(100dvh - 32px); overflow:auto; box-shadow:var(--tm-shadow); }
#cg-dialog::backdrop { background:rgba(0,0,0,.65); }
.cg-dialog-head, .cg-dialog-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.cg-dialog-head { margin-bottom:18px; }
.cg-dialog-head h2 { font-size:20px; font-weight:600; margin:0; }
#cg-dialog .cg-dialog-head button { min-height:34px; padding:3px 10px; border-color:transparent; background:transparent; font-size:20px; }
.cg-dialog-foot { justify-content:flex-end; margin-top:24px; }
#cg-dialog p { color:var(--ink2); line-height:1.7; }
#cg-dialog label { display:flex; flex-direction:column; gap:8px; font-size:13px; margin:14px 0; }
#cg-dialog :is(input,select) { min-height:38px; padding:9px 12px; background:var(--tm-inset); color:var(--ink); border:1px solid var(--line); border-radius:9px; font:inherit; font-size:13px; width:100%; box-sizing:border-box; }
#cg-dialog input::placeholder { color:var(--ink2); opacity:1; }
#cg-dialog label.cg-check { flex-direction:row; align-items:center; }
#cg-dialog input[type=checkbox] { width:16px; height:16px; min-height:0; padding:0; accent-color:var(--brand); flex-shrink:0; }
.cg-pager { display:flex; justify-content:flex-end; align-items:center; gap:14px; margin-top:15px; font-size:12px; color:var(--ink2); }
@media(max-width:1200px) {
  .cg-balance { padding:22px 16px; }
  .cg-balance strong { font-size:29px; }
  .cg-balance:first-child strong { font-size:33px; }
  .cg-flow { align-items:flex-start; flex-direction:column; }
}
@media(max-width:1024px) {
  .cg-overview-grid { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:640px) {
  .cg-payment-fields { grid-template-columns:minmax(0,1fr); gap:16px; margin-top:18px; }
  .cg-public-rules { grid-template-columns:minmax(0,1fr); gap:14px; }
  .cg-header { align-items:flex-start !important; flex-direction:column; }
  .cg-switcher .tm-select { flex:1; }
  .cg-switcher .cg-muted { width:100%; }
  .cg-balances { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cg-balance { padding:20px 15px; }
  .cg-balance:nth-child(2) { border-right:0; }
  .cg-balance:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .cg-balance strong { font-size:27px; }
  .cg-balance:first-child strong { font-size:31px; }
  .cg-flow .cg-actions { width:100%; }
  .cg-section-head { flex-wrap:wrap; }
  .cg-section-head h3 { font-size:17px; }
  .cg-project { padding:18px; }
  #cg-dialog { padding:20px; }
}
@media(prefers-reduced-motion:reduce) {
  .cg-workbench :is(button,.cg-button), #cg-dialog button { transition:none; }
}
.cg-settlement-inputs { border:0; padding:0; margin:0; min-width:0; }
.cg-settlement-members { max-height:240px; overflow:auto; display:grid; gap:8px; margin:12px 0; }
.cg-settlement-members .cg-check { display:flex; align-items:center; gap:8px; }
.cg-settlement-members small { color:var(--muted); }
#cg-settlement-preview { margin-top:16px; }
#cg-settlement-preview:empty { display:none; }
#cg-settlement-preview p { line-height:1.65; }
