/* P7.14 live appearance regression: legacy finance rules had higher specificity
   than the shared canvas and left white submenus behind dark-theme text.
   Screen-only rules preserve the separate white financial print document. */
@media screen {
 html body.gl-shell-v1.novel-system-ui.gl-original-skin :is(.content,.accounting-content,.gl-hub-main,.content-inner) {
  background:var(--sys-bg)!important;color:var(--sys-text)!important;
 }
 html body.gl-shell-v1.novel-system-ui .gl-navigation :is(.gl-nav-group,.gl-nav-heading,.gl-subnav,.gl-nav-link) {
  background:var(--sys-sidebar)!important;color:var(--sys-on-sidebar)!important;border-color:var(--sys-line)!important;
 }
 html body.gl-shell-v1.novel-system-ui .gl-navigation :is(.gl-nav-link:hover,.gl-nav-heading:hover,.gl-nav-link[aria-current=page]) {
  background:var(--sys-hover)!important;color:var(--sys-text)!important;
 }
}
/* P7.11 COLOR CONTRACT — load last, after page-specific styles.
   A module may control layout, never invent its own brand/panel palette.
   Brand comes from SystemTheme::variables; errors/statuses retain their meaning.
   The document/cheque itself is paper, not application chrome. No geometry reset. */
:root {
 --sys-accent:var(--brand-primary,#0B6BD3);--sys-on-accent:var(--brand-primary-foreground,#FFFFFF);
 --sys-topbar:var(--brand-topbar,var(--sys-accent));--sys-on-topbar:var(--brand-topbar-foreground,#FFFFFF);
 --sys-panel:var(--brand-panel,#FFFFFF);--sys-bg:var(--brand-background,#E8EEF4);
 --sys-text:var(--brand-text,#27354D);--sys-muted:var(--brand-muted,#66758D);
 --sys-sidebar:var(--brand-sidebar,#F7F9FC);--sys-on-sidebar:var(--brand-sidebar-foreground,#27354D);
 --sys-line:color-mix(in srgb,var(--sys-text) 20%,var(--sys-panel));
 --sys-soft:color-mix(in srgb,var(--sys-accent) 7%,var(--sys-panel));
 --sys-hover:color-mix(in srgb,var(--sys-accent) 14%,var(--sys-panel));
 --sys-focus:color-mix(in srgb,var(--sys-accent) 25%,transparent);
 --sys-accent-fg:var(--sys-on-accent);
 --sys-accent-strong:color-mix(in srgb,var(--sys-accent) 88%,#000);
 --novel-primary:var(--sys-accent);--novel-primary-ink:var(--sys-on-accent);
 --novel-secondary:var(--sys-accent);--novel-secondary-ink:var(--sys-on-accent);
 --novel-topbar:var(--sys-topbar);--novel-topbar-ink:var(--sys-on-topbar);
 --novel-sidebar:var(--sys-sidebar);--novel-sidebar-ink:var(--sys-on-sidebar);
 --novel-panel:var(--sys-panel);--novel-background:var(--sys-bg);--novel-text:var(--sys-text);
 --novel-muted:var(--sys-muted);--novel-line:var(--sys-line);--novel-soft:var(--sys-soft);
}
/* Resolve legacy aliases in the SAME element. Custom-property values inherited
   from a different theme root must not retain an old blue/green/red palette. */
html body.gl-shell-v1.novel-system-ui,html.novel-theme,html.novel-theme body {
 --accent:var(--sys-accent);--accent-foreground:var(--sys-on-accent);--link:var(--sys-accent);
 --secondary:var(--sys-accent);--secondary-foreground:var(--sys-on-accent);--theme-btn-text:var(--sys-on-accent);
 --purple:var(--sys-accent);--blue:var(--sys-accent);--green:var(--sys-accent);--purple-soft:var(--sys-soft);
 --novel-focus-ring:var(--sys-accent);--bg:var(--sys-bg);--background:var(--sys-bg);--paper:var(--sys-bg);
 --panel:var(--sys-panel);--surface:var(--sys-panel);--panel-alt:var(--sys-soft);
 --text:var(--sys-text);--ink:var(--sys-text);--muted:var(--sys-muted);--line:var(--sys-line);--border:var(--sys-line);
 --topbar-color:var(--sys-topbar);--topbar-foreground:var(--sys-on-topbar);
 --sidebar-color:var(--sys-sidebar);--sidebar-foreground:var(--sys-on-sidebar);
 --nu-primary:var(--sys-accent);--nu-action:var(--sys-accent);--nu-bg:var(--sys-bg);--nu-panel:var(--sys-panel);
 --nu-panel-soft:var(--sys-soft);--nu-text:var(--sys-text);--nu-muted:var(--sys-muted);--nu-border:var(--sys-line);
 --nu-topbar:var(--sys-topbar);--nu-topbar-text:var(--sys-on-topbar);--nu-sidebar:var(--sys-sidebar);--nu-sidebar-text:var(--sys-on-sidebar);
 --gl-shell-accent:var(--sys-accent);--gl-shell-panel:var(--sys-panel);--gl-shell-bg:var(--sys-bg);
 --gl-shell-text:var(--sys-text);--gl-shell-muted:var(--sys-muted);--gl-shell-topbar:var(--sys-topbar);
 --gl-shell-topbar-text:var(--sys-on-topbar);--gl-shell-nav-bg:var(--sys-sidebar);--gl-shell-nav-text:var(--sys-on-sidebar);
 --gl-bg:var(--sys-bg);--gl-panel:var(--sys-panel);--gl-accent:var(--sys-accent);--gl-secondary:var(--sys-accent);
 --gl-text:var(--sys-text);--gl-muted:var(--sys-muted);--gl-border:var(--sys-line);--gl-soft:var(--sys-soft);
 --ui-field:var(--sys-panel);--ui-ink:var(--sys-text);--ui-muted:var(--sys-muted);--ui-border:var(--sys-line);--ui-focus:var(--sys-accent);
 --p2-blue:var(--sys-accent);--p2-green:var(--sys-accent);--p2-border:var(--sys-line);--p2-muted:var(--sys-muted);
 --p2-rail:var(--sys-panel);--p2-off:var(--sys-soft);--p3-folder:var(--sys-accent);--p3-ink:var(--sys-text);--p3-line:var(--sys-line);--p3-tree:var(--sys-panel);
 --p4-border:var(--sys-line);--p4-line-bg:var(--sys-soft);--p4-muted:var(--sys-muted);
 --p5-blue:var(--sys-accent);--p5-green:var(--sys-accent);--p5-panel:var(--sys-panel);--p5-text:var(--sys-text);--p5-border:var(--sys-line);
 --p8-border:var(--sys-line);--p8-rail:var(--sys-panel);
 --ft-red:var(--sys-accent);--ft-blue:var(--sys-accent);--ft-green:var(--sys-accent);--ft-ink:var(--sys-text);--ft-muted:var(--sys-muted);--ft-border:var(--sys-line);--ft-bg:var(--sys-bg);
 --fv-red:var(--sys-accent);--fv-red-dark:color-mix(in srgb,var(--sys-accent) 88%,#000);--fv-focus:var(--sys-accent);--fv-success:var(--sys-accent);--fv-ink:var(--sys-text);--fv-muted:var(--sys-muted);--fv-line:var(--sys-line);--fv-bg:var(--sys-bg);--fv-surface:var(--sys-panel);
 --fs-accent:var(--sys-accent);--fs-body:var(--sys-bg);--fs-paper:var(--sys-panel);--fs-ink:var(--sys-text);--fs-muted:var(--sys-muted);--fs-border:var(--sys-line);--fs-hover:var(--sys-soft);--fs-selected:var(--sys-hover);
 --ch-red:var(--sys-accent);--ch-red-deep:color-mix(in srgb,var(--sys-accent) 86%,#000);--ch-blue:var(--sys-accent);--ch-blue-dark:color-mix(in srgb,var(--sys-accent) 86%,#000);--ch-green:var(--sys-accent);--ch-green-dark:color-mix(in srgb,var(--sys-accent) 86%,#000);--ch-primary:var(--sys-accent);
 --fc-bg:var(--sys-bg);--fc-ink:var(--sys-text);--fc-muted:var(--sys-muted);--fc-border:var(--sys-line);--fc-paper:var(--sys-panel);
 background-color:var(--sys-bg)!important;color:var(--sys-text)!important;
}
/* Module-local token declarations have previously defeated root-only overrides. */
html body.gl-shell-v1.novel-system-ui :is(.identity-content,.p2-workspace,.p3-workspace,.p5-workspace,.ft-workspace,.fv-workspace,.fc-workspace,.fs-workspace) {
 --purple:var(--sys-accent);--purple-soft:var(--sys-soft);--green:var(--sys-accent);--blue:var(--sys-accent);
 --ink:var(--sys-text);--muted:var(--sys-muted);--line:var(--sys-line);--panel:var(--sys-panel);--bg:var(--sys-bg);
}
html body.gl-shell-v1.novel-system-ui :is(.gl-topbar,.topbar),html.novel-theme :is(.topbar,.cf7-topbar,body>main>header,.layout>main>header) {
 background:var(--sys-topbar)!important;color:var(--sys-on-topbar)!important;
}
html body.gl-shell-v1.novel-system-ui :is(.gl-topbar,.topbar) :is(a,button,span,small),html.novel-theme :is(.topbar,.cf7-topbar) :is(a,button,span,h1,h2,small) {color:inherit!important}
html body.gl-shell-v1.novel-system-ui :is(.gl-navigation,.settings-links,.sidebar),html.novel-theme :is(.sidebar,body>aside,.layout>aside) {background:var(--sys-sidebar)!important;color:var(--sys-on-sidebar)!important}
html body.gl-shell-v1.novel-system-ui :is(.gl-nav-link:hover,.gl-nav-heading:hover,.gl-nav-link[aria-current=page],.settings-links a.active,.nav-item.active),html.novel-theme .sidebar :is(a.active,a:hover,button.active,button:hover) {background:var(--sys-hover)!important;color:var(--sys-accent)!important;border-color:var(--sys-line)!important}
html body.gl-shell-v1.novel-system-ui :is(.card,.page-panel,.settings-panel,.settings-card,.p2-panel,.p3-panel,.p3-tree-pane,.p3-list-pane,.p5-panel,.ft-card,.fv-card,.fc-card,.fs-card,.page-toolbar,.form-guide,.save-bar,.ch-block-editor),html.novel-theme :is(.card,.panel,.dialog,.table-wrap,.settings-card,.content-card) {
 background-color:var(--sys-panel)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important;
}
/* P7.14 C03: CRM tenant identity must follow the same sidebar contrast tokens.
   The legacy .tenant strong {color:white} overrode inherited text on light sidebars. */
html.novel-theme .sidebar .tenant strong {color:var(--sys-on-sidebar)!important}
html.novel-theme .sidebar :is(.tenant,.sidebar-foot) {border-color:var(--sys-line)!important}
html.novel-theme .sidebar .avatar {background:var(--sys-accent)!important;color:var(--sys-on-accent)!important}
/* Neutral standalone controls must not become white-on-white in dark dialogs. */
html.novel-theme body button:where(:not(.primary):not(.success):not(.btn-primary):not(.cf7-save):not(.danger)) {background:var(--sys-panel)!important;border-color:var(--sys-line)!important;color:var(--sys-text)!important}
/* Primary action means the saved brand color, not 'green in Finance/red in GL'. */
html body.gl-shell-v1.novel-system-ui :is(.btn-primary,.btn-success,.button.primary,.button.success,.p2-save,.p3-add,.p3-save,.p3-apply,.p4-save,.p5-save,.p6-save,.p8-save,.p9-save,.ft-btn-primary,.ft-btn-green,.fv-btn-primary,.fv-btn-green,.fc-button.primary,.fs-save,.ch-btn-green,.ch-btn-red,.ch-btn-blue,.identity-content .button-primary),
html.novel-theme :is(button.primary,.btn-primary,button.success,.btn-success,.cf7-save) {
 background:var(--sys-accent)!important;border-color:var(--sys-accent)!important;color:var(--sys-on-accent)!important;
}
html body.gl-shell-v1.novel-system-ui :is(.btn-primary,.btn-success,.ch-btn-green,.ch-btn-red,.ch-btn-blue,.p2-save,.p3-save,.p5-save,.fv-btn-primary,.ft-btn-primary):hover,
html.novel-theme :is(button.primary,.btn-primary,button.success,.cf7-save):hover {filter:brightness(.94)}
html body.gl-shell-v1.novel-system-ui :is(.btn-outline,.button-secondary,.ch-btn-outline,.ft-btn-outline,.fv-btn-outline,.fc-button.secondary,.p3-gear,.nui-select-trigger),
html.novel-theme :is(.btn-outline,button.secondary,.cf7-history button) {background:var(--sys-panel)!important;border-color:var(--sys-line)!important;color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]),
html.novel-theme :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]) {background:var(--sys-panel)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important;caret-color:var(--sys-text)}
html body.gl-shell-v1.novel-system-ui :is(input,select,textarea):is(:disabled,[readonly]),html.novel-theme :is(input,select,textarea):is(:disabled,[readonly]) {background:var(--sys-soft)!important;color:var(--sys-muted)!important;-webkit-text-fill-color:var(--sys-muted);opacity:1}
html body.gl-shell-v1.novel-system-ui :is(input,textarea)::placeholder,html.novel-theme :is(input,textarea)::placeholder {color:var(--sys-muted)!important;opacity:1}
html body.gl-shell-v1.novel-system-ui :is(input[type=checkbox],input[type=radio]),html.novel-theme :is(input[type=checkbox],input[type=radio]) {accent-color:var(--sys-accent)!important}
/* Popups can be portalled to body or placed in the top layer: never depend on a module's ancestor colors. */
html body.gl-shell-v1.novel-system-ui :is(dialog,.gl-dialog,.identity-dialog,.nui-select-popup,.p710-floating-menu),html.novel-theme :is(dialog,.dialog,.nui-select-popup) {
 background:var(--sys-panel)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important;
}
html body.gl-shell-v1.novel-system-ui :is(dialog,.gl-dialog,.identity-dialog) :is(header,footer,.dialog-head,.dialog-actions),html.novel-theme dialog :is(header,footer,.dialog-head,.dialog-actions) {background:var(--sys-panel)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important}
html body.gl-shell-v1.novel-system-ui :is(.nui-select-popup,.p710-floating-menu) :is(.nui-option,a,button),html.novel-theme .nui-select-popup :is(.nui-option,a,button) {color:var(--sys-text)!important;background:transparent!important;border-color:var(--sys-line)!important}
html body.gl-shell-v1.novel-system-ui :is(.nui-select-popup,.p710-floating-menu) :is(.nui-option,a,button):is(:hover,:focus-visible,[aria-selected=true]),html.novel-theme .nui-select-popup .nui-option:is(:hover,:focus-visible,[aria-selected=true]) {background:var(--sys-hover)!important;color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui :is(.novel-calendar-open,.ch-template-mark,.p2-rail-link.is-current,.p3-folder-icon,.guide-icon,.section-number),html.novel-theme .novel-calendar-open {background:var(--sys-soft)!important;color:var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui :is(.check-row,.ssl-row,.toggle-row,.fv-toggle-row,.ch-info,.notice,.readonly-notice,.communication-note,.form-guide),html.novel-theme :is(.notice,.empty,.dialog-actions) {background:var(--sys-soft)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important}
html body.gl-shell-v1.novel-system-ui :is(.muted,.help,.hint,.ch-hint,.ch-record-list span,.identity-content .help),html.novel-theme :is(.muted,.help,.fine) {color:var(--sys-muted)!important}
html body.gl-shell-v1.novel-system-ui :is(a,button,input,select,textarea,summary):focus-visible,html.novel-theme :is(a,button,input,select,textarea,summary):focus-visible {outline:2px solid var(--sys-accent)!important;outline-offset:2px}
html body.gl-shell-v1.novel-system-ui .nui-select-error,html.novel-theme .nui-select-error {display:block;margin-block:5px 0;font-size:12px;color:#AC2334}
html body.gl-shell-v1.novel-system-ui.theme-dark .nui-select-error,html.novel-theme.theme-dark .nui-select-error {color:#FFA6B0}
html body.gl-shell-v1.novel-system-ui [aria-invalid=true]:not([type=hidden]),html.novel-theme [aria-invalid=true]:not([type=hidden]) {border-color:#C53647!important}
/* P7.12 finance/accounting color contract: page-specific CSS may define geometry,
   but all non-semantic actions, tabs, links, switches and field focus follow the saved system accent. */
html body.gl-shell-v1.novel-system-ui :is(.novel-vouchers,.ft-app,.ch-app,.finance-settings) {
 --ft-red:var(--sys-accent);--ft-blue:var(--sys-accent);--ft-green:var(--sys-accent);
 --fv-red:var(--sys-accent);--fv-red-dark:color-mix(in srgb,var(--sys-accent) 88%,#000);--fv-focus:var(--sys-accent);
 --ch-red:var(--sys-accent);--ch-red-deep:color-mix(in srgb,var(--sys-accent) 86%,#000);--ch-blue:var(--sys-accent);--ch-blue-dark:color-mix(in srgb,var(--sys-accent) 86%,#000);--ch-green:var(--sys-accent);--ch-green-dark:color-mix(in srgb,var(--sys-accent) 86%,#000);
 --fs-accent:var(--sys-accent);
}
html body.gl-shell-v1.novel-system-ui :is(.finance-settings .fs-switch input:checked + .fs-switch-slider,.fv-toggle input:checked + .fv-toggle-track) {background:var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui :is(.novel-vouchers .fv-tabs button[aria-selected=true],.ft-tabs a[aria-current=page],.ch-tabs a.is-active) {color:var(--sys-accent)!important;border-color:var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui :is(.novel-vouchers a,.ft-app a,.ch-app a,.finance-settings a):not(.btn):not(.button):not(.ch-btn):not(.ft-btn):not(.fv-btn) {color:var(--sys-accent)}
/* Common field geometry is authoritative across internal screens. */
html body.gl-shell-v1.novel-system-ui :is(input,select,textarea,.nui-select-trigger):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]) {
 border-radius:var(--novel-control-radius,4px)!important;border-width:1px!important;box-shadow:none;
}
html body.gl-shell-v1.novel-system-ui :is(input,select,.nui-select-trigger):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]) {min-height:40px}
html body.gl-shell-v1.novel-system-ui textarea {min-height:78px}
html body.gl-shell-v1.novel-system-ui :is(input,select,textarea,.nui-select-trigger):focus,
html body.gl-shell-v1.novel-system-ui .nui-select-trigger[aria-expanded=true] {border-color:var(--sys-accent)!important;box-shadow:0 0 0 2px var(--sys-focus)!important;outline:0!important}
html body.gl-shell-v1.novel-system-ui .novel-date-control {background:var(--sys-panel)!important;border-color:var(--sys-line)!important;border-radius:3px!important}
html body.gl-shell-v1.novel-system-ui .novel-date-control:focus-within {border-color:var(--sys-accent)!important;box-shadow:0 0 0 2px var(--sys-focus)!important}
/* Preview chrome uses the same role colors; financial paper is intentionally white. */
body.novel-document-preview {background:var(--sys-bg);color:var(--sys-text)}
body.novel-document-preview.theme-dark {color-scheme:dark}
body.novel-document-preview .print-toolbar {background:var(--sys-panel);color:var(--sys-text);border-color:var(--sys-line)}
body.novel-document-preview .print-toolbar button {background:var(--sys-accent);color:var(--sys-on-accent);font-family:inherit}
body.novel-document-preview .print-toolbar a {background:var(--sys-panel);color:var(--sys-text);border:1px solid var(--sys-line)}
body.novel-document-preview .print-toolbar span {color:var(--sys-muted)}
body.novel-document-preview .document {color-scheme:light;background:#FFFFFF;color:#172435}
@media print {
 body.novel-document-preview {background:#FFFFFF!important;color:#172435!important}
 body.novel-document-preview .print-toolbar {display:none!important}
}

html body .nui-select-popup .nui-optgroup {padding:7px 9px;font-family:inherit;font-size:12px;font-weight:600;line-height:1.7;background:var(--sys-soft);color:var(--sys-muted);border-block-end:1px solid var(--sys-line)}
html body .nui-select-error[hidden] {display:none!important}

/* Standalone workspaces expose these existing action IDs (not new actions). */
html.novel-theme :is(#new-draft,#create,#save,#quick-form button[type=submit],#command-form button[type=submit]) {
 background:var(--sys-accent)!important;border-color:var(--sys-accent)!important;color:var(--sys-on-accent)!important;
}
html.novel-theme :is(.sidebar,body>aside,.layout>aside) :is(a,button):not(.brand) {color:var(--sys-on-sidebar)!important}
html.novel-theme :is(body>main>header,.layout>main>header) :is(h1,h2,p,small,a) {color:var(--sys-on-topbar)!important}

html body.gl-shell-v1.novel-system-ui .ch-endorsement-switch {background:var(--sys-soft)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important}
/* Text links remain the same hue but gain readable contrast on dark panels. */
html body.gl-shell-v1.novel-system-ui.theme-dark :is(.ch-upload-zone,.ch-accounting-details>summary,.gl-nav-link[aria-current=page]),
html.novel-theme.theme-dark :is(.eyebrow,.quick-link,a:not(.brand):not(.active)) {color:color-mix(in srgb,var(--sys-accent) 45%,var(--sys-text))!important}

/* P7.12: authoritative shared action palette. Legacy finance skins used literal
   green/red/blue values with !important; these selectors intentionally load last
   and map non-semantic primary actions back to the saved company accent. */
html body.gl-shell-v1.novel-system-ui :is(
  .finance-settings .fs-primary,
  .finance-settings .fs-save,
  .novel-vouchers .fv-primary,
  .ft-app .ft-green,
  .fc-app .fc-green,
  .ch-app .ch-btn-green,
  .ch-app .ch-btn-blue,
  .ch-app .ch-btn-red
){background:var(--sys-accent)!important;border-color:var(--sys-accent)!important;color:var(--sys-accent-fg)!important}
html body.gl-shell-v1.novel-system-ui :is(
  .finance-settings .fs-primary,
  .finance-settings .fs-save,
  .novel-vouchers .fv-primary,
  .ft-app .ft-green,
  .fc-app .fc-green,
  .ch-app .ch-btn-green,
  .ch-app .ch-btn-blue,
  .ch-app .ch-btn-red
):hover{background:var(--sys-accent-strong)!important;border-color:var(--sys-accent-strong)!important}
/* P7.12 focus specificity fix: the base field rule has multiple :not() filters,
   so the focus rule repeats them to ensure the saved accent wins over legacy borders. */
html body.gl-shell-v1.novel-system-ui :is(input,select,textarea,.nui-select-trigger):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]):focus,
html body.gl-shell-v1.novel-system-ui .nui-select-trigger[aria-expanded=true] {
 border-color:var(--sys-accent)!important;box-shadow:0 0 0 2px var(--sys-focus)!important;outline:0!important;
}
/* P7.12 finance-settings dark/theme parity: hub cards are panels, not fixed white tiles. */
html body.gl-shell-v1.novel-system-ui.finance-settings .fs-hub-card {
 background:var(--sys-panel)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important;
}
html body.gl-shell-v1.novel-system-ui.finance-settings .fs-hub-card:hover,
html body.gl-shell-v1.novel-system-ui.finance-settings .fs-hub-card:focus-visible {
 border-color:var(--sys-accent)!important;box-shadow:0 0 0 2px var(--sys-focus)!important;
}
html body.gl-shell-v1.novel-system-ui.finance-settings .fs-hub-card :is(.fs-card-symbol,.fs-card-title) {color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui.finance-settings .fs-hub-card .fs-card-detail {color:var(--sys-muted)!important}

/* ========================================================================
   P7.13 UI HARDENING CONTRACT
   One brand palette, three predictable workspace widths, one control geometry.
   Old module CSS may control composition only; these rules are intentionally
   last and authoritative for application chrome and interactive controls.
   ======================================================================== */
html body.gl-shell-v1.novel-system-ui{
 --novel-list-width:1280px;--novel-detail-width:1120px;--novel-form-width:1088px;--novel-designer-width:1380px;
 --novel-control-height:40px;--novel-radius:4px;
}
/* Lists and dashboards are wide; forms/details are consistently centered;
   designers use the available canvas. */
html body.gl-shell-v1.novel-system-ui:is(.novel-vouchers-list,.ft-index,.fc-app,.gl-phase5-page,.gl-reference-list,.p4-journal-list,.p4-journal-logs) :is(.content-inner,.toolbar-inner){max-width:var(--novel-list-width)!important;width:min(var(--novel-list-width),calc(100% - 32px))!important;margin-inline:auto!important}
html body.gl-shell-v1.novel-system-ui:is(.novel-vouchers-form,.ft-form,.fc-issue,.fc-settle,.p4-journal-form,.accounting-general-page) :is(.content-inner,.toolbar-inner){max-width:var(--novel-form-width)!important;width:min(var(--novel-form-width),calc(100% - 32px))!important;margin-inline:auto!important}
html body.gl-shell-v1.novel-system-ui:is(.novel-voucher-show,.ft-show,.ft-transfer-details,.p4-journal-detail) :is(.content-inner,.toolbar-inner){max-width:var(--novel-detail-width)!important;width:min(var(--novel-detail-width),calc(100% - 32px))!important;margin-inline:auto!important}
html body.gl-shell-v1.novel-system-ui:is(.novel-designer-page,.ch-designer-app) :is(.content-inner,.toolbar-inner){max-width:var(--novel-designer-width)!important;width:min(var(--novel-designer-width),calc(100% - 24px))!important;margin-inline:auto!important}
html body.gl-shell-v1.novel-system-ui.gl-phase6-page :is(.content-inner,.toolbar-inner){max-width:var(--novel-list-width)!important;width:min(var(--novel-list-width),calc(100% - 32px))!important;margin-inline:auto!important}
html body.gl-shell-v1.novel-system-ui.gl-phase6-page :is(.p6-location-form,.p6-asset-form,.p6-form){max-width:var(--novel-form-width)!important;margin-inline:auto!important}
html body.gl-shell-v1.novel-system-ui.ch-reference-workspace:not(.ch-designer-app) :is(.content-inner,.toolbar-inner){max-width:var(--novel-detail-width)!important;width:min(var(--novel-detail-width),calc(100% - 32px))!important;margin-inline:auto!important}
html body.gl-shell-v1.novel-system-ui.ch-reference-workspace:not(.ch-designer-app) .ch-page-narrow{max-width:990px!important;width:100%!important;margin-inline:auto!important}

/* Control geometry: native and enhanced fields must look like the same system. */
html body.gl-shell-v1.novel-system-ui :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]),
html body.gl-shell-v1.novel-system-ui :is(.nui-select-trigger,.p5-select-trigger,#p3-parent-trigger){border:1px solid var(--sys-line)!important;border-radius:var(--novel-radius)!important;background:var(--sys-panel)!important;color:var(--sys-text)!important;box-shadow:none!important;font-family:Tahoma,"Segoe UI",Arial,sans-serif!important;font-size:13px!important}
html body.gl-shell-v1.novel-system-ui :is(input,select):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]),
html body.gl-shell-v1.novel-system-ui :is(.nui-select-trigger,.p5-select-trigger,#p3-parent-trigger){min-height:var(--novel-control-height)!important;height:var(--novel-control-height)!important;padding-block:7px!important}
html body.gl-shell-v1.novel-system-ui textarea{min-height:92px!important;padding:9px 11px!important;resize:vertical}
html body.gl-shell-v1.novel-system-ui :is(input,select,textarea,.nui-select-trigger,.p5-select-trigger,#p3-parent-trigger):focus,
html body.gl-shell-v1.novel-system-ui :is(.nui-select-trigger,.p5-select-trigger,#p3-parent-trigger):focus-visible,
html body.gl-shell-v1.novel-system-ui .nui-select-trigger[aria-expanded=true]{border-color:var(--sys-accent)!important;outline:none!important;box-shadow:0 0 0 2px var(--sys-focus)!important}
html body.gl-shell-v1.novel-system-ui :is(.nui-select-popup,.p5-select-popup,.p3-combo-popup){background:var(--sys-panel)!important;color:var(--sys-text)!important;border:1px solid var(--sys-accent)!important;border-radius:var(--novel-radius)!important;box-shadow:0 12px 28px #0f172a24!important}
html body.gl-shell-v1.novel-system-ui :is(.nui-option,.p5-select-options button,#p3-parent-options button):is(:hover,:focus,[aria-selected=true]){background:var(--sys-soft)!important;color:var(--sys-accent)!important}

/* Buttons: brand action / neutral action / destructive action are semantic, not
   module-specific green/red/blue brands. */
html body.gl-shell-v1.novel-system-ui :is(.btn,.fv-btn,.ft-btn,.fc-button,.ch-btn,.p5-btn,.p6-save){border-radius:var(--novel-radius)!important;min-height:38px;font-family:Tahoma,"Segoe UI",Arial,sans-serif!important;font-size:13px!important}
html body.gl-shell-v1.novel-system-ui :is(.fv-primary,.ft-green,.fc-green,.p5-green,.p6-save,.ch-btn-green,.ch-btn-blue,.ch-btn-red){background:var(--sys-accent)!important;border-color:var(--sys-accent)!important;color:var(--sys-on-accent)!important}
html body.gl-shell-v1.novel-system-ui :is(.fv-light,.ft-light,.fc-light,.p5-btn:not(.p5-green):not(.p5-red),.btn-outline,.ch-btn-outline){background:var(--sys-panel)!important;border:1px solid var(--sys-line)!important;color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui :is(.fv-light,.ft-light,.fc-light,.p5-btn:not(.p5-green):not(.p5-red),.btn-outline,.ch-btn-outline):hover{background:var(--sys-soft)!important;border-color:var(--sys-accent)!important;color:var(--sys-accent)!important}

/* Chart of accounts: no module-owned blue skin. */
html body.gl-shell-v1.novel-system-ui.gl-phase3-page{--p3-line:var(--sys-line)!important;--p3-ink:var(--sys-text)!important;--p3-folder:var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase3-page :is(.p3-tree a,.p3-account-main,.p3-add,.p3-breadcrumb a,.p3-normal strong){color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase3-page :is(.p3-tree .p3-icon,.p3-account-main .p3-icon,.p3-add .p3-icon){color:var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase3-page .p3-tree a[aria-current],
html body.gl-shell-v1.novel-system-ui.gl-phase3-page .p3-accounts>li:hover,
html body.gl-shell-v1.novel-system-ui.gl-phase3-page .p3-accounts>li:focus-within{background:var(--sys-soft)!important;border-color:color-mix(in srgb,var(--sys-accent) 35%,var(--sys-line))!important}
html body.gl-shell-v1.novel-system-ui.gl-phase3-page :is(.p3-accounts>li,.p3-tree-pane,.p3-list-pane,.p3-account-detail,.p3-account-dialog,.p3-row-menu>div){background:var(--sys-panel)!important;border-color:var(--sys-line)!important;color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase3-page :is(.p3-row-menu summary,.p3-balance-button){background:var(--sys-soft)!important;color:var(--sys-text)!important;border:1px solid var(--sys-line)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase3-page :is(#p3-save,.p3-small-dialog button){background:var(--sys-accent)!important;color:var(--sys-on-accent)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase3-page :is(input,select,#p3-parent-trigger):focus{border-color:var(--sys-accent)!important;outline:none!important;box-shadow:0 0 0 2px var(--sys-focus)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase3-page #p3-parent-options button:is(:hover,.is-focused){background:var(--sys-soft)!important;color:var(--sys-accent)!important}

/* Cost centers and assets: understandable toolbar controls, no unlabeled sun/gear. */
html body.gl-shell-v1.novel-system-ui.gl-phase5-page .toolbar-actions{display:flex!important;align-items:center!important;justify-content:flex-start!important;flex-direction:row!important;gap:8px!important}
html body.gl-shell-v1.novel-system-ui.gl-phase5-page .p5-btn{background:var(--sys-panel)!important;color:var(--sys-text)!important;border:1px solid var(--sys-line)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase5-page .p5-green{background:var(--sys-accent)!important;color:var(--sys-on-accent)!important;border-color:var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase5-page :is(.p5-tree summary,.p5-tree-row,.p5-table th,.p5-table tbody tr:nth-child(even)){background:var(--sys-soft)!important;color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase5-page :is(.p5-tree-links a,.p5-menu a,.p5-pagination a,.p5-pagination strong){color:var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui.gl-phase6-page .p6-locations-action{gap:7px!important;white-space:nowrap!important}
html body.gl-shell-v1.novel-system-ui.gl-phase6-page .p6-locations-action svg{color:var(--sys-accent)!important}

/* Finance forms: stable white/panel cards on the same workspace; status colors
   remain semantic while brand actions inherit the saved system accent. */
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-wrapper{padding-inline:0!important}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper{max-width:var(--novel-form-width)!important;width:100%!important;margin:12px auto 40px!important;background:var(--sys-panel)!important;border:1px solid var(--sys-line)!important;border-radius:5px!important;padding:20px!important}
html body.gl-shell-v1.novel-system-ui.novel-vouchers-list .fv-wrapper{max-width:var(--novel-list-width)!important}
html body.gl-shell-v1.novel-system-ui.novel-vouchers :is(.fv-filter,.fv-totals,.fv-table-scroll,.fin-bulk-toolbar){border-color:var(--sys-line)!important}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-filter>summary{background:var(--sys-panel)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-totals{background:var(--sys-accent)!important;color:var(--sys-on-accent)!important}
html body.gl-shell-v1.novel-system-ui.ft-app .ft-master-form{max-width:var(--novel-form-width)!important;width:100%!important;margin:16px auto 45px!important;background:var(--sys-panel)!important;border:1px solid var(--sys-line)!important;border-radius:5px!important;padding:0 18px 24px!important}
html body.gl-shell-v1.novel-system-ui.ft-app .ft-section-title{background:var(--sys-soft)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important;margin-inline:-18px!important;padding-inline:18px!important}
html body.gl-shell-v1.novel-system-ui.fc-app .fc-form{max-width:var(--novel-form-width)!important;width:100%!important;margin-inline:auto!important;background:var(--sys-panel)!important;border:1px solid var(--sys-line)!important;border-radius:5px!important}

/* Human-readable audit history: raw JSON belongs in storage/logging, not the ERP UI. */
html body.gl-shell-v1.novel-system-ui .p4-audit-table td{vertical-align:top}
html body.gl-shell-v1.novel-system-ui .p4-audit-action{display:inline-flex;padding:4px 8px;border-radius:999px;background:var(--sys-soft);color:var(--sys-accent);font-weight:700;white-space:nowrap}
html body.gl-shell-v1.novel-system-ui .p4-audit-summary{display:grid;grid-template-columns:repeat(2,minmax(140px,1fr));gap:6px 12px;margin:0;min-width:280px}
html body.gl-shell-v1.novel-system-ui .p4-audit-summary>div{display:grid;grid-template-columns:minmax(85px,auto) minmax(0,1fr);gap:8px;padding:5px 0;border-bottom:1px solid var(--sys-line)}
html body.gl-shell-v1.novel-system-ui .p4-audit-summary dt{color:var(--sys-muted);font-size:11px;font-weight:600}
html body.gl-shell-v1.novel-system-ui .p4-audit-summary dd{margin:0;color:var(--sys-text);overflow-wrap:anywhere}
html body.gl-shell-v1.novel-system-ui .p4-muted{color:var(--sys-muted)}
html body.gl-shell-v1.novel-system-ui .p4-detail-audit details{border-top:1px solid var(--sys-line);padding:10px 0}
html body.gl-shell-v1.novel-system-ui .p4-detail-audit summary{cursor:pointer;color:var(--sys-text);font-weight:600}
html body.gl-shell-v1.novel-system-ui .p4-section-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}

/* Menus must open above table scroll containers and keep a predictable action order. */
html body.gl-shell-v1.novel-system-ui :is(.fv-actions,.p5-menu,.p6-menu,.ch-action-menu,.ft-actions)[open]{position:relative;z-index:120!important}
html body.gl-shell-v1.novel-system-ui :is(.fv-actions,.p5-menu,.p6-menu,.ch-action-menu,.ft-actions)>div{background:var(--sys-panel)!important;color:var(--sys-text)!important;border:1px solid var(--sys-line)!important;box-shadow:0 10px 26px #0f172a25!important;border-radius:4px!important}

@media(max-width:760px){
 html body.gl-shell-v1.novel-system-ui :is(.content-inner,.toolbar-inner){width:100%!important;max-width:100%!important;padding-inline:10px!important}
 html body.gl-shell-v1.novel-system-ui .p4-audit-summary{grid-template-columns:1fr;min-width:0}
 html body.gl-shell-v1.novel-system-ui.gl-phase5-page .toolbar-actions{flex-wrap:wrap!important}
}

/* P7.14 SYSTEM-WIDE UI CONTRACT -------------------------------------------------
   One geometry and interaction language for every authenticated ERP screen.
   Module CSS may arrange fields, but may not change the meaning/size/focus of
   inputs, dates, dropdowns, buttons, dialogs or tables. */
:root{
 --novel-control-height:40px;
 --novel-button-height:40px;
 --novel-control-radius:4px;
 --novel-panel-radius:5px;
 --novel-space-1:6px;--novel-space-2:10px;--novel-space-3:14px;--novel-space-4:18px;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body){
 font-family:Tahoma,"Segoe UI",Arial,sans-serif!important;
 font-size:13px!important;
 line-height:1.55;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(label){color:var(--sys-text)}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(label)>:where(input,select,textarea,.nui-select-trigger){margin-block-start:5px}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(input,select,textarea,.nui-select-trigger,.p5-select-trigger,#p3-parent-trigger):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]){
 box-sizing:border-box!important;
 width:100%;
 max-width:100%;
 border:1px solid var(--sys-line)!important;
 border-radius:var(--novel-control-radius)!important;
 background:var(--sys-panel)!important;
 color:var(--sys-text)!important;
 font:inherit!important;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(input,select,.nui-select-trigger,.p5-select-trigger,#p3-parent-trigger):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]):not([type=hidden]){
 min-height:var(--novel-control-height)!important;
 height:var(--novel-control-height)!important;
 padding:7px 10px!important;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) textarea{
 min-height:92px!important;
 padding:9px 10px!important;
 resize:vertical;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(input,select,textarea,.nui-select-trigger,.p5-select-trigger,#p3-parent-trigger):focus,
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(.nui-select-trigger,.p5-select-trigger,#p3-parent-trigger)[aria-expanded=true]{
 border-color:var(--sys-accent)!important;
 outline:0!important;
 box-shadow:0 0 0 2px var(--sys-focus)!important;
}
/* Dates are always one 40px control with the same calendar affordance. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) .novel-date-control{
 min-height:var(--novel-control-height)!important;
 height:var(--novel-control-height)!important;
 border:1px solid var(--sys-line)!important;
 border-radius:var(--novel-control-radius)!important;
 background:var(--sys-panel)!important;
 overflow:visible!important;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) .novel-date-control>input[type=date]{
 min-height:38px!important;height:38px!important;border:0!important;box-shadow:none!important;
 padding-inline-end:42px!important;background:transparent!important;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) .novel-date-control>.novel-calendar-open{
 position:absolute!important;inset-inline-end:3px!important;inset-inline-start:auto!important;top:3px!important;
 width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
 padding:0!important;margin:0!important;border:0!important;border-radius:3px!important;
 background:var(--sys-soft)!important;color:var(--sys-accent)!important;display:grid!important;place-items:center!important;transform:none!important;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) .novel-date-control:focus-within{
 border-color:var(--sys-accent)!important;box-shadow:0 0 0 2px var(--sys-focus)!important;
}
/* Searchable selects and native selects share the same popup/trigger language. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(.nui-select-popup,.p5-select-popup,.p3-combo-popup){
 z-index:1000!important;max-height:min(340px,55vh)!important;overflow:auto!important;
 border:1px solid var(--sys-accent)!important;border-radius:var(--novel-control-radius)!important;
 background:var(--sys-panel)!important;color:var(--sys-text)!important;box-shadow:0 14px 32px #0f172a24!important;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(.nui-option,.p5-select-options button,#p3-parent-options button){
 min-height:36px!important;padding:8px 10px!important;text-align:start!important;font:inherit!important;
}
/* Every normal action is 40px; icon-only controls remain square and labelled. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(button,.btn,.button,.fv-btn,.ft-btn,.fc-button,.ch-btn,.p5-btn,.p6-save):not(.novel-calendar-open):not(.icon-button):not([aria-label="إغلاق"]){
 min-height:var(--novel-button-height)!important;border-radius:var(--novel-control-radius)!important;font:inherit!important;
 display:inline-flex;align-items:center;justify-content:center;gap:7px;box-sizing:border-box;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(.icon-button,button[aria-label="إغلاق"],button[title="إغلاق"]){
 min-width:36px;min-height:36px;display:inline-grid;place-items:center;border-radius:var(--novel-control-radius);
}
/* Consistent panel/table language across list screens. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(table){border-collapse:separate;border-spacing:0;width:100%}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(table th){background:var(--sys-soft)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important;font-weight:700}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(table td){border-color:var(--sys-line)!important;color:var(--sys-text)}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(.table-wrap,.fv-table-scroll,.ft-table-wrap,.fc-table-wrap,.p5-table-wrap){
 border-radius:var(--novel-panel-radius)!important;border-color:var(--sys-line)!important;background:var(--sys-panel)!important;
}
/* Dialogs are never full-browser and action bars are predictable. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) dialog{
 width:min(680px,calc(100vw - 28px));max-width:680px;border:1px solid var(--sys-line)!important;
 border-radius:6px!important;padding:0;background:var(--sys-panel)!important;color:var(--sys-text)!important;
}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) dialog::backdrop{background:#0f172a66}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) dialog :where(.dialog-actions,.form-actions,footer){gap:8px}
/* Details/menus use the same focus and open-state language. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) details>summary{cursor:pointer}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) details[open]>summary{color:var(--sys-accent)}
/* File inputs/drop-zones remain readable and follow the active brand. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) input[type=file]{font:inherit;color:var(--sys-text)}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) input[type=file]::file-selector-button{
 min-height:34px;border:1px solid var(--sys-line);border-radius:3px;background:var(--sys-soft);color:var(--sys-text);font:inherit;cursor:pointer;
}
/* Prevent accidental horizontal page scroll; tables own their own scrolling. */
html body.gl-shell-v1.novel-system-ui{max-width:100vw;overflow-x:hidden}
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(.content-inner,.toolbar-inner){box-sizing:border-box}
@media(max-width:760px){
 :is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) :where(.content-inner,.toolbar-inner){width:100%!important;max-width:100%!important;padding-inline:10px!important}
 :is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) dialog{width:calc(100vw - 16px)}
}

/* P7.14 checkpoint 02: a native multi-select is a list, not a one-line trigger. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) select[multiple]:not(.nui-select-native):not([hidden]){
 height:auto!important;min-height:120px!important;
}
/* Shared floating menu positioning is owned by novel-interactions.js, without moving forms. */
:is(html body.gl-shell-v1.novel-system-ui,html.novel-theme body) [data-novel-floating-menu]{
 box-sizing:border-box!important;z-index:1100!important;overscroll-behavior:contain;
 background:var(--sys-panel)!important;color:var(--sys-text)!important;border-color:var(--sys-line)!important;
}

/* P7.14 checkpoint 02: the CRM drawer is hidden, not merely translated offscreen.
   Visibility is the no-JS safety net; the CRM controller also updates inert/focus. */
@media(max-width:760px){
 html.novel-theme body #sidebar.sidebar:not(.open){visibility:hidden;pointer-events:none}
 html.novel-theme body #sidebar.sidebar.open{visibility:visible;pointer-events:auto}
 html.novel-theme body .topbar #menu-toggle{
  background:transparent!important;color:var(--sys-on-topbar)!important;
  min-width:40px!important;padding:4px 8px!important;
 }
}


/* P7.14 C13: Custom Fields builder follows the active system palette. */
html body.gl-shell-v1.novel-system-ui.cf7-builder-page{background:var(--sys-bg)!important;color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page :where(.cf7-properties,.cf7-canvas){background:var(--sys-panel)!important;color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page :where(.cf7-properties h2,.cf7-section-title,.cf7-field-label,.cf7-builder-toolbar h1){color:var(--sys-text)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page .cf7-palette{background:var(--sys-accent)!important;scrollbar-color:color-mix(in srgb,var(--sys-on-accent) 35%,transparent) var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page .cf7-palette>button{background:color-mix(in srgb,var(--sys-accent) 82%,#000)!important;color:var(--sys-on-accent)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page .cf7-palette>button:hover{background:color-mix(in srgb,var(--sys-accent) 70%,#000)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page .cf7-palette svg{stroke:var(--sys-on-accent)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page :where(.cf7-save,.cf7-switch input:checked+span){background:var(--sys-accent)!important;color:var(--sys-on-accent)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page :where(.cf7-field.cf7-selected,.cf7-field.cf7-dragover,.cf7-empty-drop.cf7-dragover){background:var(--sys-soft)!important}
html body.gl-shell-v1.novel-system-ui.cf7-builder-page :where(.cf7-builder-page :focus-visible,.cf7-inputs :focus-visible){outline-color:var(--sys-accent)!important}
html body.gl-shell-v1.novel-system-ui .cf7-coordinate-map [data-cf7-pin]{fill:var(--sys-accent)!important}

/* Explicit finance actions retain the reference meaning across company themes. */
html body.gl-shell-v1.novel-system-ui:is(.novel-vouchers,.ft-app) [data-fin-action="save"]{
 background:#0db477!important;border-color:#0db477!important;color:#fff!important;
}
html body.gl-shell-v1.novel-system-ui:is(.novel-vouchers,.ft-app) [data-fin-action="save"]:hover{
 background:#079565!important;border-color:#079565!important;
}
html body.gl-shell-v1.novel-system-ui:is(.novel-vouchers,.ft-app) [data-fin-action="add"]{
 background:#005ad9!important;border-color:#005ad9!important;color:#fff!important;
}
html body.gl-shell-v1.novel-system-ui:is(.novel-vouchers,.ft-app) [data-fin-action="add"]:hover{
 background:#004fc1!important;border-color:#004fc1!important;
}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-table .fin-row-selected>td{
 background:#fff4c4!important;color:#242b37!important;
}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-table .fin-row-selected>td>a{
 color:#174d91!important;
}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .toolbar-actions .fin-bulk-toolbar{
 margin:0;flex-wrap:wrap;
}

/* Formatted dates keep the native calendar and one readable text editor. */
html body.gl-shell-v1.novel-system-ui .novel-date-control.novel-date-formatted>input.novel-date-iso{
 position:absolute!important;inset-inline-start:0!important;bottom:0!important;
 width:1px!important;min-width:0!important;height:1px!important;min-height:0!important;
 padding:0!important;margin:0!important;border:0!important;opacity:0!important;pointer-events:none!important;
}
html body.gl-shell-v1.novel-system-ui .novel-date-control.novel-date-formatted>input.novel-date-display{
 height:38px!important;min-height:38px!important;margin:0!important;border:0!important;
 padding:7px 10px 7px 42px!important;background:transparent!important;box-shadow:none!important;
 direction:ltr;text-align:left;
}

/* Reference 19 / 40: a separate distribution panel, backed by voucher lines. */
html body.gl-shell-v1.novel-system-ui.novel-vouchers [data-fv-cost-panel][hidden]{display:none!important}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-panel{
 margin-top:20px;border:1px solid var(--sys-line);background:var(--sys-panel);
}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table-scroll{overflow-x:auto}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table{min-width:480px;table-layout:fixed}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table th,
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table td{padding:7px 10px;text-align:start;border-bottom:1px solid var(--sys-line)}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table th:last-child{width:42px}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table tbody td{background:#fffbed!important;color:#263a55!important}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table [data-fv-cost-percent],
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table [data-fv-cost-amount]{direction:ltr;text-align:end}
html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-cost-table .fv-remove-line{
 padding:0;border:0;background:transparent!important;color:#b91c1c!important;cursor:pointer;
}
html body.gl-shell-v1.novel-system-ui.novel-vouchers [data-fv-cost-mismatch]{color:#b91c1c}

/* Settlement is a wide multi-column document, not a narrow single-record form. */
@media screen {
 html body.gl-shell-v1.novel-system-ui.fc-settle{--novel-form-width:1560px}
 html body.gl-shell-v1.novel-system-ui.fc-settle :is(.content-inner,.toolbar-inner){max-width:1560px!important;width:min(1560px,calc(100% - 32px))!important}
 html body.gl-shell-v1.novel-system-ui.fc-settle .fc-lines :is(th.fc-col-remove,td:last-child){position:sticky;inset-inline-end:0;z-index:2;background:var(--sys-panel)!important}
 html body.gl-shell-v1.novel-system-ui.fc-settle .fc-lines :is(th.fc-col-amount,td:nth-last-child(2)){position:sticky;inset-inline-end:46px;z-index:2;background:var(--sys-panel)!important}
 html body.gl-shell-v1.novel-system-ui.fc-settle .fc-lines input[type=checkbox]{min-width:18px;width:18px;height:18px;min-height:18px}
}

/* Paper must not inherit a dark canvas or company workspace background. */
@media print {
 html:has(body.novel-vouchers){background:#fff!important;color-scheme:light!important}
 html body.gl-shell-v1.novel-system-ui.novel-vouchers,
 html body.gl-shell-v1.novel-system-ui.novel-vouchers :is(.accounting-content,.content-inner,.fv-wrapper,.fv-report,.fin-print-shell,.fin-print-canvas,.fin-paper){
  background:#fff!important;color-scheme:light!important;min-height:0!important;
 }
 html body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-report-details :is(th,td){
  white-space:normal!important;overflow-wrap:anywhere;line-height:1.5;vertical-align:top;
 }
}
