/* NecheSign heritage palette. Loaded last; the public website is intentionally
   outside this scope. Layout, typography, and responsive gutters stay unchanged.
   :root body.workspace-ui also overrides the earlier route-specific dark colors. */
body.workspace-ui {
  --ink: #243330;
  --muted: #606c65;
  --paper: #f5f3ef;
  --surface: #ffffff;
  --card: #ffffff;
  --green: #137c66;
  --green-soft: #e9f3ee;
  --gold: #80622c;
  --line: #dedfd8;
  --sidebar-color: #eeeee7;
  --success: #196747;
  --success-soft: #e7f2e9;
  --warning: #805c17;
  --warning-soft: #fbf1d9;
  --danger: #a6363f;
  --danger-soft: #fbecef;
  --heritage-action: #1f7d66;
  --heritage-action-ink: #ffffff;
  --heritage-action-hover: #176550;
  --heritage-focus: #258d72;
  --heritage-feature: #e6ede1;
  --heritage-feature-line: #cbdac5;
  --heritage-feature-ink: #2e513b;
  --heritage-feature-muted: #4e6651;
  --heritage-gold: #b58b43;
  --heritage-gold-soft: #f6efdf;
  --heritage-stage: #e8eae4;
  --heritage-overlay: #101c1766;
  color-scheme: light;
  color: var(--ink);
  background: var(--paper);
}

.dark body.workspace-ui {
  --ink: #e3e9e5;
  --muted: #aab6ae;
  --paper: #171f22;
  --surface: #202b2f;
  --card: #202b2f;
  --green: #9dceba;
  --green-soft: #294235;
  --gold: #d1b978;
  --line: #35403f;
  --sidebar-color: #1b2528;
  --success: #a5d4b5;
  --success-soft: #284235;
  --warning: #e1c78f;
  --warning-soft: #413a28;
  --danger: #f2b0b6;
  --danger-soft: #482e34;
  --heritage-focus: #9dceba;
  --heritage-feature: #293b30;
  --heritage-feature-line: #3d4d39;
  --heritage-feature-ink: #d1e2cf;
  --heritage-feature-muted: #b8c9b1;
  --heritage-gold-soft: #373529;
  --heritage-stage: #121c1a;
  --heritage-overlay: #080f0c80;
  color-scheme: dark;
}

