#document-types { padding:16px; }
#documentTypeLegacyContext[hidden] { display:none !important; }
.document-definition-shell { display:grid; grid-template-columns:260px minmax(0,1fr); gap:16px; min-height:calc(100dvh - 210px); font-family:var(--ui-font); font-size:var(--erp-font-control,12px); line-height:1.35; zoom:.85; }
.document-definition-nav { background:var(--erp-surface); border:1px solid var(--erp-border); border-radius:var(--erp-radius-md); padding:8px; min-width:0; }
.document-definition-nav button { display:block; width:100%; min-height:28px; padding:5px 8px; border:0; border-radius:4px; background:transparent; color:inherit; text-align:left; font:inherit; cursor:pointer; overflow-wrap:anywhere; }
.document-definition-nav .document-definition-group-button { font-weight:700; margin:2px 0; }
.document-definition-group-button[aria-expanded]::after { content:"⌄"; float:right; }
.document-definition-group-button[aria-expanded="false"]::after { content:"›"; }
.document-definition-children { margin:2px 0 8px 12px; padding-left:8px; border-left:1px solid var(--erp-border); }
.document-definition-nav button:hover { background:var(--erp-surface-muted); }
.document-definition-nav button[aria-current="page"] { background:var(--erp-surface-muted); box-shadow:inset 3px 0 var(--erp-accent); font-weight:700; }
.document-definition-nav button:focus-visible { outline:2px solid var(--erp-accent); outline-offset:1px; }
.document-definition-group.is-selected-group > .document-definition-group-button { color:var(--erp-accent); }
.document-definition-content { min-width:0; margin:0; }
.document-definition-content h2 { margin:0; font-size:15px; }
.document-definition-content .eyebrow { font-size:10px; letter-spacing:.6px; }
.document-definition-content .erp-panel-header { padding:16px; }
.document-definition-content .erp-panel-body { padding:16px; }
.document-definition-content .erp-panel-body p { margin:0; font-size:var(--erp-font-control,12px); }
.definition-preview-notice { padding:8px; border:1px solid var(--erp-border); background:var(--erp-surface-muted); margin-bottom:10px !important; }
.definition-save-toolbar { display:flex; gap:8px; margin-bottom:8px; }
.definition-save-toolbar .button { min-height:28px; padding:4px 12px; font-size:12px; }
.definition-preview-fields { border:0; padding:0; margin:0; min-width:0; }
.definition-layout-caption { font-size:12px; font-weight:700; padding:0 0 6px; }
.definition-grid-viewport { overflow:auto; min-height:280px; border:1px solid var(--erp-border); }
.definition-policy-grid { width:100%; min-width:1880px; height:max-content; table-layout:fixed; }
.definition-policy-grid thead, .definition-policy-grid tbody { height:auto; }
.definition-policy-grid thead tr, .definition-policy-grid th { height:32px; max-height:32px; }
.definition-policy-grid th { white-space:normal; overflow-wrap:anywhere; text-transform:none; letter-spacing:0; font-size:11px; line-height:1.15; padding:4px 3px; vertical-align:middle; box-sizing:border-box; }
.definition-policy-grid td { padding:3px 2px; }
.definition-policy-grid tr.is-active td { background:var(--erp-surface-muted); box-shadow:inset 0 -1px var(--erp-accent); }
.definition-policy-grid th:nth-child(1) { width:130px; }
.definition-policy-grid th:nth-child(2) { width:260px; }
.definition-policy-grid th:nth-child(3) { width:140px; }
.definition-policy-grid th:nth-child(4) { width:230px; }
.definition-policy-grid th:nth-child(5) { width:130px; }
.definition-policy-grid th:nth-child(6) { width:210px; }
.definition-policy-grid th:nth-child(7) { width:90px; }
.definition-policy-grid th:nth-child(8), .definition-policy-grid th:nth-child(9) { width:70px; }
.definition-policy-grid th:nth-child(10) { width:160px; }
.definition-policy-grid th:nth-child(11), .definition-policy-grid th:nth-child(12), .definition-policy-grid th:nth-child(13) { width:120px; }
.definition-preview-fields input:not([type=checkbox]), .definition-preview-fields select, .definition-preview-fields textarea { width:100%; min-width:0; min-height:0; box-sizing:border-box; font:inherit; color:inherit; border:1px solid var(--erp-border); background:var(--erp-surface); border-radius:4px; padding:3px 6px; height:28px; }
.definition-preview-fields input[type=checkbox] { width:16px; height:16px; min-height:0; padding:0; margin:0; flex-shrink:0; }
.definition-policy-grid td:has(input[type=checkbox]) { text-align:center; }
.stock-definition-grid { min-width:1240px; }
.stock-definition-grid th:nth-child(7) { width:210px; }
.stock-definition-grid th:nth-child(8) { width:70px; }
.stock-definition-grid th:nth-child(9) { width:110px; }
.stock-definition-grid.is-transfer th:nth-child(3), .stock-definition-grid.is-transfer th:nth-child(4) { width:210px; }
.stock-definition-grid.is-transfer th:nth-child(5) { width:230px; }
.stock-definition-grid.is-transfer th:nth-child(6) { width:130px; }
.stock-definition-grid [hidden] { display:none !important; }
.stock-definition-grid input:disabled, .stock-definition-grid select:disabled { opacity:.65; cursor:not-allowed; }
.definition-detail-panels { display:grid; grid-template-columns:minmax(0,2fr) minmax(160px,1fr); gap:20px; padding:12px 0; border-bottom:1px solid var(--erp-border); }
.definition-finance-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px 12px; }
.definition-finance-fields label { display:grid; gap:4px; font:inherit; }
.definition-ratio { display:flex; gap:6px; min-width:0; }
.definition-special-flags { display:grid; align-content:start; gap:10px; }
.definition-special-flags label, .definition-default-flags label { display:flex; align-items:center; gap:6px; font:inherit; }
.definition-default-flags { display:flex; flex-wrap:wrap; gap:10px 18px; padding:12px 0; }
.definition-default-flags input[type=checkbox] { width:16px; height:16px; min-width:16px; max-width:16px; min-height:16px; max-height:16px; flex:0 0 16px; padding:0; margin:0; accent-color:var(--erp-accent); }
.definition-default-flags label { width:auto; margin:0; min-height:24px; white-space:nowrap; font-weight:400; }
.definition-default-flags[hidden], .definition-default-flags label[hidden] { display:none !important; }
.definition-default-flags [data-selected-label] { flex-basis:100%; order:-1; padding-bottom:8px; border-bottom:1px solid var(--erp-border); color:var(--muted); font:inherit; overflow-wrap:anywhere; }
.definition-note { display:grid; gap:4px; font:inherit; }
.definition-preview-fields textarea { height:90px; resize:vertical; }
.account-definition-scope { max-width:620px; margin-bottom:12px; }
.account-definition-scope input, .account-definition-scope select { height:28px; min-height:0; padding:3px 6px; font:inherit; }
.account-definition-grid { width:100%; min-width:800px; table-layout:fixed; }
.account-definition-grid th { text-transform:none; letter-spacing:0; font-size:11px; }
.account-definition-grid th:nth-child(1) { width:160px; }
.account-definition-grid th:nth-child(2) { width:auto; }
.account-definition-grid th:nth-child(3) { width:220px; }
.account-definition-grid th:nth-child(4) { width:220px; }
.account-definition-source { margin:12px 0; max-width:650px; }
#accountDocumentDefinitionLayout .definition-save-toolbar { justify-content:flex-end; }
#saveAccountDefinitions { order:2; }
.definition-default-choice { display:flex; align-items:center; gap:8px; font-size:12px; margin:12px 0; }
.definition-default-choice input { width:16px; height:16px; min-height:0; }
.account-definition-grid td { padding:3px; }
.account-definition-grid tr.is-active td { background:var(--erp-surface-muted); box-shadow:inset 0 -1px var(--erp-accent); }
.account-definition-numbering { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin:12px 0; }
.account-definition-numbering h3 { font-size:14px; margin:0 0 8px; }
.account-definition-hint { color:var(--muted); }
@media(max-width:700px) { .account-definition-numbering, .account-definition-scope { grid-template-columns:minmax(0,1fr); } }
#definitionNoteHint { font-size:11px; margin-top:6px; }
@media (max-width:1000px) { .definition-detail-panels { grid-template-columns:minmax(0,1fr); } }
@media (max-width:700px) {
  .document-definition-shell { grid-template-columns:minmax(0,1fr); min-height:0; }
  .document-definition-content { min-height:220px; }
}
/* Simple account adjustments use the corporate definition grid and row default. */
#accountDocumentDefinitionLayout [hidden] {display:none!important;}
.account-definition-default {margin-top:12px;border-top:1px solid var(--erp-border);}
.account-definition-default small {flex-basis:100%;color:var(--muted);font-size:11px;overflow-wrap:anywhere;}
.account-definition-default .definition-default-choice {margin:0;}
#accountDocumentDefinitionLayout.is-adjustment .account-definition-grid {min-width:600px;}
#accountDocumentDefinitionLayout.is-adjustment .account-definition-grid th:nth-child(1) {width:160px;}
#accountDocumentDefinitionLayout.is-adjustment .account-definition-grid th:nth-child(4) {width:230px;}
#accountDocumentDefinitionLayout.is-adjustment .definition-grid-viewport {min-height:320px;}
.document-definition-content.is-account-adjustment-definition > .erp-panel-header {display:flex;align-items:center;justify-content:flex-start;gap:12px;}
.document-definition-content.is-account-adjustment-definition h2 {font-size:18px;}
.account-definition-heading-icon {display:grid;place-items:center;width:40px;height:40px;flex:none;border-radius:var(--erp-radius-md);background:linear-gradient(135deg,var(--erp-accent),var(--brand-navy));color:white;}
.account-definition-heading-icon svg {width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;}
/* The shared shell supplies the visible icon; retain the screen-owned node for its controller. */
.definition-head > .account-definition-heading-icon {display:none!important;}
.document-definition-content [hidden] {display:none!important;}
#accountDefinitionHeadingDescription {font-size:12px;color:var(--muted);margin:4px 0 0;}

.document-definition-shell {--erp-surface-muted:color-mix(in srgb,var(--erp-accent) 6%,var(--erp-surface));}
#accountDocumentDefinitionLayout.is-adjustment .definition-default-choice {color:var(--ink);}
