/* Jamesnap.Studio: neutral charcoal theme. The light theme remains in the
   existing stylesheets; this file changes colors only after explicit resolution
   of the user's Light / Dark / System preference. */
html[data-theme="dark"]{
  color-scheme:dark;
  --theme-bg:#171717;
  --theme-surface:#232323;
  --theme-raised:#2e2e2e;
  --theme-line:#3d3d3d;
  --theme-text:#f3f3f3;
  --theme-muted:#b0b0b0;
  --theme-blue:#8ab4ff;
  --theme-blue-fill:#29374e;
  --theme-blue-line:#465c7a;
  --theme-green:#98dfb6;
  --theme-green-fill:#263b30;
  --theme-green-line:#42624e;
  --theme-red:#f2a0ab;
  --theme-red-fill:#422b31;
  --theme-red-line:#70424b;
  --theme-yellow:#e7cc88;
  --theme-yellow-fill:#3c3526;
  --theme-yellow-line:#68583b;
  --theme-purple:#c4afff;
  --theme-purple-fill:#352d48;
  --theme-purple-line:#5d4e76;
  --ink:var(--theme-text);--muted:var(--theme-muted);--line:var(--theme-line);
  --paper:var(--theme-surface);--wash:var(--theme-bg);--cream:var(--theme-raised);
  --green:var(--theme-blue);--green-dark:#accaff;--blue:var(--theme-blue);--red:var(--theme-red);
  background:var(--theme-bg)!important;
}
html[data-theme="dark"] body{
  background:var(--theme-bg)!important;
  background-image:none!important;
  color:var(--theme-text);
}
html[data-theme="dark"] ::selection{background:#3c5986;color:#fff}
html[data-theme="dark"] :is(input,select,textarea){accent-color:#5595ff}
html[data-theme="dark"] :is(input,select,textarea){color-scheme:dark!important}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#a5a5a5!important;opacity:1}

/* Shared surfaces, controls, modal content and search cards. */
html[data-theme="dark"] :is(.topbar,.site-footer){background:var(--theme-bg)!important;border-color:var(--theme-line)!important;color:var(--theme-muted)}
html[data-theme="dark"] :is(.panel,.summary-card,.customer-card,.customer-accordion-card,.customer-directory-panel,.customer-profile-panel,.tax-year-panel,.tax-section,.tax-search-panel,.tax-table-group,.tax-entry-card,.template-dialog,.template-choice,.auth-card,.preview-dialog,.payment-installment-card,.payment-draft-fees article,.payment-draft-summary article){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;box-shadow:0 5px 18px rgba(0,0,0,.12)!important;color:var(--theme-text)}
html[data-theme="dark"] :is(dialog,dialog form,#transaction-form,#customer-form){background:var(--theme-surface)!important;color:var(--theme-text)}
html[data-theme="dark"] :is(.dialog-heading,.dialog-actions,.preview-dialog-header,.preview-dialog-footer,.form-section,.customer-links-editor,.customer-order-history,.customer-items,.customer-orders,.customer-fastwork,.payment-section,.payment-section-heading,.payment-installment-figures,.payment-installment-card footer,.pagination){border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea,.form-select-button,.filter-menu-button,.order-input,.suggestions,.suggestions button){background-color:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text)}
html[data-theme="dark"] :is(input,select,textarea,.form-select-button,.filter-menu-button):is(:focus,:focus-visible){border-color:var(--theme-blue)!important}
html[data-theme="dark"] :is(input,select,textarea):disabled{background:var(--theme-raised)!important;color:var(--theme-muted)!important;-webkit-text-fill-color:var(--theme-muted)}
html[data-theme="dark"] :is(input[readonly],#withholding-tax,#fee,#fee-vat){background-color:var(--theme-raised)!important;color:var(--theme-muted)!important;-webkit-text-fill-color:var(--theme-muted)}
html[data-theme="dark"] #transaction-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea,.form-select-button){background-color:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text)}
html[data-theme="dark"] #transaction-dialog select{color-scheme:dark!important}
html[data-theme="dark"] :is(.secondary,.filter-reset,.filter-toggle,.filter-clear,.filter-menu-close,.customer-edit-button,.customer-toggle-jobs,.tax-list-action,.tax-cell-edit button,.template-use,.template-remove,.icon-button[data-close],#work-link-history-close.icon-button,#refresh-data){background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] :is(.primary,#auth-submit,#auth-retry,#new-transaction,.work-links-auth-prompt>button,.work-links-auth-form button,.work-links-form-actions #work-link-save){background:#3378ef!important;border-color:#3378ef!important;color:#fff!important;-webkit-text-fill-color:#fff}
html[data-theme="dark"] :is(.primary,#auth-submit,#auth-retry,#new-transaction):hover{background:#4187ff!important;border-color:#4187ff!important;color:#fff!important}
html[data-theme="dark"] :is(.secondary,.filter-reset,.filter-toggle,.customer-edit-button,.customer-toggle-jobs,.tax-list-action,.template-use,.icon-button[data-close],#work-link-history-close.icon-button,#refresh-data):hover{background:#383838!important;color:var(--theme-text)!important;border-color:#606060!important}
html[data-theme="dark"] :is(.icon-button,.search-clear-control,.filter-panel-header button){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.text-link,.button-link,.row-actions button,.customer-item-link strong,.customer-order-item strong,.bar-value,.tax-cell-net,.tax-money-net,.recent-net>strong,.net-table-amount){color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.muted,.empty-state,.select-label,.fee-note,.fee-lock-note,.form-help,.field-hint,.customer-contact-note-help,.payment-installment-note,.payment-installment-card footer,.work-link-viewer,.work-links-empty){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.page-heading,.section-heading,.dialog-heading,.panel,.auth-card,.preview-dialog,.customer-card,.customer-accordion-card) :is(h1,h2,h3,h4){color:var(--theme-text)!important}
html[data-theme="dark"] :is(.eyebrow,.form-section h3,.payment-installment-editor-heading small){color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.filters,.filter-panel,.filter-menu-options,.form-select-options,.form-select-menu,.form-select-control,.year-options,.year-picker-options,.year-dropdown,.dashboard-year-control,.tax-year-picker,.chart-date-basis,.tax-search-control,.tax-search-form,.transaction-filter-toolbar,.customer-directory-tools,.tax-directory-tools,.work-links-searchbar){background-color:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] :is(.filter-menu-options,.form-select-options,.form-select-menu,.suggestions,.year-options,.year-picker-options,.year-dropdown){box-shadow:0 12px 28px rgba(0,0,0,.3)!important}
html[data-theme="dark"] :is(.filter-menu-options button,.form-select-options button,.form-select-menu button,.year-options button,.year-picker-options button,.year-dropdown button){background:transparent!important;color:var(--theme-text)!important}
html[data-theme="dark"] :is(.filter-menu-options button,.form-select-options button,.form-select-menu button,.suggestions button,.year-options button,.year-picker-options button,.year-dropdown button):is(:hover,:focus-visible,.is-selected,.selected,[aria-selected="true"]){background:var(--theme-blue-fill)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.active-filter-chip,.filter-chip,.certificate-filter-chip){background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
html[data-theme="dark"] :is(.active-filter-chip,.filter-chip,.certificate-filter-chip) button{color:var(--theme-red)!important}
html[data-theme="dark"] :is(.order-input>span,.fee-lock-note,.upload-box){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #transaction-dialog [data-form-select-control]{--form-picker-bg:var(--theme-raised);--form-picker-border:var(--theme-line);--form-picker-text:var(--theme-text)}
html[data-theme="dark"] #transaction-dialog [data-form-select-control].form-tone-individual{--form-picker-bg:var(--theme-yellow-fill);--form-picker-border:var(--theme-yellow-line);--form-picker-text:var(--theme-yellow)}
html[data-theme="dark"] #transaction-dialog [data-form-select-control]:is(.form-tone-company,.form-tone-line){--form-picker-bg:var(--theme-green-fill);--form-picker-border:var(--theme-green-line);--form-picker-text:var(--theme-green)}
html[data-theme="dark"] #transaction-dialog [data-form-select-control].form-tone-fastwork{--form-picker-bg:var(--theme-blue-fill);--form-picker-border:var(--theme-blue-line);--form-picker-text:var(--theme-blue)}
html[data-theme="dark"] #transaction-dialog [data-form-select-control].form-tone-facebook{--form-picker-bg:var(--theme-purple-fill);--form-picker-border:var(--theme-purple-line);--form-picker-text:var(--theme-purple)}
html[data-theme="dark"] #transaction-dialog [data-form-select-control].form-tone-instagram{--form-picker-bg:var(--theme-red-fill);--form-picker-border:var(--theme-red-line);--form-picker-text:var(--theme-red)}
html[data-theme="dark"] #transaction-dialog [data-form-select-control].form-tone-tiktok{--form-picker-bg:#161616;--form-picker-border:#555;--form-picker-text:#f3f3f3}
html[data-theme="dark"] #transaction-dialog [data-form-select-control] :is(#client-type,#channel,.form-select-button){background-color:var(--form-picker-bg)!important;border-color:var(--form-picker-border)!important;color:var(--form-picker-text)!important;-webkit-text-fill-color:var(--form-picker-text)}
html[data-theme="dark"] #transaction-dialog [data-form-select-control]>.form-select-button>.year-chevron{color:var(--form-picker-text)!important}
html[data-theme="dark"] #transaction-dialog .client-type-control[data-form-select-control]{background-color:var(--form-picker-bg)!important;border-color:var(--form-picker-border)!important}
html[data-theme="dark"] :is(#transaction-form,#customer-form) :is(.form-grid>label,.customer-profile-fields label,.check-label,.customer-edit-name){color:var(--theme-muted)!important}

/* Desktop and mobile navigation keep their geometry and existing motion. */
html[data-theme="dark"] .topbar .navigation-shell .nav-link{color:var(--theme-muted)}
html[data-theme="dark"] .topbar .navigation-shell .nav-link:is(.active,:hover){color:var(--theme-blue)}
html[data-theme="dark"] .topbar .navigation-shell>nav::before{background:var(--theme-blue-fill)}
html[data-theme="dark"] .topbar .navigation-shell>nav:not(.has-nav-indicator)>.nav-link.active{background:var(--theme-blue-fill)}
html[data-theme="dark"] .topbar .navigation-shell>nav.has-nav-indicator>.nav-link.active{background:transparent}
html[data-theme="dark"] :is(.chart-date-basis,.work-links-sort){background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(.chart-date-basis button,.work-links-sort button){color:var(--theme-muted)!important}
/* Distinct blue selection for the chart basis and Work Links sort controls. */
html[data-theme="dark"] :is(.chart-date-basis button[aria-pressed="true"],.work-links-sort button.is-active){color:#d8e9ff!important}
html[data-theme="dark"] #dashboard-view .chart-date-basis::before,
html[data-theme="dark"] #links-view .work-links-sort::before,
html[data-theme="dark"] #dashboard-view .chart-date-basis:not(.has-chart-indicator) button[aria-pressed="true"],
html[data-theme="dark"] #links-view .work-links-sort:not(.has-sort-indicator) button.is-active{background:linear-gradient(145deg,#315f93,#264b76)!important;box-shadow:inset 0 0 0 1px #5689c2,0 2px 8px rgba(0,0,0,.2)!important}
html[data-theme="dark"] #dashboard-view .chart-date-basis.has-chart-indicator button[aria-pressed="true"],
html[data-theme="dark"] #links-view .work-links-sort.has-sort-indicator button.is-active{background:transparent!important}

/* Reference cards: subdued colored surfaces under the original 3D artwork. */
html[data-theme="dark"] #dashboard-view :is(.financial-flow-income,.summary-card.accent){background:linear-gradient(135deg,#2c3a50,#252c37)!important;border-color:var(--theme-blue-line)!important;box-shadow:0 7px 20px rgba(0,0,0,.15)!important}
html[data-theme="dark"] #dashboard-view :is(.financial-flow-net,.net-summary){background:linear-gradient(135deg,#2a3b31,#232f29)!important;border-color:var(--theme-green-line)!important;box-shadow:0 7px 20px rgba(0,0,0,.15)!important}
html[data-theme="dark"] #dashboard-view :is(.financial-flow-income,.financial-flow-net,.summary-card) :is(p,small){color:var(--theme-muted)!important}
html[data-theme="dark"] #dashboard-view :is(.financial-flow-income,.summary-card.accent) strong{color:var(--theme-text)!important}
html[data-theme="dark"] #dashboard-view :is(.financial-flow-net,.net-summary) strong{color:var(--theme-green)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deductions{background:linear-gradient(135deg,#3c3628,#302e28)!important;border-color:var(--theme-yellow-line)!important;box-shadow:0 7px 20px rgba(0,0,0,.15)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deductions-title{color:var(--theme-yellow)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item{background:rgba(35,35,35,.52)!important;border-color:rgba(231,204,136,.16)!important;box-shadow:none!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item+.financial-flow-item{border-left-color:rgba(231,204,136,.16)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item::before,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-card::before{background:linear-gradient(122deg,rgba(255,255,255,.035),transparent 53%,rgba(255,255,255,.06) 56%,transparent 73%)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid strong{color:var(--theme-yellow)!important}
html[data-theme="dark"] #dashboard-view .tracking-overview{background:linear-gradient(135deg,#3d2d34,#30282b)!important;border-color:var(--theme-red-line)!important}
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card{background:transparent!important;border-color:transparent!important;box-shadow:none!important}
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card :is(p,strong,small),
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card::after{color:var(--theme-red)!important}
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card .summary-icon{background:var(--theme-red-fill)!important;color:var(--theme-red)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-income .summary-icon{background:var(--theme-blue-fill)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-net .summary-icon{background:var(--theme-green-fill)!important;color:var(--theme-green)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid .summary-icon{background:var(--theme-yellow-fill)!important;color:var(--theme-yellow)!important}
html[data-theme="dark"] #dashboard-view .financial-flow-card,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-income-summary-group{background:transparent!important;border-color:transparent!important;box-shadow:none!important}
html[data-theme="dark"] :is(.financial-flow-cash,.financial-flow-cash b){background:transparent!important;color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.financial-flow-fee,.fee-summary) :is(p,strong,small){color:var(--theme-yellow)!important}
html[data-theme="dark"] :is(.bar-label,.chart-control-group>small,.bar-value,.chart-axis-label,.chart-value,.chart-empty){color:var(--theme-muted)!important}
html[data-theme="dark"] .bar{background:linear-gradient(#79aaff,#3678ed)}
html[data-theme="dark"] :is(.bar-chart,.chart-panel,.top-customers-panel,.recent-panel,.recent-item,.top-customer){border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(.recent-item time,.recent-date,.recent-job-meta,.recent-job-meta>span,.recent-gross,.recent-gross strong,.recent-gross .deduction-info,.recent-gross .deduction-info b,.top-customer small,.top-customer>span){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.recent-job strong,.recent-job-title,.recent-item>.recent-job>strong,.top-customer strong){color:var(--theme-text)!important}
html[data-theme="dark"] #dashboard-view .recent-job-button{color:var(--theme-text)!important}

/* Rows, customer profiles, tax groups and inline style values. */
html[data-theme="dark"] :is(table,thead,tbody,tr,th,td){border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(th,thead tr,.table-panel>.section-heading,.tax-table-group-head,.tax-table-group>summary,.tax-ledger-company-head,.customer-accordion-header,.customer-profile-head){background:var(--theme-raised)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] :is(td,.tax-data-table td,.transaction-date,.transaction-gross,.job-customer,.customer-job-row time,.customer-job-row>span,.tax-job-row time,.tax-job-row>span){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(tbody tr,.tax-ledger-row,.tax-entry-card,.customer-order-item,.customer-item-link,.customer-job-row,.tax-job-row,.customer-profile-row,.template-choice){background-color:var(--theme-surface)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(tbody tr:nth-child(even),.customer-contact,.customer-profile-note,.customer-profile-empty,.customer-contact-note,.tax-table-group>.tax-table-group-head){background:var(--theme-raised)!important}
html[data-theme="dark"] :is(tbody tr:hover,.tax-ledger-row:hover,.customer-order-item:hover,.customer-item-link:hover){background-color:#303030!important}
html[data-theme="dark"] :is(.job-edit-button,.job-cell strong,.job-customer-name,.customer-card h3,.customer-accordion-name,.customer-accordion-title,.customer-job-main strong,.tax-job-main strong,.tax-cell-job button,.tax-job-edit-button,.tax-table-company h3,.tax-ledger-main,.tax-ledger-company-head h3,.tax-table-totals strong,.tax-ledger-company-head strong,.customer-profile-row span,.customer-profile-row a){color:var(--theme-text)!important}
html[data-theme="dark"] :is(.customer-profile-row strong,.customer-profile-label,.customer-profile-note-title){background:var(--theme-raised)!important;color:var(--theme-muted)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(.customer-profile-row.is-line strong,.customer-profile-row.is-line a){background:var(--theme-green-fill)!important;color:var(--theme-green)!important}
html[data-theme="dark"] :is(.customer-profile-row.is-facebook strong,.customer-profile-row.is-facebook a){background:var(--theme-blue-fill)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.customer-profile-row.is-instagram strong,.customer-profile-row.is-instagram a){background:var(--theme-red-fill)!important;color:var(--theme-red)!important}
html[data-theme="dark"] #tax-view :is(.tax-table-group,.tax-table-group-head,[data-tax-company-toggle]){background-color:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #tax-view .tax-table-group>.tax-table-group-head{background:var(--theme-raised)!important}
html[data-theme="dark"] #tax-view :is(.tax-job-edit-button,.tax-job-edit-button:hover,.tax-job-edit-button:focus-visible){color:var(--theme-text)!important}
html[data-theme="dark"] #tax-view [data-tax-company-toggle]:is(:hover,:focus-visible){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #tax-view :is(.tax-year-status,.tax-table-company>span,.tax-table-totals small,.tax-job-main small,.tax-job-main em,.tax-job-main b,.tax-entry-meta,.tax-search-result-meta,.tax-search-copy,.tax-directory-tools>span){color:var(--theme-muted)!important}
html[data-theme="dark"] #tax-view .tax-simple-group,
html[data-theme="dark"] #tax-view .tax-simple-company,
html[data-theme="dark"] #tax-view .tax-pending-panel{background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #customers-view :is(.customer-accordion-head,.customer-profile-list,.customer-jobs-head){background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #customers-view .customer-accordion-totals>span{background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #customers-view :is(.customer-accordion-totals strong,.customer-accordion-copy h3,.customer-job-main strong){color:var(--theme-text)!important}
html[data-theme="dark"] #customers-view :is(.customer-accordion-copy p,.customer-accordion-totals small,.customer-job-row time,.customer-job-row>span[data-label]::before,.customer-note-text,.customer-note-label){color:var(--theme-muted)!important}
html[data-theme="dark"] #customers-view :is(.customer-jobs-toggle,.customer-edit-button){background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #customers-view .customer-profile-row--line strong{background:var(--theme-green-fill)!important;color:var(--theme-green)!important}
html[data-theme="dark"] #customers-view .customer-profile-row--facebook strong{background:var(--theme-purple-fill)!important;color:var(--theme-purple)!important}
html[data-theme="dark"] #customers-view .customer-profile-row--instagram strong{background:var(--theme-red-fill)!important;color:var(--theme-red)!important}
html[data-theme="dark"] #customers-view .customer-profile-row--note strong{background:var(--theme-raised)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #customer-dialog :is(.customer-links-editor,#customer-fastwork-editor,.customer-fastwork-edit-row){background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #customer-dialog .customer-links-editor :is(h3,p){background:var(--theme-raised)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-card{border-color:var(--theme-line)!important;box-shadow:0 7px 20px rgba(0,0,0,.15)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-total{background:linear-gradient(135deg,#2a3b31,#232f29)!important;border-color:var(--theme-green-line)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-company{background:linear-gradient(135deg,#2c3a50,#252c37)!important;border-color:var(--theme-blue-line)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-individual{background:linear-gradient(135deg,#263c3e,#263034)!important;border-color:#426466!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-withholding{background:linear-gradient(135deg,#3c3628,#302e28)!important;border-color:var(--theme-yellow-line)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid :is(.tax-summary-certificate,.tax-summary-unfiled){background:linear-gradient(135deg,#3d2d34,#30282b)!important;border-color:var(--theme-red-line)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-card :is(p,small){color:var(--theme-muted)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-card>strong{color:var(--theme-text)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-total>strong{color:var(--theme-green)!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-label>span{background:rgba(0,0,0,.16)!important;color:var(--theme-blue)!important}

/* Status and channel identities retain readable semantic colors. */
html[data-theme="dark"] :is(.status.good,.payment-status-badge.payment-paid,.payment-certificate-badge.is-received,.preview-a-certificate-status.is-received,.certificate-status.is-received,.client-kind.company,.preview-a-client-type.company,.channel-line,.is-line dt){background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important;color:var(--theme-green)!important}
html[data-theme="dark"] :is(.status.wait,.payment-status-badge.payment-deposit,.preview-a-certificate-status.is-not-required,.client-kind.individual,.preview-a-client-type.individual,.fee-lock-note){background:var(--theme-yellow-fill)!important;border-color:var(--theme-yellow-line)!important;color:var(--theme-yellow)!important}
html[data-theme="dark"] :is(.payment-status-badge.payment-unpaid,.payment-certificate-badge.is-pending,.preview-a-certificate-status.is-pending,.status.pending,.certificate-status.is-pending,.channel-instagram,.is-instagram dt){background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
html[data-theme="dark"] :is(.payment-certificate-badge.is-none,.status.neutral,.channel-direct,.customer-profile-row.is-note strong,.preview-a-customer-row.is-note dt){background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.channel-fastwork,.fastwork-name-chip,.fastwork-customer-tag,.inline-fastwork-customer,.channel-facebook,.preview-a-channel-customer>b,.preview-a-customer-row.is-facebook dt,.order-chip,.recent-channel-tag.has-fastwork-customer,.customer-accordion-top-fastwork span){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.recent-channel-tag,.recent-mobile-channel,.transaction-mobile-channel):has(.channel-line){background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important;color:var(--theme-green)!important}
html[data-theme="dark"] :is(.recent-channel-tag,.recent-mobile-channel,.transaction-mobile-channel):has(.channel-fastwork){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.recent-channel-tag,.recent-mobile-channel,.transaction-mobile-channel):has(.channel-facebook){background:var(--theme-purple-fill)!important;border-color:var(--theme-purple-line)!important;color:var(--theme-purple)!important}
html[data-theme="dark"] :is(.recent-channel-tag,.recent-mobile-channel,.transaction-mobile-channel):has(.channel-instagram){background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
html[data-theme="dark"] :is(.recent-channel-tag,.recent-mobile-channel,.transaction-mobile-channel):has(.channel-tiktok){background:#111!important;border-color:#555!important;color:#f3f3f3!important}
html[data-theme="dark"] :is(.recent-channel-tag,.recent-mobile-channel,.transaction-mobile-channel):has(.channel-direct){background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #dashboard-view .recent-mobile-channel>.channel-chip{background:transparent!important;border-color:transparent!important;color:inherit!important}
html[data-theme="dark"] #transactions-view #transaction-rows .status[data-toggle-certificate].good{background:var(--theme-green-fill)!important;color:var(--theme-green)!important}
html[data-theme="dark"] :is(.transaction-mobile-net,.transaction-mobile-net strong,.transaction-mobile-net>span,.recent-net strong,.net-table-amount,.tax-cell-net,.tax-money-net){color:var(--theme-blue)!important}
html[data-theme="dark"] #transactions-view :is(.transaction-mobile-job,.transaction-mobile-customer-name){color:var(--theme-text)!important}
html[data-theme="dark"] #transactions-view :is(.transaction-mobile-top time,.transaction-mobile-gross,.transaction-mobile-customer,.transaction-mobile-net small,.transaction-mobile-net::before,.transaction-mobile-gross::before,.transaction-mobile-footer,.transaction-date,.transaction-gross::before,.transaction-gross>strong,.net-table-amount::before){color:var(--theme-muted)!important}
html[data-theme="dark"] #transactions-view #transaction-rows .transaction-card-row{background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #transactions-view #transaction-rows .transaction-mobile-card-cell{background:transparent!important}
html[data-theme="dark"] #transactions-view #transaction-rows .transaction-card-row::after{background:var(--theme-line)!important}

/* Customer details inside the transaction editor. */
html[data-theme="dark"] #transaction-customer-contact{background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)}
html[data-theme="dark"] #transaction-customer-contact .customer-contact-summary{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #transaction-customer-contact .customer-contact-summary:hover{background:#344763!important}
html[data-theme="dark"] #transaction-customer-contact :is(.customer-contact-icon,.customer-contact-optional){background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #transaction-customer-contact :is(.customer-contact-field,.customer-contact-note-help){color:var(--theme-muted)!important}
html[data-theme="dark"] #transaction-form #transaction-customer-contact .customer-contact-field :is(input,textarea){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text)}
html[data-theme="dark"] #transaction-form #transaction-customer-contact .customer-contact-field :is(input,textarea):disabled{background:var(--theme-raised)!important;color:var(--theme-muted)!important;-webkit-text-fill-color:var(--theme-muted)}

/* Financial entry, installments, review fields and read-only totals. */
html[data-theme="dark"] #transaction-form :is(.money-section,#fastwork-card){background:transparent!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #transaction-form .money-gross-control{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important}
html[data-theme="dark"] #transaction-form :is(.money-currency-symbol,.money-gross-control #gross-amount){background:transparent!important;color:var(--theme-blue)!important;-webkit-text-fill-color:var(--theme-blue)}
html[data-theme="dark"] #transaction-form .money-gross-control #gross-amount{border-color:transparent!important}
html[data-theme="dark"] #transaction-form :is(.money-tax-value,.money-tax-value #withholding-tax){background:transparent!important;color:var(--theme-muted)!important;-webkit-text-fill-color:var(--theme-muted)}
html[data-theme="dark"] #transaction-form .money-section .net-field-wide{background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important;color:var(--theme-green)!important}
html[data-theme="dark"] #transaction-form .money-section .net-field-wide #net-amount{background:transparent!important;color:var(--theme-green)!important;-webkit-text-fill-color:var(--theme-green);border-color:transparent!important}
html[data-theme="dark"] :is(.payment-installment-editor,.payment-withholding-toggle,.payment-draft-summary article,.payment-draft-fees article,.payment-installment-figures.has-fastwork-fees>span){background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(.payment-installment-editor-heading h4,.payment-installment-card header strong,.payment-draft-fees strong,.payment-draft-summary strong,.payment-installment-figures strong){color:var(--theme-text)!important}
html[data-theme="dark"] :is(.payment-draft-summary span,.payment-draft-fees span,.payment-installment-figures small,.payment-installment-card header small){color:var(--theme-muted)!important}
html[data-theme="dark"] .payment-draft-summary .payment-draft-outstanding{background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important}
html[data-theme="dark"] .payment-draft-summary .payment-draft-outstanding strong{color:var(--theme-red)!important}
html[data-theme="dark"] .payment-draft-summary article:has(#payment-draft-tax){background:var(--theme-yellow-fill)!important;border-color:var(--theme-yellow-line)!important}
html[data-theme="dark"] #payment-draft-tax{color:var(--theme-yellow)!important}
html[data-theme="dark"] #transaction-form .payment-installment-figures.has-fastwork-fees>span:last-child{background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important}
html[data-theme="dark"] #transaction-form .payment-installment-figures.has-fastwork-fees>span:last-child>strong{color:var(--theme-green)!important}
html[data-theme="dark"] :is(.payment-installment-card [data-payment-edit],#transaction-form .payment-percent-quick button,.fastwork-link-choices button){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.payment-installment-card .payment-delete,#dialog-delete,#delete-customer,.row-actions .delete){background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
html[data-theme="dark"] .pdf-review-field :is(input,select),
html[data-theme="dark"] #transaction-form .money-gross-field.pdf-review-field .money-gross-control{background:var(--theme-yellow-fill)!important;border-color:var(--theme-yellow-line)!important;box-shadow:0 0 0 3px rgba(231,204,136,.10)!important;color:var(--theme-yellow)!important;-webkit-text-fill-color:var(--theme-yellow)}
html[data-theme="dark"] #transaction-form .money-gross-field.pdf-review-field :is(.money-currency-symbol,#gross-amount){background:transparent!important;color:var(--theme-yellow)!important;-webkit-text-fill-color:var(--theme-yellow)}
html[data-theme="dark"] #transaction-form .money-gross-field.pdf-review-field .money-gross-control #gross-amount{border-color:transparent!important;box-shadow:none!important}
html[data-theme="dark"] .pdf-review-hint{color:var(--theme-yellow)!important}

/* Transaction preview: identity, calculation, receipt/certificate and contacts. */
html[data-theme="dark"] :is(.preview-a-identity,.preview-a-summary,.preview-a-payment,.preview-a-outstanding,.preview-a-notes,.preview-summary,.preview-grid>div,.preview-notes){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] :is(.preview-a-identity-copy>strong,.preview-a-calculation strong,.preview-a-payment-grid strong,.preview-grid strong,.preview-notes p,.preview-a-customer-row dd){color:var(--theme-text)!important}
html[data-theme="dark"] :is(.preview-a-identity-label,.preview-a-identity-facts,.preview-a-identity-facts small,.preview-a-identity-facts b,.preview-a-summary header small,.preview-a-payment header small,.preview-a-outstanding header small,.preview-a-calculation small,.preview-a-payment-grid small,.preview-a-outstanding-grid small,.preview-a-payment-details h4,.preview-a-receipt-missing,.preview-a-receipt-empty,.preview-a-certificate-count,.preview-a-net>small,.preview-notes>span,.preview-grid span){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.preview-a-identity-facts,.preview-a-identity-facts>span+span,.preview-a-net,.preview-a-calculation,.preview-a-calculation>span,.preview-a-payment-grid>span,.preview-a-payment-details,.preview-a-certificate,.preview-a-customer-details,.preview-a-customer-row+.preview-a-customer-row){border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(.preview-a-calculation,.preview-a-payment-grid,.preview-a-outstanding-grid){background:var(--theme-raised)!important}
html[data-theme="dark"] .preview-a-calculation>span:not(:first-child)::before{background:var(--theme-raised)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.preview-a-net>strong,.preview-a-receipt-row time,.preview-a-customer-row a,.preview-a-identity-facts time,.preview-a-channel-customer){color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.preview-a-payment-grid>.preview-a-payment-actual,.preview-a-outstanding.is-settled,.preview-grid .preview-net){background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important}
html[data-theme="dark"] :is(.preview-a-payment-grid>.preview-a-payment-actual strong,.preview-a-outstanding.is-settled h3,.preview-a-settled-percent,.preview-grid .preview-net strong){color:var(--theme-green)!important}
html[data-theme="dark"] .preview-a-outstanding:not(.is-settled){background:var(--theme-yellow-fill)!important;border-color:var(--theme-yellow-line)!important}
html[data-theme="dark"] :is(.preview-a-outstanding:not(.is-settled) h3,.preview-a-outstanding-grid>span>strong,.preview-a-outstanding-grid>div>span>strong){color:var(--theme-yellow)!important}
html[data-theme="dark"] .preview-a-section-icon{background:var(--theme-blue-fill)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] .preview-a-payment .preview-a-section-icon,
html[data-theme="dark"] .preview-a-outstanding .preview-a-section-icon{background:var(--theme-yellow-fill)!important;color:var(--theme-yellow)!important}
html[data-theme="dark"] .preview-a-outstanding.is-settled .preview-a-section-icon{background:var(--theme-green-fill)!important;color:var(--theme-green)!important}
html[data-theme="dark"] .preview-a-customer-row dt{background:var(--theme-blue-fill)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] .preview-a-customer-row.is-line dt{background:var(--theme-green-fill)!important;color:var(--theme-green)!important}
html[data-theme="dark"] .preview-a-customer-row.is-instagram dt{background:var(--theme-red-fill)!important;color:var(--theme-red)!important}
html[data-theme="dark"] .preview-a-progress{background:#594d31}
html[data-theme="dark"] .preview-a-progress>span{background:linear-gradient(90deg,#d4b46b,#edce88)}

/* Work Links list and expanded history only; customer-facing Worker is separate. */
html[data-theme="dark"] #links-view{color:var(--theme-text);--work-line:var(--theme-line);--work-muted:var(--theme-muted)}
html[data-theme="dark"] #links-view :is(.work-links-create-card,.work-links-list-card,.work-link-inline-history,.work-links-auth-prompt){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] #links-view :is(.work-links-form label,.work-link-field-heading,.work-links-list-tools>strong,.work-links-search-icon,.work-link-destination-toggle,.destination-toggle,.work-link-stat,.work-link-last-opened,.work-links-status){color:var(--theme-muted)!important}
html[data-theme="dark"] #links-view :is(.work-link-display-name,.row .slug,.linkinfo>.slug,.work-link-name>strong,.work-link-short-url,.work-links-auth-prompt strong){color:var(--theme-text)!important}
html[data-theme="dark"] #links-view :is(.work-link-destination,.destination-detail){color:var(--theme-muted)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #links-view :is(.work-link-actions button,.actions button,#work-link-cancel,#work-links-auth-cancel){background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] #links-view :is(.copy-button,.work-link-actions button[data-work-link-copy],#work-link-generate,.work-link-suggestions button.is-active){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #links-view :is(.actions .danger,.work-link-actions button.is-delete){background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
html[data-theme="dark"] #links-view :is(.actions .is-copied,.work-link-actions button.is-copied){background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important;color:var(--theme-green)!important}
html[data-theme="dark"] #links-view :is(.badge.drive,.work-link-badge.drive){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #links-view :is(.badge.photos,.work-link-badge.photos){background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
html[data-theme="dark"] #links-view .work-link-suggestions{background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #links-view .work-link-suggestions button{background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #links-view .work-link-suggestions button.is-active{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.work-link-history-drawer,.work-link-history-drawer-head,.work-link-history-summary,.work-link-inline-history,.work-link-history-date,.work-link-history-times,.work-link-history-group){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] :is(.work-link-history-heading,.work-link-history-toolbar h3,.work-link-history-date strong,.work-link-history-identity strong,.work-link-history-summary strong,.work-link-history-group li time){color:var(--theme-text)!important}
html[data-theme="dark"] :is(.work-link-history-identity a,.work-link-history-more,.work-link-viewer.is-james,.work-link-history-mark,.work-link-history-summary-icon){color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.work-link-history-identity small,.work-link-history-summary small,.work-link-history-summary p,.work-link-history-empty,.work-link-history-content>p,.work-link-history-date-label span){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.work-link-history-footer,.work-link-history-group li+li,.work-link-history-date-row,.work-link-history-drawer-head){border-color:var(--theme-line)!important}
html[data-theme="dark"] .work-link-history-summary::before{background:var(--theme-line)!important}
html[data-theme="dark"] .work-link-history-manage{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] .work-link-history-manage[aria-pressed="true"]{background:#3378ef!important;border-color:#3378ef!important;color:#fff!important}
html[data-theme="dark"] button.work-link-history-delete{color:var(--theme-red)!important}
html[data-theme="dark"] button.work-link-history-delete.is-all{background:#bf3e44!important;border-color:#bf3e44!important;color:#fff!important}
html[data-theme="dark"] button.work-link-history-delete:not(:disabled):hover{background:var(--theme-red-fill)!important;color:var(--theme-red)!important}
html[data-theme="dark"] button.work-link-history-delete.is-all:not(:disabled):hover{background:#d84b50!important;border-color:#d84b50!important;color:#fff!important}
html[data-theme="dark"] .work-links-skeleton>span{background:linear-gradient(90deg,#2e2e2e 0 24%,#272727 24% 100%)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] .work-link-history-skeleton>span{background:#363636!important}

/* Add/filter sheets, import overlays, notifications and authentication. */
html[data-theme="dark"] :is(.add-action-menu,.add-action-menu-head,.add-action-cancel,.filter-panel-header,.auth-card,.template-list){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] .add-action-menu :is(#add-menu-new,#import-document,#quick-template){background:transparent!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] .add-action-menu :is(.add-action-copy strong,.add-action-item-chevron,.add-action-menu-head strong){color:var(--theme-text)!important}
html[data-theme="dark"] .add-action-menu .add-action-copy small{color:var(--theme-muted)!important}
html[data-theme="dark"] .add-action-menu :is(#add-menu-new,#import-document,#quick-template):is(:hover,:focus-visible){background:var(--theme-raised)!important}
html[data-theme="dark"] .pdf-drop-overlay{background:rgba(23,23,23,.8)!important}
html[data-theme="dark"] .pdf-drop-overlay-frame{border-color:var(--theme-blue)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] .pdf-drop-overlay-frame strong{color:var(--theme-text)!important}
html[data-theme="dark"] .pdf-drop-overlay-frame>span:last-child{color:var(--theme-muted)!important}
html[data-theme="dark"] #toast{background:#3a3a3a;color:var(--theme-text);box-shadow:0 8px 25px rgba(0,0,0,.3)}
html[data-theme="dark"] #toast.is-success{background:#254d37;color:#d2f5df}
html[data-theme="dark"] #toast.is-error{background:#5e3035;color:#ffe0e4}
html[data-theme="dark"] .auth-gate{background:var(--theme-bg)!important}
html[data-theme="dark"] .auth-card :is(h1,label){color:var(--theme-text)!important}
html[data-theme="dark"] .auth-card :is(p,.eyebrow,.auth-copyright){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.auth-message.is-error,.work-links-auth-form>p,.work-links-status.is-error){color:var(--theme-red)!important}
html[data-theme="dark"] .work-links-status.is-success{color:var(--theme-green)!important}
html[data-theme="dark"] :is(.certificate-notification,.certificate-notification-panel,.certificate-notification-popover){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] :is(.certificate-notification-count,.certificate-count,.status-count){background:var(--theme-red-fill)!important;color:var(--theme-red)!important}

@media(max-width:780px){
  html[data-theme="dark"].iphone-interaction-locked #transaction-dialog .client-type-control[data-form-select-control].form-tone-company{--form-picker-border:var(--theme-green-line)}
  html[data-theme="dark"].iphone-interaction-locked #transaction-dialog input[type="checkbox"]:not(:checked){background:var(--theme-raised)!important;border-color:#747474!important}
  html[data-theme="dark"].iphone-interaction-locked #transaction-dialog input[type="checkbox"]:checked{background:#3378ef!important;border-color:#3378ef!important}
  html[data-theme="dark"] .topbar .navigation-shell{background:rgba(38,38,38,.94)!important;border-color:#484848!important;box-shadow:0 4px 20px rgba(0,0,0,.25)!important}
  html[data-theme="dark"] .topbar .navigation-shell::before,
  html[data-theme="dark"] .topbar .navigation-shell:not(.has-mobile-nav-indicator) .nav-link.active{background:linear-gradient(145deg,rgba(255,255,255,.13),rgba(255,255,255,.035) 55%,rgba(190,205,230,.075));box-shadow:0 2px 8px rgba(0,0,0,.18),inset 0 0 0 1px rgba(220,225,235,.2),inset 0 2px 0 rgba(255,255,255,.12)}
  html[data-theme="dark"] #transactions-view section.filters.transaction-filter-toolbar>.filter-panel{background:var(--theme-surface)!important;background-color:var(--theme-surface)!important;border-color:var(--theme-line)!important}
  html[data-theme="dark"].iphone-interaction-locked #transaction-dialog>#transaction-form,
  html[data-theme="dark"].iphone-interaction-locked #transaction-preview-dialog>.preview-dialog{background:var(--theme-surface)!important}
  html[data-theme="dark"].iphone-interaction-locked #iphone-ledger-overlay>dialog[open]:not(#chart-month-dialog){background:transparent!important}
  /* Keep v2.8.33's one-frame compensation and the existing rgba(19,29,47,.46)
     dimmer. Its composite over #171717 is rgb(21.16,25.76,34.04). */
  html[data-theme="dark"].iphone-interaction-locked #mobile-sheet-top-surface{
    background-color:rgb(calc(23 - var(--mobile-sheet-dim-progress) * 1.84) calc(23 + var(--mobile-sheet-dim-progress) * 2.76) calc(23 + var(--mobile-sheet-dim-progress) * 11.04));
    background-image:linear-gradient(rgb(calc(23 - var(--mobile-sheet-page-progress) * 1.84) calc(23 + var(--mobile-sheet-page-progress) * 2.76) calc(23 + var(--mobile-sheet-page-progress) * 11.04)),rgb(calc(23 - var(--mobile-sheet-page-progress) * 1.84) calc(23 + var(--mobile-sheet-page-progress) * 2.76) calc(23 + var(--mobile-sheet-page-progress) * 11.04)));
  }
}

/* Match the existing ID-scoped light rules, including their interaction states. */
html[data-theme="dark"] #transactions-view section.filters.transaction-filter-toolbar,
html[data-theme="dark"] #customers-view .customer-directory-tools,
html[data-theme="dark"] #tax-view>.tax-directory-tools,
html[data-theme="dark"] #links-view .work-links-searchbar{background:var(--theme-raised)!important;border-color:var(--theme-line)!important;box-shadow:0 5px 16px rgba(0,0,0,.12)!important}
html[data-theme="dark"] #transactions-view section.filters.transaction-filter-toolbar:focus-within,
html[data-theme="dark"] #customers-view .customer-directory-tools:focus-within,
html[data-theme="dark"] #tax-view>.tax-directory-tools:focus-within,
html[data-theme="dark"] #links-view .work-links-searchbar:focus-within{border-color:var(--theme-line)!important;box-shadow:0 5px 16px rgba(0,0,0,.12)!important}
html[data-theme="dark"] #customers-view .customer-directory-tools input,
html[data-theme="dark"] #customers-view .customer-directory-tools input:is(:hover,:focus,:focus-visible,:active),
html[data-theme="dark"] #tax-view>.tax-directory-tools input,
html[data-theme="dark"] #tax-view>.tax-directory-tools input:is(:hover,:focus,:focus-visible,:active),
html[data-theme="dark"] #links-view .work-links-search input,
html[data-theme="dark"] #links-view .work-links-search input:is(:hover,:focus,:focus-visible,:active),
html[data-theme="dark"] #links-view .work-links-form input,
html[data-theme="dark"] #links-view .work-links-form input:is(:hover,:focus,:focus-visible,:active),
html[data-theme="dark"] #transactions-view section.filters.transaction-filter-toolbar .filter-search input,
html[data-theme="dark"] #transactions-view section.filters.transaction-filter-toolbar .filter-search input:is(:hover,:focus,:focus-visible,:active){background-color:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text);box-shadow:0 1px 4px rgba(0,0,0,.12)!important}
html[data-theme="dark"] #transactions-view .filter-toggle{background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important;box-shadow:0 1px 4px rgba(0,0,0,.12)!important}
html[data-theme="dark"] #transactions-view .filter-panel-header{background:var(--theme-surface)!important;color:var(--theme-text)!important}
html[data-theme="dark"] :is(#dashboard-year-button,#tax-year-button){background-color:transparent!important;color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.year-chevron,.chart-control-group>small){color:var(--theme-muted)!important}
html[data-theme="dark"] #chart-metric-button,
html[data-theme="dark"] #chart-metric-button:is(:hover,:focus,:focus-visible){background-color:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-blue)!important;box-shadow:0 2px 8px rgba(0,0,0,.18)!important}
html[data-theme="dark"] #tax-view :is(#tax-entry-list,#tax-pending-list,#tax-search-results,.tax-list-header,.tax-pending-panel>.section-heading){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] #tax-view .tax-table-company>div>span,
html[data-theme="dark"] #tax-view .tax-table-totals small{color:var(--theme-muted)!important}
html[data-theme="dark"] #tax-view .tax-table-totals strong,
html[data-theme="dark"] #tax-view .tax-table-company h3{color:var(--theme-text)!important}
html[data-theme="dark"] #tax-view :is(.tax-search-result,.tax-search-result:focus-visible,.tax-search-result:hover){background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] #tax-view :is(.tax-search-result strong,.tax-search-result-job){color:var(--theme-text)!important}
html[data-theme="dark"] #tax-view :is(.tax-search-result small,.tax-search-result-meta,.tax-empty){color:var(--theme-muted)!important}
html[data-theme="dark"] #tax-view .tax-list-action{background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #tax-view .tax-list-action.is-active{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] :is(.certificate-pending,.recent-certificate-status.certificate-pending){background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
html[data-theme="dark"] .recent-certificate-status.good{background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important;color:var(--theme-green)!important}
html[data-theme="dark"] #customers-view .customer-note-label{background:var(--theme-raised)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #customers-view .customer-accordion-meta{border-color:var(--theme-line)!important}
html[data-theme="dark"] #customers-view .customer-accordion-note{background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #customers-view .customer-accordion-note>span{color:var(--theme-text)!important}
html[data-theme="dark"] #customers-view .customer-accordion-note strong{color:var(--theme-muted)!important}
html[data-theme="dark"] #customers-view .customer-accordion-top-fastwork>span{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #customers-view .customer-job-row>span,
html[data-theme="dark"] #customers-view .customer-job-row>span::before{color:var(--theme-muted)!important}
html[data-theme="dark"] #customer-dialog .customer-profile-fields label{color:var(--theme-muted)!important}
html[data-theme="dark"] #customer-dialog .customer-profile-fields input,
html[data-theme="dark"] #customer-dialog .customer-profile-fields textarea{background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important;-webkit-text-fill-color:var(--theme-text)}
html[data-theme="dark"] #transaction-form .payment-installment-empty{background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #transaction-form .payment-installment-empty strong{color:var(--theme-text)!important}
html[data-theme="dark"] #transaction-form .payment-progress{background:var(--theme-raised)!important}
html[data-theme="dark"] #transaction-form .payment-progress>span{background:var(--theme-green)!important}
html[data-theme="dark"] #transaction-form .payment-help{background:var(--theme-yellow-fill)!important;border-color:var(--theme-yellow-line)!important;color:var(--theme-yellow)!important}
html[data-theme="dark"] #transaction-form .pdf-review-field :is(input,select,.form-select-button){background-color:var(--theme-yellow-fill)!important;border-color:var(--theme-yellow-line)!important;color:var(--theme-yellow)!important;-webkit-text-fill-color:var(--theme-yellow);box-shadow:0 0 0 3px rgba(231,204,136,.1)!important}
html[data-theme="dark"] #transaction-form .money-gross-field.pdf-review-field .money-gross-control #gross-amount{background:transparent!important;border-color:transparent!important;box-shadow:none!important}
html[data-theme="dark"] #links-view :is(.work-links-auth-form,.work-links-auth-form input){background-color:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] #links-view :is(.row,.work-link-row,.work-links-list){border-color:var(--theme-line)!important}
html[data-theme="dark"] #links-view .linkinfo>.destination-detail,
html[data-theme="dark"] #links-view .linkinfo>.destination-detail:hover{color:var(--theme-muted)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #links-view :is(.work-link-stats,.work-link-stats small,.work-link-stats strong,.work-links-count){color:var(--theme-muted)!important}
html[data-theme="dark"] #links-view .work-links-search>.work-links-search-icon{color:var(--theme-blue)!important}
html[data-theme="dark"] #links-view .actions .copy,
html[data-theme="dark"] #links-view .actions .copy-button{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #links-view .work-link-suggestions button[aria-pressed="true"]{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #links-view :is(.work-link-history-chevron,.work-link-history-date-chevron,.work-link-history-more-chevron){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.pull-refresh,.desktop-refresh-status){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-blue)!important;box-shadow:0 4px 20px rgba(0,0,0,.2)!important}
html[data-theme="dark"] .topbar .navigation-shell>nav>.nav-link{color:var(--theme-muted)}
html[data-theme="dark"] .topbar .navigation-shell>nav>.nav-link:is(.active,:hover){color:var(--theme-blue)}
@media(max-width:780px){
  html[data-theme="dark"].iphone-interaction-locked #tax-view .tax-job-edit-button:is(:hover,:active,:focus,:focus-visible){background:transparent!important;color:var(--theme-text)!important}
  html[data-theme="dark"].iphone-interaction-locked #tax-view .tax-data-table tbody tr:nth-child(odd):is(:hover,:active){background:var(--theme-surface)!important}
  html[data-theme="dark"].iphone-interaction-locked #tax-view .tax-data-table tbody tr:nth-child(even):is(:hover,:active){background:var(--theme-raised)!important}
}

/* The picker is a direct child of .topbar, outside the mobile bottom nav. */
:root{--theme-control-bg:#fff;--theme-control-raised:#f3f6fb;--theme-control-border:#d6e0ee;--theme-control-text:#425571;--theme-control-muted:#687b98;--theme-control-active:#eaf1ff;--theme-control-accent:#155eef;--theme-control-shadow:rgba(23,43,77,.16)}
html[data-theme="dark"]{--theme-control-bg:#232323;--theme-control-raised:#2e2e2e;--theme-control-border:#3d3d3d;--theme-control-text:#f3f3f3;--theme-control-muted:#b0b0b0;--theme-control-active:#303b4d;--theme-control-accent:#8ab4ff;--theme-control-shadow:rgba(0,0,0,.35)}
.theme-picker{position:relative;z-index:1350;flex:0 0 auto}
.theme-toggle{display:grid;place-items:center;width:40px;height:40px;min-width:40px;margin:0;padding:0;border:1px solid var(--theme-control-border);border-radius:10px;background:var(--theme-control-bg);color:var(--theme-control-text);box-shadow:none;transition:background-color 250ms ease,border-color 250ms ease,color 250ms ease}
.theme-toggle:hover{background:var(--theme-control-raised);color:var(--theme-control-accent)}
.theme-toggle:focus-visible{outline:2px solid var(--theme-control-accent);outline-offset:3px}
.theme-toggle-icon,.theme-option-icon{display:block;width:19px;height:19px;flex:0 0 19px;background:currentColor;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}
.theme-toggle[data-mode="light"] .theme-toggle-icon,.theme-option-icon[data-mode="light"]{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E")}
.theme-toggle[data-mode="dark"] .theme-toggle-icon,.theme-option-icon[data-mode="dark"]{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.5 14.2A8.7 8.7 0 0 1 9.8 3.5a8.7 8.7 0 1 0 10.7 10.7Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.5 14.2A8.7 8.7 0 0 1 9.8 3.5a8.7 8.7 0 1 0 10.7 10.7Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.theme-toggle[data-mode="system"] .theme-toggle-icon,.theme-option-icon[data-mode="system"]{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3.5' width='18' height='13' rx='2' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M8 21h8M12 16.5V21' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3.5' width='18' height='13' rx='2' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M8 21h8M12 16.5V21' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E")}
.theme-menu{position:absolute;top:calc(100% + 9px);right:0;width:194px;max-width:calc(100vw - 28px);padding:7px;border:1px solid var(--theme-control-border);border-radius:14px;background:var(--theme-control-bg);color:var(--theme-control-text);box-shadow:0 10px 32px var(--theme-control-shadow)}
.theme-menu[hidden]{display:none!important}
.theme-menu-heading{margin:0;padding:5px 9px 7px;color:var(--theme-control-muted);font-size:11px;font-weight:400;line-height:1.5}
.theme-option{display:flex;align-items:center;gap:10px;min-height:44px;margin:0;padding:8px 9px;border-radius:9px;color:var(--theme-control-text);font-size:13px;font-weight:500;line-height:1.5;cursor:pointer}
.theme-option:has(input:checked){background:var(--theme-control-active);color:var(--theme-control-accent)}
.theme-option:hover{background:var(--theme-control-raised)}
.theme-option:focus-within{outline:2px solid var(--theme-control-accent);outline-offset:-2px}
.theme-option input[type="radio"]{appearance:auto!important;-webkit-appearance:radio!important;display:block!important;flex:0 0 15px!important;width:15px!important;min-width:15px!important;height:15px!important;min-height:15px!important;margin:0 0 0 auto!important;padding:0!important;border:0!important;border-radius:50%!important;box-shadow:none!important;accent-color:var(--theme-control-accent)}
.brand-theme-filter{position:absolute;overflow:hidden;pointer-events:none;visibility:visible!important}
html[data-theme="dark"] :is(.brand-name,.iphone-boot-logo,.iphone-boot-name,.auth-card>img){filter:url(#brand-dark-ink)}
@media(min-width:781px){
  .topbar>.theme-picker{grid-column:3;grid-row:1;justify-self:end}
  /* Center within the usable space between the brand and actions. */
  .topbar{grid-template-columns:auto minmax(0,1fr) auto;column-gap:16px}
  .topbar .navigation-shell>nav{grid-column:2;justify-self:center;max-width:min(100%,var(--theme-nav-max-width,100%))}
}
@media(min-width:781px) and (max-width:1100px){
  .topbar .header-actions{gap:8px}
  .topbar .header-actions .theme-toggle{width:32px;height:40px;min-width:32px}
  .topbar .header-actions #refresh-data{font-size:0;padding:10px 12px}
  .topbar .header-actions #refresh-data>span{font-size:23px}
}
@media(max-width:780px){
  .topbar>.theme-picker{position:absolute;right:15px;top:18px;margin:0}
  .theme-toggle{width:44px;height:44px;min-width:44px}
}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none}}

/* Keep layout wrappers transparent; glass belongs to individual cards only. */
html[data-theme="dark"] #dashboard-view .financial-flow-card{
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
html[data-theme="dark"] #dashboard-view .financial-flow-card::before{
  content:none!important;
  background:none!important;
}
html[data-theme="dark"] #customers-view .customer-directory-panel{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}

/* Safari inherits text-fill from the input, independently of placeholder color. */
html[data-theme="dark"] :is(input,textarea)::placeholder{
  color:#909090!important;
  -webkit-text-fill-color:#909090!important;
  opacity:1;
}

html[data-theme="dark"] #tax-view .tax-table-group.is-expanded>.tax-table-group-head{
  border-bottom-color:var(--theme-line)!important;
}

/* Color the channel badge itself, preserving the light theme's badge geometry. */
html[data-theme="dark"] :is(.channel-chip,.recent-channel-tag).channel-line{
  background:var(--theme-green-fill)!important;
  border-color:var(--theme-green-line)!important;
  color:var(--theme-green)!important;
}
html[data-theme="dark"] :is(.channel-chip,.recent-channel-tag).channel-fastwork{
  background:var(--theme-blue-fill)!important;
  border-color:var(--theme-blue-line)!important;
  color:var(--theme-blue)!important;
}
html[data-theme="dark"] :is(.channel-chip,.recent-channel-tag).channel-facebook{
  background:var(--theme-purple-fill)!important;
  border-color:var(--theme-purple-line)!important;
  color:var(--theme-purple)!important;
}
html[data-theme="dark"] :is(.channel-chip,.recent-channel-tag).channel-instagram{
  background:var(--theme-red-fill)!important;
  border-color:var(--theme-red-line)!important;
  color:var(--theme-red)!important;
}
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag.channel-line{
  color:var(--theme-green)!important;
}
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag.channel-fastwork{
  color:var(--theme-blue)!important;
}
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag.channel-facebook{
  color:var(--theme-purple)!important;
}
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag.channel-instagram{
  color:var(--theme-red)!important;
}
html[data-theme="dark"] #dashboard-view .recent-channel-tag .recent-channel-name{
  color:inherit!important;
}
html[data-theme="dark"] #transactions-view .channel-order{color:var(--theme-muted)!important}

@media(max-width:780px){
  /* The legacy mobile table intentionally uses its compact cell as the badge. */
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-line){background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important;color:var(--theme-green)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-fastwork){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-facebook){background:var(--theme-purple-fill)!important;border-color:var(--theme-purple-line)!important;color:var(--theme-purple)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-instagram){background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-tiktok){background:#111!important;border-color:#555!important;color:var(--theme-text)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-direct){background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-muted)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell>.channel-chip,
  html[data-theme="dark"] #transactions-view .transaction-mobile-channel>.channel-chip{background:transparent!important;border-color:transparent!important;color:inherit!important}
}

/* Complete dark surfaces on components with their own light-only chrome. */
html[data-theme="dark"] #transaction-preview-dialog .preview-dialog>.dialog-heading,
html[data-theme="dark"] #transaction-preview-dialog .preview-dialog>.dialog-actions{
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-text)!important;
  box-shadow:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
html[data-theme="dark"] #transaction-preview-dialog .dialog-heading h2{color:var(--theme-text)!important}
html[data-theme="dark"] #transaction-preview-dialog .dialog-heading .eyebrow{color:var(--theme-blue)!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-extras{border-color:var(--theme-line)!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-extras>div>div{
  background:var(--theme-raised)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-extras span{color:var(--theme-blue)!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-extras strong{color:var(--theme-text)!important}
html[data-theme="dark"] #transaction-form>.payment-section{
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme="dark"] #transaction-form .payment-section-heading,
html[data-theme="dark"] #transaction-form .payment-section-heading-copy{background:transparent!important}

/* One consistent contact area, without filled rectangular row strips. */
html[data-theme="dark"] #customers-view .customer-profile-list{
  background:var(--theme-raised)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme="dark"] #customers-view .customer-profile-row{
  background:transparent!important;
  box-shadow:none!important;
  border-color:var(--theme-line)!important;
}
html[data-theme="dark"] #customers-view .customer-job-list{background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #customers-view .customer-job-list-head{background:var(--theme-raised)!important;color:var(--theme-muted)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #customers-view .customer-profile-row>span{color:var(--theme-text)!important;background:transparent!important}
html[data-theme="dark"] #customers-view .customer-profile-row>a.customer-phone-link{background:transparent!important;color:var(--theme-blue)!important}

/* The filter heading shares its panel surface; reset remains a red action. */
html[data-theme="dark"] #transactions-view .filter-panel .filter-panel-header,
html[data-theme="dark"] #transactions-view .filter-panel .filter-panel-header>div{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #transactions-view .filter-panel .filter-panel-header strong{color:var(--theme-text)!important}
html[data-theme="dark"] #transactions-view .filter-panel .filter-panel-header small,
html[data-theme="dark"] #transactions-view .filter-panel .filter-field-label{color:var(--theme-muted)!important}
html[data-theme="dark"] #transactions-view .filter-panel #filter-close{background:var(--theme-surface)!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #transactions-view .filter-panel #clear-filters{
  background:#ba3544!important;
  border-color:#d04454!important;
  color:#fff!important;
}
html[data-theme="dark"] #transactions-view .filter-panel #clear-filters:is(:hover,:focus-visible){background:#d14050!important;border-color:#e25060!important;color:#fff!important}

/* Opaque, more saturated card colors; keep the original artwork and geometry. */
html[data-theme="dark"] #dashboard-view :is(.financial-flow-income,.financial-flow-net,.financial-flow-deductions,.tracking-card),
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-card{
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
html[data-theme="dark"] #dashboard-view :is(.financial-flow-income,.financial-flow-net,.financial-flow-deductions,.tracking-card)::before,
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item::before,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-card::before{
  content:none!important;
  background:none!important;
}
html[data-theme="dark"] #dashboard-view .financial-flow-card>.financial-flow-income,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-company{background:linear-gradient(135deg,#205f9f,#16467e)!important;border-color:#66a4e9!important}
html[data-theme="dark"] #dashboard-view .financial-flow-net,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-total{background:linear-gradient(135deg,#08734f,#07553e)!important;border-color:#45b786!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-individual{background:linear-gradient(135deg,#087884,#075461)!important;border-color:#42b8c4!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deductions,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-withholding{background:linear-gradient(135deg,#896313,#64460c)!important;border-color:#d0a64b!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item{background:linear-gradient(135deg,#896313,#64460c)!important;border-color:#c49c47!important}
html[data-theme="dark"] #dashboard-view .tracking-overview{background:#42243a!important;border-color:#b75d8b!important}
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-certificate{background:linear-gradient(135deg,#963b68,#6f2950)!important;border-color:#dd79a6!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-unfiled{background:linear-gradient(135deg,#a15025,#733717)!important;border-color:#e3955d!important}
html[data-theme="dark"] #dashboard-view :is(.financial-flow-income,.financial-flow-net,.financial-flow-deduction-grid>.financial-flow-item) :is(p,small),
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-card :is(p,small){color:#f0f6ff!important}
html[data-theme="dark"] #dashboard-view :is(.financial-flow-net strong,.financial-flow-cash,.financial-flow-cash b),
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-total>strong{color:#b5f2cd!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid strong{color:#ffe6a8!important}
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card :is(p,strong,small),
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card::after{color:#ffd4e1!important}

/* Use the original dark badge palette consistently, including customer badges. */
html[data-theme="dark"]{
  --tag-blue-bg:var(--theme-blue-fill);--tag-blue-fg:var(--theme-blue);--tag-blue-line:var(--theme-blue-line);
  --tag-green-bg:var(--theme-green-fill);--tag-green-fg:var(--theme-green);--tag-green-line:var(--theme-green-line);
  --tag-purple-bg:var(--theme-purple-fill);--tag-purple-fg:var(--theme-purple);--tag-purple-line:var(--theme-purple-line);
  --tag-pink-bg:var(--theme-red-fill);--tag-pink-fg:var(--theme-red);--tag-pink-line:var(--theme-red-line);
  --tag-red-bg:var(--theme-red-fill);--tag-red-fg:var(--theme-red);--tag-red-line:var(--theme-red-line);
  --tag-yellow-bg:var(--theme-yellow-fill);--tag-yellow-fg:var(--theme-yellow);--tag-yellow-line:var(--theme-yellow-line);
  --tag-neutral-bg:var(--theme-raised);--tag-neutral-fg:var(--theme-muted);--tag-neutral-line:var(--theme-line);
}
html[data-theme="dark"] :is(#dashboard-view,#transactions-view,#customers-view,#tax-view,#transaction-form,#transaction-preview-dialog) :is(.channel-fastwork,.fastwork-name-chip,.fastwork-customer-tag,.inline-fastwork-customer,.order-chip,.customer-channel-fastwork,.preview-a-channel-customer>b),
html[data-theme="dark"] #customers-view .customer-accordion-top-fastwork>span,
html[data-theme="dark"] #links-view :is(.badge.drive,.work-link-badge.drive){background:var(--tag-blue-bg)!important;border-color:var(--tag-blue-line)!important;color:var(--tag-blue-fg)!important}
html[data-theme="dark"] :is(#dashboard-view,#transactions-view,#customers-view,#tax-view,#transaction-form,#transaction-preview-dialog) :is(.channel-line,.customer-channel-line,.client-kind.company,.preview-a-client-type.company,.status.good,.recent-certificate-status.good,.payment-status-badge.payment-paid,.payment-certificate-badge.is-received,.preview-a-certificate-status.is-received){background:var(--tag-green-bg)!important;border-color:var(--tag-green-line)!important;color:var(--tag-green-fg)!important}
html[data-theme="dark"] #transactions-view #transaction-rows .status[data-toggle-certificate].good{background:var(--tag-green-bg)!important;color:var(--tag-green-fg)!important}
html[data-theme="dark"] :is(#dashboard-view,#transactions-view,#customers-view,#tax-view,#transaction-form,#transaction-preview-dialog) :is(.channel-facebook,.customer-channel-facebook){background:var(--tag-purple-bg)!important;border-color:var(--tag-purple-line)!important;color:var(--tag-purple-fg)!important}
html[data-theme="dark"] :is(#dashboard-view,#transactions-view,#customers-view,#tax-view,#transaction-form,#transaction-preview-dialog) :is(.channel-instagram,.customer-channel-instagram),
html[data-theme="dark"] #links-view :is(.badge.photos,.work-link-badge.photos){background:var(--tag-pink-bg)!important;border-color:var(--tag-pink-line)!important;color:var(--tag-pink-fg)!important}
html[data-theme="dark"] :is(#dashboard-view,#transactions-view,#customers-view,#tax-view,#transaction-form,#transaction-preview-dialog) :is(.certificate-pending,.recent-certificate-status.certificate-pending,.payment-status-badge.payment-unpaid,.payment-certificate-badge.is-pending,.preview-a-certificate-status.is-pending,.active-filter-chip,.filter-chip,.certificate-filter-chip){background:var(--tag-red-bg)!important;border-color:var(--tag-red-line)!important;color:var(--tag-red-fg)!important}
html[data-theme="dark"] :is(#dashboard-view,#transactions-view,#customers-view,#tax-view,#transaction-form,#transaction-preview-dialog) :is(.status.wait,.status.individual,.payment-status-badge.payment-deposit,.payment-certificate-badge.is-none,.preview-a-certificate-status.is-not-required,.client-kind.individual,.preview-a-client-type.individual){background:var(--tag-yellow-bg)!important;border-color:var(--tag-yellow-line)!important;color:var(--tag-yellow-fg)!important}
html[data-theme="dark"] :is(#dashboard-view,#transactions-view,#customers-view,#tax-view,#transaction-form,#transaction-preview-dialog) :is(.channel-direct,.channel-custom,.customer-channel-direct,.customer-channel-custom,.status.neutral){background:var(--tag-neutral-bg)!important;border-color:var(--tag-neutral-line)!important;color:var(--tag-neutral-fg)!important}
html[data-theme="dark"] #transactions-view :is(.active-filter-chip,.filter-chip,.certificate-filter-chip) button{color:var(--tag-red-fg)!important}

/* Contact labels are badges; their containing rows remain transparent. */
html[data-theme="dark"] #customers-view .customer-profile-row strong,
html[data-theme="dark"] #transaction-preview-dialog .preview-a-customer-row dt{background:var(--tag-blue-bg)!important;border-color:var(--tag-blue-line)!important;color:var(--tag-blue-fg)!important}
html[data-theme="dark"] #customers-view .customer-profile-row--line strong,
html[data-theme="dark"] #transaction-preview-dialog .preview-a-customer-row.is-line dt{background:var(--tag-green-bg)!important;color:var(--tag-green-fg)!important}
html[data-theme="dark"] #customers-view .customer-profile-row--facebook strong,
html[data-theme="dark"] #transaction-preview-dialog .preview-a-customer-row.is-facebook dt{background:var(--tag-purple-bg)!important;color:var(--tag-purple-fg)!important}
html[data-theme="dark"] #customers-view .customer-profile-row--instagram strong,
html[data-theme="dark"] #transaction-preview-dialog .preview-a-customer-row.is-instagram dt{background:var(--tag-pink-bg)!important;color:var(--tag-pink-fg)!important}
html[data-theme="dark"] #customers-view .customer-profile-row--note strong,
html[data-theme="dark"] #transaction-preview-dialog .preview-a-customer-row.is-note dt{background:var(--tag-neutral-bg)!important;color:var(--tag-neutral-fg)!important}
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag.channel-line{background:var(--tag-green-bg)!important;border-color:var(--tag-green-line)!important;color:var(--tag-green-fg)!important}
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag.channel-fastwork{background:var(--tag-blue-bg)!important;border-color:var(--tag-blue-line)!important;color:var(--tag-blue-fg)!important}
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag.channel-facebook{background:var(--tag-purple-bg)!important;border-color:var(--tag-purple-line)!important;color:var(--tag-purple-fg)!important}
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag.channel-instagram{background:var(--tag-pink-bg)!important;border-color:var(--tag-pink-line)!important;color:var(--tag-pink-fg)!important}
html[data-theme="dark"] #dashboard-view :is(.recent-channel-tag,.inline-fastwork-customer,.fastwork-customer-tag) :is(.recent-channel-name,.recent-channel-customer,.inline-fastwork-name,.fastwork-customer-tag-text){color:inherit!important;background:transparent!important}

/* The preview has a single outer channel badge; do not paint its inner text. */
html[data-theme="dark"] #transaction-preview-dialog .preview-c-channel{background:var(--tag-neutral-bg)!important;border-color:var(--tag-neutral-line)!important;color:var(--tag-neutral-fg)!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-channel:has(.channel-line){background:var(--tag-green-bg)!important;border-color:var(--tag-green-line)!important;color:var(--tag-green-fg)!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-channel:has(.channel-fastwork){background:var(--tag-blue-bg)!important;border-color:var(--tag-blue-line)!important;color:var(--tag-blue-fg)!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-channel:has(.channel-facebook){background:var(--tag-purple-bg)!important;border-color:var(--tag-purple-line)!important;color:var(--tag-purple-fg)!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-channel:has(.channel-instagram){background:var(--tag-pink-bg)!important;border-color:var(--tag-pink-line)!important;color:var(--tag-pink-fg)!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-channel:has(.channel-tiktok){background:#17191d!important;border-color:#555!important;color:#fff!important}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-channel>.channel-chip{background:transparent!important;border-color:transparent!important;color:inherit!important;-webkit-text-fill-color:inherit}

@media(max-width:780px){
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-line),
  html[data-theme="dark"] :is(#transactions-view,#dashboard-view) :is(.transaction-mobile-channel,.recent-mobile-channel):has(.channel-line){background:var(--tag-green-bg)!important;border-color:var(--tag-green-line)!important;color:var(--tag-green-fg)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-fastwork),
  html[data-theme="dark"] :is(#transactions-view,#dashboard-view) :is(.transaction-mobile-channel,.recent-mobile-channel):has(.channel-fastwork){background:var(--tag-blue-bg)!important;border-color:var(--tag-blue-line)!important;color:var(--tag-blue-fg)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-facebook),
  html[data-theme="dark"] :is(#transactions-view,#dashboard-view) :is(.transaction-mobile-channel,.recent-mobile-channel):has(.channel-facebook){background:var(--tag-purple-bg)!important;border-color:var(--tag-purple-line)!important;color:var(--tag-purple-fg)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell:has(.channel-instagram),
  html[data-theme="dark"] :is(#transactions-view,#dashboard-view) :is(.transaction-mobile-channel,.recent-mobile-channel):has(.channel-instagram){background:var(--tag-pink-bg)!important;border-color:var(--tag-pink-line)!important;color:var(--tag-pink-fg)!important}
  html[data-theme="dark"] #transactions-view #transaction-rows .channel-cell>.channel-chip,
  html[data-theme="dark"] #transactions-view .transaction-mobile-channel>.channel-chip,
  html[data-theme="dark"] #dashboard-view .recent-mobile-channel>.channel-chip{background:transparent!important;border-color:transparent!important;color:inherit!important}
}

/* Readable figures and captions without changing the surrounding rows. */
html[data-theme="dark"] #transactions-view :is(.transaction-gross>strong,.transaction-mobile-gross strong),
html[data-theme="dark"] #dashboard-view .recent-gross>strong{color:var(--theme-text)!important}
html[data-theme="dark"] :is(#transactions-view,#dashboard-view) .deduction-info,
html[data-theme="dark"] :is(#transactions-view,#dashboard-view) .deduction-info>span,
html[data-theme="dark"] #dashboard-view .recent-gross .deduction-info::before{color:#c2c2c2!important}
html[data-theme="dark"] #transactions-view .deduction-info b,
html[data-theme="dark"] #dashboard-view .recent-gross .deduction-info b{color:var(--theme-yellow)!important}
html[data-theme="dark"] #dashboard-view :is(.recent-gross>span,.recent-net>span,.recent-status>span){color:#c2c2c2!important}

html[data-theme="dark"] #transactions-view .filter-panel #filter-close:is(:hover,:focus-visible){background:#454545!important;color:var(--theme-text)!important}
html[data-theme="dark"] #transactions-view .filter-panel #filter-close:focus-visible{outline:2px solid var(--theme-blue)!important;outline-offset:3px}
html[data-theme="dark"] #transaction-preview-dialog .preview-c-channel>.channel-order{color:inherit!important;opacity:1!important;-webkit-text-fill-color:inherit}
html[data-theme="dark"] #customers-view .customer-channel-tiktok{background:#111!important;border-color:#555!important;color:var(--theme-text)!important}

/* Template choices keep one continuous surface and clear text/hover states. */
html[data-theme="dark"] #template-dialog .template-choice{background:var(--theme-raised)!important;border-color:var(--theme-line)!important;box-shadow:none!important}
html[data-theme="dark"] #template-dialog :is(.template-use,.template-remove){background:transparent!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #template-dialog .template-use strong{color:var(--theme-blue)!important}
html[data-theme="dark"] #template-dialog .template-use small{color:#c2c2c2!important}
html[data-theme="dark"] #template-dialog .template-choice:hover,
html[data-theme="dark"] #template-dialog .template-choice:focus-within{background:#343b46!important;border-color:var(--theme-blue-line)!important;box-shadow:none!important}
html[data-theme="dark"] #template-dialog .template-use:is(:hover,:focus-visible){background:transparent!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #template-dialog .template-remove{color:var(--theme-muted)!important}
html[data-theme="dark"] #template-dialog .template-remove:is(:hover,:focus-visible){background:var(--theme-red-fill)!important;color:var(--theme-red)!important}
html[data-theme="dark"] #template-dialog :is(.template-use,.template-remove):focus-visible{outline:2px solid var(--theme-blue)!important;outline-offset:-3px}

/* Compact history timeline keeps its hierarchy in the charcoal theme. */
html[data-theme="dark"] #entry-history-dialog :is(.entry-history-item,.history-change,.history-value){background:transparent!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] #entry-history-dialog .entry-history-item::before{background:var(--theme-line)!important}
html[data-theme="dark"] #entry-history-dialog :is(.entry-history-day-heading,.history-change-label){color:#d4d4d4!important}
html[data-theme="dark"] #entry-history-dialog :is(.entry-history-day-heading>span,.entry-history-summary time,.entry-history-summary-change,.entry-history-chevron,.history-value small,.entry-history-restore-action>span){color:var(--theme-muted)!important}
html[data-theme="dark"] #entry-history-dialog :is(.entry-history-summary strong,.history-before b){color:var(--theme-text)!important}
html[data-theme="dark"] #entry-history-dialog .entry-history-dot{background:var(--theme-blue-fill)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #entry-history-dialog .entry-history-content{background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #entry-history-dialog .history-after b{color:var(--theme-blue)!important}
html[data-theme="dark"] #entry-history-dialog :is(.history-after,.entry-history-restore-action){border-color:var(--theme-line)!important}
html[data-theme="dark"] #entry-history-dialog .entry-history-restore-action>button{background:var(--theme-surface)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #entry-history-dialog :is(.entry-history-summary,.entry-history-restore-action>button):focus-visible{outline-color:var(--theme-blue)!important}
@media(hover:hover) and (pointer:fine){
  html[data-theme="dark"] #entry-history-dialog .entry-history-summary:hover strong{color:var(--theme-blue)!important}
  html[data-theme="dark"] #entry-history-dialog .entry-history-restore-action>button:not(:disabled):hover{background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
}

/* Both themes share the naming layout; each retains its existing light/dark colors. */
#template-name-dialog{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;border-width:1px;border-style:solid;border-color:var(--line);border-radius:18px}
#template-name-dialog form{display:grid;gap:14px;padding:24px;margin:0}
#template-name-title{margin:0 0 4px;font-size:21px;line-height:1.4}
#template-name-dialog label{font-size:13px;font-weight:750}
#template-name-input{width:100%;min-width:0;min-height:44px}
#template-name-dialog .template-name-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}
html[data-theme="dark"] #template-name-dialog{border-color:var(--theme-line);box-shadow:0 18px 60px rgba(0,0,0,.35)}
html[data-theme="dark"] #template-name-title{color:var(--theme-text)}
html[data-theme="dark"] #template-name-dialog label{color:var(--theme-muted)}
html[data-theme="dark"] #template-name-input:focus{outline:2px solid var(--theme-blue);outline-offset:2px}

/* CSV keeps a dark surface when hovered or reached with the keyboard. */
html[data-theme="dark"] #transactions-view #export-csv{background:transparent!important;border-color:transparent!important;color:var(--theme-muted)!important}
html[data-theme="dark"] #transactions-view #export-csv:is(:hover,:focus-visible){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #transactions-view #export-csv:focus-visible{outline:2px solid var(--theme-blue);outline-offset:2px}

/* The count, timestamp and icons share the history button's state color. */
html[data-theme="dark"] #links-view .work-link-stats{background:transparent!important}
html[data-theme="dark"] #links-view .work-link-stat-divider{background:var(--theme-line)!important}
html[data-theme="dark"] #links-view .work-link-stats:is(:hover,:focus-visible,[aria-expanded="true"]){background:var(--theme-blue-fill)!important;color:var(--theme-blue)!important}
html[data-theme="dark"] #links-view .work-link-stats:is(:hover,:focus-visible,[aria-expanded="true"]) :is(.work-link-stat,.work-link-last-opened,.work-link-history-chevron){color:inherit!important}
html[data-theme="dark"] #links-view .work-link-stats:focus-visible{outline:2px solid var(--theme-blue);outline-offset:2px}

/* Brighter desktop tabs; keep the mobile icon colors and glass indicator. */
@media(min-width:781px){
  html[data-theme="dark"] .topbar .navigation-shell>nav>.nav-link{color:#d7dce4}
  html[data-theme="dark"] .topbar .navigation-shell>nav>.nav-link.active{color:#c8ddff}
  html[data-theme="dark"] .topbar .navigation-shell>nav::before,
  html[data-theme="dark"] .topbar .navigation-shell>nav:not(.has-nav-indicator)>.nav-link.active{background:#264a78}
  html[data-theme="dark"] .topbar .navigation-shell>nav>.nav-link:not(.active):is(:hover,:focus-visible){background:#2b3442;color:#c8ddff}
  html[data-theme="dark"] .topbar .navigation-shell>nav>.nav-link:focus-visible{outline:2px solid var(--theme-blue);outline-offset:-2px}
}

/* Suggestions are individual chips on the form, without an extra filled strip. */
html[data-theme="dark"] #links-view .work-link-suggestions{background:transparent!important;border-color:transparent!important;box-shadow:none!important}

/* WebKit autofill paints its own background independently of input text-fill. */
html[data-theme="dark"] #auth-form input:-webkit-autofill,
html[data-theme="dark"] #auth-form input:-webkit-autofill:hover,
html[data-theme="dark"] #auth-form input:-webkit-autofill:focus,
html[data-theme="dark"] #auth-form input:-webkit-autofill:active{
  -webkit-text-fill-color:#f3f3f3!important;
  caret-color:#f3f3f3!important;
  -webkit-box-shadow:0 0 0 1000px #232323 inset!important;
  box-shadow:0 0 0 1000px #232323 inset!important;
  background-color:#232323!important;
  color:#f3f3f3!important;
  filter:none!important;
}
html[data-theme="dark"] #auth-form input:autofill{background-color:#232323!important;color:#f3f3f3!important;caret-color:#f3f3f3!important;-webkit-text-fill-color:#f3f3f3!important;box-shadow:0 0 0 1000px #232323 inset!important}

/* Explicit action selectors beat shared button rules containing ID selectors. */
html[data-theme="dark"] #links-view #work-links-list .work-link-actions button[data-work-link-delete],
html[data-theme="dark"] #transaction-form #dialog-delete,
html[data-theme="dark"] #transaction-form #payment-installment-list button[data-payment-delete]{background:var(--theme-red-fill)!important;border-color:var(--theme-red-line)!important;color:var(--theme-red)!important}
html[data-theme="dark"] #links-view #work-links-list .work-link-actions button[data-work-link-delete]:is(:hover,:focus-visible),
html[data-theme="dark"] #transaction-form #dialog-delete:is(:hover,:focus-visible),
html[data-theme="dark"] #transaction-form #payment-installment-list button[data-payment-delete]:is(:hover,:focus-visible){background:#63313e!important;border-color:#a85b6c!important;color:#ffd2db!important}
html[data-theme="dark"] #links-view #work-links-list .work-link-actions button[data-work-link-copy].is-copied{background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important;color:var(--theme-green)!important}
html[data-theme="dark"] #links-view #work-links-list .work-link-actions button[data-work-link-copy].is-copied:is(:hover,:focus-visible){background:#31533e!important;border-color:#609c75!important;color:#baffd1!important}

/* Jobs lead the row; customer names stay readable at a quieter weight/color. */
html[data-theme="dark"] #transactions-view #transaction-rows :is(.job-cell>strong,.job-edit-button,.transaction-mobile-job){color:#f7f7f7!important;font-weight:850}
html[data-theme="dark"] #transactions-view #transaction-rows :is(.job-customer-name,.transaction-mobile-customer-name){color:#b0b7c2!important;font-weight:500}
html[data-theme="dark"] #transactions-view #transaction-rows .channel-order{color:var(--theme-blue)!important;opacity:1!important}

/* Match tax icon ink to each card, retaining the existing mask and icon tile. */
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-total .tax-summary-label>span{color:#a5f4c9!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-company .tax-summary-label>span{color:#acd2ff!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-individual .tax-summary-label>span{color:#9ceef4!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-withholding .tax-summary-label>span{color:#ffe29b!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-certificate .tax-summary-label>span{color:#ffc3dc!important}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-unfiled .tax-summary-label>span{color:#ffd0a5!important}

/* Year labels remain distinct from the blue selected year. */
html[data-theme="dark"] :is(#dashboard-view .dashboard-year-picker,#tax-view .tax-year-picker)>span:first-child{color:#d4d9e2!important}
html[data-theme="dark"] :is(#dashboard-year-button,#tax-year-button) .year-chevron{color:#c2cbd9!important}

/* The desktop channel column shares one centered axis in both themes. */
@media(min-width:781px){
  #transactions-view .table-panel thead th:nth-child(3),
  #transactions-view #transaction-rows .channel-cell{text-align:center}
  #transactions-view #transaction-rows .channel-cell>.channel-order{display:block;text-align:center;margin-left:auto;margin-right:auto}
}
/* Match the dashboard's existing Light palette without changing Dark mode. */
html[data-theme="light"] #tax-view .tax-year-picker>span:first-child{color:#62718b!important}
html[data-theme="light"] #tax-year-button .year-chevron{color:inherit!important}
/* The heading itself has a hard-coded Light color; color it directly. */
html[data-theme="dark"] #work-link-history-drawer .work-link-history-heading h2{color:var(--theme-text)!important}

/* Finish the customer editor history surface, including its own light-only shell. */
html[data-theme="dark"] #customer-dialog .customer-order-history{background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme="dark"] #customer-dialog .customer-order-history>h3{color:var(--theme-text)!important}
html[data-theme="dark"] #customer-dialog .customer-order-history>p,
html[data-theme="dark"] #customer-dialog #delete-customer-hint{color:var(--theme-muted)!important}
html[data-theme="dark"] #customer-dialog #customer-order-history{background:transparent!important}
html[data-theme="dark"] #customer-dialog #customer-order-history .customer-order-item{background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important;box-shadow:none!important}
html[data-theme="dark"] #customer-dialog #customer-order-history .customer-order-item:is(:hover,:focus-visible){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important}
html[data-theme="dark"] #customer-dialog #customer-order-history .customer-order-item:focus-visible{outline:2px solid var(--theme-blue);outline-offset:2px}
html[data-theme="dark"] #customer-dialog #customer-order-history .customer-order-item :is(strong,b){color:var(--theme-blue)!important}
html[data-theme="dark"] #customer-dialog #customer-order-history .customer-order-item>span{color:var(--theme-muted)!important}
/* Headings/help/empty messages sit directly on the Fastwork section surface. */
html[data-theme="dark"] #customer-dialog .customer-links-editor :is(h3,p){background:transparent!important;box-shadow:none!important}
html[data-theme="dark"] #customer-dialog .customer-links-editor h3{color:var(--theme-text)!important}

/* Center each intrinsic badge on the column axis, including overlong labels. */
@media(min-width:781px){
  #transactions-view #transaction-rows .channel-cell{text-align:left}
  #transactions-view #transaction-rows .channel-cell>.channel-chip{position:relative;left:50%;transform:translateX(-50%)}
}
/* The note label is a layout wrapper, not a second colored surface. */
html[data-theme="dark"] #customer-dialog .customer-profile-fields .customer-profile-note{background:transparent!important;box-shadow:none!important}
/* Keep the trigger selected while open or while any filters remain applied. */
html[data-theme="light"] #transactions-view #filter-toggle:is([aria-expanded="true"],.has-active-filters){background:#e3edff!important;border-color:#8eacf0!important;color:#155eef!important;box-shadow:inset 0 1px 3px rgba(21,94,239,.14)!important}
html[data-theme="dark"] #transactions-view #filter-toggle:is([aria-expanded="true"],.has-active-filters){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important;box-shadow:inset 0 1px 3px rgba(0,0,0,.22)!important}

/* Equal-width, compact certificate status controls in the desktop ledger column. */
@media(min-width:781px){
  #transactions-view #transaction-rows .status-cell>button.status[data-toggle-certificate]{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    width:84px;
    min-width:0;
    max-width:100%;
    height:26px;
    min-height:26px;
    padding:4px 8px;
    font-size:12px;
    line-height:1.2;
    text-align:center;
    white-space:nowrap;
  }
}

/* Mobile-only light surfaces need their own dark palette. */
@media(max-width:780px){
  html[data-theme="dark"] #dashboard-view .recent-panel{background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
  html[data-theme="dark"] #dashboard-view .recent-panel>.section-heading{background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
  html[data-theme="dark"] #dashboard-view .recent-panel>.section-heading h2{color:var(--theme-text)!important}
  html[data-theme="dark"] #dashboard-view .recent-panel .recent-item{background:var(--theme-raised)!important;border-color:#454545!important;box-shadow:0 3px 10px rgba(0,0,0,.15)!important}
  html[data-theme="dark"] #dashboard-view .recent-footer,
  html[data-theme="dark"] #transactions-view .transaction-mobile-footer{border-color:var(--theme-line)!important}
  html[data-theme="dark"] #dashboard-view .recent-gross>span::after,
  html[data-theme="dark"] #dashboard-view .recent-net>span::after{color:var(--theme-muted)!important}
  html[data-theme="dark"] #dashboard-view .recent-net>strong{color:var(--theme-blue)!important}

  html[data-theme="dark"] #transaction-preview-dialog .preview-a-identity-facts>.preview-a-channel-fact{background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
  html[data-theme="dark"] #transaction-preview-dialog .preview-a-calculation,
  html[data-theme="dark"] #transaction-preview-dialog .preview-a-payment-grid{background:transparent!important}
  html[data-theme="dark"] #transaction-preview-dialog .preview-a-calculation>span,
  html[data-theme="dark"] #transaction-preview-dialog .preview-a-payment-grid>span:not(.preview-a-payment-actual){background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
  html[data-theme="dark"] #transaction-preview-dialog .preview-a-payment-grid>.preview-a-payment-actual{background:var(--theme-green-fill)!important;border-color:var(--theme-green-line)!important}
  html[data-theme="dark"] #transaction-preview-dialog :is(.preview-a-calculation,.preview-a-payment-grid) small{color:var(--theme-muted)!important}
  html[data-theme="dark"] #transaction-preview-dialog :is(.preview-a-calculation,.preview-a-payment-grid) strong{color:var(--theme-text)!important}
  html[data-theme="dark"] #transaction-preview-dialog .preview-a-payment-grid>.preview-a-payment-actual strong{color:var(--theme-green)!important}
  html[data-theme="dark"] #transaction-preview-dialog .preview-a-net{border-color:var(--theme-line)!important}

  html[data-theme="dark"] #tax-view .tax-table-group-head>.tax-table-totals{background:transparent!important;border-color:var(--theme-line)!important}
  html[data-theme="dark"] #tax-view .tax-table-group-head>.tax-table-totals>span{background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
  html[data-theme="dark"] #tax-view .tax-table-group-head>.tax-table-totals strong{color:var(--theme-text)!important}
  html[data-theme="dark"] #tax-view .tax-table-group-head>.tax-table-totals small{color:var(--theme-muted)!important}

  /* Keep the measured moving pill and 250ms transform; change colors only. */
  html[data-theme="dark"] .topbar .navigation-shell{border-color:#606875!important;box-shadow:0 5px 20px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.12)!important}
  html[data-theme="dark"] .topbar .navigation-shell::before,
  html[data-theme="dark"] .topbar .navigation-shell:not(.has-mobile-nav-indicator) .nav-link.active{background:linear-gradient(145deg,#37679e,#294e7c)!important;box-shadow:inset 0 0 0 1px #719cce,inset 0 1px 0 rgba(224,238,255,.25),0 2px 8px rgba(0,0,0,.25)!important}
  html[data-theme="dark"] .topbar .navigation-shell .nav-link{color:#b8c0cc!important}
  html[data-theme="dark"] .topbar .navigation-shell .nav-link.active{color:#e3efff!important}
  html[data-theme="dark"] .topbar .navigation-shell.has-mobile-nav-indicator .nav-link.active{background:transparent!important;box-shadow:none!important}
  html[data-theme="dark"] .topbar .navigation-shell .nav-link::before{color:inherit!important;background-color:currentColor!important}
  html[data-theme="dark"] .topbar .navigation-shell .nav-link::after{color:inherit!important}
}

/* Shared channel badge geometry; retain all per-theme colors. */
:is(#dashboard-view,#transactions-view,#customers-view,#transaction-preview-dialog,#customer-dialog) :is(.channel-chip,.recent-channel-tag,.customer-channel-tag,.recent-mobile-channel,.transaction-mobile-channel,.preview-c-channel){border-radius:999px!important}
@media(max-width:780px){#transactions-view #transaction-rows .channel-cell:has(.channel-chip){border-radius:999px!important}}
/* Prevent wheel scrolling behind the shared preview, regardless of entry point. */
@media(min-width:781px){
  html:has(#transaction-preview-dialog[open]),
  body:has(#transaction-preview-dialog[open]){overflow:hidden!important;overscroll-behavior:none}
}
#transaction-preview-dialog{overscroll-behavior:contain}
/* Counters use a distinct red dot with white ink, across all status families. */
html[data-theme="dark"] :is(.certificate-notification-count,.certificate-count,.status-count){background:#c6384d!important;color:#fff!important;-webkit-text-fill-color:#fff!important;box-shadow:0 0 0 2px var(--theme-surface)!important;font-weight:900}
/* Use the existing iPhone device marker; desktop keeps its monitor icon. */
html.iphone-interaction-locked .theme-toggle[data-mode="system"] .theme-toggle-icon,
html.iphone-interaction-locked .theme-option-icon[data-mode="system"]{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='2' width='12' height='20' rx='3' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M10 5h4M11 19h2' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='2' width='12' height='20' rx='3' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M10 5h4M11 19h2' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E")}

/* Counters remain solid red without a separating dark ring. */
html[data-theme="dark"] :is(.certificate-notification-count,.certificate-count,.status-count){box-shadow:none!important;border:0!important;outline:0!important}
/* Match the filled, borderless Fastwork badge on the dashboard only. */
html[data-theme="dark"] #dashboard-view .recent-job-meta>.recent-channel-tag,
html[data-theme="dark"] #dashboard-view .recent-mobile-channel{border:0!important;box-shadow:none!important}
/* Restore the cash-received pill without changing its contents or placement. */
html[data-theme="dark"] #dashboard-view .financial-flow-net>.financial-flow-cash{background:#16553f!important;border:1px solid #4e9b77;color:#b5f2cd!important;box-shadow:none!important}
/* Like the tracking cards, deduction children have no inner outline/shadow. */
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item{border:0!important;box-shadow:none!important}

/* Uniform tax rows and clear customer job hover feedback. */
html[data-theme="dark"] #tax-view .tax-data-table tbody tr:nth-child(n){background:var(--theme-surface)!important}
html[data-theme="dark"].iphone-interaction-locked #tax-view .tax-data-table tbody tr:nth-child(n):is(:hover,:active){background:var(--theme-surface)!important}
@media (hover:hover) and (pointer:fine){
  html[data-theme="dark"] #tax-view .tax-data-table tbody tr:nth-child(n):hover{background:#303030!important}
  #customers-view .customer-job-row{transition:background-color 250ms ease}
  html[data-theme="dark"] #customers-view .customer-job-row:hover{background:var(--theme-blue-fill)!important}
}
@media (prefers-reduced-motion:reduce){
  #customers-view .customer-job-row{transition:none}
}

/* Light tax rows also use one consistent surface. */
html:not([data-theme="dark"]) #tax-view .tax-data-table tbody tr:nth-child(n){background:#fff}
html:not([data-theme="dark"]).iphone-interaction-locked #tax-view .tax-data-table tbody tr:nth-child(n):is(:hover,:active){background:#fff!important}
@media (hover:hover) and (pointer:fine){
  html:not([data-theme="dark"]) #tax-view .tax-data-table tbody tr:nth-child(n):hover{background:#f4f8ff}
}

/* One hover color for both dark ledgers. */
@media (hover:hover) and (pointer:fine){
  html[data-theme="dark"] #tax-view .tax-data-table tbody tr:nth-child(n):hover{background:var(--theme-blue-fill)!important}
}
/* Match the measured refresh control, including narrower desktop headers. */
@media(min-width:781px){
  .topbar .header-actions .theme-toggle{width:var(--theme-action-size,44px);height:var(--theme-action-size,44px);min-width:var(--theme-action-size,44px);min-height:var(--theme-action-size,44px);padding:0;aspect-ratio:1}
  .topbar .navigation-shell>nav{justify-self:center;margin-inline:auto}
}
/* Native iOS label tap tint must not cover theme choices. */
html.iphone-interaction-locked .theme-picker,
html.iphone-interaction-locked .theme-picker *{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}
/* Channel badges share the filled, borderless pill treatment on both devices. */
:is(#dashboard-view,#transactions-view,#customers-view,#tax-view,#transaction-preview-dialog,#customer-dialog) :is(.channel-chip,.recent-channel-tag,.customer-channel-tag,.recent-mobile-channel,.transaction-mobile-channel,.preview-c-channel){border:0!important;border-radius:999px!important;box-shadow:none!important}
/* Keep the mobile table shell clear around its independent cards. */
@media(max-width:780px){
  html[data-theme="dark"] #transactions-view :is(.table-panel,.table-wrap){background:transparent!important;border:0!important;box-shadow:none!important}
  html[data-theme="dark"] #transactions-view .table-panel>.section-heading{background:transparent!important;border:0!important;box-shadow:none!important}
  html.iphone-interaction-locked :is(#transaction-dialog,#transaction-preview-dialog)[open]{background:transparent!important;border:0!important;box-shadow:none!important}
  html.iphone-interaction-locked #transaction-dialog>#transaction-form,
  html.iphone-interaction-locked #transaction-preview-dialog>.preview-dialog{border:0!important;border-radius:22px!important;box-shadow:none!important}
  html.iphone-interaction-locked :is(#transaction-dialog,#transaction-preview-dialog) .dialog-heading{border-top-left-radius:22px;border-top-right-radius:22px}
  html.iphone-interaction-locked :is(#transaction-dialog,#transaction-preview-dialog) .dialog-heading>.icon-button[data-close]{display:grid;place-items:center;flex:0 0 38px;width:38px;min-width:38px;height:38px;min-height:38px;padding:0;border:0!important;border-radius:0!important;line-height:1;overflow:hidden}
}
/* Preserve the light layout's grouped mobile link history surfaces. */
html[data-theme="dark"] #links-view .work-link-inline-history{background:var(--theme-raised)!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #links-view :is(.work-link-history-group,.work-link-history-date,.work-link-history-times){background:transparent!important}
@media(max-width:760px){
  html[data-theme="dark"] #links-view .work-link-stats{background:var(--theme-raised)!important}
  html[data-theme="dark"] #links-view .work-link-stats[aria-expanded="true"]{background:var(--theme-blue-fill)!important;color:var(--theme-blue)!important;border-radius:11px 11px 0 0}
  html[data-theme="dark"] #links-view .work-link-stats[aria-expanded="true"] :is(.work-link-stat,.work-link-last-opened,.work-link-history-chevron){color:inherit!important}
  html[data-theme="dark"] #links-view .work-link-stats[aria-expanded="true"]+.work-link-inline-history{background:var(--theme-blue-fill)!important}
}

/* Opaque inner surfaces separate deductions from the gold group. */
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item{background:#4d3b1c!important}
/* Taller contact labels with proportional text and icons in both themes. */
#customers-view .customer-profile-row{align-items:center;gap:12px;padding:10px 0;font-size:16px;line-height:1.5}
#customers-view .customer-profile-row strong{min-width:118px;min-height:34px;padding:6px 10px;gap:6px;font-size:14px;line-height:1.4}
#customers-view .customer-profile-row .customer-field-icon,
#transaction-preview-dialog .preview-a-customer-row .customer-field-icon{flex:0 0 20px;width:20px;height:20px}
#transaction-preview-dialog .preview-a-customer-row{grid-template-columns:118px minmax(0,1fr);align-items:center;gap:12px;padding:10px 0}
#transaction-preview-dialog .preview-a-customer-row dt{min-height:34px;margin:0;padding:6px 10px;gap:6px;font-size:14px;line-height:1.4}
#transaction-preview-dialog .preview-a-customer-row dd{font-size:16px;line-height:1.5}
@media(max-width:780px){
  #customers-view .customer-profile-row{align-items:flex-start;gap:10px;font-size:15px}
  #customers-view .customer-profile-row strong{min-width:114px;font-size:13px}
  #customers-view .customer-profile-row>span,
  #customers-view .customer-profile-row>a{padding-top:6px}
  #transaction-preview-dialog .preview-a-customer-row{grid-template-columns:114px minmax(0,1fr);gap:10px}
  #transaction-preview-dialog .preview-a-customer-row dt{font-size:13px}
  #transaction-preview-dialog .preview-a-customer-row dd{font-size:15px}
  /* Keep the hit area, show only the close glyph on iPhone. */
  html.iphone-interaction-locked :is(#transaction-dialog,#transaction-preview-dialog) .dialog-heading>.icon-button[data-close]{background:transparent!important;border:0!important;box-shadow:none!important}
}

/* Contact details stay subordinate to the company name. */
#customers-view .customer-profile-row{gap:10px;padding:8px 0;font-size:14px}
#customers-view .customer-profile-row strong{min-width:106px;min-height:28px;padding:4px 8px;gap:5px;font-size:12px}
#customers-view .customer-profile-row .customer-field-icon,
#transaction-preview-dialog .preview-a-customer-row .customer-field-icon{flex:0 0 17px;width:17px;height:17px}
#transaction-preview-dialog .preview-a-customer-row{grid-template-columns:106px minmax(0,1fr);gap:10px;padding:8px 0}
#transaction-preview-dialog .preview-a-customer-row dt{min-height:28px;padding:4px 8px;gap:5px;font-size:12px}
#transaction-preview-dialog .preview-a-customer-row dd{font-size:14px}
@media(max-width:780px){
  #customers-view .customer-profile-row strong{min-width:104px}
  #customers-view .customer-profile-row>span,
  #customers-view .customer-profile-row>a{padding-top:4px}
  #transaction-preview-dialog .preview-a-customer-row{grid-template-columns:104px minmax(0,1fr)}
}
/* Warm golden group with brighter opaque inset cards, without shiny outlines. */
html[data-theme="dark"] #dashboard-view .financial-flow-deductions{background:linear-gradient(135deg,#bd8d27,#956a16)!important;border-color:#dcb24e!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item{background:#e8bf68!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item p{color:#493511!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item small{color:#634a1a!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item strong{color:#65400a!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid .summary-icon{background:#f7d991!important;color:#80500a!important}

/* A lighter gold step while preserving the parent/inset distinction. */
html[data-theme="dark"] #dashboard-view .financial-flow-deductions{background:linear-gradient(135deg,#cca044,#b4872c)!important;border-color:#e7c375!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item{background:#f2d38d!important}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid .summary-icon{background:#fbe5b1!important}
/* Neutral note pills must remain visible against the customer card. */
html[data-theme="dark"] #customers-view .customer-profile-row--note strong,
html[data-theme="dark"] #transaction-preview-dialog .preview-a-customer-row.is-note dt{background:#42464e!important;color:#d9dce2!important;border-radius:999px}

/* Keep Cancel visibly separate from the mobile Add sheet. */
@media(max-width:780px){
  html[data-theme="dark"] .add-action-menu #add-action-cancel{background:#383c43!important;border:1px solid #565d68!important;color:var(--theme-text)!important}
}

.filter-sheet-drag-handle{display:none}
@media(max-width:780px){
  html.mobile-action-sheet-locked,html.mobile-action-sheet-locked body{overflow:hidden!important;overscroll-behavior:none!important}
  #transactions-view section.filters.transaction-filter-toolbar>.filter-panel{overscroll-behavior:contain}
  #transactions-view #filter-panel>.filter-sheet-drag-handle{display:block;position:absolute;top:0;left:50%;transform:translateX(-50%);width:calc(100% - 144px);height:44px;min-height:44px;padding:0;border:0!important;border-radius:12px;background:transparent!important;box-shadow:none!important;touch-action:none;cursor:grab;-webkit-tap-highlight-color:transparent;z-index:2}
  #transactions-view #filter-panel>.filter-sheet-drag-handle:focus-visible{outline:2px solid var(--theme-control-accent);outline-offset:-3px}
}

/* Stable selected-year styling also survives iPhone's transient-state cleanup. */
html[data-theme="dark"] :is(#dashboard-year-options,#tax-year-options) button[aria-selected="true"]{background:#294e7c!important;color:#e3efff!important}
/* Only the main navigation gets the gentler 320ms timing. */
.topbar .navigation-shell .nav-link{transition-duration:320ms;transition-timing-function:cubic-bezier(.25,.1,.25,1)}
@media(min-width:781px){
  .topbar .navigation-shell>nav::before{left:0;top:0;right:auto;bottom:auto;width:calc(100% - var(--nav-left,0px) - var(--nav-right,0px));height:calc(100% - var(--nav-top,0px) - var(--nav-bottom,0px));transform:translate3d(var(--nav-left,0px),var(--nav-top,0px),0);will-change:transform,width}
  .topbar .navigation-shell>nav.nav-motion-ready::before{transition:transform 320ms cubic-bezier(.25,.1,.25,1),width 320ms cubic-bezier(.25,.1,.25,1),height 320ms cubic-bezier(.25,.1,.25,1)}
}
@media(max-width:780px){
  .topbar .navigation-shell.mobile-nav-motion-ready::before{transition:transform 320ms cubic-bezier(.25,.1,.25,1)}
}
@media(prefers-reduced-motion:reduce){
  .topbar .navigation-shell .nav-link,
  .topbar .navigation-shell>nav.nav-motion-ready::before,
  .topbar .navigation-shell.mobile-nav-motion-ready::before{transition:none}
}
/* A larger transparent hit target over the existing Add sheet handle. */
.add-sheet-drag-handle{display:none}
@media(max-width:780px){
  #add-action-menu>.add-sheet-drag-handle{display:block;position:absolute;top:0;left:50%;transform:translateX(-50%);width:calc(100% - 48px);height:44px;min-height:44px;margin:0;padding:0;border:0!important;border-radius:12px;background:transparent!important;box-shadow:none!important;touch-action:none;cursor:grab;-webkit-tap-highlight-color:transparent;z-index:2}
  #add-action-menu>.add-sheet-drag-handle:focus-visible{outline:2px solid var(--theme-control-accent);outline-offset:-3px}
}

/* Charcoal glass mobile navigation; retain measured geometry and 320ms motion. */
@media(max-width:780px){
  html[data-theme="dark"] .topbar .navigation-shell{background:linear-gradient(180deg,rgba(48,50,55,.88),rgba(29,31,35,.90))!important;border-color:rgba(186,198,215,.20)!important;box-shadow:0 8px 24px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.10),inset 0 -1px 0 rgba(0,0,0,.12)!important}
  html[data-theme="dark"] .topbar .navigation-shell::before,
  html[data-theme="dark"] .topbar .navigation-shell:not(.has-mobile-nav-indicator) .nav-link.active{background:linear-gradient(145deg,rgba(180,208,255,.24),rgba(98,134,184,.12) 55%,rgba(119,158,214,.18))!important;box-shadow:inset 0 0 0 1px rgba(156,187,233,.36),inset 0 1px 0 rgba(235,243,255,.18),0 2px 6px rgba(0,0,0,.16)!important}
  html[data-theme="dark"] .topbar .navigation-shell .nav-link{color:#c0c8d3!important}
  html[data-theme="dark"] .topbar .navigation-shell .nav-link.active{color:#b8d5ff!important}
}

/* Keep history readable on a neutral body, with blue reserved for its summary. */
html[data-theme="dark"] #links-view .work-link-inline-history,
html[data-theme="dark"] #links-view .work-link-stats[aria-expanded="true"]+.work-link-inline-history{background:#242930!important;border-color:#485363!important}
html[data-theme="dark"] #links-view .work-link-stats[aria-expanded="true"]{background:#2c3b52!important;color:#b7d4ff!important}
html[data-theme="dark"] #links-view .work-link-inline-history :is(.work-link-history-toolbar h3,.work-link-history-date strong,.work-link-history-group li time){color:#f0f3f8!important}
html[data-theme="dark"] #links-view .work-link-inline-history :is(.work-link-history-date,.work-link-viewer,.work-link-history-date-chevron){color:#c4cbd6!important}
html[data-theme="dark"] #links-view .work-link-inline-history .work-link-viewer.is-james{color:#b7d4ff!important}
html[data-theme="dark"] #links-view .work-link-inline-history :is(.work-link-history-group,.work-link-history-date-row,.work-link-history-group li+li){border-color:#485363!important}
html[data-theme="dark"] #links-view .work-link-inline-history .work-link-history-group li::before{background:#8ab4ff}
html[data-theme="dark"] :is(.work-link-inline-history,.work-link-history-drawer) .work-link-history-more{background:#354865!important;border-color:#597194!important;color:#e0edff!important}
html[data-theme="dark"] :is(.work-link-inline-history,.work-link-history-drawer) .work-link-history-more-chevron{color:inherit!important}
html[data-theme="dark"] #links-view .work-link-inline-history .work-link-history-manage{background:#354865!important;border-color:#597194!important;color:#e0edff!important}
html[data-theme="dark"] #links-view .work-link-inline-history .work-link-history-manage[aria-pressed="true"]{background:#285da8!important;border-color:#7194c8!important;color:#fff!important}
@media(hover:hover) and (pointer:fine){
  html[data-theme="dark"] :is(.work-link-inline-history,.work-link-history-drawer) .work-link-history-more:hover{background:#425c80!important;border-color:#8ba8d1!important}
  html[data-theme="dark"] #links-view .work-link-inline-history .work-link-history-date:hover{background:#303c4b!important}
}

/* A deeper, saturated blue selection within the charcoal glass shell. */
@media(max-width:780px){
  html[data-theme="dark"] .topbar .navigation-shell::before,
  html[data-theme="dark"] .topbar .navigation-shell:not(.has-mobile-nav-indicator) .nav-link.active{background:linear-gradient(145deg,#215ec0,#17488f)!important;box-shadow:inset 0 0 0 1px rgba(112,169,255,.48),inset 0 1px 0 rgba(222,237,255,.20),0 2px 7px rgba(0,0,0,.20)!important}
  html[data-theme="dark"] .topbar .navigation-shell .nav-link.active{color:#e7f0ff!important}
  html[data-theme="dark"] #transactions-view .filter-panel #filter-close{display:grid;place-items:center;width:32px!important;height:32px;min-width:32px;min-height:32px;padding:0;border:1px solid #505966;border-radius:50%;background:#3a3f48!important;color:#d4deec!important;box-shadow:none}
}

/* Restore the soft glass selection; emphasize only its icon and label. */
@media(max-width:780px){
  html[data-theme="dark"] .topbar .navigation-shell::before,
  html[data-theme="dark"] .topbar .navigation-shell:not(.has-mobile-nav-indicator) .nav-link.active{background:linear-gradient(145deg,rgba(180,208,255,.24),rgba(98,134,184,.12) 55%,rgba(119,158,214,.18))!important;box-shadow:inset 0 0 0 1px rgba(156,187,233,.36),inset 0 1px 0 rgba(235,243,255,.18),0 2px 6px rgba(0,0,0,.16)!important}
  html[data-theme="dark"] .topbar .navigation-shell .nav-link.active{color:#559cff!important}
}

/* Match the selected pill outline to its vivid blue icon and label. */
@media(max-width:780px){
  html[data-theme="dark"] .topbar .navigation-shell::before,
  html[data-theme="dark"] .topbar .navigation-shell:not(.has-mobile-nav-indicator) .nav-link.active{box-shadow:inset 0 0 0 1px #559cff,inset 0 1px 0 rgba(235,243,255,.18),0 2px 6px rgba(0,0,0,.16)!important}
}

/* Rebalance only the desktop ledger columns, equally sharing the recovered 2%. */
@media(min-width:781px){
  #transactions-view .table-panel .col-date{width:13.4%}
  #transactions-view .table-panel .col-job{width:30.4%}
  #transactions-view .table-panel .col-channel{width:11.4%}
  #transactions-view .table-panel .col-gross{width:16.4%}
  #transactions-view .table-panel .col-net{width:14.4%}
  #transactions-view .table-panel .col-status{width:14%}
  #transactions-view .table-panel :is(.status-heading,.status-cell){padding-inline:14px}
}
/* Vivid certificate hover colors in both themes, preserving normal states. */
@media(hover:hover) and (pointer:fine){
  #transactions-view #transaction-rows button.status[data-toggle-certificate]{transition:background-color 250ms ease,color 250ms ease,box-shadow 250ms ease,transform 250ms ease}
  #transactions-view #transaction-rows button.status[data-toggle-certificate].good:is(:hover,:focus-visible){background:#13854e!important;color:#fff!important;filter:none;transform:translateY(-1px);box-shadow:0 3px 9px rgba(19,133,78,.18)}
  #transactions-view #transaction-rows button.status[data-toggle-certificate].certificate-pending:is(:hover,:focus-visible){background:#c8384b!important;color:#fff!important;filter:none;transform:translateY(-1px);box-shadow:0 3px 9px rgba(200,56,75,.18)}
}
@media(prefers-reduced-motion:reduce){
  #transactions-view #transaction-rows button.status[data-toggle-certificate]{transition:none}
}

/* Quiet semantic hover: slightly fresher fills, colored text, no strong shadow. */
@media(hover:hover) and (pointer:fine){
  #transactions-view #transaction-rows button.status[data-toggle-certificate]:is(:hover,:focus-visible){filter:none;box-shadow:none!important}
  html:not([data-theme="dark"]) #transactions-view #transaction-rows button.status[data-toggle-certificate].good:is(:hover,:focus-visible){background:#d9f6e5!important;color:#127247!important}
  html:not([data-theme="dark"]) #transactions-view #transaction-rows button.status[data-toggle-certificate].certificate-pending:is(:hover,:focus-visible){background:#ffe0e5!important;color:#b33143!important}
  html[data-theme="dark"] #transactions-view #transaction-rows button.status[data-toggle-certificate].good:is(:hover,:focus-visible){background:#2c4938!important;color:#98e6b8!important}
  html[data-theme="dark"] #transactions-view #transaction-rows button.status[data-toggle-certificate].certificate-pending:is(:hover,:focus-visible){background:#512f38!important;color:#f5a9b7!important}
}

/* Soft diagonal light on opaque Dark summary cards; backgrounds clip to each radius. */
html[data-theme="dark"]{
  --dark-summary-reflection:linear-gradient(122deg,rgba(255,255,255,.12) 0%,rgba(255,255,255,.025) 38%,rgba(255,255,255,0) 53%),linear-gradient(122deg,rgba(255,255,255,0) 49%,rgba(255,255,255,.15) 56%,rgba(255,255,255,.04) 64%,rgba(255,255,255,0) 74%);
}
html[data-theme="dark"] #dashboard-view .financial-flow-card>.financial-flow-income,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-company{--dark-summary-base:linear-gradient(135deg,#205f9f,#16467e)}
html[data-theme="dark"] #dashboard-view .financial-flow-card>.financial-flow-net,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-total{--dark-summary-base:linear-gradient(135deg,#08734f,#07553e)}
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item{--dark-summary-base:linear-gradient(#f2d38d,#f2d38d)}
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-certificate{--dark-summary-base:linear-gradient(135deg,#963b68,#6f2950)}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-individual{--dark-summary-base:linear-gradient(135deg,#087884,#075461)}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-withholding{--dark-summary-base:linear-gradient(135deg,#896313,#64460c)}
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-unfiled{--dark-summary-base:linear-gradient(135deg,#a15025,#733717)}
html[data-theme="dark"] #dashboard-view .financial-flow-card>:is(.financial-flow-income,.financial-flow-net),
html[data-theme="dark"] #dashboard-view .financial-flow-deduction-grid>.financial-flow-item,
html[data-theme="dark"] #dashboard-view .tracking-overview>.tracking-card,
html[data-theme="dark"] #tax-view.tax-card-reference-design .tax-summary-grid .tax-summary-card{
  background-image:var(--dark-summary-reflection),var(--dark-summary-base)!important;
}

/* Blue focus borders on both Dark search layers, on desktop and iPhone. */
html[data-theme="dark"] #customers-view .customer-directory-tools input:is(:focus,[data-search-focused]),
html[data-theme="dark"] #tax-view .tax-directory-tools input:is(:focus,[data-search-focused]),
html[data-theme="dark"] #links-view .work-links-search input:is(:focus,[data-search-focused]),
html[data-theme="dark"] #transactions-view section.filters.transaction-filter-toolbar .filter-search input:is(:focus,[data-search-focused]){border-color:var(--theme-blue)!important}
html[data-theme="dark"] #tax-jump-search:is(:focus,[data-search-focused]){box-shadow:inset 0 0 0 1px var(--theme-blue)!important}

html[data-theme="dark"] #customers-view .customer-directory-tools:focus-within,
html[data-theme="dark"] #tax-view .tax-directory-tools:focus-within,
html[data-theme="dark"] #links-view .work-links-searchbar:focus-within,
html[data-theme="dark"] #transactions-view section.filters.transaction-filter-toolbar:focus-within,
html[data-theme="dark"] #tax-view .tax-search-control:focus-within{border-color:var(--theme-blue)!important}

/* The full noninteractive header is a drag surface, not just the visible grip. */
@media(max-width:780px){
  #add-action-menu>.add-action-menu-head,
  #transactions-view #filter-panel>.filter-panel-header{touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
  #add-action-menu,#transactions-view #filter-panel{overscroll-behavior:contain}
}

/* Monthly chart selection and details use their own dark surfaces. */
html[data-theme="dark"] :is(#chart-month-popover,#chart-month-dialog){--chart-surface:#24262b;--chart-raised:#2b3443;--chart-text:#f0f3f8;--chart-muted:#b6c2d4;--chart-line:#465368;--chart-blue:#8db8ff;--chart-hover:#303f58;background:var(--chart-surface)!important;color:var(--chart-text)!important;border-color:var(--chart-line)!important}
html[data-theme="dark"] #monthly-chart .chart-month-button{background:transparent!important;color:var(--theme-text);box-shadow:none!important;border:0!important}
html[data-theme="dark"] #monthly-chart.has-month-selection .chart-month-button:not(.is-selected) .bar{opacity:.32;filter:saturate(.2)}
html[data-theme="dark"] #monthly-chart .chart-month-button .bar::after{box-shadow:0 0 0 1px #81b5ff,0 0 22px rgba(62,135,255,.48)}
html[data-theme="dark"] #monthly-chart .chart-month-button.is-selected :is(.bar-label,.bar-value){color:#8fbbff!important}
html[data-theme="dark"] #monthly-chart.chart-keyboard-navigation .chart-month-button:focus-visible .bar{outline-color:#8db8ff}
html[data-theme="dark"] #chart-month-dialog::backdrop{background:rgba(9,17,31,.6)}
html[data-theme="dark"] #chart-month-dialog .chart-month-drag-handle::after{background:#94a8c6}

/* iPhone modal close marks keep their hit targets without circular surfaces.
   The chart quick preview and filter close control intentionally retain theirs. */
html.iphone-interaction-locked :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close){background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent}
@media(max-width:780px){
  html.iphone-interaction-locked #chart-month-dialog .chart-month-heading{padding-right:64px}
  html.iphone-interaction-locked #chart-month-dialog .chart-month-close{position:absolute;top:16px;right:12px;z-index:2;width:44px;min-width:44px;height:44px;min-height:44px}
}

html[data-theme="dark"] #chart-month-dialog .chart-month-close:hover{background:#383838;color:var(--theme-text)}

/* One iPhone close-mark system, based on monthly details. No quick-chart/filter selectors. */
html.iphone-interaction-locked{--iphone-close-size:44px;--iphone-close-stroke:19px;--iphone-close-weight:3px}
html.iphone-interaction-locked :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close){display:grid;place-items:center;flex:0 0 var(--iphone-close-size);width:var(--iphone-close-size)!important;min-width:var(--iphone-close-size)!important;height:var(--iphone-close-size)!important;min-height:var(--iphone-close-size)!important;margin:0;padding:0;font-size:0!important;line-height:0!important}
html.iphone-interaction-locked :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close)::before,
html.iphone-interaction-locked :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close)::after{content:"";position:absolute;top:50%;left:50%;width:var(--iphone-close-stroke);height:var(--iphone-close-weight);border-radius:999px;background:currentColor;pointer-events:none}
html.iphone-interaction-locked :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close)::before{transform:translate(-50%,-50%) rotate(45deg)}
html.iphone-interaction-locked :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close)::after{transform:translate(-50%,-50%) rotate(-45deg)}
@media(max-width:780px){
  /* Inset headers anchor within their existing content padding. */
  html.iphone-interaction-locked :is(#transaction-dialog,#template-dialog,#entry-history-dialog) .dialog-heading{position:relative;padding-right:44px;min-height:44px}
  html.iphone-interaction-locked :is(#transaction-dialog,#template-dialog) .dialog-heading>.icon-button[data-close]{position:absolute;top:-9px;right:-13px}
  html.iphone-interaction-locked #entry-history-dialog .dialog-heading>.icon-button[data-close]{position:absolute;top:-5px;right:-6px}
  /* Full-width headers retain sticky behavior and their existing top padding. */
  html.iphone-interaction-locked :is(#customer-dialog,#transaction-preview-dialog) .dialog-heading{padding-right:68px}
  html.iphone-interaction-locked #transaction-preview-dialog .dialog-heading{position:relative}
  html.iphone-interaction-locked :is(#customer-dialog,#transaction-preview-dialog) .dialog-heading>.icon-button[data-close]{position:absolute;top:16px;right:12px}
  html.iphone-interaction-locked dialog .dialog-heading>div{min-width:0;max-width:100%}
  html.iphone-interaction-locked #transaction-preview-dialog .dialog-heading h2{max-width:100%}
  /* Nested editor and drawer use their own visible container edges. */
  html.iphone-interaction-locked .payment-installment-editor{position:relative}
  html.iphone-interaction-locked .payment-installment-editor-heading{padding-right:44px;min-height:44px}
  html.iphone-interaction-locked #payment-editor-close{position:absolute;top:16px;right:12px}
  html.iphone-interaction-locked .work-link-history-drawer-head{position:relative;padding-right:44px;min-height:44px}
  html.iphone-interaction-locked #work-link-history-close{position:absolute;top:-12px;right:-14px}
}

/* Desktop adopts the iPhone close-mark proportions, with mouse/keyboard feedback. */
@media(min-width:781px){
  html:not(.iphone-interaction-locked){--desktop-close-size:44px;--desktop-close-stroke:19px;--desktop-close-weight:3px}
  html:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close){display:grid;place-items:center;flex:0 0 var(--desktop-close-size);width:var(--desktop-close-size)!important;min-width:var(--desktop-close-size)!important;height:var(--desktop-close-size)!important;min-height:var(--desktop-close-size)!important;margin:0;padding:0;border:0!important;border-radius:50%;background:transparent!important;box-shadow:none!important;font-size:0!important;line-height:0!important;cursor:pointer;transform:none!important;transition:background-color 250ms,color 250ms}
  html:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close)::before,
  html:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close)::after{content:"";position:absolute;top:50%;left:50%;width:var(--desktop-close-stroke);height:var(--desktop-close-weight);border-radius:999px;background:currentColor;pointer-events:none}
  html:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close)::before{transform:translate(-50%,-50%) rotate(45deg)}
  html:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close)::after{transform:translate(-50%,-50%) rotate(-45deg)}
  html:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close):hover{background:#edf3ff!important;color:#155eef!important}
  html[data-theme="dark"]:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close):hover{background:#383838!important;color:var(--theme-text)!important}
  html.ui-keyboard-navigation:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close):focus-visible{outline:2px solid #155eef!important;outline-offset:2px}
  html[data-theme="dark"].ui-keyboard-navigation:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close):focus-visible{outline-color:var(--theme-blue)!important}
  html:not(.iphone-interaction-locked) :is(#transaction-dialog,#template-dialog,#entry-history-dialog) .dialog-heading{position:relative;padding-right:44px;min-height:44px}
  html:not(.iphone-interaction-locked) :is(#transaction-dialog,#template-dialog,#entry-history-dialog) .dialog-heading>.icon-button[data-close]{position:absolute;top:-9px;right:-13px}
  html:not(.iphone-interaction-locked) :is(#customer-dialog,#transaction-preview-dialog) .dialog-heading,
  html:not(.iphone-interaction-locked) #chart-month-dialog .chart-month-heading{padding-right:68px}
  html:not(.iphone-interaction-locked) #transaction-preview-dialog .dialog-heading,
  html:not(.iphone-interaction-locked) #chart-month-dialog .chart-month-heading{position:relative}
  html:not(.iphone-interaction-locked) :is(#customer-dialog,#transaction-preview-dialog) .dialog-heading>.icon-button[data-close],
  html:not(.iphone-interaction-locked) #chart-month-dialog .chart-month-close{position:absolute;top:16px;right:12px}
  html:not(.iphone-interaction-locked) dialog :is(.dialog-heading,.chart-month-heading)>div{min-width:0;max-width:100%}
  html:not(.iphone-interaction-locked) #transaction-preview-dialog .dialog-heading h2{max-width:100%}
  html:not(.iphone-interaction-locked) .payment-installment-editor{position:relative}
  html:not(.iphone-interaction-locked) .payment-installment-editor-heading{padding-right:44px;min-height:44px}
  html:not(.iphone-interaction-locked) #payment-editor-close{position:absolute;top:16px;right:12px}
  html:not(.iphone-interaction-locked) .work-link-history-drawer-head{position:relative;padding-right:44px;min-height:44px}
  html:not(.iphone-interaction-locked) #work-link-history-close{position:absolute;top:-12px;right:-14px}
}
@media(min-width:781px) and (prefers-reduced-motion:reduce){
  html:not(.iphone-interaction-locked) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close){transition:none!important}
}

/* Clicking/tapping and automatic dialog focus do not leave keyboard rings behind.
   Keyboard navigation keeps each control's existing focus-visible treatment.
   Hover, selected/expanded states and input focus borders remain independent. */
html:not(.ui-keyboard-navigation) :is(button,[role="button"]):focus{outline:none!important}
html:not(.ui-keyboard-navigation) :is(dialog .icon-button,#work-link-history-close.icon-button,#chart-month-dialog .chart-month-close):focus{outline:none!important}

/* Shared Dark pagination colors; desktop hover uses the same blue in both directions. */
html[data-theme="dark"] #transactions-view .pagination{--pagination-surface:#232323;--pagination-ink:var(--theme-blue);--pagination-muted:var(--theme-muted);--pagination-line:#556174;--pagination-shadow:rgba(0,0,0,.14)}
html[data-theme="dark"] #transactions-view #transaction-page-select{background:transparent!important;background-image:none!important;border-color:transparent!important;color:var(--pagination-ink)!important;-webkit-text-fill-color:var(--pagination-ink);box-shadow:none!important}
html[data-theme="dark"] #transactions-view #transaction-page-select:disabled{background:transparent!important;color:var(--pagination-muted)!important;-webkit-text-fill-color:var(--pagination-muted)}

/* The rectangular all-filter action aligns with the toggle and uses a red tone. */
html[data-theme="dark"] #transactions-view .clear-active-filters{background:var(--tag-red-bg);border-color:var(--tag-red-line);color:var(--tag-red-fg);box-shadow:inset 0 1px 3px rgba(0,0,0,.22)}
@media(hover:hover) and (pointer:fine){
  html[data-theme="dark"] #transactions-view .clear-active-filters:hover{background:var(--tag-red-bg);border-color:var(--tag-red-fg);color:var(--tag-red-fg)}
}

@media(max-width:780px){
  html[data-theme="dark"].iphone-interaction-locked #entry-history-dialog>.entry-history-dialog{background:var(--theme-surface)!important}
}

@media(max-width:780px){
  html[data-theme="dark"].iphone-interaction-locked #template-name-dialog>form{border-color:var(--theme-line);background:var(--theme-surface)!important;box-shadow:0 18px 60px rgba(0,0,0,.35)}
}

/* One confirmation, with an optional unchecked customer cleanup. */
#entry-delete-dialog{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;border:1px solid var(--line);border-radius:18px;background:#fff}
#entry-delete-dialog form{display:grid;gap:16px;padding:24px;margin:0}
#entry-delete-title{margin:0;font-size:21px;line-height:1.4}
#entry-delete-description{margin:0;line-height:1.6;overflow-wrap:anywhere}
#entry-delete-dialog .entry-delete-customer{padding:16px;border:1px solid var(--line);border-radius:12px}
#entry-delete-dialog .entry-delete-last-job{margin:0 0 14px;font-size:14px;line-height:1.6;overflow-wrap:anywhere}
#entry-delete-dialog .entry-delete-option{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14px;font-weight:700;cursor:pointer}
#entry-delete-dialog .entry-delete-option input{flex:none;width:20px;min-width:20px;height:20px;min-height:20px;padding:0;margin:0;accent-color:#155eef}
#entry-delete-dialog .entry-delete-actions{display:flex;justify-content:flex-end;gap:10px}
#entry-delete-dialog .entry-delete-confirm{border-radius:9px;padding:10px 14px;font-weight:750;background:#c3394c;border:1px solid #c3394c;color:#fff}
@media(hover:hover){#entry-delete-dialog .entry-delete-confirm:hover{background:#ad2d40;border-color:#ad2d40}}
html[data-theme="dark"] #entry-delete-dialog{background:var(--theme-surface);border-color:var(--theme-line);color:var(--theme-text)}
html[data-theme="dark"] #entry-delete-dialog .entry-delete-customer{border-color:var(--theme-line)}
@media(max-width:780px){
  html[data-theme="dark"].iphone-interaction-locked #entry-delete-dialog>form{border-color:var(--theme-line);background:var(--theme-surface)!important;color:var(--theme-text);box-shadow:0 18px 60px rgba(0,0,0,.35)}
}

html[data-theme="dark"] #entry-delete-dialog .entry-delete-option input{accent-color:#5595ff}

/* Suppress WebKit tap paint while retaining the whole native checkbox label hit area. */
#entry-delete-dialog .entry-delete-option,
#entry-delete-dialog .entry-delete-option *{-webkit-tap-highlight-color:transparent}

/* Payment action: distinguish availability without inheriting secondary-button hover. */
html[data-theme="dark"] #transaction-form #add-payment-installment:not(:disabled){background:#3378ef!important;border-color:#3378ef!important;color:#fff!important;-webkit-text-fill-color:#fff;opacity:1}
@media(hover:hover) and (pointer:fine){
  html[data-theme="dark"] #transaction-form #add-payment-installment:not(:disabled):hover{background:#4187ff!important;border-color:#4187ff!important;color:#fff!important}
}
html[data-theme="dark"] #transaction-form #add-payment-installment:disabled,
html[data-theme="dark"] #transaction-form #add-payment-installment:disabled:is(:hover,:focus,:focus-visible,:active){background:#344966!important;border-color:#405575!important;color:#91a4bf!important;-webkit-text-fill-color:#91a4bf!important;opacity:1;cursor:not-allowed;box-shadow:none!important;filter:none!important;transform:none!important;outline:none!important;text-shadow:none!important}

/* Seamless inline history keeps the same neutral surface and text in either state. */
html[data-theme="dark"] #links-view{--work-history-surface:var(--theme-raised);--work-history-ink:var(--theme-text);--work-history-muted:var(--theme-muted);--work-history-divider:var(--theme-line);--work-history-accent:var(--theme-blue)}
html[data-theme="dark"] #links-view .work-link-history-card>.work-link-stats,
html[data-theme="dark"] #links-view .work-link-history-card>.work-link-stats:is(:hover,:focus-visible,[aria-expanded="true"]){background:transparent!important;color:var(--work-history-muted)!important;border-radius:0}
html[data-theme="dark"] #links-view .work-link-history-card .work-link-stats .work-link-stat{color:var(--work-history-ink)!important}
html[data-theme="dark"] #links-view .work-link-history-card .work-link-stats :is(.work-link-last-opened,.work-link-history-chevron){color:var(--work-history-muted)!important}
html[data-theme="dark"] #links-view .work-link-history-card .work-link-inline-history{background:transparent!important;border:0!important;color:var(--work-history-muted)!important}
html[data-theme="dark"] #links-view .work-link-history-card .work-link-inline-history :is(.work-link-history-toolbar h3,.work-link-history-date strong){color:var(--work-history-ink)!important}
html[data-theme="dark"] #links-view .work-link-history-card .work-link-inline-history :is(.work-link-history-date,.work-link-history-date-chevron,.work-link-history-group li time,.work-link-viewer){color:var(--work-history-muted)!important}
html[data-theme="dark"] #links-view .work-link-history-card .work-link-inline-history .work-link-viewer.is-james{color:var(--work-history-accent)!important}
html[data-theme="dark"] #links-view .work-link-history-card .work-link-inline-history :is(.work-link-history-group,.work-link-history-date-row,.work-link-history-group li+li,.work-link-history-footer){border-color:var(--work-history-divider)!important}
html[data-theme="dark"] #links-view .work-link-history-card .work-link-history-manage:not([aria-pressed="true"]){background:var(--theme-blue-fill)!important;border-color:var(--theme-blue-line)!important;color:var(--theme-blue)!important}
@media(hover:hover) and (pointer:fine){html[data-theme="dark"] #links-view .work-link-history-card .work-link-inline-history .work-link-history-date:hover{background:var(--work-history-surface)!important}}

/* Match the ledger certificate's quiet hover palette, including detail actions. */
@media(hover:hover) and (pointer:fine){
  :is(#transactions-view,#dashboard-view,#transaction-preview-dialog){--status-red-hover-bg:#ffe0e5;--status-red-hover-fg:#b33143;--status-green-hover-bg:#d9f6e5;--status-green-hover-fg:#127247;--status-yellow-hover-bg:#ffe9bd;--status-yellow-hover-fg:#966000;--order-hover-bg:#dfe8ff}
  html[data-theme="dark"] :is(#transactions-view,#dashboard-view,#transaction-preview-dialog){--status-red-hover-bg:#512f38;--status-red-hover-fg:#f5a9b7;--status-green-hover-bg:#2c4938;--status-green-hover-fg:#98e6b8;--status-yellow-hover-bg:#51432b;--status-yellow-hover-fg:#edce8d;--order-hover-bg:#334969}
  html:not(.iphone-interaction-locked) :is(#transactions-view,#dashboard-view,#transaction-preview-dialog) :is(button.payment-status-badge.payment-unpaid,button.preview-a-certificate-status.is-pending):not(:disabled):is(:hover,:focus-visible){background:var(--status-red-hover-bg)!important;color:var(--status-red-hover-fg)!important}
  html:not(.iphone-interaction-locked) #transaction-preview-dialog :is(button.payment-status-badge.payment-paid,button.preview-a-certificate-status.is-received):not(:disabled):is(:hover,:focus-visible){background:var(--status-green-hover-bg)!important;color:var(--status-green-hover-fg)!important}
  html:not(.iphone-interaction-locked) #transaction-preview-dialog button.payment-status-badge.payment-deposit:not(:disabled):is(:hover,:focus-visible){background:var(--status-yellow-hover-bg)!important;color:var(--status-yellow-hover-fg)!important}
  html:not(.iphone-interaction-locked) #transaction-preview-dialog button.fastwork-order-copy:not(:disabled):is(:hover,:focus-visible){background:var(--order-hover-bg)!important}
}

/* Retain label/value contrast for structured receipt history in Dark mode. */
html[data-theme="dark"] #entry-history-dialog .history-payment-field+.history-payment-field{border-color:var(--theme-line)}
html[data-theme="dark"] #entry-history-dialog .history-payment-field dt{color:var(--theme-muted)}
html[data-theme="dark"] #entry-history-dialog .history-payment-field dd{color:var(--theme-text)}
html[data-theme="dark"] #entry-history-dialog .history-after .history-payment-field dd{color:var(--theme-blue)}

html[data-theme="dark"] #entry-history-dialog .entry-history-current{background:var(--theme-green-fill);color:var(--theme-green)}
