/* NOVEL ERP P7.3 — global density contract.
 * Loaded after every module/theme stylesheet. The goal is one compact spatial
 * rhythm across every completed screen without changing business logic,
 * visibility rules, table semantics or printed documents. */
@media screen {
  :root {
    --nu-page-x:12px;
    --nu-page-y:10px;
    --nu-page-bottom:24px;
    --nu-toolbar-h:48px;
    --nu-stack:10px;
    --nu-stack-sm:6px;
    --nu-grid-row:10px;
    --nu-grid-col:12px;
    --nu-panel-pad:12px;
    --nu-panel-pad-sm:9px;
    --nu-empty-pad:20px;
  }

  /* Workspace geometry: consume the available canvas instead of nesting
     unrelated 900/1000/1120px islands that leave large dead bands. */
  body.gl-shell-v1.novel-system-ui :is(.content,.accounting-content,.gl-hub-main) {
    padding:var(--nu-page-y) var(--nu-page-x) var(--nu-page-bottom)!important;
  }
  body.gl-shell-v1.novel-system-ui :is(.content-inner,.gl-hub-inner) {
    width:100%!important;max-width:none!important;margin-inline:0!important;
  }
  body.gl-shell-v1.novel-system-ui .page-toolbar {
    height:var(--nu-toolbar-h)!important;min-height:var(--nu-toolbar-h)!important;
  }
  body.gl-shell-v1.novel-system-ui .toolbar-inner {
    width:calc(100% - (var(--nu-page-x) * 2))!important;max-width:none!important;
    margin-inline:auto!important;gap:8px!important;padding-inline:0!important;
  }
  body.gl-shell-v1.novel-system-ui .gl-page-spacer {height:8px!important;min-height:8px!important;}
  body.gl-shell-v1.novel-system-ui.page-dashboard .content {padding-top:var(--nu-page-y)!important;}

  /* Common vertical rhythm. */
  body.gl-shell-v1.novel-system-ui :is(.flash,.notice,.readonly-notice,.error-list) {
    margin:0 0 var(--nu-stack)!important;padding:9px 11px!important;
  }
  body.gl-shell-v1.novel-system-ui :is(.card,.settings-card,.settings-panel,.page-panel,.p2-panel,.p3-panel,
    .p6-card,.p8-panel,.fv-wrapper,.fv-form-wrapper,.ft-panel,.ft-card,.fc-panel,.ch-card,
    .ch-reference-grid,.ch-book-reference-grid,.ch-record-tabs) {
    margin-top:0!important;margin-bottom:var(--nu-stack)!important;
  }
  body.gl-shell-v1.novel-system-ui :is(.settings-card,.settings-panel,.page-panel,.p2-panel,.p8-panel,
    .fv-form-wrapper,.ft-panel,.ft-card,.fc-panel,.ch-card,.ch-reference-grid,.ch-book-reference-grid,.ch-record-tabs) {
    padding:var(--nu-panel-pad)!important;
  }
  body.gl-shell-v1.novel-system-ui :is(.card h1,.card h2,.card h3,.settings-card h1,.settings-card h2,.settings-card h3,
    .settings-panel h1,.settings-panel h2,.settings-panel h3,.page-panel h1,.page-panel h2,.page-panel h3) {
    margin-top:0!important;margin-bottom:8px!important;
  }

  /* Forms and field groups: labels stay attached to their controls. */
  body.gl-shell-v1.novel-system-ui :is(.form-stack,.settings-section .form-stack) {gap:var(--nu-stack)!important;}
  body.gl-shell-v1.novel-system-ui :is(.form-grid,.provider-form-grid,.provider-fields,.account-identity,.plugin-grid,
    .chart-grid,.currency-management,.accounting-settings-grid,.gl-general-layout,.p2-date-pair,.p2-closure-search,
    .p2-details,.p6-grid,.p6-basic-grid,.p6-columns,.p6-summary,.p8-field-row,.p8-fields,.p8-direct-panel .p8-fields,
    .p9-grid,.fv-form-grid,.fv-filter-grid,.fv-tax-grid,.ft-search-grid,.ft-form-grid,.ft-transfer-columns,
    .ft-transfer-extra,.ft-inline-filter,.ft-overview,.ft-import-content,.fc-filter-grid,.fc-fields,.fc-details,
    .ch-dashboard,.ch-filter-grid,.ch-template-category-grid,.ch-designer-layout,.ch-book-info-grid,
    .ch-cheque-info-grid,.ch-variable-modal-body,.ch-book-filter-grid,.ch-reference-gallery,
    .identity-content .form-columns,.identity-content .form-main,.identity-content .stat-grid,
    .identity-content .security-grid) {
    gap:var(--nu-grid-row) var(--nu-grid-col)!important;
  }
  body.gl-shell-v1.novel-system-ui label {margin-block:0!important;}
  body.gl-shell-v1.novel-system-ui label > :is(input,select,textarea,.nui-select-trigger) {margin-top:4px!important;}
  body.gl-shell-v1.novel-system-ui :is(.help,.muted,.p2-help,.p6-help,.fv-help,.ft-help,.fc-muted,.ch-muted) {
    margin-top:3px!important;margin-bottom:5px!important;line-height:1.55!important;
  }

  /* Settings: compact navigation and remove double padding around content. */
  body.gl-shell-v1.novel-system-ui .settings-tab {padding:10px 11px!important;gap:8px!important;align-items:center!important;}
  body.gl-shell-v1.novel-system-ui .settings-tab .icon {width:20px!important;height:20px!important;margin-top:0!important;}
  body.gl-shell-v1.novel-system-ui .settings-tab strong {font-size:13px!important;margin-bottom:2px!important;}
  body.gl-shell-v1.novel-system-ui .settings-tab .help {font-size:11px!important;line-height:1.4!important;}
  body.gl-shell-v1.novel-system-ui .chart-grid {padding:10px 12px!important;}

  /* Accounting families. */
  body.gl-shell-v1.novel-system-ui .gl-hub-grid {max-width:none!important;column-gap:12px!important;row-gap:10px!important;margin:0!important;}
  body.gl-shell-v1.novel-system-ui .p2-general-form .p2-panel {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui .p4-head-grid {gap:10px!important;margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui .p4-document {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui .p5-allocation-space {padding-top:8px!important;}
  body.gl-shell-v1.novel-system-ui .p6-card {margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui :is(.p6-grid,.p6-basic-grid) {padding:10px 12px!important;}
  body.gl-shell-v1.novel-system-ui .p6-notes {padding:9px 12px!important;}
  body.gl-shell-v1.novel-system-ui .p6-dropzone {padding:12px 8px!important;min-height:58px!important;}
  body.gl-shell-v1.novel-system-ui .p6-empty {min-height:120px!important;padding:var(--nu-empty-pad)!important;}
  body.gl-shell-v1.novel-system-ui .p6-policy {margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui .p8-main {padding-inline:0!important;}
  body.gl-shell-v1.novel-system-ui .p8-panel {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui .p8-rail {margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui .p9-filter-bottom {margin-top:10px!important;}
  body.gl-shell-v1.novel-system-ui .p9-report-caption {margin:10px 0 12px!important;padding:9px!important;}
  body.gl-shell-v1.novel-system-ui .p9-pagination {padding:9px 5px!important;margin:0!important;}
  body.gl-shell-v1.novel-system-ui .p9-spacer td {height:10px!important;}
  body.gl-shell-v1.novel-system-ui .p9-empty {padding:var(--nu-empty-pad)!important;}

  /* Finance vouchers: forms should fill the usable workspace, not a 1000px island. */
  body.gl-shell-v1.novel-system-ui.novel-vouchers :is(.fv-form-wrapper,.fv-show) {
    width:100%!important;max-width:none!important;margin-inline:0!important;
  }
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-wrapper {padding:0!important;max-width:none!important;}
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper {padding:12px!important;margin-top:0!important;}
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-grid {row-gap:10px!important;}
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper .fv-lines {margin-top:10px!important;}
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper .fv-tax-seller {margin-top:8px!important;max-width:none!important;}
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-totals {max-width:none!important;margin:4px 0 10px!important;}

  /* Treasury / bank / custody. */
  body.gl-shell-v1.novel-system-ui.ft-app .ft-page {max-width:none!important;margin:0!important;padding:0 0 18px!important;}
  body.gl-shell-v1.novel-system-ui.ft-app .ft-master-form {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui.ft-app .ft-overview {padding:8px 12px 12px!important;}
  body.gl-shell-v1.novel-system-ui.ft-app .ft-import-page {max-width:none!important;}
  body.gl-shell-v1.novel-system-ui.ft-app .ft-import-steps {padding:10px 12px!important;margin:6px 0 10px!important;}
  body.gl-shell-v1.novel-system-ui.fc-app .fc-page {max-width:none!important;margin:0!important;padding:0 0 18px!important;}
  body.gl-shell-v1.novel-system-ui.fc-app :is(.fc-document,.fc-form,.fc-settlement-summary) {margin-bottom:10px!important;}

  /* Cheques: P7.1 had several 1024/1120px caps and oversized cards. */
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace :is(.content-inner,.toolbar-inner) {max-width:none!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace .accounting-content {padding:var(--nu-page-y) var(--nu-page-x) 24px!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace .page-toolbar {height:var(--nu-toolbar-h)!important;min-height:var(--nu-toolbar-h)!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace :is(.ch-reference-grid,.ch-book-reference-grid) {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace :is(.ch-book-info-grid,.ch-cheque-info-grid) {padding:10px 8px!important;gap:10px 12px!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace .ch-record-tabs {padding:8px!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace .ch-record-tabs .ch-detail-layout {padding:8px!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace .ch-reference-gallery {gap:12px!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace .ch-book-filter-grid {gap:10px 12px!important;}
  body.gl-shell-v1.novel-system-ui.ch-designer-app .ch-design-canvas {padding:10px 0!important;}

  /* Identity / branches / permissions. */
  body.gl-shell-v1.novel-system-ui.access-in-settings .content-inner {max-width:none!important;}
  body.gl-shell-v1.novel-system-ui .identity-content .panel-body {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui .identity-content .branch-card {gap:10px!important;}
  body.gl-shell-v1.novel-system-ui .identity-content .empty-state {padding:var(--nu-empty-pad)!important;}
  body.gl-shell-v1.novel-system-ui .identity-content .welcome-banner {padding:14px!important;margin-bottom:10px!important;gap:12px!important;}
  body.gl-shell-v1.novel-system-ui .identity-content .planned-note {margin:0 0 10px!important;padding:8px 10px!important;}

  /* Empty states across families must not create a half-screen blank block. */
  body.gl-shell-v1.novel-system-ui :is(.empty,.empty-state,.p5-empty-center,.ft-empty,.fc-empty,.ch-empty,.fv-empty) {
    padding:var(--nu-empty-pad)!important;min-height:0!important;margin-block:0 var(--nu-stack)!important;
  }

  /* Tables and pagination use the same compact rhythm. */
  body.gl-shell-v1.novel-system-ui :is(table th,table td,.table th,.table td,.data-table th,.data-table td,
    .p6-table th,.p6-table td,.p9-table th,.p9-table td) {padding:7px 9px!important;}
  body.gl-shell-v1.novel-system-ui :is(.pagination,.p4-pagination,.p5-pagination,.ft-pagination,.fc-pagination,.ch-pagination) {
    margin-top:8px!important;padding-block:6px!important;gap:6px!important;
  }

  /* Dialogs: eliminate the second large whitespace system. */
  body.gl-shell-v1.novel-system-ui dialog:not(.fin-print-dialog) {padding:14px!important;}
  body.gl-shell-v1.novel-system-ui dialog :is(.dialog-head,.dialog-header) {margin-bottom:8px!important;}
  body.gl-shell-v1.novel-system-ui dialog :is(.dialog-actions,footer) {margin-top:10px!important;gap:7px!important;}

  /* Auth is a separate composition, but its internal spacing follows the same scale. */
  body.auth-body.novel-system-ui .auth-form-area {padding:24px clamp(20px,4vw,48px)!important;}
  body.auth-body.novel-system-ui .auth-card {padding:14px 0!important;}
  body.auth-body.novel-system-ui :is(.auth-description,.login-tabs,.first-login-note,.auth-top-label) {margin-bottom:14px!important;}
  body.auth-body.novel-system-ui .auth-note {margin-top:14px!important;}
}

@media screen and (max-width:800px) {
  :root {--nu-page-x:8px;--nu-page-y:8px;--nu-page-bottom:16px;--nu-toolbar-h:44px;--nu-panel-pad:10px;--nu-grid-row:8px;--nu-grid-col:8px;}
  body.gl-shell-v1.novel-system-ui .toolbar-inner {width:calc(100% - 16px)!important;}
  body.gl-shell-v1.novel-system-ui .settings-tab {padding:8px 7px!important;}
  body.gl-shell-v1.novel-system-ui .settings-tab .help {display:none!important;}
  body.gl-shell-v1.novel-system-ui :is(.settings-card,.settings-panel,.page-panel,.p2-panel,.p8-panel,
    .fv-form-wrapper,.ft-panel,.ft-card,.fc-panel,.ch-card,.ch-reference-grid,.ch-book-reference-grid,.ch-record-tabs) {padding:10px!important;}
  body.gl-shell-v1.novel-system-ui .p6-basic-grid {padding:9px!important;}
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace .ch-reference-actionbar {padding:6px!important;gap:5px!important;}
}

/* P7.3 audit fixes discovered by the all-preview density pass. */
@media screen {
  body.gl-shell-v1.novel-system-ui .card {padding:var(--nu-panel-pad)!important;}
  body.gl-shell-v1.novel-system-ui :is(.ch-form-grid) {gap:var(--nu-grid-row) var(--nu-grid-col)!important;}
  body.gl-shell-v1.novel-system-ui.reference-settings-original.page-smtp .content-inner {transform:none!important;}
}
@media screen {
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace .ch-ui-form :is(.ch-reference-grid,.ch-book-reference-grid,.ch-form-grid) {
    gap:var(--nu-grid-row) var(--nu-grid-col)!important;
  }
}

/* P7.3 deep spacing pass — structural gaps found after the first all-preview audit. */
@media screen {
  /* Finance voucher rows: switches must not reserve a 60px blank row. */
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-toggle-field {
    min-height:38px!important;padding-top:0!important;align-items:center!important;justify-content:flex-start!important;align-self:end!important;
  }
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-field {gap:4px!important;}
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-file-box {min-height:62px!important;padding:8px 10px!important;gap:10px!important;}
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-extended {margin-top:0!important;margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-extended>summary {min-height:38px!important;padding:8px 10px!important;}

  /* General-ledger settings had a second, much looser spacing system. */
  body.gl-shell-v1.novel-system-ui .gl-settings-panel {padding:12px!important;margin-bottom:10px!important;scroll-margin-top:90px!important;}
  body.gl-shell-v1.novel-system-ui .gl-field-block {margin-top:10px!important;}
  body.gl-shell-v1.novel-system-ui .gl-section-link {padding:9px 11px!important;min-height:40px!important;}
  body.gl-shell-v1.novel-system-ui .journal-results-title {margin-top:10px!important;}
  body.gl-shell-v1.novel-system-ui.gl-phase3-page.gl-original-skin .p3-branch-form {min-height:46px!important;}
  body.gl-shell-v1.novel-system-ui.gl-phase3-page.gl-original-skin .p3-accounts>li {min-height:44px!important;padding-block:6px!important;}
  body.gl-shell-v1.novel-system-ui.gl-phase3-page.gl-original-skin .p3-add {min-height:40px!important;padding:7px 4px!important;}

  /* Payment/settings cards: title/footer heights are content-driven, not fixed whitespace. */
  body.gl-shell-v1.novel-system-ui.page-payments :is(.gateway-title,.gateway-footer) {min-height:0!important;}
  body.gl-shell-v1.novel-system-ui.page-payments .gateway-title {padding:10px 12px!important;}
  body.gl-shell-v1.novel-system-ui.page-payments .gateway-footer {padding:7px 10px!important;}
  body.gl-shell-v1.novel-system-ui.page-payments .gateway-group-title {margin-top:10px!important;}

  /* Identity/branches/access screens. */
  body.gl-shell-v1.novel-system-ui .identity-content .form-actions {margin-top:10px!important;gap:7px!important;}
  body.gl-shell-v1.novel-system-ui .identity-content .save-bar {padding:10px 12px!important;margin-top:10px!important;gap:10px!important;border-radius:var(--nu-radius)!important;}
  body.gl-shell-v1.novel-system-ui .identity-content .stat-grid {margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui .identity-content :is(.alert,.info-strip,.invite-delivery) {padding:10px 12px!important;margin-bottom:10px!important;border-radius:var(--nu-radius)!important;}
  body.gl-shell-v1.novel-system-ui .identity-content .workspace-tile>span:last-child:not(.tile-icon) {margin-top:8px!important;}

  /* Custom-field designer: preserve editor affordances while removing oversized internal whitespace. */
  body.gl-shell-v1.novel-system-ui .cf7-builder-grid {gap:8px!important;padding:8px!important;}
  body.gl-shell-v1.novel-system-ui .cf7-canvas {padding:10px!important;}
  body.gl-shell-v1.novel-system-ui .cf7-property-form {padding:10px 12px!important;}
  body.gl-shell-v1.novel-system-ui .cf7-section-title {margin:8px -12px 10px!important;}
  body.gl-shell-v1.novel-system-ui .cf7-prop {margin:4px 0 9px!important;}
  body.gl-shell-v1.novel-system-ui .cf7-fields {gap:10px 0!important;}
  body.gl-shell-v1.novel-system-ui .cf7-field {padding:12px 16px 10px!important;margin-bottom:5px!important;}
  body.gl-shell-v1.novel-system-ui .cf7-empty-drop {min-height:80px!important;}
  body.gl-shell-v1.novel-system-ui .cf7-child-fields {min-height:70px!important;padding:12px 6px 4px!important;gap:10px 0!important;}
  body.gl-shell-v1.novel-system-ui .cf7-rich-skeleton {height:320px!important;padding:24px 28px!important;}

  /* Auth screens are part of the same product density. */
  body.auth-body.novel-system-ui :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select) {
    min-height:40px!important;height:40px!important;padding:8px 10px!important;border-radius:var(--nu-radius)!important;
  }
  body.auth-body.novel-system-ui .button.wide {min-height:40px!important;border-radius:var(--nu-radius)!important;}
  body.auth-body.novel-system-ui .auth-emblem {margin-bottom:12px!important;}
  body.auth-body.novel-system-ui .auth-footer {margin-top:14px!important;padding-top:12px!important;}
  body.auth-body.novel-system-ui .tenant-choices {gap:8px!important;margin-bottom:12px!important;}
  body.auth-body.novel-system-ui .story-content>p {margin-bottom:18px!important;}
  body.auth-body.novel-system-ui .auth-modules {margin-top:18px!important;}
}

/* P7.3 full-canvas pass — remove nested narrow workspaces that caused large dead bands. */
@media screen {
  /* Settings */
  body.gl-shell-v1.novel-system-ui :is(.form-narrow,.numbering-form,.settings-section,.payment-panel,.smtp-panel,
    .sms-provider-form,.plugins-form,.api-dashboard,.account-card,.branch-settings-card) {
    width:100%!important;max-width:none!important;margin-inline:0!important;
  }
  body.gl-shell-v1.novel-system-ui .section {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui .grid {gap:10px 12px!important;}
  body.gl-shell-v1.novel-system-ui .form-actions {margin-top:10px!important;padding-top:0!important;gap:7px!important;}
  body.gl-shell-v1.novel-system-ui .inline-info {padding:10px 12px!important;gap:10px!important;margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui .inline-info>.icon {width:32px!important;height:32px!important;}
  body.gl-shell-v1.novel-system-ui .disclosure {margin-top:8px!important;}
  body.gl-shell-v1.novel-system-ui .settings-body>fieldset {gap:10px!important;}
  body.gl-shell-v1.novel-system-ui .settings-section {padding:14px!important;scroll-margin-top:90px!important;}
  body.gl-shell-v1.novel-system-ui .settings-section>.help {margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui .numbering-form {padding:14px!important;}
  body.gl-shell-v1.novel-system-ui .numbering-form>fieldset,
  body.gl-shell-v1.novel-system-ui .numbering-fields {gap:10px!important;}
  body.gl-shell-v1.novel-system-ui .numbering-form h2 {font-size:18px!important;}
  body.gl-shell-v1.novel-system-ui .numbering-nav-head {height:44px!important;padding-inline:12px!important;}
  body.gl-shell-v1.novel-system-ui .numbering-nav [data-numbering-items] a {min-height:42px!important;padding:9px 12px!important;gap:8px!important;}
  body.gl-shell-v1.novel-system-ui .logo-zone {padding:10px!important;gap:7px!important;}
  body.gl-shell-v1.novel-system-ui .logo-drop {min-height:70px!important;gap:9px!important;}
  body.gl-shell-v1.novel-system-ui .logo-drop :is(.logo-placeholder,.logo-preview) {width:62px!important;height:62px!important;}
  body.gl-shell-v1.novel-system-ui .provider-form-grid {gap:12px!important;grid-template-columns:minmax(220px,30%) minmax(0,1fr)!important;}
  body.gl-shell-v1.novel-system-ui .provider-fields {gap:10px!important;}
  body.gl-shell-v1.novel-system-ui :is(.provider-help.whatsapp-help,.provider-help.smsmisr-help,.provider-help.twilio-help) {min-height:0!important;}
  body.gl-shell-v1.novel-system-ui .provider-status {margin-top:8px!important;}
  body.gl-shell-v1.novel-system-ui .account-card {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui .account-identity {gap:10px!important;}
  body.gl-shell-v1.novel-system-ui .account-details {gap:9px!important;}
  body.gl-shell-v1.novel-system-ui .usage-summary {gap:10px!important;margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui .usage-note {margin-top:8px!important;}
  body.gl-shell-v1.novel-system-ui .plugin-grid {gap:10px!important;}
  body.gl-shell-v1.novel-system-ui .plugin-group {padding-bottom:8px!important;}
  body.gl-shell-v1.novel-system-ui .drawer .field {margin-bottom:9px!important;}
  body.gl-shell-v1.novel-system-ui .drawer form {padding-bottom:64px!important;}
  body.gl-shell-v1.novel-system-ui .drawer-logo {min-height:64px!important;margin-bottom:8px!important;}

  /* General ledger / reports / setup */
  body.gl-shell-v1.novel-system-ui.accounting-shell :is(.narrow,.gl-general-form,.p5-narrow,.p6-location-form) {
    width:100%!important;max-width:none!important;margin-inline:0!important;
  }
  body.gl-shell-v1.novel-system-ui.accounting-shell .accounting-settings-grid {max-width:none!important;margin:10px 0!important;gap:10px!important;}
  body.gl-shell-v1.novel-system-ui.gl-phase2-page .p2-general-form .p2-panel,
  body.gl-shell-v1.novel-system-ui.gl-phase2-page :is(.p2-fiscal-panel,.p2-closure-panel,.p2-search-panel,.p2-list-panel) {
    width:100%!important;max-width:none!important;margin:0 0 10px!important;
  }
  body.gl-shell-v1.novel-system-ui.gl-phase2-page .p2-general-form {padding-inline:0!important;}
  body.gl-shell-v1.novel-system-ui.gl-phase2-page .p2-fiscal-fields {margin-top:10px!important;}
  body.gl-shell-v1.novel-system-ui.gl-phase2-page .p2-rail {margin-bottom:10px!important;}

  /* Treasury / bank */
  body.gl-shell-v1.novel-system-ui.ft-app :is(.ft-master-form,.ft-details-card,.ft-transfer-form,.ft-error) {
    width:100%!important;max-width:none!important;margin-inline:0!important;
  }
  body.gl-shell-v1.novel-system-ui.ft-app .ft-master-form {margin-top:0!important;margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui.ft-app .ft-details-card {margin-bottom:10px!important;}
  body.gl-shell-v1.novel-system-ui.ft-app .ft-error {margin-block:0 10px!important;}

  /* Cheques and finance reversal cards */
  body.gl-shell-v1.novel-system-ui.ch-reference-workspace :is(.ch-page-narrow,.ch-reference-detail) {
    width:100%!important;max-width:none!important;margin-inline:0!important;padding-top:0!important;
  }
  body.gl-shell-v1.novel-system-ui :is(.f63-transfer-card) {width:100%!important;max-width:none!important;margin-inline:0!important;}
  body.gl-shell-v1.novel-system-ui .f63-transfer-heading {padding:12px!important;}
  body.gl-shell-v1.novel-system-ui .f63-transfer-pair {padding:12px!important;gap:10px!important;}
  body.gl-shell-v1.novel-system-ui .f63-transfer-pair section {padding:12px!important;gap:8px!important;}
  body.gl-shell-v1.novel-system-ui :is(.f63-transfer-meta,.f63-reversal-evidence) {padding:10px 12px!important;}
  body.gl-shell-v1.novel-system-ui .f63-reverse-panel {margin:10px 0!important;}
}

@media screen and (max-width:800px) {
  body.gl-shell-v1.novel-system-ui .provider-form-grid {grid-template-columns:1fr!important;}
  body.gl-shell-v1.novel-system-ui .numbering-form,
  body.gl-shell-v1.novel-system-ui .settings-section {padding:10px!important;}
}

/* P7.4 compact finance voucher extended fields.
 * Keep seller and posting treasury on the same desktop row. This restores the
 * reference geometry while reducing vertical dead space introduced by the
 * global full-width density pass. */
@media screen and (min-width:561px) {
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper .fv-extended-content {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px 12px!important;
  }
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper .fv-extended-content > .fv-tax-grid {
    grid-column:1 / -1!important;
  }
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper .fv-tax-seller,
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper .fv-posting-treasury {
    margin-top:0!important;
    max-width:none!important;
    min-width:0!important;
  }
}
@media screen and (max-width:560px) {
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper .fv-extended-content {
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  body.gl-shell-v1.novel-system-ui.novel-vouchers .fv-form-wrapper .fv-extended-content > .fv-tax-grid {
    grid-column:1!important;
  }
}

/* P7.8 mobile canvas guard.
 * Some off-canvas navigation implementations translate a fixed sidebar just
 * beyond the viewport. Chromium can still include that transformed edge in
 * document scrollWidth, producing a 1-2px horizontal page scroll even though
 * the form itself fits correctly. Keep page-level overflow clipped/hidden;
 * data tables and designer canvases retain their own local scrollers. */
@media screen and (max-width:760px) {
  html {
    overflow-x:hidden!important;
  }
  body.gl-shell-v1.novel-system-ui {
    overflow-x:hidden!important;
    max-width:100%!important;
  }
}

/* P7.8 simple file controls.
 * Dropzones keep their intentionally larger upload surface. Ordinary file
 * inputs now share the same control geometry as other fields across Settings,
 * GL, Finance and Cheques. */
body.gl-shell-v1.novel-system-ui label:not(.fin-dropzone):not(.fv-file-box):not(.ch-upload-zone):not(.p6-dropzone):not(.upload-zone) > input[type=file] {
  display:block;
  width:100%!important;
  max-width:100%!important;
  min-height:38px!important;
  height:38px!important;
  margin-top:5px;
  padding:4px 6px!important;
  border:1px solid var(--nu-border)!important;
  border-radius:var(--nu-radius)!important;
  background:var(--nu-panel)!important;
  color:var(--nu-text)!important;
  font:inherit!important;
  box-shadow:none!important;
}
body.gl-shell-v1.novel-system-ui label:not(.fin-dropzone):not(.fv-file-box):not(.ch-upload-zone):not(.p6-dropzone):not(.upload-zone) > input[type=file]::file-selector-button {
  min-height:28px;
  margin-inline-end:8px;
  padding:4px 10px;
  border:0;
  border-radius:2px;
  background:#EDF3F8;
  color:#42566F;
  font:inherit;
  cursor:pointer;
}
body.gl-shell-v1.novel-system-ui label:not(.fin-dropzone):not(.fv-file-box):not(.ch-upload-zone):not(.p6-dropzone):not(.upload-zone) > input[type=file]:focus-visible {
  border-color:var(--nu-primary)!important;
  outline:0!important;
  box-shadow:var(--nu-focus)!important;
}
@media screen and (max-width:800px) {
  body.gl-shell-v1.novel-system-ui label:not(.fin-dropzone):not(.fv-file-box):not(.ch-upload-zone):not(.p6-dropzone):not(.upload-zone) > input[type=file] {
    min-height:40px!important;
    height:40px!important;
  }
}

/* P7.8 compact interactive targets: keep utility links visually light while
 * giving them a consistent, usable hit area across every completed module. */
body.gl-shell-v1.novel-system-ui .gl-top-link,
body.gl-shell-v1.novel-system-ui button.fc-link {
  min-height:28px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
body.gl-shell-v1.novel-system-ui .gl-top-link {padding:3px 2px!important;}
body.gl-shell-v1.novel-system-ui button.fc-link {padding:4px 8px!important;}
@media screen and (max-width:800px) {
  body.gl-shell-v1.novel-system-ui .gl-top-link,
  body.gl-shell-v1.novel-system-ui button.fc-link {min-height:32px!important;}
}

/* P7.8 full-system audit: compact controls keep the visual density but expose
 * a consistent hit target. Icons remain visually small; the interactive box
 * is large enough for keyboard/touch use without changing workflow logic. */
body.gl-shell-v1.novel-system-ui .p3-expand {
  min-width:24px!important;
  min-height:24px!important;
  width:24px!important;
  height:24px!important;
}
body.gl-shell-v1.novel-system-ui .gl-phase3-page .p3-expand {
  right:calc((var(--p3-depth) - 1)*15px - 13px)!important;
}
body.gl-shell-v1.novel-system-ui .p4-lines .p4-expand-cell,
body.gl-shell-v1.novel-system-ui .p4-lines .p4-remove-cell {
  width:32px!important;
  min-width:32px!important;
}
body.gl-shell-v1.novel-system-ui .p4-lines .p4-expand-cell button,
body.gl-shell-v1.novel-system-ui .p4-lines .p4-remove-cell button {
  min-width:30px!important;
  min-height:32px!important;
}
body.gl-shell-v1.novel-system-ui .gl-phase2-closures .p2-search-heading,
body.gl-shell-v1.novel-system-ui .p4-advanced-toggle,
body.gl-shell-v1.novel-system-ui .identity-content .text-button {
  min-height:28px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
body.gl-shell-v1.novel-system-ui .gl-phase2-closures .p2-search-heading,
body.gl-shell-v1.novel-system-ui .p4-advanced-toggle {
  padding:4px 6px!important;
}
body.gl-shell-v1.novel-system-ui.ch-designer-app .ch-wysiwyg-tools button,
body.gl-shell-v1.novel-system-ui.ch-designer-app .ch-wysiwyg-tools .nui-select-trigger,
body.gl-shell-v1.novel-system-ui.ch-designer-app .ch-wysiwyg-tools select {
  min-height:28px!important;
  height:28px!important;
}
body.gl-shell-v1.novel-system-ui.ch-designer-app .ch-wysiwyg-tools button {
  min-width:28px!important;
}
@media (max-width:800px) {
  body.gl-shell-v1.novel-system-ui .p3-expand,
  body.gl-shell-v1.novel-system-ui .p4-lines .p4-expand-cell button,
  body.gl-shell-v1.novel-system-ui .p4-lines .p4-remove-cell button,
  body.gl-shell-v1.novel-system-ui .gl-phase2-closures .p2-search-heading,
  body.gl-shell-v1.novel-system-ui .p4-advanced-toggle,
  body.gl-shell-v1.novel-system-ui .identity-content .text-button,
  body.gl-shell-v1.novel-system-ui.ch-designer-app .ch-wysiwyg-tools button,
  body.gl-shell-v1.novel-system-ui.ch-designer-app .ch-wysiwyg-tools .nui-select-trigger,
  body.gl-shell-v1.novel-system-ui.ch-designer-app .ch-wysiwyg-tools select {
    min-height:32px!important;
  }
}

/* P7.8 audit: icon-only actions retain compact artwork but no longer expose
 * sub-28px click targets. */
body.gl-shell-v1.novel-system-ui .gl-top-link {
  min-width:32px!important;
}
body.gl-shell-v1.novel-system-ui .gl-phase3-page .p3-search button {
  width:32px!important;
  min-width:32px!important;
  height:32px!important;
  min-height:32px!important;
  left:5px!important;
  top:5px!important;
  padding:4px 8px!important;
}

/* P7.8 full style contract: primary actions keep the same vertical rhythm even
 * inside cheque record action bars and the Settings warehouse workspace. */
@media screen and (min-width:801px) {
  body.gl-shell-v1.novel-system-ui .ch-reference-actionbar .ch-btn {
    min-height:36px!important;
    height:36px!important;
    padding:5px 10px!important;
  }
  body.gl-shell-v1.novel-system-ui.gl-warehouse-page .btn-primary {
    min-height:36px!important;
    height:36px!important;
    padding:5px 13px!important;
  }
}
@media screen and (max-width:800px) {
  body.gl-shell-v1.novel-system-ui .ch-reference-actionbar .ch-btn,
  body.gl-shell-v1.novel-system-ui.gl-warehouse-page .btn-primary {
    min-height:38px!important;
    height:38px!important;
  }
}

/* P7.8 final audit corrections: phase classes live on <body>, so selectors
 * must target the body itself rather than look for an impossible descendant. */
body.gl-shell-v1.novel-system-ui.gl-phase3-page .p3-search button {
  width:32px!important;
  min-width:32px!important;
  height:32px!important;
  min-height:32px!important;
  left:5px!important;
  top:5px!important;
  padding:4px 8px!important;
}
body.gl-shell-v1.novel-system-ui.gl-phase2-closures .p2-search-heading {
  min-width:32px!important;
  min-height:28px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:4px 6px!important;
}
@media (max-width:800px) {
  body.gl-shell-v1.novel-system-ui.gl-phase2-closures .p2-search-heading {
    min-height:32px!important;
  }
}

/* Native file inputs used inside styled upload zones are intentionally
 * visually hidden. Global input sizing must not expand the hidden element
 * and create a stray clickable sliver. The wrapping label is the hit target. */
body.gl-shell-v1.novel-system-ui.ch-app .ch-reference-form .ch-attachments .ch-upload-zone input[type=file] {
  position:absolute!important;
  inline-size:1px!important;
  block-size:1px!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  min-height:1px!important;
  padding:0!important;
  margin:-1px!important;
  opacity:0!important;
  overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
}