/* Shared shell and controls. */
:root body.workspace-ui :focus-visible { outline-color: var(--heritage-focus); }
:root body.workspace-ui .sidebar { background: var(--sidebar-color); color: var(--ink); scrollbar-color: var(--line) transparent; }
:root body.workspace-ui :is(.workspace-switch, .sidebar-user, .sidebar-bottom) { border-color: var(--line); }
:root body.workspace-ui .workspace-switch { background: var(--card); color: var(--ink); }
:root body.workspace-ui :is(.workspace-switch small, .nav-group-label, .sidebar-profile small) { color: var(--muted); }
:root body.workspace-ui :is(.sidebar .nav-link, .sidebar .icon-btn, .sidebar-profile) { color: var(--muted); }
:root body.workspace-ui .sidebar .nav-link:hover { color: var(--ink); background: var(--green-soft); }
:root body.workspace-ui .sidebar .nav-link.active { color: var(--green); background: var(--green-soft); }
:root body.workspace-ui .sidebar-user .avatar { background: var(--green-soft); color: var(--green); }
:root body.workspace-ui .workspace-switch .workspace-icon { background: var(--green-soft); color: var(--green); }
:root body.workspace-ui :is(.brand-n, .mobile-brand .brand-n) { color: var(--gold); background: var(--heritage-gold-soft); }
:root body.workspace-ui .crumb-slash { color: var(--muted); }
:root body.workspace-ui :is(.workspace-body, .auth-page, .auth-main, .recipient-app) { background: var(--paper); color: var(--ink); }
:root body.workspace-ui :is(.btn-primary, .auth-primary, .brand-preview-button, .create-symbol) {
  background: var(--heritage-action);
  border-color: var(--heritage-action);
  color: var(--heritage-action-ink);
}
:root body.workspace-ui :is(.btn-primary, .auth-primary):hover {
  background: var(--heritage-action-hover);
  border-color: var(--heritage-action-hover);
  color: var(--heritage-action-ink);
}
:root body.workspace-ui :is(.btn-secondary, .wp-page .btn-secondary, .auth-secondary) {
  background: var(--card);
  border-color: var(--line);
  color: var(--green);
}
:root body.workspace-ui :is(.btn-secondary, .wp-page .btn-secondary, .auth-secondary):hover {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}
:root body.workspace-ui :is(.link-button, .stat-foot.positive) { color: var(--green); }
:root body.workspace-ui :is(.avatar, .avatar.blue, .avatar.gold) { color: var(--green); background: var(--green-soft); }
:root body.workspace-ui :is(input[type=checkbox], input[type=radio]) { accent-color: var(--heritage-action); }
:root body.workspace-ui :is(.btn-danger, .wp-drawer-danger .btn) { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
:root body.workspace-ui :is(.drawer-shade, .studio-tools-shade, .modal-backdrop) { background: var(--heritage-overlay); }
:root body.workspace-ui .modal-dialog { box-shadow: -8px 8px 40px #00000026; }
@keyframes workspace-shade { from { background: transparent; } to { background: var(--heritage-overlay); } }

/* Overview, agreements, templates, contacts, team, and activity. */
:root body.workspace-ui .wp-action-card {
  background: var(--heritage-feature);
  border-color: var(--heritage-feature-line);
  color: var(--heritage-feature-ink);
}
:root body.workspace-ui .wp-action-card h2 { color: var(--heritage-feature-ink); }
:root body.workspace-ui .wp-action-card p { color: var(--heritage-feature-muted); }
:root body.workspace-ui .wp-action-card .wp-action-count { background: var(--card); color: var(--green); }
:root body.workspace-ui .wp-action-card .btn { background: var(--heritage-action); border-color: var(--heritage-action); color: var(--heritage-action-ink); }
:root body.workspace-ui .wp-action-card .btn:hover { background: var(--heritage-action-hover); border-color: var(--heritage-action-hover); }
:root body.workspace-ui .wp-ai-mark { background: var(--heritage-gold-soft); color: var(--gold); }
:root body.workspace-ui .wp-brief-highlight { background: var(--heritage-gold-soft); color: var(--gold); }
:root body.workspace-ui .wp-brief-highlight p { color: var(--gold); }
:root body.workspace-ui :is(.wp-recent-table td, .wp-worklist-row, .wp-contact-footer, .wp-event-preview) { border-color: var(--line); }
:root body.workspace-ui :is(.wp-list-heading, .wp-role-label, .wp-drawer-tip, .wp-detail-preview) { background: var(--paper); color: var(--muted); }
:root body.workspace-ui :is(.wp-worklist-row.selected, .wp-worklist-row.selected:hover, .wp-worklist-row:hover, .wp-contact-card:hover) { background: var(--green-soft); }
:root body.workspace-ui .wp-contact-card:hover { border-color: var(--green); }
:root body.workspace-ui .wp-file-icon { background: var(--green-soft); border-color: var(--line); color: var(--green); }
:root body.workspace-ui :is(.wp-recipient .avatar, .wp-member-row .avatar, .wp-contact-card .avatar, .wp-activity-row .avatar) { background: var(--green-soft); color: var(--green); }
:root body.workspace-ui .wp-owner-lock,
:root body.workspace-ui .wp-search input::placeholder { color: var(--muted); }
:root body.workspace-ui :is(.wp-detail-timeline>div>span, .wp-event-dot) { background: var(--green); }
:root body.workspace-ui .wp-role-explanation { color: var(--green) !important; }
:root body.workspace-ui .wp-review-note { background: var(--warning-soft); border-color: var(--line); }
:root body.workspace-ui :is(.wp-review-note strong, .wp-review-note p) { color: var(--warning); }
:root body.workspace-ui :is(.wp-contact-agreements>button, .wp-custom-template) { background: var(--card); border-color: var(--line); color: var(--ink); }
:root body.workspace-ui :is(.wp-template-art, .wp-template-art.business, .wp-template-art.people) { background: var(--green-soft); }
:root body.workspace-ui .wp-template-type-icon { color: var(--green); }
:root body.workspace-ui .wp-status { background: var(--green-soft); color: var(--green); }
:root body.workspace-ui :is(.wp-status-review, .status-review) { background: var(--danger-soft); color: var(--danger); }
:root body.workspace-ui :is(.wp-status-waiting, .status-waiting) { background: var(--warning-soft); color: var(--warning); }
:root body.workspace-ui :is(.wp-status-completed, .status-completed, .badge.green) { background: var(--success-soft); color: var(--success); }
:root body.workspace-ui :is(.wp-status-draft, .status-draft) { background: var(--green-soft); color: var(--green); }

/* Account settings, subscription billing, and help. */
:root body.workspace-ui .admin-toggle-row input[type=checkbox] { background: var(--muted); border-color: var(--muted); }
:root body.workspace-ui .admin-toggle-row input[type=checkbox]:checked { background: var(--heritage-action); border-color: var(--heritage-action); }
:root body.workspace-ui .subscription-summary { border-top-color: var(--heritage-gold); }
:root body.workspace-ui .usage-meter progress::-webkit-progress-value { background: var(--heritage-action); }
:root body.workspace-ui .usage-meter progress::-moz-progress-bar { background: var(--heritage-action); }
:root body.workspace-ui .plan-option.current { border-color: var(--heritage-gold); }
:root body.workspace-ui .help-article:hover { border-color: var(--green); }
:root body.workspace-ui :is(.create-recipient-number, .create-order-list span) {
  background: color-mix(in srgb, var(--recipient-color) 75%, #000);
  color: #fff;
}

/* Developer console and connected storage. Provider logos retain their colors. */
:root body.workspace-ui :is(.d-demo-note, .d-api-banner) { background: var(--green-soft); border-color: var(--line); color: var(--muted); }
:root body.workspace-ui .d-demo-note strong { color: var(--ink); }
:root body.workspace-ui :is(.d-code-card pre, .d-response pre, .d-modal-code, .d-table-heading, .d-folder-setting) { background: var(--paper); border-color: var(--line); color: var(--muted); }
:root body.workspace-ui :is(.d-hook-row .tag, .d-event-types code) { background: var(--paper); border-color: var(--line); color: var(--green); }
:root body.workspace-ui :is(.d-test-badge, .d-row-actions .icon-btn:hover) { border-color: var(--line); }
:root body.workspace-ui .d-feature-button:hover { border-color: var(--green); box-shadow: 0 4px 16px #12231a0c; }
:root body.workspace-ui :is(.d-log-row:hover, .d-sample-files button:hover) { background: var(--green-soft); border-color: var(--green); }
:root body.workspace-ui .d-integration-top .badge { color: var(--muted); background: var(--paper); border-color: var(--line); }
:root body.workspace-ui .d-integration-top .badge.green { color: var(--success); background: var(--success-soft); border-color: var(--line); }
:root body.workspace-ui :is(.d-banner-icon, .d-api-banner>.btn) { background: var(--card); border-color: var(--line); color: var(--green); }
:root body.workspace-ui .d-status-success { color: var(--success); background: var(--success-soft); border-color: var(--line); }
:root body.workspace-ui .d-status-failed { color: var(--danger); background: var(--danger-soft); border-color: var(--line); }

/* Agreement preparation and review. The old variable names remain compatible. */
:root body.workspace-ui .agreement-studio {
  --studio-blue: var(--green);
  --studio-soft: var(--green-soft);
  --studio-line: var(--line);
}
:root body.workspace-ui :is(.agreement-studio .document-stage, .recipient-document-stage) { background: var(--heritage-stage); border-color: var(--line); }
:root body.workspace-ui .agreement-studio .canvas-toolbar { border-color: var(--line); }
:root body.workspace-ui :is(.agreement-studio .studio-step.active b, .agreement-studio .studio-panel-tabs button.active, .agreement-studio .recipient-selector .avatar) {
  color: var(--heritage-action-ink);
  background: var(--heritage-action);
  border-color: var(--heritage-action);
}
:root body.workspace-ui :is(.agreement-studio .recipient-selector, .agreement-studio .panel-ai, .editor-ai-label) { border-color: var(--line); }
:root body.workspace-ui .agreement-studio .panel-ai { background: var(--heritage-gold-soft); }
:root body.workspace-ui :is(.agreement-studio .panel-ai strong, .agreement-studio .panel-ai button, .editor-ai-label) { color: var(--gold); }
:root body.workspace-ui :is(.agreement-studio .editor-hint, .agreement-studio .panel-ai p) { color: var(--muted); }
:root body.workspace-ui .editor-recipient-select select { color: var(--ink); }
:root body.workspace-ui .editor-recipient-select small { color: var(--muted) !important; }
:root body.workspace-ui .agreement-studio .field-option:hover { border-color: var(--green); }
:root body.workspace-ui :is(.editor-review-document>.icon, .editor-review-recipients .avatar, .editor-send-success>.icon) { color: var(--green); background: var(--green-soft); }
:root body.workspace-ui .editor-readiness { color: var(--success); background: var(--success-soft); border-color: var(--line); }
:root body.workspace-ui .editor-ai-check { color: var(--warning); }
:root body.workspace-ui .editor-ai-check.passed { color: var(--success); }
:root body.workspace-ui .editor-delete { color: var(--danger) !important; }
:root body.workspace-ui .editor-error { color: var(--danger); background: var(--danger-soft); }
:root body.workspace-ui .agreement-studio .studio-panel.tools-open { box-shadow: 0 18px 70px #00000040; }

/* Recipient signing uses the same charcoal shell and quiet surfaces. */
:root body.workspace-ui .recipient-app {
  --recipient-blue: var(--green);
  --recipient-soft: var(--green-soft);
  --recipient-ink: var(--ink);
  --recipient-muted: var(--muted);
  --recipient-line: var(--line);
}
:root body.workspace-ui :is(.recipient-action-card, .recipient-document-toolbar, .recipient-sender-mark, .recipient-demo-tag, .recipient-completion-card, .recipient-change-quote) { background: var(--card); }
:root body.workspace-ui .recipient-preview-select select { background: var(--card) !important; }
:root body.workspace-ui :is(.recipient-person, .recipient-field-list>button:hover) { background: var(--paper); }
:root body.workspace-ui :is(.recipient-person .avatar, .recipient-field-list>button>span:first-child, .recipient-completion-people .avatar, .signature-pending-people .avatar) { background: var(--green-soft); color: var(--green); }
:root body.workspace-ui .recipient-progress { background: var(--line); }
:root body.workspace-ui .recipient-progress>span { background: var(--heritage-action); }
:root body.workspace-ui :is(.recipient-status-icon, .recipient-completion-document>span:first-child) { border-color: var(--line); }
:root body.workspace-ui .recipient-field-list>button { border-color: var(--line); }
:root body.workspace-ui :is(.recipient-field-list>button.done>span:first-child, .recipient-completed-badge) { color: var(--success); background: var(--success-soft); border-color: var(--line); }
:root body.workspace-ui :is(.recipient-field-list>button.done small, .recipient-completion-people>div>.icon, .signature-pending-people .icon) { color: var(--success); }
:root body.workspace-ui .recipient-completion-mark { color: var(--green); background: var(--green-soft); border-color: var(--line); }
:root body.workspace-ui .signature-tabs button[aria-selected=true] { color: var(--heritage-action-ink); background: var(--heritage-action); box-shadow: none; }
:root body.workspace-ui .signature-clear { color: var(--green) !important; }
:root body.workspace-ui .signature-upload-zone { background: var(--paper); border-color: var(--green); }
:root body.workspace-ui .signature-upload-zone:hover { background: var(--green-soft); border-color: var(--green); }
:root body.workspace-ui .signature-upload-zone:focus-within { outline-color: var(--heritage-focus); }
:root body.workspace-ui .signature-upload-icon { background: var(--green-soft); color: var(--green); border-color: var(--line); }
:root body.workspace-ui .signature-upload-zone strong { color: var(--green); }
:root body.workspace-ui .signature-upload-zone>span:last-of-type { color: var(--muted); }
:root body.workspace-ui .signature-upload-error { color: var(--danger); background: var(--danger-soft); border-color: var(--line); }

/* Authentication and onboarding. Decorative agreement sheets stay white. */
:root body.workspace-ui .auth-brand-panel { color: #e3e9e5; background: #202b2f; }
:root body.workspace-ui .auth-brand>span { color: var(--gold); background: var(--heritage-gold-soft); }
:root body.workspace-ui .auth-page .auth-brand-copy>.auth-eyebrow { color: #cdb478; }
:root body.workspace-ui .auth-brand-copy>h1 { color: #e3e9e5; }
:root body.workspace-ui :is(.auth-brand-copy>p, .auth-brand-note, .auth-brand-footer) { color: #b8c6bd; }
:root body.workspace-ui .auth-brand-note>.icon { color: #9dceba; }
:root body.workspace-ui .auth-brand-footer { border-color: #445149; }
:root body.workspace-ui .auth-paper-back { background: #3a5545; border-color: #5d7564; }
:root body.workspace-ui .auth-paper-status { color: var(--success); background: var(--success-soft); border-color: var(--line); box-shadow: 0 4px 15px #0a171324; }
:root body.workspace-ui :is(.auth-heading h2, .auth-heading strong, .auth-label, .auth-use-cases legend, .auth-workspace-identity h3, .auth-workspace-preview-row>strong, .auth-info>strong, .auth-use-case strong, .auth-mobile-brand .auth-brand) { color: var(--ink); }
:root body.workspace-ui :is(.auth-eyebrow, .auth-main .auth-eyebrow, .auth-topbar, .auth-heading>p, .auth-field-help, .auth-form-options, .auth-sample-note, .auth-footer, .auth-back, .auth-divider, .auth-password>button, .auth-info p, .auth-verification-note>span, .auth-verification-note>small, .auth-setup-progress li, .auth-use-case-icon, .auth-use-case small, .auth-remove-invite, .auth-workspace-identity p, .auth-workspace-preview-row>span, .auth-sso-preview>p, .auth-preview-team-note) { color: var(--muted); }
:root body.workspace-ui :is(.auth-topbar>a, .auth-form-options>a, .auth-sample-note button, .auth-text-button, .auth-back:hover, .auth-verification-note>strong, .auth-setup-progress li.active) { color: var(--green); }
:root body.workspace-ui :is(.auth-sso-button, .auth-label>input, .auth-label>select, .auth-password>input, .auth-use-case, .auth-info, .auth-workspace-preview) { color: var(--ink); background: var(--card); border-color: var(--line); }
:root body.workspace-ui :is(.auth-sso-button:hover, .auth-password>button:hover) { background: var(--green-soft); border-color: var(--green); color: var(--green); }
:root body.workspace-ui .auth-label input::placeholder { color: var(--muted); }
:root body.workspace-ui :is(.auth-label input:focus, .auth-label select:focus) { border-color: var(--green); outline-color: var(--green-soft); }
:root body.workspace-ui .auth-divider::before,
:root body.workspace-ui .auth-divider::after { background: var(--line); }
:root body.workspace-ui :is(.auth-state-icon, .auth-workspace-identity>span, .auth-verification-note) { color: var(--green); background: var(--green-soft); border-color: var(--line); }
:root body.workspace-ui .auth-code::placeholder { color: var(--muted) !important; }
:root body.workspace-ui .auth-use-case:has(input:checked) { background: var(--green-soft); border-color: var(--green); box-shadow: none; }
:root body.workspace-ui .auth-use-case:has(input:checked) .auth-use-case-icon { color: var(--green); }
:root body.workspace-ui .auth-use-case>input { accent-color: var(--heritage-action); }
:root body.workspace-ui .auth-setup-progress li>span { color: var(--muted); background: var(--card); border-color: var(--line); }
:root body.workspace-ui .auth-setup-progress li.active>span { background: var(--heritage-action); border-color: var(--heritage-action); color: var(--heritage-action-ink); }
:root body.workspace-ui .auth-setup-progress li.done>span { background: var(--success-soft); color: var(--success); border-color: var(--line); }
:root body.workspace-ui :is(.auth-workspace-identity, .auth-preview-team-note, .auth-mobile-brand) { border-color: var(--line); }
:root body.workspace-ui .auth-mobile-brand .auth-brand>span { background: var(--heritage-gold-soft); color: var(--gold); }
:root body.workspace-ui :is(.auth-error, .auth-remove-invite:hover) { background: var(--danger-soft); border-color: var(--line); color: var(--danger); }

/* Paper is a stable, light surface in both appearances. Its text and fields use
   explicit dark colors so a dark workspace never creates white text on paper. */
:root body.workspace-ui :is(.document-sheet, .wp-paper-preview, .wp-template-paper, .wp-template-drawer-preview, .auth-paper, .signature-type-preview, .signature-upload-preview, .signature-drawing-wrap, .signature-drawer .signature-pad) {
  background: #ffffff;
  color: #243330;
  border-color: #d7ded5;
  color-scheme: light;
}
:root body.workspace-ui :is(.document-sheet, .wp-paper-preview, .wp-template-paper, .auth-paper) { box-shadow: 0 3px 12px #1020181a; }
:root body.workspace-ui :is(.document-sheet h2, .document-sheet h3, .doc-parties strong, .wp-paper-preview h3, .wp-template-paper strong, .wp-template-drawer-preview h2, .recipient-app .signed-name) { color: #243330; }
:root body.workspace-ui :is(.document-sheet p, .document-sheet .doc-overline, .document-sheet .doc-address, .doc-parties span, .document-sheet .doc-disclaimer, .doc-sign-lines span, .doc-page-footer, .wp-template-drawer-preview p, .auth-paper-top, .auth-paper-bottom) { color: #58665c; border-color: #d7ded5; }
:root body.workspace-ui :is(.document-sheet .doc-parties, .signature-drawing-baseline),
:root body.workspace-ui .signature-type-preview::after { border-color: #d7ded5; }
:root body.workspace-ui :is(.wp-paper-preview>span, .wp-template-paper>span) { color: #58665c; border-color: #d7ded5; }
:root body.workspace-ui :is(.wp-paper-preview>i, .wp-template-paper>i, .auth-paper-line, .studio-page-mini i) { background: #e2e8e1; }
:root body.workspace-ui :is(.wp-paper-preview>div, .wp-template-paper>div, .wp-template-drawer-signature) { background: #edf5ef; color: #27684b; border-color: #8eaf99; }
:root body.workspace-ui .studio-page-mini { background: #fff; border-color: #d7ded5; }
:root body.workspace-ui .studio-page-mini b { background: #e9f3ee; border-color: #8eaf99; }
:root body.workspace-ui :is(.auth-paper-top>span:first-child, .auth-paper-signature) { color: #27684b; }
:root body.workspace-ui .auth-paper-bottom .icon { color: #196747; }
:root body.workspace-ui :is(.agreement-studio .signature-field, .recipient-app .signature-field) { background: #edf5eff2; border-color: #518669; color: #27684b; }
:root body.workspace-ui :is(.agreement-studio .signature-field small, .recipient-app .signature-field small) { color: #486952; }
:root body.workspace-ui .agreement-studio .signature-field.selected { outline-color: #258d72; }
:root body.workspace-ui :is(.agreement-studio .signature-field.blue, .recipient-app .signature-field.blue) { background: #f3f3ece8; border-color: #aaa58e; color: #66634f; }
:root body.workspace-ui .recipient-app .signature-field:not(:disabled):hover { background: #deeee3; box-shadow: 0 0 0 3px #258d7226; }
:root body.workspace-ui .recipient-app .signature-field.recipient-field-filled { background: #f4f8f2; border-color: #8eaf99; }
:root body.workspace-ui .signature-upload-preview .link-button { color: #9e3b42; }
